diff --git a/.fernignore b/.fernignore new file mode 100644 index 00000000..084a8ebb --- /dev/null +++ b/.fernignore @@ -0,0 +1 @@ +# Specify files that shouldn't be modified by Fern diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b7d6cdf4..00000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -**/*.php -lf diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 5c6efcd1..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve Square SDKs -title: '' -labels: '' -assignees: '' - ---- - -## **ATTENTION** -This issue template is for **bugs** or **documentation** errors in this SDK Repo. Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly. - -**Describe the bug** -A clear and concise description of what the bug is. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**To Reproduce** -Steps to reproduce the bug: -1. (step 1) -2. (step 2) -3. (step 3) -4. ... - -**Screenshots** -If applicable, add screenshots to help explain the bug. - -**Square SDK version** -For example: 17.2.x - -**Additional context** -Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index f38eff76..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Square Developer Forums - url: https://developer.squareup.com/forums - about: Public discussion threads for technical support, feature requests, api discussion, and all things related to square development. - - name: Square Developer Discord Server - url: https://discord.com/invite/squaredev - about: Community slack channel for real time support and conversations about building with square. - - name: Developer Support - url: https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68 - about: Private support directly with Square Developer Success Engineers. diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 1d486d97..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,21 +0,0 @@ - -# configuration settings for labeler - -version: v1 - -labels: - - label: "automerge" - sync: true - matcher: - title: "^Generated PR for Release:" - - - label: "automerge-author" - sync: true - matcher: - author: - - square-sdk-deployer - - - label: "automerge-branch" - sync: true - matcher: - branch: "^release" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 77bc5759..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,4 +0,0 @@ -# **ATTENTION** -This repository **cannot** accept Pull Requests. If you wish to proceed with opening this PR, please understand that your code **will not** be pulled into this repository. Consider opening an issue which lays out the problem instead. Thank you very much for your efforts and highlighting issues! - -Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..258bf33a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + + - name: Install tools + run: | + composer install + + - name: Build + run: | + composer build + + - name: Analyze + run: | + composer analyze + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + + - name: Install tools + run: | + composer install + + - name: Run Tests + run: | + composer test \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index 53565070..00000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - env: - SQUARE_ENVIRONMENT: sandbox - SQUARE_ACCESS_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }} - - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ["7.4", "8.0", "8.1"] - phpunit-versions: ["8.5.8"] - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:${{ matrix.phpunit-versions }} - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ matrix.php-versions }}- - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Run test suite - run: composer run test - - labeler: - needs: build - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: automerge-labeler - uses: fuxingloh/multi-labeler@v1 - - automerge: - needs: labeler - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: automerge - uses: "pascalgn/automerge-action@v0.14.2" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_LABELS: "automerge,automerge-branch,automerge-author" diff --git a/.gitignore b/.gitignore index 1d2fc34b..31a1aeb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -composer.phar -composer.lock -vendor/ +.idea +.php-cs-fixer.cache .phpunit.result.cache -coverage/ \ No newline at end of file +composer.lock +vendor/ \ No newline at end of file diff --git a/.phan/config.php b/.phan/config.php deleted file mode 100644 index bef4850b..00000000 --- a/.phan/config.php +++ /dev/null @@ -1,77 +0,0 @@ - '7.2', - - // A list of directories that should be parsed for class and - // method information. After excluding the directories - // defined in exclude_analysis_directory_list, the remaining - // files will be statically analyzed for errors. - // - // Thus, both first-party and third-party code being used by - // your application should be included in this list. - 'directory_list' => [ - 'src', - $vendor_dir . '/apimatic/unirest-php', - $vendor_dir . '/apimatic/jsonmapper' - ], - - // A directory list that defines files that will be excluded - // from static analysis, but whose class and method - // information should be included. - // - // Generally, you'll want to include the directories for - // third-party code (such as "vendor/") in this list. - // - // n.b.: If you'd like to parse but not analyze 3rd - // party code, directories containing that code - // should be added to both the `directory_list` - // and `exclude_analysis_directory_list` arrays. - 'exclude_analysis_directory_list' => [ - $vendor_dir - ], - - 'plugin_config' => [ - 'infer_pure_methods' => true - ], - - 'plugins' => [ - 'AlwaysReturnPlugin', - 'DuplicateArrayKeyPlugin', - 'PregRegexCheckerPlugin', - 'PrintfCheckerPlugin', - 'UnreachableCodePlugin', - 'InvokePHPNativeSyntaxCheckPlugin', - 'UseReturnValuePlugin', - 'EmptyStatementListPlugin', - 'LoopVariableReusePlugin', - 'RedundantAssignmentPlugin', - 'NonBoolBranchPlugin', - 'NonBoolInLogicalArithPlugin', - 'InvalidVariableIssetPlugin', - 'NoAssertPlugin', - 'DuplicateExpressionPlugin', - 'WhitespacePlugin', - 'PHPDocToRealTypesPlugin', - 'PHPDocRedundantPlugin', - 'PreferNamespaceUsePlugin', - 'StrictComparisonPlugin', - 'EmptyMethodAndFunctionPlugin', - 'DollarDollarPlugin', - 'AvoidableGetterPlugin' - ] -]; diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 034dc1e0..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,772 +0,0 @@ -# Change Log - -For general API and SDK changelogs, see [Square APIs and SDKs Release Notes](https://developer.squareup.com/docs/changelog/connect). - -## Version 19.0.1.20220512 (2022-05-12) -- Fixed [Op Cache can break response types](https://github.com/square/square-php-sdk/issues/80) - -## Version 17.3.0.20220316 (2022-03-16) -### Added - -* Now supports PHP 8.1 - - -## Version 17.0.0.20211215 (2021-12-15) -### API updates - -* **Invoices API:** - * The Invoices API now supports seller accounts in France. For more information, see [International availability and considerations.](https://developer.squareup.com/docs/invoices-api/overview#international-availability-invoices) - * France only: [`Invoice`](https://developer.squareup.com/reference/square_2021-12-15/objects/Invoice) object. Added a new `payment_conditions` field, which contains payment terms and conditions that are displayed on the invoice. This field is available only for sellers in France. For more information, see [Payment conditions.](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions) - - Square version 2021-12-15 or higher is required to set this field, but it is returned in `ListInvoices` and `RetrieveInvoice` requests for all Square versions. - -* **Cards API** - * Added the `CARD_DECLINED_VERIFICATION_REQUIRED` error code to the list of error codes returned by [CreateCard](https://developer.squareup.com/reference/square_2021-12-15/cards-api/CreateCard). -* **Catalog API:** - * [CreateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/create-catalog-image) endpoint - * Updated to support attaching multiple images to a [Catalogbject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) instance. - * Added `is_primary` option to let the caller choose to attach an image as the primary image on the object for display with the Square Point of Sale and other first-party Square applications. For more information, see [Upload and Attach Images.](https://developer.squareup.com/docs/catalog-api/upload-and-attach-images) - * [CatalogObject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) object - * Retired the `image_id` field, used to hold a single image object attached to an image-supporting object of the `ITEM`, `ITEM_VARIATION`, `CATEGORY`, or `MODIFIER_LIST` type, in Square API version 2021-12-15 and later, which supports attachment of multiple images. The `image_id` field is still supported in Square API version prior to 2021-12-15. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview) - * [CatalogItem](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItem), [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItemVariation), [CatalogCategory](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogCategory) or [CatalogModifierList](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogModifierList) object - * Added `image_ids` list to hold attached image objects. The first element of `image_ids` list refers to the primary image attached to the catalog object. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview) - * [UpdateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/update-catalog-image) endpoint - * Added to support replacing the image file encapsulated by an existing [CatalogImage](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogImage) object. For more information, see [Replace image file on a CatalogImage object.](https://developer.squareup.com/docs/catalog-api/manage-images#replace-the-image-file-of-a-catalogimage-object) - - * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule) object - * Added [minimum_order_subtotal_money](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule#definition__property-minimum_order_subtotal_money) field to require that the minimum order subtotal be reached before the pricing rule may be applied. - -### Documentation updates -* Added a new top-level node for Developer Tools. This node includes such features as Sandbox, API Logs, and Webhooks. -* Added [Webhook Event Logs (beta)](https://developer.squareup.com/docs/devtools/webhook-logs) documentation to the Developer Tools node. - - -## Version 16.0.0.20211117 (2021-11-17) -## API updates - -* **Cards API.** The [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/card) object and webhook response body for all webhooks are updated updated with fields. - * Added the [Card.merchant_id](https://developer.squareup.com/reference/square_2021-11-17/objects/Card#definition__property-merchant_id) field to identify the Square seller that stored the payment card on file. - * Added a [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/Card) object to the response bodies of all [Cards API webhooks](https://developer.squareup.com/docs/webhooks/v2webhook-events-tech-ref#cards-api). The `Card` is added as a child of the `data.object` field in all webhook responses. - -* **Bookings API.** The new [ListBookings](https://developer.squareup.com/reference/square_2021-11-17/bookings-api/list-bookings) endpoint supports browsing a collection of bookings of a seller. For more information, see [Use the Bookings API: list bookings.](https://developer.squareup.com/docs/bookings-api/use-the-api#list-bookings) - -* **Subscriptions API.** Introduced the new [actions framework](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) representing scheduled, future changes to subscriptions. - * The new [PauseSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/pause-subscription) endpoint supports temporarily pausing a subscription. Calling this endpoint schedules a new `PAUSE` action. - * The new [SwapPlan](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/swap-plan) endpoint supports changing the subscription plan associated with a single customer. Calling this endpoint schedules a new `SWAP_PLAN` action. - * The new [DeleteSubscriptionAction](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/delete-subscription-action) endpoint supports deleting a scheduled action. - * The [ResumeSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/resume-subscription) endpoint has been updated to support resuming a paused subscription. Calling this endpoint schedules a new `RESUME` action. - * The [CancelSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/cancel-subscription) endpoint now schedules a new `CANCEL` action. - * Added an optional `include` body parameter to the [SearchSubscriptions](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/search-subscriptions) endpoint. Include `actions` in the request to return all [actions](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) associated with the subscriptions. - -## Documentation Update - -* **Migration Guides.** - * [Migrate from the Connect V1 Refunds API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-refunds) The topic is updated to include information to migrate from the v1 ListRefunds endpoint to the appropriate Square API counterparts. - * [Migrate from the Connect V1 Payments API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-payments) The topic provides developers information to migrate from the Connect V1 Payments API to the appropriate Square API counterparts. - - Code that relies on these V1 API endpoints must be updated to avoid breaking when these APIs reach retirement. - - -## Version 15.0.0.20211020 (2021-10-20) -## API updates -* **Transactions API.** Three previously deprecated endpoints (`ListRefunds`, `Charge`, and `CreateRefund`) in the [Transactions API](https://developer.squareup.com/reference/square_2021-10-20/transactions-api) are removed from Square API version 2021-10-20 and later. These endpoints will work if you are using Square API versions prior to 2021-10-20. However, these endpoints will eventually be retired from all Square versions. - - * Instead of the Transactions API `Charge` endpoint, use the Payments API [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint. - * Instead of the Transactions API `CreateRefund` endpoint, use the Refunds API [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/refund-payment) endpoint. - * Instead of the Transactions API `ListRefunds` endpoint, use the Refunds API [ListPaymentRefund](https://developer.squareup.com/reference/square_2021-10-20/payments-api/list-payment-refunds) endpoint. - -* **Payments API:** - * [Payment](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment) object. - * Added the [device_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-device_details) read-only field to view details of the device used to take a payment. This `Payment`-level field provides device information for all types of payments. Previously, device details were only available for card payments (`Payment.card_details.device_details`), which is now deprecated. - * Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-team_member_id) that applications can use to view the ID of the [TeamMember](https://developer.squareup.com/reference/square_2021-10-20/objects/TeamMember) associated with the payment. Use this field instead of the `Payment.employee_id` field, which is now deprecated. - * Added the [application_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-application_details) read-only field to view details of the application that took the payment. - - * These `Payment` fields have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle) (GA) state:[tip_money](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-tip_money), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [delay_action](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_action), [delayed_until](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delayed_until), and [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier). - - * The [ACH Bank Transfer Payments](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments) feature has moved to the GA state. Accordingly, the [bank_account_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-bank_account_details) field (and its [BankAccountPaymentDetails](https://developer.squareup.com/reference/square_2021-10-20/objects/BankAccountPaymentDetails) type) are moved to the GA state. - * [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint. - * Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-team_member_id) request field to record the ID of the team member associated with the payment. - * The [accept_partial_authorization](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-accept_partial_authorization) request field has moved to the GA state. - * [CompletePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/complete-payment) endpoint. Added the `version_token` request field to support optimistic concurrency. For more information, see [Delayed capture of a card payment.](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment) - -* **Refunds API:** - * [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/refunds-api/refund-payment) endpoint. - * Added the `team_member_id` request field to record the ID of the team member associated with the refund. - * Added the `payment_version_token` request field to support optimistic concurrency. For more information, see [Refund Payment.](https://developer.squareup.com/docs/payments-api/refund-payments#optimistic-concurrency) - -* **Customers API:** - * [Customer](https://developer.squareup.com/reference/square_2021-10-20/objects/Customer) object. Added a new `tax_ids` field of the [CustomerTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/CustomerTaxIds) type, which can contain the EU VAT ID of the customer. This field is available only for customers of sellers in France, Ireland, or the United Kingdom. For more information, see [Customer tax IDs.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids) - - * [UpdateCustomer](https://developer.squareup.com/reference/square_2021-10-20/customers-api/update-customer) endpoint. The Customers API now returns a `400 BAD_REQUEST` error if the request body does not contain any fields. For earlier Square versions, the Customers API will continue to return a `200 OK` response along with the customer profile. For more information, see [Migration notes.](https://developer.squareup.com/docs/customers-api/what-it-does#migration-notes) - -* **Invoices API:** - * [InvoiceRecipient](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipient) object. Added a new, read-only `tax_ids` field of the [InvoiceRecipientTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipientTaxIds) type, which can contain the EU VAT ID of the invoice recipient. This field is available only for customers of sellers in Ireland or the United Kingdom. If defined, `tax_ids` is returned for all Square API versions. For more information, see [Invoice recipient tax IDs.](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids) - * Square now sends emails for test invoices that are published in the Sandbox environment. - -* **Catalog API:** - * [CatalogSubscriptionPlan.name](https://developer.squareup.com/reference/square_2021-10-20/objects/CatalogSubscriptionPlan#definition__property-name) can be updated after the subscription plan is created. The change is retroactively applicable to prior versions of the Square API. - -* **Subscriptions API:** - * The new [SubscriptionSource](https://developer.squareup.com/reference/square_2021-10-20/objects/SubscriptionSource) data type is introduced to encapsulate the source where a subscription is created. The new `SubscriptionSource.name` value is propagated to the `Order.source` attribute when an order is made on the subscription. The new feature is retroactively applicable to prior versions of the Square API. - * The new [Subscription.source](https://developer.squareup.com/reference/square_2021-10-20/objects/Subscription#definition__property-source) attribute is introduced to indicate the source where the subscription was created. This new feature is retroactively applicable to prior versions of the Square API. - * The new [SearchSubscriptionsFilter.source_names](https://developer.squareup.com/reference/square_2021-10-20/objects/SearchSubscriptionFilter#definition__property-source_names) query expression is introduced to enable search for subscriptions by the subscription source name. This new feature is retroactively applicable to prior versions of the Square API. - - -## Version 14.1.0.20210915 (2021-09-15) -## API updates - -* **Invoices API:** - * [Invoice](https://developer.squareup.com/reference/square_2021-09-15/objects/Invoice) object. Added a new, optional `sale_or_service_date` field used to specify the date of the sale or the date that the service is rendered. If specified, this date is displayed on the invoice. - -* **Orders API:** - * [CreateOrder](https://developer.squareup.com/reference/square_2021-09-15/orders-api/create-order). The endpoint now supports creating temporary, draft orders. For more information, see [Create a draft order.](https://developer.squareup.com/docs/orders-api/create-orders#create-a-draft-order) - * [CloneOrder](https://developer.squareup.com/reference/square_2021-09-15/orders-api/clone-order). The Orders API supports this new endpoint to clone an existing order. For more information, see [Clone an order.](https://developer.squareup.com/docs/orders-api/create-orders#clone-an-order) - * These fields have moved to the [general availability (GA)](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) state: [OrderLineItem.item_type](https://developer.squareup.com/reference/square_2021-09-15/objects/OrderLineItem#definition__property-item_type), [OrderServiceCharge.type](https://developer.squareup.com/reference/square_2021-09-15/objects/OrderServiceCharge#definition__property-type), and `catalog_version` field on every order type that contains this field. - -* **Team API:** - * [SearchTeamMembersFilter](https://developer.squareup.com/reference/square_2021-09-15/objects/SearchTeamMembersFilter) object now has an `is_owner` field that when set, causes a team member search to return only the seller who owns a Square account. - -* **Terminal API:** - * [TerminalCheckout](https://developer.squareup.com/reference/square_2021-09-15/objects/TerminalCheckout) object. The `customer_id` field is now GA. - -## Documentation updates -* **OAuth API:** - * Revised API descriptions for the ObtainToken and Authorize endpoints. Clarified that the Authorize endpoint is not a callable API but is used to direct the seller to the Square authorization page. For more information about the Authorize endpoint, see [Create the Redirect URL and Square Authorization Page URL.](https://developer.squareup.com/docs/oauth-api/create-urls-for-square-authorization) - - -## Version 13.1.0.20210818 (2021-08-18) -## API updates - -* **Customers API:** - * [Customer](https://developer.squareup.com/reference/square_2021-08-18/objects/Customer) object. The `version` field has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. This field represents the current version of the customer profile and enables optimistic concurrency control. For more information, see [Customer profile versions and optimistic concurrency support.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-profile-versions-and-optimistic-concurrency-support) - * [ListCustomers](https://developer.squareup.com/reference/square_2021-08-18/customers-api/list-customers) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. - -* **Customer Groups API:** - * [ListCustomerGroups](https://developer.squareup.com/reference/square_2021-08-18/customer-groups-api/list-customer-groups) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. - -* **Customer Segments API:** - * [ListCustomerSegments](https://developer.squareup.com/reference/square_2021-08-18/customer-segments-api/list-customer-segments) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. - -* **Invoices API:** - * Square Invoices Plus is a monthly subscription plan that allows access to premium invoice features. After Invoices Plus is launched in September 2021, a subscription will be required to create invoices with custom fields and installment payments. For more information, including how to handle new errors, see [Premium features available with Invoices Plus.](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription) - -* **Loyalty API:** - * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-08-18/objects/LoyaltyAccount) object. Added a new `expiring_point_deadlines` field that specifies when points in the account balance are scheduled to expire. This field contains a list of [LoyaltyAccountExpiringPointDeadline](https://developer.squareup.com/reference/square_2021-08-18/objects/LoyaltyAccountExpiringPointDeadline) objects. For more information, see [Expiring points.](https://developer.squareup.com/docs/loyalty-api/overview#expiring-points) - -## Documentation updates - -* [App Marketplace.](https://developer.squareup.com/docs/app-marketplace) Added the following topics: - * [How to apply.](https://developer.squareup.com/docs/app-marketplace#how-to-apply) Documented the process to list an application on the Square App Marketplace. - * [App Marketplace API Usage Requirements.](https://developer.squareup.com/docs/app-marketplace/requirements) Added a topic that describes a set of API usage requirements and recommendations for partner applications. - -* [Automatic communications from Square about invoices.](https://developer.squareup.com/docs/invoices-api/overview#automatic-communication-from-square-to-customers) Documented the invoice-related communications sent from Square to customers and sellers. - -* [Snippets best practices.](https://developer.squareup.com/docs/snippets-api/overview#best-practices) Documented best practices and additional requirements for snippets and applications that integrate with the Snippets API. - - -## Version 13.0.0.20210721 (2021-07-21) -## API updates - -* **Orders API:** - * [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge) object. Added a new field, `type`. It identifies the service charge type. - - * [OrderQuantityUnit](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderQuantityUnit), - [OrderLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItem), - [OrderLineItemDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemDiscount), - [OrderLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemModifier), - [OrderLineItemTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemTax), - [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge), - [OrderReturnLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItem), - [OrderReturnLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItemModifier), - [OrderReturnServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnServiceCharge), - [OrderReturnTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnTax), and - [OrderReturnDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnDiscount) objects. Added a new field, `catalog_version`. -* **Locations API:** - * [Location](https://developer.squareup.com/reference/square_2021-07-21/objects/Location) object. Added a new field `tax_ids` of type `TaxIds`. In the current implementation, sellers in Ireland and France can configure tax IDs during the onboarding process. They can also provide the information later by updating the location information in the Seller Dashboard. These tax IDs appear in this field. - -* **Loyalty API:** - * As of July 15, 2021, the country in which the seller’s Square account is activated determines whether Square uses pretax or post-tax purchase amounts to calculate accrued points. This change supports consumption tax models, such as value-added tax (VAT). Previously, point accrual was based on pretax purchase amounts only. This change does not affect the existing point balance of loyalty accounts. For more information, see [Availability of Square Loyalty.](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability) - -* **Payments API:** - * [UpdatePayment](https://developer.squareup.com/reference/square_2021-07-21/payments-api/update-payment). The endpoint has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Also, you can now update gift card payments (similar to card, cash, and external payments). - -* **Subscriptions API:** - * The [Subscriptions API](https://developer.squareup.com/docs/subscriptions-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. - * [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2021-07-21/objects/CatalogSubscriptionPlan) object. The `name` and `price` are now write-once fields. You specify these values at the time of creating a plan. After the plan is created, these fields cannot be updated. This makes a subscription plan immutable. - -* **Inventory API:** - * [RetrieveInventoryTransfer.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Transfer) This new endpoint is introduced to support the retrieval of inventory transfer. - * [RetrieveInventoryChanges.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Changes) This endpoint is deprecated. Its support ends when it is retired in about 12 months. - * The following endpoints have updated URLs to conform to the standard REST API convention. For more information about migrating deprecated URLs to updated URLs in your application, see [Inventory API: Migrate to Updated API Entities.](https://developer.squareup.com/docs/inventory-api/migrate-to-updated-api-entities) - * [RetrieveInventoryAdjustment](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Adjustment) - * [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Change-Inventory) - * [BatchRetrieveInventoryChanges](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Changes) - * [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Counts) - * [RetrieveInventoryPhysicalCount](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Physical-Count) - -## Documentation updates -* **Webhooks.** Revised the steps and descriptions for creating and using webhooks. For more information, see [Webhooks Overview.](https://developer.squareup.com/docs/webhooks/overview) - - -## Version 12.0.0.20210616 (2021-06-16) -## New API releases -* **Gift Cards API and Gift Card Activities API.** Gift card support is integrated in the [Square Seller Dashboard](https://squareup.com/dashboard/) and the [Square Point of Sale](https://squareup.com/us/en/point-of-sale) application. Sellers can sell, redeem, track, and reload Square gift cards. Now developers can use the [Gift Cards API](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api) and the [Gift Card Activities API](https://developer.squareup.com/reference/square_2021-06-16/gift-card-activities-api) to integrate Square gift cards into third-party applications. For more information, see [Gift Cards API Overview.](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api) - -* **Cards API.** The [Cards API](https://developer.squareup.com/reference/square_2021-06-16/cards-api) replaces the deprecated `CreateCustomerCard` and `DeleteCustomerCard` endpoints and lets an application save a customer payment card on file along with other card management operations. For more information, see [Cards API Overview.](https://developer.squareup.com/docs/cards-api/overview) - -## API updates -* **Catalog API:** - * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule). Support of the [customer group discount](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule#definition__property-customer_group_ids_any) becomes GA. For more information, see [CreateCustomerGroupDiscounts.](https://developer.squareup.com/docs/catalog-api/configure-customer-group-discounts) - * [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation). Offers Beta support of the [stockable](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable) and [stockable_conversion](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable_conversion) attributes to enable sales of a product in multiple measurement units. - * [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Support creating an item with stockable and non-stockable variations with a specified stock conversion between the two. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion) - * [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Require that an item be created with at least one variation. Otherwise, an `INVALID_REQUEST` error is returned. - -* **Customers API:** - * Using the Customers API to manage cards on file is deprecated: - * The [CreateCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/create-customer-card) endpoint is deprecated and replaced by the [CreateCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/create-card) and [LinkCustomerToGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/link-customer-to-gift-card) endpoints. - * The [DeleteCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/delete-customer-card) endpoint is deprecated and replaced by the [DisableCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/disable-card) and [UnlinkCustomerFromGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/unlink-customer-from-gift-card) endpoints. - * The `cards` field in the [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object is deprecated and replaced by the following endpoints: - * [ListCards](https://developer.squareup.com/reference/square_2021-06-16/cards-api/list-cards) to retrieve credit and debit cards on file. - * [ListGiftCards](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/list-gift-cards) to retrieve gift cards on file. - - For more information, see [Migrate to the Cards API and Gift Cards API.](https://developer.squareup.com/docs/customers-api/use-the-api/integrate-with-other-services#migrate-customer-cards) - - * [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object. In the `cards` field, the IDs for gift cards now have a `gftc:` prefix followed by the card number. This is a service-level change that applies to all Square API versions. - -* **Disputes API:** - * The Disputes API is now GA. - * `RemoveDisputeEvidence`. Renamed to [DeleteDisputeEvidence](https://developer.squareup.com/reference/square_2021-06-16/objects/DeleteDisputeEvidence). - * [CreateDisputeEvidenceFile.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceFile) The URL is changed from `/v2/disputes/{dispute_id}/evidence_file` to `/v2/disputes/{dispute_id}/evidence-files`. - * [CreateDisputeEvidenceText.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceText) The URL is changed from `/v2/disputes/{dispute_id}/evidence_text` to `/v2/disputes/{dispute_id}/evidence-text`. - * [ListDisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/ListDisputeEvidence) The endpoint now returns a pagination cursor and accepts a pagination cursor in requests. - * `DISPUTES_READ` and `DISPUTES_WRITE` permissions are required for all Disputes API endpoints instead of `PAYMENTS_READ` and `PAYMENTS_WRITE`. - * [DisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/DisputeEvidence) The `evidence_id` field is deprecated and replaced by the `id` field. - * The `dispute.state.changed` webhook is renamed to `dispute.state.updated`. - * [Dispute](https://developer.squareup.com/reference/square_2021-06-16/objects/Dispute) object. The following breaking changes are made: - * The `dispute_id` field is deprecated and replaced by the `id` field. - * The `reported_date` field is deprecated and replaced by the `reported_at` field. - * The `evidence_ids` field is deprecated with no replacement. - - For more information about the GA release of the Disputes API, see [Disputes Overview.](https://developer.squareup.com/docs/disputes-api/overview) - - -* **Inventory API:** - * [CatalogStockConversion](https://developer.squareup.com/docs/{SQUARE_TECH_REF}/objects/CatalogStockConversion) (Beta). Enables selling a product in multiple measurement units and lets Square sellers manage inventory counts of the product's stockable and a non-stockable variations in a self-consistent manner. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion) - -* **Invoices API:** - * [CreateInvoice.](https://developer.squareup.com/reference/square_2021-06-16/invoices-api/create-invoice) The `location_id` field is now optional and defaults to the location ID of the associated order. If specified in the request, the value must match the location ID of the associated order. This is a service-level change that applies to all Square API versions. - -* **Loyalty API:** - * [LoyaltyProgramAccrualRule](https://developer.squareup.com/reference/square_2021-06-16/objects/LoyaltyProgramAccrualRule) object. New `excluded_category_ids` and `excluded_item_variation_ids` fields that represent any categories and items that are excluded from accruing points in spend-based loyalty programs. - -* **Subscriptions API:** - * [Subscription.](https://developer.squareup.com/reference/square_2021-06-16/objects/Subscription) The `paid_until_date` field is renamed to `charge_through_date`. - * [UpdateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/update-subscription) The `version` field is now optional because it can update only the latest version of a subscription. - - * [CreateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/create-subscription) The `idempotency_key` field is now optional in the request. If you do not provide it, each `CreateSubscription` assumes a unique (never used before) value and creates a subscription for each call. - -## Documentation updates -* [Order fee structure.](https://developer.squareup.com/docs/payments-pricing#orders-api-fee-structure) Documented the transaction fee related to using the Orders API with a non-Square payments provider. - - -## Version 11.0.0.20210513 (2021-05-13) -## New API releases - -* **Sites API.** The [Sites API](https://developer.squareup.com/reference/square_2021-05-13/sites-api) lets you retrieve basic details about the Square Online sites that belong to a Square seller. For more information, see [Sites API Overview.](https://developer.squareup.com/docs/sites-api/overview) - - -* **Snippets API.** The [Snippets API](https://developer.squareup.com/reference/square_2021-05-13/snippets-api) lets you manage snippets that provide custom functionality on Square Online sites. A snippet is a script that is injected into all pages on a site, except for checkout pages. For more information, see [Snippets API Overview.](https://developer.squareup.com/docs/snippets-api/overview) - -The Sites API and Snippets API are publicly available to all developers as part of an early access program (EAP). For more information, see [Early access program for Square Online APIs.](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis) - -## API updates - -* **Payments API.** - * [CreatePayment.](https://developer.squareup.com/reference/square_2021-05-13/payments-api/create-payment) The endpoint now supports ACH bank transfer payments. For more information, see [ACH Payment](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments). - -* **Loyalty API:** - * The [Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. - - * The [ListLoyaltyPrograms](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/list-loyalty-programs) endpoint is deprecated and replaced by the [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/retrieve-loyalty-program) endpoint when used with the `main` keyword. - - * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccount)  object. The `mappings` field is retired and replaced by `mapping`. - - * [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccountMapping) object. The `type` and `value` fields are retired and replaced by `phone_number`. - - Starting in Square version 2021-05-13: - * `mappings` is not accepted in `CreateLoyaltyAccount` requests or returned in responses. - * `type` and `value` are not accepted in `CreateLoyaltyAccount` or `SearchLoyaltyAccounts` requests or returned in responses. - - For more information, see [Migration notes.](https://developer.squareup.com/docs/loyalty-api/overview#migration-notes) - -## Documentation updates -* **Getting Started** Added step that shows how to use the API Logs to examine a transaction. - - -## Version 10.0.0.20210421 (2021-04-21) -## New API releases - -## Existing API updates - -* **Subscriptions API:** - * [ResumeSubscription.](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/resume-subscription) This new endpoint enables applications to resume [deactivated subscriptions.](https://developer.squareup.com/docs/subscriptions-api/overview#deactivated-subscriptions) After a subscription is created, there are events that can make a subscription non-billable, causing Square to deactivate the subscription. A seller can also resume deactivated subscriptions in the Seller Dashboard. Applications can call [ListSubscriptionEvents](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/list-subscription-events) to determine why Square deactivated a subscription. - -* **Customers API:** - - * [Customer](https://developer.squareup.com/reference/square_2021-04-21/objects/Customer) object: - * New `version` field (beta). This field represents the current version of the customer profile. You can include it in your `UpdateCustomer` and `DeleteCustomer` requests to enable optimistic concurrency. For more information, see [Customer profile versions and optimistic concurrency support.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-profile-versions-and-optimistic-concurrency-support) - * The `groups` field and corresponding `CustomerGroupInfo` object are retired. - - * [Customer webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks) have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Event notifications now include the `version` field (beta). - -* **Invoices API:** - - * The [Invoices API](https://developer.squareup.com/docs/invoices-api/overview) has moved to the GA state. - - * [Invoice](https://developer.squareup.com/reference/square_2021-04-21/objects/Invoice) object: - * A new required `accepted_payment_methods` field that defines the methods of payment that customers can use to pay an invoice on the Square-hosted invoice page. Valid values are defined in the new [InvoiceAcceptedPaymentMethods](https://developer.squareup.com/reference/square_2021-04-21/objects/InvoiceAcceptedPaymentMethods) enum. For more information, see the [migration notes.](https://developer.squareup.com/docs/invoices-api/overview#migration-notes) - * A new `subscription_id` field, which is included in invoices created for subscription billing. - -* **Loyalty API:** (beta) - - * [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-04-21/loyalty-api/retrieve-loyalty-program) endpoint. This new endpoint accepts a program ID or the `main` keyword and returns the loyalty program in a seller's account. For more information, see [Retrieve a loyalty program.](https://developer.squareup.com/docs/loyalty-api/overview#retrieve-loyalty-program) This endpoint is preferred over the `ListLoyaltyPrograms` endpoint. - - * Introduced a new mapping implementation for loyalty accounts: - * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccount) object. Added the `mapping` field (of type `LoyaltyAccountMapping`), which is used to associate the loyalty account with a buyer. This field is recommended over the `mappings` field. - * [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccountMapping) object. Added the `phone_number` field to represent a phone number mapping. This field is recommended over the `type` and `value` fields. - - * A new [loyalty.program.created](https://developer.squareup.com/reference/square_2021-04-21/webhooks/loyalty.program.created) webhook. Square now publishes an event notification when a loyalty program is created in the Square Seller Dashboard. - -* **Inventory API:** - * [InventoryChange](https://developer.squareup.com/reference/square_2021-04-21/objects/InventoryChange) can now have its own measurement unit. - -* **Catalog API:** - * [CatalogItem](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogItem) introduces the `sort_name` attribute that can take Japanese writing scripts to sort items by. When it is unspecified, the regular `name` attribute is used for sorting. - * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogCatalogPricingRule) has the new `customer_group_ids_any` attribute included to support automatic application of discounts to specified product set purchased by members of any of the customer groups identified by the `customer_group_ids_any` attribute values. -* **Team API** - * New [Team webhooks](https://developer.squareup.com/reference/square_2021-04-21/team-api/webhooks): `team_member.created`, `team_member.updated`, `team_member.wage_setting.updated` to notify on created and updated team members and wage settings. - - - - -## Version 9.1.0.20210317 (2021-03-17) - -## Existing API updates - -* **Payments API:** - * [CreatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/create-payment). Until now, the `CreatePayment` endpoint supported only taking card payments. In this release, the API now supports cash and external payments. For more information, see [Take Payments.](https://developer.squareup.com/docs/payments-api/take-payments) - * [UpdatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/update-payment). This new endpoint enables developers to change the payment amount and tip amount after a payment is created. For more information, see [Update Payments.](https://developer.squareup.com/docs/payments-api/update-payments) - -* **Invoices API:** - * [InvoiceDeliveryMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceDeliveryMethod) enum. Added the read-only `SMS` value. - * [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceRequestMethod) enum (deprecated). Added the read-only `SMS`, `SMS_CHARGE_CARD_ON_FILE`, and `SMS_CHARGE_BANK_ON_FILE` values for backward compatibility. - - These values direct Square to send invoices and receipts to customers using SMS (text message). SMS settings can be configured from first-party Square applications only; they cannot be configured from the Invoices API. Square does not send invoice reminders when using SMS to communicate with customers. - - -* **Terminal API:** - * [TerminalCheckout](https://developer.squareup.com/reference/square_2021-03-17/objects/TerminalCheckout). Previously, `TerminalCheckout` only supported tapped, dipped, or swiped credit cards. It now supports manual card entry and e-money. Added the `payment_type` field to denote a request for a manually entered payment card or an e-money payment. - * [TerminalCheckoutPaymentType.](https://developer.squareup.com/reference/square_2021-03-17enums/TerminalCheckoutPaymentType) A new enum for the Terminal checkout payment types that can be requested. - * [E-money support](https://developer.squareup.com/docs/terminal-api/e-money-payments) is now available for Terminal checkout requests in Japan. - - -## SDKs -* **Square Java SDK:** - * Updated the OkHttp dependency to version 4.9.0. - * Fixed a `NullPointerException` when passing an empty order ID to the `UpdateOrder` method. - -## Documentation updates - -* **Multi-language code examples.** Previously, various topics showed only cURL examples for the REST API operations. These topics now show examples in multiple languages. You can use the language drop-down list to choose a language. - -* [When to Use Connect V1.](https://developer.squareup.com/docs/build-basics/using-connect-v1) Content is revised to reflect the most current information about when to use the Connect V1 API. - - -## Version 9.0.0.20210226 (2021-02-26) -## Existing API updates - -* **Customers API:** - - * [New webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks) (beta). Square now sends notifications for the following events: - * [customer.created](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.created) - * [customer.deleted](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.deleted) - * [customer.updated](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.updated) - -* **Orders API:** - * [CreateOrder](https://developer.squareup.com/reference/square_2021-02-26/orders-api/create-order). Removed the `location_id` field from the request. It was an unused field. - -* **Payments API:** - * [Payment](https://developer.squareup.com/reference/square_2021-02-26/objects/Payment). This type now returns the `card_payment_timeline` [(CardPaymentTimeline](https://developer.squareup.com/reference/square_2021-02-26/objects/CardPaymentTimeline)) as part of the `card_details` field. - -* **v1 Items API:** - * The following endpoints are [retired:](https://developer.squareup.com/docs/build-basics/api-lifecycle) - * `AdjustInventory`: Use the Square Inventory API [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-change-inventory) endpoint. - * `ListInventory`: Use the Square Inventory API [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-retrieve-inventory-counts) endpoint. - -* **v1 Employees.Timecards:** - * The following endpoints are retired: - * `CreateTimecard`: Use the Square Labor API [CreateShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/create-shift) endpoint. - * `DeleteTimecard`: Use the Square Labor API [DeleteShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/delete-shift) endpoint. - * `ListTimecards`: Use the Square Labor API [SearchShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/search-shift) endpoint. - * `RetrieveTimecards`: Use the Square Labor API [GetShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/get-shift) endpoint. - * `UpdateTimecard`: Use the Square Labor API [UpdateShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/update-shift) endpoint. - * `ListTimecardEvents`: No direct replacement. To learn about replacing the v1 functionality, see the [migration guide.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-timecards#endpoints) - -* **v1 Employees.CashDrawers:** - * The following endpoints are retired: - * `ListCashDrawerShifts`: Use the Square CashDrawerShifts API [ListCashDrawerShifts](https://developer.squareup.com/reference/square_2021-02-26/cash-drawers-api/list-cash-drawer-shifts) endpoint. - * `RetrieveCashDrawerShift`: Use the Square CashDrawerShifts API [RetrieveCashDrawerShift](https://developer.squareup.com/reference/square_2021-02-26/cash-drawers-api/retrieve-cash-drawer-shift) endpoint. -* **v1 Transactions.BankAccounts:** - * The following endpoints are retired: - * `ListBankAccounts`: Use the Square Bank Accounts API [ListBankAccounts](https://developer.squareup.com/reference/square_2021-02-26/bank-accounts-api/list-bank-accounts) endpoint. - * `RetrieveBankAccount`: Use the Square Bank Accounts API [GetBankAccount](https://developer.squareup.com/reference/square_2021-02-26/bank-accounts-api/get-bank-account) endpoint. - -## SDKs - -* **All Square SDKs:** - - By default, all SDKs send requests to Square's production (https://connect.squareup.com) or sandbox (https://connect.squareupsandbox.com) hosts based on the client's `environment` parameter. - - You now have the option to use a custom URL instead. To use a custom URL, follow the example for your language to set the `environment` parameter to `custom` and the `customUrl` parameter to your URL: - - - Java - - ```java - new SquareClient.Builder() - .environment(Environment.CUSTOM) - .customUrl("https://example.com") - ``` - - - .NET - - ```csharp - new Square.SquareClient.Builder() - .Environment(Environment.Custom) - .CustomUrl("https://example.com") - ``` - - - Node.js - - ```javascript - new Client({ - environment: Environment.Custom, - customUrl: 'https://example.com' - }); - ``` - - - PHP - - ```php - new Square\SquareClient([ - 'environment' => Environment::CUSTOM, - 'customUrl' => 'https://example.com', - ]); - ``` - - - Python - - ```python - Client( - environment = 'custom', - custom_url = 'https://example.com',) - ``` - - - Ruby - - ```ruby - Square::Client.new( - environment: 'custom', - custom_url: 'https://example.com' - }); - ``` - - -* **Square .NET SDK:** - - Square has overridden the `Equals` and `GetHashCode` methods for models: - - * In the `Equals` override, Square has implemented a field-level comparison. - * The Square `GetHashCode` override now ensures that hashes are deterministic and unique for each object. - -* **Square Node.js SDK:** - - Endpoints that return 64-bit integers now return a `BigInt` object instead of a `Number` object. - - -* **Connect Node.js SDK:** (deprecated) - - The deprecated Connect Node.js SDK is in the security [maintenance state.](https://developer.squareup.com/docs/build-basics/api-lifecycle#maintenance) It does not receive any bug fixes or API updates from the Square version 2021-02-26 release. However, the SDK will receive support and security patches until it is retired (end of life) in the second quarter of 2021. For more information, including steps for migrating to the [Square Node.js SDK,](https://github.com/square/square-nodejs-sdk) see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) - -## Documentation updates -* **Catalog API:** - * [Update Catalog Objects.](https://developer.squareup.com/docs/catalog-api/update-catalog-objects) Provides programming guidance to update catalog objects. - -* **Inventory API:** - * [List or retrieve inventory.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-items#list-or-retrieve-inventory) Migrate the retired v1 endpoint of `ListInventory` to the v2 endpoint of `BatchRetrieveInventoryCounts`. Compare and contrast the programming patterns between the v1 endpoint of `ListInventory` and its v2 counterparts of [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-retrieve-inventory-counts) or [RetrieveInventoryCount](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/retrieve-inventory-count). - * [Adjust or change inventory.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-items#adjust-or-change-inventory) Migrate the retired v1 endpoint of `AdjustInventory` to the v2 endpoint of `BatchChangeInventory`. Compare and contrast the programming patterns between the v1 endpoint of `AdjustInventory` and its v2 counterparts of [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-change-inventory). - -* **Get Started topic.** Revised the [Get Started](https://developer.squareup.com/docs/get-started) experience. In addition to clarifications, it now includes the use of the Square Sandbox and API Explorer. These are the tools and environments developers use to explore Square APIs. - - -## Version 8.1.0.20210121 (2021-01-21T00:00) -## Existing API updates - -* **Invoices API:** (beta) - - The `InvoicePaymentRequest.request_method` field is deprecated, and its current options are separated into two new fields that better represent their scope: - * `Invoice.delivery_method` specifies how Square should send invoices, reminders, and receipts to the customer. - * `InvoicePaymentRequest.automatic_payment_source` specifies the payment method for an automatic payment. - - As part of this change, the [InvoiceDeliveryMethod](https://developer.squareup.com/reference/square_2021-01-21/enums/InvoiceDeliveryMethod) and [InvoiceAutomaticPaymentSource](https://developer.squareup.com/reference/square_2021-01-21/enums/InvoiceAutomaticPaymentSource) enums are added and the `InvoiceRequestMethod` enum is deprecated. - - The Invoices API will continue to accept `request_method` in create and update requests until the field is retired, but starting in this version, `request_method` is not included in returned `Invoice` objects. For more information, see the [migration notes.](https://developer.squareup.com/docs/invoices-api/overview#migrate-InvoicePaymentRequest.request_method) - - -* **Locations API:** - * The [Locations.MCC](https://developer.squareup.com/reference/square_2021-01-21/objects/Location#definition__property-mcc) field is now updatable (beta). You can use the `UpdateLocation` endpoint to update the merchant category code (MCC) associated with a seller location. For more information, see [Initialize a merchant category code.](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) - - - - -## SDKs -* **Connect Node.js SDK:** (deprecated) - - The deprecated Connect Node.js SDK is in the security [maintenance state.](https://developer.squareup.com/docs/build-basics/api-lifecycle#maintenance) It will not receive any bug fixes or API updates from the Square version 2021-01-21 release. However, the SDK will receive support and security patches until it is retired (EOL) in Q2, 2021. For more information, including steps for migrating to the [Square Node.js SDK,](https://github.com/square/square-nodejs-sdk) see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) - -## Documentation updates -* **Catalog API:** - * The [Use Item Options to Manage Item Variations](https://developer.squareup.com/docs/catalog-api/item-options-migration) topic is added. It demonstrates how item variations are usually used and how item options can be used to enable random access to item variations. - -* **Inventory API:** - * The [Inventory API](inventory-api/what-it-does) content is updated. It provides clearer guidance about how to use the API, with a task-oriented TOC and improved code examples. - - - -## Version 8.0.0.20201216 (2020-12-16T00:00) -## Existing API updates - -* **Orders API:** - * [OrderLineItemPricingBlocklists.](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItemPricingBlocklists) You can explicitly specify taxes and discounts in an order or automatically apply preconfigured taxes and discounts to an order. In addition, you can now block applying these taxes and discounts to a specific [OrderLineItem](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItem) in an [order](https://developer.squareup.com/reference/square_2020-12-16/objects/Order). You add the `pricing_blocklists` attribute to individual line items and specify the `blocked_discounts` and `blocked_taxes` that you do not want to apply. For more information, see [Apply Taxes and Discounts.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts) For example walkthroughs, see [Automatically Apply Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-discounts) and [Automatically Apply Taxes.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes) - * [OrderPricingOptions](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderPricingOptions). Previously, the `pricing_options` field in an [order](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderPricingOptions) supported only `auto_apply_discounts` to enable the automatic application of preconfigured discounts. Now it also supports `auto_apply_taxes` to enable the automatic application of preconfigured taxes. For more information, see [Automatically apply preconfigured catalog taxes or discounts.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts#automatically-apply-preconfigured-catalog-taxes-or-discounts) - - * [OrderLineItemTax](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItemTax). It now includes the new `auto_applied` field. It indicates whether the tax was automatically applied using a preconfigured [CatalogTax](https://developer.squareup.com/reference/square_2020-12-16/objects/CatalogTax). - - -* **Bookings API:** - * The [CancelBooking](https://developer.squareup.com/reference/square_2020-12-16/bookings-api/cancel-booking) endpoint supports canceling an accepted or pending booking. - * The [booking.created](https://developer.squareup.com/reference/square_2020-12-16/webhooks/booking.created) webhook event notifies when a new booking is created by calling the [CreateBooking](https://developer.squareup.com/reference/square_2020-12-16/bookings-api/cancel-booking) endpoint. - * The [booking.updated](https://developer.squareup.com/reference/square_2020-12-16/webhooks/booking.updated) webhook event notifies when an existing booking is updated. - -* **Catalog API:** - * [ListCatalog](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/list-catalog), [RetrieveCatalogObject](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/retrieve-catalog-object), and [BatchRetrieveCatalogObjects](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/batch-retrieve-catalog-objects) now support the `catalog_version` filter to return catalog objects of the specified version. - -* **Customers API:** - * [SearchCustomers](https://developer.squareup.com/reference/square_2020-12-16/customers-api/search-customers) endpoint. The `email_address`, `group_ids`, `phone_number`, and `reference_id` query filters are now generally available (GA). - * The [Customer Groups](https://developer.squareup.com/reference/square_2020-12-16/customer-groups-api) API is now GA. - * The [Customer Segments](https://developer.squareup.com/reference/square_2020-12-16/customer-segments-api) API is now GA. - - -* **Invoices API:** (beta) - * [Invoice](https://developer.squareup.com/reference/square_2020-12-16/objects/Invoice) object. Added the `custom_fields` field, which contains up to two customer-facing, seller-defined fields to display on the invoice. For more information, see [Custom fields.](https://developer.squareup.com/docs/invoices-api/overview#custom-fields) - As part of this change, the following objects are added: - * [InvoiceCustomField](https://developer.squareup.com/reference/square_2020-12-16/objects/InvoiceCustomField) object - * [InvoiceCustomFieldPlacement](https://developer.squareup.com/reference/square_2020-12-16/enums/InvoiceCustomFieldPlacement) enum - * [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2020-12-16/enums/InvoiceRequestMethod) enum. Added the read-only CHARGE_BANK_ON_FILE value, which represents a bank transfer automatic payment method for a recurring invoice. - - -* **Loyalty API:** (beta) - * [LoyaltyProgramRewardTier](https://developer.squareup.com/reference/square_2020-12-16/objects/LoyaltyProgramRewardTier) object. The `definition` field in this type is deprecated and replaced by the new `pricing_rule_reference` field. You can use `pricing_rule_reference` fields to retrieve catalog objects that define the discount details for the reward tier. For more information, see [Get discount details for a reward tier.](https://developer.squareup.com/docs/loyalty-api/overview#get-discount-details-for-a-reward-tier) - As part of this change, the following APIs are deprecated: - * [LoyaltyProgramRewardDefinition](https://developer.squareup.com/reference/square_2020-12-16/objects/LoyaltyProgramRewardDefinition) object - * [LoyaltyProgramRewardDefinitionScope](https://developer.squareup.com/reference/square_2020-12-16/enums/LoyaltyProgramRewardDefinitionScope) enum - * [LoyaltyProgramRewardDefinitionType](https://developer.squareup.com/reference/square_2020-12-16/enums/LoyaltyProgramRewardDefinitionType) enum - -## New SDK release -* **Square Node.js SDK:** - - The new [Square Node.js SDK](https://github.com/square/square-nodejs-sdk) is now GA and replaces the deprecated Connect Node.js SDK. For migration information, see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) - - -## Documentation updates - -* [Get Right-Sized Permissions with Down-Scoped OAuth Tokens.](https://developer.squareup.com/docs/oauth-api/cookbook/downscoped-access) This new OAuth API topic shows how to get an additional reduced-scope OAuth token with a 24-hour expiration by using the refresh token from the Square account authorization OAuth flow. - - -## Version 7.0.0.20201118 (2020-11-18T00:00) -## New API releases - -* **Bookings API** (beta). This API enables you, as an application developer, to create applications to set up and manage bookings for appointments of fixed duration in which selected staff members of a Square seller provide specified services in supported locations for particular customers. - * For an overview, see [Manage Bookings for Square Sellers](https://developer.squareup.com/docs/bookings-api/what-it-is). - * For technical reference, see [Bookings API](https://developer.squareup.com/reference/square_2020-11-18/bookings-api). - -## Existing API updates - -* **Payments API:** - * [Payment.](https://developer.squareup.com/reference/square_2020-11-18/objects/Payment) The object now includes the `risk_evaluation` field to identify the Square-assigned risk level associated with the payment. Sellers can use this information to provide the goods and services or refund the payment. - -## New SDK release -* **New Square Node.js SDK (beta)** - - The new [Square Node.js SDK](https://github.com/square/square-nodejs-sdk) is available in beta and will eventually replace the deprecated Connect Node.js SDK. For migration information, see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) The following topics are updated to use the new SDK: - * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough) - * [Verify the Buyer When Using a Nonce for an Online Payment](https://developer.squareup.com/docs/payment-form/cookbook/verify-buyer-on-card-charge) - * [Create a Gift Card Payment Endpoint](https://developer.squareup.com/docs/payment-form/gift-cards/part-2) - - -## Documentation Updates - -* The **Testing** topics are moved from the end of the table of contents to the top, in the **Home** section under [Testing your App](https://developer.squareup.com/docs/testing-your-app). -* [Pay for orders.]](https://developer.squareup.com/docs/orders-api/pay-for-order) Topic revised to add clarity when to use Payments API and Orders API to pay for an order. The [Orders Integration]](https://developer.squareup.com/docs/payments-api/take-payments?preview=true#orders-integration) topic in Payments API simplified accordingly. - - -## Version 6.5.0.20201028 (2020-10-28T00:00) - -## Existing API updates - -* **Terminal API.** New endpoints to enable sellers in Canada refund Interac payments. - * New endpoints: - - * [CreateTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/create-terminal-refund) - * [GetTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/get-terminal-refund) - * [CancelTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/cancel-terminal-refund) - * [SearchTerminalRefunds](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/search-terminal-refunds) - - * New webhooks: - * `terminal.refund.created`. Notification of a new Terminal refund request. - * `terminal.refund.updated`. Notification that a Terminal refund request state is changed. - - * New topic [Refund Interac Payments.](https://developer.squareup.com/docs/terminal-api/square-terminal-refunds). Describes how to refund Interac payments. - -* **Loyalty API (beta):** - * [SearchLoyaltyAccounts.](https://developer.squareup.com/reference/square_2020-10-28/loyalty-api/search-loyalty-accounts) The endpoint supports a new query parameter to search by customer ID. - -* **Locations API:** - * [Location](https://developer.squareup.com/reference/square_2020-10-28/objects/Location) object. Has a new read-only field,[full_format_logo_url](https://developer.squareup.com/reference/square_2020-10-28/objects/Location#definition__property-full_format_logo_url), which provides URL of a full-format logo image for the location. - * [Webhooks](https://developer.squareup.com/docs/webhooks-api/subscribe-to-events#locations) The Locations API now supports notifications for when a location is created and when a location is updated. - -* **Orders API:** - * [RetrieveOrder](https://developer.squareup.com/reference/square_2020-10-28/orders-api/retrieve-order), new endpoint. For more information, see the [Retrieve Orders](https://developer.squareup.com/docs/orders-api/manage-orders#retrieve-orders) overview. - -* **Invoices API (beta):** - * [Invoice](https://developer.squareup.com/reference/square_2020-10-28/objects/Invoice) object. The [payment_requests](https://developer.squareup.com/reference/square_2020-10-28/objects/Invoice#definition__property-payment_requests) field can now contain up to 13 payment requests, with a maximum of 12 `INSTALLMENT` request types. This is a service-level change that applies to all Square API versions. For more information, see [Payment requests.](https://developer.squareup.com/docs/invoices-api/overview#payment-requests) - -## Version 6.4.0.20200923 (2020-09-23) -## Existing API updates -* Invoices API (beta) - * [InvoiceStatus](https://developer.squareup.com/reference/square_2020-09-23/enums/InvoiceStatus) enum. Added the `PAYMENT_PENDING` value. Previously, the Invoices API returned a `PAID` or `PARTIALLY_PAID` status for invoices in a payment pending state. Now, the Invoices API returns a `PAYMENT_PENDING` status for all invoices in a payment pending state, including those previously returned as `PAID` or `PARTIALLY_PAID`. -* Payments API - * [ListPayment](https://developer.squareup.com/reference/square_2020-09-23/payments-api/list-payments). The endpoint now supports the `limit` parameter. -* Refunds API - * [ListPaymentRefunds](https://developer.squareup.com/reference/square_2020-09-23/refunds-api/list-payment-refunds). The endpoint now supports the `limit` parameter. -* [DeviceDetails](https://developer.squareup.com/reference/square_2020-09-23/objects/DeviceDetails#definition__property-device_installation_id). The object now includes the `device_installation_id` field. -## Documentation updates -* [Payment status.](https://developer.squareup.com/docs/payments-api/take-payments#payment-status) Added details about the `Payment.status` changes and how the status relates to the seller receiving the funds. -* [Refund status.](https://developer.squareup.com/docs/payments-api/refund-payments#refund-status) Added details about the `PaymentRefund.status` changes and how the status relates to the cardholder receiving the funds. -* [CreateRefund errors.](https://developer.squareup.com/docs/payments-api/error-codes#createrefund-errors) Added documentation for the `REFUND_DECLINED` error code. - -## Version 6.3.0.20200826 (2020-08-26) -## Existing API updates -* Orders API - * [Order](https://developer.squareup.com/reference/square_2020-08-26/objects/Order) object. The `total_tip_money` field is now GA. - * [CreateOrder](https://developer.squareup.com/reference/square_2020-08-26/orders-api/create-order), [UpdateOrder](https://developer.squareup.com/reference/square_2020-08-26/orders-api/update-order), and [BatchRetrieveOrders](https://developer.squareup.com/reference/square_2020-08-26/orders-api/batch-retrieve-orders). These APIs now support merchant-scoped endpoints (for example, the `CreateOrder` endpoint `POST /v2/orders`). The location-scoped variants of these endpoints (for example, the `CreateOrder` endpoint `POST /v2/locations/{location_id}/orders`) continue to work, but these endpoints are now deprecated. You should use the merchant-scoped endpoints (you provide the location information in the request body). -* Labor API - * [Migrate from Employees to Team Members.](https://developer.squareup.com/docs/labor-api/migrate-to-teams) The Employees API is now deprecated in this release. Accordingly, update references to the `Shift.employee_id` field to the `Shift.team_member_id` field of the Labor API. -* v2 Employees API (deprecated) - * [Migrate from the Square Employees API.](https://developer.squareup.com/docs/team/migrate-from-v2-employees) The v2 Employees API is now deprecated. This topic provides information to migrate to the Team API. -* v1 Employees API (deprecated) - * [Migrate from the v1 Employees API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-employees) The v1 Employees API is now deprecated. This topic provides information to migrate to the Team API. - -## Documentation updates -* Point of Sale API - * [Build on iOS.](https://developer.squareup.com/docs/pos-api/build-on-ios) Corrected the Swift example code in step 7. -* Team API - * [Team API Overview.](https://developer.squareup.com/docs/team/overview) Documented the limitation related to creating a team member in the Square Sandbox. - -## All SDKs - -SDK technical reference documentation: - -* Nulls in SDK documentation example code are replaced with example values. - -## .NET SDK - -Bug fixes: - -* The `APIException.Errors` property was not set on instantiation. Behavior is now corrected to instantiate the class with an empty `Errors` list. - -## Version 6.2.0.20200812 (2020-08-12) -## API releases -* Subscriptions API (beta): - * For an overview, see [Square Subscriptions.](https://developer.squareup.com/docs/subscriptions/overview) - * For technical reference, see [Subscriptions API.](https://developer.squareup.com/reference/square_2020-08-12/subscriptions-api) - -## Existing API updates -* Catalog API - * [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2020-08-12/objects/CatalogSubscriptionPlan) (beta). This catalog type is added in support of the Subscriptions API. Subscription plans are stored as catalog object of the `SUBSCRIPTION_PLAN` type. For more information, see [Set Up and Manage a Subscription Plan.](https://developer.squareup.com/docs/subscriptions-api/setup-plan) - -## SqPaymentForm SDK updates -* [SqPaymentForm.masterpassImageURL.](https://developer.squareup.com/docs/api/paymentform#masterpassimageurl) This function is updated to return a Secure Remote Commerce background image URL. - -## Documentation updates -* Locations API - * [About the main location.](https://developer.squareup.com/docs/locations-api#about-the-main-location) Added clarifying information about the main location concept. -* OAuth API - * [Migrate to the Square API OAuth Flow.](https://developer.squareup.com/docs/oauth-api/migrate-to-square-oauth-flow) Added a new topic to document migration from a v1 location-scoped OAuth access token to the Square seller-scoped OAuth access token. -* Payment Form SDK - * Renamed the Add a Masterpass Button topic to [Add a Secure Remote Commerce Button.](https://developer.squareup.com/docs/payment-form/add-digital-wallets/masterpass) Updated the instructions to add a Secure Remote Commerce button to replace a legacy Masterpass button. - * [Payment form technical reference.](https://developer.squareup.com/docs/api/paymentform) Updated the reference to show code examples for adding a Secure Remote Commerce button. - -## Version 6.1.0.20200722 (2020-07-22) -## API releases - -* Invoices API (beta): - * For an overview, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/invoices-api/overview). - * For technical reference, see [Invoices API](https://developer.squareup.com/reference/square_2020-07-22/invoices-api). - -## Existing API updates - -* Catalog API - * [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items). You can now call the new search endpoint to [search for catalog items or item variations](https://developer.squareup.com/docs/catalog-api/search-catalog-items), with simplified programming experiences, using one or more of the supported query filters, including the custom attribute value filter. -* Locations API - * [Locations API Overview](https://developer.squareup.com/docs/locations-api). Introduced the "main" location concept. - * [RetrieveLocation](https://developer.squareup.com/reference/square_2020-07-22/locations-api/retrieve-location). You can now specify "main" as the location ID to retrieve the main location information. - -* Merchants API - * [RetrieveMerchant](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant) and [ListMerchants](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant). These endpoints now return a new field, `main_location_id`. - -* Orders API - * [PricingOptions](https://developer.squareup.com/reference/square_2020-07-22/objects/Order#definition__property-pricing_options). You can now enable the `auto_apply_discounts` of the options to have rule-based discounts automatically applied to an [Order](https://developer.squareup.com/reference/square_2020-07-22/objects/Order) that is pre-configured with a [pricing rule](https://developer.squareup.com/reference/square_2020-07-22/objects/CatalogPricingRule). - -* [Inventory API](https://developer.squareup.com/reference/square_2020-07-22/inventory-api) - * Replaced 500 error on max string length exceeded with a max length error message. Max length attribute added to string type fields. - -* Terminal API (beta) - * [TerminalCheckout](https://developer.squareup.com/reference/square_2020-07-22/objects/TerminalCheckout) object. The `TerminalCheckoutCancelReason` field is renamed to `ActionCancelReason`. - -## Documentation updates - -* Catalog API - * [Search a catalog](https://developer.squareup.com/docs/catalog-api/search-catalog). New topics added to provide actionable guides to using the existing [SearchCatalogObjects](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-objects) endpoint, in addition to the [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items) endpoints. - -* Orders API - * [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders). Updated existing content with the new pricing option for the automatic application of rule-based discounts. - - -## Version 6.0.0.20200625 (2020-06-25) - -## New API release -* Team API generally available (GA) - * For an overview, see [Team API Overview](https://developer.squareup.com/docs/team/overview). - * For technical reference, see [Team API](https://developer.squareup.com/reference/square_2020-06-25/team-api). - -## Existing API updates -* Catalog API - * [Pricing](https://developer.squareup.com/reference/square_2020-06-25/objects/CatalogPricingRule) is now GA. It allows an application to configure catalog item pricing rules for the specified discounts to apply automatically. -* Payments API - * The [CardPaymentDetails](https://developer.squareup.com/reference/square_2020-06-25/objects/CardPaymentDetails) type now supports a new field, [refund_requires_card_presence](https://developer.squareup.com/reference/square_2020-06-25/objects/CardPaymentDetails#definition__property-refund_requires_card_presence). When set to true, the payment card must be physically present to refund a payment. - -## Version 5.0.0.20200528 (2020-05-28) -## Square SDK - PHP -Square is excited to announce the public release of customized SDK for PHP - -To align with other Square SDKs generated for SQUARE API version 2020-05-28, the initial version of this PHP SDK is 5.0.0.20200528 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 830654f5..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,21 +0,0 @@ -# Contributing to Square SDKs - -Thank you for your willingness to help improve the Square SDKs. Your feedback and expertise ultimately benefits everyone who builds with Square. - -If you encounter a bug while using Square SDKs, please [let us know](#bug-reporting). We'll investigate the issue and fix it as soon as possible. - -We also accept feedback in the form of a pull request (PR), and will follow up with you if we need more information. However, any code changes required will be perfomed by Square engineering, and we'll close the PR. - -## Bug report - -To report a bug: -* Go to the **[Issues](../../issues)** page. -* Click **New issue**. -* Click **Get started**. - -## Other support - -For all other support, including new feature requests, see: - -* Square developer forums: [https://developer.squareup.com/forums](https://developer.squareup.com/forums) -* Square support center: [https://squareup.com/help/us/en](https://squareup.com/help/us/en) diff --git a/LICENSE b/LICENSE index 71fb2ce0..f5669d1d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,21 @@ -Copyright 2024 Square, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +MIT License + +Copyright (c) 2025 Square. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 3223eee5..00000000 --- a/README.md +++ /dev/null @@ -1,199 +0,0 @@ -# Square PHP SDK - -[![Build](https://github.com/square/square-php-sdk/actions/workflows/php.yml/badge.svg)](https://github.com/square/square-php-sdk/actions/workflows/php.yml) -[![PHP version](https://badge.fury.io/ph/square%2Fsquare.svg)](https://badge.fury.io/ph/square%2Fsquare) -[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0) - -Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders. - -* [Requirements](#requirements) -* [Installation](#installation) -* [Quickstart](#quickstart) -* [Usage](#usage) -* [Tests](#tests) -* [SDK Reference](#sdk-reference) -* [Deprecated APIs](#deprecated-apis) - - -## Requirements - -Use of the Square PHP SDK requires: - -* PHP 7.4 through PHP ^8.0 - -## Installation - -For more information, see [Set Up Your Square SDK for a PHP Project](https://developer.squareup.com/docs/sdks/php/setup-project). - -## Quickstart - -For more information, see [Square PHP SDK Quickstart](https://developer.squareup.com/docs/sdks/php/quick-start). - -## Usage -For more information, see [Using the Square PHP SDK](https://developer.squareup.com/docs/sdks/php/using-php-sdk). - -## Tests - -First, clone the repo locally and `cd` into the directory. - -```sh -git clone https://github.com/square/square-php-sdk.git -cd square-php-sdk -``` - -Next, make sure you've downloaded Composer, following the instructions [here](https://getcomposer.org/download/) -and then run the following command from the root of the repository: - -```sh -composer install -``` - -Before running the tests, find a sandbox token in your [Developer Dashboard] and set environment variables: - -```sh -export SQUARE_ACCESS_TOKEN=mytoken -export SQUARE_ENVIRONMENT=sandbox -``` - -Run the tests: - -```sh -composer run test -``` - -All environment variables: -* `SQUARE_TIMEOUT` - number -* `SQUARE_NUMBER_OF_RETRIES` - number -* `SQUARE_MAXIMUM_RETRY_WAIT_TIME` - number -* `SQUARE_SQUARE_VERSION` - string -* `SQUARE_USER_AGENT_DETAIL` - string -* `SQUARE_CUSTOM_URL` - string -* `SQUARE_ACCESS_TOKEN` - string -* `SQUARE_ENVIRONMENT` - string - one of production, sandbox, custom - -## SDK Reference - -### Payments -* [Payments] -* [Refunds] -* [Disputes] -* [Checkout] -* [Apple Pay] -* [Cards] -* [Payouts] - -### Terminal -* [Terminal] - -### Orders -* [Orders] -* [Order Custom Attributes] - -### Subscriptions -* [Subscriptions] - -### Invoices -* [Invoices] - -### Items -* [Catalog] -* [Inventory] - -### Customers -* [Customers] -* [Customer Custom Attributes] -* [Customer Groups] -* [Customer Segments] - -### Loyalty -* [Loyalty] - -### Gift Cards -* [Gift Cards] -* [Gift Card Activities] - -### Bookings -* [Bookings] -* [Booking Custom Attributes] - -### Business -* [Merchants] -* [Merchant Custom Attributes] -* [Locations] -* [Location Custom Attributes] -* [Devices] -* [Cash Drawers] -* [Vendors] - -### Team -* [Team] -* [Labor] - -### Financials -* [Bank Accounts] - -### Online -* [Sites] -* [Snippets] - -### Authorization -* [Mobile Authorization] -* [OAuth] - -### Webhook Subscriptions -* [Webhook Subscriptions] -## Deprecated APIs - -The following Square APIs are [deprecated](https://developer.squareup.com/docs/build-basics/api-lifecycle): - -* [Employees] - replaced by the [Team] API. For more information, see [Migrate from the Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees). - -* [Transactions] - replaced by the [Orders] and [Payments] APIs. For more information, see [Migrate from the Transactions API](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api). - - -[//]: # "Link anchor definitions" -[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg -[Developer Dashboard]: https://developer.squareup.com/apps -[Square API]: https://squareup.com/developers -[sign up for a developer account]: https://squareup.com/signup?v=developers -[Client]: doc/client.md -[Devices]: doc/apis/devices.md -[Disputes]: doc/apis/disputes.md -[Terminal]: doc/apis/terminal.md -[Cash Drawers]: doc/apis/cash-drawers.md -[Vendors]: doc/apis/vendors.md -[Customer Groups]: doc/apis/customer-groups.md -[Customer Custom Attributes]: doc/apis/customer-custom-attributes.md -[Customer Segments]: doc/apis/customer-segments.md -[Bank Accounts]: doc/apis/bank-accounts.md -[Payments]: doc/apis/payments.md -[Checkout]: doc/apis/checkout.md -[Catalog]: doc/apis/catalog.md -[Customers]: doc/apis/customers.md -[Inventory]: doc/apis/inventory.md -[Labor]: doc/apis/labor.md -[Loyalty]: doc/apis/loyalty.md -[Bookings]: doc/apis/bookings.md -[Booking Custom Attributes]: doc/api/booking-custom-attributes.md -[Locations]: doc/apis/locations.md -[Location Custom Attributes]: doc/api/location-custom-attributes.md -[Merchants]: doc/apis/merchants.md -[Merchant Custom Attributes]: doc/api/merchant-custom-attributes.md -[Orders]: doc/apis/orders.md -[Order Custom Attributes]: doc/api/order-custom-attributes.md -[Invoices]: doc/apis/invoices.md -[Apple Pay]: doc/apis/apple-pay.md -[Refunds]: doc/apis/refunds.md -[Subscriptions]: doc/apis/subscriptions.md -[Mobile Authorization]: doc/apis/mobile-authorization.md -[OAuth]: doc/apis/o-auth.md -[Team]: doc/apis/team.md -[Sites]: doc/apis/sites.md -[Snippets]: doc/apis/snippets.md -[Cards]: doc/apis/cards.md -[Payouts]: doc/apis/payouts.md -[Gift Cards]: doc/apis/gift-cards.md -[Gift Card Activities]: doc/apis/gift-card-activities.md -[Employees]: doc/apis/employees.md -[Transactions]: doc/apis/transactions.md -[Webhook Subscriptions]: doc/api/webhook-subscriptions.md diff --git a/composer.json b/composer.json index 175da7bb..1755ebd5 100644 --- a/composer.json +++ b/composer.json @@ -1,58 +1,48 @@ { - "name": "square/square", - "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", - "version": "40.0.0.20250123", - "type": "library", - "keywords": [ - "Square", - "API", - "SDK" - ], - "homepage": "https://squareup.com/developers", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Square Developer Platform", - "email": "developers@squareup.com", - "homepage": "https://squareup.com/developers" - } - ], - "prefer-stable": false, - "require": { - "php": "^7.2 || ^8.0", - "ext-json": "*", - "apimatic/unirest-php": "^4.0.0", - "apimatic/core-interfaces": "~0.1.5", - "apimatic/core": "~0.3.12" - }, - "require-dev": { - "squizlabs/php_codesniffer": "^3.5", - "phan/phan": "5.4.5", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" - }, - "autoload": { - "psr-4": { - "Square\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Square\\Tests\\": "tests/" - } - }, - "scripts": { - "test": "phpunit", - "test-coverage": "phpunit --coverage-html=coverage", - "lint-src": "phpcs --standard=phpcs-ruleset.xml src/", - "lint-src-fix": "phpcbf --standard=phpcs-ruleset.xml src/", - "lint-tests": "phpcs --standard=phpcs-ruleset.xml tests/", - "lint-tests-fix": "phpcbf --standard=phpcs-ruleset.xml tests/", - "analyze": "phan --allow-polyfill-parser -p", - "lint": [ - "@lint-src", - "@lint-tests" - ] + "name": "square/square", + "version": "0.0.350", + "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", + "keywords": [ + "square", + "api", + "sdk" + ], + "license": "MIT", + "require": { + "php": "^8.1", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.4", + "apimatic/unirest-php": "^4.0.0", + "apimatic/core-interfaces": "~0.1.5", + "apimatic/core": "~0.3.12" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "friendsofphp/php-cs-fixer": "3.5.0", + "phpstan/phpstan": "^1.12" + }, + "autoload": { + "psr-4": { + "Square\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "Square\\Tests\\": "tests/" + } + }, + "scripts": { + "build": [ + "@php -l src", + "@php -l tests" + ], + "test": "phpunit", + "analyze": "phpstan analyze src tests --memory-limit=1G" + }, + "author": { + "name": "Square Developer Platform", + "url": "https://developer.squareup.com", + "email": "developers@squareup.com" + }, + "homepage": "https://squareup.com/developers" } \ No newline at end of file diff --git a/doc/api-exception.md b/doc/api-exception.md deleted file mode 100644 index 4e41ae07..00000000 --- a/doc/api-exception.md +++ /dev/null @@ -1,13 +0,0 @@ - -# ApiException - -Thrown when there is a network error or HTTP response status code is not okay. - -## Methods - -| Name | Type | Description | -| --- | --- | --- | -| getHttpRequest() | [`HttpRequest`](http-request.md) | Returns the HTTP request. | -| getHttpResponse() | ?[`HttpResponse`](http-response.md) | Returns the HTTP response. | -| hasResponse() | bool | Is the response available? | - diff --git a/doc/apis/apple-pay.md b/doc/apis/apple-pay.md deleted file mode 100644 index 9f9f608f..00000000 --- a/doc/apis/apple-pay.md +++ /dev/null @@ -1,62 +0,0 @@ -# Apple Pay - -```php -$applePayApi = $client->getApplePayApi(); -``` - -## Class Name - -`ApplePayApi` - - -# Register Domain - -Activates a domain for use with Apple Pay on the Web and Square. A validation -is performed on this domain by Apple to ensure that it is properly set up as -an Apple Pay enabled domain. - -This endpoint provides an easy way for platform developers to bulk activate -Apple Pay on the Web with Square for merchants using their platform. - -Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The -current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, -and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your -domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding -long-lived caches that might not keep in sync with the correct file version. - -To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). - -```php -function registerDomain(RegisterDomainRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`RegisterDomainRequest`](../../doc/models/register-domain-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RegisterDomainResponse`](../../doc/models/register-domain-response.md). - -## Example Usage - -```php -$body = RegisterDomainRequestBuilder::init( - 'example.com' -)->build(); - -$apiResponse = $applePayApi->registerDomain($body); - -if ($apiResponse->isSuccess()) { - $registerDomainResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/bank-accounts.md b/doc/apis/bank-accounts.md deleted file mode 100644 index bbee050f..00000000 --- a/doc/apis/bank-accounts.md +++ /dev/null @@ -1,128 +0,0 @@ -# Bank Accounts - -```php -$bankAccountsApi = $client->getBankAccountsApi(); -``` - -## Class Name - -`BankAccountsApi` - -## Methods - -* [List Bank Accounts](../../doc/apis/bank-accounts.md#list-bank-accounts) -* [Get Bank Account by V1 Id](../../doc/apis/bank-accounts.md#get-bank-account-by-v1-id) -* [Get Bank Account](../../doc/apis/bank-accounts.md#get-bank-account) - - -# List Bank Accounts - -Returns a list of [BankAccount](../../doc/models/bank-account.md) objects linked to a Square account. - -```php -function listBankAccounts(?string $cursor = null, ?int $limit = null, ?string $locationId = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | The pagination cursor returned by a previous call to this endpoint.
Use it in the next `ListBankAccounts` request to retrieve the next set
of results.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | -| `limit` | `?int` | Query, Optional | Upper limit on the number of bank accounts to return in the response.
Currently, 1000 is the largest supported limit. You can specify a limit
of up to 1000 bank accounts. This is also the default limit. | -| `locationId` | `?string` | Query, Optional | Location ID. You can specify this optional filter
to retrieve only the linked bank accounts belonging to a specific location. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListBankAccountsResponse`](../../doc/models/list-bank-accounts-response.md). - -## Example Usage - -```php -$apiResponse = $bankAccountsApi->listBankAccounts(); - -if ($apiResponse->isSuccess()) { - $listBankAccountsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Bank Account by V1 Id - -Returns details of a [BankAccount](../../doc/models/bank-account.md) identified by V1 bank account ID. - -```php -function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `v1BankAccountId` | `string` | Template, Required | Connect V1 ID of the desired `BankAccount`. For more information, see
[Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetBankAccountByV1IdResponse`](../../doc/models/get-bank-account-by-v1-id-response.md). - -## Example Usage - -```php -$v1BankAccountId = 'v1_bank_account_id8'; - -$apiResponse = $bankAccountsApi->getBankAccountByV1Id($v1BankAccountId); - -if ($apiResponse->isSuccess()) { - $getBankAccountByV1IdResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Bank Account - -Returns details of a [BankAccount](../../doc/models/bank-account.md) -linked to a Square account. - -```php -function getBankAccount(string $bankAccountId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bankAccountId` | `string` | Template, Required | Square-issued ID of the desired `BankAccount`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetBankAccountResponse`](../../doc/models/get-bank-account-response.md). - -## Example Usage - -```php -$bankAccountId = 'bank_account_id0'; - -$apiResponse = $bankAccountsApi->getBankAccount($bankAccountId); - -if ($apiResponse->isSuccess()) { - $getBankAccountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/booking-custom-attributes.md b/doc/apis/booking-custom-attributes.md deleted file mode 100644 index 3c8b06bf..00000000 --- a/doc/apis/booking-custom-attributes.md +++ /dev/null @@ -1,575 +0,0 @@ -# Booking Custom Attributes - -```php -$bookingCustomAttributesApi = $client->getBookingCustomAttributesApi(); -``` - -## Class Name - -`BookingCustomAttributesApi` - -## Methods - -* [List Booking Custom Attribute Definitions](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attribute-definitions) -* [Create Booking Custom Attribute Definition](../../doc/apis/booking-custom-attributes.md#create-booking-custom-attribute-definition) -* [Delete Booking Custom Attribute Definition](../../doc/apis/booking-custom-attributes.md#delete-booking-custom-attribute-definition) -* [Retrieve Booking Custom Attribute Definition](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) -* [Update Booking Custom Attribute Definition](../../doc/apis/booking-custom-attributes.md#update-booking-custom-attribute-definition) -* [Bulk Delete Booking Custom Attributes](../../doc/apis/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) -* [Bulk Upsert Booking Custom Attributes](../../doc/apis/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) -* [List Booking Custom Attributes](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attributes) -* [Delete Booking Custom Attribute](../../doc/apis/booking-custom-attributes.md#delete-booking-custom-attribute) -* [Retrieve Booking Custom Attribute](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute) -* [Upsert Booking Custom Attribute](../../doc/apis/booking-custom-attributes.md#upsert-booking-custom-attribute) - - -# List Booking Custom Attribute Definitions - -Get all bookings custom attribute definitions. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function listBookingCustomAttributeDefinitions(?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListBookingCustomAttributeDefinitionsResponse`](../../doc/models/list-booking-custom-attribute-definitions-response.md). - -## Example Usage - -```php -$apiResponse = $bookingCustomAttributesApi->listBookingCustomAttributeDefinitions(); - -if ($apiResponse->isSuccess()) { - $listBookingCustomAttributeDefinitionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Booking Custom Attribute Definition - -Creates a bookings custom attribute definition. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function createBookingCustomAttributeDefinition( - CreateBookingCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateBookingCustomAttributeDefinitionRequest`](../../doc/models/create-booking-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateBookingCustomAttributeDefinitionResponse`](../../doc/models/create-booking-custom-attribute-definition-response.md). - -## Example Usage - -```php -$body = CreateBookingCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init()->build() -)->build(); - -$apiResponse = $bookingCustomAttributesApi->createBookingCustomAttributeDefinition($body); - -if ($apiResponse->isSuccess()) { - $createBookingCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Booking Custom Attribute Definition - -Deletes a bookings custom attribute definition. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function deleteBookingCustomAttributeDefinition(string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteBookingCustomAttributeDefinitionResponse`](../../doc/models/delete-booking-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $bookingCustomAttributesApi->deleteBookingCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $deleteBookingCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Booking Custom Attribute Definition - -Retrieves a bookings custom attribute definition. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function retrieveBookingCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | -| `version` | `?int` | Query, Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveBookingCustomAttributeDefinitionResponse`](../../doc/models/retrieve-booking-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $bookingCustomAttributesApi->retrieveBookingCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $retrieveBookingCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Booking Custom Attribute Definition - -Updates a bookings custom attribute definition. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function updateBookingCustomAttributeDefinition( - string $key, - UpdateBookingCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`UpdateBookingCustomAttributeDefinitionRequest`](../../doc/models/update-booking-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateBookingCustomAttributeDefinitionResponse`](../../doc/models/update-booking-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$body = UpdateBookingCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init()->build() -)->build(); - -$apiResponse = $bookingCustomAttributesApi->updateBookingCustomAttributeDefinition( - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $updateBookingCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Delete Booking Custom Attributes - -Bulk deletes bookings custom attributes. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function bulkDeleteBookingCustomAttributes(BulkDeleteBookingCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkDeleteBookingCustomAttributesRequest`](../../doc/models/bulk-delete-booking-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkDeleteBookingCustomAttributesResponse`](../../doc/models/bulk-delete-booking-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkDeleteBookingCustomAttributesRequestBuilder::init( - [ - 'key0' => BookingCustomAttributeDeleteRequestBuilder::init( - 'booking_id4', - 'key0' - )->build(), - 'key1' => BookingCustomAttributeDeleteRequestBuilder::init( - 'booking_id4', - 'key0' - )->build() - ] -)->build(); - -$apiResponse = $bookingCustomAttributesApi->bulkDeleteBookingCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkDeleteBookingCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Upsert Booking Custom Attributes - -Bulk upserts bookings custom attributes. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function bulkUpsertBookingCustomAttributes(BulkUpsertBookingCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpsertBookingCustomAttributesRequest`](../../doc/models/bulk-upsert-booking-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpsertBookingCustomAttributesResponse`](../../doc/models/bulk-upsert-booking-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkUpsertBookingCustomAttributesRequestBuilder::init( - [ - 'key0' => BookingCustomAttributeUpsertRequestBuilder::init( - 'booking_id4', - CustomAttributeBuilder::init()->build() - )->build(), - 'key1' => BookingCustomAttributeUpsertRequestBuilder::init( - 'booking_id4', - CustomAttributeBuilder::init()->build() - )->build() - ] -)->build(); - -$apiResponse = $bookingCustomAttributesApi->bulkUpsertBookingCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkUpsertBookingCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Booking Custom Attributes - -Lists a booking's custom attributes. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function listBookingCustomAttributes( - string $bookingId, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `withDefinitions` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListBookingCustomAttributesResponse`](../../doc/models/list-booking-custom-attributes-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$withDefinitions = false; - -$apiResponse = $bookingCustomAttributesApi->listBookingCustomAttributes( - $bookingId, - null, - null, - $withDefinitions -); - -if ($apiResponse->isSuccess()) { - $listBookingCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Booking Custom Attribute - -Deletes a bookings custom attribute. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function deleteBookingCustomAttribute(string $bookingId, string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | -| `key` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteBookingCustomAttributeResponse`](../../doc/models/delete-booking-custom-attribute-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$key = 'key0'; - -$apiResponse = $bookingCustomAttributesApi->deleteBookingCustomAttribute( - $bookingId, - $key -); - -if ($apiResponse->isSuccess()) { - $deleteBookingCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Booking Custom Attribute - -Retrieves a bookings custom attribute. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function retrieveBookingCustomAttribute( - string $bookingId, - string $key, - ?bool $withDefinition = false, - ?int $version = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | -| `key` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | -| `withDefinition` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | -| `version` | `?int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveBookingCustomAttributeResponse`](../../doc/models/retrieve-booking-custom-attribute-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$key = 'key0'; - -$withDefinition = false; - -$apiResponse = $bookingCustomAttributesApi->retrieveBookingCustomAttribute( - $bookingId, - $key, - $withDefinition -); - -if ($apiResponse->isSuccess()) { - $retrieveBookingCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Booking Custom Attribute - -Upserts a bookings custom attribute. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function upsertBookingCustomAttribute( - string $bookingId, - string $key, - UpsertBookingCustomAttributeRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | -| `key` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the `key` of a
custom attribute definition in the Square seller account. If the requesting application is not
the definition owner, you must use the qualified key. | -| `body` | [`UpsertBookingCustomAttributeRequest`](../../doc/models/upsert-booking-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertBookingCustomAttributeResponse`](../../doc/models/upsert-booking-custom-attribute-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$key = 'key0'; - -$body = UpsertBookingCustomAttributeRequestBuilder::init( - CustomAttributeBuilder::init()->build() -)->build(); - -$apiResponse = $bookingCustomAttributesApi->upsertBookingCustomAttribute( - $bookingId, - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertBookingCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/bookings.md b/doc/apis/bookings.md deleted file mode 100644 index 5c27d287..00000000 --- a/doc/apis/bookings.md +++ /dev/null @@ -1,590 +0,0 @@ -# Bookings - -```php -$bookingsApi = $client->getBookingsApi(); -``` - -## Class Name - -`BookingsApi` - -## Methods - -* [List Bookings](../../doc/apis/bookings.md#list-bookings) -* [Create Booking](../../doc/apis/bookings.md#create-booking) -* [Search Availability](../../doc/apis/bookings.md#search-availability) -* [Bulk Retrieve Bookings](../../doc/apis/bookings.md#bulk-retrieve-bookings) -* [Retrieve Business Booking Profile](../../doc/apis/bookings.md#retrieve-business-booking-profile) -* [List Location Booking Profiles](../../doc/apis/bookings.md#list-location-booking-profiles) -* [Retrieve Location Booking Profile](../../doc/apis/bookings.md#retrieve-location-booking-profile) -* [List Team Member Booking Profiles](../../doc/apis/bookings.md#list-team-member-booking-profiles) -* [Bulk Retrieve Team Member Booking Profiles](../../doc/apis/bookings.md#bulk-retrieve-team-member-booking-profiles) -* [Retrieve Team Member Booking Profile](../../doc/apis/bookings.md#retrieve-team-member-booking-profile) -* [Retrieve Booking](../../doc/apis/bookings.md#retrieve-booking) -* [Update Booking](../../doc/apis/bookings.md#update-booking) -* [Cancel Booking](../../doc/apis/bookings.md#cancel-booking) - - -# List Bookings - -Retrieve a collection of bookings. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function listBookings( - ?int $limit = null, - ?string $cursor = null, - ?string $customerId = null, - ?string $teamMemberId = null, - ?string $locationId = null, - ?string $startAtMin = null, - ?string $startAtMax = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `?int` | Query, Optional | The maximum number of results per page to return in a paged response. | -| `cursor` | `?string` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. | -| `customerId` | `?string` | Query, Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. | -| `teamMemberId` | `?string` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. | -| `locationId` | `?string` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. | -| `startAtMin` | `?string` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | -| `startAtMax` | `?string` | Query, Optional | The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListBookingsResponse`](../../doc/models/list-bookings-response.md). - -## Example Usage - -```php -$apiResponse = $bookingsApi->listBookings(); - -if ($apiResponse->isSuccess()) { - $listBookingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Booking - -Creates a booking. - -The required input must include the following: - -- `Booking.location_id` -- `Booking.start_at` -- `Booking.AppointmentSegment.team_member_id` -- `Booking.AppointmentSegment.service_variation_id` -- `Booking.AppointmentSegment.service_variation_version` - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function createBooking(CreateBookingRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateBookingRequest`](../../doc/models/create-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateBookingResponse`](../../doc/models/create-booking-response.md). - -## Example Usage - -```php -$body = CreateBookingRequestBuilder::init( - BookingBuilder::init()->build() -)->build(); - -$apiResponse = $bookingsApi->createBooking($body); - -if ($apiResponse->isSuccess()) { - $createBookingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Availability - -Searches for availabilities for booking. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function searchAvailability(SearchAvailabilityRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchAvailabilityRequest`](../../doc/models/search-availability-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchAvailabilityResponse`](../../doc/models/search-availability-response.md). - -## Example Usage - -```php -$body = SearchAvailabilityRequestBuilder::init( - SearchAvailabilityQueryBuilder::init( - SearchAvailabilityFilterBuilder::init( - TimeRangeBuilder::init()->build() - )->build() - )->build() -)->build(); - -$apiResponse = $bookingsApi->searchAvailability($body); - -if ($apiResponse->isSuccess()) { - $searchAvailabilityResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Retrieve Bookings - -Bulk-Retrieves a list of bookings by booking IDs. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function bulkRetrieveBookings(BulkRetrieveBookingsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkRetrieveBookingsRequest`](../../doc/models/bulk-retrieve-bookings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkRetrieveBookingsResponse`](../../doc/models/bulk-retrieve-bookings-response.md). - -## Example Usage - -```php -$body = BulkRetrieveBookingsRequestBuilder::init( - [ - 'booking_ids8', - 'booking_ids9', - 'booking_ids0' - ] -)->build(); - -$apiResponse = $bookingsApi->bulkRetrieveBookings($body); - -if ($apiResponse->isSuccess()) { - $bulkRetrieveBookingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Business Booking Profile - -Retrieves a seller's booking profile. - -```php -function retrieveBusinessBookingProfile(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveBusinessBookingProfileResponse`](../../doc/models/retrieve-business-booking-profile-response.md). - -## Example Usage - -```php -$apiResponse = $bookingsApi->retrieveBusinessBookingProfile(); - -if ($apiResponse->isSuccess()) { - $retrieveBusinessBookingProfileResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Location Booking Profiles - -Lists location booking profiles of a seller. - -```php -function listLocationBookingProfiles(?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a paged response. | -| `cursor` | `?string` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLocationBookingProfilesResponse`](../../doc/models/list-location-booking-profiles-response.md). - -## Example Usage - -```php -$apiResponse = $bookingsApi->listLocationBookingProfiles(); - -if ($apiResponse->isSuccess()) { - $listLocationBookingProfilesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Location Booking Profile - -Retrieves a seller's location booking profile. - -```php -function retrieveLocationBookingProfile(string $locationId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to retrieve the booking profile. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationBookingProfileResponse`](../../doc/models/retrieve-location-booking-profile-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $bookingsApi->retrieveLocationBookingProfile($locationId); - -if ($apiResponse->isSuccess()) { - $retrieveLocationBookingProfileResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Team Member Booking Profiles - -Lists booking profiles for team members. - -```php -function listTeamMemberBookingProfiles( - ?bool $bookableOnly = false, - ?int $limit = null, - ?string $cursor = null, - ?string $locationId = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookableOnly` | `?bool` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).
**Default**: `false` | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a paged response. | -| `cursor` | `?string` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. | -| `locationId` | `?string` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListTeamMemberBookingProfilesResponse`](../../doc/models/list-team-member-booking-profiles-response.md). - -## Example Usage - -```php -$bookableOnly = false; - -$apiResponse = $bookingsApi->listTeamMemberBookingProfiles($bookableOnly); - -if ($apiResponse->isSuccess()) { - $listTeamMemberBookingProfilesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Retrieve Team Member Booking Profiles - -Retrieves one or more team members' booking profiles. - -```php -function bulkRetrieveTeamMemberBookingProfiles(BulkRetrieveTeamMemberBookingProfilesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkRetrieveTeamMemberBookingProfilesRequest`](../../doc/models/bulk-retrieve-team-member-booking-profiles-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkRetrieveTeamMemberBookingProfilesResponse`](../../doc/models/bulk-retrieve-team-member-booking-profiles-response.md). - -## Example Usage - -```php -$body = BulkRetrieveTeamMemberBookingProfilesRequestBuilder::init( - [ - 'team_member_ids3', - 'team_member_ids4', - 'team_member_ids5' - ] -)->build(); - -$apiResponse = $bookingsApi->bulkRetrieveTeamMemberBookingProfiles($body); - -if ($apiResponse->isSuccess()) { - $bulkRetrieveTeamMemberBookingProfilesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Team Member Booking Profile - -Retrieves a team member's booking profile. - -```php -function retrieveTeamMemberBookingProfile(string $teamMemberId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `string` | Template, Required | The ID of the team member to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveTeamMemberBookingProfileResponse`](../../doc/models/retrieve-team-member-booking-profile-response.md). - -## Example Usage - -```php -$teamMemberId = 'team_member_id0'; - -$apiResponse = $bookingsApi->retrieveTeamMemberBookingProfile($teamMemberId); - -if ($apiResponse->isSuccess()) { - $retrieveTeamMemberBookingProfileResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Booking - -Retrieves a booking. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - -```php -function retrieveBooking(string $bookingId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveBookingResponse`](../../doc/models/retrieve-booking-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$apiResponse = $bookingsApi->retrieveBooking($bookingId); - -if ($apiResponse->isSuccess()) { - $retrieveBookingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Booking - -Updates a booking. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function updateBooking(string $bookingId, UpdateBookingRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. | -| `body` | [`UpdateBookingRequest`](../../doc/models/update-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateBookingResponse`](../../doc/models/update-booking-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$body = UpdateBookingRequestBuilder::init( - BookingBuilder::init()->build() -)->build(); - -$apiResponse = $bookingsApi->updateBooking( - $bookingId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateBookingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Booking - -Cancels an existing booking. - -To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. -To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. - -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. - -```php -function cancelBooking(string $bookingId, CancelBookingRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. | -| `body` | [`CancelBookingRequest`](../../doc/models/cancel-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelBookingResponse`](../../doc/models/cancel-booking-response.md). - -## Example Usage - -```php -$bookingId = 'booking_id4'; - -$body = CancelBookingRequestBuilder::init()->build(); - -$apiResponse = $bookingsApi->cancelBooking( - $bookingId, - $body -); - -if ($apiResponse->isSuccess()) { - $cancelBookingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/cards.md b/doc/apis/cards.md deleted file mode 100644 index 9d8838b5..00000000 --- a/doc/apis/cards.md +++ /dev/null @@ -1,199 +0,0 @@ -# Cards - -```php -$cardsApi = $client->getCardsApi(); -``` - -## Class Name - -`CardsApi` - -## Methods - -* [List Cards](../../doc/apis/cards.md#list-cards) -* [Create Card](../../doc/apis/cards.md#create-card) -* [Retrieve Card](../../doc/apis/cards.md#retrieve-card) -* [Disable Card](../../doc/apis/cards.md#disable-card) - - -# List Cards - -Retrieves a list of cards owned by the account making the request. -A max of 25 cards will be returned. - -```php -function listCards( - ?string $cursor = null, - ?string $customerId = null, - ?bool $includeDisabled = false, - ?string $referenceId = null, - ?string $sortOrder = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | -| `customerId` | `?string` | Query, Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | -| `includeDisabled` | `?bool` | Query, Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned.
**Default**: `false` | -| `referenceId` | `?string` | Query, Optional | Limit results to cards associated with the reference_id supplied. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the card was created with the specified order.
This field defaults to ASC. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCardsResponse`](../../doc/models/list-cards-response.md). - -## Example Usage - -```php -$includeDisabled = false; - -$apiResponse = $cardsApi->listCards( - null, - null, - $includeDisabled -); - -if ($apiResponse->isSuccess()) { - $listCardsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Card - -Adds a card on file to an existing merchant. - -```php -function createCard(CreateCardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCardResponse`](../../doc/models/create-card-response.md). - -## Example Usage - -```php -$body = CreateCardRequestBuilder::init( - '4935a656-a929-4792-b97c-8848be85c27c', - 'cnon:uIbfJXhXETSP197M3GB', - CardBuilder::init() - ->cardholderName('Amelia Earhart') - ->billingAddress( - AddressBuilder::init() - ->addressLine1('500 Electric Ave') - ->addressLine2('Suite 600') - ->locality('New York') - ->administrativeDistrictLevel1('NY') - ->postalCode('10003') - ->country(Country::US) - ->build() - ) - ->customerId('VDKXEEKPJN48QDG3BGGFAK05P8') - ->referenceId('user-id-1') - ->build() -)->build(); - -$apiResponse = $cardsApi->createCard($body); - -if ($apiResponse->isSuccess()) { - $createCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Card - -Retrieves details for a specific Card. - -```php -function retrieveCard(string $cardId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cardId` | `string` | Template, Required | Unique ID for the desired Card. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCardResponse`](../../doc/models/retrieve-card-response.md). - -## Example Usage - -```php -$cardId = 'card_id4'; - -$apiResponse = $cardsApi->retrieveCard($cardId); - -if ($apiResponse->isSuccess()) { - $retrieveCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Disable Card - -Disables the card, preventing any further updates or charges. -Disabling an already disabled card is allowed but has no effect. - -```php -function disableCard(string $cardId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cardId` | `string` | Template, Required | Unique ID for the desired Card. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DisableCardResponse`](../../doc/models/disable-card-response.md). - -## Example Usage - -```php -$cardId = 'card_id4'; - -$apiResponse = $cardsApi->disableCard($cardId); - -if ($apiResponse->isSuccess()) { - $disableCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/cash-drawers.md b/doc/apis/cash-drawers.md deleted file mode 100644 index a6fdc318..00000000 --- a/doc/apis/cash-drawers.md +++ /dev/null @@ -1,160 +0,0 @@ -# Cash Drawers - -```php -$cashDrawersApi = $client->getCashDrawersApi(); -``` - -## Class Name - -`CashDrawersApi` - -## Methods - -* [List Cash Drawer Shifts](../../doc/apis/cash-drawers.md#list-cash-drawer-shifts) -* [Retrieve Cash Drawer Shift](../../doc/apis/cash-drawers.md#retrieve-cash-drawer-shift) -* [List Cash Drawer Shift Events](../../doc/apis/cash-drawers.md#list-cash-drawer-shift-events) - - -# List Cash Drawer Shifts - -Provides the details for all of the cash drawer shifts for a location -in a date range. - -```php -function listCashDrawerShifts( - string $locationId, - ?string $sortOrder = null, - ?string $beginTime = null, - ?string $endTime = null, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Query, Required | The ID of the location to query for a list of cash drawer shifts. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which cash drawer shifts are listed in the response,
based on their opened_at field. Default value: ASC | -| `beginTime` | `?string` | Query, Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | -| `endTime` | `?string` | Query, Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | -| `limit` | `?int` | Query, Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max). | -| `cursor` | `?string` | Query, Optional | Opaque cursor for fetching the next page of results. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCashDrawerShiftsResponse`](../../doc/models/list-cash-drawer-shifts-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $cashDrawersApi->listCashDrawerShifts($locationId); - -if ($apiResponse->isSuccess()) { - $listCashDrawerShiftsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Cash Drawer Shift - -Provides the summary details for a single cash drawer shift. See -[ListCashDrawerShiftEvents](../../doc/apis/cash-drawers.md#list-cash-drawer-shift-events) for a list of cash drawer shift events. - -```php -function retrieveCashDrawerShift(string $locationId, string $shiftId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Query, Required | The ID of the location to retrieve cash drawer shifts from. | -| `shiftId` | `string` | Template, Required | The shift ID. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCashDrawerShiftResponse`](../../doc/models/retrieve-cash-drawer-shift-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$shiftId = 'shift_id0'; - -$apiResponse = $cashDrawersApi->retrieveCashDrawerShift( - $locationId, - $shiftId -); - -if ($apiResponse->isSuccess()) { - $retrieveCashDrawerShiftResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Cash Drawer Shift Events - -Provides a paginated list of events for a single cash drawer shift. - -```php -function listCashDrawerShiftEvents( - string $locationId, - string $shiftId, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Query, Required | The ID of the location to list cash drawer shifts for. | -| `shiftId` | `string` | Template, Required | The shift ID. | -| `limit` | `?int` | Query, Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max). | -| `cursor` | `?string` | Query, Optional | Opaque cursor for fetching the next page of results. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCashDrawerShiftEventsResponse`](../../doc/models/list-cash-drawer-shift-events-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$shiftId = 'shift_id0'; - -$apiResponse = $cashDrawersApi->listCashDrawerShiftEvents( - $locationId, - $shiftId -); - -if ($apiResponse->isSuccess()) { - $listCashDrawerShiftEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/catalog.md b/doc/apis/catalog.md deleted file mode 100644 index 5b1409f9..00000000 --- a/doc/apis/catalog.md +++ /dev/null @@ -1,980 +0,0 @@ -# Catalog - -```php -$catalogApi = $client->getCatalogApi(); -``` - -## Class Name - -`CatalogApi` - -## Methods - -* [Batch Delete Catalog Objects](../../doc/apis/catalog.md#batch-delete-catalog-objects) -* [Batch Retrieve Catalog Objects](../../doc/apis/catalog.md#batch-retrieve-catalog-objects) -* [Batch Upsert Catalog Objects](../../doc/apis/catalog.md#batch-upsert-catalog-objects) -* [Create Catalog Image](../../doc/apis/catalog.md#create-catalog-image) -* [Update Catalog Image](../../doc/apis/catalog.md#update-catalog-image) -* [Catalog Info](../../doc/apis/catalog.md#catalog-info) -* [List Catalog](../../doc/apis/catalog.md#list-catalog) -* [Upsert Catalog Object](../../doc/apis/catalog.md#upsert-catalog-object) -* [Delete Catalog Object](../../doc/apis/catalog.md#delete-catalog-object) -* [Retrieve Catalog Object](../../doc/apis/catalog.md#retrieve-catalog-object) -* [Search Catalog Objects](../../doc/apis/catalog.md#search-catalog-objects) -* [Search Catalog Items](../../doc/apis/catalog.md#search-catalog-items) -* [Update Item Modifier Lists](../../doc/apis/catalog.md#update-item-modifier-lists) -* [Update Item Taxes](../../doc/apis/catalog.md#update-item-taxes) - - -# Batch Delete Catalog Objects - -Deletes a set of [CatalogItem](../../doc/models/catalog-item.md)s based on the -provided list of target IDs and returns a set of successfully deleted IDs in -the response. Deletion is a cascading event such that all children of the -targeted object are also deleted. For example, deleting a CatalogItem will -also delete all of its [CatalogItemVariation](../../doc/models/catalog-item-variation.md) -children. - -`BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted -IDs can be deleted. The response will only include IDs that were -actually deleted. - -To ensure consistency, only one delete request is processed at a time per seller account. -While one (batch or non-batch) delete request is being processed, other (batched and non-batched) -delete requests are rejected with the `429` error code. - -```php -function batchDeleteCatalogObjects(BatchDeleteCatalogObjectsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchDeleteCatalogObjectsRequest`](../../doc/models/batch-delete-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchDeleteCatalogObjectsResponse`](../../doc/models/batch-delete-catalog-objects-response.md). - -## Example Usage - -```php -$body = BatchDeleteCatalogObjectsRequestBuilder::init() - ->objectIds( - [ - 'W62UWFY35CWMYGVWK6TWJDNI', - 'AA27W3M2GGTF3H6AVPNB77CK' - ] - ) - ->build(); - -$apiResponse = $catalogApi->batchDeleteCatalogObjects($body); - -if ($apiResponse->isSuccess()) { - $batchDeleteCatalogObjectsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Retrieve Catalog Objects - -Returns a set of objects based on the provided ID. -Each [CatalogItem](../../doc/models/catalog-item.md) returned in the set includes all of its -child information including: all of its -[CatalogItemVariation](../../doc/models/catalog-item-variation.md) objects, references to -its [CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects, and the ids of -any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it. - -```php -function batchRetrieveCatalogObjects(BatchRetrieveCatalogObjectsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveCatalogObjectsRequest`](../../doc/models/batch-retrieve-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveCatalogObjectsResponse`](../../doc/models/batch-retrieve-catalog-objects-response.md). - -## Example Usage - -```php -$body = BatchRetrieveCatalogObjectsRequestBuilder::init( - [ - 'W62UWFY35CWMYGVWK6TWJDNI', - 'AA27W3M2GGTF3H6AVPNB77CK' - ] -) - ->includeRelatedObjects(true) - ->build(); - -$apiResponse = $catalogApi->batchRetrieveCatalogObjects($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveCatalogObjectsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Upsert Catalog Objects - -Creates or updates up to 10,000 target objects based on the provided -list of objects. The target objects are grouped into batches and each batch is -inserted/updated in an all-or-nothing manner. If an object within a batch is -malformed in some way, or violates a database constraint, the entire batch -containing that item will be disregarded. However, other batches in the same -request may still succeed. Each batch may contain up to 1,000 objects, and -batches will be processed in order as long as the total object count for the -request (items, variations, modifier lists, discounts, and taxes) is no more -than 10,000. - -To ensure consistency, only one update request is processed at a time per seller account. -While one (batch or non-batch) update request is being processed, other (batched and non-batched) -update requests are rejected with the `429` error code. - -```php -function batchUpsertCatalogObjects(BatchUpsertCatalogObjectsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchUpsertCatalogObjectsRequest`](../../doc/models/batch-upsert-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchUpsertCatalogObjectsResponse`](../../doc/models/batch-upsert-catalog-objects-response.md). - -## Example Usage - -```php -$body = BatchUpsertCatalogObjectsRequestBuilder::init( - '789ff020-f723-43a9-b4b5-43b5dc1fa3dc', - [ - CatalogObjectBatchBuilder::init( - [ - CatalogObjectBuilder::init( - CatalogObjectType::ITEM, - '#Tea' - ) - ->presentAtAllLocations(true) - ->itemData( - CatalogItemBuilder::init() - ->name('Tea') - ->taxIds( - [ - '#SalesTax' - ] - ) - ->variations( - [ - CatalogObjectBuilder::init( - CatalogObjectType::ITEM_VARIATION, - '#Tea_Mug' - ) - ->presentAtAllLocations(true) - ->itemVariationData( - CatalogItemVariationBuilder::init() - ->itemId('#Tea') - ->name('Mug') - ->pricingType(CatalogPricingType::FIXED_PRICING) - ->priceMoney( - MoneyBuilder::init() - ->amount(150) - ->currency(Currency::USD) - ->build() - ) - ->build() - ) - ->build() - ] - ) - ->categories( - [ - CatalogObjectCategoryBuilder::init() - ->id('#Beverages') - ->build() - ] - ) - ->descriptionHtml('

Hot Leaf Juice

') - ->build() - ) - ->build(), - CatalogObjectBuilder::init( - CatalogObjectType::ITEM, - '#Coffee' - ) - ->presentAtAllLocations(true) - ->itemData( - CatalogItemBuilder::init() - ->name('Coffee') - ->taxIds( - [ - '#SalesTax' - ] - ) - ->variations( - [ - CatalogObjectBuilder::init( - CatalogObjectType::ITEM_VARIATION, - '#Coffee_Regular' - ) - ->presentAtAllLocations(true) - ->itemVariationData( - CatalogItemVariationBuilder::init() - ->itemId('#Coffee') - ->name('Regular') - ->pricingType(CatalogPricingType::FIXED_PRICING) - ->priceMoney( - MoneyBuilder::init() - ->amount(250) - ->currency(Currency::USD) - ->build() - ) - ->build() - ) - ->build(), - CatalogObjectBuilder::init( - CatalogObjectType::ITEM_VARIATION, - '#Coffee_Large' - ) - ->presentAtAllLocations(true) - ->itemVariationData( - CatalogItemVariationBuilder::init() - ->itemId('#Coffee') - ->name('Large') - ->pricingType(CatalogPricingType::FIXED_PRICING) - ->priceMoney( - MoneyBuilder::init() - ->amount(350) - ->currency(Currency::USD) - ->build() - ) - ->build() - ) - ->build() - ] - ) - ->categories( - [ - CatalogObjectCategoryBuilder::init() - ->id('#Beverages') - ->build() - ] - ) - ->descriptionHtml('

Hot Bean Juice

') - ->build() - ) - ->build(), - CatalogObjectBuilder::init( - CatalogObjectType::CATEGORY, - '#Beverages' - ) - ->presentAtAllLocations(true) - ->categoryData( - CatalogCategoryBuilder::init() - ->name('Beverages') - ->build() - ) - ->build(), - CatalogObjectBuilder::init( - CatalogObjectType::TAX, - '#SalesTax' - ) - ->presentAtAllLocations(true) - ->taxData( - CatalogTaxBuilder::init() - ->name('Sales Tax') - ->calculationPhase(TaxCalculationPhase::TAX_SUBTOTAL_PHASE) - ->inclusionType(TaxInclusionType::ADDITIVE) - ->percentage('5.0') - ->appliesToCustomAmounts(true) - ->enabled(true) - ->build() - ) - ->build() - ] - )->build() - ] -)->build(); - -$apiResponse = $catalogApi->batchUpsertCatalogObjects($body); - -if ($apiResponse->isSuccess()) { - $batchUpsertCatalogObjectsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Catalog Image - -Uploads an image file to be represented by a [CatalogImage](../../doc/models/catalog-image.md) object that can be linked to an existing -[CatalogObject](../../doc/models/catalog-object.md) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id` -is not specified. - -This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in -JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. - -```php -function createCatalogImage( - ?CreateCatalogImageRequest $request = null, - ?FileWrapper $imageFile = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `request` | [`?CreateCatalogImageRequest`](../../doc/models/create-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | -| `imageFile` | `?FileWrapper` | Form, Optional | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCatalogImageResponse`](../../doc/models/create-catalog-image-response.md). - -## Example Usage - -```php -$request = CreateCatalogImageRequestBuilder::init( - '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86', - CatalogObjectBuilder::init( - CatalogObjectType::IMAGE, - '#TEMP_ID' - ) - ->imageData( - CatalogImageBuilder::init() - ->caption('A picture of a cup of coffee') - ->build() - ) - ->build() -) - ->objectId('ND6EA5AAJEO5WL3JNNIAQA32') - ->build(); - -$apiResponse = $catalogApi->createCatalogImage($request); - -if ($apiResponse->isSuccess()) { - $createCatalogImageResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Catalog Image - -Uploads a new image file to replace the existing one in the specified [CatalogImage](../../doc/models/catalog-image.md) object. - -This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in -JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. - -```php -function updateCatalogImage( - string $imageId, - ?UpdateCatalogImageRequest $request = null, - ?FileWrapper $imageFile = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `imageId` | `string` | Template, Required | The ID of the `CatalogImage` object to update the encapsulated image file. | -| `request` | [`?UpdateCatalogImageRequest`](../../doc/models/update-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | -| `imageFile` | `?FileWrapper` | Form, Optional | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateCatalogImageResponse`](../../doc/models/update-catalog-image-response.md). - -## Example Usage - -```php -$imageId = 'image_id4'; - -$request = UpdateCatalogImageRequestBuilder::init( - '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86' -)->build(); - -$apiResponse = $catalogApi->updateCatalogImage( - $imageId, - $request -); - -if ($apiResponse->isSuccess()) { - $updateCatalogImageResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Catalog Info - -Retrieves information about the Square Catalog API, such as batch size -limits that can be used by the `BatchUpsertCatalogObjects` endpoint. - -```php -function catalogInfo(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CatalogInfoResponse`](../../doc/models/catalog-info-response.md). - -## Example Usage - -```php -$apiResponse = $catalogApi->catalogInfo(); - -if ($apiResponse->isSuccess()) { - $catalogInfoResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Catalog - -Returns a list of all [CatalogObject](../../doc/models/catalog-object.md)s of the specified types in the catalog. - -The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](../../doc/models/catalog-object-type.md) values, -for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". - -__Important:__ ListCatalog does not return deleted catalog items. To retrieve -deleted catalog items, use [SearchCatalogObjects](../../doc/apis/catalog.md#search-catalog-objects) -and set the `include_deleted_objects` attribute value to `true`. - -```php -function listCatalog(?string $cursor = null, ?string $types = null, ?int $catalogVersion = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
The page size is currently set to be 100.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | -| `types` | `?string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.

The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example,
`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,
`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.

If this is unspecified, the operation returns objects of all the top level types at the version
of the Square API used to make the request. Object types that are nested onto other object types
are not included in the defaults.

At the current API version the default object types are:
ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,
PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,
SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. | -| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will be from the
current version of the catalog. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCatalogResponse`](../../doc/models/list-catalog-response.md). - -## Example Usage - -```php -$apiResponse = $catalogApi->listCatalog(); - -if ($apiResponse->isSuccess()) { - $listCatalogResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Catalog Object - -Creates a new or updates the specified [CatalogObject](../../doc/models/catalog-object.md). - -To ensure consistency, only one update request is processed at a time per seller account. -While one (batch or non-batch) update request is being processed, other (batched and non-batched) -update requests are rejected with the `429` error code. - -```php -function upsertCatalogObject(UpsertCatalogObjectRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`UpsertCatalogObjectRequest`](../../doc/models/upsert-catalog-object-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertCatalogObjectResponse`](../../doc/models/upsert-catalog-object-response.md). - -## Example Usage - -```php -$body = UpsertCatalogObjectRequestBuilder::init( - 'af3d1afc-7212-4300-b463-0bfc5314a5ae', - CatalogObjectBuilder::init( - CatalogObjectType::ITEM, - '#Cocoa' - ) - ->itemData( - CatalogItemBuilder::init() - ->name('Cocoa') - ->abbreviation('Ch') - ->variations( - [ - CatalogObjectBuilder::init( - CatalogObjectType::ITEM_VARIATION, - '#Small' - ) - ->itemVariationData( - CatalogItemVariationBuilder::init() - ->itemId('#Cocoa') - ->name('Small') - ->pricingType(CatalogPricingType::VARIABLE_PRICING) - ->build() - ) - ->build(), - CatalogObjectBuilder::init( - CatalogObjectType::ITEM_VARIATION, - '#Large' - ) - ->itemVariationData( - CatalogItemVariationBuilder::init() - ->itemId('#Cocoa') - ->name('Large') - ->pricingType(CatalogPricingType::FIXED_PRICING) - ->priceMoney( - MoneyBuilder::init() - ->amount(400) - ->currency(Currency::USD) - ->build() - ) - ->build() - ) - ->build() - ] - ) - ->descriptionHtml('

Hot Chocolate

') - ->build() - ) - ->build() -)->build(); - -$apiResponse = $catalogApi->upsertCatalogObject($body); - -if ($apiResponse->isSuccess()) { - $upsertCatalogObjectResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Catalog Object - -Deletes a single [CatalogObject](../../doc/models/catalog-object.md) based on the -provided ID and returns the set of successfully deleted IDs in the response. -Deletion is a cascading event such that all children of the targeted object -are also deleted. For example, deleting a [CatalogItem](../../doc/models/catalog-item.md) -will also delete all of its -[CatalogItemVariation](../../doc/models/catalog-item-variation.md) children. - -To ensure consistency, only one delete request is processed at a time per seller account. -While one (batch or non-batch) delete request is being processed, other (batched and non-batched) -delete requests are rejected with the `429` error code. - -```php -function deleteCatalogObject(string $objectId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `objectId` | `string` | Template, Required | The ID of the catalog object to be deleted. When an object is deleted, other
objects in the graph that depend on that object will be deleted as well (for example, deleting a
catalog item will delete its catalog item variations). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCatalogObjectResponse`](../../doc/models/delete-catalog-object-response.md). - -## Example Usage - -```php -$objectId = 'object_id8'; - -$apiResponse = $catalogApi->deleteCatalogObject($objectId); - -if ($apiResponse->isSuccess()) { - $deleteCatalogObjectResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Catalog Object - -Returns a single [CatalogItem](../../doc/models/catalog-item.md) as a -[CatalogObject](../../doc/models/catalog-object.md) based on the provided ID. The returned -object includes all of the relevant [CatalogItem](../../doc/models/catalog-item.md) -information including: [CatalogItemVariation](../../doc/models/catalog-item-variation.md) -children, references to its -[CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects, and the ids of -any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it. - -```php -function retrieveCatalogObject( - string $objectId, - ?bool $includeRelatedObjects = false, - ?int $catalogVersion = null, - ?bool $includeCategoryPathToRoot = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `objectId` | `string` | Template, Required | The object ID of any type of catalog objects to be retrieved. | -| `includeRelatedObjects` | `?bool` | Query, Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false`
**Default**: `false` | -| `catalogVersion` | `?int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | -| `includeCategoryPathToRoot` | `?bool` | Query, Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCatalogObjectResponse`](../../doc/models/retrieve-catalog-object-response.md). - -## Example Usage - -```php -$objectId = 'object_id8'; - -$includeRelatedObjects = false; - -$includeCategoryPathToRoot = false; - -$apiResponse = $catalogApi->retrieveCatalogObject( - $objectId, - $includeRelatedObjects, - null, - $includeCategoryPathToRoot -); - -if ($apiResponse->isSuccess()) { - $retrieveCatalogObjectResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Catalog Objects - -Searches for [CatalogObject](../../doc/models/catalog-object.md) of any type by matching supported search attribute values, -excluding custom attribute values on items or item variations, against one or more of the specified query filters. - -This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items) -endpoint in the following aspects: - -- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. -- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. -- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. -- The both endpoints have different call conventions, including the query filter formats. - -```php -function searchCatalogObjects(SearchCatalogObjectsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchCatalogObjectsRequest`](../../doc/models/search-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchCatalogObjectsResponse`](../../doc/models/search-catalog-objects-response.md). - -## Example Usage - -```php -$body = SearchCatalogObjectsRequestBuilder::init() - ->objectTypes( - [ - CatalogObjectType::ITEM - ] - ) - ->query( - CatalogQueryBuilder::init() - ->prefixQuery( - CatalogQueryPrefixBuilder::init( - 'name', - 'tea' - )->build() - )->build() - ) - ->limit(100) - ->build(); - -$apiResponse = $catalogApi->searchCatalogObjects($body); - -if ($apiResponse->isSuccess()) { - $searchCatalogObjectsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Catalog Items - -Searches for catalog items or item variations by matching supported search attribute values, including -custom attribute values, against one or more of the specified query filters. - -This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](../../doc/apis/catalog.md#search-catalog-objects) -endpoint in the following aspects: - -- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. -- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. -- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. -- The both endpoints use different call conventions, including the query filter formats. - -```php -function searchCatalogItems(SearchCatalogItemsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchCatalogItemsRequest`](../../doc/models/search-catalog-items-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchCatalogItemsResponse`](../../doc/models/search-catalog-items-response.md). - -## Example Usage - -```php -$body = SearchCatalogItemsRequestBuilder::init() - ->textFilter('red') - ->categoryIds( - [ - 'WINE_CATEGORY_ID' - ] - ) - ->stockLevels( - [ - SearchCatalogItemsRequestStockLevel::OUT, - SearchCatalogItemsRequestStockLevel::LOW - ] - ) - ->enabledLocationIds( - [ - 'ATL_LOCATION_ID' - ] - ) - ->limit(100) - ->sortOrder(SortOrder::ASC) - ->productTypes( - [ - CatalogItemProductType::REGULAR - ] - ) - ->customAttributeFilters( - [ - CustomAttributeFilterBuilder::init() - ->customAttributeDefinitionId('VEGAN_DEFINITION_ID') - ->boolFilter(true) - ->build(), - CustomAttributeFilterBuilder::init() - ->customAttributeDefinitionId('BRAND_DEFINITION_ID') - ->stringFilter('Dark Horse') - ->build(), - CustomAttributeFilterBuilder::init() - ->key('VINTAGE') - ->numberFilter( - RangeBuilder::init() - ->min('2017') - ->max('2018') - ->build() - ) - ->build(), - CustomAttributeFilterBuilder::init() - ->customAttributeDefinitionId('VARIETAL_DEFINITION_ID') - ->build() - ] - ) - ->build(); - -$apiResponse = $catalogApi->searchCatalogItems($body); - -if ($apiResponse->isSuccess()) { - $searchCatalogItemsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Item Modifier Lists - -Updates the [CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects -that apply to the targeted [CatalogItem](../../doc/models/catalog-item.md) without having -to perform an upsert on the entire item. - -```php -function updateItemModifierLists(UpdateItemModifierListsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`UpdateItemModifierListsRequest`](../../doc/models/update-item-modifier-lists-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateItemModifierListsResponse`](../../doc/models/update-item-modifier-lists-response.md). - -## Example Usage - -```php -$body = UpdateItemModifierListsRequestBuilder::init( - [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ] -) - ->modifierListsToEnable( - [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ] - ) - ->modifierListsToDisable( - [ - '7WRC16CJZDVLSNDQ35PP6YAD' - ] - ) - ->build(); - -$apiResponse = $catalogApi->updateItemModifierLists($body); - -if ($apiResponse->isSuccess()) { - $updateItemModifierListsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Item Taxes - -Updates the [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to the -targeted [CatalogItem](../../doc/models/catalog-item.md) without having to perform an -upsert on the entire item. - -```php -function updateItemTaxes(UpdateItemTaxesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`UpdateItemTaxesRequest`](../../doc/models/update-item-taxes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateItemTaxesResponse`](../../doc/models/update-item-taxes-response.md). - -## Example Usage - -```php -$body = UpdateItemTaxesRequestBuilder::init( - [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ] -) - ->taxesToEnable( - [ - '4WRCNHCJZDVLSNDQ35PP6YAD' - ] - ) - ->taxesToDisable( - [ - 'AQCEGCEBBQONINDOHRGZISEX' - ] - ) - ->build(); - -$apiResponse = $catalogApi->updateItemTaxes($body); - -if ($apiResponse->isSuccess()) { - $updateItemTaxesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/checkout.md b/doc/apis/checkout.md deleted file mode 100644 index 3dbae027..00000000 --- a/doc/apis/checkout.md +++ /dev/null @@ -1,553 +0,0 @@ -# Checkout - -```php -$checkoutApi = $client->getCheckoutApi(); -``` - -## Class Name - -`CheckoutApi` - -## Methods - -* [Create Checkout](../../doc/apis/checkout.md#create-checkout) -* [Retrieve Location Settings](../../doc/apis/checkout.md#retrieve-location-settings) -* [Update Location Settings](../../doc/apis/checkout.md#update-location-settings) -* [Retrieve Merchant Settings](../../doc/apis/checkout.md#retrieve-merchant-settings) -* [Update Merchant Settings](../../doc/apis/checkout.md#update-merchant-settings) -* [List Payment Links](../../doc/apis/checkout.md#list-payment-links) -* [Create Payment Link](../../doc/apis/checkout.md#create-payment-link) -* [Delete Payment Link](../../doc/apis/checkout.md#delete-payment-link) -* [Retrieve Payment Link](../../doc/apis/checkout.md#retrieve-payment-link) -* [Update Payment Link](../../doc/apis/checkout.md#update-payment-link) - - -# Create Checkout - -**This endpoint is deprecated.** - -Links a `checkoutId` to a `checkout_page_url` that customers are -directed to in order to provide their payment information using a -payment processing workflow hosted on connect.squareup.com. - -NOTE: The Checkout API has been updated with new features. -For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). - -```php -function createCheckout(string $locationId, CreateCheckoutRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the business location to associate the checkout with. | -| `body` | [`CreateCheckoutRequest`](../../doc/models/create-checkout-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCheckoutResponse`](../../doc/models/create-checkout-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$body = CreateCheckoutRequestBuilder::init( - '86ae1696-b1e3-4328-af6d-f1e04d947ad6', - CreateOrderRequestBuilder::init() - ->order( - OrderBuilder::init( - 'location_id' - ) - ->referenceId('reference_id') - ->customerId('customer_id') - ->lineItems( - [ - OrderLineItemBuilder::init( - '2' - ) - ->name('Printed T Shirt') - ->appliedTaxes( - [ - OrderLineItemAppliedTaxBuilder::init( - '38ze1696-z1e3-5628-af6d-f1e04d947fg3' - )->build() - ] - ) - ->appliedDiscounts( - [ - OrderLineItemAppliedDiscountBuilder::init( - '56ae1696-z1e3-9328-af6d-f1e04d947gd4' - )->build() - ] - ) - ->basePriceMoney( - MoneyBuilder::init() - ->amount(1500) - ->currency(Currency::USD) - ->build() - ) - ->build(), - OrderLineItemBuilder::init( - '1' - ) - ->name('Slim Jeans') - ->basePriceMoney( - MoneyBuilder::init() - ->amount(2500) - ->currency(Currency::USD) - ->build() - ) - ->build(), - OrderLineItemBuilder::init( - '3' - ) - ->name('Woven Sweater') - ->basePriceMoney( - MoneyBuilder::init() - ->amount(3500) - ->currency(Currency::USD) - ->build() - ) - ->build() - ] - ) - ->taxes( - [ - OrderLineItemTaxBuilder::init() - ->uid('38ze1696-z1e3-5628-af6d-f1e04d947fg3') - ->type(OrderLineItemTaxType::INCLUSIVE) - ->percentage('7.75') - ->scope(OrderLineItemTaxScope::LINE_ITEM) - ->build() - ] - ) - ->discounts( - [ - OrderLineItemDiscountBuilder::init() - ->uid('56ae1696-z1e3-9328-af6d-f1e04d947gd4') - ->type(OrderLineItemDiscountType::FIXED_AMOUNT) - ->amountMoney( - MoneyBuilder::init() - ->amount(100) - ->currency(Currency::USD) - ->build() - ) - ->scope(OrderLineItemDiscountScope::LINE_ITEM) - ->build() - ] - ) - ->build() - ) - ->idempotencyKey('12ae1696-z1e3-4328-af6d-f1e04d947gd4') - ->build() -) - ->askForShippingAddress(true) - ->merchantSupportEmail('merchant+support@website.com') - ->prePopulateBuyerEmail('example@email.com') - ->prePopulateShippingAddress( - AddressBuilder::init() - ->addressLine1('1455 Market St.') - ->addressLine2('Suite 600') - ->locality('San Francisco') - ->administrativeDistrictLevel1('CA') - ->postalCode('94103') - ->country(Country::US) - ->firstName('Jane') - ->lastName('Doe') - ->build() - ) - ->redirectUrl('https://merchant.website.com/order-confirm') - ->additionalRecipients( - [ - ChargeRequestAdditionalRecipientBuilder::init( - '057P5VYJ4A5X1', - 'Application fees', - MoneyBuilder::init() - ->amount(60) - ->currency(Currency::USD) - ->build() - )->build() - ] - )->build(); - -$apiResponse = $checkoutApi->createCheckout( - $locationId, - $body -); - -if ($apiResponse->isSuccess()) { - $createCheckoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Location Settings - -Retrieves the location-level settings for a Square-hosted checkout page. - -```php -function retrieveLocationSettings(string $locationId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location for which to retrieve settings. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationSettingsResponse`](../../doc/models/retrieve-location-settings-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $checkoutApi->retrieveLocationSettings($locationId); - -if ($apiResponse->isSuccess()) { - $retrieveLocationSettingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Location Settings - -Updates the location-level settings for a Square-hosted checkout page. - -```php -function updateLocationSettings(string $locationId, UpdateLocationSettingsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location for which to retrieve settings. | -| `body` | [`UpdateLocationSettingsRequest`](../../doc/models/update-location-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateLocationSettingsResponse`](../../doc/models/update-location-settings-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$body = UpdateLocationSettingsRequestBuilder::init( - CheckoutLocationSettingsBuilder::init()->build() -)->build(); - -$apiResponse = $checkoutApi->updateLocationSettings( - $locationId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateLocationSettingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Merchant Settings - -Retrieves the merchant-level settings for a Square-hosted checkout page. - -```php -function retrieveMerchantSettings(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveMerchantSettingsResponse`](../../doc/models/retrieve-merchant-settings-response.md). - -## Example Usage - -```php -$apiResponse = $checkoutApi->retrieveMerchantSettings(); - -if ($apiResponse->isSuccess()) { - $retrieveMerchantSettingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Merchant Settings - -Updates the merchant-level settings for a Square-hosted checkout page. - -```php -function updateMerchantSettings(UpdateMerchantSettingsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`UpdateMerchantSettingsRequest`](../../doc/models/update-merchant-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateMerchantSettingsResponse`](../../doc/models/update-merchant-settings-response.md). - -## Example Usage - -```php -$body = UpdateMerchantSettingsRequestBuilder::init( - CheckoutMerchantSettingsBuilder::init()->build() -)->build(); - -$apiResponse = $checkoutApi->updateMerchantSettings($body); - -if ($apiResponse->isSuccess()) { - $updateMerchantSettingsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Payment Links - -Lists all payment links. - -```php -function listPaymentLinks(?string $cursor = null, ?int $limit = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | A limit on the number of results to return per page. The limit is advisory and
the implementation might return more or less results. If the supplied limit is negative, zero, or
greater than the maximum limit of 1000, it is ignored.

Default value: `100` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListPaymentLinksResponse`](../../doc/models/list-payment-links-response.md). - -## Example Usage - -```php -$apiResponse = $checkoutApi->listPaymentLinks(); - -if ($apiResponse->isSuccess()) { - $listPaymentLinksResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Payment Link - -Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. - -```php -function createPaymentLink(CreatePaymentLinkRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreatePaymentLinkRequest`](../../doc/models/create-payment-link-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreatePaymentLinkResponse`](../../doc/models/create-payment-link-response.md). - -## Example Usage - -```php -$body = CreatePaymentLinkRequestBuilder::init() - ->idempotencyKey('cd9e25dc-d9f2-4430-aedb-61605070e95f') - ->quickPay( - QuickPayBuilder::init( - 'Auto Detailing', - MoneyBuilder::init() - ->amount(10000) - ->currency(Currency::USD) - ->build(), - 'A9Y43N9ABXZBP' - )->build() - )->build(); - -$apiResponse = $checkoutApi->createPaymentLink($body); - -if ($apiResponse->isSuccess()) { - $createPaymentLinkResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Payment Link - -Deletes a payment link. - -```php -function deletePaymentLink(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The ID of the payment link to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeletePaymentLinkResponse`](../../doc/models/delete-payment-link-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $checkoutApi->deletePaymentLink($id); - -if ($apiResponse->isSuccess()) { - $deletePaymentLinkResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Payment Link - -Retrieves a payment link. - -```php -function retrievePaymentLink(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The ID of link to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrievePaymentLinkResponse`](../../doc/models/retrieve-payment-link-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $checkoutApi->retrievePaymentLink($id); - -if ($apiResponse->isSuccess()) { - $retrievePaymentLinkResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Payment Link - -Updates a payment link. You can update the `payment_link` fields such as -`description`, `checkout_options`, and `pre_populated_data`. -You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. - -```php -function updatePaymentLink(string $id, UpdatePaymentLinkRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The ID of the payment link to update. | -| `body` | [`UpdatePaymentLinkRequest`](../../doc/models/update-payment-link-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdatePaymentLinkResponse`](../../doc/models/update-payment-link-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$body = UpdatePaymentLinkRequestBuilder::init( - PaymentLinkBuilder::init( - 1 - ) - ->checkoutOptions( - CheckoutOptionsBuilder::init() - ->askForShippingAddress(true) - ->build() - ) - ->build() -)->build(); - -$apiResponse = $checkoutApi->updatePaymentLink( - $id, - $body -); - -if ($apiResponse->isSuccess()) { - $updatePaymentLinkResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/customer-custom-attributes.md b/doc/apis/customer-custom-attributes.md deleted file mode 100644 index f0fe8785..00000000 --- a/doc/apis/customer-custom-attributes.md +++ /dev/null @@ -1,549 +0,0 @@ -# Customer Custom Attributes - -```php -$customerCustomAttributesApi = $client->getCustomerCustomAttributesApi(); -``` - -## Class Name - -`CustomerCustomAttributesApi` - -## Methods - -* [List Customer Custom Attribute Definitions](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attribute-definitions) -* [Create Customer Custom Attribute Definition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) -* [Delete Customer Custom Attribute Definition](../../doc/apis/customer-custom-attributes.md#delete-customer-custom-attribute-definition) -* [Retrieve Customer Custom Attribute Definition](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) -* [Update Customer Custom Attribute Definition](../../doc/apis/customer-custom-attributes.md#update-customer-custom-attribute-definition) -* [Bulk Upsert Customer Custom Attributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) -* [List Customer Custom Attributes](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attributes) -* [Delete Customer Custom Attribute](../../doc/apis/customer-custom-attributes.md#delete-customer-custom-attribute) -* [Retrieve Customer Custom Attribute](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute) -* [Upsert Customer Custom Attribute](../../doc/apis/customer-custom-attributes.md#upsert-customer-custom-attribute) - - -# List Customer Custom Attribute Definitions - -Lists the customer-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) that belong to a Square seller account. - -When all response pages are retrieved, the results include all custom attribute definitions -that are visible to the requesting application, including those that are created by other -applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that -seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listCustomerCustomAttributeDefinitions(?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCustomerCustomAttributeDefinitionsResponse`](../../doc/models/list-customer-custom-attribute-definitions-response.md). - -## Example Usage - -```php -$apiResponse = $customerCustomAttributesApi->listCustomerCustomAttributeDefinitions(); - -if ($apiResponse->isSuccess()) { - $listCustomerCustomAttributeDefinitionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Customer Custom Attribute Definition - -Creates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. -Use this endpoint to define a custom attribute that can be associated with customer profiles. - -A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties -for a custom attribute. After the definition is created, you can call -[UpsertCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#upsert-customer-custom-attribute) or -[BulkUpsertCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) -to set the custom attribute for customer profiles in the seller's Customer Directory. - -Sellers can view all custom attributes in exported customer data, including those set to -`VISIBILITY_HIDDEN`. - -```php -function createCustomerCustomAttributeDefinition( - CreateCustomerCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateCustomerCustomAttributeDefinitionRequest`](../../doc/models/create-customer-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCustomerCustomAttributeDefinitionResponse`](../../doc/models/create-customer-custom-attribute-definition-response.md). - -## Example Usage - -```php -$body = CreateCustomerCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->key('favoritemovie') - ->name('Favorite Movie') - ->description('The favorite movie of the customer.') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_HIDDEN) - ->build() -)->build(); - -$apiResponse = $customerCustomAttributesApi->createCustomerCustomAttributeDefinition($body); - -if ($apiResponse->isSuccess()) { - $createCustomerCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Customer Custom Attribute Definition - -Deletes a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. - -Deleting a custom attribute definition also deletes the corresponding custom attribute from -all customer profiles in the seller's Customer Directory. - -Only the definition owner can delete a custom attribute definition. - -```php -function deleteCustomerCustomAttributeDefinition(string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCustomerCustomAttributeDefinitionResponse`](../../doc/models/delete-customer-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $customerCustomAttributesApi->deleteCustomerCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $deleteCustomerCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Customer Custom Attribute Definition - -Retrieves a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. - -To retrieve a custom attribute definition created by another application, the `visibility` -setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveCustomerCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | -| `version` | `?int` | Query, Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCustomerCustomAttributeDefinitionResponse`](../../doc/models/retrieve-customer-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $customerCustomAttributesApi->retrieveCustomerCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $retrieveCustomerCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Customer Custom Attribute Definition - -Updates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. - -Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the -`schema` for a `Selection` data type. - -Only the definition owner can update a custom attribute definition. Note that sellers can view -all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - -```php -function updateCustomerCustomAttributeDefinition( - string $key, - UpdateCustomerCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`UpdateCustomerCustomAttributeDefinitionRequest`](../../doc/models/update-customer-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateCustomerCustomAttributeDefinitionResponse`](../../doc/models/update-customer-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$body = UpdateCustomerCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->description('Update the description as desired.') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY) - ->build() -)->build(); - -$apiResponse = $customerCustomAttributesApi->updateCustomerCustomAttributeDefinition( - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $updateCustomerCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Upsert Customer Custom Attributes - -Creates or updates [custom attributes](../../doc/models/custom-attribute.md) for customer profiles as a bulk operation. - -Use this endpoint to set the value of one or more custom attributes for one or more customer profiles. -A custom attribute is based on a custom attribute definition in a Square seller account, which is -created using the [CreateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) endpoint. - -This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert -requests and returns a map of individual upsert responses. Each upsert request has a unique ID -and provides a customer ID and custom attribute. Each upsert response is returned with the ID -of the corresponding request. - -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkUpsertCustomerCustomAttributes(BulkUpsertCustomerCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpsertCustomerCustomAttributesRequest`](../../doc/models/bulk-upsert-customer-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpsertCustomerCustomAttributesResponse`](../../doc/models/bulk-upsert-customer-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkUpsertCustomerCustomAttributesRequestBuilder::init( - [ - 'key0' => BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestBuilder::init( - 'customer_id8', - CustomAttributeBuilder::init()->build() - )->build(), - 'key1' => BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestBuilder::init( - 'customer_id8', - CustomAttributeBuilder::init()->build() - )->build() - ] -)->build(); - -$apiResponse = $customerCustomAttributesApi->bulkUpsertCustomerCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkUpsertCustomerCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Customer Custom Attributes - -Lists the [custom attributes](../../doc/models/custom-attribute.md) associated with a customer profile. - -You can use the `with_definitions` query parameter to also retrieve custom attribute definitions -in the same call. - -When all response pages are retrieved, the results include all custom attributes that are -visible to the requesting application, including those that are owned by other applications -and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listCustomerCustomAttributes( - string $customerId, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `withDefinitions` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCustomerCustomAttributesResponse`](../../doc/models/list-customer-custom-attributes-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$withDefinitions = false; - -$apiResponse = $customerCustomAttributesApi->listCustomerCustomAttributes( - $customerId, - null, - null, - $withDefinitions -); - -if ($apiResponse->isSuccess()) { - $listCustomerCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Customer Custom Attribute - -Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a customer profile. - -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function deleteCustomerCustomAttribute(string $customerId, string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | -| `key` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCustomerCustomAttributeResponse`](../../doc/models/delete-customer-custom-attribute-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$key = 'key0'; - -$apiResponse = $customerCustomAttributesApi->deleteCustomerCustomAttribute( - $customerId, - $key -); - -if ($apiResponse->isSuccess()) { - $deleteCustomerCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Customer Custom Attribute - -Retrieves a [custom attribute](../../doc/models/custom-attribute.md) associated with a customer profile. - -You can use the `with_definition` query parameter to also retrieve the custom attribute definition -in the same call. - -To retrieve a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveCustomerCustomAttribute( - string $customerId, - string $key, - ?bool $withDefinition = false, - ?int $version = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | -| `key` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | -| `withDefinition` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | -| `version` | `?int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCustomerCustomAttributeResponse`](../../doc/models/retrieve-customer-custom-attribute-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$key = 'key0'; - -$withDefinition = false; - -$apiResponse = $customerCustomAttributesApi->retrieveCustomerCustomAttribute( - $customerId, - $key, - $withDefinition -); - -if ($apiResponse->isSuccess()) { - $retrieveCustomerCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Customer Custom Attribute - -Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) for a customer profile. - -Use this endpoint to set the value of a custom attribute for a specified customer profile. -A custom attribute is based on a custom attribute definition in a Square seller account, which -is created using the [CreateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) endpoint. - -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function upsertCustomerCustomAttribute( - string $customerId, - string $key, - UpsertCustomerCustomAttributeRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | -| `key` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the `key` of a
custom attribute definition in the Square seller account. If the requesting application is not
the definition owner, you must use the qualified key. | -| `body` | [`UpsertCustomerCustomAttributeRequest`](../../doc/models/upsert-customer-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertCustomerCustomAttributeResponse`](../../doc/models/upsert-customer-custom-attribute-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$key = 'key0'; - -$body = UpsertCustomerCustomAttributeRequestBuilder::init( - CustomAttributeBuilder::init()->build() -)->build(); - -$apiResponse = $customerCustomAttributesApi->upsertCustomerCustomAttribute( - $customerId, - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertCustomerCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/customer-groups.md b/doc/apis/customer-groups.md deleted file mode 100644 index b1543472..00000000 --- a/doc/apis/customer-groups.md +++ /dev/null @@ -1,218 +0,0 @@ -# Customer Groups - -```php -$customerGroupsApi = $client->getCustomerGroupsApi(); -``` - -## Class Name - -`CustomerGroupsApi` - -## Methods - -* [List Customer Groups](../../doc/apis/customer-groups.md#list-customer-groups) -* [Create Customer Group](../../doc/apis/customer-groups.md#create-customer-group) -* [Delete Customer Group](../../doc/apis/customer-groups.md#delete-customer-group) -* [Retrieve Customer Group](../../doc/apis/customer-groups.md#retrieve-customer-group) -* [Update Customer Group](../../doc/apis/customer-groups.md#update-customer-group) - - -# List Customer Groups - -Retrieves the list of customer groups of a business. - -```php -function listCustomerGroups(?string $cursor = null, ?int $limit = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCustomerGroupsResponse`](../../doc/models/list-customer-groups-response.md). - -## Example Usage - -```php -$apiResponse = $customerGroupsApi->listCustomerGroups(); - -if ($apiResponse->isSuccess()) { - $listCustomerGroupsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Customer Group - -Creates a new customer group for a business. - -The request must include the `name` value of the group. - -```php -function createCustomerGroup(CreateCustomerGroupRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateCustomerGroupRequest`](../../doc/models/create-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCustomerGroupResponse`](../../doc/models/create-customer-group-response.md). - -## Example Usage - -```php -$body = CreateCustomerGroupRequestBuilder::init( - CustomerGroupBuilder::init( - 'Loyal Customers' - )->build() -)->build(); - -$apiResponse = $customerGroupsApi->createCustomerGroup($body); - -if ($apiResponse->isSuccess()) { - $createCustomerGroupResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Customer Group - -Deletes a customer group as identified by the `group_id` value. - -```php -function deleteCustomerGroup(string $groupId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `groupId` | `string` | Template, Required | The ID of the customer group to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCustomerGroupResponse`](../../doc/models/delete-customer-group-response.md). - -## Example Usage - -```php -$groupId = 'group_id0'; - -$apiResponse = $customerGroupsApi->deleteCustomerGroup($groupId); - -if ($apiResponse->isSuccess()) { - $deleteCustomerGroupResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Customer Group - -Retrieves a specific customer group as identified by the `group_id` value. - -```php -function retrieveCustomerGroup(string $groupId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `groupId` | `string` | Template, Required | The ID of the customer group to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCustomerGroupResponse`](../../doc/models/retrieve-customer-group-response.md). - -## Example Usage - -```php -$groupId = 'group_id0'; - -$apiResponse = $customerGroupsApi->retrieveCustomerGroup($groupId); - -if ($apiResponse->isSuccess()) { - $retrieveCustomerGroupResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Customer Group - -Updates a customer group as identified by the `group_id` value. - -```php -function updateCustomerGroup(string $groupId, UpdateCustomerGroupRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `groupId` | `string` | Template, Required | The ID of the customer group to update. | -| `body` | [`UpdateCustomerGroupRequest`](../../doc/models/update-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateCustomerGroupResponse`](../../doc/models/update-customer-group-response.md). - -## Example Usage - -```php -$groupId = 'group_id0'; - -$body = UpdateCustomerGroupRequestBuilder::init( - CustomerGroupBuilder::init( - 'Loyal Customers' - )->build() -)->build(); - -$apiResponse = $customerGroupsApi->updateCustomerGroup( - $groupId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateCustomerGroupResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/customer-segments.md b/doc/apis/customer-segments.md deleted file mode 100644 index da841992..00000000 --- a/doc/apis/customer-segments.md +++ /dev/null @@ -1,88 +0,0 @@ -# Customer Segments - -```php -$customerSegmentsApi = $client->getCustomerSegmentsApi(); -``` - -## Class Name - -`CustomerSegmentsApi` - -## Methods - -* [List Customer Segments](../../doc/apis/customer-segments.md#list-customer-segments) -* [Retrieve Customer Segment](../../doc/apis/customer-segments.md#retrieve-customer-segment) - - -# List Customer Segments - -Retrieves the list of customer segments of a business. - -```php -function listCustomerSegments(?string $cursor = null, ?int $limit = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by previous calls to `ListCustomerSegments`.
This cursor is used to retrieve the next set of query results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCustomerSegmentsResponse`](../../doc/models/list-customer-segments-response.md). - -## Example Usage - -```php -$apiResponse = $customerSegmentsApi->listCustomerSegments(); - -if ($apiResponse->isSuccess()) { - $listCustomerSegmentsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Customer Segment - -Retrieves a specific customer segment as identified by the `segment_id` value. - -```php -function retrieveCustomerSegment(string $segmentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `segmentId` | `string` | Template, Required | The Square-issued ID of the customer segment. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCustomerSegmentResponse`](../../doc/models/retrieve-customer-segment-response.md). - -## Example Usage - -```php -$segmentId = 'segment_id4'; - -$apiResponse = $customerSegmentsApi->retrieveCustomerSegment($segmentId); - -if ($apiResponse->isSuccess()) { - $retrieveCustomerSegmentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/customers.md b/doc/apis/customers.md deleted file mode 100644 index 36fabf8a..00000000 --- a/doc/apis/customers.md +++ /dev/null @@ -1,799 +0,0 @@ -# Customers - -```php -$customersApi = $client->getCustomersApi(); -``` - -## Class Name - -`CustomersApi` - -## Methods - -* [List Customers](../../doc/apis/customers.md#list-customers) -* [Create Customer](../../doc/apis/customers.md#create-customer) -* [Bulk Create Customers](../../doc/apis/customers.md#bulk-create-customers) -* [Bulk Delete Customers](../../doc/apis/customers.md#bulk-delete-customers) -* [Bulk Retrieve Customers](../../doc/apis/customers.md#bulk-retrieve-customers) -* [Bulk Update Customers](../../doc/apis/customers.md#bulk-update-customers) -* [Search Customers](../../doc/apis/customers.md#search-customers) -* [Delete Customer](../../doc/apis/customers.md#delete-customer) -* [Retrieve Customer](../../doc/apis/customers.md#retrieve-customer) -* [Update Customer](../../doc/apis/customers.md#update-customer) -* [Create Customer Card](../../doc/apis/customers.md#create-customer-card) -* [Delete Customer Card](../../doc/apis/customers.md#delete-customer-card) -* [Remove Group From Customer](../../doc/apis/customers.md#remove-group-from-customer) -* [Add Group to Customer](../../doc/apis/customers.md#add-group-to-customer) - - -# List Customers - -Lists customer profiles associated with a Square account. - -Under normal operating conditions, newly created or updated customer profiles become available -for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated -profiles can take closer to one minute or longer, especially during network incidents and outages. - -```php -function listCustomers( - ?string $cursor = null, - ?int $limit = null, - ?string $sortField = null, - ?string $sortOrder = null, - ?bool $count = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `sortField` | [`?string(CustomerSortField)`](../../doc/models/customer-sort-field.md) | Query, Optional | Indicates how customers should be sorted.

The default value is `DEFAULT`. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | Indicates whether customers should be sorted in ascending (`ASC`) or
descending (`DESC`) order.

The default value is `ASC`. | -| `count` | `?bool` | Query, Optional | Indicates whether to return the total count of customers in the `count` field of the response.

The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListCustomersResponse`](../../doc/models/list-customers-response.md). - -## Example Usage - -```php -$count = false; - -$apiResponse = $customersApi->listCustomers( - null, - null, - null, - null, - $count -); - -if ($apiResponse->isSuccess()) { - $listCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Customer - -Creates a new customer for a business. - -You must provide at least one of the following values in your request to this -endpoint: - -- `given_name` -- `family_name` -- `company_name` -- `email_address` -- `phone_number` - -```php -function createCustomer(CreateCustomerRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateCustomerRequest`](../../doc/models/create-customer-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCustomerResponse`](../../doc/models/create-customer-response.md). - -## Example Usage - -```php -$body = CreateCustomerRequestBuilder::init() - ->givenName('Amelia') - ->familyName('Earhart') - ->emailAddress('Amelia.Earhart@example.com') - ->address( - AddressBuilder::init() - ->addressLine1('500 Electric Ave') - ->addressLine2('Suite 600') - ->locality('New York') - ->administrativeDistrictLevel1('NY') - ->postalCode('10003') - ->country(Country::US) - ->build() - ) - ->phoneNumber('+1-212-555-4240') - ->referenceId('YOUR_REFERENCE_ID') - ->note('a customer') - ->build(); - -$apiResponse = $customersApi->createCustomer($body); - -if ($apiResponse->isSuccess()) { - $createCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Create Customers - -Creates multiple [customer profiles](../../doc/models/customer.md) for a business. - -This endpoint takes a map of individual create requests and returns a map of responses. - -You must provide at least one of the following values in each create request: - -- `given_name` -- `family_name` -- `company_name` -- `email_address` -- `phone_number` - -```php -function bulkCreateCustomers(BulkCreateCustomersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkCreateCustomersRequest`](../../doc/models/bulk-create-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkCreateCustomersResponse`](../../doc/models/bulk-create-customers-response.md). - -## Example Usage - -```php -$body = BulkCreateCustomersRequestBuilder::init( - [ - '8bb76c4f-e35d-4c5b-90de-1194cd9179f0' => BulkCreateCustomerDataBuilder::init() - ->givenName('Amelia') - ->familyName('Earhart') - ->emailAddress('Amelia.Earhart@example.com') - ->address( - AddressBuilder::init() - ->addressLine1('500 Electric Ave') - ->addressLine2('Suite 600') - ->locality('New York') - ->administrativeDistrictLevel1('NY') - ->postalCode('10003') - ->country(Country::US) - ->build() - ) - ->phoneNumber('+1-212-555-4240') - ->referenceId('YOUR_REFERENCE_ID') - ->note('a customer') - ->build(), - 'd1689f23-b25d-4932-b2f0-aed00f5e2029' => BulkCreateCustomerDataBuilder::init() - ->givenName('Marie') - ->familyName('Curie') - ->emailAddress('Marie.Curie@example.com') - ->address( - AddressBuilder::init() - ->addressLine1('500 Electric Ave') - ->addressLine2('Suite 601') - ->locality('New York') - ->administrativeDistrictLevel1('NY') - ->postalCode('10003') - ->country(Country::US) - ->build() - ) - ->phoneNumber('+1-212-444-4240') - ->referenceId('YOUR_REFERENCE_ID') - ->note('another customer') - ->build() - ] -)->build(); - -$apiResponse = $customersApi->bulkCreateCustomers($body); - -if ($apiResponse->isSuccess()) { - $bulkCreateCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Delete Customers - -Deletes multiple customer profiles. - -The endpoint takes a list of customer IDs and returns a map of responses. - -```php -function bulkDeleteCustomers(BulkDeleteCustomersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkDeleteCustomersRequest`](../../doc/models/bulk-delete-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkDeleteCustomersResponse`](../../doc/models/bulk-delete-customers-response.md). - -## Example Usage - -```php -$body = BulkDeleteCustomersRequestBuilder::init( - [ - '8DDA5NZVBZFGAX0V3HPF81HHE0', - 'N18CPRVXR5214XPBBA6BZQWF3C', - '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' - ] -)->build(); - -$apiResponse = $customersApi->bulkDeleteCustomers($body); - -if ($apiResponse->isSuccess()) { - $bulkDeleteCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Retrieve Customers - -Retrieves multiple customer profiles. - -This endpoint takes a list of customer IDs and returns a map of responses. - -```php -function bulkRetrieveCustomers(BulkRetrieveCustomersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkRetrieveCustomersRequest`](../../doc/models/bulk-retrieve-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkRetrieveCustomersResponse`](../../doc/models/bulk-retrieve-customers-response.md). - -## Example Usage - -```php -$body = BulkRetrieveCustomersRequestBuilder::init( - [ - '8DDA5NZVBZFGAX0V3HPF81HHE0', - 'N18CPRVXR5214XPBBA6BZQWF3C', - '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' - ] -)->build(); - -$apiResponse = $customersApi->bulkRetrieveCustomers($body); - -if ($apiResponse->isSuccess()) { - $bulkRetrieveCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Update Customers - -Updates multiple customer profiles. - -This endpoint takes a map of individual update requests and returns a map of responses. - -You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/apis/cards.md) or [Gift Cards API](../../doc/apis/gift-cards.md). - -```php -function bulkUpdateCustomers(BulkUpdateCustomersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpdateCustomersRequest`](../../doc/models/bulk-update-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpdateCustomersResponse`](../../doc/models/bulk-update-customers-response.md). - -## Example Usage - -```php -$body = BulkUpdateCustomersRequestBuilder::init( - [ - '8DDA5NZVBZFGAX0V3HPF81HHE0' => BulkUpdateCustomerDataBuilder::init() - ->emailAddress('New.Amelia.Earhart@example.com') - ->phoneNumber('phone_number2') - ->note('updated customer note') - ->version(2) - ->build(), - 'N18CPRVXR5214XPBBA6BZQWF3C' => BulkUpdateCustomerDataBuilder::init() - ->givenName('Marie') - ->familyName('Curie') - ->version(0) - ->build() - ] -)->build(); - -$apiResponse = $customersApi->bulkUpdateCustomers($body); - -if ($apiResponse->isSuccess()) { - $bulkUpdateCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Customers - -Searches the customer profiles associated with a Square account using one or more supported query filters. - -Calling `SearchCustomers` without any explicit query filter returns all -customer profiles ordered alphabetically based on `given_name` and -`family_name`. - -Under normal operating conditions, newly created or updated customer profiles become available -for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated -profiles can take closer to one minute or longer, especially during network incidents and outages. - -```php -function searchCustomers(SearchCustomersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchCustomersRequest`](../../doc/models/search-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchCustomersResponse`](../../doc/models/search-customers-response.md). - -## Example Usage - -```php -$body = SearchCustomersRequestBuilder::init() - ->limit(2) - ->query( - CustomerQueryBuilder::init() - ->filter( - CustomerFilterBuilder::init() - ->creationSource( - CustomerCreationSourceFilterBuilder::init() - ->values( - [ - CustomerCreationSource::THIRD_PARTY - ] - ) - ->rule(CustomerInclusionExclusion::INCLUDE_) - ->build() - ) - ->createdAt( - TimeRangeBuilder::init() - ->startAt('2018-01-01T00:00:00-00:00') - ->endAt('2018-02-01T00:00:00-00:00') - ->build() - ) - ->emailAddress( - CustomerTextFilterBuilder::init() - ->fuzzy('example.com') - ->build() - ) - ->groupIds( - FilterValueBuilder::init() - ->all( - [ - '545AXB44B4XXWMVQ4W8SBT3HHF' - ] - ) - ->build() - ) - ->build() - ) - ->sort( - CustomerSortBuilder::init() - ->field(CustomerSortField::CREATED_AT) - ->order(SortOrder::ASC) - ->build() - ) - ->build() - ) - ->build(); - -$apiResponse = $customersApi->searchCustomers($body); - -if ($apiResponse->isSuccess()) { - $searchCustomersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Customer - -Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - -To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. - -```php -function deleteCustomer(string $customerId, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer to delete. | -| `version` | `?int` | Query, Optional | The current version of the customer profile.

As a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCustomerResponse`](../../doc/models/delete-customer-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$apiResponse = $customersApi->deleteCustomer($customerId); - -if ($apiResponse->isSuccess()) { - $deleteCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Customer - -Returns details for a single customer. - -```php -function retrieveCustomer(string $customerId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveCustomerResponse`](../../doc/models/retrieve-customer-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$apiResponse = $customersApi->retrieveCustomer($customerId); - -if ($apiResponse->isSuccess()) { - $retrieveCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Customer - -Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. -To add or update a field, specify the new value. To remove a field, specify `null`. - -To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. - -You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/apis/cards.md) or [Gift Cards API](../../doc/apis/gift-cards.md). - -```php -function updateCustomer(string $customerId, UpdateCustomerRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer to update. | -| `body` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateCustomerResponse`](../../doc/models/update-customer-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$body = UpdateCustomerRequestBuilder::init() - ->emailAddress('New.Amelia.Earhart@example.com') - ->phoneNumber('phone_number2') - ->note('updated customer note') - ->version(2) - ->build(); - -$apiResponse = $customersApi->updateCustomer( - $customerId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Customer Card - -**This endpoint is deprecated.** - -Adds a card on file to an existing customer. - -As with charges, calls to `CreateCustomerCard` are idempotent. Multiple -calls with the same card nonce return the same card record that was created -with the provided nonce during the _first_ call. - -```php -function createCustomerCard(string $customerId, CreateCustomerCardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The Square ID of the customer profile the card is linked to. | -| `body` | [`CreateCustomerCardRequest`](../../doc/models/create-customer-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateCustomerCardResponse`](../../doc/models/create-customer-card-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$body = CreateCustomerCardRequestBuilder::init( - 'YOUR_CARD_NONCE' -) - ->billingAddress( - AddressBuilder::init() - ->addressLine1('500 Electric Ave') - ->addressLine2('Suite 600') - ->locality('New York') - ->administrativeDistrictLevel1('NY') - ->postalCode('10003') - ->country(Country::US) - ->build() - ) - ->cardholderName('Amelia Earhart') - ->build(); - -$apiResponse = $customersApi->createCustomerCard( - $customerId, - $body -); - -if ($apiResponse->isSuccess()) { - $createCustomerCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Customer Card - -**This endpoint is deprecated.** - -Removes a card on file from a customer. - -```php -function deleteCustomerCard(string $customerId, string $cardId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer that the card on file belongs to. | -| `cardId` | `string` | Template, Required | The ID of the card on file to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteCustomerCardResponse`](../../doc/models/delete-customer-card-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$cardId = 'card_id4'; - -$apiResponse = $customersApi->deleteCustomerCard( - $customerId, - $cardId -); - -if ($apiResponse->isSuccess()) { - $deleteCustomerCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Remove Group From Customer - -Removes a group membership from a customer. - -The customer is identified by the `customer_id` value -and the customer group is identified by the `group_id` value. - -```php -function removeGroupFromCustomer(string $customerId, string $groupId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer to remove from the group. | -| `groupId` | `string` | Template, Required | The ID of the customer group to remove the customer from. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RemoveGroupFromCustomerResponse`](../../doc/models/remove-group-from-customer-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$groupId = 'group_id0'; - -$apiResponse = $customersApi->removeGroupFromCustomer( - $customerId, - $groupId -); - -if ($apiResponse->isSuccess()) { - $removeGroupFromCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Add Group to Customer - -Adds a group membership to a customer. - -The customer is identified by the `customer_id` value -and the customer group is identified by the `group_id` value. - -```php -function addGroupToCustomer(string $customerId, string $groupId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The ID of the customer to add to a group. | -| `groupId` | `string` | Template, Required | The ID of the customer group to add the customer to. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`AddGroupToCustomerResponse`](../../doc/models/add-group-to-customer-response.md). - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$groupId = 'group_id0'; - -$apiResponse = $customersApi->addGroupToCustomer( - $customerId, - $groupId -); - -if ($apiResponse->isSuccess()) { - $addGroupToCustomerResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/devices.md b/doc/apis/devices.md deleted file mode 100644 index ce8e2141..00000000 --- a/doc/apis/devices.md +++ /dev/null @@ -1,223 +0,0 @@ -# Devices - -```php -$devicesApi = $client->getDevicesApi(); -``` - -## Class Name - -`DevicesApi` - -## Methods - -* [List Devices](../../doc/apis/devices.md#list-devices) -* [List Device Codes](../../doc/apis/devices.md#list-device-codes) -* [Create Device Code](../../doc/apis/devices.md#create-device-code) -* [Get Device Code](../../doc/apis/devices.md#get-device-code) -* [Get Device](../../doc/apis/devices.md#get-device) - - -# List Devices - -List devices associated with the merchant. Currently, only Terminal API -devices are supported. - -```php -function listDevices( - ?string $cursor = null, - ?string $sortOrder = null, - ?int $limit = null, - ?string $locationId = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which results are listed.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `limit` | `?int` | Query, Optional | The number of results to return in a single page. | -| `locationId` | `?string` | Query, Optional | If present, only returns devices at the target location. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListDevicesResponse`](../../doc/models/list-devices-response.md). - -## Example Usage - -```php -$apiResponse = $devicesApi->listDevices(); - -if ($apiResponse->isSuccess()) { - $listDevicesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Device Codes - -Lists all DeviceCodes associated with the merchant. - -```php -function listDeviceCodes( - ?string $cursor = null, - ?string $locationId = null, - ?string $productType = null, - ?string $status = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | -| `locationId` | `?string` | Query, Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | -| `productType` | [`?string(ProductType)`](../../doc/models/product-type.md) | Query, Optional | If specified, only returns DeviceCodes targeting the specified product type.
Returns DeviceCodes of all product types if empty. | -| `status` | [`?string(DeviceCodeStatus)`](../../doc/models/device-code-status.md) | Query, Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListDeviceCodesResponse`](../../doc/models/list-device-codes-response.md). - -## Example Usage - -```php -$apiResponse = $devicesApi->listDeviceCodes(); - -if ($apiResponse->isSuccess()) { - $listDeviceCodesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Device Code - -Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected -terminal mode. - -```php -function createDeviceCode(CreateDeviceCodeRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateDeviceCodeRequest`](../../doc/models/create-device-code-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateDeviceCodeResponse`](../../doc/models/create-device-code-response.md). - -## Example Usage - -```php -$body = CreateDeviceCodeRequestBuilder::init( - '01bb00a6-0c86-4770-94ed-f5fca973cd56', - DeviceCodeBuilder::init() - ->name('Counter 1') - ->locationId('B5E4484SHHNYH') - ->build() -)->build(); - -$apiResponse = $devicesApi->createDeviceCode($body); - -if ($apiResponse->isSuccess()) { - $createDeviceCodeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Device Code - -Retrieves DeviceCode with the associated ID. - -```php -function getDeviceCode(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The unique identifier for the device code. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetDeviceCodeResponse`](../../doc/models/get-device-code-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $devicesApi->getDeviceCode($id); - -if ($apiResponse->isSuccess()) { - $getDeviceCodeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Device - -Retrieves Device with the associated `device_id`. - -```php -function getDevice(string $deviceId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `deviceId` | `string` | Template, Required | The unique ID for the desired `Device`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetDeviceResponse`](../../doc/models/get-device-response.md). - -## Example Usage - -```php -$deviceId = 'device_id6'; - -$apiResponse = $devicesApi->getDevice($deviceId); - -if ($apiResponse->isSuccess()) { - $getDeviceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/disputes.md b/doc/apis/disputes.md deleted file mode 100644 index bcda1099..00000000 --- a/doc/apis/disputes.md +++ /dev/null @@ -1,399 +0,0 @@ -# Disputes - -```php -$disputesApi = $client->getDisputesApi(); -``` - -## Class Name - -`DisputesApi` - -## Methods - -* [List Disputes](../../doc/apis/disputes.md#list-disputes) -* [Retrieve Dispute](../../doc/apis/disputes.md#retrieve-dispute) -* [Accept Dispute](../../doc/apis/disputes.md#accept-dispute) -* [List Dispute Evidence](../../doc/apis/disputes.md#list-dispute-evidence) -* [Create Dispute Evidence File](../../doc/apis/disputes.md#create-dispute-evidence-file) -* [Create Dispute Evidence Text](../../doc/apis/disputes.md#create-dispute-evidence-text) -* [Delete Dispute Evidence](../../doc/apis/disputes.md#delete-dispute-evidence) -* [Retrieve Dispute Evidence](../../doc/apis/disputes.md#retrieve-dispute-evidence) -* [Submit Evidence](../../doc/apis/disputes.md#submit-evidence) - - -# List Disputes - -Returns a list of disputes associated with a particular account. - -```php -function listDisputes(?string $cursor = null, ?string $states = null, ?string $locationId = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `states` | [`?string(DisputeState)`](../../doc/models/dispute-state.md) | Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. | -| `locationId` | `?string` | Query, Optional | The ID of the location for which to return a list of disputes.
If not specified, the endpoint returns disputes associated with all locations. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListDisputesResponse`](../../doc/models/list-disputes-response.md). - -## Example Usage - -```php -$apiResponse = $disputesApi->listDisputes(); - -if ($apiResponse->isSuccess()) { - $listDisputesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Dispute - -Returns details about a specific dispute. - -```php -function retrieveDispute(string $disputeId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute you want more details about. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveDisputeResponse`](../../doc/models/retrieve-dispute-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$apiResponse = $disputesApi->retrieveDispute($disputeId); - -if ($apiResponse->isSuccess()) { - $retrieveDisputeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Accept Dispute - -Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and -updates the dispute state to ACCEPTED. - -Square debits the disputed amount from the seller’s Square account. If the Square account -does not have sufficient funds, Square debits the associated bank account. - -```php -function acceptDispute(string $disputeId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute you want to accept. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`AcceptDisputeResponse`](../../doc/models/accept-dispute-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$apiResponse = $disputesApi->acceptDispute($disputeId); - -if ($apiResponse->isSuccess()) { - $acceptDisputeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Dispute Evidence - -Returns a list of evidence associated with a dispute. - -```php -function listDisputeEvidence(string $disputeId, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListDisputeEvidenceResponse`](../../doc/models/list-dispute-evidence-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$apiResponse = $disputesApi->listDisputeEvidence($disputeId); - -if ($apiResponse->isSuccess()) { - $listDisputeEvidenceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Dispute Evidence File - -Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP -multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. - -```php -function createDisputeEvidenceFile( - string $disputeId, - ?CreateDisputeEvidenceFileRequest $request = null, - ?FileWrapper $imageFile = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. | -| `request` | [`?CreateDisputeEvidenceFileRequest`](../../doc/models/create-dispute-evidence-file-request.md) | Form (JSON-Encoded), Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. | -| `imageFile` | `?FileWrapper` | Form, Optional | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateDisputeEvidenceFileResponse`](../../doc/models/create-dispute-evidence-file-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$apiResponse = $disputesApi->createDisputeEvidenceFile($disputeId); - -if ($apiResponse->isSuccess()) { - $createDisputeEvidenceFileResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Dispute Evidence Text - -Uploads text to use as evidence for a dispute challenge. - -```php -function createDisputeEvidenceText(string $disputeId, CreateDisputeEvidenceTextRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. | -| `body` | [`CreateDisputeEvidenceTextRequest`](../../doc/models/create-dispute-evidence-text-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateDisputeEvidenceTextResponse`](../../doc/models/create-dispute-evidence-text-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$body = CreateDisputeEvidenceTextRequestBuilder::init( - 'ed3ee3933d946f1514d505d173c82648', - '1Z8888888888888888' -) - ->evidenceType(DisputeEvidenceType::TRACKING_NUMBER) - ->build(); - -$apiResponse = $disputesApi->createDisputeEvidenceText( - $disputeId, - $body -); - -if ($apiResponse->isSuccess()) { - $createDisputeEvidenceTextResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Dispute Evidence - -Removes specified evidence from a dispute. -Square does not send the bank any evidence that is removed. - -```php -function deleteDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to remove evidence. | -| `evidenceId` | `string` | Template, Required | The ID of the evidence you want to remove. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteDisputeEvidenceResponse`](../../doc/models/delete-dispute-evidence-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$evidenceId = 'evidence_id2'; - -$apiResponse = $disputesApi->deleteDisputeEvidence( - $disputeId, - $evidenceId -); - -if ($apiResponse->isSuccess()) { - $deleteDisputeEvidenceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Dispute Evidence - -Returns the metadata for the evidence specified in the request URL path. - -You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it. - -```php -function retrieveDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. | -| `evidenceId` | `string` | Template, Required | The ID of the evidence to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveDisputeEvidenceResponse`](../../doc/models/retrieve-dispute-evidence-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$evidenceId = 'evidence_id2'; - -$apiResponse = $disputesApi->retrieveDisputeEvidence( - $disputeId, - $evidenceId -); - -if ($apiResponse->isSuccess()) { - $retrieveDisputeEvidenceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Submit Evidence - -Submits evidence to the cardholder's bank. - -The evidence submitted by this endpoint includes evidence uploaded -using the [CreateDisputeEvidenceFile](../../doc/apis/disputes.md#create-dispute-evidence-file) and -[CreateDisputeEvidenceText](../../doc/apis/disputes.md#create-dispute-evidence-text) endpoints and -evidence automatically provided by Square, when available. Evidence cannot be removed from -a dispute after submission. - -```php -function submitEvidence(string $disputeId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to submit evidence. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SubmitEvidenceResponse`](../../doc/models/submit-evidence-response.md). - -## Example Usage - -```php -$disputeId = 'dispute_id2'; - -$apiResponse = $disputesApi->submitEvidence($disputeId); - -if ($apiResponse->isSuccess()) { - $submitEvidenceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/employees.md b/doc/apis/employees.md deleted file mode 100644 index a6f18aff..00000000 --- a/doc/apis/employees.md +++ /dev/null @@ -1,95 +0,0 @@ -# Employees - -```php -$employeesApi = $client->getEmployeesApi(); -``` - -## Class Name - -`EmployeesApi` - -## Methods - -* [List Employees](../../doc/apis/employees.md#list-employees) -* [Retrieve Employee](../../doc/apis/employees.md#retrieve-employee) - - -# List Employees - -**This endpoint is deprecated.** - -```php -function listEmployees( - ?string $locationId = null, - ?string $status = null, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `?string` | Query, Optional | - | -| `status` | [`?string(EmployeeStatus)`](../../doc/models/employee-status.md) | Query, Optional | Specifies the EmployeeStatus to filter the employee by. | -| `limit` | `?int` | Query, Optional | The number of employees to be returned on each page. | -| `cursor` | `?string` | Query, Optional | The token required to retrieve the specified page of results. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListEmployeesResponse`](../../doc/models/list-employees-response.md). - -## Example Usage - -```php -$apiResponse = $employeesApi->listEmployees(); - -if ($apiResponse->isSuccess()) { - $listEmployeesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Employee - -**This endpoint is deprecated.** - -```php -function retrieveEmployee(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | UUID for the employee that was requested. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveEmployeeResponse`](../../doc/models/retrieve-employee-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $employeesApi->retrieveEmployee($id); - -if ($apiResponse->isSuccess()) { - $retrieveEmployeeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/events.md b/doc/apis/events.md deleted file mode 100644 index 2f497258..00000000 --- a/doc/apis/events.md +++ /dev/null @@ -1,149 +0,0 @@ -# Events - -```php -$eventsApi = $client->getEventsApi(); -``` - -## Class Name - -`EventsApi` - -## Methods - -* [Search Events](../../doc/apis/events.md#search-events) -* [Disable Events](../../doc/apis/events.md#disable-events) -* [Enable Events](../../doc/apis/events.md#enable-events) -* [List Event Types](../../doc/apis/events.md#list-event-types) - - -# Search Events - -Search for Square API events that occur within a 28-day timeframe. - -```php -function searchEvents(SearchEventsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchEventsRequest`](../../doc/models/search-events-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchEventsResponse`](../../doc/models/search-events-response.md). - -## Example Usage - -```php -$body = SearchEventsRequestBuilder::init()->build(); - -$apiResponse = $eventsApi->searchEvents($body); - -if ($apiResponse->isSuccess()) { - $searchEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Disable Events - -Disables events to prevent them from being searchable. -All events are disabled by default. You must enable events to make them searchable. -Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. - -```php -function disableEvents(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DisableEventsResponse`](../../doc/models/disable-events-response.md). - -## Example Usage - -```php -$apiResponse = $eventsApi->disableEvents(); - -if ($apiResponse->isSuccess()) { - $disableEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Enable Events - -Enables events to make them searchable. Only events that occur while in the enabled state are searchable. - -```php -function enableEvents(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`EnableEventsResponse`](../../doc/models/enable-events-response.md). - -## Example Usage - -```php -$apiResponse = $eventsApi->enableEvents(); - -if ($apiResponse->isSuccess()) { - $enableEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Event Types - -Lists all event types that you can subscribe to as webhooks or query using the Events API. - -```php -function listEventTypes(?string $apiVersion = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `apiVersion` | `?string` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListEventTypesResponse`](../../doc/models/list-event-types-response.md). - -## Example Usage - -```php -$apiResponse = $eventsApi->listEventTypes(); - -if ($apiResponse->isSuccess()) { - $listEventTypesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/gift-card-activities.md b/doc/apis/gift-card-activities.md deleted file mode 100644 index 389b35dc..00000000 --- a/doc/apis/gift-card-activities.md +++ /dev/null @@ -1,121 +0,0 @@ -# Gift Card Activities - -```php -$giftCardActivitiesApi = $client->getGiftCardActivitiesApi(); -``` - -## Class Name - -`GiftCardActivitiesApi` - -## Methods - -* [List Gift Card Activities](../../doc/apis/gift-card-activities.md#list-gift-card-activities) -* [Create Gift Card Activity](../../doc/apis/gift-card-activities.md#create-gift-card-activity) - - -# List Gift Card Activities - -Lists gift card activities. By default, you get gift card activities for all -gift cards in the seller's account. You can optionally specify query parameters to -filter the list. For example, you can get a list of gift card activities for a gift card, -for all gift cards in a specific region, or for activities within a time window. - -```php -function listGiftCardActivities( - ?string $giftCardId = null, - ?string $type = null, - ?string $locationId = null, - ?string $beginTime = null, - ?string $endTime = null, - ?int $limit = null, - ?string $cursor = null, - ?string $sortOrder = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `giftCardId` | `?string` | Query, Optional | If a gift card ID is provided, the endpoint returns activities related
to the specified gift card. Otherwise, the endpoint returns all gift card activities for
the seller. | -| `type` | `?string` | Query, Optional | If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type.
Otherwise, the endpoint returns all types of gift card activities. | -| `locationId` | `?string` | Query, Optional | If a location ID is provided, the endpoint returns gift card activities for the specified location.
Otherwise, the endpoint returns gift card activities for all locations. | -| `beginTime` | `?string` | Query, Optional | The timestamp for the beginning of the reporting period, in RFC 3339 format.
This start time is inclusive. The default value is the current time minus one year. | -| `endTime` | `?string` | Query, Optional | The timestamp for the end of the reporting period, in RFC 3339 format.
This end time is inclusive. The default value is the current time. | -| `limit` | `?int` | Query, Optional | If a limit is provided, the endpoint returns the specified number
of results (or fewer) per page. The maximum value is 100. The default value is 50.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `sortOrder` | `?string` | Query, Optional | The order in which the endpoint returns the activities, based on `created_at`.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListGiftCardActivitiesResponse`](../../doc/models/list-gift-card-activities-response.md). - -## Example Usage - -```php -$apiResponse = $giftCardActivitiesApi->listGiftCardActivities(); - -if ($apiResponse->isSuccess()) { - $listGiftCardActivitiesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Gift Card Activity - -Creates a gift card activity to manage the balance or state of a [gift card](../../doc/models/gift-card.md). -For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. - -```php -function createGiftCardActivity(CreateGiftCardActivityRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateGiftCardActivityRequest`](../../doc/models/create-gift-card-activity-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateGiftCardActivityResponse`](../../doc/models/create-gift-card-activity-response.md). - -## Example Usage - -```php -$body = CreateGiftCardActivityRequestBuilder::init( - 'U16kfr-kA70er-q4Rsym-7U7NnY', - GiftCardActivityBuilder::init( - GiftCardActivityType::ACTIVATE, - '81FN9BNFZTKS4' - ) - ->giftCardId('gftc:6d55a72470d940c6ba09c0ab8ad08d20') - ->activateActivityDetails( - GiftCardActivityActivateBuilder::init() - ->orderId('jJNGHm4gLI6XkFbwtiSLqK72KkAZY') - ->lineItemUid('eIWl7X0nMuO9Ewbh0ChIx') - ->build() - ) - ->build() -)->build(); - -$apiResponse = $giftCardActivitiesApi->createGiftCardActivity($body); - -if ($apiResponse->isSuccess()) { - $createGiftCardActivityResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/gift-cards.md b/doc/apis/gift-cards.md deleted file mode 100644 index 3c81676e..00000000 --- a/doc/apis/gift-cards.md +++ /dev/null @@ -1,318 +0,0 @@ -# Gift Cards - -```php -$giftCardsApi = $client->getGiftCardsApi(); -``` - -## Class Name - -`GiftCardsApi` - -## Methods - -* [List Gift Cards](../../doc/apis/gift-cards.md#list-gift-cards) -* [Create Gift Card](../../doc/apis/gift-cards.md#create-gift-card) -* [Retrieve Gift Card From GAN](../../doc/apis/gift-cards.md#retrieve-gift-card-from-gan) -* [Retrieve Gift Card From Nonce](../../doc/apis/gift-cards.md#retrieve-gift-card-from-nonce) -* [Link Customer to Gift Card](../../doc/apis/gift-cards.md#link-customer-to-gift-card) -* [Unlink Customer From Gift Card](../../doc/apis/gift-cards.md#unlink-customer-from-gift-card) -* [Retrieve Gift Card](../../doc/apis/gift-cards.md#retrieve-gift-card) - - -# List Gift Cards - -Lists all gift cards. You can specify optional filters to retrieve -a subset of the gift cards. Results are sorted by `created_at` in ascending order. - -```php -function listGiftCards( - ?string $type = null, - ?string $state = null, - ?int $limit = null, - ?string $cursor = null, - ?string $customerId = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | `?string` | Query, Optional | If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.
Otherwise, the endpoint returns gift cards of all types. | -| `state` | `?string` | Query, Optional | If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.
Otherwise, the endpoint returns the gift cards of all states. | -| `limit` | `?int` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.
The maximum value is 200. The default value is 30.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `customerId` | `?string` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListGiftCardsResponse`](../../doc/models/list-gift-cards-response.md). - -## Example Usage - -```php -$apiResponse = $giftCardsApi->listGiftCards(); - -if ($apiResponse->isSuccess()) { - $listGiftCardsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Gift Card - -Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card -has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call -[CreateGiftCardActivity](../../doc/apis/gift-card-activities.md#create-gift-card-activity) and create an `ACTIVATE` -activity with the initial balance. Alternatively, you can use [RefundPayment](../../doc/apis/refunds.md#refund-payment) -to refund a payment to the new gift card. - -```php -function createGiftCard(CreateGiftCardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateGiftCardRequest`](../../doc/models/create-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateGiftCardResponse`](../../doc/models/create-gift-card-response.md). - -## Example Usage - -```php -$body = CreateGiftCardRequestBuilder::init( - 'NC9Tm69EjbjtConu', - '81FN9BNFZTKS4', - GiftCardBuilder::init( - GiftCardType::DIGITAL - )->build() -)->build(); - -$apiResponse = $giftCardsApi->createGiftCard($body); - -if ($apiResponse->isSuccess()) { - $createGiftCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Gift Card From GAN - -Retrieves a gift card using the gift card account number (GAN). - -```php -function retrieveGiftCardFromGAN(RetrieveGiftCardFromGANRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`RetrieveGiftCardFromGANRequest`](../../doc/models/retrieve-gift-card-from-gan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveGiftCardFromGANResponse`](../../doc/models/retrieve-gift-card-from-gan-response.md). - -## Example Usage - -```php -$body = RetrieveGiftCardFromGANRequestBuilder::init( - '7783320001001635' -)->build(); - -$apiResponse = $giftCardsApi->retrieveGiftCardFromGAN($body); - -if ($apiResponse->isSuccess()) { - $retrieveGiftCardFromGANResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Gift Card From Nonce - -Retrieves a gift card using a secure payment token that represents the gift card. - -```php -function retrieveGiftCardFromNonce(RetrieveGiftCardFromNonceRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`RetrieveGiftCardFromNonceRequest`](../../doc/models/retrieve-gift-card-from-nonce-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveGiftCardFromNonceResponse`](../../doc/models/retrieve-gift-card-from-nonce-response.md). - -## Example Usage - -```php -$body = RetrieveGiftCardFromNonceRequestBuilder::init( - 'cnon:7783322135245171' -)->build(); - -$apiResponse = $giftCardsApi->retrieveGiftCardFromNonce($body); - -if ($apiResponse->isSuccess()) { - $retrieveGiftCardFromNonceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Link Customer to Gift Card - -Links a customer to a gift card, which is also referred to as adding a card on file. - -```php -function linkCustomerToGiftCard(string $giftCardId, LinkCustomerToGiftCardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `giftCardId` | `string` | Template, Required | The ID of the gift card to be linked. | -| `body` | [`LinkCustomerToGiftCardRequest`](../../doc/models/link-customer-to-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`LinkCustomerToGiftCardResponse`](../../doc/models/link-customer-to-gift-card-response.md). - -## Example Usage - -```php -$giftCardId = 'gift_card_id8'; - -$body = LinkCustomerToGiftCardRequestBuilder::init( - 'GKY0FZ3V717AH8Q2D821PNT2ZW' -)->build(); - -$apiResponse = $giftCardsApi->linkCustomerToGiftCard( - $giftCardId, - $body -); - -if ($apiResponse->isSuccess()) { - $linkCustomerToGiftCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Unlink Customer From Gift Card - -Unlinks a customer from a gift card, which is also referred to as removing a card on file. - -```php -function unlinkCustomerFromGiftCard(string $giftCardId, UnlinkCustomerFromGiftCardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `giftCardId` | `string` | Template, Required | The ID of the gift card to be unlinked. | -| `body` | [`UnlinkCustomerFromGiftCardRequest`](../../doc/models/unlink-customer-from-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UnlinkCustomerFromGiftCardResponse`](../../doc/models/unlink-customer-from-gift-card-response.md). - -## Example Usage - -```php -$giftCardId = 'gift_card_id8'; - -$body = UnlinkCustomerFromGiftCardRequestBuilder::init( - 'GKY0FZ3V717AH8Q2D821PNT2ZW' -)->build(); - -$apiResponse = $giftCardsApi->unlinkCustomerFromGiftCard( - $giftCardId, - $body -); - -if ($apiResponse->isSuccess()) { - $unlinkCustomerFromGiftCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Gift Card - -Retrieves a gift card using the gift card ID. - -```php -function retrieveGiftCard(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The ID of the gift card to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveGiftCardResponse`](../../doc/models/retrieve-gift-card-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $giftCardsApi->retrieveGiftCard($id); - -if ($apiResponse->isSuccess()) { - $retrieveGiftCardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/inventory.md b/doc/apis/inventory.md deleted file mode 100644 index a3b90f9e..00000000 --- a/doc/apis/inventory.md +++ /dev/null @@ -1,689 +0,0 @@ -# Inventory - -```php -$inventoryApi = $client->getInventoryApi(); -``` - -## Class Name - -`InventoryApi` - -## Methods - -* [Deprecated Retrieve Inventory Adjustment](../../doc/apis/inventory.md#deprecated-retrieve-inventory-adjustment) -* [Retrieve Inventory Adjustment](../../doc/apis/inventory.md#retrieve-inventory-adjustment) -* [Deprecated Batch Change Inventory](../../doc/apis/inventory.md#deprecated-batch-change-inventory) -* [Deprecated Batch Retrieve Inventory Changes](../../doc/apis/inventory.md#deprecated-batch-retrieve-inventory-changes) -* [Deprecated Batch Retrieve Inventory Counts](../../doc/apis/inventory.md#deprecated-batch-retrieve-inventory-counts) -* [Batch Change Inventory](../../doc/apis/inventory.md#batch-change-inventory) -* [Batch Retrieve Inventory Changes](../../doc/apis/inventory.md#batch-retrieve-inventory-changes) -* [Batch Retrieve Inventory Counts](../../doc/apis/inventory.md#batch-retrieve-inventory-counts) -* [Deprecated Retrieve Inventory Physical Count](../../doc/apis/inventory.md#deprecated-retrieve-inventory-physical-count) -* [Retrieve Inventory Physical Count](../../doc/apis/inventory.md#retrieve-inventory-physical-count) -* [Retrieve Inventory Transfer](../../doc/apis/inventory.md#retrieve-inventory-transfer) -* [Retrieve Inventory Count](../../doc/apis/inventory.md#retrieve-inventory-count) -* [Retrieve Inventory Changes](../../doc/apis/inventory.md#retrieve-inventory-changes) - - -# Deprecated Retrieve Inventory Adjustment - -**This endpoint is deprecated.** - -Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL -is updated to conform to the standard convention. - -```php -function deprecatedRetrieveInventoryAdjustment(string $adjustmentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryAdjustmentResponse`](../../doc/models/retrieve-inventory-adjustment-response.md). - -## Example Usage - -```php -$adjustmentId = 'adjustment_id0'; - -$apiResponse = $inventoryApi->deprecatedRetrieveInventoryAdjustment($adjustmentId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryAdjustmentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Inventory Adjustment - -Returns the [InventoryAdjustment](../../doc/models/inventory-adjustment.md) object -with the provided `adjustment_id`. - -```php -function retrieveInventoryAdjustment(string $adjustmentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryAdjustmentResponse`](../../doc/models/retrieve-inventory-adjustment-response.md). - -## Example Usage - -```php -$adjustmentId = 'adjustment_id0'; - -$apiResponse = $inventoryApi->retrieveInventoryAdjustment($adjustmentId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryAdjustmentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Deprecated Batch Change Inventory - -**This endpoint is deprecated.** - -Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL -is updated to conform to the standard convention. - -```php -function deprecatedBatchChangeInventory(BatchChangeInventoryRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchChangeInventoryRequest`](../../doc/models/batch-change-inventory-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchChangeInventoryResponse`](../../doc/models/batch-change-inventory-response.md). - -## Example Usage - -```php -$body = BatchChangeInventoryRequestBuilder::init( - '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe' -) - ->changes( - [ - InventoryChangeBuilder::init() - ->type(InventoryChangeType::PHYSICAL_COUNT) - ->physicalCount( - InventoryPhysicalCountBuilder::init() - ->referenceId('1536bfbf-efed-48bf-b17d-a197141b2a92') - ->catalogObjectId('W62UWFY35CWMYGVWK6TWJDNI') - ->state(InventoryState::IN_STOCK) - ->locationId('C6W5YS5QM06F5') - ->quantity('53') - ->teamMemberId('LRK57NSQ5X7PUD05') - ->occurredAt('2016-11-16T22:25:24.878Z') - ->build() - ) - ->build() - ] - ) - ->ignoreUnchangedCounts(true) - ->build(); - -$apiResponse = $inventoryApi->deprecatedBatchChangeInventory($body); - -if ($apiResponse->isSuccess()) { - $batchChangeInventoryResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Deprecated Batch Retrieve Inventory Changes - -**This endpoint is deprecated.** - -Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL -is updated to conform to the standard convention. - -```php -function deprecatedBatchRetrieveInventoryChanges(BatchRetrieveInventoryChangesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveInventoryChangesRequest`](../../doc/models/batch-retrieve-inventory-changes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveInventoryChangesResponse`](../../doc/models/batch-retrieve-inventory-changes-response.md). - -## Example Usage - -```php -$body = BatchRetrieveInventoryChangesRequestBuilder::init() - ->catalogObjectIds( - [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ] - ) - ->locationIds( - [ - 'C6W5YS5QM06F5' - ] - ) - ->types( - [ - InventoryChangeType::PHYSICAL_COUNT - ] - ) - ->states( - [ - InventoryState::IN_STOCK - ] - ) - ->updatedAfter('2016-11-01T00:00:00.000Z') - ->updatedBefore('2016-12-01T00:00:00.000Z') - ->build(); - -$apiResponse = $inventoryApi->deprecatedBatchRetrieveInventoryChanges($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveInventoryChangesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Deprecated Batch Retrieve Inventory Counts - -**This endpoint is deprecated.** - -Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL -is updated to conform to the standard convention. - -```php -function deprecatedBatchRetrieveInventoryCounts(BatchRetrieveInventoryCountsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveInventoryCountsRequest`](../../doc/models/batch-retrieve-inventory-counts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveInventoryCountsResponse`](../../doc/models/batch-retrieve-inventory-counts-response.md). - -## Example Usage - -```php -$body = BatchRetrieveInventoryCountsRequestBuilder::init() - ->catalogObjectIds( - [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ] - ) - ->locationIds( - [ - '59TNP9SA8VGDA' - ] - ) - ->updatedAfter('2016-11-16T00:00:00.000Z') - ->build(); - -$apiResponse = $inventoryApi->deprecatedBatchRetrieveInventoryCounts($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveInventoryCountsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Change Inventory - -Applies adjustments and counts to the provided item quantities. - -On success: returns the current calculated counts for all objects -referenced in the request. -On failure: returns a list of related errors. - -```php -function batchChangeInventory(BatchChangeInventoryRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchChangeInventoryRequest`](../../doc/models/batch-change-inventory-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchChangeInventoryResponse`](../../doc/models/batch-change-inventory-response.md). - -## Example Usage - -```php -$body = BatchChangeInventoryRequestBuilder::init( - '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe' -) - ->changes( - [ - InventoryChangeBuilder::init() - ->type(InventoryChangeType::PHYSICAL_COUNT) - ->physicalCount( - InventoryPhysicalCountBuilder::init() - ->referenceId('1536bfbf-efed-48bf-b17d-a197141b2a92') - ->catalogObjectId('W62UWFY35CWMYGVWK6TWJDNI') - ->state(InventoryState::IN_STOCK) - ->locationId('C6W5YS5QM06F5') - ->quantity('53') - ->teamMemberId('LRK57NSQ5X7PUD05') - ->occurredAt('2016-11-16T22:25:24.878Z') - ->build() - ) - ->build() - ] - ) - ->ignoreUnchangedCounts(true) - ->build(); - -$apiResponse = $inventoryApi->batchChangeInventory($body); - -if ($apiResponse->isSuccess()) { - $batchChangeInventoryResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Retrieve Inventory Changes - -Returns historical physical counts and adjustments based on the -provided filter criteria. - -Results are paginated and sorted in ascending order according their -`occurred_at` timestamp (oldest first). - -BatchRetrieveInventoryChanges is a catch-all query endpoint for queries -that cannot be handled by other, simpler endpoints. - -```php -function batchRetrieveInventoryChanges(BatchRetrieveInventoryChangesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveInventoryChangesRequest`](../../doc/models/batch-retrieve-inventory-changes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveInventoryChangesResponse`](../../doc/models/batch-retrieve-inventory-changes-response.md). - -## Example Usage - -```php -$body = BatchRetrieveInventoryChangesRequestBuilder::init() - ->catalogObjectIds( - [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ] - ) - ->locationIds( - [ - 'C6W5YS5QM06F5' - ] - ) - ->types( - [ - InventoryChangeType::PHYSICAL_COUNT - ] - ) - ->states( - [ - InventoryState::IN_STOCK - ] - ) - ->updatedAfter('2016-11-01T00:00:00.000Z') - ->updatedBefore('2016-12-01T00:00:00.000Z') - ->build(); - -$apiResponse = $inventoryApi->batchRetrieveInventoryChanges($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveInventoryChangesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Retrieve Inventory Counts - -Returns current counts for the provided -[CatalogObject](../../doc/models/catalog-object.md)s at the requested -[Location](../../doc/models/location.md)s. - -Results are paginated and sorted in descending order according to their -`calculated_at` timestamp (newest first). - -When `updated_after` is specified, only counts that have changed since that -time (based on the server timestamp for the most recent change) are -returned. This allows clients to perform a "sync" operation, for example -in response to receiving a Webhook notification. - -```php -function batchRetrieveInventoryCounts(BatchRetrieveInventoryCountsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveInventoryCountsRequest`](../../doc/models/batch-retrieve-inventory-counts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveInventoryCountsResponse`](../../doc/models/batch-retrieve-inventory-counts-response.md). - -## Example Usage - -```php -$body = BatchRetrieveInventoryCountsRequestBuilder::init() - ->catalogObjectIds( - [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ] - ) - ->locationIds( - [ - '59TNP9SA8VGDA' - ] - ) - ->updatedAfter('2016-11-16T00:00:00.000Z') - ->build(); - -$apiResponse = $inventoryApi->batchRetrieveInventoryCounts($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveInventoryCountsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Deprecated Retrieve Inventory Physical Count - -**This endpoint is deprecated.** - -Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL -is updated to conform to the standard convention. - -```php -function deprecatedRetrieveInventoryPhysicalCount(string $physicalCountId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryPhysicalCountResponse`](../../doc/models/retrieve-inventory-physical-count-response.md). - -## Example Usage - -```php -$physicalCountId = 'physical_count_id2'; - -$apiResponse = $inventoryApi->deprecatedRetrieveInventoryPhysicalCount($physicalCountId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryPhysicalCountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Inventory Physical Count - -Returns the [InventoryPhysicalCount](../../doc/models/inventory-physical-count.md) -object with the provided `physical_count_id`. - -```php -function retrieveInventoryPhysicalCount(string $physicalCountId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryPhysicalCountResponse`](../../doc/models/retrieve-inventory-physical-count-response.md). - -## Example Usage - -```php -$physicalCountId = 'physical_count_id2'; - -$apiResponse = $inventoryApi->retrieveInventoryPhysicalCount($physicalCountId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryPhysicalCountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Inventory Transfer - -Returns the [InventoryTransfer](../../doc/models/inventory-transfer.md) object -with the provided `transfer_id`. - -```php -function retrieveInventoryTransfer(string $transferId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `transferId` | `string` | Template, Required | ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryTransferResponse`](../../doc/models/retrieve-inventory-transfer-response.md). - -## Example Usage - -```php -$transferId = 'transfer_id6'; - -$apiResponse = $inventoryApi->retrieveInventoryTransfer($transferId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryTransferResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Inventory Count - -Retrieves the current calculated stock count for a given -[CatalogObject](../../doc/models/catalog-object.md) at a given set of -[Location](../../doc/models/location.md)s. Responses are paginated and unsorted. -For more sophisticated queries, use a batch endpoint. - -```php -function retrieveInventoryCount( - string $catalogObjectId, - ?string $locationIds = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | -| `locationIds` | `?string` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryCountResponse`](../../doc/models/retrieve-inventory-count-response.md). - -## Example Usage - -```php -$catalogObjectId = 'catalog_object_id6'; - -$apiResponse = $inventoryApi->retrieveInventoryCount($catalogObjectId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryCountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Inventory Changes - -**This endpoint is deprecated.** - -Returns a set of physical counts and inventory adjustments for the -provided [CatalogObject](entity:CatalogObject) at the requested -[Location](entity:Location)s. - -You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) -and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. - -Results are paginated and sorted in descending order according to their -`occurred_at` timestamp (newest first). - -There are no limits on how far back the caller can page. This endpoint can be -used to display recent changes for a specific item. For more -sophisticated queries, use a batch endpoint. - -```php -function retrieveInventoryChanges( - string $catalogObjectId, - ?string $locationIds = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | -| `locationIds` | `?string` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveInventoryChangesResponse`](../../doc/models/retrieve-inventory-changes-response.md). - -## Example Usage - -```php -$catalogObjectId = 'catalog_object_id6'; - -$apiResponse = $inventoryApi->retrieveInventoryChanges($catalogObjectId); - -if ($apiResponse->isSuccess()) { - $retrieveInventoryChangesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/invoices.md b/doc/apis/invoices.md deleted file mode 100644 index 1c343b20..00000000 --- a/doc/apis/invoices.md +++ /dev/null @@ -1,578 +0,0 @@ -# Invoices - -```php -$invoicesApi = $client->getInvoicesApi(); -``` - -## Class Name - -`InvoicesApi` - -## Methods - -* [List Invoices](../../doc/apis/invoices.md#list-invoices) -* [Create Invoice](../../doc/apis/invoices.md#create-invoice) -* [Search Invoices](../../doc/apis/invoices.md#search-invoices) -* [Delete Invoice](../../doc/apis/invoices.md#delete-invoice) -* [Get Invoice](../../doc/apis/invoices.md#get-invoice) -* [Update Invoice](../../doc/apis/invoices.md#update-invoice) -* [Create Invoice Attachment](../../doc/apis/invoices.md#create-invoice-attachment) -* [Delete Invoice Attachment](../../doc/apis/invoices.md#delete-invoice-attachment) -* [Cancel Invoice](../../doc/apis/invoices.md#cancel-invoice) -* [Publish Invoice](../../doc/apis/invoices.md#publish-invoice) - - -# List Invoices - -Returns a list of invoices for a given location. The response -is paginated. If truncated, the response includes a `cursor` that you -use in a subsequent request to retrieve the next set of invoices. - -```php -function listInvoices(string $locationId, ?string $cursor = null, ?int $limit = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Query, Required | The ID of the location for which to list invoices. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListInvoicesResponse`](../../doc/models/list-invoices-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $invoicesApi->listInvoices($locationId); - -if ($apiResponse->isSuccess()) { - $listInvoicesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Invoice - -Creates a draft [invoice](../../doc/models/invoice.md) -for an order created using the Orders API. - -A draft invoice remains in your account and no action is taken. -You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). - -```php -function createInvoice(CreateInvoiceRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateInvoiceResponse`](../../doc/models/create-invoice-response.md). - -## Example Usage - -```php -$body = CreateInvoiceRequestBuilder::init( - InvoiceBuilder::init() - ->locationId('ES0RJRZYEC39A') - ->orderId('CAISENgvlJ6jLWAzERDzjyHVybY') - ->primaryRecipient( - InvoiceRecipientBuilder::init() - ->customerId('JDKYHBWT1D4F8MFH63DBMEN8Y4') - ->build() - ) - ->paymentRequests( - [ - InvoicePaymentRequestBuilder::init() - ->requestType(InvoiceRequestType::BALANCE) - ->dueDate('2030-01-24') - ->tippingEnabled(true) - ->automaticPaymentSource(InvoiceAutomaticPaymentSource::NONE) - ->reminders( - [ - InvoicePaymentReminderBuilder::init() - ->relativeScheduledDays(-1) - ->message('Your invoice is due tomorrow') - ->build() - ] - ) - ->build() - ] - ) - ->deliveryMethod(InvoiceDeliveryMethod::EMAIL) - ->invoiceNumber('inv-100') - ->title('Event Planning Services') - ->description('We appreciate your business!') - ->scheduledAt('2030-01-13T10:00:00Z') - ->acceptedPaymentMethods( - InvoiceAcceptedPaymentMethodsBuilder::init() - ->card(true) - ->squareGiftCard(false) - ->bankAccount(false) - ->buyNowPayLater(false) - ->cashAppPay(false) - ->build() - ) - ->customFields( - [ - InvoiceCustomFieldBuilder::init() - ->label('Event Reference Number') - ->value('Ref. #1234') - ->placement(InvoiceCustomFieldPlacement::ABOVE_LINE_ITEMS) - ->build(), - InvoiceCustomFieldBuilder::init() - ->label('Terms of Service') - ->value('The terms of service are...') - ->placement(InvoiceCustomFieldPlacement::BELOW_LINE_ITEMS) - ->build() - ] - ) - ->saleOrServiceDate('2030-01-24') - ->storePaymentMethodEnabled(false) - ->build() -) - ->idempotencyKey('ce3748f9-5fc1-4762-aa12-aae5e843f1f4') - ->build(); - -$apiResponse = $invoicesApi->createInvoice($body); - -if ($apiResponse->isSuccess()) { - $createInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Invoices - -Searches for invoices from a location specified in -the filter. You can optionally specify customers in the filter for whom to -retrieve invoices. In the current implementation, you can only specify one location and -optionally one customer. - -The response is paginated. If truncated, the response includes a `cursor` -that you use in a subsequent request to retrieve the next set of invoices. - -```php -function searchInvoices(SearchInvoicesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchInvoicesRequest`](../../doc/models/search-invoices-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchInvoicesResponse`](../../doc/models/search-invoices-response.md). - -## Example Usage - -```php -$body = SearchInvoicesRequestBuilder::init( - InvoiceQueryBuilder::init( - InvoiceFilterBuilder::init( - [ - 'ES0RJRZYEC39A' - ] - ) - ->customerIds( - [ - 'JDKYHBWT1D4F8MFH63DBMEN8Y4' - ] - ) - ->build() - ) - ->sort( - InvoiceSortBuilder::init() - ->order(SortOrder::DESC) - ->build() - ) - ->build() -)->build(); - -$apiResponse = $invoicesApi->searchInvoices($body); - -if ($apiResponse->isSuccess()) { - $searchInvoicesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Invoice - -Deletes the specified invoice. When an invoice is deleted, the -associated order status changes to CANCELED. You can only delete a draft -invoice (you cannot delete a published invoice, including one that is scheduled for processing). - -```php -function deleteInvoice(string $invoiceId, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the invoice to delete. | -| `version` | `?int` | Query, Optional | The version of the [invoice](entity:Invoice) to delete.
If you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or
[ListInvoices](api-endpoint:Invoices-ListInvoices). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteInvoiceResponse`](../../doc/models/delete-invoice-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$apiResponse = $invoicesApi->deleteInvoice($invoiceId); - -if ($apiResponse->isSuccess()) { - $deleteInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Invoice - -Retrieves an invoice by invoice ID. - -```php -function getInvoice(string $invoiceId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the invoice to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetInvoiceResponse`](../../doc/models/get-invoice-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$apiResponse = $invoicesApi->getInvoice($invoiceId); - -if ($apiResponse->isSuccess()) { - $getInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Invoice - -Updates an invoice. This endpoint supports sparse updates, so you only need -to specify the fields you want to change along with the required `version` field. -Some restrictions apply to updating invoices. For example, you cannot change the -`order_id` or `location_id` field. - -```php -function updateInvoice(string $invoiceId, UpdateInvoiceRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the invoice to update. | -| `body` | [`UpdateInvoiceRequest`](../../doc/models/update-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateInvoiceResponse`](../../doc/models/update-invoice-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$body = UpdateInvoiceRequestBuilder::init( - InvoiceBuilder::init() - ->version(1) - ->paymentRequests( - [ - InvoicePaymentRequestBuilder::init() - ->uid('2da7964f-f3d2-4f43-81e8-5aa220bf3355') - ->tippingEnabled(false) - ->reminders( - [ - InvoicePaymentReminderBuilder::init()->build(), - InvoicePaymentReminderBuilder::init()->build(), - InvoicePaymentReminderBuilder::init()->build() - ] - )->build() - ] - )->build() -) - ->idempotencyKey('4ee82288-0910-499e-ab4c-5d0071dad1be') - ->build(); - -$apiResponse = $invoicesApi->updateInvoice( - $invoiceId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Invoice Attachment - -Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads -with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file -in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. - -Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices -in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. - -```php -function createInvoiceAttachment( - string $invoiceId, - ?CreateInvoiceAttachmentRequest $request = null, - ?FileWrapper $imageFile = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to attach the file to. | -| `request` | [`?CreateInvoiceAttachmentRequest`](../../doc/models/create-invoice-attachment-request.md) | Form (JSON-Encoded), Optional | Represents a [CreateInvoiceAttachment](../../doc/apis/invoices.md#create-invoice-attachment) request. | -| `imageFile` | `?FileWrapper` | Form, Optional | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateInvoiceAttachmentResponse`](../../doc/models/create-invoice-attachment-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$request = CreateInvoiceAttachmentRequestBuilder::init() - ->idempotencyKey('ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3') - ->description('Service contract') - ->build(); - -$apiResponse = $invoicesApi->createInvoiceAttachment( - $invoiceId, - $request -); - -if ($apiResponse->isSuccess()) { - $createInvoiceAttachmentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Invoice Attachment - -Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only -from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. - -```php -function deleteInvoiceAttachment(string $invoiceId, string $attachmentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to delete the attachment from. | -| `attachmentId` | `string` | Template, Required | The ID of the [attachment](entity:InvoiceAttachment) to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteInvoiceAttachmentResponse`](../../doc/models/delete-invoice-attachment-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$attachmentId = 'attachment_id6'; - -$apiResponse = $invoicesApi->deleteInvoiceAttachment( - $invoiceId, - $attachmentId -); - -if ($apiResponse->isSuccess()) { - $deleteInvoiceAttachmentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Invoice - -Cancels an invoice. The seller cannot collect payments for -the canceled invoice. - -You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. - -```php -function cancelInvoice(string $invoiceId, CancelInvoiceRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to cancel. | -| `body` | [`CancelInvoiceRequest`](../../doc/models/cancel-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelInvoiceResponse`](../../doc/models/cancel-invoice-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$body = CancelInvoiceRequestBuilder::init( - 0 -)->build(); - -$apiResponse = $invoicesApi->cancelInvoice( - $invoiceId, - $body -); - -if ($apiResponse->isSuccess()) { - $cancelInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Publish Invoice - -Publishes the specified draft invoice. - -After an invoice is published, Square -follows up based on the invoice configuration. For example, Square -sends the invoice to the customer's email address, charges the customer's card on file, or does -nothing. Square also makes the invoice available on a Square-hosted invoice page. - -The invoice `status` also changes from `DRAFT` to a status -based on the invoice configuration. For example, the status changes to `UNPAID` if -Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the -invoice amount. - -In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` -and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. - -```php -function publishInvoice(string $invoiceId, PublishInvoiceRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the invoice to publish. | -| `body` | [`PublishInvoiceRequest`](../../doc/models/publish-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`PublishInvoiceResponse`](../../doc/models/publish-invoice-response.md). - -## Example Usage - -```php -$invoiceId = 'invoice_id0'; - -$body = PublishInvoiceRequestBuilder::init( - 1 -) - ->idempotencyKey('32da42d0-1997-41b0-826b-f09464fc2c2e') - ->build(); - -$apiResponse = $invoicesApi->publishInvoice( - $invoiceId, - $body -); - -if ($apiResponse->isSuccess()) { - $publishInvoiceResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/labor.md b/doc/apis/labor.md deleted file mode 100644 index 7f76b2b3..00000000 --- a/doc/apis/labor.md +++ /dev/null @@ -1,829 +0,0 @@ -# Labor - -```php -$laborApi = $client->getLaborApi(); -``` - -## Class Name - -`LaborApi` - -## Methods - -* [List Break Types](../../doc/apis/labor.md#list-break-types) -* [Create Break Type](../../doc/apis/labor.md#create-break-type) -* [Delete Break Type](../../doc/apis/labor.md#delete-break-type) -* [Get Break Type](../../doc/apis/labor.md#get-break-type) -* [Update Break Type](../../doc/apis/labor.md#update-break-type) -* [List Employee Wages](../../doc/apis/labor.md#list-employee-wages) -* [Get Employee Wage](../../doc/apis/labor.md#get-employee-wage) -* [Create Shift](../../doc/apis/labor.md#create-shift) -* [Search Shifts](../../doc/apis/labor.md#search-shifts) -* [Delete Shift](../../doc/apis/labor.md#delete-shift) -* [Get Shift](../../doc/apis/labor.md#get-shift) -* [Update Shift](../../doc/apis/labor.md#update-shift) -* [List Team Member Wages](../../doc/apis/labor.md#list-team-member-wages) -* [Get Team Member Wage](../../doc/apis/labor.md#get-team-member-wage) -* [List Workweek Configs](../../doc/apis/labor.md#list-workweek-configs) -* [Update Workweek Config](../../doc/apis/labor.md#update-workweek-config) - - -# List Break Types - -Returns a paginated list of `BreakType` instances for a business. - -```php -function listBreakTypes(?string $locationId = null, ?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `?string` | Query, Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | -| `limit` | `?int` | Query, Optional | The maximum number of `BreakType` results to return per page. The number can range between 1
and 200. The default is 200. | -| `cursor` | `?string` | Query, Optional | A pointer to the next page of `BreakType` results to fetch. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListBreakTypesResponse`](../../doc/models/list-break-types-response.md). - -## Example Usage - -```php -$apiResponse = $laborApi->listBreakTypes(); - -if ($apiResponse->isSuccess()) { - $listBreakTypesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Break Type - -Creates a new `BreakType`. - -A `BreakType` is a template for creating `Break` objects. -You must provide the following values in your request to this -endpoint: - -- `location_id` -- `break_name` -- `expected_duration` -- `is_paid` - -You can only have three `BreakType` instances per location. If you attempt to add a fourth -`BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." -is returned. - -```php -function createBreakType(CreateBreakTypeRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateBreakTypeRequest`](../../doc/models/create-break-type-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateBreakTypeResponse`](../../doc/models/create-break-type-response.md). - -## Example Usage - -```php -$body = CreateBreakTypeRequestBuilder::init( - BreakTypeBuilder::init( - 'CGJN03P1D08GF', - 'Lunch Break', - 'PT30M', - true - )->build() -) - ->idempotencyKey('PAD3NG5KSN2GL') - ->build(); - -$apiResponse = $laborApi->createBreakType($body); - -if ($apiResponse->isSuccess()) { - $createBreakTypeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Break Type - -Deletes an existing `BreakType`. - -A `BreakType` can be deleted even if it is referenced from a `Shift`. - -```php -function deleteBreakType(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `BreakType` being deleted. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteBreakTypeResponse`](../../doc/models/delete-break-type-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->deleteBreakType($id); - -if ($apiResponse->isSuccess()) { - $deleteBreakTypeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Break Type - -Returns a single `BreakType` specified by `id`. - -```php -function getBreakType(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `BreakType` being retrieved. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetBreakTypeResponse`](../../doc/models/get-break-type-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->getBreakType($id); - -if ($apiResponse->isSuccess()) { - $getBreakTypeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Break Type - -Updates an existing `BreakType`. - -```php -function updateBreakType(string $id, UpdateBreakTypeRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `BreakType` being updated. | -| `body` | [`UpdateBreakTypeRequest`](../../doc/models/update-break-type-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateBreakTypeResponse`](../../doc/models/update-break-type-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$body = UpdateBreakTypeRequestBuilder::init( - BreakTypeBuilder::init( - '26M7H24AZ9N6R', - 'Lunch', - 'PT50M', - true - ) - ->version(1) - ->build() -)->build(); - -$apiResponse = $laborApi->updateBreakType( - $id, - $body -); - -if ($apiResponse->isSuccess()) { - $updateBreakTypeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Employee Wages - -**This endpoint is deprecated.** - -Returns a paginated list of `EmployeeWage` instances for a business. - -```php -function listEmployeeWages(?string $employeeId = null, ?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `employeeId` | `?string` | Query, Optional | Filter the returned wages to only those that are associated with the specified employee. | -| `limit` | `?int` | Query, Optional | The maximum number of `EmployeeWage` results to return per page. The number can range between
1 and 200. The default is 200. | -| `cursor` | `?string` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListEmployeeWagesResponse`](../../doc/models/list-employee-wages-response.md). - -## Example Usage - -```php -$apiResponse = $laborApi->listEmployeeWages(); - -if ($apiResponse->isSuccess()) { - $listEmployeeWagesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Employee Wage - -**This endpoint is deprecated.** - -Returns a single `EmployeeWage` specified by `id`. - -```php -function getEmployeeWage(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `EmployeeWage` being retrieved. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetEmployeeWageResponse`](../../doc/models/get-employee-wage-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->getEmployeeWage($id); - -if ($apiResponse->isSuccess()) { - $getEmployeeWageResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Shift - -Creates a new `Shift`. - -A `Shift` represents a complete workday for a single team member. -You must provide the following values in your request to this -endpoint: - -- `location_id` -- `team_member_id` -- `start_at` - -An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - -- The `status` of the new `Shift` is `OPEN` and the team member has another - shift with an `OPEN` status. -- The `start_at` date is in the future. -- The `start_at` or `end_at` date overlaps another shift for the same team member. -- The `Break` instances are set in the request and a break `start_at` - is before the `Shift.start_at`, a break `end_at` is after - the `Shift.end_at`, or both. - -```php -function createShift(CreateShiftRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateShiftRequest`](../../doc/models/create-shift-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateShiftResponse`](../../doc/models/create-shift-response.md). - -## Example Usage - -```php -$body = CreateShiftRequestBuilder::init( - ShiftBuilder::init( - 'PAA1RJZZKXBFG', - '2019-01-25T03:11:00-05:00' - ) - ->endAt('2019-01-25T13:11:00-05:00') - ->wage( - ShiftWageBuilder::init() - ->title('Barista') - ->hourlyRate( - MoneyBuilder::init() - ->amount(1100) - ->currency(Currency::USD) - ->build() - ) - ->tipEligible(true) - ->build() - ) - ->breaks( - [ - MBreakBuilder::init( - '2019-01-25T06:11:00-05:00', - 'REGS1EQR1TPZ5', - 'Tea Break', - 'PT5M', - true - ) - ->endAt('2019-01-25T06:16:00-05:00') - ->build() - ] - ) - ->teamMemberId('ormj0jJJZ5OZIzxrZYJI') - ->declaredCashTipMoney( - MoneyBuilder::init() - ->amount(500) - ->currency(Currency::USD) - ->build() - ) - ->build() -) - ->idempotencyKey('HIDSNG5KS478L') - ->build(); - -$apiResponse = $laborApi->createShift($body); - -if ($apiResponse->isSuccess()) { - $createShiftResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Shifts - -Returns a paginated list of `Shift` records for a business. -The list to be returned can be filtered by: - -- Location IDs -- Team member IDs -- Shift status (`OPEN` or `CLOSED`) -- Shift start -- Shift end -- Workday details - -The list can be sorted by: - -- `START_AT` -- `END_AT` -- `CREATED_AT` -- `UPDATED_AT` - -```php -function searchShifts(SearchShiftsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchShiftsRequest`](../../doc/models/search-shifts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchShiftsResponse`](../../doc/models/search-shifts-response.md). - -## Example Usage - -```php -$body = SearchShiftsRequestBuilder::init() - ->query( - ShiftQueryBuilder::init() - ->filter( - ShiftFilterBuilder::init() - ->workday( - ShiftWorkdayBuilder::init() - ->dateRange( - DateRangeBuilder::init() - ->startDate('2019-01-20') - ->endDate('2019-02-03') - ->build() - ) - ->matchShiftsBy(ShiftWorkdayMatcher::START_AT) - ->defaultTimezone('America/Los_Angeles') - ->build() - ) - ->build() - ) - ->build() - ) - ->limit(100) - ->build(); - -$apiResponse = $laborApi->searchShifts($body); - -if ($apiResponse->isSuccess()) { - $searchShiftsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Shift - -Deletes a `Shift`. - -```php -function deleteShift(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `Shift` being deleted. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteShiftResponse`](../../doc/models/delete-shift-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->deleteShift($id); - -if ($apiResponse->isSuccess()) { - $deleteShiftResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Shift - -Returns a single `Shift` specified by `id`. - -```php -function getShift(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `Shift` being retrieved. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetShiftResponse`](../../doc/models/get-shift-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->getShift($id); - -if ($apiResponse->isSuccess()) { - $getShiftResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Shift - -Updates an existing `Shift`. - -When adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have -the `end_at` property set to a valid RFC-3339 datetime string. - -When closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at` -set on each `Break`. - -```php -function updateShift(string $id, UpdateShiftRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The ID of the object being updated. | -| `body` | [`UpdateShiftRequest`](../../doc/models/update-shift-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateShiftResponse`](../../doc/models/update-shift-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$body = UpdateShiftRequestBuilder::init( - ShiftBuilder::init( - 'PAA1RJZZKXBFG', - '2019-01-25T03:11:00-05:00' - ) - ->endAt('2019-01-25T13:11:00-05:00') - ->wage( - ShiftWageBuilder::init() - ->title('Bartender') - ->hourlyRate( - MoneyBuilder::init() - ->amount(1500) - ->currency(Currency::USD) - ->build() - ) - ->tipEligible(true) - ->build() - ) - ->breaks( - [ - MBreakBuilder::init( - '2019-01-25T06:11:00-05:00', - 'REGS1EQR1TPZ5', - 'Tea Break', - 'PT5M', - true - ) - ->id('X7GAQYVVRRG6P') - ->endAt('2019-01-25T06:16:00-05:00') - ->build() - ] - ) - ->version(1) - ->teamMemberId('ormj0jJJZ5OZIzxrZYJI') - ->declaredCashTipMoney( - MoneyBuilder::init() - ->amount(500) - ->currency(Currency::USD) - ->build() - ) - ->build() -)->build(); - -$apiResponse = $laborApi->updateShift( - $id, - $body -); - -if ($apiResponse->isSuccess()) { - $updateShiftResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Team Member Wages - -Returns a paginated list of `TeamMemberWage` instances for a business. - -```php -function listTeamMemberWages( - ?string $teamMemberId = null, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `?string` | Query, Optional | Filter the returned wages to only those that are associated with the
specified team member. | -| `limit` | `?int` | Query, Optional | The maximum number of `TeamMemberWage` results to return per page. The number can range between
1 and 200. The default is 200. | -| `cursor` | `?string` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListTeamMemberWagesResponse`](../../doc/models/list-team-member-wages-response.md). - -## Example Usage - -```php -$apiResponse = $laborApi->listTeamMemberWages(); - -if ($apiResponse->isSuccess()) { - $listTeamMemberWagesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Team Member Wage - -Returns a single `TeamMemberWage` specified by `id`. - -```php -function getTeamMemberWage(string $id): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `TeamMemberWage` being retrieved. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetTeamMemberWageResponse`](../../doc/models/get-team-member-wage-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$apiResponse = $laborApi->getTeamMemberWage($id); - -if ($apiResponse->isSuccess()) { - $getTeamMemberWageResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Workweek Configs - -Returns a list of `WorkweekConfig` instances for a business. - -```php -function listWorkweekConfigs(?int $limit = null, ?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `?int` | Query, Optional | The maximum number of `WorkweekConfigs` results to return per page. | -| `cursor` | `?string` | Query, Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListWorkweekConfigsResponse`](../../doc/models/list-workweek-configs-response.md). - -## Example Usage - -```php -$apiResponse = $laborApi->listWorkweekConfigs(); - -if ($apiResponse->isSuccess()) { - $listWorkweekConfigsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Workweek Config - -Updates a `WorkweekConfig`. - -```php -function updateWorkweekConfig(string $id, UpdateWorkweekConfigRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | The UUID for the `WorkweekConfig` object being updated. | -| `body` | [`UpdateWorkweekConfigRequest`](../../doc/models/update-workweek-config-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateWorkweekConfigResponse`](../../doc/models/update-workweek-config-response.md). - -## Example Usage - -```php -$id = 'id0'; - -$body = UpdateWorkweekConfigRequestBuilder::init( - WorkweekConfigBuilder::init( - Weekday::MON, - '10:00' - ) - ->version(10) - ->build() -)->build(); - -$apiResponse = $laborApi->updateWorkweekConfig( - $id, - $body -); - -if ($apiResponse->isSuccess()) { - $updateWorkweekConfigResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/location-custom-attributes.md b/doc/apis/location-custom-attributes.md deleted file mode 100644 index abfc0735..00000000 --- a/doc/apis/location-custom-attributes.md +++ /dev/null @@ -1,576 +0,0 @@ -# Location Custom Attributes - -```php -$locationCustomAttributesApi = $client->getLocationCustomAttributesApi(); -``` - -## Class Name - -`LocationCustomAttributesApi` - -## Methods - -* [List Location Custom Attribute Definitions](../../doc/apis/location-custom-attributes.md#list-location-custom-attribute-definitions) -* [Create Location Custom Attribute Definition](../../doc/apis/location-custom-attributes.md#create-location-custom-attribute-definition) -* [Delete Location Custom Attribute Definition](../../doc/apis/location-custom-attributes.md#delete-location-custom-attribute-definition) -* [Retrieve Location Custom Attribute Definition](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute-definition) -* [Update Location Custom Attribute Definition](../../doc/apis/location-custom-attributes.md#update-location-custom-attribute-definition) -* [Bulk Delete Location Custom Attributes](../../doc/apis/location-custom-attributes.md#bulk-delete-location-custom-attributes) -* [Bulk Upsert Location Custom Attributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) -* [List Location Custom Attributes](../../doc/apis/location-custom-attributes.md#list-location-custom-attributes) -* [Delete Location Custom Attribute](../../doc/apis/location-custom-attributes.md#delete-location-custom-attribute) -* [Retrieve Location Custom Attribute](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute) -* [Upsert Location Custom Attribute](../../doc/apis/location-custom-attributes.md#upsert-location-custom-attribute) - - -# List Location Custom Attribute Definitions - -Lists the location-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) that belong to a Square seller account. -When all response pages are retrieved, the results include all custom attribute definitions -that are visible to the requesting application, including those that are created by other -applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listLocationCustomAttributeDefinitions( - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLocationCustomAttributeDefinitionsResponse`](../../doc/models/list-location-custom-attribute-definitions-response.md). - -## Example Usage - -```php -$apiResponse = $locationCustomAttributesApi->listLocationCustomAttributeDefinitions(); - -if ($apiResponse->isSuccess()) { - $listLocationCustomAttributeDefinitionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Location Custom Attribute Definition - -Creates a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. -Use this endpoint to define a custom attribute that can be associated with locations. -A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties -for a custom attribute. After the definition is created, you can call -[UpsertLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#upsert-location-custom-attribute) or -[BulkUpsertLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) -to set the custom attribute for locations. - -```php -function createLocationCustomAttributeDefinition( - CreateLocationCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateLocationCustomAttributeDefinitionRequest`](../../doc/models/create-location-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateLocationCustomAttributeDefinitionResponse`](../../doc/models/create-location-custom-attribute-definition-response.md). - -## Example Usage - -```php -$body = CreateLocationCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->key('bestseller') - ->name('Bestseller') - ->description('Bestselling item at location') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES) - ->build() -)->build(); - -$apiResponse = $locationCustomAttributesApi->createLocationCustomAttributeDefinition($body); - -if ($apiResponse->isSuccess()) { - $createLocationCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Location Custom Attribute Definition - -Deletes a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. -Deleting a custom attribute definition also deletes the corresponding custom attribute from -all locations. -Only the definition owner can delete a custom attribute definition. - -```php -function deleteLocationCustomAttributeDefinition(string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteLocationCustomAttributeDefinitionResponse`](../../doc/models/delete-location-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $locationCustomAttributesApi->deleteLocationCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $deleteLocationCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Location Custom Attribute Definition - -Retrieves a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. -To retrieve a custom attribute definition created by another application, the `visibility` -setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveLocationCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | -| `version` | `?int` | Query, Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationCustomAttributeDefinitionResponse`](../../doc/models/retrieve-location-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $locationCustomAttributesApi->retrieveLocationCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $retrieveLocationCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Location Custom Attribute Definition - -Updates a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. -Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the -`schema` for a `Selection` data type. -Only the definition owner can update a custom attribute definition. - -```php -function updateLocationCustomAttributeDefinition( - string $key, - UpdateLocationCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`UpdateLocationCustomAttributeDefinitionRequest`](../../doc/models/update-location-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateLocationCustomAttributeDefinitionResponse`](../../doc/models/update-location-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$body = UpdateLocationCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->description('Update the description as desired.') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY) - ->build() -)->build(); - -$apiResponse = $locationCustomAttributesApi->updateLocationCustomAttributeDefinition( - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $updateLocationCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Delete Location Custom Attributes - -Deletes [custom attributes](../../doc/models/custom-attribute.md) for locations as a bulk operation. -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkDeleteLocationCustomAttributes(BulkDeleteLocationCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkDeleteLocationCustomAttributesRequest`](../../doc/models/bulk-delete-location-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkDeleteLocationCustomAttributesResponse`](../../doc/models/bulk-delete-location-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkDeleteLocationCustomAttributesRequestBuilder::init( - [ - 'id1' => BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder::init()->build(), - 'id2' => BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder::init()->build(), - 'id3' => BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder::init()->build() - ] -)->build(); - -$apiResponse = $locationCustomAttributesApi->bulkDeleteLocationCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkDeleteLocationCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Upsert Location Custom Attributes - -Creates or updates [custom attributes](../../doc/models/custom-attribute.md) for locations as a bulk operation. -Use this endpoint to set the value of one or more custom attributes for one or more locations. -A custom attribute is based on a custom attribute definition in a Square seller account, which is -created using the [CreateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#create-location-custom-attribute-definition) endpoint. -This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert -requests and returns a map of individual upsert responses. Each upsert request has a unique ID -and provides a location ID and custom attribute. Each upsert response is returned with the ID -of the corresponding request. -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkUpsertLocationCustomAttributes(BulkUpsertLocationCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpsertLocationCustomAttributesRequest`](../../doc/models/bulk-upsert-location-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpsertLocationCustomAttributesResponse`](../../doc/models/bulk-upsert-location-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkUpsertLocationCustomAttributesRequestBuilder::init( - [ - 'key0' => BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestBuilder::init( - 'location_id4', - CustomAttributeBuilder::init()->build() - )->build(), - 'key1' => BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestBuilder::init( - 'location_id4', - CustomAttributeBuilder::init()->build() - )->build() - ] -)->build(); - -$apiResponse = $locationCustomAttributesApi->bulkUpsertLocationCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkUpsertLocationCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Location Custom Attributes - -Lists the [custom attributes](../../doc/models/custom-attribute.md) associated with a location. -You can use the `with_definitions` query parameter to also retrieve custom attribute definitions -in the same call. -When all response pages are retrieved, the results include all custom attributes that are -visible to the requesting application, including those that are owned by other applications -and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listLocationCustomAttributes( - string $locationId, - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `withDefinitions` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLocationCustomAttributesResponse`](../../doc/models/list-location-custom-attributes-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$withDefinitions = false; - -$apiResponse = $locationCustomAttributesApi->listLocationCustomAttributes( - $locationId, - null, - null, - null, - $withDefinitions -); - -if ($apiResponse->isSuccess()) { - $listLocationCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Location Custom Attribute - -Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a location. -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. - -```php -function deleteLocationCustomAttribute(string $locationId, string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | -| `key` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteLocationCustomAttributeResponse`](../../doc/models/delete-location-custom-attribute-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$key = 'key0'; - -$apiResponse = $locationCustomAttributesApi->deleteLocationCustomAttribute( - $locationId, - $key -); - -if ($apiResponse->isSuccess()) { - $deleteLocationCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Location Custom Attribute - -Retrieves a [custom attribute](../../doc/models/custom-attribute.md) associated with a location. -You can use the `with_definition` query parameter to also retrieve the custom attribute definition -in the same call. -To retrieve a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveLocationCustomAttribute( - string $locationId, - string $key, - ?bool $withDefinition = false, - ?int $version = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | -| `key` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | -| `withDefinition` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | -| `version` | `?int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationCustomAttributeResponse`](../../doc/models/retrieve-location-custom-attribute-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$key = 'key0'; - -$withDefinition = false; - -$apiResponse = $locationCustomAttributesApi->retrieveLocationCustomAttribute( - $locationId, - $key, - $withDefinition -); - -if ($apiResponse->isSuccess()) { - $retrieveLocationCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Location Custom Attribute - -Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) for a location. -Use this endpoint to set the value of a custom attribute for a specified location. -A custom attribute is based on a custom attribute definition in a Square seller account, which -is created using the [CreateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#create-location-custom-attribute-definition) endpoint. -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. - -```php -function upsertLocationCustomAttribute( - string $locationId, - string $key, - UpsertLocationCustomAttributeRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | -| `key` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the `key` of a
custom attribute definition in the Square seller account. If the requesting application is not
the definition owner, you must use the qualified key. | -| `body` | [`UpsertLocationCustomAttributeRequest`](../../doc/models/upsert-location-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertLocationCustomAttributeResponse`](../../doc/models/upsert-location-custom-attribute-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$key = 'key0'; - -$body = UpsertLocationCustomAttributeRequestBuilder::init( - CustomAttributeBuilder::init()->build() -)->build(); - -$apiResponse = $locationCustomAttributesApi->upsertLocationCustomAttribute( - $locationId, - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertLocationCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/locations.md b/doc/apis/locations.md deleted file mode 100644 index 206ec9ad..00000000 --- a/doc/apis/locations.md +++ /dev/null @@ -1,215 +0,0 @@ -# Locations - -```php -$locationsApi = $client->getLocationsApi(); -``` - -## Class Name - -`LocationsApi` - -## Methods - -* [List Locations](../../doc/apis/locations.md#list-locations) -* [Create Location](../../doc/apis/locations.md#create-location) -* [Retrieve Location](../../doc/apis/locations.md#retrieve-location) -* [Update Location](../../doc/apis/locations.md#update-location) - - -# List Locations - -Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), -including those with an inactive status. Locations are listed alphabetically by `name`. - -```php -function listLocations(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLocationsResponse`](../../doc/models/list-locations-response.md). - -## Example Usage - -```php -$apiResponse = $locationsApi->listLocations(); - -if ($apiResponse->isSuccess()) { - $listLocationsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Location - -Creates a [location](https://developer.squareup.com/docs/locations-api). -Creating new locations allows for separate configuration of receipt layouts, item prices, -and sales reports. Developers can use locations to separate sales activity through applications -that integrate with Square from sales activity elsewhere in a seller's account. -Locations created programmatically with the Locations API last forever and -are visible to the seller for their own management. Therefore, ensure that -each location has a sensible and unique name. - -```php -function createLocation(CreateLocationRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateLocationRequest`](../../doc/models/create-location-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateLocationResponse`](../../doc/models/create-location-response.md). - -## Example Usage - -```php -$body = CreateLocationRequestBuilder::init() - ->location( - LocationBuilder::init() - ->name('Midtown') - ->address( - AddressBuilder::init() - ->addressLine1('1234 Peachtree St. NE') - ->locality('Atlanta') - ->administrativeDistrictLevel1('GA') - ->postalCode('30309') - ->build() - ) - ->description('Midtown Atlanta store') - ->build() - ) - ->build(); - -$apiResponse = $locationsApi->createLocation($body); - -if ($apiResponse->isSuccess()) { - $createLocationResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Location - -Retrieves details of a single location. Specify "main" -as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location). - -```php -function retrieveLocation(string $locationId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to retrieve. Specify the string
"main" to return the main location. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLocationResponse`](../../doc/models/retrieve-location-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $locationsApi->retrieveLocation($locationId); - -if ($apiResponse->isSuccess()) { - $retrieveLocationResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Location - -Updates a [location](https://developer.squareup.com/docs/locations-api). - -```php -function updateLocation(string $locationId, UpdateLocationRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to update. | -| `body` | [`UpdateLocationRequest`](../../doc/models/update-location-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateLocationResponse`](../../doc/models/update-location-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$body = UpdateLocationRequestBuilder::init() - ->location( - LocationBuilder::init() - ->businessHours( - BusinessHoursBuilder::init() - ->periods( - [ - BusinessHoursPeriodBuilder::init() - ->dayOfWeek(DayOfWeek::FRI) - ->startLocalTime('07:00') - ->endLocalTime('18:00') - ->build(), - BusinessHoursPeriodBuilder::init() - ->dayOfWeek(DayOfWeek::SAT) - ->startLocalTime('07:00') - ->endLocalTime('18:00') - ->build(), - BusinessHoursPeriodBuilder::init() - ->dayOfWeek(DayOfWeek::SUN) - ->startLocalTime('09:00') - ->endLocalTime('15:00') - ->build() - ] - ) - ->build() - ) - ->description('Midtown Atlanta store - Open weekends') - ->build() - ) - ->build(); - -$apiResponse = $locationsApi->updateLocation( - $locationId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateLocationResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/loyalty.md b/doc/apis/loyalty.md deleted file mode 100644 index 74f4a0aa..00000000 --- a/doc/apis/loyalty.md +++ /dev/null @@ -1,943 +0,0 @@ -# Loyalty - -```php -$loyaltyApi = $client->getLoyaltyApi(); -``` - -## Class Name - -`LoyaltyApi` - -## Methods - -* [Create Loyalty Account](../../doc/apis/loyalty.md#create-loyalty-account) -* [Search Loyalty Accounts](../../doc/apis/loyalty.md#search-loyalty-accounts) -* [Retrieve Loyalty Account](../../doc/apis/loyalty.md#retrieve-loyalty-account) -* [Accumulate Loyalty Points](../../doc/apis/loyalty.md#accumulate-loyalty-points) -* [Adjust Loyalty Points](../../doc/apis/loyalty.md#adjust-loyalty-points) -* [Search Loyalty Events](../../doc/apis/loyalty.md#search-loyalty-events) -* [List Loyalty Programs](../../doc/apis/loyalty.md#list-loyalty-programs) -* [Retrieve Loyalty Program](../../doc/apis/loyalty.md#retrieve-loyalty-program) -* [Calculate Loyalty Points](../../doc/apis/loyalty.md#calculate-loyalty-points) -* [List Loyalty Promotions](../../doc/apis/loyalty.md#list-loyalty-promotions) -* [Create Loyalty Promotion](../../doc/apis/loyalty.md#create-loyalty-promotion) -* [Retrieve Loyalty Promotion](../../doc/apis/loyalty.md#retrieve-loyalty-promotion) -* [Cancel Loyalty Promotion](../../doc/apis/loyalty.md#cancel-loyalty-promotion) -* [Create Loyalty Reward](../../doc/apis/loyalty.md#create-loyalty-reward) -* [Search Loyalty Rewards](../../doc/apis/loyalty.md#search-loyalty-rewards) -* [Delete Loyalty Reward](../../doc/apis/loyalty.md#delete-loyalty-reward) -* [Retrieve Loyalty Reward](../../doc/apis/loyalty.md#retrieve-loyalty-reward) -* [Redeem Loyalty Reward](../../doc/apis/loyalty.md#redeem-loyalty-reward) - - -# Create Loyalty Account - -Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. - -```php -function createLoyaltyAccount(CreateLoyaltyAccountRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateLoyaltyAccountRequest`](../../doc/models/create-loyalty-account-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateLoyaltyAccountResponse`](../../doc/models/create-loyalty-account-response.md). - -## Example Usage - -```php -$body = CreateLoyaltyAccountRequestBuilder::init( - LoyaltyAccountBuilder::init( - 'd619f755-2d17-41f3-990d-c04ecedd64dd' - ) - ->mapping( - LoyaltyAccountMappingBuilder::init() - ->phoneNumber('+14155551234') - ->build() - ) - ->build(), - 'ec78c477-b1c3-4899-a209-a4e71337c996' -)->build(); - -$apiResponse = $loyaltyApi->createLoyaltyAccount($body); - -if ($apiResponse->isSuccess()) { - $createLoyaltyAccountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Loyalty Accounts - -Searches for loyalty accounts in a loyalty program. - -You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely. - -Search results are sorted by `created_at` in ascending order. - -```php -function searchLoyaltyAccounts(SearchLoyaltyAccountsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchLoyaltyAccountsRequest`](../../doc/models/search-loyalty-accounts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchLoyaltyAccountsResponse`](../../doc/models/search-loyalty-accounts-response.md). - -## Example Usage - -```php -$body = SearchLoyaltyAccountsRequestBuilder::init() - ->query( - SearchLoyaltyAccountsRequestLoyaltyAccountQueryBuilder::init() - ->mappings( - [ - LoyaltyAccountMappingBuilder::init() - ->phoneNumber('+14155551234') - ->build() - ] - ) - ->build() - ) - ->limit(10) - ->build(); - -$apiResponse = $loyaltyApi->searchLoyaltyAccounts($body); - -if ($apiResponse->isSuccess()) { - $searchLoyaltyAccountsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Loyalty Account - -Retrieves a loyalty account. - -```php -function retrieveLoyaltyAccount(string $accountId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLoyaltyAccountResponse`](../../doc/models/retrieve-loyalty-account-response.md). - -## Example Usage - -```php -$accountId = 'account_id2'; - -$apiResponse = $loyaltyApi->retrieveLoyaltyAccount($accountId); - -if ($apiResponse->isSuccess()) { - $retrieveLoyaltyAccountResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Accumulate Loyalty Points - -Adds points earned from a purchase to a [loyalty account](../../doc/models/loyalty-account.md). - -- If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order - to compute the points earned from both the base loyalty program and an associated - [loyalty promotion](../../doc/models/loyalty-promotion.md). For purchases that qualify for multiple accrual - rules, Square computes points based on the accrual rule that grants the most points. - For purchases that qualify for multiple promotions, Square computes points based on the most - recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. - -- If you are not using the Orders API to manage orders, provide `points` with the number of points to add. - You must first perform a client-side computation of the points earned from the loyalty program and - loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](../../doc/apis/loyalty.md#calculate-loyalty-points) - to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see - [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - -```php -function accumulateLoyaltyPoints(string $accountId, AccumulateLoyaltyPointsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | -| `body` | [`AccumulateLoyaltyPointsRequest`](../../doc/models/accumulate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`AccumulateLoyaltyPointsResponse`](../../doc/models/accumulate-loyalty-points-response.md). - -## Example Usage - -```php -$accountId = 'account_id2'; - -$body = AccumulateLoyaltyPointsRequestBuilder::init( - LoyaltyEventAccumulatePointsBuilder::init() - ->orderId('RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY') - ->build(), - '58b90739-c3e8-4b11-85f7-e636d48d72cb', - 'P034NEENMD09F' -)->build(); - -$apiResponse = $loyaltyApi->accumulateLoyaltyPoints( - $accountId, - $body -); - -if ($apiResponse->isSuccess()) { - $accumulateLoyaltyPointsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Adjust Loyalty Points - -Adds points to or subtracts points from a buyer's account. - -Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call -[AccumulateLoyaltyPoints](../../doc/apis/loyalty.md#accumulate-loyalty-points) -to add points when a buyer pays for the purchase. - -```php -function adjustLoyaltyPoints(string $accountId, AdjustLoyaltyPointsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | -| `body` | [`AdjustLoyaltyPointsRequest`](../../doc/models/adjust-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`AdjustLoyaltyPointsResponse`](../../doc/models/adjust-loyalty-points-response.md). - -## Example Usage - -```php -$accountId = 'account_id2'; - -$body = AdjustLoyaltyPointsRequestBuilder::init( - 'bc29a517-3dc9-450e-aa76-fae39ee849d1', - LoyaltyEventAdjustPointsBuilder::init( - 10 - ) - ->reason('Complimentary points') - ->build() -)->build(); - -$apiResponse = $loyaltyApi->adjustLoyaltyPoints( - $accountId, - $body -); - -if ($apiResponse->isSuccess()) { - $adjustLoyaltyPointsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Loyalty Events - -Searches for loyalty events. - -A Square loyalty program maintains a ledger of events that occur during the lifetime of a -buyer's loyalty account. Each change in the point balance -(for example, points earned, points redeemed, and points expired) is -recorded in the ledger. Using this endpoint, you can search the ledger for events. - -Search results are sorted by `created_at` in descending order. - -```php -function searchLoyaltyEvents(SearchLoyaltyEventsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchLoyaltyEventsRequest`](../../doc/models/search-loyalty-events-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchLoyaltyEventsResponse`](../../doc/models/search-loyalty-events-response.md). - -## Example Usage - -```php -$body = SearchLoyaltyEventsRequestBuilder::init() - ->query( - LoyaltyEventQueryBuilder::init() - ->filter( - LoyaltyEventFilterBuilder::init() - ->orderFilter( - LoyaltyEventOrderFilterBuilder::init( - 'PyATxhYLfsMqpVkcKJITPydgEYfZY' - )->build() - )->build() - )->build() - ) - ->limit(30) - ->build(); - -$apiResponse = $loyaltyApi->searchLoyaltyEvents($body); - -if ($apiResponse->isSuccess()) { - $searchLoyaltyEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Loyalty Programs - -**This endpoint is deprecated.** - -Returns a list of loyalty programs in the seller's account. -Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - -Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`. - -```php -function listLoyaltyPrograms(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLoyaltyProgramsResponse`](../../doc/models/list-loyalty-programs-response.md). - -## Example Usage - -```php -$apiResponse = $loyaltyApi->listLoyaltyPrograms(); - -if ($apiResponse->isSuccess()) { - $listLoyaltyProgramsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Loyalty Program - -Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`. - -Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - -```php -function retrieveLoyaltyProgram(string $programId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `programId` | `string` | Template, Required | The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLoyaltyProgramResponse`](../../doc/models/retrieve-loyalty-program-response.md). - -## Example Usage - -```php -$programId = 'program_id0'; - -$apiResponse = $loyaltyApi->retrieveLoyaltyProgram($programId); - -if ($apiResponse->isSuccess()) { - $retrieveLoyaltyProgramResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Calculate Loyalty Points - -Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint -to display the points to the buyer. - -- If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`. - Square reads the order to compute the points earned from the base loyalty program and an associated - [loyalty promotion](../../doc/models/loyalty-promotion.md). - -- If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the - purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, - but not points earned from a loyalty promotion. For spend-based and visit-based programs, the `tax_mode` - setting of the accrual rule indicates how taxes should be treated for loyalty points accrual. - If the purchase qualifies for program points, call - [ListLoyaltyPromotions](../../doc/apis/loyalty.md#list-loyalty-promotions) and perform a client-side computation - to calculate whether the purchase also qualifies for promotion points. For more information, see - [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - -```php -function calculateLoyaltyPoints(string $programId, CalculateLoyaltyPointsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `programId` | `string` | Template, Required | The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. | -| `body` | [`CalculateLoyaltyPointsRequest`](../../doc/models/calculate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CalculateLoyaltyPointsResponse`](../../doc/models/calculate-loyalty-points-response.md). - -## Example Usage - -```php -$programId = 'program_id0'; - -$body = CalculateLoyaltyPointsRequestBuilder::init() - ->orderId('RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY') - ->loyaltyAccountId('79b807d2-d786-46a9-933b-918028d7a8c5') - ->build(); - -$apiResponse = $loyaltyApi->calculateLoyaltyPoints( - $programId, - $body -); - -if ($apiResponse->isSuccess()) { - $calculateLoyaltyPointsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Loyalty Promotions - -Lists the loyalty promotions associated with a [loyalty program](../../doc/models/loyalty-program.md). -Results are sorted by the `created_at` date in descending order (newest to oldest). - -```php -function listLoyaltyPromotions( - string $programId, - ?string $status = null, - ?string $cursor = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,
call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. | -| `status` | [`?string(LoyaltyPromotionStatus)`](../../doc/models/loyalty-promotion-status.md) | Query, Optional | The status to filter the results by. If a status is provided, only loyalty promotions
with the specified status are returned. Otherwise, all loyalty promotions associated with
the loyalty program are returned. | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response.
The minimum value is 1 and the maximum value is 30. The default value is 30.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListLoyaltyPromotionsResponse`](../../doc/models/list-loyalty-promotions-response.md). - -## Example Usage - -```php -$programId = 'program_id0'; - -$apiResponse = $loyaltyApi->listLoyaltyPromotions($programId); - -if ($apiResponse->isSuccess()) { - $listLoyaltyPromotionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Loyalty Promotion - -Creates a loyalty promotion for a [loyalty program](../../doc/models/loyalty-program.md). A loyalty promotion -enables buyers to earn points in addition to those earned from the base loyalty program. - -This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the -`available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an -`ACTIVE` or `SCHEDULED` status. - -```php -function createLoyaltyPromotion(string $programId, CreateLoyaltyPromotionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `programId` | `string` | Template, Required | The ID of the [loyalty program](entity:LoyaltyProgram) to associate with the promotion.
To get the program ID, call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram)
using the `main` keyword. | -| `body` | [`CreateLoyaltyPromotionRequest`](../../doc/models/create-loyalty-promotion-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateLoyaltyPromotionResponse`](../../doc/models/create-loyalty-promotion-response.md). - -## Example Usage - -```php -$programId = 'program_id0'; - -$body = CreateLoyaltyPromotionRequestBuilder::init( - LoyaltyPromotionBuilder::init( - 'Tuesday Happy Hour Promo', - LoyaltyPromotionIncentiveBuilder::init( - LoyaltyPromotionIncentiveType::POINTS_MULTIPLIER - ) - ->pointsMultiplierData( - LoyaltyPromotionIncentivePointsMultiplierDataBuilder::init() - ->multiplier('3.0') - ->build() - ) - ->build(), - LoyaltyPromotionAvailableTimeDataBuilder::init( - [ - 'BEGIN:VEVENT -DTSTART:20220816T160000 -DURATION:PT2H -RRULE:FREQ=WEEKLY;BYDAY=TU -END:VEVENT' - ] - )->build() - ) - ->triggerLimit( - LoyaltyPromotionTriggerLimitBuilder::init( - 1 - ) - ->interval(LoyaltyPromotionTriggerLimitInterval::DAY) - ->build() - ) - ->minimumSpendAmountMoney( - MoneyBuilder::init() - ->amount(2000) - ->currency(Currency::USD) - ->build() - ) - ->qualifyingCategoryIds( - [ - 'XTQPYLR3IIU9C44VRCB3XD12' - ] - ) - ->build(), - 'ec78c477-b1c3-4899-a209-a4e71337c996' -)->build(); - -$apiResponse = $loyaltyApi->createLoyaltyPromotion( - $programId, - $body -); - -if ($apiResponse->isSuccess()) { - $createLoyaltyPromotionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Loyalty Promotion - -Retrieves a loyalty promotion. - -```php -function retrieveLoyaltyPromotion(string $promotionId, string $programId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `promotionId` | `string` | Template, Required | The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. | -| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,
call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLoyaltyPromotionResponse`](../../doc/models/retrieve-loyalty-promotion-response.md). - -## Example Usage - -```php -$promotionId = 'promotion_id0'; - -$programId = 'program_id0'; - -$apiResponse = $loyaltyApi->retrieveLoyaltyPromotion( - $promotionId, - $programId -); - -if ($apiResponse->isSuccess()) { - $retrieveLoyaltyPromotionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Loyalty Promotion - -Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` promotion earlier than the -end date, cancel an `ACTIVE` promotion when an end date is not specified, or cancel a `SCHEDULED` promotion. -Because updating a promotion is not supported, you can also use this endpoint to cancel a promotion before -you create a new one. - -This endpoint sets the loyalty promotion to the `CANCELED` state - -```php -function cancelLoyaltyPromotion(string $promotionId, string $programId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `promotionId` | `string` | Template, Required | The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a
promotion that has an `ACTIVE` or `SCHEDULED` status. | -| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelLoyaltyPromotionResponse`](../../doc/models/cancel-loyalty-promotion-response.md). - -## Example Usage - -```php -$promotionId = 'promotion_id0'; - -$programId = 'program_id0'; - -$apiResponse = $loyaltyApi->cancelLoyaltyPromotion( - $promotionId, - $programId -); - -if ($apiResponse->isSuccess()) { - $cancelLoyaltyPromotionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Loyalty Reward - -Creates a loyalty reward. In the process, the endpoint does following: - -- Uses the `reward_tier_id` in the request to determine the number of points - to lock for this reward. -- If the request includes `order_id`, it adds the reward and related discount to the order. - -After a reward is created, the points are locked and -not available for the buyer to redeem another reward. - -```php -function createLoyaltyReward(CreateLoyaltyRewardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateLoyaltyRewardRequest`](../../doc/models/create-loyalty-reward-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateLoyaltyRewardResponse`](../../doc/models/create-loyalty-reward-response.md). - -## Example Usage - -```php -$body = CreateLoyaltyRewardRequestBuilder::init( - LoyaltyRewardBuilder::init( - '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd', - 'e1b39225-9da5-43d1-a5db-782cdd8ad94f' - ) - ->orderId('RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY') - ->build(), - '18c2e5ea-a620-4b1f-ad60-7b167285e451' -)->build(); - -$apiResponse = $loyaltyApi->createLoyaltyReward($body); - -if ($apiResponse->isSuccess()) { - $createLoyaltyRewardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Loyalty Rewards - -Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. -If you include a `query` object, `loyalty_account_id` is required and `status` is optional. - -If you know a reward ID, use the -[RetrieveLoyaltyReward](../../doc/apis/loyalty.md#retrieve-loyalty-reward) endpoint. - -Search results are sorted by `updated_at` in descending order. - -```php -function searchLoyaltyRewards(SearchLoyaltyRewardsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchLoyaltyRewardsRequest`](../../doc/models/search-loyalty-rewards-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchLoyaltyRewardsResponse`](../../doc/models/search-loyalty-rewards-response.md). - -## Example Usage - -```php -$body = SearchLoyaltyRewardsRequestBuilder::init() - ->query( - SearchLoyaltyRewardsRequestLoyaltyRewardQueryBuilder::init( - '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd' - )->build() - ) - ->limit(10) - ->build(); - -$apiResponse = $loyaltyApi->searchLoyaltyRewards($body); - -if ($apiResponse->isSuccess()) { - $searchLoyaltyRewardsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Loyalty Reward - -Deletes a loyalty reward by doing the following: - -- Returns the loyalty points back to the loyalty account. -- If an order ID was specified when the reward was created - (see [CreateLoyaltyReward](../../doc/apis/loyalty.md#create-loyalty-reward)), - it updates the order by removing the reward and related - discounts. - -You cannot delete a reward that has reached the terminal state (REDEEMED). - -```php -function deleteLoyaltyReward(string $rewardId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteLoyaltyRewardResponse`](../../doc/models/delete-loyalty-reward-response.md). - -## Example Usage - -```php -$rewardId = 'reward_id4'; - -$apiResponse = $loyaltyApi->deleteLoyaltyReward($rewardId); - -if ($apiResponse->isSuccess()) { - $deleteLoyaltyRewardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Loyalty Reward - -Retrieves a loyalty reward. - -```php -function retrieveLoyaltyReward(string $rewardId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveLoyaltyRewardResponse`](../../doc/models/retrieve-loyalty-reward-response.md). - -## Example Usage - -```php -$rewardId = 'reward_id4'; - -$apiResponse = $loyaltyApi->retrieveLoyaltyReward($rewardId); - -if ($apiResponse->isSuccess()) { - $retrieveLoyaltyRewardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Redeem Loyalty Reward - -Redeems a loyalty reward. - -The endpoint sets the reward to the `REDEEMED` terminal state. - -If you are using your own order processing system (not using the -Orders API), you call this endpoint after the buyer paid for the -purchase. - -After the reward reaches the terminal state, it cannot be deleted. -In other words, points used for the reward cannot be returned -to the account. - -```php -function redeemLoyaltyReward(string $rewardId, RedeemLoyaltyRewardRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. | -| `body` | [`RedeemLoyaltyRewardRequest`](../../doc/models/redeem-loyalty-reward-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RedeemLoyaltyRewardResponse`](../../doc/models/redeem-loyalty-reward-response.md). - -## Example Usage - -```php -$rewardId = 'reward_id4'; - -$body = RedeemLoyaltyRewardRequestBuilder::init( - '98adc7f7-6963-473b-b29c-f3c9cdd7d994', - 'P034NEENMD09F' -)->build(); - -$apiResponse = $loyaltyApi->redeemLoyaltyReward( - $rewardId, - $body -); - -if ($apiResponse->isSuccess()) { - $redeemLoyaltyRewardResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/merchant-custom-attributes.md b/doc/apis/merchant-custom-attributes.md deleted file mode 100644 index 06e070a4..00000000 --- a/doc/apis/merchant-custom-attributes.md +++ /dev/null @@ -1,575 +0,0 @@ -# Merchant Custom Attributes - -```php -$merchantCustomAttributesApi = $client->getMerchantCustomAttributesApi(); -``` - -## Class Name - -`MerchantCustomAttributesApi` - -## Methods - -* [List Merchant Custom Attribute Definitions](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) -* [Create Merchant Custom Attribute Definition](../../doc/apis/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) -* [Delete Merchant Custom Attribute Definition](../../doc/apis/merchant-custom-attributes.md#delete-merchant-custom-attribute-definition) -* [Retrieve Merchant Custom Attribute Definition](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) -* [Update Merchant Custom Attribute Definition](../../doc/apis/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) -* [Bulk Delete Merchant Custom Attributes](../../doc/apis/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) -* [Bulk Upsert Merchant Custom Attributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) -* [List Merchant Custom Attributes](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attributes) -* [Delete Merchant Custom Attribute](../../doc/apis/merchant-custom-attributes.md#delete-merchant-custom-attribute) -* [Retrieve Merchant Custom Attribute](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) -* [Upsert Merchant Custom Attribute](../../doc/apis/merchant-custom-attributes.md#upsert-merchant-custom-attribute) - - -# List Merchant Custom Attribute Definitions - -Lists the merchant-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) that belong to a Square seller account. -When all response pages are retrieved, the results include all custom attribute definitions -that are visible to the requesting application, including those that are created by other -applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listMerchantCustomAttributeDefinitions( - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListMerchantCustomAttributeDefinitionsResponse`](../../doc/models/list-merchant-custom-attribute-definitions-response.md). - -## Example Usage - -```php -$apiResponse = $merchantCustomAttributesApi->listMerchantCustomAttributeDefinitions(); - -if ($apiResponse->isSuccess()) { - $listMerchantCustomAttributeDefinitionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Merchant Custom Attribute Definition - -Creates a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. -Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. -A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties -for a custom attribute. After the definition is created, you can call -[UpsertMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#upsert-merchant-custom-attribute) or -[BulkUpsertMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) -to set the custom attribute for a merchant. - -```php -function createMerchantCustomAttributeDefinition( - CreateMerchantCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateMerchantCustomAttributeDefinitionRequest`](../../doc/models/create-merchant-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateMerchantCustomAttributeDefinitionResponse`](../../doc/models/create-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```php -$body = CreateMerchantCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->key('alternative_seller_name') - ->name('Alternative Merchant Name') - ->description('This is the other name this merchant goes by.') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY) - ->build() -)->build(); - -$apiResponse = $merchantCustomAttributesApi->createMerchantCustomAttributeDefinition($body); - -if ($apiResponse->isSuccess()) { - $createMerchantCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Merchant Custom Attribute Definition - -Deletes a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. -Deleting a custom attribute definition also deletes the corresponding custom attribute from -the merchant. -Only the definition owner can delete a custom attribute definition. - -```php -function deleteMerchantCustomAttributeDefinition(string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteMerchantCustomAttributeDefinitionResponse`](../../doc/models/delete-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $merchantCustomAttributesApi->deleteMerchantCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $deleteMerchantCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Merchant Custom Attribute Definition - -Retrieves a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. -To retrieve a custom attribute definition created by another application, the `visibility` -setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveMerchantCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | -| `version` | `?int` | Query, Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveMerchantCustomAttributeDefinitionResponse`](../../doc/models/retrieve-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $merchantCustomAttributesApi->retrieveMerchantCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $retrieveMerchantCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Merchant Custom Attribute Definition - -Updates a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account. -Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the -`schema` for a `Selection` data type. -Only the definition owner can update a custom attribute definition. - -```php -function updateMerchantCustomAttributeDefinition( - string $key, - UpdateMerchantCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`UpdateMerchantCustomAttributeDefinitionRequest`](../../doc/models/update-merchant-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateMerchantCustomAttributeDefinitionResponse`](../../doc/models/update-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$body = UpdateMerchantCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->description('Update the description as desired.') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY) - ->build() -)->build(); - -$apiResponse = $merchantCustomAttributesApi->updateMerchantCustomAttributeDefinition( - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $updateMerchantCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Delete Merchant Custom Attributes - -Deletes [custom attributes](../../doc/models/custom-attribute.md) for a merchant as a bulk operation. -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkDeleteMerchantCustomAttributes(BulkDeleteMerchantCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkDeleteMerchantCustomAttributesRequest`](../../doc/models/bulk-delete-merchant-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkDeleteMerchantCustomAttributesResponse`](../../doc/models/bulk-delete-merchant-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkDeleteMerchantCustomAttributesRequestBuilder::init( - [ - 'id1' => BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestBuilder::init()->build(), - 'id2' => BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestBuilder::init()->build() - ] -)->build(); - -$apiResponse = $merchantCustomAttributesApi->bulkDeleteMerchantCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkDeleteMerchantCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Upsert Merchant Custom Attributes - -Creates or updates [custom attributes](../../doc/models/custom-attribute.md) for a merchant as a bulk operation. -Use this endpoint to set the value of one or more custom attributes for a merchant. -A custom attribute is based on a custom attribute definition in a Square seller account, which is -created using the [CreateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) endpoint. -This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert -requests and returns a map of individual upsert responses. Each upsert request has a unique ID -and provides a merchant ID and custom attribute. Each upsert response is returned with the ID -of the corresponding request. -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkUpsertMerchantCustomAttributes(BulkUpsertMerchantCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpsertMerchantCustomAttributesRequest`](../../doc/models/bulk-upsert-merchant-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpsertMerchantCustomAttributesResponse`](../../doc/models/bulk-upsert-merchant-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkUpsertMerchantCustomAttributesRequestBuilder::init( - [ - 'key0' => BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestBuilder::init( - 'merchant_id0', - CustomAttributeBuilder::init()->build() - )->build(), - 'key1' => BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestBuilder::init( - 'merchant_id0', - CustomAttributeBuilder::init()->build() - )->build() - ] -)->build(); - -$apiResponse = $merchantCustomAttributesApi->bulkUpsertMerchantCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkUpsertMerchantCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Merchant Custom Attributes - -Lists the [custom attributes](../../doc/models/custom-attribute.md) associated with a merchant. -You can use the `with_definitions` query parameter to also retrieve custom attribute definitions -in the same call. -When all response pages are retrieved, the results include all custom attributes that are -visible to the requesting application, including those that are owned by other applications -and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listMerchantCustomAttributes( - string $merchantId, - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `withDefinitions` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListMerchantCustomAttributesResponse`](../../doc/models/list-merchant-custom-attributes-response.md). - -## Example Usage - -```php -$merchantId = 'merchant_id0'; - -$withDefinitions = false; - -$apiResponse = $merchantCustomAttributesApi->listMerchantCustomAttributes( - $merchantId, - null, - null, - null, - $withDefinitions -); - -if ($apiResponse->isSuccess()) { - $listMerchantCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Merchant Custom Attribute - -Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a merchant. -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. - -```php -function deleteMerchantCustomAttribute(string $merchantId, string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | -| `key` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteMerchantCustomAttributeResponse`](../../doc/models/delete-merchant-custom-attribute-response.md). - -## Example Usage - -```php -$merchantId = 'merchant_id0'; - -$key = 'key0'; - -$apiResponse = $merchantCustomAttributesApi->deleteMerchantCustomAttribute( - $merchantId, - $key -); - -if ($apiResponse->isSuccess()) { - $deleteMerchantCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Merchant Custom Attribute - -Retrieves a [custom attribute](../../doc/models/custom-attribute.md) associated with a merchant. -You can use the `with_definition` query parameter to also retrieve the custom attribute definition -in the same call. -To retrieve a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveMerchantCustomAttribute( - string $merchantId, - string $key, - ?bool $withDefinition = false, - ?int $version = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | -| `key` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the `key` of a custom
attribute definition in the Square seller account. If the requesting application is not the
definition owner, you must use the qualified key. | -| `withDefinition` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | -| `version` | `?int` | Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveMerchantCustomAttributeResponse`](../../doc/models/retrieve-merchant-custom-attribute-response.md). - -## Example Usage - -```php -$merchantId = 'merchant_id0'; - -$key = 'key0'; - -$withDefinition = false; - -$apiResponse = $merchantCustomAttributesApi->retrieveMerchantCustomAttribute( - $merchantId, - $key, - $withDefinition -); - -if ($apiResponse->isSuccess()) { - $retrieveMerchantCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Merchant Custom Attribute - -Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) for a merchant. -Use this endpoint to set the value of a custom attribute for a specified merchant. -A custom attribute is based on a custom attribute definition in a Square seller account, which -is created using the [CreateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) endpoint. -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. - -```php -function upsertMerchantCustomAttribute( - string $merchantId, - string $key, - UpsertMerchantCustomAttributeRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | -| `key` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the `key` of a
custom attribute definition in the Square seller account. If the requesting application is not
the definition owner, you must use the qualified key. | -| `body` | [`UpsertMerchantCustomAttributeRequest`](../../doc/models/upsert-merchant-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertMerchantCustomAttributeResponse`](../../doc/models/upsert-merchant-custom-attribute-response.md). - -## Example Usage - -```php -$merchantId = 'merchant_id0'; - -$key = 'key0'; - -$body = UpsertMerchantCustomAttributeRequestBuilder::init( - CustomAttributeBuilder::init()->build() -)->build(); - -$apiResponse = $merchantCustomAttributesApi->upsertMerchantCustomAttribute( - $merchantId, - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertMerchantCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/merchants.md b/doc/apis/merchants.md deleted file mode 100644 index 28b26e02..00000000 --- a/doc/apis/merchants.md +++ /dev/null @@ -1,96 +0,0 @@ -# Merchants - -```php -$merchantsApi = $client->getMerchantsApi(); -``` - -## Class Name - -`MerchantsApi` - -## Methods - -* [List Merchants](../../doc/apis/merchants.md#list-merchants) -* [Retrieve Merchant](../../doc/apis/merchants.md#retrieve-merchant) - - -# List Merchants - -Provides details about the merchant associated with a given access token. - -The access token used to connect your application to a Square seller is associated -with a single merchant. That means that `ListMerchants` returns a list -with a single `Merchant` object. You can specify your personal access token -to get your own merchant information or specify an OAuth token to get the -information for the merchant that granted your application access. - -If you know the merchant ID, you can also use the [RetrieveMerchant](../../doc/apis/merchants.md#retrieve-merchant) -endpoint to retrieve the merchant information. - -```php -function listMerchants(?int $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?int` | Query, Optional | The cursor generated by the previous response. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListMerchantsResponse`](../../doc/models/list-merchants-response.md). - -## Example Usage - -```php -$apiResponse = $merchantsApi->listMerchants(); - -if ($apiResponse->isSuccess()) { - $listMerchantsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Merchant - -Retrieves the `Merchant` object for the given `merchant_id`. - -```php -function retrieveMerchant(string $merchantId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchantId` | `string` | Template, Required | The ID of the merchant to retrieve. If the string "me" is supplied as the ID,
then retrieve the merchant that is currently accessible to this call. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveMerchantResponse`](../../doc/models/retrieve-merchant-response.md). - -## Example Usage - -```php -$merchantId = 'merchant_id0'; - -$apiResponse = $merchantsApi->retrieveMerchant($merchantId); - -if ($apiResponse->isSuccess()) { - $retrieveMerchantResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/mobile-authorization.md b/doc/apis/mobile-authorization.md deleted file mode 100644 index 8979f13f..00000000 --- a/doc/apis/mobile-authorization.md +++ /dev/null @@ -1,60 +0,0 @@ -# Mobile Authorization - -```php -$mobileAuthorizationApi = $client->getMobileAuthorizationApi(); -``` - -## Class Name - -`MobileAuthorizationApi` - - -# Create Mobile Authorization Code - -Generates code to authorize a mobile application to connect to a Square card reader. - -Authorization codes are one-time-use codes and expire 60 minutes after being issued. - -__Important:__ The `Authorization` header you provide to this endpoint must have the following format: - -``` -Authorization: Bearer ACCESS_TOKEN -``` - -Replace `ACCESS_TOKEN` with a -[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). - -```php -function createMobileAuthorizationCode(CreateMobileAuthorizationCodeRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateMobileAuthorizationCodeRequest`](../../doc/models/create-mobile-authorization-code-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateMobileAuthorizationCodeResponse`](../../doc/models/create-mobile-authorization-code-response.md). - -## Example Usage - -```php -$body = CreateMobileAuthorizationCodeRequestBuilder::init() - ->locationId('YOUR_LOCATION_ID') - ->build(); - -$apiResponse = $mobileAuthorizationApi->createMobileAuthorizationCode($body); - -if ($apiResponse->isSuccess()) { - $createMobileAuthorizationCodeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/o-auth.md b/doc/apis/o-auth.md deleted file mode 100644 index 84c0f767..00000000 --- a/doc/apis/o-auth.md +++ /dev/null @@ -1,180 +0,0 @@ -# O Auth - -```php -$oAuthApi = $client->getOAuthApi(); -``` - -## Class Name - -`OAuthApi` - -## Methods - -* [Revoke Token](../../doc/apis/o-auth.md#revoke-token) -* [Obtain Token](../../doc/apis/o-auth.md#obtain-token) -* [Retrieve Token Status](../../doc/apis/o-auth.md#retrieve-token-status) - - -# Revoke Token - -Revokes an access token generated with the OAuth flow. - -If an account has more than one OAuth access token for your application, this -endpoint revokes all of them, regardless of which token you specify. - -__Important:__ The `Authorization` header for this endpoint must have the -following format: - -``` -Authorization: Client APPLICATION_SECRET -``` - -Replace `APPLICATION_SECRET` with the application secret on the **OAuth** -page for your application in the Developer Dashboard. - -:information_source: **Note** This endpoint does not require authentication. - -```php -function revokeToken(RevokeTokenRequest $body, string $authorization): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`RevokeTokenRequest`](../../doc/models/revoke-token-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | -| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RevokeTokenResponse`](../../doc/models/revoke-token-response.md). - -## Example Usage - -```php -$body = RevokeTokenRequestBuilder::init() - ->clientId('CLIENT_ID') - ->accessToken('ACCESS_TOKEN') - ->build(); - -$authorization = 'Client CLIENT_SECRET'; - -$apiResponse = $oAuthApi->revokeToken( - $body, - $authorization -); - -if ($apiResponse->isSuccess()) { - $revokeTokenResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Obtain Token - -Returns an OAuth access token and a refresh token unless the -`short_lived` parameter is set to `true`, in which case the endpoint -returns only an access token. - -The `grant_type` parameter specifies the type of OAuth request. If -`grant_type` is `authorization_code`, you must include the authorization -code you received when a seller granted you authorization. If `grant_type` -is `refresh_token`, you must provide a valid refresh token. If you're using -an old version of the Square APIs (prior to March 13, 2019), `grant_type` -can be `migration_token` and you must provide a valid migration token. - -You can use the `scopes` parameter to limit the set of permissions granted -to the access token and refresh token. You can use the `short_lived` parameter -to create an access token that expires in 24 hours. - -__Note:__ OAuth tokens should be encrypted and stored on a secure server. -Application clients should never interact directly with OAuth tokens. - -:information_source: **Note** This endpoint does not require authentication. - -```php -function obtainToken(ObtainTokenRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`ObtainTokenRequest`](../../doc/models/obtain-token-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ObtainTokenResponse`](../../doc/models/obtain-token-response.md). - -## Example Usage - -```php -$body = ObtainTokenRequestBuilder::init( - 'APPLICATION_ID', - 'authorization_code' -) - ->clientSecret('APPLICATION_SECRET') - ->code('CODE_FROM_AUTHORIZE') - ->build(); - -$apiResponse = $oAuthApi->obtainToken($body); - -if ($apiResponse->isSuccess()) { - $obtainTokenResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Token Status - -Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token). - -Add the access token to the Authorization header of the request. - -__Important:__ The `Authorization` header you provide to this endpoint must have the following format: - -``` -Authorization: Bearer ACCESS_TOKEN -``` - -where `ACCESS_TOKEN` is a -[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). - -If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. - -```php -function retrieveTokenStatus(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveTokenStatusResponse`](../../doc/models/retrieve-token-status-response.md). - -## Example Usage - -```php -$apiResponse = $oAuthApi->retrieveTokenStatus(); - -if ($apiResponse->isSuccess()) { - $retrieveTokenStatusResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/order-custom-attributes.md b/doc/apis/order-custom-attributes.md deleted file mode 100644 index fd68ee29..00000000 --- a/doc/apis/order-custom-attributes.md +++ /dev/null @@ -1,608 +0,0 @@ -# Order Custom Attributes - -```php -$orderCustomAttributesApi = $client->getOrderCustomAttributesApi(); -``` - -## Class Name - -`OrderCustomAttributesApi` - -## Methods - -* [List Order Custom Attribute Definitions](../../doc/apis/order-custom-attributes.md#list-order-custom-attribute-definitions) -* [Create Order Custom Attribute Definition](../../doc/apis/order-custom-attributes.md#create-order-custom-attribute-definition) -* [Delete Order Custom Attribute Definition](../../doc/apis/order-custom-attributes.md#delete-order-custom-attribute-definition) -* [Retrieve Order Custom Attribute Definition](../../doc/apis/order-custom-attributes.md#retrieve-order-custom-attribute-definition) -* [Update Order Custom Attribute Definition](../../doc/apis/order-custom-attributes.md#update-order-custom-attribute-definition) -* [Bulk Delete Order Custom Attributes](../../doc/apis/order-custom-attributes.md#bulk-delete-order-custom-attributes) -* [Bulk Upsert Order Custom Attributes](../../doc/apis/order-custom-attributes.md#bulk-upsert-order-custom-attributes) -* [List Order Custom Attributes](../../doc/apis/order-custom-attributes.md#list-order-custom-attributes) -* [Delete Order Custom Attribute](../../doc/apis/order-custom-attributes.md#delete-order-custom-attribute) -* [Retrieve Order Custom Attribute](../../doc/apis/order-custom-attributes.md#retrieve-order-custom-attribute) -* [Upsert Order Custom Attribute](../../doc/apis/order-custom-attributes.md#upsert-order-custom-attribute) - - -# List Order Custom Attribute Definitions - -Lists the order-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) that belong to a Square seller account. - -When all response pages are retrieved, the results include all custom attribute definitions -that are visible to the requesting application, including those that are created by other -applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that -seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listOrderCustomAttributeDefinitions( - ?string $visibilityFilter = null, - ?string $cursor = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Requests that all of the custom attributes be returned, or only those that are read-only or read-write. | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListOrderCustomAttributeDefinitionsResponse`](../../doc/models/list-order-custom-attribute-definitions-response.md). - -## Example Usage - -```php -$apiResponse = $orderCustomAttributesApi->listOrderCustomAttributeDefinitions(); - -if ($apiResponse->isSuccess()) { - $listOrderCustomAttributeDefinitionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Order Custom Attribute Definition - -Creates an order-related custom attribute definition. Use this endpoint to -define a custom attribute that can be associated with orders. - -After creating a custom attribute definition, you can set the custom attribute for orders -in the Square seller account. - -```php -function createOrderCustomAttributeDefinition(CreateOrderCustomAttributeDefinitionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateOrderCustomAttributeDefinitionRequest`](../../doc/models/create-order-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateOrderCustomAttributeDefinitionResponse`](../../doc/models/create-order-custom-attribute-definition-response.md). - -## Example Usage - -```php -$body = CreateOrderCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->key('cover-count') - ->name('Cover count') - ->description('The number of people seated at a table') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES) - ->build() -) - ->idempotencyKey('IDEMPOTENCY_KEY') - ->build(); - -$apiResponse = $orderCustomAttributesApi->createOrderCustomAttributeDefinition($body); - -if ($apiResponse->isSuccess()) { - $createOrderCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Order Custom Attribute Definition - -Deletes an order-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. - -Only the definition owner can delete a custom attribute definition. - -```php -function deleteOrderCustomAttributeDefinition(string $key): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteOrderCustomAttributeDefinitionResponse`](../../doc/models/delete-order-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $orderCustomAttributesApi->deleteOrderCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $deleteOrderCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Order Custom Attribute Definition - -Retrieves an order-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. - -To retrieve a custom attribute definition created by another application, the `visibility` -setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveOrderCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. | -| `version` | `?int` | Query, Optional | To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control, include this optional field and specify the current version of the custom attribute. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveOrderCustomAttributeDefinitionResponse`](../../doc/models/retrieve-order-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$apiResponse = $orderCustomAttributesApi->retrieveOrderCustomAttributeDefinition($key); - -if ($apiResponse->isSuccess()) { - $retrieveOrderCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Order Custom Attribute Definition - -Updates an order-related custom attribute definition for a Square seller account. - -Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - -```php -function updateOrderCustomAttributeDefinition( - string $key, - UpdateOrderCustomAttributeDefinitionRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`UpdateOrderCustomAttributeDefinitionRequest`](../../doc/models/update-order-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateOrderCustomAttributeDefinitionResponse`](../../doc/models/update-order-custom-attribute-definition-response.md). - -## Example Usage - -```php -$key = 'key0'; - -$body = UpdateOrderCustomAttributeDefinitionRequestBuilder::init( - CustomAttributeDefinitionBuilder::init() - ->key('cover-count') - ->visibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY) - ->version(1) - ->build() -) - ->idempotencyKey('IDEMPOTENCY_KEY') - ->build(); - -$apiResponse = $orderCustomAttributesApi->updateOrderCustomAttributeDefinition( - $key, - $body -); - -if ($apiResponse->isSuccess()) { - $updateOrderCustomAttributeDefinitionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Delete Order Custom Attributes - -Deletes order [custom attributes](../../doc/models/custom-attribute.md) as a bulk operation. - -Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a -custom attribute definition, use the [CreateOrderCustomAttributeDefinition](../../doc/apis/order-custom-attributes.md#create-order-custom-attribute-definition) endpoint.) - -This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete -requests and returns a map of individual delete responses. Each delete request has a unique ID -and provides an order ID and custom attribute. Each delete response is returned with the ID -of the corresponding request. - -To delete a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkDeleteOrderCustomAttributes(BulkDeleteOrderCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkDeleteOrderCustomAttributesRequest`](../../doc/models/bulk-delete-order-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkDeleteOrderCustomAttributesResponse`](../../doc/models/bulk-delete-order-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkDeleteOrderCustomAttributesRequestBuilder::init( - [ - 'cover-count' => BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeBuilder::init( - '7BbXGEIWNldxAzrtGf9GPVZTwZ4F' - )->build(), - 'table-number' => BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeBuilder::init( - '7BbXGEIWNldxAzrtGf9GPVZTwZ4F' - )->build() - ] -)->build(); - -$apiResponse = $orderCustomAttributesApi->bulkDeleteOrderCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkDeleteOrderCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Upsert Order Custom Attributes - -Creates or updates order [custom attributes](../../doc/models/custom-attribute.md) as a bulk operation. - -Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a -custom attribute definition, use the [CreateOrderCustomAttributeDefinition](../../doc/apis/order-custom-attributes.md#create-order-custom-attribute-definition) endpoint.) - -This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert -requests and returns a map of individual upsert responses. Each upsert request has a unique ID -and provides an order ID and custom attribute. Each upsert response is returned with the ID -of the corresponding request. - -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function bulkUpsertOrderCustomAttributes(BulkUpsertOrderCustomAttributesRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpsertOrderCustomAttributesRequest`](../../doc/models/bulk-upsert-order-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpsertOrderCustomAttributesResponse`](../../doc/models/bulk-upsert-order-custom-attributes-response.md). - -## Example Usage - -```php -$body = BulkUpsertOrderCustomAttributesRequestBuilder::init( - [ - 'key0' => BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeBuilder::init( - CustomAttributeBuilder::init()->build(), - 'order_id4' - )->build(), - 'key1' => BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeBuilder::init( - CustomAttributeBuilder::init()->build(), - 'order_id4' - )->build() - ] -)->build(); - -$apiResponse = $orderCustomAttributesApi->bulkUpsertOrderCustomAttributes($body); - -if ($apiResponse->isSuccess()) { - $bulkUpsertOrderCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Order Custom Attributes - -Lists the [custom attributes](../../doc/models/custom-attribute.md) associated with an order. - -You can use the `with_definitions` query parameter to also retrieve custom attribute definitions -in the same call. - -When all response pages are retrieved, the results include all custom attributes that are -visible to the requesting application, including those that are owned by other applications -and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - -```php -function listOrderCustomAttributes( - string $orderId, - ?string $visibilityFilter = null, - ?string $cursor = null, - ?int $limit = null, - ?bool $withDefinitions = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Query, Optional | Requests that all of the custom attributes be returned, or only those that are read-only or read-write. | -| `cursor` | `?string` | Query, Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `withDefinitions` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom attribute,
information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListOrderCustomAttributesResponse`](../../doc/models/list-order-custom-attributes-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$withDefinitions = false; - -$apiResponse = $orderCustomAttributesApi->listOrderCustomAttributes( - $orderId, - null, - null, - null, - $withDefinitions -); - -if ($apiResponse->isSuccess()) { - $listOrderCustomAttributesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Order Custom Attribute - -Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a customer profile. - -To delete a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function deleteOrderCustomAttribute(string $orderId, string $customAttributeKey): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | -| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the key of an
existing custom attribute definition. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteOrderCustomAttributeResponse`](../../doc/models/delete-order-custom-attribute-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$customAttributeKey = 'custom_attribute_key2'; - -$apiResponse = $orderCustomAttributesApi->deleteOrderCustomAttribute( - $orderId, - $customAttributeKey -); - -if ($apiResponse->isSuccess()) { - $deleteOrderCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Order Custom Attribute - -Retrieves a [custom attribute](../../doc/models/custom-attribute.md) associated with an order. - -You can use the `with_definition` query parameter to also retrieve the custom attribute definition -in the same call. - -To retrieve a custom attribute owned by another application, the `visibility` setting must be -`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function retrieveOrderCustomAttribute( - string $orderId, - string $customAttributeKey, - ?int $version = null, - ?bool $withDefinition = false -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | -| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the key of an
existing custom attribute definition. | -| `version` | `?int` | Query, Optional | To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control, include this optional field and specify the current version of the custom attribute. | -| `withDefinition` | `?bool` | Query, Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom attribute,
information about the data type, or other definition details. The default value is `false`.
**Default**: `false` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveOrderCustomAttributeResponse`](../../doc/models/retrieve-order-custom-attribute-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$customAttributeKey = 'custom_attribute_key2'; - -$withDefinition = false; - -$apiResponse = $orderCustomAttributesApi->retrieveOrderCustomAttribute( - $orderId, - $customAttributeKey, - null, - $withDefinition -); - -if ($apiResponse->isSuccess()) { - $retrieveOrderCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Order Custom Attribute - -Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) for an order. - -Use this endpoint to set the value of a custom attribute for a specific order. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a -custom attribute definition, use the [CreateOrderCustomAttributeDefinition](../../doc/apis/order-custom-attributes.md#create-order-custom-attribute-definition) endpoint.) - -To create or update a custom attribute owned by another application, the `visibility` setting -must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes -(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - -```php -function upsertOrderCustomAttribute( - string $orderId, - string $customAttributeKey, - UpsertOrderCustomAttributeRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | -| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the key
of an existing custom attribute definition. | -| `body` | [`UpsertOrderCustomAttributeRequest`](../../doc/models/upsert-order-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertOrderCustomAttributeResponse`](../../doc/models/upsert-order-custom-attribute-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$customAttributeKey = 'custom_attribute_key2'; - -$body = UpsertOrderCustomAttributeRequestBuilder::init( - CustomAttributeBuilder::init()->build() -)->build(); - -$apiResponse = $orderCustomAttributesApi->upsertOrderCustomAttribute( - $orderId, - $customAttributeKey, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertOrderCustomAttributeResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/orders.md b/doc/apis/orders.md deleted file mode 100644 index 0194fc4b..00000000 --- a/doc/apis/orders.md +++ /dev/null @@ -1,561 +0,0 @@ -# Orders - -```php -$ordersApi = $client->getOrdersApi(); -``` - -## Class Name - -`OrdersApi` - -## Methods - -* [Create Order](../../doc/apis/orders.md#create-order) -* [Batch Retrieve Orders](../../doc/apis/orders.md#batch-retrieve-orders) -* [Calculate Order](../../doc/apis/orders.md#calculate-order) -* [Clone Order](../../doc/apis/orders.md#clone-order) -* [Search Orders](../../doc/apis/orders.md#search-orders) -* [Retrieve Order](../../doc/apis/orders.md#retrieve-order) -* [Update Order](../../doc/apis/orders.md#update-order) -* [Pay Order](../../doc/apis/orders.md#pay-order) - - -# Create Order - -Creates a new [order](../../doc/models/order.md) that can include information about products for -purchase and settings to apply to the purchase. - -To pay for a created order, see -[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). - -You can modify open orders using the [UpdateOrder](../../doc/apis/orders.md#update-order) endpoint. - -```php -function createOrder(CreateOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateOrderResponse`](../../doc/models/create-order-response.md). - -## Example Usage - -```php -$body = CreateOrderRequestBuilder::init() - ->order( - OrderBuilder::init( - '057P5VYJ4A5X1' - ) - ->referenceId('my-order-001') - ->lineItems( - [ - OrderLineItemBuilder::init( - '1' - ) - ->name('New York Strip Steak') - ->basePriceMoney( - MoneyBuilder::init() - ->amount(1599) - ->currency(Currency::USD) - ->build() - ) - ->build(), - OrderLineItemBuilder::init( - '2' - ) - ->catalogObjectId('BEMYCSMIJL46OCDV4KYIKXIB') - ->modifiers( - [ - OrderLineItemModifierBuilder::init() - ->catalogObjectId('CHQX7Y4KY6N5KINJKZCFURPZ') - ->build() - ] - ) - ->appliedDiscounts( - [ - OrderLineItemAppliedDiscountBuilder::init( - 'one-dollar-off' - )->build() - ] - )->build() - ] - ) - ->taxes( - [ - OrderLineItemTaxBuilder::init() - ->uid('state-sales-tax') - ->name('State Sales Tax') - ->percentage('9') - ->scope(OrderLineItemTaxScope::ORDER) - ->build() - ] - ) - ->discounts( - [ - OrderLineItemDiscountBuilder::init() - ->uid('labor-day-sale') - ->name('Labor Day Sale') - ->percentage('5') - ->scope(OrderLineItemDiscountScope::ORDER) - ->build(), - OrderLineItemDiscountBuilder::init() - ->uid('membership-discount') - ->catalogObjectId('DB7L55ZH2BGWI4H23ULIWOQ7') - ->scope(OrderLineItemDiscountScope::ORDER) - ->build(), - OrderLineItemDiscountBuilder::init() - ->uid('one-dollar-off') - ->name('Sale - $1.00 off') - ->amountMoney( - MoneyBuilder::init() - ->amount(100) - ->currency(Currency::USD) - ->build() - ) - ->scope(OrderLineItemDiscountScope::LINE_ITEM) - ->build() - ] - ) - ->build() - ) - ->idempotencyKey('8193148c-9586-11e6-99f9-28cfe92138cf') - ->build(); - -$apiResponse = $ordersApi->createOrder($body); - -if ($apiResponse->isSuccess()) { - $createOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Batch Retrieve Orders - -Retrieves a set of [orders](../../doc/models/order.md) by their IDs. - -If a given order ID does not exist, the ID is ignored instead of generating an error. - -```php -function batchRetrieveOrders(BatchRetrieveOrdersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BatchRetrieveOrdersRequest`](../../doc/models/batch-retrieve-orders-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BatchRetrieveOrdersResponse`](../../doc/models/batch-retrieve-orders-response.md). - -## Example Usage - -```php -$body = BatchRetrieveOrdersRequestBuilder::init( - [ - 'CAISEM82RcpmcFBM0TfOyiHV3es', - 'CAISENgvlJ6jLWAzERDzjyHVybY' - ] -) - ->locationId('057P5VYJ4A5X1') - ->build(); - -$apiResponse = $ordersApi->batchRetrieveOrders($body); - -if ($apiResponse->isSuccess()) { - $batchRetrieveOrdersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Calculate Order - -Enables applications to preview order pricing without creating an order. - -```php -function calculateOrder(CalculateOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CalculateOrderRequest`](../../doc/models/calculate-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CalculateOrderResponse`](../../doc/models/calculate-order-response.md). - -## Example Usage - -```php -$body = CalculateOrderRequestBuilder::init( - OrderBuilder::init( - 'D7AVYMEAPJ3A3' - ) - ->lineItems( - [ - OrderLineItemBuilder::init( - '1' - ) - ->name('Item 1') - ->basePriceMoney( - MoneyBuilder::init() - ->amount(500) - ->currency(Currency::USD) - ->build() - ) - ->build(), - OrderLineItemBuilder::init( - '2' - ) - ->name('Item 2') - ->basePriceMoney( - MoneyBuilder::init() - ->amount(300) - ->currency(Currency::USD) - ->build() - ) - ->build() - ] - ) - ->discounts( - [ - OrderLineItemDiscountBuilder::init() - ->name('50% Off') - ->percentage('50') - ->scope(OrderLineItemDiscountScope::ORDER) - ->build() - ] - ) - ->build() -)->build(); - -$apiResponse = $ordersApi->calculateOrder($body); - -if ($apiResponse->isSuccess()) { - $calculateOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Clone Order - -Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has -only the core fields (such as line items, taxes, and discounts) copied from the original order. - -```php -function cloneOrder(CloneOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CloneOrderRequest`](../../doc/models/clone-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CloneOrderResponse`](../../doc/models/clone-order-response.md). - -## Example Usage - -```php -$body = CloneOrderRequestBuilder::init( - 'ZAISEM52YcpmcWAzERDOyiWS123' -) - ->version(3) - ->idempotencyKey('UNIQUE_STRING') - ->build(); - -$apiResponse = $ordersApi->cloneOrder($body); - -if ($apiResponse->isSuccess()) { - $cloneOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Orders - -Search all orders for one or more locations. Orders include all sales, -returns, and exchanges regardless of how or when they entered the Square -ecosystem (such as Point of Sale, Invoices, and Connect APIs). - -`SearchOrders` requests need to specify which locations to search and define a -[SearchOrdersQuery](../../doc/models/search-orders-query.md) object that controls -how to sort or filter the results. Your `SearchOrdersQuery` can: - -Set filter criteria. -Set the sort order. -Determine whether to return results as complete `Order` objects or as -[OrderEntry](../../doc/models/order-entry.md) objects. - -Note that details for orders processed with Square Point of Sale while in -offline mode might not be transmitted to Square for up to 72 hours. Offline -orders have a `created_at` value that reflects the time the order was created, -not the time it was subsequently transmitted to Square. - -```php -function searchOrders(SearchOrdersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchOrdersRequest`](../../doc/models/search-orders-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchOrdersResponse`](../../doc/models/search-orders-response.md). - -## Example Usage - -```php -$body = SearchOrdersRequestBuilder::init() - ->locationIds( - [ - '057P5VYJ4A5X1', - '18YC4JDH91E1H' - ] - ) - ->query( - SearchOrdersQueryBuilder::init() - ->filter( - SearchOrdersFilterBuilder::init() - ->stateFilter( - SearchOrdersStateFilterBuilder::init( - [ - OrderState::COMPLETED - ] - )->build() - ) - ->dateTimeFilter( - SearchOrdersDateTimeFilterBuilder::init() - ->closedAt( - TimeRangeBuilder::init() - ->startAt('2018-03-03T20:00:00+00:00') - ->endAt('2019-03-04T21:54:45+00:00') - ->build() - ) - ->build() - ) - ->build() - ) - ->sort( - SearchOrdersSortBuilder::init( - SearchOrdersSortField::CLOSED_AT - ) - ->sortOrder(SortOrder::DESC) - ->build() - ) - ->build() - ) - ->limit(3) - ->returnEntries(true) - ->build(); - -$apiResponse = $ordersApi->searchOrders($body); - -if ($apiResponse->isSuccess()) { - $searchOrdersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Order - -Retrieves an [Order](../../doc/models/order.md) by ID. - -```php -function retrieveOrder(string $orderId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the order to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveOrderResponse`](../../doc/models/retrieve-order-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$apiResponse = $ordersApi->retrieveOrder($orderId); - -if ($apiResponse->isSuccess()) { - $retrieveOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Order - -Updates an open [order](../../doc/models/order.md) by adding, replacing, or deleting -fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. - -An `UpdateOrder` request requires the following: - -- The `order_id` in the endpoint path, identifying the order to update. -- The latest `version` of the order to update. -- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) - containing only the fields to update and the version to which the update is - being applied. -- If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) - identifying the fields to clear. - -To pay for an order, see -[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). - -```php -function updateOrder(string $orderId, UpdateOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the order to update. | -| `body` | [`UpdateOrderRequest`](../../doc/models/update-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateOrderResponse`](../../doc/models/update-order-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$body = UpdateOrderRequestBuilder::init()->build(); - -$apiResponse = $ordersApi->updateOrder( - $orderId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Pay Order - -Pay for an [order](../../doc/models/order.md) using one or more approved [payments](../../doc/models/payment.md) -or settle an order with a total of `0`. - -The total of the `payment_ids` listed in the request must be equal to the order -total. Orders with a total amount of `0` can be marked as paid by specifying an empty -array of `payment_ids` in the request. - -To be used with `PayOrder`, a payment must: - -- Reference the order by specifying the `order_id` when [creating the payment](../../doc/apis/payments.md#create-payment). - Any approved payments that reference the same `order_id` not specified in the - `payment_ids` is canceled. -- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). - Using a delayed capture payment with `PayOrder` completes the approved payment. - -```php -function payOrder(string $orderId, PayOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | The ID of the order being paid. | -| `body` | [`PayOrderRequest`](../../doc/models/pay-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`PayOrderResponse`](../../doc/models/pay-order-response.md). - -## Example Usage - -```php -$orderId = 'order_id6'; - -$body = PayOrderRequestBuilder::init( - 'c043a359-7ad9-4136-82a9-c3f1d66dcbff' -) - ->paymentIds( - [ - 'EnZdNAlWCmfh6Mt5FMNST1o7taB', - '0LRiVlbXVwe8ozu4KbZxd12mvaB' - ] - ) - ->build(); - -$apiResponse = $ordersApi->payOrder( - $orderId, - $body -); - -if ($apiResponse->isSuccess()) { - $payOrderResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/payments.md b/doc/apis/payments.md deleted file mode 100644 index 0180708b..00000000 --- a/doc/apis/payments.md +++ /dev/null @@ -1,402 +0,0 @@ -# Payments - -```php -$paymentsApi = $client->getPaymentsApi(); -``` - -## Class Name - -`PaymentsApi` - -## Methods - -* [List Payments](../../doc/apis/payments.md#list-payments) -* [Create Payment](../../doc/apis/payments.md#create-payment) -* [Cancel Payment by Idempotency Key](../../doc/apis/payments.md#cancel-payment-by-idempotency-key) -* [Get Payment](../../doc/apis/payments.md#get-payment) -* [Update Payment](../../doc/apis/payments.md#update-payment) -* [Cancel Payment](../../doc/apis/payments.md#cancel-payment) -* [Complete Payment](../../doc/apis/payments.md#complete-payment) - - -# List Payments - -Retrieves a list of payments taken by the account making the request. - -Results are eventually consistent, and new payments or changes to payments might take several -seconds to appear. - -The maximum results per page is 100. - -```php -function listPayments( - ?string $beginTime = null, - ?string $endTime = null, - ?string $sortOrder = null, - ?string $cursor = null, - ?string $locationId = null, - ?int $total = null, - ?string $last4 = null, - ?string $cardBrand = null, - ?int $limit = null, - ?bool $isOfflinePayment = false, - ?string $offlineBeginTime = null, - ?string $offlineEndTime = null, - ?string $updatedAtBeginTime = null, - ?string $updatedAtEndTime = null, - ?string $sortField = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `beginTime` | `?string` | Query, Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format.
The range is determined using the `created_at` field for each Payment.
Inclusive. Default: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `created_at` field for each Payment.

Default: The current time. | -| `sortOrder` | `?string` | Query, Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `locationId` | `?string` | Query, Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | -| `total` | `?int` | Query, Optional | The exact amount in the `total_money` for a payment. | -| `last4` | `?string` | Query, Optional | The last four digits of a payment card. | -| `cardBrand` | `?string` | Query, Optional | The brand of the payment card (for example, VISA). | -| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.

Default: `100` | -| `isOfflinePayment` | `?bool` | Query, Optional | Whether the payment was taken offline or not.
**Default**: `false` | -| `offlineBeginTime` | `?string` | Query, Optional | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | -| `offlineEndTime` | `?string` | Query, Optional | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | -| `updatedAtBeginTime` | `?string` | Query, Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `updated_at` field for each Payment. | -| `updatedAtEndTime` | `?string` | Query, Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `updated_at` field for each Payment. | -| `sortField` | [`?string(PaymentSortField)`](../../doc/models/payment-sort-field.md) | Query, Optional | The field used to sort results by. The default is `CREATED_AT`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListPaymentsResponse`](../../doc/models/list-payments-response.md). - -## Example Usage - -```php -$isOfflinePayment = false; - -$apiResponse = $paymentsApi->listPayments( - null, - null, - null, - null, - null, - null, - null, - null, - null, - $isOfflinePayment -); - -if ($apiResponse->isSuccess()) { - $listPaymentsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Payment - -Creates a payment using the provided source. You can use this endpoint -to charge a card (credit/debit card or -Square gift card) or record a payment that the seller received outside of Square -(cash payment from a buyer or a payment that an external entity -processed on behalf of the seller). - -The endpoint creates a -`Payment` object and returns it in the response. - -```php -function createPayment(CreatePaymentRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreatePaymentRequest`](../../doc/models/create-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreatePaymentResponse`](../../doc/models/create-payment-response.md). - -## Example Usage - -```php -$body = CreatePaymentRequestBuilder::init( - 'ccof:GaJGNaZa8x4OgDJn4GB', - '7b0f3ec5-086a-4871-8f13-3c81b3875218' -) - ->amountMoney( - MoneyBuilder::init() - ->amount(1000) - ->currency(Currency::USD) - ->build() - ) - ->appFeeMoney( - MoneyBuilder::init() - ->amount(10) - ->currency(Currency::USD) - ->build() - ) - ->autocomplete(true) - ->customerId('W92WH6P11H4Z77CTET0RNTGFW8') - ->locationId('L88917AVBK2S5') - ->referenceId('123456') - ->note('Brief description') - ->build(); - -$apiResponse = $paymentsApi->createPayment($body); - -if ($apiResponse->isSuccess()) { - $createPaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Payment by Idempotency Key - -Cancels (voids) a payment identified by the idempotency key that is specified in the -request. - -Use this method when the status of a `CreatePayment` request is unknown (for example, after you send a -`CreatePayment` request, a network error occurs and you do not get a response). In this case, you can -direct Square to cancel the payment using this endpoint. In the request, you provide the same -idempotency key that you provided in your `CreatePayment` request that you want to cancel. After -canceling the payment, you can submit your `CreatePayment` request again. - -Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint -returns successfully. - -```php -function cancelPaymentByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CancelPaymentByIdempotencyKeyRequest`](../../doc/models/cancel-payment-by-idempotency-key-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelPaymentByIdempotencyKeyResponse`](../../doc/models/cancel-payment-by-idempotency-key-response.md). - -## Example Usage - -```php -$body = CancelPaymentByIdempotencyKeyRequestBuilder::init( - 'a7e36d40-d24b-11e8-b568-0800200c9a66' -)->build(); - -$apiResponse = $paymentsApi->cancelPaymentByIdempotencyKey($body); - -if ($apiResponse->isSuccess()) { - $cancelPaymentByIdempotencyKeyResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Payment - -Retrieves details for a specific payment. - -```php -function getPayment(string $paymentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentId` | `string` | Template, Required | A unique ID for the desired payment. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetPaymentResponse`](../../doc/models/get-payment-response.md). - -## Example Usage - -```php -$paymentId = 'payment_id0'; - -$apiResponse = $paymentsApi->getPayment($paymentId); - -if ($apiResponse->isSuccess()) { - $getPaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Payment - -Updates a payment with the APPROVED status. -You can update the `amount_money` and `tip_money` using this endpoint. - -```php -function updatePayment(string $paymentId, UpdatePaymentRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentId` | `string` | Template, Required | The ID of the payment to update. | -| `body` | [`UpdatePaymentRequest`](../../doc/models/update-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdatePaymentResponse`](../../doc/models/update-payment-response.md). - -## Example Usage - -```php -$paymentId = 'payment_id0'; - -$body = UpdatePaymentRequestBuilder::init( - '956f8b13-e4ec-45d6-85e8-d1d95ef0c5de' -) - ->payment( - PaymentBuilder::init() - ->amountMoney( - MoneyBuilder::init() - ->amount(1000) - ->currency(Currency::USD) - ->build() - ) - ->tipMoney( - MoneyBuilder::init() - ->amount(100) - ->currency(Currency::USD) - ->build() - ) - ->versionToken('ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o') - ->build() - ) - ->build(); - -$apiResponse = $paymentsApi->updatePayment( - $paymentId, - $body -); - -if ($apiResponse->isSuccess()) { - $updatePaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Payment - -Cancels (voids) a payment. You can use this endpoint to cancel a payment with -the APPROVED `status`. - -```php -function cancelPayment(string $paymentId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentId` | `string` | Template, Required | The ID of the payment to cancel. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelPaymentResponse`](../../doc/models/cancel-payment-response.md). - -## Example Usage - -```php -$paymentId = 'payment_id0'; - -$apiResponse = $paymentsApi->cancelPayment($paymentId); - -if ($apiResponse->isSuccess()) { - $cancelPaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Complete Payment - -Completes (captures) a payment. -By default, payments are set to complete immediately after they are created. - -You can use this endpoint to complete a payment with the APPROVED `status`. - -```php -function completePayment(string $paymentId, CompletePaymentRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentId` | `string` | Template, Required | The unique ID identifying the payment to be completed. | -| `body` | [`CompletePaymentRequest`](../../doc/models/complete-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CompletePaymentResponse`](../../doc/models/complete-payment-response.md). - -## Example Usage - -```php -$paymentId = 'payment_id0'; - -$body = CompletePaymentRequestBuilder::init()->build(); - -$apiResponse = $paymentsApi->completePayment( - $paymentId, - $body -); - -if ($apiResponse->isSuccess()) { - $completePaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/payouts.md b/doc/apis/payouts.md deleted file mode 100644 index a2a106de..00000000 --- a/doc/apis/payouts.md +++ /dev/null @@ -1,151 +0,0 @@ -# Payouts - -```php -$payoutsApi = $client->getPayoutsApi(); -``` - -## Class Name - -`PayoutsApi` - -## Methods - -* [List Payouts](../../doc/apis/payouts.md#list-payouts) -* [Get Payout](../../doc/apis/payouts.md#get-payout) -* [List Payout Entries](../../doc/apis/payouts.md#list-payout-entries) - - -# List Payouts - -Retrieves a list of all payouts for the default location. -You can filter payouts by location ID, status, time range, and order them in ascending or descending order. -To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - -```php -function listPayouts( - ?string $locationId = null, - ?string $status = null, - ?string $beginTime = null, - ?string $endTime = null, - ?string $sortOrder = null, - ?string $cursor = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `?string` | Query, Optional | The ID of the location for which to list the payouts.
By default, payouts are returned for the default (main) location associated with the seller. | -| `status` | [`?string(PayoutStatus)`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. | -| `beginTime` | `?string` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
If request parameters change between requests, subsequent results may contain duplicates or missing records. | -| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: `100` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListPayoutsResponse`](../../doc/models/list-payouts-response.md). - -## Example Usage - -```php -$apiResponse = $payoutsApi->listPayouts(); - -if ($apiResponse->isSuccess()) { - $listPayoutsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Payout - -Retrieves details of a specific payout identified by a payout ID. -To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - -```php -function getPayout(string $payoutId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetPayoutResponse`](../../doc/models/get-payout-response.md). - -## Example Usage - -```php -$payoutId = 'payout_id6'; - -$apiResponse = $payoutsApi->getPayout($payoutId); - -if ($apiResponse->isSuccess()) { - $getPayoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Payout Entries - -Retrieves a list of all payout entries for a specific payout. -To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - -```php -function listPayoutEntries( - string $payoutId, - ?string $sortOrder = null, - ?string $cursor = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
If request parameters change between requests, subsequent results may contain duplicates or missing records. | -| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: `100` | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListPayoutEntriesResponse`](../../doc/models/list-payout-entries-response.md). - -## Example Usage - -```php -$payoutId = 'payout_id6'; - -$apiResponse = $payoutsApi->listPayoutEntries($payoutId); - -if ($apiResponse->isSuccess()) { - $listPayoutEntriesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/refunds.md b/doc/apis/refunds.md deleted file mode 100644 index 6a85341b..00000000 --- a/doc/apis/refunds.md +++ /dev/null @@ -1,164 +0,0 @@ -# Refunds - -```php -$refundsApi = $client->getRefundsApi(); -``` - -## Class Name - -`RefundsApi` - -## Methods - -* [List Payment Refunds](../../doc/apis/refunds.md#list-payment-refunds) -* [Refund Payment](../../doc/apis/refunds.md#refund-payment) -* [Get Payment Refund](../../doc/apis/refunds.md#get-payment-refund) - - -# List Payment Refunds - -Retrieves a list of refunds for the account making the request. - -Results are eventually consistent, and new refunds or changes to refunds might take several -seconds to appear. - -The maximum results per page is 100. - -```php -function listPaymentRefunds( - ?string $beginTime = null, - ?string $endTime = null, - ?string $sortOrder = null, - ?string $cursor = null, - ?string $locationId = null, - ?string $status = null, - ?string $sourceType = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `beginTime` | `?string` | Query, Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `created_at` field for each `PaymentRefund`.

Default: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `created_at` field for each `PaymentRefund`.

Default: The current time. | -| `sortOrder` | `?string` | Query, Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `locationId` | `?string` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | -| `status` | `?string` | Query, Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](entity:PaymentRefund).

Default: If omitted, refunds are returned regardless of their status. | -| `sourceType` | `?string` | Query, Optional | If provided, only returns refunds whose payments have the indicated source type.
Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.
For information about these payment source types, see
[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).

Default: If omitted, refunds are returned regardless of the source type. | -| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.

It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, no more than 100 results are returned.

Default: 100 | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListPaymentRefundsResponse`](../../doc/models/list-payment-refunds-response.md). - -## Example Usage - -```php -$apiResponse = $refundsApi->listPaymentRefunds(); - -if ($apiResponse->isSuccess()) { - $listPaymentRefundsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Refund Payment - -Refunds a payment. You can refund the entire payment amount or a -portion of it. You can use this endpoint to refund a card payment or record a -refund of a cash or external payment. For more information, see -[Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). - -```php -function refundPayment(RefundPaymentRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`RefundPaymentRequest`](../../doc/models/refund-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RefundPaymentResponse`](../../doc/models/refund-payment-response.md). - -## Example Usage - -```php -$body = RefundPaymentRequestBuilder::init( - '9b7f2dcf-49da-4411-b23e-a2d6af21333a', - MoneyBuilder::init() - ->amount(1000) - ->currency(Currency::USD) - ->build() -) - ->appFeeMoney( - MoneyBuilder::init() - ->amount(10) - ->currency(Currency::USD) - ->build() - ) - ->paymentId('R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY') - ->reason('Example') - ->build(); - -$apiResponse = $refundsApi->refundPayment($body); - -if ($apiResponse->isSuccess()) { - $refundPaymentResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Payment Refund - -Retrieves a specific refund using the `refund_id`. - -```php -function getPaymentRefund(string $refundId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `refundId` | `string` | Template, Required | The unique ID for the desired `PaymentRefund`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetPaymentRefundResponse`](../../doc/models/get-payment-refund-response.md). - -## Example Usage - -```php -$refundId = 'refund_id4'; - -$apiResponse = $refundsApi->getPaymentRefund($refundId); - -if ($apiResponse->isSuccess()) { - $getPaymentRefundResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/sites.md b/doc/apis/sites.md deleted file mode 100644 index b5ae9d9f..00000000 --- a/doc/apis/sites.md +++ /dev/null @@ -1,41 +0,0 @@ -# Sites - -```php -$sitesApi = $client->getSitesApi(); -``` - -## Class Name - -`SitesApi` - - -# List Sites - -Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date. - -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). - -```php -function listSites(): ApiResponse -``` - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListSitesResponse`](../../doc/models/list-sites-response.md). - -## Example Usage - -```php -$apiResponse = $sitesApi->listSites(); - -if ($apiResponse->isSuccess()) { - $listSitesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/snippets.md b/doc/apis/snippets.md deleted file mode 100644 index 50b8e039..00000000 --- a/doc/apis/snippets.md +++ /dev/null @@ -1,150 +0,0 @@ -# Snippets - -```php -$snippetsApi = $client->getSnippetsApi(); -``` - -## Class Name - -`SnippetsApi` - -## Methods - -* [Delete Snippet](../../doc/apis/snippets.md#delete-snippet) -* [Retrieve Snippet](../../doc/apis/snippets.md#retrieve-snippet) -* [Upsert Snippet](../../doc/apis/snippets.md#upsert-snippet) - - -# Delete Snippet - -Removes your snippet from a Square Online site. - -You can call [ListSites](../../doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. - -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). - -```php -function deleteSnippet(string $siteId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteSnippetResponse`](../../doc/models/delete-snippet-response.md). - -## Example Usage - -```php -$siteId = 'site_id6'; - -$apiResponse = $snippetsApi->deleteSnippet($siteId); - -if ($apiResponse->isSuccess()) { - $deleteSnippetResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Snippet - -Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application. - -You can call [ListSites](../../doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. - -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). - -```php -function retrieveSnippet(string $siteId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveSnippetResponse`](../../doc/models/retrieve-snippet-response.md). - -## Example Usage - -```php -$siteId = 'site_id6'; - -$apiResponse = $snippetsApi->retrieveSnippet($siteId); - -if ($apiResponse->isSuccess()) { - $retrieveSnippetResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Upsert Snippet - -Adds a snippet to a Square Online site or updates the existing snippet on the site. -The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. - -You can call [ListSites](../../doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. - -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). - -```php -function upsertSnippet(string $siteId, UpsertSnippetRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `siteId` | `string` | Template, Required | The ID of the site where you want to add or update the snippet. | -| `body` | [`UpsertSnippetRequest`](../../doc/models/upsert-snippet-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpsertSnippetResponse`](../../doc/models/upsert-snippet-response.md). - -## Example Usage - -```php -$siteId = 'site_id6'; - -$body = UpsertSnippetRequestBuilder::init( - SnippetBuilder::init( - '' - )->build() -)->build(); - -$apiResponse = $snippetsApi->upsertSnippet( - $siteId, - $body -); - -if ($apiResponse->isSuccess()) { - $upsertSnippetResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/subscriptions.md b/doc/apis/subscriptions.md deleted file mode 100644 index 8cbfaa5c..00000000 --- a/doc/apis/subscriptions.md +++ /dev/null @@ -1,604 +0,0 @@ -# Subscriptions - -```php -$subscriptionsApi = $client->getSubscriptionsApi(); -``` - -## Class Name - -`SubscriptionsApi` - -## Methods - -* [Create Subscription](../../doc/apis/subscriptions.md#create-subscription) -* [Bulk Swap Plan](../../doc/apis/subscriptions.md#bulk-swap-plan) -* [Search Subscriptions](../../doc/apis/subscriptions.md#search-subscriptions) -* [Retrieve Subscription](../../doc/apis/subscriptions.md#retrieve-subscription) -* [Update Subscription](../../doc/apis/subscriptions.md#update-subscription) -* [Delete Subscription Action](../../doc/apis/subscriptions.md#delete-subscription-action) -* [Change Billing Anchor Date](../../doc/apis/subscriptions.md#change-billing-anchor-date) -* [Cancel Subscription](../../doc/apis/subscriptions.md#cancel-subscription) -* [List Subscription Events](../../doc/apis/subscriptions.md#list-subscription-events) -* [Pause Subscription](../../doc/apis/subscriptions.md#pause-subscription) -* [Resume Subscription](../../doc/apis/subscriptions.md#resume-subscription) -* [Swap Plan](../../doc/apis/subscriptions.md#swap-plan) - - -# Create Subscription - -Enrolls a customer in a subscription. - -If you provide a card on file in the request, Square charges the card for -the subscription. Otherwise, Square sends an invoice to the customer's email -address. The subscription starts immediately, unless the request includes -the optional `start_date`. Each individual subscription is associated with a particular location. - -For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). - -```php -function createSubscription(CreateSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateSubscriptionResponse`](../../doc/models/create-subscription-response.md). - -## Example Usage - -```php -$body = CreateSubscriptionRequestBuilder::init( - 'S8GWD5R9QB376', - 'CHFGVKYY8RSV93M5KCYTG4PN0G' -) - ->idempotencyKey('8193148c-9586-11e6-99f9-28cfe92138cf') - ->planVariationId('6JHXF3B2CW3YKHDV4XEM674H') - ->startDate('2023-06-20') - ->cardId('ccof:qy5x8hHGYsgLrp4Q4GB') - ->timezone('America/Los_Angeles') - ->source( - SubscriptionSourceBuilder::init() - ->name('My Application') - ->build() - ) - ->phases( - [ - PhaseBuilder::init() - ->ordinal(0) - ->orderTemplateId('U2NaowWxzXwpsZU697x7ZHOAnCNZY') - ->build() - ] - ) - ->build(); - -$apiResponse = $subscriptionsApi->createSubscription($body); - -if ($apiResponse->isSuccess()) { - $createSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Swap Plan - -Schedules a plan variation change for all active subscriptions under a given plan -variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). - -```php -function bulkSwapPlan(BulkSwapPlanRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkSwapPlanRequest`](../../doc/models/bulk-swap-plan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkSwapPlanResponse`](../../doc/models/bulk-swap-plan-response.md). - -## Example Usage - -```php -$body = BulkSwapPlanRequestBuilder::init( - 'FQ7CDXXWSLUJRPM3GFJSJGZ7', - '6JHXF3B2CW3YKHDV4XEM674H', - 'S8GWD5R9QB376' -)->build(); - -$apiResponse = $subscriptionsApi->bulkSwapPlan($body); - -if ($apiResponse->isSuccess()) { - $bulkSwapPlanResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Subscriptions - -Searches for subscriptions. - -Results are ordered chronologically by subscription creation date. If -the request specifies more than one location ID, -the endpoint orders the result -by location ID, and then by creation date within each location. If no locations are given -in the query, all locations are searched. - -You can also optionally specify `customer_ids` to search by customer. -If left unset, all customers -associated with the specified locations are returned. -If the request specifies customer IDs, the endpoint orders results -first by location, within location by customer ID, and within -customer by subscription creation date. - -```php -function searchSubscriptions(SearchSubscriptionsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchSubscriptionsRequest`](../../doc/models/search-subscriptions-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchSubscriptionsResponse`](../../doc/models/search-subscriptions-response.md). - -## Example Usage - -```php -$body = SearchSubscriptionsRequestBuilder::init() - ->query( - SearchSubscriptionsQueryBuilder::init() - ->filter( - SearchSubscriptionsFilterBuilder::init() - ->customerIds( - [ - 'CHFGVKYY8RSV93M5KCYTG4PN0G' - ] - ) - ->locationIds( - [ - 'S8GWD5R9QB376' - ] - ) - ->sourceNames( - [ - 'My App' - ] - ) - ->build() - ) - ->build() - ) - ->build(); - -$apiResponse = $subscriptionsApi->searchSubscriptions($body); - -if ($apiResponse->isSuccess()) { - $searchSubscriptionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Subscription - -Retrieves a specific subscription. - -```php -function retrieveSubscription(string $subscriptionId, ?string $mInclude = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve. | -| `mInclude` | `?string` | Query, Optional | A query parameter to specify related information to be included in the response.

The supported query parameter values are:

- `actions`: to include scheduled actions on the targeted subscription. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveSubscriptionResponse`](../../doc/models/retrieve-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$apiResponse = $subscriptionsApi->retrieveSubscription($subscriptionId); - -if ($apiResponse->isSuccess()) { - $retrieveSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Subscription - -Updates a subscription by modifying or clearing `subscription` field values. -To clear a field, set its value to `null`. - -```php -function updateSubscription(string $subscriptionId, UpdateSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to update. | -| `body` | [`UpdateSubscriptionRequest`](../../doc/models/update-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateSubscriptionResponse`](../../doc/models/update-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = UpdateSubscriptionRequestBuilder::init() - ->subscription( - SubscriptionBuilder::init() - ->canceledDate('canceled_date6') - ->cardId('{NEW CARD ID}') - ->build() - ) - ->build(); - -$apiResponse = $subscriptionsApi->updateSubscription( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Subscription Action - -Deletes a scheduled action for a subscription. - -```php -function deleteSubscriptionAction(string $subscriptionId, string $actionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription the targeted action is to act upon. | -| `actionId` | `string` | Template, Required | The ID of the targeted action to be deleted. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteSubscriptionActionResponse`](../../doc/models/delete-subscription-action-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$actionId = 'action_id6'; - -$apiResponse = $subscriptionsApi->deleteSubscriptionAction( - $subscriptionId, - $actionId -); - -if ($apiResponse->isSuccess()) { - $deleteSubscriptionActionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Change Billing Anchor Date - -Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) -for a subscription. - -```php -function changeBillingAnchorDate(string $subscriptionId, ChangeBillingAnchorDateRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to update the billing anchor date. | -| `body` | [`ChangeBillingAnchorDateRequest`](../../doc/models/change-billing-anchor-date-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ChangeBillingAnchorDateResponse`](../../doc/models/change-billing-anchor-date-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = ChangeBillingAnchorDateRequestBuilder::init() - ->monthlyBillingAnchorDate(1) - ->build(); - -$apiResponse = $subscriptionsApi->changeBillingAnchorDate( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $changeBillingAnchorDateResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Subscription - -Schedules a `CANCEL` action to cancel an active subscription. This -sets the `canceled_date` field to the end of the active billing period. After this date, -the subscription status changes from ACTIVE to CANCELED. - -```php -function cancelSubscription(string $subscriptionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to cancel. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelSubscriptionResponse`](../../doc/models/cancel-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$apiResponse = $subscriptionsApi->cancelSubscription($subscriptionId); - -if ($apiResponse->isSuccess()) { - $cancelSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Subscription Events - -Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. - -```php -function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null, ?int $limit = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve the events for. | -| `cursor` | `?string` | Query, Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `limit` | `?int` | Query, Optional | The upper limit on the number of subscription events to return
in a paged response. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListSubscriptionEventsResponse`](../../doc/models/list-subscription-events-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$apiResponse = $subscriptionsApi->listSubscriptionEvents($subscriptionId); - -if ($apiResponse->isSuccess()) { - $listSubscriptionEventsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Pause Subscription - -Schedules a `PAUSE` action to pause an active subscription. - -```php -function pauseSubscription(string $subscriptionId, PauseSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to pause. | -| `body` | [`PauseSubscriptionRequest`](../../doc/models/pause-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`PauseSubscriptionResponse`](../../doc/models/pause-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = PauseSubscriptionRequestBuilder::init()->build(); - -$apiResponse = $subscriptionsApi->pauseSubscription( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $pauseSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Resume Subscription - -Schedules a `RESUME` action to resume a paused or a deactivated subscription. - -```php -function resumeSubscription(string $subscriptionId, ResumeSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to resume. | -| `body` | [`ResumeSubscriptionRequest`](../../doc/models/resume-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ResumeSubscriptionResponse`](../../doc/models/resume-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = ResumeSubscriptionRequestBuilder::init()->build(); - -$apiResponse = $subscriptionsApi->resumeSubscription( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $resumeSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Swap Plan - -Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. -For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). - -```php -function swapPlan(string $subscriptionId, SwapPlanRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The ID of the subscription to swap the subscription plan for. | -| `body` | [`SwapPlanRequest`](../../doc/models/swap-plan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SwapPlanResponse`](../../doc/models/swap-plan-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = SwapPlanRequestBuilder::init() - ->newPlanVariationId('FQ7CDXXWSLUJRPM3GFJSJGZ7') - ->phases( - [ - PhaseInputBuilder::init( - 0 - ) - ->orderTemplateId('uhhnjH9osVv3shUADwaC0b3hNxQZY') - ->build() - ] - ) - ->build(); - -$apiResponse = $subscriptionsApi->swapPlan( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $swapPlanResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/team.md b/doc/apis/team.md deleted file mode 100644 index 396765db..00000000 --- a/doc/apis/team.md +++ /dev/null @@ -1,738 +0,0 @@ -# Team - -```php -$teamApi = $client->getTeamApi(); -``` - -## Class Name - -`TeamApi` - -## Methods - -* [Create Team Member](../../doc/apis/team.md#create-team-member) -* [Bulk Create Team Members](../../doc/apis/team.md#bulk-create-team-members) -* [Bulk Update Team Members](../../doc/apis/team.md#bulk-update-team-members) -* [List Jobs](../../doc/apis/team.md#list-jobs) -* [Create Job](../../doc/apis/team.md#create-job) -* [Retrieve Job](../../doc/apis/team.md#retrieve-job) -* [Update Job](../../doc/apis/team.md#update-job) -* [Search Team Members](../../doc/apis/team.md#search-team-members) -* [Retrieve Team Member](../../doc/apis/team.md#retrieve-team-member) -* [Update Team Member](../../doc/apis/team.md#update-team-member) -* [Retrieve Wage Setting](../../doc/apis/team.md#retrieve-wage-setting) -* [Update Wage Setting](../../doc/apis/team.md#update-wage-setting) - - -# Create Team Member - -Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates. -You must provide the following values in your request to this endpoint: - -- `given_name` -- `family_name` - -Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). - -```php -function createTeamMember(CreateTeamMemberRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateTeamMemberRequest`](../../doc/models/create-team-member-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateTeamMemberResponse`](../../doc/models/create-team-member-response.md). - -## Example Usage - -```php -$body = CreateTeamMemberRequestBuilder::init() - ->idempotencyKey('idempotency-key-0') - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_1') - ->status(TeamMemberStatus::ACTIVE) - ->givenName('Joe') - ->familyName('Doe') - ->emailAddress('joe_doe@gmail.com') - ->phoneNumber('+14159283333') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::EXPLICIT_LOCATIONS) - ->locationIds( - [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - ) - ->build() - ) - ->wageSetting( - WageSettingBuilder::init() - ->jobAssignments( - [ - JobAssignmentBuilder::init( - JobAssignmentPayType::SALARY - ) - ->annualRate( - MoneyBuilder::init() - ->amount(3000000) - ->currency(Currency::USD) - ->build() - ) - ->weeklyHours(40) - ->jobId('FjS8x95cqHiMenw4f1NAUH4P') - ->build(), - JobAssignmentBuilder::init( - JobAssignmentPayType::HOURLY - ) - ->hourlyRate( - MoneyBuilder::init() - ->amount(2000) - ->currency(Currency::USD) - ->build() - ) - ->jobId('VDNpRv8da51NU8qZFC5zDWpF') - ->build() - ] - ) - ->isOvertimeExempt(true) - ->build() - ) - ->build() - ) - ->build(); - -$apiResponse = $teamApi->createTeamMember($body); - -if ($apiResponse->isSuccess()) { - $createTeamMemberResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Create Team Members - -Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates. -This process is non-transactional and processes as much of the request as possible. If one of the creates in -the request cannot be successfully processed, the request is not marked as failed, but the body of the response -contains explicit error information for the failed create. - -Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). - -```php -function bulkCreateTeamMembers(BulkCreateTeamMembersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkCreateTeamMembersRequest`](../../doc/models/bulk-create-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkCreateTeamMembersResponse`](../../doc/models/bulk-create-team-members-response.md). - -## Example Usage - -```php -$body = BulkCreateTeamMembersRequestBuilder::init( - [ - 'idempotency-key-1' => CreateTeamMemberRequestBuilder::init() - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_1') - ->givenName('Joe') - ->familyName('Doe') - ->emailAddress('joe_doe@gmail.com') - ->phoneNumber('+14159283333') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::EXPLICIT_LOCATIONS) - ->locationIds( - [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - ) - ->build() - ) - ->build() - ) - ->build(), - 'idempotency-key-2' => CreateTeamMemberRequestBuilder::init() - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_2') - ->givenName('Jane') - ->familyName('Smith') - ->emailAddress('jane_smith@gmail.com') - ->phoneNumber('+14159223334') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::ALL_CURRENT_AND_FUTURE_LOCATIONS) - ->build() - ) - ->build() - ) - ->build() - ] -)->build(); - -$apiResponse = $teamApi->bulkCreateTeamMembers($body); - -if ($apiResponse->isSuccess()) { - $bulkCreateTeamMembersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Update Team Members - -Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates. -This process is non-transactional and processes as much of the request as possible. If one of the updates in -the request cannot be successfully processed, the request is not marked as failed, but the body of the response -contains explicit error information for the failed update. -Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). - -```php -function bulkUpdateTeamMembers(BulkUpdateTeamMembersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpdateTeamMembersRequest`](../../doc/models/bulk-update-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpdateTeamMembersResponse`](../../doc/models/bulk-update-team-members-response.md). - -## Example Usage - -```php -$body = BulkUpdateTeamMembersRequestBuilder::init( - [ - 'AFMwA08kR-MIF-3Vs0OE' => UpdateTeamMemberRequestBuilder::init() - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_2') - ->status(TeamMemberStatus::ACTIVE) - ->givenName('Jane') - ->familyName('Smith') - ->emailAddress('jane_smith@gmail.com') - ->phoneNumber('+14159223334') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::ALL_CURRENT_AND_FUTURE_LOCATIONS) - ->build() - ) - ->build() - ) - ->build(), - 'fpgteZNMaf0qOK-a4t6P' => UpdateTeamMemberRequestBuilder::init() - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_1') - ->status(TeamMemberStatus::ACTIVE) - ->givenName('Joe') - ->familyName('Doe') - ->emailAddress('joe_doe@gmail.com') - ->phoneNumber('+14159283333') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::EXPLICIT_LOCATIONS) - ->locationIds( - [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - ) - ->build() - ) - ->build() - ) - ->build() - ] -)->build(); - -$apiResponse = $teamApi->bulkUpdateTeamMembers($body); - -if ($apiResponse->isSuccess()) { - $bulkUpdateTeamMembersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Jobs - -Lists jobs in a seller account. Results are sorted by title in ascending order. - -```php -function listJobs(?string $cursor = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | The pagination cursor returned by the previous call to this endpoint. Provide this
cursor to retrieve the next page of results for your original request. For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListJobsResponse`](../../doc/models/list-jobs-response.md). - -## Example Usage - -```php -$apiResponse = $teamApi->listJobs(); - -if ($apiResponse->isSuccess()) { - $listJobsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Job - -Creates a job in a seller account. A job defines a title and tip eligibility. Note that -compensation is defined in a [job assignment](../../doc/models/job-assignment.md) in a team member's wage setting. - -```php -function createJob(CreateJobRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateJobRequest`](../../doc/models/create-job-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateJobResponse`](../../doc/models/create-job-response.md). - -## Example Usage - -```php -$body = CreateJobRequestBuilder::init( - JobBuilder::init() - ->title('Cashier') - ->isTipEligible(true) - ->build(), - 'idempotency-key-0' -)->build(); - -$apiResponse = $teamApi->createJob($body); - -if ($apiResponse->isSuccess()) { - $createJobResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Job - -Retrieves a specified job. - -```php -function retrieveJob(string $jobId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `jobId` | `string` | Template, Required | The ID of the job to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveJobResponse`](../../doc/models/retrieve-job-response.md). - -## Example Usage - -```php -$jobId = 'job_id2'; - -$apiResponse = $teamApi->retrieveJob($jobId); - -if ($apiResponse->isSuccess()) { - $retrieveJobResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Job - -Updates the title or tip eligibility of a job. Changes to the title propagate to all -`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to -tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. - -```php -function updateJob(string $jobId, UpdateJobRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `jobId` | `string` | Template, Required | The ID of the job to update. | -| `body` | [`UpdateJobRequest`](../../doc/models/update-job-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateJobResponse`](../../doc/models/update-job-response.md). - -## Example Usage - -```php -$jobId = 'job_id2'; - -$body = UpdateJobRequestBuilder::init( - JobBuilder::init() - ->title('Cashier 1') - ->isTipEligible(true) - ->build() -)->build(); - -$apiResponse = $teamApi->updateJob( - $jobId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateJobResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Team Members - -Returns a paginated list of `TeamMember` objects for a business. -The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether -the team member is the Square account owner. - -```php -function searchTeamMembers(SearchTeamMembersRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchTeamMembersRequest`](../../doc/models/search-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchTeamMembersResponse`](../../doc/models/search-team-members-response.md). - -## Example Usage - -```php -$body = SearchTeamMembersRequestBuilder::init() - ->query( - SearchTeamMembersQueryBuilder::init() - ->filter( - SearchTeamMembersFilterBuilder::init() - ->locationIds( - [ - '0G5P3VGACMMQZ' - ] - ) - ->status(TeamMemberStatus::ACTIVE) - ->build() - ) - ->build() - ) - ->limit(10) - ->build(); - -$apiResponse = $teamApi->searchTeamMembers($body); - -if ($apiResponse->isSuccess()) { - $searchTeamMembersResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Team Member - -Retrieves a `TeamMember` object for the given `TeamMember.id`. -Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). - -```php -function retrieveTeamMember(string $teamMemberId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `string` | Template, Required | The ID of the team member to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveTeamMemberResponse`](../../doc/models/retrieve-team-member-response.md). - -## Example Usage - -```php -$teamMemberId = 'team_member_id0'; - -$apiResponse = $teamApi->retrieveTeamMember($teamMemberId); - -if ($apiResponse->isSuccess()) { - $retrieveTeamMemberResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Team Member - -Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates. -Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). - -```php -function updateTeamMember(string $teamMemberId, UpdateTeamMemberRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `string` | Template, Required | The ID of the team member to update. | -| `body` | [`UpdateTeamMemberRequest`](../../doc/models/update-team-member-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateTeamMemberResponse`](../../doc/models/update-team-member-response.md). - -## Example Usage - -```php -$teamMemberId = 'team_member_id0'; - -$body = UpdateTeamMemberRequestBuilder::init() - ->teamMember( - TeamMemberBuilder::init() - ->referenceId('reference_id_1') - ->status(TeamMemberStatus::ACTIVE) - ->givenName('Joe') - ->familyName('Doe') - ->emailAddress('joe_doe@gmail.com') - ->phoneNumber('+14159283333') - ->assignedLocations( - TeamMemberAssignedLocationsBuilder::init() - ->assignmentType(TeamMemberAssignedLocationsAssignmentType::EXPLICIT_LOCATIONS) - ->locationIds( - [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - ) - ->build() - ) - ->build() - ) - ->build(); - -$apiResponse = $teamApi->updateTeamMember( - $teamMemberId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateTeamMemberResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Wage Setting - -Retrieves a `WageSetting` object for a team member specified -by `TeamMember.id`. For more information, see -[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting). - -Square recommends using [RetrieveTeamMember](../../doc/apis/team.md#retrieve-team-member) or [SearchTeamMembers](../../doc/apis/team.md#search-team-members) -to get this information directly from the `TeamMember.wage_setting` field. - -```php -function retrieveWageSetting(string $teamMemberId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `string` | Template, Required | The ID of the team member for which to retrieve the wage setting. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveWageSettingResponse`](../../doc/models/retrieve-wage-setting-response.md). - -## Example Usage - -```php -$teamMemberId = 'team_member_id0'; - -$apiResponse = $teamApi->retrieveWageSetting($teamMemberId); - -if ($apiResponse->isSuccess()) { - $retrieveWageSettingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Wage Setting - -Creates or updates a `WageSetting` object. The object is created if a -`WageSetting` with the specified `team_member_id` doesn't exist. Otherwise, -it fully replaces the `WageSetting` object for the team member. -The `WageSetting` is returned on a successful update. For more information, see -[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). - -Square recommends using [CreateTeamMember](../../doc/apis/team.md#create-team-member) or [UpdateTeamMember](../../doc/apis/team.md#update-team-member) -to manage the `TeamMember.wage_setting` field directly. - -```php -function updateWageSetting(string $teamMemberId, UpdateWageSettingRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `teamMemberId` | `string` | Template, Required | The ID of the team member for which to update the `WageSetting` object. | -| `body` | [`UpdateWageSettingRequest`](../../doc/models/update-wage-setting-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateWageSettingResponse`](../../doc/models/update-wage-setting-response.md). - -## Example Usage - -```php -$teamMemberId = 'team_member_id0'; - -$body = UpdateWageSettingRequestBuilder::init( - WageSettingBuilder::init() - ->jobAssignments( - [ - JobAssignmentBuilder::init( - JobAssignmentPayType::SALARY - ) - ->jobTitle('Manager') - ->annualRate( - MoneyBuilder::init() - ->amount(3000000) - ->currency(Currency::USD) - ->build() - ) - ->weeklyHours(40) - ->build(), - JobAssignmentBuilder::init( - JobAssignmentPayType::HOURLY - ) - ->jobTitle('Cashier') - ->hourlyRate( - MoneyBuilder::init() - ->amount(2000) - ->currency(Currency::USD) - ->build() - ) - ->build() - ] - ) - ->isOvertimeExempt(true) - ->build() -)->build(); - -$apiResponse = $teamApi->updateWageSetting( - $teamMemberId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateWageSettingResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/terminal.md b/doc/apis/terminal.md deleted file mode 100644 index 3fa5a4b9..00000000 --- a/doc/apis/terminal.md +++ /dev/null @@ -1,669 +0,0 @@ -# Terminal - -```php -$terminalApi = $client->getTerminalApi(); -``` - -## Class Name - -`TerminalApi` - -## Methods - -* [Create Terminal Action](../../doc/apis/terminal.md#create-terminal-action) -* [Search Terminal Actions](../../doc/apis/terminal.md#search-terminal-actions) -* [Get Terminal Action](../../doc/apis/terminal.md#get-terminal-action) -* [Cancel Terminal Action](../../doc/apis/terminal.md#cancel-terminal-action) -* [Dismiss Terminal Action](../../doc/apis/terminal.md#dismiss-terminal-action) -* [Create Terminal Checkout](../../doc/apis/terminal.md#create-terminal-checkout) -* [Search Terminal Checkouts](../../doc/apis/terminal.md#search-terminal-checkouts) -* [Get Terminal Checkout](../../doc/apis/terminal.md#get-terminal-checkout) -* [Cancel Terminal Checkout](../../doc/apis/terminal.md#cancel-terminal-checkout) -* [Dismiss Terminal Checkout](../../doc/apis/terminal.md#dismiss-terminal-checkout) -* [Create Terminal Refund](../../doc/apis/terminal.md#create-terminal-refund) -* [Search Terminal Refunds](../../doc/apis/terminal.md#search-terminal-refunds) -* [Get Terminal Refund](../../doc/apis/terminal.md#get-terminal-refund) -* [Cancel Terminal Refund](../../doc/apis/terminal.md#cancel-terminal-refund) -* [Dismiss Terminal Refund](../../doc/apis/terminal.md#dismiss-terminal-refund) - - -# Create Terminal Action - -Creates a Terminal action request and sends it to the specified device. - -```php -function createTerminalAction(CreateTerminalActionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateTerminalActionRequest`](../../doc/models/create-terminal-action-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateTerminalActionResponse`](../../doc/models/create-terminal-action-response.md). - -## Example Usage - -```php -$body = CreateTerminalActionRequestBuilder::init( - 'thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e', - TerminalActionBuilder::init() - ->deviceId('{{DEVICE_ID}}') - ->deadlineDuration('PT5M') - ->type(TerminalActionActionType::SAVE_CARD) - ->saveCardOptions( - SaveCardOptionsBuilder::init( - '{{CUSTOMER_ID}}' - ) - ->referenceId('user-id-1') - ->build() - ) - ->build() -)->build(); - -$apiResponse = $terminalApi->createTerminalAction($body); - -if ($apiResponse->isSuccess()) { - $createTerminalActionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Terminal Actions - -Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. - -```php -function searchTerminalActions(SearchTerminalActionsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchTerminalActionsRequest`](../../doc/models/search-terminal-actions-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchTerminalActionsResponse`](../../doc/models/search-terminal-actions-response.md). - -## Example Usage - -```php -$body = SearchTerminalActionsRequestBuilder::init() - ->query( - TerminalActionQueryBuilder::init() - ->filter( - TerminalActionQueryFilterBuilder::init() - ->createdAt( - TimeRangeBuilder::init() - ->startAt('2022-04-01T00:00:00.000Z') - ->build() - ) - ->build() - ) - ->sort( - TerminalActionQuerySortBuilder::init() - ->sortOrder(SortOrder::DESC) - ->build() - ) - ->build() - ) - ->limit(2) - ->build(); - -$apiResponse = $terminalApi->searchTerminalActions($body); - -if ($apiResponse->isSuccess()) { - $searchTerminalActionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Terminal Action - -Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. - -```php -function getTerminalAction(string $actionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetTerminalActionResponse`](../../doc/models/get-terminal-action-response.md). - -## Example Usage - -```php -$actionId = 'action_id6'; - -$apiResponse = $terminalApi->getTerminalAction($actionId); - -if ($apiResponse->isSuccess()) { - $getTerminalActionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Terminal Action - -Cancels a Terminal action request if the status of the request permits it. - -```php -function cancelTerminalAction(string $actionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelTerminalActionResponse`](../../doc/models/cancel-terminal-action-response.md). - -## Example Usage - -```php -$actionId = 'action_id6'; - -$apiResponse = $terminalApi->cancelTerminalAction($actionId); - -if ($apiResponse->isSuccess()) { - $cancelTerminalActionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Dismiss Terminal Action - -Dismisses a Terminal action request if the status and type of the request permits it. - -See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. - -```php -function dismissTerminalAction(string $actionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `actionId` | `string` | Template, Required | Unique ID for the `TerminalAction` associated with the action to be dismissed. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DismissTerminalActionResponse`](../../doc/models/dismiss-terminal-action-response.md). - -## Example Usage - -```php -$actionId = 'action_id6'; - -$apiResponse = $terminalApi->dismissTerminalAction($actionId); - -if ($apiResponse->isSuccess()) { - $dismissTerminalActionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Terminal Checkout - -Creates a Terminal checkout request and sends it to the specified device to take a payment -for the requested amount. - -```php -function createTerminalCheckout(CreateTerminalCheckoutRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateTerminalCheckoutRequest`](../../doc/models/create-terminal-checkout-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateTerminalCheckoutResponse`](../../doc/models/create-terminal-checkout-response.md). - -## Example Usage - -```php -$body = CreateTerminalCheckoutRequestBuilder::init( - '28a0c3bc-7839-11ea-bc55-0242ac130003', - TerminalCheckoutBuilder::init( - MoneyBuilder::init() - ->amount(2610) - ->currency(Currency::USD) - ->build(), - DeviceCheckoutOptionsBuilder::init( - 'dbb5d83a-7838-11ea-bc55-0242ac130003' - )->build() - ) - ->referenceId('id11572') - ->note('A brief note') - ->build() -)->build(); - -$apiResponse = $terminalApi->createTerminalCheckout($body); - -if ($apiResponse->isSuccess()) { - $createTerminalCheckoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Terminal Checkouts - -Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. - -```php -function searchTerminalCheckouts(SearchTerminalCheckoutsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchTerminalCheckoutsRequest`](../../doc/models/search-terminal-checkouts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchTerminalCheckoutsResponse`](../../doc/models/search-terminal-checkouts-response.md). - -## Example Usage - -```php -$body = SearchTerminalCheckoutsRequestBuilder::init() - ->query( - TerminalCheckoutQueryBuilder::init() - ->filter( - TerminalCheckoutQueryFilterBuilder::init() - ->status('COMPLETED') - ->build() - ) - ->build() - ) - ->limit(2) - ->build(); - -$apiResponse = $terminalApi->searchTerminalCheckouts($body); - -if ($apiResponse->isSuccess()) { - $searchTerminalCheckoutsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Terminal Checkout - -Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. - -```php -function getTerminalCheckout(string $checkoutId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkoutId` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetTerminalCheckoutResponse`](../../doc/models/get-terminal-checkout-response.md). - -## Example Usage - -```php -$checkoutId = 'checkout_id8'; - -$apiResponse = $terminalApi->getTerminalCheckout($checkoutId); - -if ($apiResponse->isSuccess()) { - $getTerminalCheckoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Terminal Checkout - -Cancels a Terminal checkout request if the status of the request permits it. - -```php -function cancelTerminalCheckout(string $checkoutId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkoutId` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelTerminalCheckoutResponse`](../../doc/models/cancel-terminal-checkout-response.md). - -## Example Usage - -```php -$checkoutId = 'checkout_id8'; - -$apiResponse = $terminalApi->cancelTerminalCheckout($checkoutId); - -if ($apiResponse->isSuccess()) { - $cancelTerminalCheckoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Dismiss Terminal Checkout - -Dismisses a Terminal checkout request if the status and type of the request permits it. - -```php -function dismissTerminalCheckout(string $checkoutId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkoutId` | `string` | Template, Required | Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DismissTerminalCheckoutResponse`](../../doc/models/dismiss-terminal-checkout-response.md). - -## Example Usage - -```php -$checkoutId = 'checkout_id8'; - -$apiResponse = $terminalApi->dismissTerminalCheckout($checkoutId); - -if ($apiResponse->isSuccess()) { - $dismissTerminalCheckoutResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Terminal Refund - -Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](../../doc/apis/refunds.md). - -```php -function createTerminalRefund(CreateTerminalRefundRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateTerminalRefundRequest`](../../doc/models/create-terminal-refund-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateTerminalRefundResponse`](../../doc/models/create-terminal-refund-response.md). - -## Example Usage - -```php -$body = CreateTerminalRefundRequestBuilder::init( - '402a640b-b26f-401f-b406-46f839590c04' -) - ->refund( - TerminalRefundBuilder::init( - '5O5OvgkcNUhl7JBuINflcjKqUzXZY', - MoneyBuilder::init() - ->amount(111) - ->currency(Currency::CAD) - ->build(), - 'Returning items', - 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291' - )->build() - )->build(); - -$apiResponse = $terminalApi->createTerminalRefund($body); - -if ($apiResponse->isSuccess()) { - $createTerminalRefundResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Terminal Refunds - -Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. - -```php -function searchTerminalRefunds(SearchTerminalRefundsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchTerminalRefundsRequest`](../../doc/models/search-terminal-refunds-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchTerminalRefundsResponse`](../../doc/models/search-terminal-refunds-response.md). - -## Example Usage - -```php -$body = SearchTerminalRefundsRequestBuilder::init() - ->query( - TerminalRefundQueryBuilder::init() - ->filter( - TerminalRefundQueryFilterBuilder::init() - ->status('COMPLETED') - ->build() - ) - ->build() - ) - ->limit(1) - ->build(); - -$apiResponse = $terminalApi->searchTerminalRefunds($body); - -if ($apiResponse->isSuccess()) { - $searchTerminalRefundsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Get Terminal Refund - -Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. - -```php -function getTerminalRefund(string $terminalRefundId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminalRefundId` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`GetTerminalRefundResponse`](../../doc/models/get-terminal-refund-response.md). - -## Example Usage - -```php -$terminalRefundId = 'terminal_refund_id0'; - -$apiResponse = $terminalApi->getTerminalRefund($terminalRefundId); - -if ($apiResponse->isSuccess()) { - $getTerminalRefundResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Cancel Terminal Refund - -Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. - -```php -function cancelTerminalRefund(string $terminalRefundId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminalRefundId` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CancelTerminalRefundResponse`](../../doc/models/cancel-terminal-refund-response.md). - -## Example Usage - -```php -$terminalRefundId = 'terminal_refund_id0'; - -$apiResponse = $terminalApi->cancelTerminalRefund($terminalRefundId); - -if ($apiResponse->isSuccess()) { - $cancelTerminalRefundResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Dismiss Terminal Refund - -Dismisses a Terminal refund request if the status and type of the request permits it. - -```php -function dismissTerminalRefund(string $terminalRefundId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminalRefundId` | `string` | Template, Required | Unique ID for the `TerminalRefund` associated with the refund to be dismissed. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DismissTerminalRefundResponse`](../../doc/models/dismiss-terminal-refund-response.md). - -## Example Usage - -```php -$terminalRefundId = 'terminal_refund_id0'; - -$apiResponse = $terminalApi->dismissTerminalRefund($terminalRefundId); - -if ($apiResponse->isSuccess()) { - $dismissTerminalRefundResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/transactions.md b/doc/apis/transactions.md deleted file mode 100644 index 05f616a3..00000000 --- a/doc/apis/transactions.md +++ /dev/null @@ -1,214 +0,0 @@ -# Transactions - -```php -$transactionsApi = $client->getTransactionsApi(); -``` - -## Class Name - -`TransactionsApi` - -## Methods - -* [List Transactions](../../doc/apis/transactions.md#list-transactions) -* [Retrieve Transaction](../../doc/apis/transactions.md#retrieve-transaction) -* [Capture Transaction](../../doc/apis/transactions.md#capture-transaction) -* [Void Transaction](../../doc/apis/transactions.md#void-transaction) - - -# List Transactions - -**This endpoint is deprecated.** - -Lists transactions for a particular location. - -Transactions include payment information from sales and exchanges and refund -information from returns and exchanges. - -Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 - -```php -function listTransactions( - string $locationId, - ?string $beginTime = null, - ?string $endTime = null, - ?string $sortOrder = null, - ?string $cursor = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list transactions for. | -| `beginTime` | `?string` | Query, Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which results are listed in the response (`ASC` for
oldest first, `DESC` for newest first).

Default value: `DESC` | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListTransactionsResponse`](../../doc/models/list-transactions-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $transactionsApi->listTransactions($locationId); - -if ($apiResponse->isSuccess()) { - $listTransactionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Transaction - -**This endpoint is deprecated.** - -Retrieves details for a single transaction. - -```php -function retrieveTransaction(string $locationId, string $transactionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the transaction's associated location. | -| `transactionId` | `string` | Template, Required | The ID of the transaction to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveTransactionResponse`](../../doc/models/retrieve-transaction-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$transactionId = 'transaction_id8'; - -$apiResponse = $transactionsApi->retrieveTransaction( - $locationId, - $transactionId -); - -if ($apiResponse->isSuccess()) { - $retrieveTransactionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Capture Transaction - -**This endpoint is deprecated.** - -Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. - -```php -function captureTransaction(string $locationId, string $transactionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | - | -| `transactionId` | `string` | Template, Required | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CaptureTransactionResponse`](../../doc/models/capture-transaction-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$transactionId = 'transaction_id8'; - -$apiResponse = $transactionsApi->captureTransaction( - $locationId, - $transactionId -); - -if ($apiResponse->isSuccess()) { - $captureTransactionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Void Transaction - -**This endpoint is deprecated.** - -Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. - -```php -function voidTransaction(string $locationId, string $transactionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | - | -| `transactionId` | `string` | Template, Required | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`VoidTransactionResponse`](../../doc/models/void-transaction-response.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$transactionId = 'transaction_id8'; - -$apiResponse = $transactionsApi->voidTransaction( - $locationId, - $transactionId -); - -if ($apiResponse->isSuccess()) { - $voidTransactionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/v1-transactions.md b/doc/apis/v1-transactions.md deleted file mode 100644 index 53182d71..00000000 --- a/doc/apis/v1-transactions.md +++ /dev/null @@ -1,159 +0,0 @@ -# V1 Transactions - -```php -$v1TransactionsApi = $client->getV1TransactionsApi(); -``` - -## Class Name - -`V1TransactionsApi` - -## Methods - -* [V1 List Orders](../../doc/apis/v1-transactions.md#v1-list-orders) -* [V1 Retrieve Order](../../doc/apis/v1-transactions.md#v1-retrieve-order) -* [V1 Update Order](../../doc/apis/v1-transactions.md#v1-update-order) - - -# V1 List Orders - -**This endpoint is deprecated.** - -Provides summary information for a merchant's online store orders. - -```php -function v1ListOrders( - string $locationId, - ?string $order = null, - ?int $limit = null, - ?string $batchToken = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the location to list online store orders for. | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `limit` | `?int` | Query, Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | -| `batchToken` | `?string` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`V1Order[]`](../../doc/models/v1-order.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$apiResponse = $v1TransactionsApi->v1ListOrders($locationId); - -if ($apiResponse->isSuccess()) { - $v1Order = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# V1 Retrieve Order - -**This endpoint is deprecated.** - -Provides comprehensive information for a single online store order, including the order's history. - -```php -function v1RetrieveOrder(string $locationId, string $orderId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the order's associated location. | -| `orderId` | `string` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`V1Order`](../../doc/models/v1-order.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$orderId = 'order_id6'; - -$apiResponse = $v1TransactionsApi->v1RetrieveOrder( - $locationId, - $orderId -); - -if ($apiResponse->isSuccess()) { - $v1Order = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# V1 Update Order - -**This endpoint is deprecated.** - -Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: - -```php -function v1UpdateOrder(string $locationId, string $orderId, V1UpdateOrderRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `locationId` | `string` | Template, Required | The ID of the order's associated location. | -| `orderId` | `string` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | -| `body` | [`V1UpdateOrderRequest`](../../doc/models/v1-update-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`V1Order`](../../doc/models/v1-order.md). - -## Example Usage - -```php -$locationId = 'location_id4'; - -$orderId = 'order_id6'; - -$body = V1UpdateOrderRequestBuilder::init( - V1UpdateOrderRequestAction::REFUND -)->build(); - -$apiResponse = $v1TransactionsApi->v1UpdateOrder( - $locationId, - $orderId, - $body -); - -if ($apiResponse->isSuccess()) { - $v1Order = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/vendors.md b/doc/apis/vendors.md deleted file mode 100644 index 09e0740e..00000000 --- a/doc/apis/vendors.md +++ /dev/null @@ -1,316 +0,0 @@ -# Vendors - -```php -$vendorsApi = $client->getVendorsApi(); -``` - -## Class Name - -`VendorsApi` - -## Methods - -* [Bulk Create Vendors](../../doc/apis/vendors.md#bulk-create-vendors) -* [Bulk Retrieve Vendors](../../doc/apis/vendors.md#bulk-retrieve-vendors) -* [Bulk Update Vendors](../../doc/apis/vendors.md#bulk-update-vendors) -* [Create Vendor](../../doc/apis/vendors.md#create-vendor) -* [Search Vendors](../../doc/apis/vendors.md#search-vendors) -* [Retrieve Vendor](../../doc/apis/vendors.md#retrieve-vendor) -* [Update Vendor](../../doc/apis/vendors.md#update-vendor) - - -# Bulk Create Vendors - -Creates one or more [Vendor](../../doc/models/vendor.md) objects to represent suppliers to a seller. - -```php -function bulkCreateVendors(BulkCreateVendorsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkCreateVendorsRequest`](../../doc/models/bulk-create-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkCreateVendorsResponse`](../../doc/models/bulk-create-vendors-response.md). - -## Example Usage - -```php -$body = BulkCreateVendorsRequestBuilder::init( - [ - 'key0' => VendorBuilder::init()->build(), - 'key1' => VendorBuilder::init()->build() - ] -)->build(); - -$apiResponse = $vendorsApi->bulkCreateVendors($body); - -if ($apiResponse->isSuccess()) { - $bulkCreateVendorsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Retrieve Vendors - -Retrieves one or more vendors of specified [Vendor](../../doc/models/vendor.md) IDs. - -```php -function bulkRetrieveVendors(BulkRetrieveVendorsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkRetrieveVendorsRequest`](../../doc/models/bulk-retrieve-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkRetrieveVendorsResponse`](../../doc/models/bulk-retrieve-vendors-response.md). - -## Example Usage - -```php -$body = BulkRetrieveVendorsRequestBuilder::init() - ->vendorIds( - [ - 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4' - ] - ) - ->build(); - -$apiResponse = $vendorsApi->bulkRetrieveVendors($body); - -if ($apiResponse->isSuccess()) { - $bulkRetrieveVendorsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Bulk Update Vendors - -Updates one or more of existing [Vendor](../../doc/models/vendor.md) objects as suppliers to a seller. - -```php -function bulkUpdateVendors(BulkUpdateVendorsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`BulkUpdateVendorsRequest`](../../doc/models/bulk-update-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`BulkUpdateVendorsResponse`](../../doc/models/bulk-update-vendors-response.md). - -## Example Usage - -```php -$body = BulkUpdateVendorsRequestBuilder::init( - [ - 'key0' => UpdateVendorRequestBuilder::init( - VendorBuilder::init()->build() - )->build(), - 'key1' => UpdateVendorRequestBuilder::init( - VendorBuilder::init()->build() - )->build() - ] -)->build(); - -$apiResponse = $vendorsApi->bulkUpdateVendors($body); - -if ($apiResponse->isSuccess()) { - $bulkUpdateVendorsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Vendor - -Creates a single [Vendor](../../doc/models/vendor.md) object to represent a supplier to a seller. - -```php -function createVendor(CreateVendorRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateVendorRequest`](../../doc/models/create-vendor-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateVendorResponse`](../../doc/models/create-vendor-response.md). - -## Example Usage - -```php -$body = CreateVendorRequestBuilder::init( - 'idempotency_key2' -)->build(); - -$apiResponse = $vendorsApi->createVendor($body); - -if ($apiResponse->isSuccess()) { - $createVendorResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Search Vendors - -Searches for vendors using a filter against supported [Vendor](../../doc/models/vendor.md) properties and a supported sorter. - -```php -function searchVendors(SearchVendorsRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`SearchVendorsRequest`](../../doc/models/search-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`SearchVendorsResponse`](../../doc/models/search-vendors-response.md). - -## Example Usage - -```php -$body = SearchVendorsRequestBuilder::init()->build(); - -$apiResponse = $vendorsApi->searchVendors($body); - -if ($apiResponse->isSuccess()) { - $searchVendorsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Vendor - -Retrieves the vendor of a specified [Vendor](../../doc/models/vendor.md) ID. - -```php -function retrieveVendor(string $vendorId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `vendorId` | `string` | Template, Required | ID of the [Vendor](entity:Vendor) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveVendorResponse`](../../doc/models/retrieve-vendor-response.md). - -## Example Usage - -```php -$vendorId = 'vendor_id8'; - -$apiResponse = $vendorsApi->retrieveVendor($vendorId); - -if ($apiResponse->isSuccess()) { - $retrieveVendorResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Vendor - -Updates an existing [Vendor](../../doc/models/vendor.md) object as a supplier to a seller. - -```php -function updateVendor(UpdateVendorRequest $body, string $vendorId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`UpdateVendorRequest`](../../doc/models/update-vendor-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | -| `vendorId` | `string` | Template, Required | - | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateVendorResponse`](../../doc/models/update-vendor-response.md). - -## Example Usage - -```php -$body = UpdateVendorRequestBuilder::init( - VendorBuilder::init() - ->id('INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4') - ->name('Jack\'s Chicken Shack') - ->version(1) - ->status(VendorStatus::ACTIVE) - ->build() -) - ->idempotencyKey('8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe') - ->build(); - -$vendorId = 'vendor_id8'; - -$apiResponse = $vendorsApi->updateVendor( - $body, - $vendorId -); - -if ($apiResponse->isSuccess()) { - $updateVendorResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/apis/webhook-subscriptions.md b/doc/apis/webhook-subscriptions.md deleted file mode 100644 index 651a9d25..00000000 --- a/doc/apis/webhook-subscriptions.md +++ /dev/null @@ -1,372 +0,0 @@ -# Webhook Subscriptions - -```php -$webhookSubscriptionsApi = $client->getWebhookSubscriptionsApi(); -``` - -## Class Name - -`WebhookSubscriptionsApi` - -## Methods - -* [List Webhook Event Types](../../doc/apis/webhook-subscriptions.md#list-webhook-event-types) -* [List Webhook Subscriptions](../../doc/apis/webhook-subscriptions.md#list-webhook-subscriptions) -* [Create Webhook Subscription](../../doc/apis/webhook-subscriptions.md#create-webhook-subscription) -* [Delete Webhook Subscription](../../doc/apis/webhook-subscriptions.md#delete-webhook-subscription) -* [Retrieve Webhook Subscription](../../doc/apis/webhook-subscriptions.md#retrieve-webhook-subscription) -* [Update Webhook Subscription](../../doc/apis/webhook-subscriptions.md#update-webhook-subscription) -* [Update Webhook Subscription Signature Key](../../doc/apis/webhook-subscriptions.md#update-webhook-subscription-signature-key) -* [Test Webhook Subscription](../../doc/apis/webhook-subscriptions.md#test-webhook-subscription) - - -# List Webhook Event Types - -Lists all webhook event types that can be subscribed to. - -```php -function listWebhookEventTypes(?string $apiVersion = null): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `apiVersion` | `?string` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListWebhookEventTypesResponse`](../../doc/models/list-webhook-event-types-response.md). - -## Example Usage - -```php -$apiResponse = $webhookSubscriptionsApi->listWebhookEventTypes(); - -if ($apiResponse->isSuccess()) { - $listWebhookEventTypesResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# List Webhook Subscriptions - -Lists all webhook subscriptions owned by your application. - -```php -function listWebhookSubscriptions( - ?string $cursor = null, - ?bool $includeDisabled = false, - ?string $sortOrder = null, - ?int $limit = null -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | -| `includeDisabled` | `?bool` | Query, Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned.
**Default**: `false` | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order.
This field defaults to ASC. | -| `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value.

Default: 100 | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`ListWebhookSubscriptionsResponse`](../../doc/models/list-webhook-subscriptions-response.md). - -## Example Usage - -```php -$includeDisabled = false; - -$apiResponse = $webhookSubscriptionsApi->listWebhookSubscriptions( - null, - $includeDisabled -); - -if ($apiResponse->isSuccess()) { - $listWebhookSubscriptionsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Create Webhook Subscription - -Creates a webhook subscription. - -```php -function createWebhookSubscription(CreateWebhookSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`CreateWebhookSubscriptionRequest`](../../doc/models/create-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`CreateWebhookSubscriptionResponse`](../../doc/models/create-webhook-subscription-response.md). - -## Example Usage - -```php -$body = CreateWebhookSubscriptionRequestBuilder::init( - WebhookSubscriptionBuilder::init() - ->name('Example Webhook Subscription') - ->eventTypes( - [ - 'payment.created', - 'payment.updated' - ] - ) - ->notificationUrl('https://example-webhook-url.com') - ->apiVersion('2021-12-15') - ->build() -) - ->idempotencyKey('63f84c6c-2200-4c99-846c-2670a1311fbf') - ->build(); - -$apiResponse = $webhookSubscriptionsApi->createWebhookSubscription($body); - -if ($apiResponse->isSuccess()) { - $createWebhookSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Delete Webhook Subscription - -Deletes a webhook subscription. - -```php -function deleteWebhookSubscription(string $subscriptionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DeleteWebhookSubscriptionResponse`](../../doc/models/delete-webhook-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$apiResponse = $webhookSubscriptionsApi->deleteWebhookSubscription($subscriptionId); - -if ($apiResponse->isSuccess()) { - $deleteWebhookSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Retrieve Webhook Subscription - -Retrieves a webhook subscription identified by its ID. - -```php -function retrieveWebhookSubscription(string $subscriptionId): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`RetrieveWebhookSubscriptionResponse`](../../doc/models/retrieve-webhook-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$apiResponse = $webhookSubscriptionsApi->retrieveWebhookSubscription($subscriptionId); - -if ($apiResponse->isSuccess()) { - $retrieveWebhookSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Webhook Subscription - -Updates a webhook subscription. - -```php -function updateWebhookSubscription(string $subscriptionId, UpdateWebhookSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | -| `body` | [`UpdateWebhookSubscriptionRequest`](../../doc/models/update-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateWebhookSubscriptionResponse`](../../doc/models/update-webhook-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = UpdateWebhookSubscriptionRequestBuilder::init() - ->subscription( - WebhookSubscriptionBuilder::init() - ->name('Updated Example Webhook Subscription') - ->enabled(false) - ->build() - ) - ->build(); - -$apiResponse = $webhookSubscriptionsApi->updateWebhookSubscription( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateWebhookSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Update Webhook Subscription Signature Key - -Updates a webhook subscription by replacing the existing signature key with a new one. - -```php -function updateWebhookSubscriptionSignatureKey( - string $subscriptionId, - UpdateWebhookSubscriptionSignatureKeyRequest $body -): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | -| `body` | [`UpdateWebhookSubscriptionSignatureKeyRequest`](../../doc/models/update-webhook-subscription-signature-key-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`UpdateWebhookSubscriptionSignatureKeyResponse`](../../doc/models/update-webhook-subscription-signature-key-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = UpdateWebhookSubscriptionSignatureKeyRequestBuilder::init() - ->idempotencyKey('ed80ae6b-0654-473b-bbab-a39aee89a60d') - ->build(); - -$apiResponse = $webhookSubscriptionsApi->updateWebhookSubscriptionSignatureKey( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $updateWebhookSubscriptionSignatureKeyResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - - -# Test Webhook Subscription - -Tests a webhook subscription by sending a test event to the notification URL. - -```php -function testWebhookSubscription(string $subscriptionId, TestWebhookSubscriptionRequest $body): ApiResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. | -| `body` | [`TestWebhookSubscriptionRequest`](../../doc/models/test-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | - -## Response Type - -This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`TestWebhookSubscriptionResponse`](../../doc/models/test-webhook-subscription-response.md). - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$body = TestWebhookSubscriptionRequestBuilder::init() - ->eventType('payment.created') - ->build(); - -$apiResponse = $webhookSubscriptionsApi->testWebhookSubscription( - $subscriptionId, - $body -); - -if ($apiResponse->isSuccess()) { - $testWebhookSubscriptionResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - diff --git a/doc/auth/oauth-2-bearer-token.md b/doc/auth/oauth-2-bearer-token.md deleted file mode 100644 index da137264..00000000 --- a/doc/auth/oauth-2-bearer-token.md +++ /dev/null @@ -1,34 +0,0 @@ - -# OAuth 2 Bearer token - - - -Documentation for accessing and setting credentials for global. - -## Auth Credentials - -| Name | Type | Description | Setter | Getter | -| --- | --- | --- | --- | --- | -| AccessToken | `string` | The OAuth 2.0 Access Token to use for API requests. | `accessToken` | `getAccessToken()` | - - - -**Note:** Auth credentials can be set using `BearerAuthCredentialsBuilder::init()` in `bearerAuthCredentials` method in the client builder and accessed through `getBearerAuthCredentials` method in the client instance. - -## Usage Example - -### Client Initialization - -You must provide credentials in the client as shown in the following code snippet. - -```php -$client = SquareClientBuilder::init() - ->bearerAuthCredentials( - BearerAuthCredentialsBuilder::init( - 'AccessToken' - ) - ) - ->build(); -``` - - diff --git a/doc/client.md b/doc/client.md deleted file mode 100644 index dfa78aea..00000000 --- a/doc/client.md +++ /dev/null @@ -1,132 +0,0 @@ - -# Client Class Documentation - -The following parameters are configurable for the API Client: - -| Parameter | Type | Description | -| --- | --- | --- | -| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2025-01-23'` | -| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | -| `environment` | `string` | The API environment.
**Default: `production`** | -| `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `60` | -| `enableRetries` | `bool` | Whether to enable retries and backoff feature.
*Default*: `false` | -| `numberOfRetries` | `int` | The number of retries to make.
*Default*: `0` | -| `retryInterval` | `float` | The retry time interval between the endpoint calls.
*Default*: `1` | -| `backOffFactor` | `float` | Exponential backoff factor to increase interval between retries.
*Default*: `2` | -| `maximumRetryWaitTime` | `int` | The maximum wait time in seconds for overall retrying requests.
*Default*: `0` | -| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` | -| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | -| `httpMethodsToRetry` | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` | -| `additionalHeaders` | `array` | Additional headers to add to each API call
*Default*: `[]` | -| `userAgentDetail` | `string` | User agent detail, to be appended with user-agent header. | -| `bearerAuthCredentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The Credentials Setter for OAuth 2 Bearer token | - -The API client can be initialized as follows: - -```php -$client = SquareClientBuilder::init() - ->bearerAuthCredentials( - BearerAuthCredentialsBuilder::init( - 'AccessToken' - ) - ) - ->squareVersion('2025-01-23') - ->environment(Environment::PRODUCTION) - ->customUrl('https://connect.squareup.com') - ->build(); -``` - -API calls return an `ApiResponse` object that includes the following fields: - -| Field | Description | -| --- | --- | -| `getStatusCode` | Status code of the HTTP response | -| `getHeaders` | Headers of the HTTP response as a Hash | -| `getResult` | The deserialized body of the HTTP response as a String | - -## Make Calls with the API Client - -```php -bearerAuthCredentials( - BearerAuthCredentialsBuilder::init( - 'AccessToken' - ) - ) - ->squareVersion('2025-01-23') - ->environment(Environment::PRODUCTION) - ->customUrl('https://connect.squareup.com') - ->build(); - -$apiResponse = $client->getLocationsApi()->listLocations(); - -if ($apiResponse->isSuccess()) { - $listLocationsResponse = $apiResponse->getResult(); -} else { - $errors = $apiResponse->getErrors(); -} - -// Getting more response information -var_dump($apiResponse->getStatusCode()); -var_dump($apiResponse->getHeaders()); -``` - -## Square Client - -The gateway for the SDK. This class acts as a factory for the Apis and also holds the configuration of the SDK. - -## API - -| Name | Description | -| --- | --- | -| getMobileAuthorizationApi() | Gets MobileAuthorizationApi | -| getOAuthApi() | Gets OAuthApi | -| getV1TransactionsApi() | Gets V1TransactionsApi | -| getApplePayApi() | Gets ApplePayApi | -| getBankAccountsApi() | Gets BankAccountsApi | -| getBookingsApi() | Gets BookingsApi | -| getBookingCustomAttributesApi() | Gets BookingCustomAttributesApi | -| getCardsApi() | Gets CardsApi | -| getCashDrawersApi() | Gets CashDrawersApi | -| getCatalogApi() | Gets CatalogApi | -| getCustomersApi() | Gets CustomersApi | -| getCustomerCustomAttributesApi() | Gets CustomerCustomAttributesApi | -| getCustomerGroupsApi() | Gets CustomerGroupsApi | -| getCustomerSegmentsApi() | Gets CustomerSegmentsApi | -| getDevicesApi() | Gets DevicesApi | -| getDisputesApi() | Gets DisputesApi | -| getEmployeesApi() | Gets EmployeesApi | -| getEventsApi() | Gets EventsApi | -| getGiftCardsApi() | Gets GiftCardsApi | -| getGiftCardActivitiesApi() | Gets GiftCardActivitiesApi | -| getInventoryApi() | Gets InventoryApi | -| getInvoicesApi() | Gets InvoicesApi | -| getLaborApi() | Gets LaborApi | -| getLocationsApi() | Gets LocationsApi | -| getLocationCustomAttributesApi() | Gets LocationCustomAttributesApi | -| getCheckoutApi() | Gets CheckoutApi | -| getTransactionsApi() | Gets TransactionsApi | -| getLoyaltyApi() | Gets LoyaltyApi | -| getMerchantsApi() | Gets MerchantsApi | -| getMerchantCustomAttributesApi() | Gets MerchantCustomAttributesApi | -| getOrdersApi() | Gets OrdersApi | -| getOrderCustomAttributesApi() | Gets OrderCustomAttributesApi | -| getPaymentsApi() | Gets PaymentsApi | -| getPayoutsApi() | Gets PayoutsApi | -| getRefundsApi() | Gets RefundsApi | -| getSitesApi() | Gets SitesApi | -| getSnippetsApi() | Gets SnippetsApi | -| getSubscriptionsApi() | Gets SubscriptionsApi | -| getTeamApi() | Gets TeamApi | -| getTerminalApi() | Gets TerminalApi | -| getVendorsApi() | Gets VendorsApi | -| getWebhookSubscriptionsApi() | Gets WebhookSubscriptionsApi | - diff --git a/doc/http-request.md b/doc/http-request.md deleted file mode 100644 index 065d652b..00000000 --- a/doc/http-request.md +++ /dev/null @@ -1,14 +0,0 @@ - -# HttpRequest - -Represents a single Http Request. - -## Methods - -| Name | Type | Description | -| --- | --- | --- | -| getHttpMethod() | string | The HTTP method of the request. | -| getQueryUrl() | string | The endpoint URL for the API request. | -| getHeaders() | array | Request headers. | -| getParameters() | array | Input parameters for the body. | - diff --git a/doc/http-response.md b/doc/http-response.md deleted file mode 100644 index e7bdfc98..00000000 --- a/doc/http-response.md +++ /dev/null @@ -1,13 +0,0 @@ - -# HttpResponse - -Http response received. - -## Methods - -| Name | Type | Description | -| --- | --- | --- | -| getStatusCode() | int | The status code of the response. | -| getHeaders() | array | Response headers. | -| getRawBody() | string | Raw body of the response. | - diff --git a/doc/models/accept-dispute-response.md b/doc/models/accept-dispute-response.md deleted file mode 100644 index 4c6c72c5..00000000 --- a/doc/models/accept-dispute-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Accept Dispute Response - -Defines the fields in an `AcceptDispute` response. - -## Structure - -`AcceptDisputeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `dispute` | [`?Dispute`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | getDispute(): ?Dispute | setDispute(?Dispute dispute): void | - -## Example (as JSON) - -```json -{ - "dispute": { - "amount_money": { - "amount": 2500, - "currency": "USD" - }, - "brand_dispute_id": "100000809947", - "card_brand": "VISA", - "created_at": "2022-06-29T18:45:22.265Z", - "disputed_payment": { - "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" - }, - "due_at": "2022-07-13T00:00:00.000Z", - "id": "XDgyFu7yo1E2S5lQGGpYn", - "location_id": "L1HN3ZMQK64X9", - "reason": "NO_KNOWLEDGE", - "reported_at": "2022-06-29T00:00:00.000Z", - "state": "ACCEPTED", - "updated_at": "2022-07-07T19:14:42.650Z", - "version": 2, - "dispute_id": "dispute_id8" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/accepted-payment-methods.md b/doc/models/accepted-payment-methods.md deleted file mode 100644 index 7876da61..00000000 --- a/doc/models/accepted-payment-methods.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Accepted Payment Methods - -## Structure - -`AcceptedPaymentMethods` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `applePay` | `?bool` | Optional | Whether Apple Pay is accepted at checkout. | getApplePay(): ?bool | setApplePay(?bool applePay): void | -| `googlePay` | `?bool` | Optional | Whether Google Pay is accepted at checkout. | getGooglePay(): ?bool | setGooglePay(?bool googlePay): void | -| `cashAppPay` | `?bool` | Optional | Whether Cash App Pay is accepted at checkout. | getCashAppPay(): ?bool | setCashAppPay(?bool cashAppPay): void | -| `afterpayClearpay` | `?bool` | Optional | Whether Afterpay/Clearpay is accepted at checkout. | getAfterpayClearpay(): ?bool | setAfterpayClearpay(?bool afterpayClearpay): void | - -## Example (as JSON) - -```json -{ - "apple_pay": false, - "google_pay": false, - "cash_app_pay": false, - "afterpay_clearpay": false -} -``` - diff --git a/doc/models/accumulate-loyalty-points-request.md b/doc/models/accumulate-loyalty-points-request.md deleted file mode 100644 index 4dedf981..00000000 --- a/doc/models/accumulate-loyalty-points-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Accumulate Loyalty Points Request - -Represents an [AccumulateLoyaltyPoints](../../doc/apis/loyalty.md#accumulate-loyalty-points) request. - -## Structure - -`AccumulateLoyaltyPointsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `accumulatePoints` | [`LoyaltyEventAccumulatePoints`](../../doc/models/loyalty-event-accumulate-points.md) | Required | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | getAccumulatePoints(): LoyaltyEventAccumulatePoints | setAccumulatePoints(LoyaltyEventAccumulatePoints accumulatePoints): void | -| `idempotencyKey` | `string` | Required | A unique string that identifies the `AccumulateLoyaltyPoints` request.
Keys can be any valid string but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `locationId` | `string` | Required | The [location](entity:Location) where the purchase was made. | getLocationId(): string | setLocationId(string locationId): void | - -## Example (as JSON) - -```json -{ - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - "loyalty_program_id": "loyalty_program_id8", - "points": 118 - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" -} -``` - diff --git a/doc/models/accumulate-loyalty-points-response.md b/doc/models/accumulate-loyalty-points-response.md deleted file mode 100644 index e295228f..00000000 --- a/doc/models/accumulate-loyalty-points-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# Accumulate Loyalty Points Response - -Represents an [AccumulateLoyaltyPoints](../../doc/apis/loyalty.md#accumulate-loyalty-points) response. - -## Structure - -`AccumulateLoyaltyPointsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `event` | [`?LoyaltyEvent`](../../doc/models/loyalty-event.md) | Optional | Provides information about a loyalty event.
For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). | getEvent(): ?LoyaltyEvent | setEvent(?LoyaltyEvent event): void | -| `events` | [`?(LoyaltyEvent[])`](../../doc/models/loyalty-event.md) | Optional | The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event
is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included
if the purchase also qualifies for a loyalty promotion. | getEvents(): ?array | setEvents(?array events): void | - -## Example (as JSON) - -```json -{ - "events": [ - { - "accumulate_points": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - "points": 6 - }, - "created_at": "2020-05-08T21:41:12Z", - "id": "ee46aafd-1af6-3695-a385-276e2ef0be26", - "location_id": "P034NEENMD09F", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "source": "LOYALTY_API", - "type": "ACCUMULATE_POINTS", - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "event": { - "id": "id0", - "type": "ADJUST_POINTS", - "created_at": "created_at8", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - }, - "loyalty_account_id": "loyalty_account_id0", - "source": "SQUARE" - } -} -``` - diff --git a/doc/models/ach-details.md b/doc/models/ach-details.md deleted file mode 100644 index 01aead60..00000000 --- a/doc/models/ach-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# ACH Details - -ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. - -## Structure - -`ACHDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `routingNumber` | `?string` | Optional | The routing number for the bank account.
**Constraints**: *Maximum Length*: `50` | getRoutingNumber(): ?string | setRoutingNumber(?string routingNumber): void | -| `accountNumberSuffix` | `?string` | Optional | The last few digits of the bank account number.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` | getAccountNumberSuffix(): ?string | setAccountNumberSuffix(?string accountNumberSuffix): void | -| `accountType` | `?string` | Optional | The type of the bank account performing the transfer. The account type can be `CHECKING`,
`SAVINGS`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getAccountType(): ?string | setAccountType(?string accountType): void | - -## Example (as JSON) - -```json -{ - "routing_number": "routing_number6", - "account_number_suffix": "account_number_suffix6", - "account_type": "account_type8" -} -``` - diff --git a/doc/models/action-cancel-reason.md b/doc/models/action-cancel-reason.md deleted file mode 100644 index c3d54bfb..00000000 --- a/doc/models/action-cancel-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Action Cancel Reason - -## Enumeration - -`ActionCancelReason` - -## Fields - -| Name | Description | -| --- | --- | -| `BUYER_CANCELED` | A person canceled the `TerminalCheckout` from a Square device. | -| `SELLER_CANCELED` | A client canceled the `TerminalCheckout` using the API. | -| `TIMED_OUT` | The `TerminalCheckout` timed out (see `deadline_duration` on the `TerminalCheckout`). | - diff --git a/doc/models/activity-type.md b/doc/models/activity-type.md deleted file mode 100644 index 04577ccd..00000000 --- a/doc/models/activity-type.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Activity Type - -## Enumeration - -`ActivityType` - -## Fields - -| Name | Description | -| --- | --- | -| `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. | -| `APP_FEE_REFUND` | A refund for an application fee on a payment. | -| `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. | -| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales. | -| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds. | -| `CHARGE` | A credit card payment capture. | -| `DEPOSIT_FEE` | A fee assessed because of a deposit, such as an instant deposit. | -| `DEPOSIT_FEE_REVERSED` | Indicates that Square returned a fee that was previously assessed because of a deposit, such as an instant deposit, back to the seller's account. | -| `DISPUTE` | The balance change due to a dispute event. | -| `ESCHEATMENT` | An escheatment entry for remittance. | -| `FEE` | The cost plus adjustment fee. | -| `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller
referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).
This entry represents a credit to the seller for the purposes of free processing. | -| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. | -| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance (initial, in the sense that it causes the creation of the other activity types, such as a hold and refund). | -| `MONEY_TRANSFER` | The balance change from a money transfer. | -| `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. | -| `OPEN_DISPUTE` | The balance change for a chargeback that's been filed. | -| `OTHER` | Any other type that doesn't belong in the rest of the types. | -| `OTHER_ADJUSTMENT` | Any other type of adjustment that doesn't fall under existing types. | -| `PAID_SERVICE_FEE` | A fee paid to a third-party seller. | -| `PAID_SERVICE_FEE_REFUND` | A fee refunded to a third-party seller. | -| `REDEMPTION_CODE` | Repayment for a redemption code. | -| `REFUND` | A refund for an existing card payment. | -| `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. | -| `RESERVE_HOLD` | Fees paid for a funding risk reserve. | -| `RESERVE_RELEASE` | Fees released from a risk reserve. | -| `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the
settlement of the original entry failed. | -| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are generally proportional to the merchant's sales but can be issued for other reasons related to the MCA. | -| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are generally proportional to the merchant's refunds but can be issued for other reasons related to the MCA. | -| `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. | -| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that's been refunded. | -| `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. | -| `TAX_ON_FEE` | The tax paid on fee amounts. | -| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. | -| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. | -| `PAYOUT` | The balance change due to a money transfer. Note that this type is never returned by the Payouts API. | -| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates that the portion of each payment withheld by Square was automatically converted into bitcoin using Cash App. The seller manages their bitcoin in their Cash App account. | -| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance. | -| `CREDIT_CARD_REPAYMENT` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made. | -| `CREDIT_CARD_REPAYMENT_REVERSED` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed. | -| `LOCAL_OFFERS_CASHBACK` | Cashback amount given by a Square Local Offers seller to their customer for a purchase. | -| `LOCAL_OFFERS_FEE` | A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers. | -| `PERCENTAGE_PROCESSING_ENROLLMENT` | When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute. | -| `PERCENTAGE_PROCESSING_DEACTIVATION` | Deducting the outstanding Percentage Processing balance from the seller’s account. It's the final installment in repaying the dispute-induced negative balance through percentage processing. | -| `PERCENTAGE_PROCESSING_REPAYMENT` | Withheld funds from a payment to cover a negative balance. It's an installment to repay the amount from a dispute that had been offset during Percentage Processing enrollment. | -| `PERCENTAGE_PROCESSING_REPAYMENT_REVERSED` | The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment. | -| `PROCESSING_FEE` | The processing fee for a payment. If sellers opt for Gross Settlement, i.e., direct bank withdrawal instead of deducting fees from daily sales, the processing fee is recorded separately as a new payout entry, not part of the CHARGE payout entry. | -| `PROCESSING_FEE_REFUND` | The processing fee for a payment refund issued by sellers enrolled in Gross Settlement. The refunded processing fee is recorded separately as a new payout entry, not part of the REFUND payout entry. | -| `UNDO_PROCESSING_FEE_REFUND` | When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used. | -| `GIFT_CARD_LOAD_FEE` | Fee collected during the sale or reload of a gift card. This fee, which is a portion of the amount loaded on the gift card, is deducted from the merchant's payment balance. | -| `GIFT_CARD_LOAD_FEE_REFUND` | Refund for fee charged during the sale or reload of a gift card. | -| `UNDO_GIFT_CARD_LOAD_FEE_REFUND` | The undo of a refund for a fee charged during the sale or reload of a gift card. | -| `BALANCE_FOLDERS_TRANSFER` | A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | -| `BALANCE_FOLDERS_TRANSFER_REVERSED` | A reversal of transfer of funds from a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | -| `GIFT_CARD_POOL_TRANSFER` | A transfer of gift card funds to a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | -| `GIFT_CARD_POOL_TRANSFER_REVERSED` | A reversal of transfer of gift card funds from a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account. | -| `SQUARE_PAYROLL_TRANSFER` | A payroll payment that was transferred to a team member’s bank account. | -| `SQUARE_PAYROLL_TRANSFER_REVERSED` | A payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square. | - diff --git a/doc/models/add-group-to-customer-response.md b/doc/models/add-group-to-customer-response.md deleted file mode 100644 index 8c39769c..00000000 --- a/doc/models/add-group-to-customer-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Add Group to Customer Response - -Defines the fields that are included in the response body of -a request to the [AddGroupToCustomer](../../doc/apis/customers.md#add-group-to-customer) endpoint. - -## Structure - -`AddGroupToCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/additional-recipient.md b/doc/models/additional-recipient.md deleted file mode 100644 index 649b89c4..00000000 --- a/doc/models/additional-recipient.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Additional Recipient - -Represents an additional recipient (other than the merchant) receiving a portion of this tender. - -## Structure - -`AdditionalRecipient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of this tender.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getLocationId(): string | setLocationId(string locationId): void | -| `description` | `?string` | Optional | The description of the additional recipient.
**Constraints**: *Maximum Length*: `100` | getDescription(): ?string | setDescription(?string description): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `receivableId` | `?string` | Optional | The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.
**Constraints**: *Maximum Length*: `192` | getReceivableId(): ?string | setReceivableId(?string receivableId): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id2", - "description": "description2", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id8" -} -``` - diff --git a/doc/models/address.md b/doc/models/address.md deleted file mode 100644 index 84755fc0..00000000 --- a/doc/models/address.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Address - -Represents a postal address in a country. -For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - -## Structure - -`Address` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `addressLine1` | `?string` | Optional | The first line of the address.

Fields that start with `address_line` provide the address's most specific
details, like street number, street name, and building name. They do *not*
provide less specific details like city, state/province, or country (these
details are provided in other fields). | getAddressLine1(): ?string | setAddressLine1(?string addressLine1): void | -| `addressLine2` | `?string` | Optional | The second line of the address, if any. | getAddressLine2(): ?string | setAddressLine2(?string addressLine2): void | -| `addressLine3` | `?string` | Optional | The third line of the address, if any. | getAddressLine3(): ?string | setAddressLine3(?string addressLine3): void | -| `locality` | `?string` | Optional | The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getLocality(): ?string | setLocality(?string locality): void | -| `sublocality` | `?string` | Optional | A civil region within the address's `locality`, if any. | getSublocality(): ?string | setSublocality(?string sublocality): void | -| `sublocality2` | `?string` | Optional | A civil region within the address's `sublocality`, if any. | getSublocality2(): ?string | setSublocality2(?string sublocality2): void | -| `sublocality3` | `?string` | Optional | A civil region within the address's `sublocality_2`, if any. | getSublocality3(): ?string | setSublocality3(?string sublocality3): void | -| `administrativeDistrictLevel1` | `?string` | Optional | A civil entity within the address's country. In the US, this
is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAdministrativeDistrictLevel1(): ?string | setAdministrativeDistrictLevel1(?string administrativeDistrictLevel1): void | -| `administrativeDistrictLevel2` | `?string` | Optional | A civil entity within the address's `administrative_district_level_1`.
In the US, this is the county. | getAdministrativeDistrictLevel2(): ?string | setAdministrativeDistrictLevel2(?string administrativeDistrictLevel2): void | -| `administrativeDistrictLevel3` | `?string` | Optional | A civil entity within the address's `administrative_district_level_2`,
if any. | getAdministrativeDistrictLevel3(): ?string | setAdministrativeDistrictLevel3(?string administrativeDistrictLevel3): void | -| `postalCode` | `?string` | Optional | The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getPostalCode(): ?string | setPostalCode(?string postalCode): void | -| `country` | [`?string(Country)`](../../doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | getCountry(): ?string | setCountry(?string country): void | -| `firstName` | `?string` | Optional | Optional first name when it's representing recipient. | getFirstName(): ?string | setFirstName(?string firstName): void | -| `lastName` | `?string` | Optional | Optional last name when it's representing recipient. | getLastName(): ?string | setLastName(?string lastName): void | - -## Example (as JSON) - -```json -{ - "address_line_1": "address_line_18", - "address_line_2": "address_line_28", - "address_line_3": "address_line_34", - "locality": "locality8", - "sublocality": "sublocality8" -} -``` - diff --git a/doc/models/adjust-loyalty-points-request.md b/doc/models/adjust-loyalty-points-request.md deleted file mode 100644 index 16a48a69..00000000 --- a/doc/models/adjust-loyalty-points-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Adjust Loyalty Points Request - -Represents an [AdjustLoyaltyPoints](../../doc/apis/loyalty.md#adjust-loyalty-points) request. - -## Structure - -`AdjustLoyaltyPointsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `AdjustLoyaltyPoints` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `adjustPoints` | [`LoyaltyEventAdjustPoints`](../../doc/models/loyalty-event-adjust-points.md) | Required | Provides metadata when the event `type` is `ADJUST_POINTS`. | getAdjustPoints(): LoyaltyEventAdjustPoints | setAdjustPoints(LoyaltyEventAdjustPoints adjustPoints): void | -| `allowNegativeBalance` | `?bool` | Optional | Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a negative
balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when subtracting
the specified number of points would result in a negative balance. The default value is `false`. | getAllowNegativeBalance(): ?bool | setAllowNegativeBalance(?bool allowNegativeBalance): void | - -## Example (as JSON) - -```json -{ - "adjust_points": { - "points": 10, - "reason": "Complimentary points", - "loyalty_program_id": "loyalty_program_id2" - }, - "idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1", - "allow_negative_balance": false -} -``` - diff --git a/doc/models/adjust-loyalty-points-response.md b/doc/models/adjust-loyalty-points-response.md deleted file mode 100644 index cc2d1f89..00000000 --- a/doc/models/adjust-loyalty-points-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Adjust Loyalty Points Response - -Represents an [AdjustLoyaltyPoints](../../doc/apis/loyalty.md#adjust-loyalty-points) request. - -## Structure - -`AdjustLoyaltyPointsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `event` | [`?LoyaltyEvent`](../../doc/models/loyalty-event.md) | Optional | Provides information about a loyalty event.
For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). | getEvent(): ?LoyaltyEvent | setEvent(?LoyaltyEvent event): void | - -## Example (as JSON) - -```json -{ - "event": { - "adjust_points": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "points": 10, - "reason": "Complimentary points" - }, - "created_at": "2020-05-08T21:42:32Z", - "id": "613a6fca-8d67-39d0-bad2-3b4bc45c8637", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "source": "LOYALTY_API", - "type": "ADJUST_POINTS", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/afterpay-details.md b/doc/models/afterpay-details.md deleted file mode 100644 index eaa680de..00000000 --- a/doc/models/afterpay-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Afterpay Details - -Additional details about Afterpay payments. - -## Structure - -`AfterpayDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `emailAddress` | `?string` | Optional | Email address on the buyer's Afterpay account.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | - -## Example (as JSON) - -```json -{ - "email_address": "email_address2" -} -``` - diff --git a/doc/models/application-details-external-square-product.md b/doc/models/application-details-external-square-product.md deleted file mode 100644 index 9fa8cdc3..00000000 --- a/doc/models/application-details-external-square-product.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Application Details External Square Product - -A list of products to return to external callers. - -## Enumeration - -`ApplicationDetailsExternalSquareProduct` - -## Fields - -| Name | -| --- | -| `APPOINTMENTS` | -| `ECOMMERCE_API` | -| `INVOICES` | -| `ONLINE_STORE` | -| `OTHER` | -| `RESTAURANTS` | -| `RETAIL` | -| `SQUARE_POS` | -| `TERMINAL_API` | -| `VIRTUAL_TERMINAL` | - diff --git a/doc/models/application-details.md b/doc/models/application-details.md deleted file mode 100644 index 440ebc66..00000000 --- a/doc/models/application-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Application Details - -Details about the application that took the payment. - -## Structure - -`ApplicationDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `squareProduct` | [`?string(ApplicationDetailsExternalSquareProduct)`](../../doc/models/application-details-external-square-product.md) | Optional | A list of products to return to external callers. | getSquareProduct(): ?string | setSquareProduct(?string squareProduct): void | -| `applicationId` | `?string` | Optional | The Square ID assigned to the application used to take the payment.
Application developers can use this information to identify payments that
their application processed.
For example, if a developer uses a custom application to process payments,
this field contains the application ID from the Developer Dashboard.
If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace)
application to process payments, the field contains the corresponding application ID. | getApplicationId(): ?string | setApplicationId(?string applicationId): void | - -## Example (as JSON) - -```json -{ - "square_product": "APPOINTMENTS", - "application_id": "application_id2" -} -``` - diff --git a/doc/models/application-type.md b/doc/models/application-type.md deleted file mode 100644 index ab57c1f9..00000000 --- a/doc/models/application-type.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Application Type - -## Enumeration - -`ApplicationType` - -## Fields - -| Name | -| --- | -| `TERMINAL_API` | - diff --git a/doc/models/appointment-segment.md b/doc/models/appointment-segment.md deleted file mode 100644 index 725a179b..00000000 --- a/doc/models/appointment-segment.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Appointment Segment - -Defines an appointment segment of a booking. - -## Structure - -`AppointmentSegment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `durationMinutes` | `?int` | Optional | The time span in minutes of an appointment segment.
**Constraints**: `<= 1500` | getDurationMinutes(): ?int | setDurationMinutes(?int durationMinutes): void | -| `serviceVariationId` | `?string` | Optional | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Maximum Length*: `36` | getServiceVariationId(): ?string | setServiceVariationId(?string serviceVariationId): void | -| `teamMemberId` | `string` | Required | The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this segment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32` | getTeamMemberId(): string | setTeamMemberId(string teamMemberId): void | -| `serviceVariationVersion` | `?int` | Optional | The current version of the item variation representing the service booked in this segment. | getServiceVariationVersion(): ?int | setServiceVariationVersion(?int serviceVariationVersion): void | -| `intermissionMinutes` | `?int` | Optional | Time between the end of this segment and the beginning of the subsequent segment. | getIntermissionMinutes(): ?int | setIntermissionMinutes(?int intermissionMinutes): void | -| `anyTeamMember` | `?bool` | Optional | Whether the customer accepts any team member, instead of a specific one, to serve this segment. | getAnyTeamMember(): ?bool | setAnyTeamMember(?bool anyTeamMember): void | -| `resourceIds` | `?(string[])` | Optional | The IDs of the seller-accessible resources used for this appointment segment. | getResourceIds(): ?array | setResourceIds(?array resourceIds): void | - -## Example (as JSON) - -```json -{ - "duration_minutes": 36, - "service_variation_id": "service_variation_id4", - "team_member_id": "team_member_id0", - "service_variation_version": 204, - "intermission_minutes": 210, - "any_team_member": false -} -``` - diff --git a/doc/models/archived-state.md b/doc/models/archived-state.md deleted file mode 100644 index 35286ea0..00000000 --- a/doc/models/archived-state.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Archived State - -Defines the values for the `archived_state` query expression -used in [SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items) -to return the archived, not archived or either type of catalog items. - -## Enumeration - -`ArchivedState` - -## Fields - -| Name | Description | -| --- | --- | -| `ARCHIVED_STATE_NOT_ARCHIVED` | Requested items are not archived with the `is_archived` attribute set to `false`. | -| `ARCHIVED_STATE_ARCHIVED` | Requested items are archived with the `is_archived` attribute set to `true`. | -| `ARCHIVED_STATE_ALL` | Requested items can be archived or not archived. | - diff --git a/doc/models/availability.md b/doc/models/availability.md deleted file mode 100644 index f3b6ac53..00000000 --- a/doc/models/availability.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Availability - -Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. - -## Structure - -`Availability` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startAt` | `?string` | Optional | The RFC 3339 timestamp specifying the beginning time of the slot available for booking. | getStartAt(): ?string | setStartAt(?string startAt): void | -| `locationId` | `?string` | Optional | The ID of the location available for booking.
**Constraints**: *Maximum Length*: `32` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `appointmentSegments` | [`?(AppointmentSegment[])`](../../doc/models/appointment-segment.md) | Optional | The list of appointment segments available for booking | getAppointmentSegments(): ?array | setAppointmentSegments(?array appointmentSegments): void | - -## Example (as JSON) - -```json -{ - "start_at": "start_at6", - "location_id": "location_id8", - "appointment_segments": [ - { - "duration_minutes": 136, - "service_variation_id": "service_variation_id4", - "team_member_id": "team_member_id0", - "service_variation_version": 48, - "intermission_minutes": 54, - "any_team_member": false - } - ] -} -``` - diff --git a/doc/models/bank-account-payment-details.md b/doc/models/bank-account-payment-details.md deleted file mode 100644 index 549064b1..00000000 --- a/doc/models/bank-account-payment-details.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Bank Account Payment Details - -Additional details about BANK_ACCOUNT type payments. - -## Structure - -`BankAccountPaymentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bankName` | `?string` | Optional | The name of the bank associated with the bank account.
**Constraints**: *Maximum Length*: `100` | getBankName(): ?string | setBankName(?string bankName): void | -| `transferType` | `?string` | Optional | The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getTransferType(): ?string | setTransferType(?string transferType): void | -| `accountOwnershipType` | `?string` | Optional | The ownership type of the bank account performing the transfer.
The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getAccountOwnershipType(): ?string | setAccountOwnershipType(?string accountOwnershipType): void | -| `fingerprint` | `?string` | Optional | Uniquely identifies the bank account for this seller and can be used
to determine if payments are from the same bank account.
**Constraints**: *Maximum Length*: `255` | getFingerprint(): ?string | setFingerprint(?string fingerprint): void | -| `country` | `?string` | Optional | The two-letter ISO code representing the country the bank account is located in.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | getCountry(): ?string | setCountry(?string country): void | -| `statementDescription` | `?string` | Optional | The statement description as sent to the bank.
**Constraints**: *Maximum Length*: `1000` | getStatementDescription(): ?string | setStatementDescription(?string statementDescription): void | -| `achDetails` | [`?ACHDetails`](../../doc/models/ach-details.md) | Optional | ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. | getAchDetails(): ?ACHDetails | setAchDetails(?ACHDetails achDetails): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "bank_name": "bank_name4", - "transfer_type": "transfer_type8", - "account_ownership_type": "account_ownership_type8", - "fingerprint": "fingerprint6", - "country": "country4" -} -``` - diff --git a/doc/models/bank-account-status.md b/doc/models/bank-account-status.md deleted file mode 100644 index 7986f080..00000000 --- a/doc/models/bank-account-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Bank Account Status - -Indicates the current verification status of a `BankAccount` object. - -## Enumeration - -`BankAccountStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `VERIFICATION_IN_PROGRESS` | Indicates that the verification process has started. Some features
(for example, creditable or debitable) may be provisionally enabled on the bank
account. | -| `VERIFIED` | Indicates that the bank account was successfully verified. | -| `DISABLED` | Indicates that the bank account is disabled and is permanently unusable
for funds transfer. A bank account can be disabled because of a failed verification
attempt or a failed deposit attempt. | - diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md deleted file mode 100644 index 809c07a9..00000000 --- a/doc/models/bank-account-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Bank Account Type - -Indicates the financial purpose of the bank account. - -## Enumeration - -`BankAccountType` - -## Fields - -| Name | Description | -| --- | --- | -| `CHECKING` | An account at a financial institution against which checks can be
drawn by the account depositor. | -| `SAVINGS` | An account at a financial institution that pays interest but cannot be
used directly as money in the narrow sense of a medium of exchange. | -| `INVESTMENT` | An account at a financial institution that contains a deposit of funds
and/or securities. | -| `OTHER` | An account at a financial institution which cannot be described by the
other types. | -| `BUSINESS_CHECKING` | An account at a financial institution against which checks can be
drawn specifically for business purposes (non-personal use). | - diff --git a/doc/models/bank-account.md b/doc/models/bank-account.md deleted file mode 100644 index e6a85562..00000000 --- a/doc/models/bank-account.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Bank Account - -Represents a bank account. For more information about -linking a bank account to a Square account, see -[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - -## Structure - -`BankAccount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The unique, Square-issued identifier for the bank account.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | getId(): string | setId(string id): void | -| `accountNumberSuffix` | `string` | Required | The last few digits of the account number.
**Constraints**: *Minimum Length*: `1` | getAccountNumberSuffix(): string | setAccountNumberSuffix(string accountNumberSuffix): void | -| `country` | [`string(Country)`](../../doc/models/country.md) | Required | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | getCountry(): string | setCountry(string country): void | -| `currency` | [`string(Currency)`](../../doc/models/currency.md) | Required | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | getCurrency(): string | setCurrency(string currency): void | -| `accountType` | [`string(BankAccountType)`](../../doc/models/bank-account-type.md) | Required | Indicates the financial purpose of the bank account. | getAccountType(): string | setAccountType(string accountType): void | -| `holderName` | `string` | Required | Name of the account holder. This name must match the name
on the targeted bank account record.
**Constraints**: *Minimum Length*: `1` | getHolderName(): string | setHolderName(string holderName): void | -| `primaryBankIdentificationNumber` | `string` | Required | Primary identifier for the bank. For more information, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).
**Constraints**: *Maximum Length*: `40` | getPrimaryBankIdentificationNumber(): string | setPrimaryBankIdentificationNumber(string primaryBankIdentificationNumber): void | -| `secondaryBankIdentificationNumber` | `?string` | Optional | Secondary identifier for the bank. For more information, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).
**Constraints**: *Maximum Length*: `40` | getSecondaryBankIdentificationNumber(): ?string | setSecondaryBankIdentificationNumber(?string secondaryBankIdentificationNumber): void | -| `debitMandateReferenceId` | `?string` | Optional | Reference identifier that will be displayed to UK bank account owners
when collecting direct debit authorization. Only required for UK bank accounts. | getDebitMandateReferenceId(): ?string | setDebitMandateReferenceId(?string debitMandateReferenceId): void | -| `referenceId` | `?string` | Optional | Client-provided identifier for linking the banking account to an entity
in a third-party system (for example, a bank account number or a user identifier). | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `locationId` | `?string` | Optional | The location to which the bank account belongs. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | [`string(BankAccountStatus)`](../../doc/models/bank-account-status.md) | Required | Indicates the current verification status of a `BankAccount` object. | getStatus(): string | setStatus(string status): void | -| `creditable` | `bool` | Required | Indicates whether it is possible for Square to send money to this bank account. | getCreditable(): bool | setCreditable(bool creditable): void | -| `debitable` | `bool` | Required | Indicates whether it is possible for Square to take money from this
bank account. | getDebitable(): bool | setDebitable(bool debitable): void | -| `fingerprint` | `?string` | Optional | A Square-assigned, unique identifier for the bank account based on the
account information. The account fingerprint can be used to compare account
entries and determine if the they represent the same real-world bank account. | getFingerprint(): ?string | setFingerprint(?string fingerprint): void | -| `version` | `?int` | Optional | The current version of the `BankAccount`. | getVersion(): ?int | setVersion(?int version): void | -| `bankName` | `?string` | Optional | Read only. Name of actual financial institution.
For example "Bank of America".
**Constraints**: *Maximum Length*: `100` | getBankName(): ?string | setBankName(?string bankName): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "account_number_suffix": "account_number_suffix6", - "country": "TT", - "currency": "MVR", - "account_type": "OTHER", - "holder_name": "holder_name8", - "primary_bank_identification_number": "primary_bank_identification_number0", - "secondary_bank_identification_number": "secondary_bank_identification_number2", - "debit_mandate_reference_id": "debit_mandate_reference_id2", - "reference_id": "reference_id0", - "location_id": "location_id6", - "status": "VERIFICATION_IN_PROGRESS", - "creditable": false, - "debitable": false, - "fingerprint": "fingerprint8" -} -``` - diff --git a/doc/models/batch-change-inventory-request.md b/doc/models/batch-change-inventory-request.md deleted file mode 100644 index f8c24683..00000000 --- a/doc/models/batch-change-inventory-request.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Batch Change Inventory Request - -## Structure - -`BatchChangeInventoryRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A client-supplied, universally unique identifier (UUID) for the
request.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more
information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `changes` | [`?(InventoryChange[])`](../../doc/models/inventory-change.md) | Optional | The set of physical counts and inventory adjustments to be made.
Changes are applied based on the client-supplied timestamp and may be sent
out of order. | getChanges(): ?array | setChanges(?array changes): void | -| `ignoreUnchangedCounts` | `?bool` | Optional | Indicates whether the current physical count should be ignored if
the quantity is unchanged since the last physical count. Default: `true`. | getIgnoreUnchangedCounts(): ?bool | setIgnoreUnchangedCounts(?bool ignoreUnchangedCounts): void | - -## Example (as JSON) - -```json -{ - "changes": [ - { - "physical_count": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "location_id": "C6W5YS5QM06F5", - "occurred_at": "2016-11-16T22:25:24.878Z", - "quantity": "53", - "reference_id": "1536bfbf-efed-48bf-b17d-a197141b2a92", - "state": "IN_STOCK", - "team_member_id": "LRK57NSQ5X7PUD05", - "id": "id2", - "catalog_object_type": "catalog_object_type6" - }, - "type": "PHYSICAL_COUNT", - "adjustment": { - "id": "id4", - "reference_id": "reference_id2", - "from_state": "IN_TRANSIT_TO", - "to_state": "SOLD", - "location_id": "location_id8" - }, - "transfer": { - "id": "id8", - "reference_id": "reference_id6", - "state": "RESERVED_FOR_SALE", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" - }, - "measurement_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 184 - } - } - ], - "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - "ignore_unchanged_counts": true -} -``` - diff --git a/doc/models/batch-change-inventory-response.md b/doc/models/batch-change-inventory-response.md deleted file mode 100644 index 620523f4..00000000 --- a/doc/models/batch-change-inventory-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Batch Change Inventory Response - -## Structure - -`BatchChangeInventoryResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `counts` | [`?(InventoryCount[])`](../../doc/models/inventory-count.md) | Optional | The current counts for all objects referenced in the request. | getCounts(): ?array | setCounts(?array counts): void | -| `changes` | [`?(InventoryChange[])`](../../doc/models/inventory-change.md) | Optional | Changes created for the request. | getChanges(): ?array | setChanges(?array changes): void | - -## Example (as JSON) - -```json -{ - "counts": [ - { - "calculated_at": "2016-11-16T22:28:01.223Z", - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "location_id": "C6W5YS5QM06F5", - "quantity": "53", - "state": "IN_STOCK" - } - ], - "errors": [], - "changes": [ - { - "type": "TRANSFER", - "physical_count": { - "id": "id2", - "reference_id": "reference_id0", - "catalog_object_id": "catalog_object_id6", - "catalog_object_type": "catalog_object_type6", - "state": "SUPPORTED_BY_NEWER_VERSION" - }, - "adjustment": { - "id": "id4", - "reference_id": "reference_id2", - "from_state": "IN_TRANSIT_TO", - "to_state": "SOLD", - "location_id": "location_id8" - }, - "transfer": { - "id": "id8", - "reference_id": "reference_id6", - "state": "RESERVED_FOR_SALE", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" - }, - "measurement_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 184 - } - } - ] -} -``` - diff --git a/doc/models/batch-delete-catalog-objects-request.md b/doc/models/batch-delete-catalog-objects-request.md deleted file mode 100644 index f2643163..00000000 --- a/doc/models/batch-delete-catalog-objects-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Batch Delete Catalog Objects Request - -## Structure - -`BatchDeleteCatalogObjectsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `objectIds` | `?(string[])` | Optional | The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects
in the graph that depend on that object will be deleted as well (for example, deleting a
CatalogItem will delete its CatalogItemVariation. | getObjectIds(): ?array | setObjectIds(?array objectIds): void | - -## Example (as JSON) - -```json -{ - "object_ids": [ - "W62UWFY35CWMYGVWK6TWJDNI", - "AA27W3M2GGTF3H6AVPNB77CK" - ] -} -``` - diff --git a/doc/models/batch-delete-catalog-objects-response.md b/doc/models/batch-delete-catalog-objects-response.md deleted file mode 100644 index 9540b34a..00000000 --- a/doc/models/batch-delete-catalog-objects-response.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Batch Delete Catalog Objects Response - -## Structure - -`BatchDeleteCatalogObjectsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `deletedObjectIds` | `?(string[])` | Optional | The IDs of all CatalogObjects deleted by this request. | getDeletedObjectIds(): ?array | setDeletedObjectIds(?array deletedObjectIds): void | -| `deletedAt` | `?string` | Optional | The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getDeletedAt(): ?string | setDeletedAt(?string deletedAt): void | - -## Example (as JSON) - -```json -{ - "deleted_at": "2016-11-16T22:25:24.878Z", - "deleted_object_ids": [ - "W62UWFY35CWMYGVWK6TWJDNI", - "AA27W3M2GGTF3H6AVPNB77CK" - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/batch-retrieve-catalog-objects-request.md b/doc/models/batch-retrieve-catalog-objects-request.md deleted file mode 100644 index 00cbc72f..00000000 --- a/doc/models/batch-retrieve-catalog-objects-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Batch Retrieve Catalog Objects Request - -## Structure - -`BatchRetrieveCatalogObjectsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `objectIds` | `string[]` | Required | The IDs of the CatalogObjects to be retrieved. | getObjectIds(): array | setObjectIds(array objectIds): void | -| `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | -| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will
be from the current version of the catalog. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `includeDeletedObjects` | `?bool` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. | getIncludeDeletedObjects(): ?bool | setIncludeDeletedObjects(?bool includeDeletedObjects): void | -| `includeCategoryPathToRoot` | `?bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | getIncludeCategoryPathToRoot(): ?bool | setIncludeCategoryPathToRoot(?bool includeCategoryPathToRoot): void | - -## Example (as JSON) - -```json -{ - "include_related_objects": true, - "object_ids": [ - "W62UWFY35CWMYGVWK6TWJDNI", - "AA27W3M2GGTF3H6AVPNB77CK" - ], - "catalog_version": 190, - "include_deleted_objects": false, - "include_category_path_to_root": false -} -``` - diff --git a/doc/models/batch-retrieve-catalog-objects-response.md b/doc/models/batch-retrieve-catalog-objects-response.md deleted file mode 100644 index dda55773..00000000 --- a/doc/models/batch-retrieve-catalog-objects-response.md +++ /dev/null @@ -1,276 +0,0 @@ - -# Batch Retrieve Catalog Objects Response - -## Structure - -`BatchRetrieveCatalogObjectsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `objects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogObject](entity:CatalogObject)s returned. | getObjects(): ?array | setObjects(?array objects): void | -| `relatedObjects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. | getRelatedObjects(): ?array | setRelatedObjects(?array relatedObjects): void | - -## Example (as JSON) - -```json -{ - "objects": [ - { - "id": "W62UWFY35CWMYGVWK6TWJDNI", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "BJNQCF2FJ6S6UIDT65ABHLRX", - "ordinal": 0 - } - ], - "description": "Hot Leaf Juice", - "name": "Tea", - "tax_ids": [ - "HURXQOOAIC4IZSI2BEXQRYFY" - ], - "variations": [ - { - "id": "2TZFAOHWGG7PAK2QEXWYPZSP", - "is_deleted": false, - "item_variation_data": { - "item_id": "W62UWFY35CWMYGVWK6TWJDNI", - "name": "Mug", - "ordinal": 0, - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "AA27W3M2GGTF3H6AVPNB77CK", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "BJNQCF2FJ6S6UIDT65ABHLRX", - "ordinal": 0 - } - ], - "description": "Hot Bean Juice", - "name": "Coffee", - "tax_ids": [ - "HURXQOOAIC4IZSI2BEXQRYFY" - ], - "variations": [ - { - "id": "LBTYIHNHU52WOIHWT7SNRIYH", - "is_deleted": false, - "item_variation_data": { - "item_id": "AA27W3M2GGTF3H6AVPNB77CK", - "name": "Regular", - "ordinal": 0, - "price_money": { - "amount": 250, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878 - }, - { - "id": "PKYIC7HGGKW5CYVSCVDEIMHY", - "is_deleted": false, - "item_variation_data": { - "item_id": "AA27W3M2GGTF3H6AVPNB77CK", - "name": "Large", - "ordinal": 1, - "price_money": { - "amount": 350, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "related_objects": [ - { - "category_data": { - "name": "Beverages" - }, - "id": "BJNQCF2FJ6S6UIDT65ABHLRX", - "is_deleted": false, - "present_at_all_locations": true, - "type": "CATEGORY", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "HURXQOOAIC4IZSI2BEXQRYFY", - "is_deleted": false, - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/batch-retrieve-inventory-changes-request.md b/doc/models/batch-retrieve-inventory-changes-request.md deleted file mode 100644 index d4afab84..00000000 --- a/doc/models/batch-retrieve-inventory-changes-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Batch Retrieve Inventory Changes Request - -## Structure - -`BatchRetrieveInventoryChangesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `catalogObjectIds` | `?(string[])` | Optional | The filter to return results by `CatalogObject` ID.
The filter is only applicable when set. The default value is null. | getCatalogObjectIds(): ?array | setCatalogObjectIds(?array catalogObjectIds): void | -| `locationIds` | `?(string[])` | Optional | The filter to return results by `Location` ID.
The filter is only applicable when set. The default value is null. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `types` | [`?(string(InventoryChangeType)[])`](../../doc/models/inventory-change-type.md) | Optional | The filter to return results by `InventoryChangeType` values other than `TRANSFER`.
The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. | getTypes(): ?array | setTypes(?array types): void | -| `states` | [`?(string(InventoryState)[])`](../../doc/models/inventory-state.md) | Optional | The filter to return `ADJUSTMENT` query results by
`InventoryState`. This filter is only applied when set.
The default value is null. | getStates(): ?array | setStates(?array states): void | -| `updatedAfter` | `?string` | Optional | The filter to return results with their `calculated_at` value
after the given time as specified in an RFC 3339 timestamp.
The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedAfter(): ?string | setUpdatedAfter(?string updatedAfter): void | -| `updatedBefore` | `?string` | Optional | The filter to return results with their `created_at` or `calculated_at` value
strictly before the given time as specified in an RFC 3339 timestamp.
The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedBefore(): ?string | setUpdatedBefore(?string updatedBefore): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The number of [records](entity:InventoryChange) to return.
**Constraints**: `>= 1`, `<= 1000` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "catalog_object_ids": [ - "W62UWFY35CWMYGVWK6TWJDNI" - ], - "location_ids": [ - "C6W5YS5QM06F5" - ], - "states": [ - "IN_STOCK" - ], - "types": [ - "PHYSICAL_COUNT" - ], - "updated_after": "2016-11-01T00:00:00.000Z", - "updated_before": "2016-12-01T00:00:00.000Z" -} -``` - diff --git a/doc/models/batch-retrieve-inventory-changes-response.md b/doc/models/batch-retrieve-inventory-changes-response.md deleted file mode 100644 index b30671cb..00000000 --- a/doc/models/batch-retrieve-inventory-changes-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# Batch Retrieve Inventory Changes Response - -## Structure - -`BatchRetrieveInventoryChangesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `changes` | [`?(InventoryChange[])`](../../doc/models/inventory-change.md) | Optional | The current calculated inventory changes for the requested objects
and locations. | getChanges(): ?array | setChanges(?array changes): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "changes": [ - { - "physical_count": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "created_at": "2016-11-16T22:25:24.878Z", - "id": "46YDTW253DWGGK9HMAE6XCAO", - "location_id": "C6W5YS5QM06F5", - "occurred_at": "2016-11-16T22:24:49.028Z", - "quantity": "86", - "reference_id": "22c07cf4-5626-4224-89f9-691112019399", - "source": { - "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - "name": "Square Point of Sale 4.37", - "product": "SQUARE_POS" - }, - "state": "IN_STOCK", - "team_member_id": "LRK57NSQ5X7PUD05" - }, - "type": "PHYSICAL_COUNT", - "adjustment": { - "id": "id4", - "reference_id": "reference_id2", - "from_state": "IN_TRANSIT_TO", - "to_state": "SOLD", - "location_id": "location_id8" - }, - "transfer": { - "id": "id8", - "reference_id": "reference_id6", - "state": "RESERVED_FOR_SALE", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" - }, - "measurement_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 184 - } - } - ], - "errors": [], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/batch-retrieve-inventory-counts-request.md b/doc/models/batch-retrieve-inventory-counts-request.md deleted file mode 100644 index a780e6e6..00000000 --- a/doc/models/batch-retrieve-inventory-counts-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Batch Retrieve Inventory Counts Request - -## Structure - -`BatchRetrieveInventoryCountsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `catalogObjectIds` | `?(string[])` | Optional | The filter to return results by `CatalogObject` ID.
The filter is applicable only when set. The default is null. | getCatalogObjectIds(): ?array | setCatalogObjectIds(?array catalogObjectIds): void | -| `locationIds` | `?(string[])` | Optional | The filter to return results by `Location` ID.
This filter is applicable only when set. The default is null. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `updatedAfter` | `?string` | Optional | The filter to return results with their `calculated_at` value
after the given time as specified in an RFC 3339 timestamp.
The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). | getUpdatedAfter(): ?string | setUpdatedAfter(?string updatedAfter): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `states` | [`?(string(InventoryState)[])`](../../doc/models/inventory-state.md) | Optional | The filter to return results by `InventoryState`. The filter is only applicable when set.
Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`.
The default is null. | getStates(): ?array | setStates(?array states): void | -| `limit` | `?int` | Optional | The number of [records](entity:InventoryCount) to return.
**Constraints**: `>= 1`, `<= 1000` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "catalog_object_ids": [ - "W62UWFY35CWMYGVWK6TWJDNI" - ], - "location_ids": [ - "59TNP9SA8VGDA" - ], - "updated_after": "2016-11-16T00:00:00.000Z", - "cursor": "cursor2", - "states": [ - "RESERVED_FOR_SALE", - "RETURNED_BY_CUSTOMER" - ] -} -``` - diff --git a/doc/models/batch-retrieve-inventory-counts-response.md b/doc/models/batch-retrieve-inventory-counts-response.md deleted file mode 100644 index 1797e503..00000000 --- a/doc/models/batch-retrieve-inventory-counts-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Batch Retrieve Inventory Counts Response - -## Structure - -`BatchRetrieveInventoryCountsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `counts` | [`?(InventoryCount[])`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested objects
and locations. | getCounts(): ?array | setCounts(?array counts): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "counts": [ - { - "calculated_at": "2016-11-16T22:28:01.223Z", - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "location_id": "59TNP9SA8VGDA", - "quantity": "79", - "state": "IN_STOCK" - } - ], - "errors": [], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/batch-retrieve-orders-request.md b/doc/models/batch-retrieve-orders-request.md deleted file mode 100644 index 6afcf2c1..00000000 --- a/doc/models/batch-retrieve-orders-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Batch Retrieve Orders Request - -Defines the fields that are included in requests to the -`BatchRetrieveOrders` endpoint. - -## Structure - -`BatchRetrieveOrdersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the location for these orders. This field is optional: omit it to retrieve
orders within the scope of the current authorization's merchant ID. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `orderIds` | `string[]` | Required | The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. | getOrderIds(): array | setOrderIds(array orderIds): void | - -## Example (as JSON) - -```json -{ - "location_id": "057P5VYJ4A5X1", - "order_ids": [ - "CAISEM82RcpmcFBM0TfOyiHV3es", - "CAISENgvlJ6jLWAzERDzjyHVybY" - ] -} -``` - diff --git a/doc/models/batch-retrieve-orders-response.md b/doc/models/batch-retrieve-orders-response.md deleted file mode 100644 index bb674a5e..00000000 --- a/doc/models/batch-retrieve-orders-response.md +++ /dev/null @@ -1,121 +0,0 @@ - -# Batch Retrieve Orders Response - -Defines the fields that are included in the response body of -a request to the `BatchRetrieveOrders` endpoint. - -## Structure - -`BatchRetrieveOrdersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orders` | [`?(Order[])`](../../doc/models/order.md) | Optional | The requested orders. This will omit any requested orders that do not exist. | getOrders(): ?array | setOrders(?array orders): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "orders": [ - { - "id": "CAISEM82RcpmcFBM0TfOyiHV3es", - "line_items": [ - { - "base_price_money": { - "amount": 1599, - "currency": "USD" - }, - "name": "Awesome product", - "quantity": "1", - "total_money": { - "amount": 1599, - "currency": "USD" - }, - "uid": "945986d1-9586-11e6-ad5a-28cfe92138cf", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "Another awesome product", - "quantity": "3", - "total_money": { - "amount": 6000, - "currency": "USD" - }, - "uid": "a8f4168c-9586-11e6-bdf0-28cfe92138cf", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "057P5VYJ4A5X1", - "reference_id": "my-order-001", - "total_money": { - "amount": 7599, - "currency": "USD" - }, - "source": { - "name": "name4" - }, - "customer_id": "customer_id0" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/batch-upsert-catalog-objects-request.md b/doc/models/batch-upsert-catalog-objects-request.md deleted file mode 100644 index 566d1860..00000000 --- a/doc/models/batch-upsert-catalog-objects-request.md +++ /dev/null @@ -1,261 +0,0 @@ - -# Batch Upsert Catalog Objects Request - -## Structure - -`BatchUpsertCatalogObjectsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
request among all your requests. A common way to create
a valid idempotency key is to use a Universally unique
identifier (UUID).

If you're unsure whether a particular request was successful,
you can reattempt it with the same idempotency key without
worrying about creating duplicate objects.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `batches` | [`CatalogObjectBatch[]`](../../doc/models/catalog-object-batch.md) | Required | A batch of CatalogObjects to be inserted/updated atomically.
The objects within a batch will be inserted in an all-or-nothing fashion, i.e., if an error occurs
attempting to insert or update an object within a batch, the entire batch will be rejected. However, an error
in one batch will not affect other batches within the same request.

For each object, its `updated_at` field is ignored and replaced with a current [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), and its
`is_deleted` field must not be set to `true`.

To modify an existing object, supply its ID. To create a new object, use an ID starting
with `#`. These IDs may be used to create relationships between an object and attributes of
other objects that reference it. For example, you can create a CatalogItem with
ID `#ABC` and a CatalogItemVariation with its `item_id` attribute set to
`#ABC` in order to associate the CatalogItemVariation with its parent
CatalogItem.

Any `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server-generated IDs.

Each batch may contain up to 1,000 objects. The total number of objects across all batches for a single request
may not exceed 10,000. If either of these limits is violated, an error will be returned and no objects will
be inserted or updated. | getBatches(): array | setBatches(array batches): void | - -## Example (as JSON) - -```json -{ - "batches": [ - { - "objects": [ - { - "id": "#Tea", - "item_data": { - "categories": [ - { - "id": "#Beverages" - } - ], - "description_html": "

Hot Leaf Juice

", - "name": "Tea", - "tax_ids": [ - "#SalesTax" - ], - "variations": [ - { - "id": "#Tea_Mug", - "item_variation_data": { - "item_id": "#Tea", - "name": "Mug", - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION" - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "updated_at2", - "version": 164, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "#Coffee", - "item_data": { - "categories": [ - { - "id": "#Beverages" - } - ], - "description_html": "

Hot Bean Juice

", - "name": "Coffee", - "tax_ids": [ - "#SalesTax" - ], - "variations": [ - { - "id": "#Coffee_Regular", - "item_variation_data": { - "item_id": "#Coffee", - "name": "Regular", - "price_money": { - "amount": 250, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION" - }, - { - "id": "#Coffee_Large", - "item_variation_data": { - "item_id": "#Coffee", - "name": "Large", - "price_money": { - "amount": 350, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION" - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "updated_at2", - "version": 164, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "category_data": { - "name": "Beverages" - }, - "id": "#Beverages", - "present_at_all_locations": true, - "type": "CATEGORY", - "updated_at": "updated_at2", - "version": 164, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "#SalesTax", - "present_at_all_locations": true, - "tax_data": { - "applies_to_custom_amounts": true, - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX", - "updated_at": "updated_at2", - "version": 164, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ] - } - ], - "idempotency_key": "789ff020-f723-43a9-b4b5-43b5dc1fa3dc" -} -``` - diff --git a/doc/models/batch-upsert-catalog-objects-response.md b/doc/models/batch-upsert-catalog-objects-response.md deleted file mode 100644 index 37261ae0..00000000 --- a/doc/models/batch-upsert-catalog-objects-response.md +++ /dev/null @@ -1,340 +0,0 @@ - -# Batch Upsert Catalog Objects Response - -## Structure - -`BatchUpsertCatalogObjectsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `objects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The created successfully created CatalogObjects. | getObjects(): ?array | setObjects(?array objects): void | -| `updatedAt` | `?string` | Optional | The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `idMappings` | [`?(CatalogIdMapping[])`](../../doc/models/catalog-id-mapping.md) | Optional | The mapping between client and server IDs for this upsert. | getIdMappings(): ?array | setIdMappings(?array idMappings): void | - -## Example (as JSON) - -```json -{ - "id_mappings": [ - { - "client_object_id": "#Tea", - "object_id": "67GA7XA2FWMRYY2VCONTYZJR" - }, - { - "client_object_id": "#Coffee", - "object_id": "MQ4TZKOG3SR2EQI3TWEK4AH7" - }, - { - "client_object_id": "#Beverages", - "object_id": "XCS4SCGN4WQYE2VU4U3TKXEH" - }, - { - "client_object_id": "#SalesTax", - "object_id": "HP5VNYPKZKTNCKZ2Z5NPUH6A" - }, - { - "client_object_id": "#Tea_Mug", - "object_id": "CAJBHUIQH7ONTSZI2KTVOUP6" - }, - { - "client_object_id": "#Coffee_Regular", - "object_id": "GY2GXJTVVPQAPW43GFRR3NG6" - }, - { - "client_object_id": "#Coffee_Large", - "object_id": "JE6VHPSRQL6IWSN26C36CJ7W" - } - ], - "objects": [ - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "67GA7XA2FWMRYY2VCONTYZJR", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "XCS4SCGN4WQYE2VU4U3TKXEH", - "ordinal": -2251731094208512 - } - ], - "description": "Hot Leaf Juice", - "description_html": "

Hot Leaf Juice

", - "description_plaintext": "Hot Leaf Juice", - "is_archived": false, - "is_taxable": true, - "name": "Tea", - "product_type": "REGULAR", - "tax_ids": [ - "HP5VNYPKZKTNCKZ2Z5NPUH6A" - ], - "variations": [ - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "CAJBHUIQH7ONTSZI2KTVOUP6", - "is_deleted": false, - "item_variation_data": { - "item_id": "67GA7XA2FWMRYY2VCONTYZJR", - "name": "Mug", - "ordinal": 0, - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING", - "sellable": true, - "stockable": true - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "MQ4TZKOG3SR2EQI3TWEK4AH7", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "XCS4SCGN4WQYE2VU4U3TKXEH", - "ordinal": -2251662374731776 - } - ], - "description": "Hot Bean Juice", - "description_html": "

Hot Bean Juice

", - "description_plaintext": "Hot Bean Juice", - "is_archived": false, - "is_taxable": true, - "name": "Coffee", - "product_type": "REGULAR", - "tax_ids": [ - "HP5VNYPKZKTNCKZ2Z5NPUH6A" - ], - "variations": [ - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "GY2GXJTVVPQAPW43GFRR3NG6", - "is_deleted": false, - "item_variation_data": { - "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", - "name": "Regular", - "ordinal": 0, - "price_money": { - "amount": 250, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING", - "sellable": true, - "stockable": true - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400 - }, - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "JE6VHPSRQL6IWSN26C36CJ7W", - "is_deleted": false, - "item_variation_data": { - "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", - "name": "Large", - "ordinal": 1, - "price_money": { - "amount": 350, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING", - "sellable": true, - "stockable": true - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "category_data": { - "category_type": "REGULAR_CATEGORY", - "is_top_level": true, - "name": "Beverages", - "online_visibility": true, - "parent_category": { - "ordinal": -2250837741010944 - } - }, - "created_at": "2023-11-30T19:24:35.4Z", - "id": "XCS4SCGN4WQYE2VU4U3TKXEH", - "is_deleted": false, - "present_at_all_locations": true, - "type": "CATEGORY", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "created_at": "2023-11-30T19:24:35.4Z", - "id": "HP5VNYPKZKTNCKZ2Z5NPUH6A", - "is_deleted": false, - "present_at_all_locations": true, - "tax_data": { - "applies_to_custom_amounts": true, - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX", - "updated_at": "2023-11-30T19:24:35.4Z", - "version": 1701372275400, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "updated_at": "updated_at6" -} -``` - diff --git a/doc/models/booking-booking-source.md b/doc/models/booking-booking-source.md deleted file mode 100644 index 38440caf..00000000 --- a/doc/models/booking-booking-source.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Booking Booking Source - -Supported sources a booking was created from. - -## Enumeration - -`BookingBookingSource` - -## Fields - -| Name | Description | -| --- | --- | -| `FIRST_PARTY_MERCHANT` | The booking was created by a seller from a Square Appointments application, such as the Square Appointments Dashboard or a Square Appointments mobile app. | -| `FIRST_PARTY_BUYER` | The booking was created by a buyer from a Square Appointments application, such as Square Online Booking Site. | -| `THIRD_PARTY_BUYER` | The booking was created by a buyer created from a third-party application. | -| `API` | The booking was created by a seller or a buyer from the Square Bookings API. | - diff --git a/doc/models/booking-creator-details-creator-type.md b/doc/models/booking-creator-details-creator-type.md deleted file mode 100644 index 1e8c073f..00000000 --- a/doc/models/booking-creator-details-creator-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Booking Creator Details Creator Type - -Supported types of a booking creator. - -## Enumeration - -`BookingCreatorDetailsCreatorType` - -## Fields - -| Name | Description | -| --- | --- | -| `TEAM_MEMBER` | The creator is of the seller type. | -| `CUSTOMER` | The creator is of the buyer type. | - diff --git a/doc/models/booking-creator-details.md b/doc/models/booking-creator-details.md deleted file mode 100644 index cf653348..00000000 --- a/doc/models/booking-creator-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Booking Creator Details - -Information about a booking creator. - -## Structure - -`BookingCreatorDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `creatorType` | [`?string(BookingCreatorDetailsCreatorType)`](../../doc/models/booking-creator-details-creator-type.md) | Optional | Supported types of a booking creator. | getCreatorType(): ?string | setCreatorType(?string creatorType): void | -| `teamMemberId` | `?string` | Optional | The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type.
Access to this field requires seller-level permissions.
**Constraints**: *Maximum Length*: `32` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `customerId` | `?string` | Optional | The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type.
Access to this field requires seller-level permissions.
**Constraints**: *Maximum Length*: `192` | getCustomerId(): ?string | setCustomerId(?string customerId): void | - -## Example (as JSON) - -```json -{ - "creator_type": "TEAM_MEMBER", - "team_member_id": "team_member_id4", - "customer_id": "customer_id2" -} -``` - diff --git a/doc/models/booking-custom-attribute-delete-request.md b/doc/models/booking-custom-attribute-delete-request.md deleted file mode 100644 index b4952842..00000000 --- a/doc/models/booking-custom-attribute-delete-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Booking Custom Attribute Delete Request - -Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) -request. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key. - -## Structure - -`BookingCustomAttributeDeleteRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookingId` | `string` | Required | The ID of the target [booking](entity:Booking).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getBookingId(): string | setBookingId(string bookingId): void | -| `key` | `string` | Required | The key of the custom attribute to delete. This key must match the `key` of a
custom attribute definition in the Square seller account. If the requesting application is not
the definition owner, you must use the qualified key.
**Constraints**: *Minimum Length*: `1` | getKey(): string | setKey(string key): void | - -## Example (as JSON) - -```json -{ - "booking_id": "booking_id0", - "key": "key6" -} -``` - diff --git a/doc/models/booking-custom-attribute-delete-response.md b/doc/models/booking-custom-attribute-delete-response.md deleted file mode 100644 index abb42ad7..00000000 --- a/doc/models/booking-custom-attribute-delete-response.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Booking Custom Attribute Delete Response - -Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) operation. - -## Structure - -`BookingCustomAttributeDeleteResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookingId` | `?string` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | getBookingId(): ?string | setBookingId(?string bookingId): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", - "errors": [] -} -``` - diff --git a/doc/models/booking-custom-attribute-upsert-request.md b/doc/models/booking-custom-attribute-upsert-request.md deleted file mode 100644 index 3713c8b9..00000000 --- a/doc/models/booking-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Booking Custom Attribute Upsert Request - -Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) -request. An individual request contains a booking ID, the custom attribute to create or update, -and an optional idempotency key. - -## Structure - -`BookingCustomAttributeUpsertRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookingId` | `string` | Required | The ID of the target [booking](entity:Booking).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getBookingId(): string | setBookingId(string bookingId): void | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this individual upsert request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "booking_id": "booking_id2", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/booking-custom-attribute-upsert-response.md b/doc/models/booking-custom-attribute-upsert-response.md deleted file mode 100644 index aa11cbac..00000000 --- a/doc/models/booking-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Booking Custom Attribute Upsert Response - -Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) operation. - -## Structure - -`BookingCustomAttributeUpsertResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookingId` | `?string` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | getBookingId(): ?string | setBookingId(?string bookingId): void | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking_id": "booking_id6", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/booking-status.md b/doc/models/booking-status.md deleted file mode 100644 index 3673283e..00000000 --- a/doc/models/booking-status.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Booking Status - -Supported booking statuses. - -## Enumeration - -`BookingStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | An unaccepted booking. It is visible to both sellers and customers. | -| `CANCELLED_BY_CUSTOMER` | A customer-cancelled booking. It is visible to both the seller and the customer. | -| `CANCELLED_BY_SELLER` | A seller-cancelled booking. It is visible to both the seller and the customer. | -| `DECLINED` | A declined booking. It had once been pending, but was then declined by the seller. | -| `ACCEPTED` | An accepted booking agreed to or accepted by the seller. | -| `NO_SHOW` | A no-show booking. The booking was accepted at one time, but have now been marked as a no-show by
the seller because the client either missed the booking or cancelled it without enough notice. | - diff --git a/doc/models/booking.md b/doc/models/booking.md deleted file mode 100644 index 0c896ad5..00000000 --- a/doc/models/booking.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Booking - -Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service -at a given location to a requesting customer in one or more appointment segments. - -## Structure - -`Booking` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID of this object representing a booking.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `version` | `?int` | Optional | The revision number for the booking used for optimistic concurrency. | getVersion(): ?int | setVersion(?int version): void | -| `status` | [`?string(BookingStatus)`](../../doc/models/booking-status.md) | Optional | Supported booking statuses. | getStatus(): ?string | setStatus(?string status): void | -| `createdAt` | `?string` | Optional | The RFC 3339 timestamp specifying the creation time of this booking. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The RFC 3339 timestamp specifying the most recent update time of this booking. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `startAt` | `?string` | Optional | The RFC 3339 timestamp specifying the starting time of this booking. | getStartAt(): ?string | setStartAt(?string startAt): void | -| `locationId` | `?string` | Optional | The ID of the [Location](entity:Location) object representing the location where the booked service is provided. Once set when the booking is created, its value cannot be changed.
**Constraints**: *Maximum Length*: `32` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `customerId` | `?string` | Optional | The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.
**Constraints**: *Maximum Length*: `192` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `customerNote` | `?string` | Optional | The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity:CatalogObject) instance.
**Constraints**: *Maximum Length*: `4096` | getCustomerNote(): ?string | setCustomerNote(?string customerNote): void | -| `sellerNote` | `?string` | Optional | The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity:CatalogObject) instance.
This field should not be visible to customers.
**Constraints**: *Maximum Length*: `4096` | getSellerNote(): ?string | setSellerNote(?string sellerNote): void | -| `appointmentSegments` | [`?(AppointmentSegment[])`](../../doc/models/appointment-segment.md) | Optional | A list of appointment segments for this booking. | getAppointmentSegments(): ?array | setAppointmentSegments(?array appointmentSegments): void | -| `transitionTimeMinutes` | `?int` | Optional | Additional time at the end of a booking.
Applications should not make this field visible to customers of a seller. | getTransitionTimeMinutes(): ?int | setTransitionTimeMinutes(?int transitionTimeMinutes): void | -| `allDay` | `?bool` | Optional | Whether the booking is of a full business day. | getAllDay(): ?bool | setAllDay(?bool allDay): void | -| `locationType` | [`?string(BusinessAppointmentSettingsBookingLocationType)`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Supported types of location where service is provided. | getLocationType(): ?string | setLocationType(?string locationType): void | -| `creatorDetails` | [`?BookingCreatorDetails`](../../doc/models/booking-creator-details.md) | Optional | Information about a booking creator. | getCreatorDetails(): ?BookingCreatorDetails | setCreatorDetails(?BookingCreatorDetails creatorDetails): void | -| `source` | [`?string(BookingBookingSource)`](../../doc/models/booking-booking-source.md) | Optional | Supported sources a booking was created from. | getSource(): ?string | setSource(?string source): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "version": 92, - "status": "PENDING", - "created_at": "created_at2", - "updated_at": "updated_at0" -} -``` - diff --git a/doc/models/break-type.md b/doc/models/break-type.md deleted file mode 100644 index 819dd99f..00000000 --- a/doc/models/break-type.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Break Type - -A defined break template that sets an expectation for possible `Break` -instances on a `Shift`. - -## Structure - -`BreakType` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `locationId` | `string` | Required | The ID of the business location this type of break applies to.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `breakName` | `string` | Required | A human-readable name for this type of break. The name is displayed to
employees in Square products.
**Constraints**: *Minimum Length*: `1` | getBreakName(): string | setBreakName(string breakName): void | -| `expectedDuration` | `string` | Required | Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of
this break. Precision less than minutes is truncated.

Example for break expected duration of 15 minutes: T15M
**Constraints**: *Minimum Length*: `1` | getExpectedDuration(): string | setExpectedDuration(string expectedDuration): void | -| `isPaid` | `bool` | Required | Whether this break counts towards time worked for compensation
purposes. | getIsPaid(): bool | setIsPaid(bool isPaid): void | -| `version` | `?int` | Optional | Used for resolving concurrency issues. The request fails if the version
provided does not match the server version at the time of the request. If a value is not
provided, Square's servers execute a "blind" write; potentially
overwriting another writer's data. | getVersion(): ?int | setVersion(?int version): void | -| `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "location_id": "location_id8", - "break_name": "break_name4", - "expected_duration": "expected_duration0", - "is_paid": false, - "version": 236, - "created_at": "created_at8", - "updated_at": "updated_at0" -} -``` - diff --git a/doc/models/bulk-create-customer-data.md b/doc/models/bulk-create-customer-data.md deleted file mode 100644 index 53dfe6be..00000000 --- a/doc/models/bulk-create-customer-data.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Bulk Create Customer Data - -Defines the customer data provided in individual create requests for a -[BulkCreateCustomers](../../doc/apis/customers.md#bulk-create-customers) operation. - -## Structure - -`BulkCreateCustomerData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `companyName` | `?string` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `nickname` | `?string` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | getNickname(): ?string | setNickname(?string nickname): void | -| `emailAddress` | `?string` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified. | getBirthday(): ?string | setBirthday(?string birthday): void | -| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "given_name": "given_name4", - "family_name": "family_name4", - "company_name": "company_name8", - "nickname": "nickname8", - "email_address": "email_address0" -} -``` - diff --git a/doc/models/bulk-create-customers-request.md b/doc/models/bulk-create-customers-request.md deleted file mode 100644 index 7e23e093..00000000 --- a/doc/models/bulk-create-customers-request.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Bulk Create Customers Request - -Defines the body parameters that can be included in requests to the -[BulkCreateCustomers](../../doc/apis/customers.md#bulk-create-customers) endpoint. - -## Structure - -`BulkCreateCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customers` | [`array`](../../doc/models/bulk-create-customer-data.md) | Required | A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
key-value pairs.

Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)
that uniquely identifies the create request. Each value contains the customer data used to create the
customer profile. | getCustomers(): array | setCustomers(array customers): void | - -## Example (as JSON) - -```json -{ - "customers": { - "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "reference_id": "YOUR_REFERENCE_ID", - "company_name": "company_name8", - "nickname": "nickname8" - }, - "d1689f23-b25d-4932-b2f0-aed00f5e2029": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 601", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "email_address": "Marie.Curie@example.com", - "family_name": "Curie", - "given_name": "Marie", - "note": "another customer", - "phone_number": "+1-212-444-4240", - "reference_id": "YOUR_REFERENCE_ID", - "company_name": "company_name8", - "nickname": "nickname8" - } - } -} -``` - diff --git a/doc/models/bulk-create-customers-response.md b/doc/models/bulk-create-customers-response.md deleted file mode 100644 index c7c6ca21..00000000 --- a/doc/models/bulk-create-customers-response.md +++ /dev/null @@ -1,150 +0,0 @@ - -# Bulk Create Customers Response - -Defines the fields included in the response body from the -[BulkCreateCustomers](../../doc/apis/customers.md#bulk-create-customers) endpoint. - -## Structure - -`BulkCreateCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `responses` | [`?array`](../../doc/models/create-customer-response.md) | Optional | A map of responses that correspond to individual create requests, represented by
key-value pairs.

Each key is the idempotency key that was provided for a create request and each value
is the corresponding response.
If the request succeeds, the value is the new customer profile.
If the request fails, the value contains any errors that occurred during the request. | getResponses(): ?array | setResponses(?array responses): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "responses": { - "8bb76c4f-e35d-4c5b-90de-1194cd9179f4": { - "customer": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2024-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2024-03-23T20:21:54.859Z", - "version": 0, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "d1689f23-b25d-4932-b2f0-aed00f5e2029": { - "customer": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 601", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2024-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "Marie.Curie@example.com", - "family_name": "Curie", - "given_name": "Marie", - "id": "N18CPRVXR5214XPBBA6BZQWF3C", - "note": "another customer", - "phone_number": "+1-212-444-4240", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2024-03-23T20:21:54.859Z", - "version": 0, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-create-team-members-request.md b/doc/models/bulk-create-team-members-request.md deleted file mode 100644 index b7c70026..00000000 --- a/doc/models/bulk-create-team-members-request.md +++ /dev/null @@ -1,60 +0,0 @@ - -# Bulk Create Team Members Request - -Represents a bulk create request for `TeamMember` objects. - -## Structure - -`BulkCreateTeamMembersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMembers` | [`array`](../../doc/models/create-team-member-request.md) | Required | The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.
The maximum number of create objects is 25.

If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,
call [ListJobs](api-endpoint:Team-ListJobs). | getTeamMembers(): array | setTeamMembers(array teamMembers): void | - -## Example (as JSON) - -```json -{ - "team_members": { - "idempotency-key-1": { - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "YSGH2WBKG94QZ", - "GA2Y9HSJ8KRYT" - ] - }, - "email_address": "joe_doe@gmail.com", - "family_name": "Doe", - "given_name": "Joe", - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "id": "id6", - "is_owner": false, - "status": "ACTIVE" - }, - "idempotency_key": "idempotency_key4" - }, - "idempotency-key-2": { - "team_member": { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "email_address": "jane_smith@gmail.com", - "family_name": "Smith", - "given_name": "Jane", - "phone_number": "+14159223334", - "reference_id": "reference_id_2", - "id": "id6", - "is_owner": false, - "status": "ACTIVE" - }, - "idempotency_key": "idempotency_key4" - } - } -} -``` - diff --git a/doc/models/bulk-create-team-members-response.md b/doc/models/bulk-create-team-members-response.md deleted file mode 100644 index 45e105e7..00000000 --- a/doc/models/bulk-create-team-members-response.md +++ /dev/null @@ -1,95 +0,0 @@ - -# Bulk Create Team Members Response - -Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. - -## Structure - -`BulkCreateTeamMembersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMembers` | [`?array`](../../doc/models/create-team-member-response.md) | Optional | The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. | getTeamMembers(): ?array | setTeamMembers(?array teamMembers): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_members": { - "idempotency-key-1": { - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "GA2Y9HSJ8KRYT", - "YSGH2WBKG94QZ" - ] - }, - "email_address": "joe_doe@gmail.com", - "family_name": "Doe", - "given_name": "Joe", - "id": "ywhG1qfIOoqsHfVRubFV", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "idempotency-key-2": { - "team_member": { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "email_address": "jane_smith@gmail.com", - "family_name": "Smith", - "given_name": "Jane", - "id": "IF_Ncrg7fHhCqxVI9T6R", - "is_owner": false, - "phone_number": "+14159223334", - "reference_id": "reference_id_2", - "status": "ACTIVE" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-create-vendors-request.md b/doc/models/bulk-create-vendors-request.md deleted file mode 100644 index 17789ca9..00000000 --- a/doc/models/bulk-create-vendors-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Bulk Create Vendors Request - -Represents an input to a call to [BulkCreateVendors](../../doc/apis/vendors.md#bulk-create-vendors). - -## Structure - -`BulkCreateVendorsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `vendors` | [`array`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency-key/`Vendor`-object pairs. | getVendors(): array | setVendors(array vendors): void | - -## Example (as JSON) - -```json -{ - "vendors": { - "key0": { - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4", - "name": "name8", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - } -} -``` - diff --git a/doc/models/bulk-create-vendors-response.md b/doc/models/bulk-create-vendors-response.md deleted file mode 100644 index b2cea73d..00000000 --- a/doc/models/bulk-create-vendors-response.md +++ /dev/null @@ -1,80 +0,0 @@ - -# Bulk Create Vendors Response - -Represents an output from a call to [BulkCreateVendors](../../doc/apis/vendors.md#bulk-create-vendors). - -## Structure - -`BulkCreateVendorsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `responses` | [`?array`](../../doc/models/create-vendor-response.md) | Optional | A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)
objects or error responses for failed attempts. The set is represented by
a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified
in the input. | getResponses(): ?array | setResponses(?array responses): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "responses": { - "key0": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - } - } -} -``` - diff --git a/doc/models/bulk-delete-booking-custom-attributes-request.md b/doc/models/bulk-delete-booking-custom-attributes-request.md deleted file mode 100644 index 54da71bd..00000000 --- a/doc/models/bulk-delete-booking-custom-attributes-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Delete Booking Custom Attributes Request - -Represents a [BulkDeleteBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) request. - -## Structure - -`BulkDeleteBookingCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/booking-custom-attribute-delete-request.md) | Required | A map containing 1 to 25 individual Delete requests. For each request, provide an
arbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the
information needed to delete a custom attribute. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "booking_id": "booking_id4", - "key": "key0" - } - } -} -``` - diff --git a/doc/models/bulk-delete-booking-custom-attributes-response.md b/doc/models/bulk-delete-booking-custom-attributes-response.md deleted file mode 100644 index fa04c13f..00000000 --- a/doc/models/bulk-delete-booking-custom-attributes-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Bulk Delete Booking Custom Attributes Response - -Represents a [BulkDeleteBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) response, -which contains a map of responses that each corresponds to an individual delete request. - -## Structure - -`BulkDeleteBookingCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?array`](../../doc/models/booking-custom-attribute-delete-response.md) | Optional | A map of responses that correspond to individual delete requests. Each response has the
same ID as the corresponding request and contains `booking_id` and `errors` field. | getValues(): ?array | setValues(?array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "values": { - "id1": { - "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", - "errors": [] - }, - "id2": { - "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", - "errors": [] - }, - "id3": { - "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", - "errors": [] - } - } -} -``` - diff --git a/doc/models/bulk-delete-customers-request.md b/doc/models/bulk-delete-customers-request.md deleted file mode 100644 index 856ecddf..00000000 --- a/doc/models/bulk-delete-customers-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Delete Customers Request - -Defines the body parameters that can be included in requests to the -[BulkDeleteCustomers](../../doc/apis/customers.md#bulk-delete-customers) endpoint. - -## Structure - -`BulkDeleteCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerIds` | `string[]` | Required | The IDs of the [customer profiles](entity:Customer) to delete. | getCustomerIds(): array | setCustomerIds(array customerIds): void | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "8DDA5NZVBZFGAX0V3HPF81HHE0", - "N18CPRVXR5214XPBBA6BZQWF3C", - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" - ] -} -``` - diff --git a/doc/models/bulk-delete-customers-response.md b/doc/models/bulk-delete-customers-response.md deleted file mode 100644 index 8365087e..00000000 --- a/doc/models/bulk-delete-customers-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Bulk Delete Customers Response - -Defines the fields included in the response body from the -[BulkDeleteCustomers](../../doc/apis/customers.md#bulk-delete-customers) endpoint. - -## Structure - -`BulkDeleteCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `responses` | [`?array`](../../doc/models/delete-customer-response.md) | Optional | A map of responses that correspond to individual delete requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a delete request and each value
is the corresponding response.
If the request succeeds, the value is an empty object (`{ }`).
If the request fails, the value contains any errors that occurred during the request. | getResponses(): ?array | setResponses(?array responses): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "responses": { - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { - "errors": [ - { - "category": "INVALID_REQUEST_ERROR", - "code": "NOT_FOUND", - "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", - "field": "field4" - } - ] - }, - "8DDA5NZVBZFGAX0V3HPF81HHE0": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "N18CPRVXR5214XPBBA6BZQWF3C": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md b/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md deleted file mode 100644 index 48970256..00000000 --- a/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete Request - -Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-delete-location-custom-attributes) -request. An individual request contains an optional ID of the associated custom attribute definition -and optional key of the associated custom attribute definition. - -## Structure - -`BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `?string` | Optional | The key of the associated custom attribute definition.
Represented as a qualified key if the requesting app is not the definition owner.
**Constraints**: *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | getKey(): ?string | setKey(?string key): void | - -## Example (as JSON) - -```json -{ - "key": "key8" -} -``` - diff --git a/doc/models/bulk-delete-location-custom-attributes-request.md b/doc/models/bulk-delete-location-custom-attributes-request.md deleted file mode 100644 index c193cfeb..00000000 --- a/doc/models/bulk-delete-location-custom-attributes-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Bulk Delete Location Custom Attributes Request - -Represents a [BulkDeleteLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-delete-location-custom-attributes) request. - -## Structure - -`BulkDeleteLocationCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md) | Required | The data used to update the `CustomAttribute` objects.
The keys must be unique and are used to map to the corresponding response. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "id1": { - "key": "bestseller", - "location_id": "L0TBCBTB7P8RQ" - }, - "id2": { - "key": "bestseller", - "location_id": "L9XMD04V3STJX" - }, - "id3": { - "key": "phone-number", - "location_id": "L0TBCBTB7P8RQ" - } - } -} -``` - diff --git a/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md b/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md deleted file mode 100644 index f99de917..00000000 --- a/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete Response - -Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-delete-location-custom-attributes) -request. - -## Structure - -`BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the location associated with the custom attribute. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "location_id": "L0TBCBTB7P8RQ" -} -``` - diff --git a/doc/models/bulk-delete-location-custom-attributes-response.md b/doc/models/bulk-delete-location-custom-attributes-response.md deleted file mode 100644 index d1aabed5..00000000 --- a/doc/models/bulk-delete-location-custom-attributes-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Bulk Delete Location Custom Attributes Response - -Represents a [BulkDeleteLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-delete-location-custom-attributes) response, -which contains a map of responses that each corresponds to an individual delete request. - -## Structure - -`BulkDeleteLocationCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md) | Required | A map of responses that correspond to individual delete requests. Each response has the
same key as the corresponding request. | getValues(): array | setValues(array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "id1": { - "errors": [], - "location_id": "L0TBCBTB7P8RQ" - }, - "id2": { - "errors": [], - "location_id": "L9XMD04V3STJX" - }, - "id3": { - "errors": [], - "location_id": "L0TBCBTB7P8RQ" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md b/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md deleted file mode 100644 index a71d6c64..00000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete Request - -Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) -request. An individual request contains an optional ID of the associated custom attribute definition -and optional key of the associated custom attribute definition. - -## Structure - -`BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `?string` | Optional | The key of the associated custom attribute definition.
Represented as a qualified key if the requesting app is not the definition owner.
**Constraints**: *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | getKey(): ?string | setKey(?string key): void | - -## Example (as JSON) - -```json -{ - "key": "key0" -} -``` - diff --git a/doc/models/bulk-delete-merchant-custom-attributes-request.md b/doc/models/bulk-delete-merchant-custom-attributes-request.md deleted file mode 100644 index 07e13070..00000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Bulk Delete Merchant Custom Attributes Request - -Represents a [BulkDeleteMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) request. - -## Structure - -`BulkDeleteMerchantCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md) | Required | The data used to update the `CustomAttribute` objects.
The keys must be unique and are used to map to the corresponding response. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "id1": { - "key": "alternative_seller_name", - "merchant_id": "DM7VKY8Q63GNP" - }, - "id2": { - "key": "has_seen_tutorial", - "merchant_id": "DM7VKY8Q63GNP" - } - } -} -``` - diff --git a/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md b/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md deleted file mode 100644 index a3f3128a..00000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete Response - -Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) -request. - -## Structure - -`BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "merchant_id": "DM7VKY8Q63GNP" -} -``` - diff --git a/doc/models/bulk-delete-merchant-custom-attributes-response.md b/doc/models/bulk-delete-merchant-custom-attributes-response.md deleted file mode 100644 index 5355c3bb..00000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Bulk Delete Merchant Custom Attributes Response - -Represents a [BulkDeleteMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) response, -which contains a map of responses that each corresponds to an individual delete request. - -## Structure - -`BulkDeleteMerchantCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md) | Required | A map of responses that correspond to individual delete requests. Each response has the
same key as the corresponding request. | getValues(): array | setValues(array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "id1": { - "errors": [], - "merchant_id": "DM7VKY8Q63GNP" - }, - "id2": { - "errors": [], - "merchant_id": "DM7VKY8Q63GNP" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md b/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md deleted file mode 100644 index 732bdb20..00000000 --- a/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Delete Order Custom Attributes Request Delete Custom Attribute - -Represents one delete within the bulk operation. - -## Structure - -`BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `?string` | Optional | The key of the custom attribute to delete. This key must match the key
of an existing custom attribute definition.
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | getKey(): ?string | setKey(?string key): void | -| `orderId` | `string` | Required | The ID of the target [order](entity:Order).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getOrderId(): string | setOrderId(string orderId): void | - -## Example (as JSON) - -```json -{ - "key": "key2", - "order_id": "order_id6" -} -``` - diff --git a/doc/models/bulk-delete-order-custom-attributes-request.md b/doc/models/bulk-delete-order-custom-attributes-request.md deleted file mode 100644 index 322e382e..00000000 --- a/doc/models/bulk-delete-order-custom-attributes-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Bulk Delete Order Custom Attributes Request - -Represents a bulk delete request for one or more order custom attributes. - -## Structure - -`BulkDeleteOrderCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md) | Required | A map of requests that correspond to individual delete operations for custom attributes. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "cover-count": { - "key": "cover-count", - "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - }, - "table-number": { - "key": "table-number", - "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - } - } -} -``` - diff --git a/doc/models/bulk-delete-order-custom-attributes-response.md b/doc/models/bulk-delete-order-custom-attributes-response.md deleted file mode 100644 index 96672462..00000000 --- a/doc/models/bulk-delete-order-custom-attributes-response.md +++ /dev/null @@ -1,65 +0,0 @@ - -# Bulk Delete Order Custom Attributes Response - -Represents a response from deleting one or more order custom attributes. - -## Structure - -`BulkDeleteOrderCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `values` | [`array`](../../doc/models/delete-order-custom-attribute-response.md) | Required | A map of responses that correspond to individual delete requests. Each response has the same ID
as the corresponding request and contains either a `custom_attribute` or an `errors` field. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "cover-count": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "table-number": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-retrieve-bookings-request.md b/doc/models/bulk-retrieve-bookings-request.md deleted file mode 100644 index 0d30b2a1..00000000 --- a/doc/models/bulk-retrieve-bookings-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Bulk Retrieve Bookings Request - -Request payload for bulk retrieval of bookings. - -## Structure - -`BulkRetrieveBookingsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookingIds` | `string[]` | Required | A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. | getBookingIds(): array | setBookingIds(array bookingIds): void | - -## Example (as JSON) - -```json -{ - "booking_ids": [ - "booking_ids8", - "booking_ids9", - "booking_ids0" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-bookings-response.md b/doc/models/bulk-retrieve-bookings-response.md deleted file mode 100644 index 4071a18a..00000000 --- a/doc/models/bulk-retrieve-bookings-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Bulk Retrieve Bookings Response - -Response payload for bulk retrieval of bookings. - -## Structure - -`BulkRetrieveBookingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookings` | [`?array`](../../doc/models/retrieve-booking-response.md) | Optional | Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value. | getBookings(): ?array | setBookings(?array bookings): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "bookings": { - "sc3p3m7dvctfr1": { - "booking": { - "all_day": false, - "appointment_segments": [ - { - "any_team_member": false, - "duration_minutes": 60, - "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", - "service_variation_version": 1641341724039, - "team_member_id": "TMjiqI3PxyLMKr4k" - } - ], - "created_at": "2023-04-26T18:19:21Z", - "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", - "id": "sc3p3m7dvctfr1", - "location_id": "LY6WNBPVM6VGV", - "start_at": "2023-05-01T14:00:00Z", - "status": "ACCEPTED", - "updated_at": "2023-04-26T18:19:21Z", - "version": 0 - }, - "errors": [] - }, - "tdegug1dvctdef": { - "errors": [ - { - "category": "INVALID_REQUEST_ERROR", - "code": "NOT_FOUND", - "detail": "Specified booking was not found.", - "field": "booking_id" - } - ], - "booking": { - "id": "id4", - "version": 156, - "status": "CANCELLED_BY_SELLER", - "created_at": "created_at2", - "updated_at": "updated_at0" - } - }, - "tdegug1fqni3wh": { - "booking": { - "all_day": false, - "appointment_segments": [ - { - "any_team_member": false, - "duration_minutes": 60, - "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", - "service_variation_version": 1641341724039, - "team_member_id": "TMjiqI3PxyLMKr4k" - } - ], - "created_at": "2023-04-26T18:19:30Z", - "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", - "id": "tdegug1fqni3wh", - "location_id": "LY6WNBPVM6VGV", - "start_at": "2023-05-02T14:00:00Z", - "status": "ACCEPTED", - "updated_at": "2023-04-26T18:19:30Z", - "version": 0 - }, - "errors": [] - } - }, - "errors": [] -} -``` - diff --git a/doc/models/bulk-retrieve-customers-request.md b/doc/models/bulk-retrieve-customers-request.md deleted file mode 100644 index 91dfa9da..00000000 --- a/doc/models/bulk-retrieve-customers-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Retrieve Customers Request - -Defines the body parameters that can be included in requests to the -[BulkRetrieveCustomers](../../doc/apis/customers.md#bulk-retrieve-customers) endpoint. - -## Structure - -`BulkRetrieveCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerIds` | `string[]` | Required | The IDs of the [customer profiles](entity:Customer) to retrieve. | getCustomerIds(): array | setCustomerIds(array customerIds): void | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "8DDA5NZVBZFGAX0V3HPF81HHE0", - "N18CPRVXR5214XPBBA6BZQWF3C", - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-customers-response.md b/doc/models/bulk-retrieve-customers-response.md deleted file mode 100644 index 5bc6ffaa..00000000 --- a/doc/models/bulk-retrieve-customers-response.md +++ /dev/null @@ -1,142 +0,0 @@ - -# Bulk Retrieve Customers Response - -Defines the fields included in the response body from the -[BulkRetrieveCustomers](../../doc/apis/customers.md#bulk-retrieve-customers) endpoint. - -## Structure - -`BulkRetrieveCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `responses` | [`?array`](../../doc/models/retrieve-customer-response.md) | Optional | A map of responses that correspond to individual retrieve requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a retrieve request and each value
is the corresponding response.
If the request succeeds, the value is the requested customer profile.
If the request fails, the value contains any errors that occurred during the request. | getResponses(): ?array | setResponses(?array responses): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "responses": { - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { - "errors": [ - { - "category": "INVALID_REQUEST_ERROR", - "code": "NOT_FOUND", - "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", - "field": "field4" - } - ], - "customer": { - "id": "id0", - "created_at": "created_at2", - "updated_at": "updated_at4", - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ], - "given_name": "given_name2" - } - }, - "8DDA5NZVBZFGAX0V3HPF81HHE0": { - "customer": { - "birthday": "1897-07-24", - "created_at": "2024-01-19T00:27:54.59Z", - "creation_source": "THIRD_PARTY", - "email_address": "New.Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", - "note": "updated customer note", - "preferences": { - "email_unsubscribed": false - }, - "updated_at": "2024-01-19T00:38:06Z", - "version": 3 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "N18CPRVXR5214XPBBA6BZQWF3C": { - "customer": { - "created_at": "2024-01-19T00:27:54.59Z", - "creation_source": "THIRD_PARTY", - "family_name": "Curie", - "given_name": "Marie", - "id": "N18CPRVXR5214XPBBA6BZQWF3C", - "preferences": { - "email_unsubscribed": false - }, - "updated_at": "2024-01-19T00:38:06Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-retrieve-team-member-booking-profiles-request.md b/doc/models/bulk-retrieve-team-member-booking-profiles-request.md deleted file mode 100644 index 5d4b21e6..00000000 --- a/doc/models/bulk-retrieve-team-member-booking-profiles-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Bulk Retrieve Team Member Booking Profiles Request - -Request payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/apis/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. - -## Structure - -`BulkRetrieveTeamMemberBookingProfilesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberIds` | `string[]` | Required | A non-empty list of IDs of team members whose booking profiles you want to retrieve. | getTeamMemberIds(): array | setTeamMemberIds(array teamMemberIds): void | - -## Example (as JSON) - -```json -{ - "team_member_ids": [ - "team_member_ids1", - "team_member_ids2" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-team-member-booking-profiles-response.md b/doc/models/bulk-retrieve-team-member-booking-profiles-response.md deleted file mode 100644 index 0240cb53..00000000 --- a/doc/models/bulk-retrieve-team-member-booking-profiles-response.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Bulk Retrieve Team Member Booking Profiles Response - -Response payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/apis/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. - -## Structure - -`BulkRetrieveTeamMemberBookingProfilesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberBookingProfiles` | [`?array`](../../doc/models/retrieve-team-member-booking-profile-response.md) | Optional | The returned team members' booking profiles, as a map with `team_member_id` as the key and [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. | getTeamMemberBookingProfiles(): ?array | setTeamMemberBookingProfiles(?array teamMemberBookingProfiles): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "team_member_booking_profiles": { - "TMXUrsBWWcHTt79t": { - "errors": [ - { - "category": "INVALID_REQUEST_ERROR", - "code": "NOT_FOUND", - "detail": "Resource not found.", - "field": "field4" - } - ], - "team_member_booking_profile": { - "team_member_id": "team_member_id2", - "description": "description2", - "display_name": "display_name2", - "is_bookable": false, - "profile_image_url": "profile_image_url8" - } - }, - "TMaJcbiRqPIGZuS9": { - "errors": [], - "team_member_booking_profile": { - "display_name": "Sandbox Staff 1", - "is_bookable": true, - "team_member_id": "TMaJcbiRqPIGZuS9" - } - }, - "TMtdegug1fqni3wh": { - "errors": [], - "team_member_booking_profile": { - "display_name": "Sandbox Staff 2", - "is_bookable": true, - "team_member_id": "TMtdegug1fqni3wh" - } - } - } -} -``` - diff --git a/doc/models/bulk-retrieve-vendors-request.md b/doc/models/bulk-retrieve-vendors-request.md deleted file mode 100644 index 89a37a0e..00000000 --- a/doc/models/bulk-retrieve-vendors-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Retrieve Vendors Request - -Represents an input to a call to [BulkRetrieveVendors](../../doc/apis/vendors.md#bulk-retrieve-vendors). - -## Structure - -`BulkRetrieveVendorsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `vendorIds` | `?(string[])` | Optional | IDs of the [Vendor](entity:Vendor) objects to retrieve. | getVendorIds(): ?array | setVendorIds(?array vendorIds): void | - -## Example (as JSON) - -```json -{ - "vendor_ids": [ - "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-vendors-response.md b/doc/models/bulk-retrieve-vendors-response.md deleted file mode 100644 index 0802bba4..00000000 --- a/doc/models/bulk-retrieve-vendors-response.md +++ /dev/null @@ -1,109 +0,0 @@ - -# Bulk Retrieve Vendors Response - -Represents an output from a call to [BulkRetrieveVendors](../../doc/apis/vendors.md#bulk-retrieve-vendors). - -## Structure - -`BulkRetrieveVendorsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `responses` | [`?array`](../../doc/models/retrieve-vendor-response.md) | Optional | The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating successfully retrieved [Vendor](entity:Vendor)
objects or error responses for failed attempts. The set is represented by
a collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs. | getResponses(): ?array | setResponses(?array responses): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "responses": { - "key0": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - }, - "key1": { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - } - } -} -``` - diff --git a/doc/models/bulk-swap-plan-request.md b/doc/models/bulk-swap-plan-request.md deleted file mode 100644 index ef34c6a1..00000000 --- a/doc/models/bulk-swap-plan-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Swap Plan Request - -Defines input parameters in a call to the -[BulkSwapPlan](../../doc/apis/subscriptions.md#bulk-swap-plan) endpoint. - -## Structure - -`BulkSwapPlanRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `newPlanVariationId` | `string` | Required | The ID of the new subscription plan variation.

This field is required.
**Constraints**: *Minimum Length*: `1` | getNewPlanVariationId(): string | setNewPlanVariationId(string newPlanVariationId): void | -| `oldPlanVariationId` | `string` | Required | The ID of the plan variation whose subscriptions should be swapped. Active subscriptions
using this plan variation will be subscribed to the new plan variation on their next billing
day.
**Constraints**: *Minimum Length*: `1` | getOldPlanVariationId(): string | setOldPlanVariationId(string oldPlanVariationId): void | -| `locationId` | `string` | Required | The ID of the location to associate with the swapped subscriptions.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | - -## Example (as JSON) - -```json -{ - "location_id": "S8GWD5R9QB376", - "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", - "old_plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H" -} -``` - diff --git a/doc/models/bulk-swap-plan-response.md b/doc/models/bulk-swap-plan-response.md deleted file mode 100644 index d188e967..00000000 --- a/doc/models/bulk-swap-plan-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Bulk Swap Plan Response - -Defines output parameters in a response of the -[BulkSwapPlan](../../doc/apis/subscriptions.md#bulk-swap-plan) endpoint. - -## Structure - -`BulkSwapPlanResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `affectedSubscriptions` | `?int` | Optional | The number of affected subscriptions. | getAffectedSubscriptions(): ?int | setAffectedSubscriptions(?int affectedSubscriptions): void | - -## Example (as JSON) - -```json -{ - "affected_subscriptions": 12, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-update-customer-data.md b/doc/models/bulk-update-customer-data.md deleted file mode 100644 index 86897afb..00000000 --- a/doc/models/bulk-update-customer-data.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Bulk Update Customer Data - -Defines the customer data provided in individual update requests for a -[BulkUpdateCustomers](../../doc/apis/customers.md#bulk-update-customers) operation. - -## Structure - -`BulkUpdateCustomerData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `companyName` | `?string` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `nickname` | `?string` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | getNickname(): ?string | setNickname(?string nickname): void | -| `emailAddress` | `?string` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | An custom note associates with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified. | getBirthday(): ?string | setBirthday(?string birthday): void | -| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void | -| `version` | `?int` | Optional | The current version of the customer profile.

As a best practice, you should include this field to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "given_name": "given_name4", - "family_name": "family_name4", - "company_name": "company_name8", - "nickname": "nickname8", - "email_address": "email_address0" -} -``` - diff --git a/doc/models/bulk-update-customers-request.md b/doc/models/bulk-update-customers-request.md deleted file mode 100644 index 7e040b96..00000000 --- a/doc/models/bulk-update-customers-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Bulk Update Customers Request - -Defines the body parameters that can be included in requests to the -[BulkUpdateCustomers](../../doc/apis/customers.md#bulk-update-customers) endpoint. - -## Structure - -`BulkUpdateCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customers` | [`array`](../../doc/models/bulk-update-customer-data.md) | Required | A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }`
key-value pairs.

Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile
that was created by merging existing profiles, provide the ID of the newly created profile.

Each value contains the updated customer data. Only new or changed fields are required. To add or
update a field, specify the new value. To remove a field, specify `null`. | getCustomers(): array | setCustomers(array customers): void | - -## Example (as JSON) - -```json -{ - "customers": { - "8DDA5NZVBZFGAX0V3HPF81HHE0": { - "email_address": "New.Amelia.Earhart@example.com", - "note": "updated customer note", - "phone_number": null, - "version": 2, - "given_name": "given_name4", - "family_name": "family_name6", - "company_name": "company_name8", - "nickname": "nickname8" - }, - "N18CPRVXR5214XPBBA6BZQWF3C": { - "family_name": "Curie", - "given_name": "Marie", - "version": 0, - "company_name": "company_name8", - "nickname": "nickname8", - "email_address": "email_address0" - } - } -} -``` - diff --git a/doc/models/bulk-update-customers-response.md b/doc/models/bulk-update-customers-response.md deleted file mode 100644 index bb8bea08..00000000 --- a/doc/models/bulk-update-customers-response.md +++ /dev/null @@ -1,135 +0,0 @@ - -# Bulk Update Customers Response - -Defines the fields included in the response body from the -[BulkUpdateCustomers](../../doc/apis/customers.md#bulk-update-customers) endpoint. - -## Structure - -`BulkUpdateCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `responses` | [`?array`](../../doc/models/update-customer-response.md) | Optional | A map of responses that correspond to individual update requests, represented by
key-value pairs.

Each key is the customer ID that was specified for an update request and each value
is the corresponding response.
If the request succeeds, the value is the updated customer profile.
If the request fails, the value contains any errors that occurred during the request. | getResponses(): ?array | setResponses(?array responses): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "responses": { - "8DDA5NZVBZFGAX0V3HPF81HHE0": { - "customer": { - "birthday": "1897-07-24", - "created_at": "2024-01-19T00:27:54.59Z", - "creation_source": "THIRD_PARTY", - "email_address": "New.Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", - "note": "updated customer note", - "preferences": { - "email_unsubscribed": false - }, - "updated_at": "2024-01-19T00:38:06Z", - "version": 3, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "N18CPRVXR5214XPBBA6BZQWF3C": { - "customer": { - "created_at": "2024-01-19T00:27:54.59Z", - "creation_source": "THIRD_PARTY", - "family_name": "Curie", - "given_name": "Marie", - "id": "N18CPRVXR5214XPBBA6BZQWF3C", - "preferences": { - "email_unsubscribed": false - }, - "updated_at": "2024-01-19T00:38:06Z", - "version": 1, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-update-team-members-request.md b/doc/models/bulk-update-team-members-request.md deleted file mode 100644 index 097bd4f6..00000000 --- a/doc/models/bulk-update-team-members-request.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Bulk Update Team Members Request - -Represents a bulk update request for `TeamMember` objects. - -## Structure - -`BulkUpdateTeamMembersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMembers` | [`array`](../../doc/models/update-team-member-request.md) | Required | The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`.
The maximum number of update objects is 25.

For each team member, include the fields to add, change, or clear. Fields can be cleared using a null value.
To update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed,
call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values. | getTeamMembers(): array | setTeamMembers(array teamMembers): void | - -## Example (as JSON) - -```json -{ - "team_members": { - "AFMwA08kR-MIF-3Vs0OE": { - "team_member": { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "email_address": "jane_smith@gmail.com", - "family_name": "Smith", - "given_name": "Jane", - "is_owner": false, - "phone_number": "+14159223334", - "reference_id": "reference_id_2", - "status": "ACTIVE", - "id": "id6" - } - }, - "fpgteZNMaf0qOK-a4t6P": { - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "YSGH2WBKG94QZ", - "GA2Y9HSJ8KRYT" - ] - }, - "email_address": "joe_doe@gmail.com", - "family_name": "Doe", - "given_name": "Joe", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "id": "id6" - } - } - } -} -``` - diff --git a/doc/models/bulk-update-team-members-response.md b/doc/models/bulk-update-team-members-response.md deleted file mode 100644 index b26a4b51..00000000 --- a/doc/models/bulk-update-team-members-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# Bulk Update Team Members Response - -Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. - -## Structure - -`BulkUpdateTeamMembersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMembers` | [`?array`](../../doc/models/update-team-member-response.md) | Optional | The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`. | getTeamMembers(): ?array | setTeamMembers(?array teamMembers): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_members": { - "AFMwA08kR-MIF-3Vs0OE": { - "team_member": { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:00Z", - "email_address": "jane_smith@example.com", - "family_name": "Smith", - "given_name": "Jane", - "id": "AFMwA08kR-MIF-3Vs0OE", - "is_owner": false, - "phone_number": "+14159223334", - "reference_id": "reference_id_2", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:18:00Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "fpgteZNMaf0qOK-a4t6P": { - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "GA2Y9HSJ8KRYT", - "YSGH2WBKG94QZ" - ] - }, - "created_at": "2020-03-24T18:14:00Z", - "email_address": "joe_doe@example.com", - "family_name": "Doe", - "given_name": "Joe", - "id": "fpgteZNMaf0qOK-a4t6P", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:18:00Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-update-vendors-request.md b/doc/models/bulk-update-vendors-request.md deleted file mode 100644 index 00c3d1c5..00000000 --- a/doc/models/bulk-update-vendors-request.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Bulk Update Vendors Request - -Represents an input to a call to [BulkUpdateVendors](../../doc/apis/vendors.md#bulk-update-vendors). - -## Structure - -`BulkUpdateVendorsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `vendors` | [`array`](../../doc/models/update-vendor-request.md) | Required | A set of [UpdateVendorRequest](entity:UpdateVendorRequest) objects encapsulating to-be-updated [Vendor](entity:Vendor)
objects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorRequest`-object pairs. | getVendors(): array | setVendors(array vendors): void | - -## Example (as JSON) - -```json -{ - "vendors": { - "key0": { - "idempotency_key": "idempotency_key4", - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - }, - "key1": { - "idempotency_key": "idempotency_key4", - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - }, - "key2": { - "idempotency_key": "idempotency_key4", - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - } - } -} -``` - diff --git a/doc/models/bulk-update-vendors-response.md b/doc/models/bulk-update-vendors-response.md deleted file mode 100644 index 160df74c..00000000 --- a/doc/models/bulk-update-vendors-response.md +++ /dev/null @@ -1,139 +0,0 @@ - -# Bulk Update Vendors Response - -Represents an output from a call to [BulkUpdateVendors](../../doc/apis/vendors.md#bulk-update-vendors). - -## Structure - -`BulkUpdateVendorsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | getErrors(): ?array | setErrors(?array errors): void | -| `responses` | [`?array`](../../doc/models/update-vendor-response.md) | Optional | A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)
objects or error responses for failed attempts. The set is represented by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or
`Vendor`-ID/error-object pairs. | getResponses(): ?array | setResponses(?array responses): void | - -## Example (as JSON) - -```json -{ - "responses": { - "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A": { - "vendor": { - "address": { - "address_line_1": "202 Mill St", - "administrative_district_level_1": "NJ", - "country": "US", - "locality": "Moorestown", - "postal_code": "08057", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "contacts": [ - { - "email_address": "annie@annieshotsauce.com", - "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4", - "name": "Annie Thomas", - "ordinal": 0, - "phone_number": "1-212-555-4250" - } - ], - "created_at": "2022-03-16T10:21:54.859Z", - "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A", - "name": "Annie’s Hot Sauce", - "status": "ACTIVE", - "updated_at": "2022-03-16T20:21:54.859Z", - "version": 11 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { - "vendor": { - "account_number": "4025391", - "address": { - "address_line_1": "505 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "contacts": [ - { - "email_address": "joe@joesfreshseafood.com", - "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", - "name": "Joe Burrow", - "ordinal": 0, - "phone_number": "1-212-555-4250" - } - ], - "created_at": "2022-03-16T10:10:54.859Z", - "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", - "name": "Joe's Fresh Seafood", - "note": "favorite vendor", - "status": "ACTIVE", - "updated_at": "2022-03-16T20:21:54.859Z", - "version": 31 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-booking-custom-attributes-request.md b/doc/models/bulk-upsert-booking-custom-attributes-request.md deleted file mode 100644 index 757c086c..00000000 --- a/doc/models/bulk-upsert-booking-custom-attributes-request.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Bulk Upsert Booking Custom Attributes Request - -Represents a [BulkUpsertBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) request. - -## Structure - -`BulkUpsertBookingCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/booking-custom-attribute-upsert-request.md) | Required | A map containing 1 to 25 individual upsert requests. For each request, provide an
arbitrary ID that is unique for this `BulkUpsertBookingCustomAttributes` request and the
information needed to create or update a custom attribute. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "booking_id": "booking_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - }, - "key1": { - "booking_id": "booking_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - } - } -} -``` - diff --git a/doc/models/bulk-upsert-booking-custom-attributes-response.md b/doc/models/bulk-upsert-booking-custom-attributes-response.md deleted file mode 100644 index d1c7a1d6..00000000 --- a/doc/models/bulk-upsert-booking-custom-attributes-response.md +++ /dev/null @@ -1,142 +0,0 @@ - -# Bulk Upsert Booking Custom Attributes Response - -Represents a [BulkUpsertBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) response, -which contains a map of responses that each corresponds to an individual upsert request. - -## Structure - -`BulkUpsertBookingCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?array`](../../doc/models/booking-custom-attribute-upsert-response.md) | Optional | A map of responses that correspond to individual upsert requests. Each response has the
same ID as the corresponding request and contains either a `booking_id` and `custom_attribute` or an `errors` field. | getValues(): ?array | setValues(?array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "booking_id": "booking_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "key1": { - "booking_id": "booking_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "key2": { - "booking_id": "booking_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md deleted file mode 100644 index 3c0da39f..00000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert Request - -Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) -request. An individual request contains a customer ID, the custom attribute to create or update, -and an optional idempotency key. - -## Structure - -`BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `string` | Required | The ID of the target [customer profile](entity:Customer).
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this individual upsert request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key8" -} -``` - diff --git a/doc/models/bulk-upsert-customer-custom-attributes-request.md b/doc/models/bulk-upsert-customer-custom-attributes-request.md deleted file mode 100644 index bc607880..00000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Customer Custom Attributes Request - -Represents a [BulkUpsertCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) request. - -## Structure - -`BulkUpsertCustomerCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md) | Required | A map containing 1 to 25 individual upsert requests. For each request, provide an
arbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the
information needed to create or update a custom attribute. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "customer_id": "customer_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - } - } -} -``` - diff --git a/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md deleted file mode 100644 index 13e227ec..00000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert Response - -Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) operation. - -## Structure - -`BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `?string` | Optional | The ID of the customer profile associated with the custom attribute. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-customer-custom-attributes-response.md b/doc/models/bulk-upsert-customer-custom-attributes-response.md deleted file mode 100644 index 8362ad5a..00000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-response.md +++ /dev/null @@ -1,154 +0,0 @@ - -# Bulk Upsert Customer Custom Attributes Response - -Represents a [BulkUpsertCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) response, -which contains a map of responses that each corresponds to an individual upsert request. - -## Structure - -`BulkUpsertCustomerCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?array`](../../doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md) | Optional | A map of responses that correspond to individual upsert requests. Each response has the
same ID as the corresponding request and contains either a `customer_id` and `custom_attribute` or an `errors` field. | getValues(): ?array | setValues(?array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "customer_id": "customer_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "key1": { - "customer_id": "customer_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "key2": { - "customer_id": "customer_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md deleted file mode 100644 index 99585fe5..00000000 --- a/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert Request - -Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) -request. An individual request contains a location ID, the custom attribute to create or update, -and an optional idempotency key. - -## Structure - -`BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The ID of the target [location](entity:Location).
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this individual upsert request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id2", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/bulk-upsert-location-custom-attributes-request.md b/doc/models/bulk-upsert-location-custom-attributes-request.md deleted file mode 100644 index 61bc2a4e..00000000 --- a/doc/models/bulk-upsert-location-custom-attributes-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Location Custom Attributes Request - -Represents a [BulkUpsertLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) request. - -## Structure - -`BulkUpsertLocationCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md) | Required | A map containing 1 to 25 individual upsert requests. For each request, provide an
arbitrary ID that is unique for this `BulkUpsertLocationCustomAttributes` request and the
information needed to create or update a custom attribute. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "location_id": "location_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - } - } -} -``` - diff --git a/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md deleted file mode 100644 index 2058dbd8..00000000 --- a/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert Response - -Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) operation. - -## Structure - -`BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the location associated with the custom attribute. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-location-custom-attributes-response.md b/doc/models/bulk-upsert-location-custom-attributes-response.md deleted file mode 100644 index 9ea1714d..00000000 --- a/doc/models/bulk-upsert-location-custom-attributes-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Bulk Upsert Location Custom Attributes Response - -Represents a [BulkUpsertLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#bulk-upsert-location-custom-attributes) response, -which contains a map of responses that each corresponds to an individual upsert request. - -## Structure - -`BulkUpsertLocationCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?array`](../../doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md) | Optional | A map of responses that correspond to individual upsert requests. Each response has the
same ID as the corresponding request and contains either a `location_id` and `custom_attribute` or an `errors` field. | getValues(): ?array | setValues(?array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "location_id": "location_id4", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md deleted file mode 100644 index 43bc39fd..00000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert Request - -Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) -request. An individual request contains a merchant ID, the custom attribute to create or update, -and an optional idempotency key. - -## Structure - -`BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `merchantId` | `string` | Required | The ID of the target [merchant](entity:Merchant).
**Constraints**: *Minimum Length*: `1` | getMerchantId(): string | setMerchantId(string merchantId): void | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this individual upsert request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "merchant_id": "merchant_id8", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/bulk-upsert-merchant-custom-attributes-request.md b/doc/models/bulk-upsert-merchant-custom-attributes-request.md deleted file mode 100644 index d9df80e0..00000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-request.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Bulk Upsert Merchant Custom Attributes Request - -Represents a [BulkUpsertMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) request. - -## Structure - -`BulkUpsertMerchantCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md) | Required | A map containing 1 to 25 individual upsert requests. For each request, provide an
arbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the
information needed to create or update a custom attribute. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - }, - "key1": { - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - }, - "key2": { - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" - } - } -} -``` - diff --git a/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md deleted file mode 100644 index 99482af9..00000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert Response - -Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) operation. - -## Structure - -`BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `merchantId` | `?string` | Optional | The ID of the merchant associated with the custom attribute. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-merchant-custom-attributes-response.md b/doc/models/bulk-upsert-merchant-custom-attributes-response.md deleted file mode 100644 index a9588a76..00000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# Bulk Upsert Merchant Custom Attributes Response - -Represents a [BulkUpsertMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) response, -which contains a map of responses that each corresponds to an individual upsert request. - -## Structure - -`BulkUpsertMerchantCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?array`](../../doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md) | Optional | A map of responses that correspond to individual upsert requests. Each response has the
same ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or an `errors` field. | getValues(): ?array | setValues(?array values): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - }, - "key1": { - "merchant_id": "merchant_id0", - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md b/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md deleted file mode 100644 index afdedc2d..00000000 --- a/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute - -Represents one upsert within the bulk operation. - -## Structure - -`BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `orderId` | `string` | Required | The ID of the target [order](entity:Order).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getOrderId(): string | setOrderId(string orderId): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4", - "order_id": "order_id2" -} -``` - diff --git a/doc/models/bulk-upsert-order-custom-attributes-request.md b/doc/models/bulk-upsert-order-custom-attributes-request.md deleted file mode 100644 index c62d98ba..00000000 --- a/doc/models/bulk-upsert-order-custom-attributes-request.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Request - -Represents a bulk upsert request for one or more order custom attributes. - -## Structure - -`BulkUpsertOrderCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`array`](../../doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md) | Required | A map of requests that correspond to individual upsert operations for custom attributes. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "values": { - "key0": { - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6", - "order_id": "order_id4" - }, - "key1": { - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6", - "order_id": "order_id4" - }, - "key2": { - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6", - "order_id": "order_id4" - } - } -} -``` - diff --git a/doc/models/bulk-upsert-order-custom-attributes-response.md b/doc/models/bulk-upsert-order-custom-attributes-response.md deleted file mode 100644 index 235ca68c..00000000 --- a/doc/models/bulk-upsert-order-custom-attributes-response.md +++ /dev/null @@ -1,74 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Response - -Represents a response from a bulk upsert of order custom attributes. - -## Structure - -`BulkUpsertOrderCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `values` | [`array`](../../doc/models/upsert-order-custom-attribute-response.md) | Required | A map of responses that correspond to individual upsert operations for custom attributes. | getValues(): array | setValues(array values): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "values": { - "key0": { - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] - } - } -} -``` - diff --git a/doc/models/business-appointment-settings-alignment-time.md b/doc/models/business-appointment-settings-alignment-time.md deleted file mode 100644 index 65cf656f..00000000 --- a/doc/models/business-appointment-settings-alignment-time.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Business Appointment Settings Alignment Time - -Time units of a service duration for bookings. - -## Enumeration - -`BusinessAppointmentSettingsAlignmentTime` - -## Fields - -| Name | Description | -| --- | --- | -| `SERVICE_DURATION` | The service duration unit is one visit of a fixed time interval specified by the seller. | -| `QUARTER_HOURLY` | The service duration unit is a 15-minute interval. Bookings can be scheduled every quarter hour. | -| `HALF_HOURLY` | The service duration unit is a 30-minute interval. Bookings can be scheduled every half hour. | -| `HOURLY` | The service duration unit is a 60-minute interval. Bookings can be scheduled every hour. | - diff --git a/doc/models/business-appointment-settings-booking-location-type.md b/doc/models/business-appointment-settings-booking-location-type.md deleted file mode 100644 index 5bf90605..00000000 --- a/doc/models/business-appointment-settings-booking-location-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Business Appointment Settings Booking Location Type - -Supported types of location where service is provided. - -## Enumeration - -`BusinessAppointmentSettingsBookingLocationType` - -## Fields - -| Name | Description | -| --- | --- | -| `BUSINESS_LOCATION` | The service is provided at a seller location. | -| `CUSTOMER_LOCATION` | The service is provided at a customer location. | -| `PHONE` | The service is provided over the phone. | - diff --git a/doc/models/business-appointment-settings-cancellation-policy.md b/doc/models/business-appointment-settings-cancellation-policy.md deleted file mode 100644 index 37710f62..00000000 --- a/doc/models/business-appointment-settings-cancellation-policy.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Appointment Settings Cancellation Policy - -The category of the seller’s cancellation policy. - -## Enumeration - -`BusinessAppointmentSettingsCancellationPolicy` - -## Fields - -| Name | Description | -| --- | --- | -| `CANCELLATION_TREATED_AS_NO_SHOW` | Cancellations are treated as no shows and may incur a fee as specified by `cancellation_fee_money`. | -| `CUSTOM_POLICY` | Cancellations follow the seller-specified policy that is described in free-form text and not enforced automatically by Square. | - diff --git a/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md b/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md deleted file mode 100644 index 7ce1edea..00000000 --- a/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Appointment Settings Max Appointments Per Day Limit Type - -Types of daily appointment limits. - -## Enumeration - -`BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType` - -## Fields - -| Name | Description | -| --- | --- | -| `PER_TEAM_MEMBER` | The maximum number of daily appointments is set on a per team member basis. | -| `PER_LOCATION` | The maximum number of daily appointments is set on a per location basis. | - diff --git a/doc/models/business-appointment-settings.md b/doc/models/business-appointment-settings.md deleted file mode 100644 index baef9b75..00000000 --- a/doc/models/business-appointment-settings.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Business Appointment Settings - -The service appointment settings, including where and how the service is provided. - -## Structure - -`BusinessAppointmentSettings` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationTypes` | [`?(string(BusinessAppointmentSettingsBookingLocationType)[])`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Types of the location allowed for bookings.
See [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values | getLocationTypes(): ?array | setLocationTypes(?array locationTypes): void | -| `alignmentTime` | [`?string(BusinessAppointmentSettingsAlignmentTime)`](../../doc/models/business-appointment-settings-alignment-time.md) | Optional | Time units of a service duration for bookings. | getAlignmentTime(): ?string | setAlignmentTime(?string alignmentTime): void | -| `minBookingLeadTimeSeconds` | `?int` | Optional | The minimum lead time in seconds before a service can be booked. A booking must be created at least this amount of time before its starting time. | getMinBookingLeadTimeSeconds(): ?int | setMinBookingLeadTimeSeconds(?int minBookingLeadTimeSeconds): void | -| `maxBookingLeadTimeSeconds` | `?int` | Optional | The maximum lead time in seconds before a service can be booked. A booking must be created at most this amount of time before its starting time. | getMaxBookingLeadTimeSeconds(): ?int | setMaxBookingLeadTimeSeconds(?int maxBookingLeadTimeSeconds): void | -| `anyTeamMemberBookingEnabled` | `?bool` | Optional | Indicates whether a customer can choose from all available time slots and have a staff member assigned
automatically (`true`) or not (`false`). | getAnyTeamMemberBookingEnabled(): ?bool | setAnyTeamMemberBookingEnabled(?bool anyTeamMemberBookingEnabled): void | -| `multipleServiceBookingEnabled` | `?bool` | Optional | Indicates whether a customer can book multiple services in a single online booking. | getMultipleServiceBookingEnabled(): ?bool | setMultipleServiceBookingEnabled(?bool multipleServiceBookingEnabled): void | -| `maxAppointmentsPerDayLimitType` | [`?string(BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType)`](../../doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md) | Optional | Types of daily appointment limits. | getMaxAppointmentsPerDayLimitType(): ?string | setMaxAppointmentsPerDayLimitType(?string maxAppointmentsPerDayLimitType): void | -| `maxAppointmentsPerDayLimit` | `?int` | Optional | The maximum number of daily appointments per team member or per location. | getMaxAppointmentsPerDayLimit(): ?int | setMaxAppointmentsPerDayLimit(?int maxAppointmentsPerDayLimit): void | -| `cancellationWindowSeconds` | `?int` | Optional | The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. | getCancellationWindowSeconds(): ?int | setCancellationWindowSeconds(?int cancellationWindowSeconds): void | -| `cancellationFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCancellationFeeMoney(): ?Money | setCancellationFeeMoney(?Money cancellationFeeMoney): void | -| `cancellationPolicy` | [`?string(BusinessAppointmentSettingsCancellationPolicy)`](../../doc/models/business-appointment-settings-cancellation-policy.md) | Optional | The category of the seller’s cancellation policy. | getCancellationPolicy(): ?string | setCancellationPolicy(?string cancellationPolicy): void | -| `cancellationPolicyText` | `?string` | Optional | The free-form text of the seller's cancellation policy.
**Constraints**: *Maximum Length*: `65536` | getCancellationPolicyText(): ?string | setCancellationPolicyText(?string cancellationPolicyText): void | -| `skipBookingFlowStaffSelection` | `?bool` | Optional | Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`). | getSkipBookingFlowStaffSelection(): ?bool | setSkipBookingFlowStaffSelection(?bool skipBookingFlowStaffSelection): void | - -## Example (as JSON) - -```json -{ - "location_types": [ - "PHONE" - ], - "alignment_time": "SERVICE_DURATION", - "min_booking_lead_time_seconds": 88, - "max_booking_lead_time_seconds": 98, - "any_team_member_booking_enabled": false -} -``` - diff --git a/doc/models/business-booking-profile-booking-policy.md b/doc/models/business-booking-profile-booking-policy.md deleted file mode 100644 index 5104c348..00000000 --- a/doc/models/business-booking-profile-booking-policy.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Booking Profile Booking Policy - -Policies for accepting bookings. - -## Enumeration - -`BusinessBookingProfileBookingPolicy` - -## Fields - -| Name | Description | -| --- | --- | -| `ACCEPT_ALL` | The seller accepts all booking requests automatically. | -| `REQUIRES_ACCEPTANCE` | The seller must accept requests to complete bookings. | - diff --git a/doc/models/business-booking-profile-customer-timezone-choice.md b/doc/models/business-booking-profile-customer-timezone-choice.md deleted file mode 100644 index a2c12282..00000000 --- a/doc/models/business-booking-profile-customer-timezone-choice.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Booking Profile Customer Timezone Choice - -Choices of customer-facing time zone used for bookings. - -## Enumeration - -`BusinessBookingProfileCustomerTimezoneChoice` - -## Fields - -| Name | Description | -| --- | --- | -| `BUSINESS_LOCATION_TIMEZONE` | Use the time zone of the business location for bookings. | -| `CUSTOMER_CHOICE` | Use the customer-chosen time zone for bookings. | - diff --git a/doc/models/business-booking-profile.md b/doc/models/business-booking-profile.md deleted file mode 100644 index 48fa3abe..00000000 --- a/doc/models/business-booking-profile.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Business Booking Profile - -A seller's business booking profile, including booking policy, appointment settings, etc. - -## Structure - -`BusinessBookingProfile` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sellerId` | `?string` | Optional | The ID of the seller, obtainable using the Merchants API.
**Constraints**: *Maximum Length*: `32` | getSellerId(): ?string | setSellerId(?string sellerId): void | -| `createdAt` | `?string` | Optional | The RFC 3339 timestamp specifying the booking's creation time. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `bookingEnabled` | `?bool` | Optional | Indicates whether the seller is open for booking. | getBookingEnabled(): ?bool | setBookingEnabled(?bool bookingEnabled): void | -| `customerTimezoneChoice` | [`?string(BusinessBookingProfileCustomerTimezoneChoice)`](../../doc/models/business-booking-profile-customer-timezone-choice.md) | Optional | Choices of customer-facing time zone used for bookings. | getCustomerTimezoneChoice(): ?string | setCustomerTimezoneChoice(?string customerTimezoneChoice): void | -| `bookingPolicy` | [`?string(BusinessBookingProfileBookingPolicy)`](../../doc/models/business-booking-profile-booking-policy.md) | Optional | Policies for accepting bookings. | getBookingPolicy(): ?string | setBookingPolicy(?string bookingPolicy): void | -| `allowUserCancel` | `?bool` | Optional | Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). | getAllowUserCancel(): ?bool | setAllowUserCancel(?bool allowUserCancel): void | -| `businessAppointmentSettings` | [`?BusinessAppointmentSettings`](../../doc/models/business-appointment-settings.md) | Optional | The service appointment settings, including where and how the service is provided. | getBusinessAppointmentSettings(): ?BusinessAppointmentSettings | setBusinessAppointmentSettings(?BusinessAppointmentSettings businessAppointmentSettings): void | -| `supportSellerLevelWrites` | `?bool` | Optional | Indicates whether the seller's subscription to Square Appointments supports creating, updating or canceling an appointment through the API (`true`) or not (`false`) using seller permission. | getSupportSellerLevelWrites(): ?bool | setSupportSellerLevelWrites(?bool supportSellerLevelWrites): void | - -## Example (as JSON) - -```json -{ - "seller_id": "seller_id8", - "created_at": "created_at8", - "booking_enabled": false, - "customer_timezone_choice": "BUSINESS_LOCATION_TIMEZONE", - "booking_policy": "ACCEPT_ALL" -} -``` - diff --git a/doc/models/business-hours-period.md b/doc/models/business-hours-period.md deleted file mode 100644 index ebd9f8e4..00000000 --- a/doc/models/business-hours-period.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Business Hours Period - -Represents a period of time during which a business location is open. - -## Structure - -`BusinessHoursPeriod` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `dayOfWeek` | [`?string(DayOfWeek)`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | getDayOfWeek(): ?string | setDayOfWeek(?string dayOfWeek): void | -| `startLocalTime` | `?string` | Optional | The start time of a business hours period, specified in local time using partial-time
RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | getStartLocalTime(): ?string | setStartLocalTime(?string startLocalTime): void | -| `endLocalTime` | `?string` | Optional | The end time of a business hours period, specified in local time using partial-time
RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | getEndLocalTime(): ?string | setEndLocalTime(?string endLocalTime): void | - -## Example (as JSON) - -```json -{ - "day_of_week": "SUN", - "start_local_time": "start_local_time2", - "end_local_time": "end_local_time4" -} -``` - diff --git a/doc/models/business-hours.md b/doc/models/business-hours.md deleted file mode 100644 index a6b64dd2..00000000 --- a/doc/models/business-hours.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Business Hours - -The hours of operation for a location. - -## Structure - -`BusinessHours` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `periods` | [`?(BusinessHoursPeriod[])`](../../doc/models/business-hours-period.md) | Optional | The list of time periods during which the business is open. There can be at most 10 periods per day. | getPeriods(): ?array | setPeriods(?array periods): void | - -## Example (as JSON) - -```json -{ - "periods": [ - { - "day_of_week": "WED", - "start_local_time": "start_local_time4", - "end_local_time": "end_local_time6" - }, - { - "day_of_week": "WED", - "start_local_time": "start_local_time4", - "end_local_time": "end_local_time6" - }, - { - "day_of_week": "WED", - "start_local_time": "start_local_time4", - "end_local_time": "end_local_time6" - } - ] -} -``` - diff --git a/doc/models/buy-now-pay-later-details.md b/doc/models/buy-now-pay-later-details.md deleted file mode 100644 index ead35c70..00000000 --- a/doc/models/buy-now-pay-later-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Buy Now Pay Later Details - -Additional details about a Buy Now Pay Later payment type. - -## Structure - -`BuyNowPayLaterDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `brand` | `?string` | Optional | The brand used for the Buy Now Pay Later payment.
The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getBrand(): ?string | setBrand(?string brand): void | -| `afterpayDetails` | [`?AfterpayDetails`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. | getAfterpayDetails(): ?AfterpayDetails | setAfterpayDetails(?AfterpayDetails afterpayDetails): void | -| `clearpayDetails` | [`?ClearpayDetails`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. | getClearpayDetails(): ?ClearpayDetails | setClearpayDetails(?ClearpayDetails clearpayDetails): void | - -## Example (as JSON) - -```json -{ - "brand": "brand6", - "afterpay_details": { - "email_address": "email_address4" - }, - "clearpay_details": { - "email_address": "email_address4" - } -} -``` - diff --git a/doc/models/calculate-loyalty-points-request.md b/doc/models/calculate-loyalty-points-request.md deleted file mode 100644 index fbc53cb5..00000000 --- a/doc/models/calculate-loyalty-points-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Calculate Loyalty Points Request - -Represents a [CalculateLoyaltyPoints](../../doc/apis/loyalty.md#calculate-loyalty-points) request. - -## Structure - -`CalculateLoyaltyPointsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The [order](entity:Order) ID for which to calculate the points.
Specify this field if your application uses the Orders API to process orders.
Otherwise, specify the `transaction_amount_money`. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `transactionAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTransactionAmountMoney(): ?Money | setTransactionAmountMoney(?Money transactionAmountMoney): void | -| `loyaltyAccountId` | `?string` | Optional | The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field
if your application uses the Orders API to process orders.

If specified, the `promotion_points` field in the response shows the number of points the buyer would
earn from the purchase. In this case, Square uses the account ID to determine whether the promotion's
`trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been reached.
If not specified, the `promotion_points` field shows the number of points the purchase qualifies
for regardless of the trigger limit.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): ?string | setLoyaltyAccountId(?string loyaltyAccountId): void | - -## Example (as JSON) - -```json -{ - "loyalty_account_id": "79b807d2-d786-46a9-933b-918028d7a8c5", - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - "transaction_amount_money": { - "amount": 64, - "currency": "ANG" - } -} -``` - diff --git a/doc/models/calculate-loyalty-points-response.md b/doc/models/calculate-loyalty-points-response.md deleted file mode 100644 index 7d43495f..00000000 --- a/doc/models/calculate-loyalty-points-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Calculate Loyalty Points Response - -Represents a [CalculateLoyaltyPoints](../../doc/apis/loyalty.md#calculate-loyalty-points) response. - -## Structure - -`CalculateLoyaltyPointsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `points` | `?int` | Optional | The number of points that the buyer can earn from the base loyalty program. | getPoints(): ?int | setPoints(?int points): void | -| `promotionPoints` | `?int` | Optional | The number of points that the buyer can earn from a loyalty promotion. To be eligible
to earn promotion points, the purchase must first qualify for program points. When `order_id`
is not provided in the request, this value is always 0. | getPromotionPoints(): ?int | setPromotionPoints(?int promotionPoints): void | - -## Example (as JSON) - -```json -{ - "points": 6, - "promotion_points": 12, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/calculate-order-request.md b/doc/models/calculate-order-request.md deleted file mode 100644 index b6b80a5f..00000000 --- a/doc/models/calculate-order-request.md +++ /dev/null @@ -1,98 +0,0 @@ - -# Calculate Order Request - -## Structure - -`CalculateOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`Order`](../../doc/models/order.md) | Required | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): Order | setOrder(Order order): void | -| `proposedRewards` | [`?(OrderReward[])`](../../doc/models/order-reward.md) | Optional | Identifies one or more loyalty reward tiers to apply during the order calculation.
The discounts defined by the reward tiers are added to the order only to preview the
effect of applying the specified rewards. The rewards do not correspond to actual
redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are
random strings used only to reference the reward tier. | getProposedRewards(): ?array | setProposedRewards(?array proposedRewards): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "b3e98fe3-b8de-471c-82f1-545f371e637c", - "order": { - "discounts": [ - { - "name": "50% Off", - "percentage": "50", - "scope": "ORDER" - } - ], - "line_items": [ - { - "base_price_money": { - "amount": 500, - "currency": "USD" - }, - "name": "Item 1", - "quantity": "1", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 300, - "currency": "USD" - }, - "name": "Item 2", - "quantity": "2", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "D7AVYMEAPJ3A3", - "id": "id6", - "reference_id": "reference_id4", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4" - }, - "proposed_rewards": [ - { - "id": "id0", - "reward_tier_id": "reward_tier_id6" - } - ] -} -``` - diff --git a/doc/models/calculate-order-response.md b/doc/models/calculate-order-response.md deleted file mode 100644 index 03f5f936..00000000 --- a/doc/models/calculate-order-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Calculate Order Response - -## Structure - -`CalculateOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "order": { - "created_at": "2020-05-18T16:30:49.614Z", - "discounts": [ - { - "applied_money": { - "amount": 550, - "currency": "USD" - }, - "name": "50% Off", - "percentage": "50", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "zGsRZP69aqSSR9lq9euSPB" - } - ], - "line_items": [ - { - "applied_discounts": [ - { - "applied_money": { - "amount": 250, - "currency": "USD" - }, - "discount_uid": "zGsRZP69aqSSR9lq9euSPB", - "uid": "9zr9S4dxvPAixvn0lpa1VC" - } - ], - "base_price_money": { - "amount": 500, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 500, - "currency": "USD" - }, - "name": "Item 1", - "quantity": "1", - "total_discount_money": { - "amount": 250, - "currency": "USD" - }, - "total_money": { - "amount": 250, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "ULkg0tQTRK2bkU9fNv3IJD", - "variation_total_price_money": { - "amount": 500, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "applied_discounts": [ - { - "applied_money": { - "amount": 300, - "currency": "USD" - }, - "discount_uid": "zGsRZP69aqSSR9lq9euSPB", - "uid": "qa8LwwZK82FgSEkQc2HYVC" - } - ], - "base_price_money": { - "amount": 300, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 600, - "currency": "USD" - }, - "name": "Item 2", - "quantity": "2", - "total_discount_money": { - "amount": 300, - "currency": "USD" - }, - "total_money": { - "amount": 300, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "mumY8Nun4BC5aKe2yyx5a", - "variation_total_price_money": { - "amount": 600, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "D7AVYMEAPJ3A3", - "net_amounts": { - "discount_money": { - "amount": 550, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 0, - "currency": "USD" - }, - "tip_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 550, - "currency": "USD" - } - }, - "state": "OPEN", - "total_discount_money": { - "amount": 550, - "currency": "USD" - }, - "total_money": { - "amount": 550, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "total_tip_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2020-05-18T16:30:49.614Z", - "version": 1, - "id": "id6", - "reference_id": "reference_id4", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-booking-request.md b/doc/models/cancel-booking-request.md deleted file mode 100644 index ddb37c25..00000000 --- a/doc/models/cancel-booking-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cancel Booking Request - -## Structure - -`CancelBookingRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `bookingVersion` | `?int` | Optional | The revision number for the booking used for optimistic concurrency. | getBookingVersion(): ?int | setBookingVersion(?int bookingVersion): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key0", - "booking_version": 224 -} -``` - diff --git a/doc/models/cancel-booking-response.md b/doc/models/cancel-booking-response.md deleted file mode 100644 index 60782a4e..00000000 --- a/doc/models/cancel-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Cancel Booking Response - -## Structure - -`CancelBookingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `booking` | [`?Booking`](../../doc/models/booking.md) | Optional | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): ?Booking | setBooking(?Booking booking): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking": { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t" - } - ], - "created_at": "2020-10-28T15:47:41Z", - "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - "customer_note": "", - "id": "zkras0xv0xwswx", - "location_id": "LEQHH0YY8B42M", - "seller_note": "", - "start_at": "2020-11-26T13:00:00Z", - "status": "CANCELLED_BY_CUSTOMER", - "updated_at": "2020-10-28T15:49:25Z", - "version": 1 - }, - "errors": [] -} -``` - diff --git a/doc/models/cancel-invoice-request.md b/doc/models/cancel-invoice-request.md deleted file mode 100644 index 5d31ce1f..00000000 --- a/doc/models/cancel-invoice-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cancel Invoice Request - -Describes a `CancelInvoice` request. - -## Structure - -`CancelInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `int` | Required | The version of the [invoice](entity:Invoice) to cancel.
If you do not know the version, you can call
[GetInvoice](api-endpoint:Invoices-GetInvoice) or [ListInvoices](api-endpoint:Invoices-ListInvoices). | getVersion(): int | setVersion(int version): void | - -## Example (as JSON) - -```json -{ - "version": 0 -} -``` - diff --git a/doc/models/cancel-invoice-response.md b/doc/models/cancel-invoice-response.md deleted file mode 100644 index 4919cbdf..00000000 --- a/doc/models/cancel-invoice-response.md +++ /dev/null @@ -1,112 +0,0 @@ - -# Cancel Invoice Response - -The response returned by the `CancelInvoice` request. - -## Structure - -`CancelInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`?Invoice`](../../doc/models/invoice.md) | Optional | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): ?Invoice | setInvoice(?Invoice invoice): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "CANCELED", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T18:23:11Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-loyalty-promotion-response.md b/doc/models/cancel-loyalty-promotion-response.md deleted file mode 100644 index 3c3dc8b6..00000000 --- a/doc/models/cancel-loyalty-promotion-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# Cancel Loyalty Promotion Response - -Represents a [CancelLoyaltyPromotion](../../doc/apis/loyalty.md#cancel-loyalty-promotion) response. -Either `loyalty_promotion` or `errors` is present in the response. - -## Structure - -`CancelLoyaltyPromotionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyPromotion` | [`?LoyaltyPromotion`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). Loyalty promotions enable buyers
to earn extra points on top of those earned from the base program.

A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. | getLoyaltyPromotion(): ?LoyaltyPromotion | setLoyaltyPromotion(?LoyaltyPromotion loyaltyPromotion): void | - -## Example (as JSON) - -```json -{ - "loyalty_promotion": { - "available_time": { - "start_date": "2022-08-16", - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" - ], - "end_date": "end_date8" - }, - "canceled_at": "2022-08-17T12:42:49Z", - "created_at": "2022-08-16T08:38:54Z", - "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - "incentive": { - "points_multiplier_data": { - "multiplier": "3.000", - "points_multiplier": 3 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "minimum_spend_amount_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "Tuesday Happy Hour Promo", - "qualifying_category_ids": [ - "XTQPYLR3IIU9C44VRCB3XD12" - ], - "status": "CANCELED", - "trigger_limit": { - "interval": "DAY", - "times": 1 - }, - "updated_at": "2022-08-17T12:42:49Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-payment-by-idempotency-key-request.md b/doc/models/cancel-payment-by-idempotency-key-request.md deleted file mode 100644 index 6400337a..00000000 --- a/doc/models/cancel-payment-by-idempotency-key-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Cancel Payment by Idempotency Key Request - -Describes a request to cancel a payment using -[CancelPaymentByIdempotencyKey](../../doc/apis/payments.md#cancel-payment-by-idempotency-key). - -## Structure - -`CancelPaymentByIdempotencyKeyRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | The `idempotency_key` identifying the payment to be canceled.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66" -} -``` - diff --git a/doc/models/cancel-payment-by-idempotency-key-response.md b/doc/models/cancel-payment-by-idempotency-key-response.md deleted file mode 100644 index 23d2c2ff..00000000 --- a/doc/models/cancel-payment-by-idempotency-key-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Cancel Payment by Idempotency Key Response - -Defines the response returned by -[CancelPaymentByIdempotencyKey](../../doc/apis/payments.md#cancel-payment-by-idempotency-key). -On success, `errors` is empty. - -## Structure - -`CancelPaymentByIdempotencyKeyResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-payment-response.md b/doc/models/cancel-payment-response.md deleted file mode 100644 index 3cdf1c3d..00000000 --- a/doc/models/cancel-payment-response.md +++ /dev/null @@ -1,98 +0,0 @@ - -# Cancel Payment Response - -Defines the response returned by [CancelPayment](../../doc/apis/payments.md#cancel-payment). - -## Structure - -`CancelPaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | - -## Example (as JSON) - -```json -{ - "payment": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", - "square_product": "ECOMMERCE_API" - }, - "approved_money": { - "amount": 1000, - "currency": "USD" - }, - "card_details": { - "auth_result_code": "68aLBM", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T20:26:44.364Z", - "voided_at": "2021-10-13T20:31:21.597Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "ON_FILE", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "VOIDED" - }, - "created_at": "2021-10-13T20:26:44.191Z", - "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T20:26:44.191Z", - "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", - "location_id": "L88917AVBK2S5", - "note": "Example Note", - "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", - "risk_evaluation": { - "created_at": "2021-10-13T20:26:45.271Z", - "risk_level": "NORMAL" - }, - "source_type": "CARD", - "status": "CANCELED", - "tip_money": { - "amount": 100, - "currency": "USD" - }, - "total_money": { - "amount": 1100, - "currency": "USD" - }, - "updated_at": "2021-10-13T20:31:21.597Z", - "version_token": "N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-subscription-response.md b/doc/models/cancel-subscription-response.md deleted file mode 100644 index f904b4cb..00000000 --- a/doc/models/cancel-subscription-response.md +++ /dev/null @@ -1,146 +0,0 @@ - -# Cancel Subscription Response - -Defines output parameters in a response from the -[CancelSubscription](../../doc/apis/subscriptions.md#cancel-subscription) endpoint. - -## Structure - -`CancelSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a single `CANCEL` action scheduled for the subscription. | getActions(): ?array | setActions(?array actions): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "canceled_date": "2023-06-05", - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "created_at": "2022-01-19T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "910afd30-464a-4e00-a8d8-2296e", - "invoice_ids": [ - "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" - ], - "location_id": "S8GWD5R9QB376", - "paid_until_date": "2023-12-31", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2022-01-19", - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 3 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "actions": [ - { - "id": "id8", - "type": "RESUME", - "effective_date": "effective_date8", - "monthly_billing_anchor_date": 186, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "id": "id8", - "type": "RESUME", - "effective_date": "effective_date8", - "monthly_billing_anchor_date": 186, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "id": "id8", - "type": "RESUME", - "effective_date": "effective_date8", - "monthly_billing_anchor_date": 186, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - } - ] -} -``` - diff --git a/doc/models/cancel-terminal-action-response.md b/doc/models/cancel-terminal-action-response.md deleted file mode 100644 index 353d4692..00000000 --- a/doc/models/cancel-terminal-action-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Cancel Terminal Action Response - -## Structure - -`CancelTerminalActionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void | - -## Example (as JSON) - -```json -{ - "action": { - "app_id": "APP_ID", - "cancel_reason": "SELLER_CANCELED", - "created_at": "2021-07-28T23:22:07.476Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:jveJIAkkAjILHkdCE", - "location_id": "LOCATION_ID", - "save_card_options": { - "customer_id": "CUSTOMER_ID", - "reference_id": "user-id-1" - }, - "status": "CANCELED", - "type": "SAVE_CARD", - "updated_at": "2021-07-28T23:22:29.511Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-terminal-checkout-response.md b/doc/models/cancel-terminal-checkout-response.md deleted file mode 100644 index ffc3d935..00000000 --- a/doc/models/cancel-terminal-checkout-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# Cancel Terminal Checkout Response - -## Structure - -`CancelTerminalCheckoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `checkout` | [`?TerminalCheckout`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | getCheckout(): ?TerminalCheckout | setCheckout(?TerminalCheckout checkout): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "amount_money": { - "amount": 123, - "currency": "USD" - }, - "app_id": "APP_ID", - "cancel_reason": "SELLER_CANCELED", - "created_at": "2020-03-16T15:31:19.934Z", - "deadline_duration": "PT5M", - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": true, - "tip_settings": { - "allow_tipping": true, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "collect_signature": false, - "show_itemized_cart": false - }, - "id": "S1yDlPQx7slqO", - "location_id": "LOCATION_ID", - "reference_id": "id36815", - "status": "CANCELED", - "updated_at": "2020-03-16T15:31:45.787Z", - "note": "note8", - "order_id": "order_id6", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/cancel-terminal-refund-response.md b/doc/models/cancel-terminal-refund-response.md deleted file mode 100644 index 38cd2b2f..00000000 --- a/doc/models/cancel-terminal-refund-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Cancel Terminal Refund Response - -## Structure - -`CancelTerminalRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?TerminalRefund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | getRefund(): ?TerminalRefund | setRefund(?TerminalRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 100, - "currency": "CAD" - }, - "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", - "cancel_reason": "SELLER_CANCELED", - "card": { - "bin": "411111", - "card_brand": "INTERAC", - "card_type": "CREDIT", - "exp_month": 1, - "exp_year": 2022, - "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", - "last_4": "1111" - }, - "created_at": "2020-10-21T22:47:23.241Z", - "deadline_duration": "PT5M", - "device_id": "42690809-faa2-4701-a24b-19d3d34c9aaa", - "id": "g6ycb6HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "location_id": "76C9W6K8CNNQ5", - "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", - "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "reason": "reason", - "status": "CANCELED", - "updated_at": "2020-10-21T22:47:30.096Z", - "refund_id": "refund_id2" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/capture-transaction-response.md b/doc/models/capture-transaction-response.md deleted file mode 100644 index 73e35d48..00000000 --- a/doc/models/capture-transaction-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Capture Transaction Response - -Defines the fields that are included in the response body of -a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. - -## Structure - -`CaptureTransactionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md deleted file mode 100644 index 01ab8473..00000000 --- a/doc/models/card-brand.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Card Brand - -Indicates a card's brand, such as `VISA` or `MASTERCARD`. - -## Enumeration - -`CardBrand` - -## Fields - -| Name | -| --- | -| `OTHER_BRAND` | -| `VISA` | -| `MASTERCARD` | -| `AMERICAN_EXPRESS` | -| `DISCOVER` | -| `DISCOVER_DINERS` | -| `JCB` | -| `CHINA_UNIONPAY` | -| `SQUARE_GIFT_CARD` | -| `SQUARE_CAPITAL_CARD` | -| `INTERAC` | -| `EFTPOS` | -| `FELICA` | -| `EBT` | - diff --git a/doc/models/card-co-brand.md b/doc/models/card-co-brand.md deleted file mode 100644 index 8e5872da..00000000 --- a/doc/models/card-co-brand.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Co Brand - -Indicates the brand for a co-branded card. - -## Enumeration - -`CardCoBrand` - -## Fields - -| Name | -| --- | -| `UNKNOWN` | -| `AFTERPAY` | -| `CLEARPAY` | - diff --git a/doc/models/card-payment-details.md b/doc/models/card-payment-details.md deleted file mode 100644 index 630c3c64..00000000 --- a/doc/models/card-payment-details.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Card Payment Details - -Reflects the current status of a card payment. Contains only non-confidential information. - -## Structure - -`CardPaymentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | `?string` | Optional | The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or
FAILED.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | -| `entryMethod` | `?string` | Optional | The method used to enter the card's details for the payment. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | getEntryMethod(): ?string | setEntryMethod(?string entryMethod): void | -| `cvvStatus` | `?string` | Optional | The status code returned from the Card Verification Value (CVV) check. The code can be
`CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`.
**Constraints**: *Maximum Length*: `50` | getCvvStatus(): ?string | setCvvStatus(?string cvvStatus): void | -| `avsStatus` | `?string` | Optional | The status code returned from the Address Verification System (AVS) check. The code can be
`AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`.
**Constraints**: *Maximum Length*: `50` | getAvsStatus(): ?string | setAvsStatus(?string avsStatus): void | -| `authResultCode` | `?string` | Optional | The status code returned by the card issuer that describes the payment's
authorization status.
**Constraints**: *Maximum Length*: `10` | getAuthResultCode(): ?string | setAuthResultCode(?string authResultCode): void | -| `applicationIdentifier` | `?string` | Optional | For EMV payments, the application ID identifies the EMV application used for the payment.
**Constraints**: *Maximum Length*: `32` | getApplicationIdentifier(): ?string | setApplicationIdentifier(?string applicationIdentifier): void | -| `applicationName` | `?string` | Optional | For EMV payments, the human-readable name of the EMV application used for the payment.
**Constraints**: *Maximum Length*: `16` | getApplicationName(): ?string | setApplicationName(?string applicationName): void | -| `applicationCryptogram` | `?string` | Optional | For EMV payments, the cryptogram generated for the payment.
**Constraints**: *Maximum Length*: `16` | getApplicationCryptogram(): ?string | setApplicationCryptogram(?string applicationCryptogram): void | -| `verificationMethod` | `?string` | Optional | For EMV payments, the method used to verify the cardholder's identity. The method can be
`PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`.
**Constraints**: *Maximum Length*: `50` | getVerificationMethod(): ?string | setVerificationMethod(?string verificationMethod): void | -| `verificationResults` | `?string` | Optional | For EMV payments, the results of the cardholder verification. The result can be
`SUCCESS`, `FAILURE`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getVerificationResults(): ?string | setVerificationResults(?string verificationResults): void | -| `statementDescription` | `?string` | Optional | The statement description sent to the card networks.

Note: The actual statement description varies and is likely to be truncated and appended with
additional information on a per issuer basis.
**Constraints**: *Maximum Length*: `50` | getStatementDescription(): ?string | setStatementDescription(?string statementDescription): void | -| `deviceDetails` | [`?DeviceDetails`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | getDeviceDetails(): ?DeviceDetails | setDeviceDetails(?DeviceDetails deviceDetails): void | -| `cardPaymentTimeline` | [`?CardPaymentTimeline`](../../doc/models/card-payment-timeline.md) | Optional | The timeline for card payments. | getCardPaymentTimeline(): ?CardPaymentTimeline | setCardPaymentTimeline(?CardPaymentTimeline cardPaymentTimeline): void | -| `refundRequiresCardPresence` | `?bool` | Optional | Whether the card must be physically present for the payment to
be refunded. If set to `true`, the card must be present. | getRefundRequiresCardPresence(): ?bool | setRefundRequiresCardPresence(?bool refundRequiresCardPresence): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "status": "status6", - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "cvv_status": "cvv_status4", - "avs_status": "avs_status6" -} -``` - diff --git a/doc/models/card-payment-timeline.md b/doc/models/card-payment-timeline.md deleted file mode 100644 index 5a797fa9..00000000 --- a/doc/models/card-payment-timeline.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Card Payment Timeline - -The timeline for card payments. - -## Structure - -`CardPaymentTimeline` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `authorizedAt` | `?string` | Optional | The timestamp when the payment was authorized, in RFC 3339 format. | getAuthorizedAt(): ?string | setAuthorizedAt(?string authorizedAt): void | -| `capturedAt` | `?string` | Optional | The timestamp when the payment was captured, in RFC 3339 format. | getCapturedAt(): ?string | setCapturedAt(?string capturedAt): void | -| `voidedAt` | `?string` | Optional | The timestamp when the payment was voided, in RFC 3339 format. | getVoidedAt(): ?string | setVoidedAt(?string voidedAt): void | - -## Example (as JSON) - -```json -{ - "authorized_at": "authorized_at2", - "captured_at": "captured_at2", - "voided_at": "voided_at6" -} -``` - diff --git a/doc/models/card-prepaid-type.md b/doc/models/card-prepaid-type.md deleted file mode 100644 index 2e3352df..00000000 --- a/doc/models/card-prepaid-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Prepaid Type - -Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. - -## Enumeration - -`CardPrepaidType` - -## Fields - -| Name | -| --- | -| `UNKNOWN_PREPAID_TYPE` | -| `NOT_PREPAID` | -| `PREPAID` | - diff --git a/doc/models/card-type.md b/doc/models/card-type.md deleted file mode 100644 index 97b9f084..00000000 --- a/doc/models/card-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Type - -Indicates a card's type, such as `CREDIT` or `DEBIT`. - -## Enumeration - -`CardType` - -## Fields - -| Name | -| --- | -| `UNKNOWN_CARD_TYPE` | -| `CREDIT` | -| `DEBIT` | - diff --git a/doc/models/card.md b/doc/models/card.md deleted file mode 100644 index bd2b8dec..00000000 --- a/doc/models/card.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Card - -Represents the payment details of a card to be used for payments. These -details are determined by the payment token generated by Web Payments SDK. - -## Structure - -`Card` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | Unique ID for this card. Generated by Square.
**Constraints**: *Maximum Length*: `64` | getId(): ?string | setId(?string id): void | -| `cardBrand` | [`?string(CardBrand)`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | getCardBrand(): ?string | setCardBrand(?string cardBrand): void | -| `last4` | `?string` | Optional | The last 4 digits of the card number.
**Constraints**: *Maximum Length*: `4` | getLast4(): ?string | setLast4(?string last4): void | -| `expMonth` | `?int` | Optional | The expiration month of the associated card as an integer between 1 and 12. | getExpMonth(): ?int | setExpMonth(?int expMonth): void | -| `expYear` | `?int` | Optional | The four-digit year of the card's expiration date. | getExpYear(): ?int | setExpYear(?int expYear): void | -| `cardholderName` | `?string` | Optional | The name of the cardholder.
**Constraints**: *Maximum Length*: `96` | getCardholderName(): ?string | setCardholderName(?string cardholderName): void | -| `billingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | -| `fingerprint` | `?string` | Optional | Intended as a Square-assigned identifier, based
on the card number, to identify the card across multiple locations within a
single application.
**Constraints**: *Maximum Length*: `255` | getFingerprint(): ?string | setFingerprint(?string fingerprint): void | -| `customerId` | `?string` | Optional | **Required** The ID of a customer created using the Customers API to be associated with the card. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `merchantId` | `?string` | Optional | The ID of the merchant associated with the card. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `referenceId` | `?string` | Optional | An optional user-defined reference ID that associates this card with
another entity in an external system. For example, a customer ID from an
external customer management system.
**Constraints**: *Maximum Length*: `128` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `enabled` | `?bool` | Optional | Indicates whether or not a card can be used for payments. | getEnabled(): ?bool | setEnabled(?bool enabled): void | -| `cardType` | [`?string(CardType)`](../../doc/models/card-type.md) | Optional | Indicates a card's type, such as `CREDIT` or `DEBIT`. | getCardType(): ?string | setCardType(?string cardType): void | -| `prepaidType` | [`?string(CardPrepaidType)`](../../doc/models/card-prepaid-type.md) | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. | getPrepaidType(): ?string | setPrepaidType(?string prepaidType): void | -| `bin` | `?string` | Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API
returns this field.
**Constraints**: *Maximum Length*: `6` | getBin(): ?string | setBin(?string bin): void | -| `version` | `?int` | Optional | Current version number of the card. Increments with each card update. Requests to update an
existing Card object will be rejected unless the version in the request matches the current
version for the Card. | getVersion(): ?int | setVersion(?int version): void | -| `cardCoBrand` | [`?string(CardCoBrand)`](../../doc/models/card-co-brand.md) | Optional | Indicates the brand for a co-branded card. | getCardCoBrand(): ?string | setCardCoBrand(?string cardCoBrand): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "card_brand": "INTERAC", - "last_4": "last_42", - "exp_month": 240, - "exp_year": 56 -} -``` - diff --git a/doc/models/cash-app-details.md b/doc/models/cash-app-details.md deleted file mode 100644 index 3d8be55b..00000000 --- a/doc/models/cash-app-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Cash App Details - -Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. - -## Structure - -`CashAppDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `buyerFullName` | `?string` | Optional | The name of the Cash App account holder.
**Constraints**: *Maximum Length*: `255` | getBuyerFullName(): ?string | setBuyerFullName(?string buyerFullName): void | -| `buyerCountryCode` | `?string` | Optional | The country of the Cash App account holder, in ISO 3166-1-alpha-2 format.

For possible values, see [Country](entity:Country).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | getBuyerCountryCode(): ?string | setBuyerCountryCode(?string buyerCountryCode): void | -| `buyerCashtag` | `?string` | Optional | $Cashtag of the Cash App account holder.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `21` | getBuyerCashtag(): ?string | setBuyerCashtag(?string buyerCashtag): void | - -## Example (as JSON) - -```json -{ - "buyer_full_name": "buyer_full_name0", - "buyer_country_code": "buyer_country_code0", - "buyer_cashtag": "buyer_cashtag2" -} -``` - diff --git a/doc/models/cash-drawer-device.md b/doc/models/cash-drawer-device.md deleted file mode 100644 index a9ee1b10..00000000 --- a/doc/models/cash-drawer-device.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cash Drawer Device - -## Structure - -`CashDrawerDevice` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The device Square-issued ID | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | The device merchant-specified name. | getName(): ?string | setName(?string name): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "name": "name2" -} -``` - diff --git a/doc/models/cash-drawer-event-type.md b/doc/models/cash-drawer-event-type.md deleted file mode 100644 index afb4d4e7..00000000 --- a/doc/models/cash-drawer-event-type.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Cash Drawer Event Type - -The types of events on a CashDrawerShift. -Each event type represents an employee action on the actual cash drawer -represented by a CashDrawerShift. - -## Enumeration - -`CashDrawerEventType` - -## Fields - -| Name | Description | -| --- | --- | -| `NO_SALE` | Triggered when a no sale occurs on a cash drawer.
A CashDrawerEvent of this type must have a zero money amount. | -| `CASH_TENDER_PAYMENT` | Triggered when a cash tender payment occurs on a cash drawer.
A CashDrawerEvent of this type can must not have a negative amount. | -| `OTHER_TENDER_PAYMENT` | Triggered when a check, gift card, or other non-cash payment occurs
on a cash drawer.
A CashDrawerEvent of this type must have a zero money amount. | -| `CASH_TENDER_CANCELLED_PAYMENT` | Triggered when a split tender bill is cancelled after cash has been
tendered.
A CASH_TENDER_CANCELLED_PAYMENT should have a corresponding CASH_TENDER_PAYMENT.
A CashDrawerEvent of this type must not have a negative amount. | -| `OTHER_TENDER_CANCELLED_PAYMENT` | Triggered when a split tender bill is cancelled after a non-cash tender
has been tendered. An OTHER_TENDER_CANCELLED_PAYMENT should have a corresponding
OTHER_TENDER_PAYMENT. A CashDrawerEvent of this type must have a zero money
amount. | -| `CASH_TENDER_REFUND` | Triggered when a cash tender refund occurs.
A CashDrawerEvent of this type must not have a negative amount. | -| `OTHER_TENDER_REFUND` | Triggered when an other tender refund occurs.
A CashDrawerEvent of this type must have a zero money amount. | -| `PAID_IN` | Triggered when money unrelated to a payment is added to the cash drawer.
For example, an employee adds coins to the drawer.
A CashDrawerEvent of this type must not have a negative amount. | -| `PAID_OUT` | Triggered when money is removed from the drawer for other reasons
than making change.
For example, an employee pays a delivery person with cash from the cash drawer.
A CashDrawerEvent of this type must not have a negative amount. | - diff --git a/doc/models/cash-drawer-shift-event.md b/doc/models/cash-drawer-shift-event.md deleted file mode 100644 index 4fb54b9d..00000000 --- a/doc/models/cash-drawer-shift-event.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Cash Drawer Shift Event - -## Structure - -`CashDrawerShiftEvent` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The unique ID of the event. | getId(): ?string | setId(?string id): void | -| `eventType` | [`?string(CashDrawerEventType)`](../../doc/models/cash-drawer-event-type.md) | Optional | The types of events on a CashDrawerShift.
Each event type represents an employee action on the actual cash drawer
represented by a CashDrawerShift. | getEventType(): ?string | setEventType(?string eventType): void | -| `eventMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getEventMoney(): ?Money | setEventMoney(?Money eventMoney): void | -| `createdAt` | `?string` | Optional | The event time in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `description` | `?string` | Optional | An optional description of the event, entered by the employee that
created the event. | getDescription(): ?string | setDescription(?string description): void | -| `teamMemberId` | `?string` | Optional | The ID of the team member that created the event. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "event_type": "OTHER_TENDER_PAYMENT", - "event_money": { - "amount": 148, - "currency": "SDG" - }, - "created_at": "created_at4", - "description": "description6" -} -``` - diff --git a/doc/models/cash-drawer-shift-state.md b/doc/models/cash-drawer-shift-state.md deleted file mode 100644 index 7c9e3dbb..00000000 --- a/doc/models/cash-drawer-shift-state.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Cash Drawer Shift State - -The current state of a cash drawer shift. - -## Enumeration - -`CashDrawerShiftState` - -## Fields - -| Name | Description | -| --- | --- | -| `OPEN` | An open cash drawer shift. | -| `ENDED` | A cash drawer shift that is ended but has not yet had an employee content audit. | -| `CLOSED` | An ended cash drawer shift that is closed with a completed employee
content audit and recorded result. | - diff --git a/doc/models/cash-drawer-shift-summary.md b/doc/models/cash-drawer-shift-summary.md deleted file mode 100644 index 67ab8b25..00000000 --- a/doc/models/cash-drawer-shift-summary.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Cash Drawer Shift Summary - -The summary of a closed cash drawer shift. -This model contains only the money counted to start a cash drawer shift, counted -at the end of the shift, and the amount that should be in the drawer at shift -end based on summing all cash drawer shift events. - -## Structure - -`CashDrawerShiftSummary` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The shift unique ID. | getId(): ?string | setId(?string id): void | -| `state` | [`?string(CashDrawerShiftState)`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | getState(): ?string | setState(?string state): void | -| `openedAt` | `?string` | Optional | The shift start time in ISO 8601 format. | getOpenedAt(): ?string | setOpenedAt(?string openedAt): void | -| `endedAt` | `?string` | Optional | The shift end time in ISO 8601 format. | getEndedAt(): ?string | setEndedAt(?string endedAt): void | -| `closedAt` | `?string` | Optional | The shift close time in ISO 8601 format. | getClosedAt(): ?string | setClosedAt(?string closedAt): void | -| `description` | `?string` | Optional | An employee free-text description of a cash drawer shift. | getDescription(): ?string | setDescription(?string description): void | -| `openedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getOpenedCashMoney(): ?Money | setOpenedCashMoney(?Money openedCashMoney): void | -| `expectedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getExpectedCashMoney(): ?Money | setExpectedCashMoney(?Money expectedCashMoney): void | -| `closedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getClosedCashMoney(): ?Money | setClosedCashMoney(?Money closedCashMoney): void | -| `createdAt` | `?string` | Optional | The shift start time in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The shift updated at time in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `locationId` | `?string` | Optional | The ID of the location the cash drawer shift belongs to. | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "state": "CLOSED", - "opened_at": "opened_at8", - "ended_at": "ended_at2", - "closed_at": "closed_at2" -} -``` - diff --git a/doc/models/cash-drawer-shift.md b/doc/models/cash-drawer-shift.md deleted file mode 100644 index 5b9efa78..00000000 --- a/doc/models/cash-drawer-shift.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Cash Drawer Shift - -This model gives the details of a cash drawer shift. -The cash_payment_money, cash_refund_money, cash_paid_in_money, -and cash_paid_out_money fields are all computed by summing their respective -event types. - -## Structure - -`CashDrawerShift` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The shift unique ID. | getId(): ?string | setId(?string id): void | -| `state` | [`?string(CashDrawerShiftState)`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | getState(): ?string | setState(?string state): void | -| `openedAt` | `?string` | Optional | The time when the shift began, in ISO 8601 format. | getOpenedAt(): ?string | setOpenedAt(?string openedAt): void | -| `endedAt` | `?string` | Optional | The time when the shift ended, in ISO 8601 format. | getEndedAt(): ?string | setEndedAt(?string endedAt): void | -| `closedAt` | `?string` | Optional | The time when the shift was closed, in ISO 8601 format. | getClosedAt(): ?string | setClosedAt(?string closedAt): void | -| `description` | `?string` | Optional | The free-form text description of a cash drawer by an employee. | getDescription(): ?string | setDescription(?string description): void | -| `openedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getOpenedCashMoney(): ?Money | setOpenedCashMoney(?Money openedCashMoney): void | -| `cashPaymentMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCashPaymentMoney(): ?Money | setCashPaymentMoney(?Money cashPaymentMoney): void | -| `cashRefundsMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCashRefundsMoney(): ?Money | setCashRefundsMoney(?Money cashRefundsMoney): void | -| `cashPaidInMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCashPaidInMoney(): ?Money | setCashPaidInMoney(?Money cashPaidInMoney): void | -| `cashPaidOutMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCashPaidOutMoney(): ?Money | setCashPaidOutMoney(?Money cashPaidOutMoney): void | -| `expectedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getExpectedCashMoney(): ?Money | setExpectedCashMoney(?Money expectedCashMoney): void | -| `closedCashMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getClosedCashMoney(): ?Money | setClosedCashMoney(?Money closedCashMoney): void | -| `device` | [`?CashDrawerDevice`](../../doc/models/cash-drawer-device.md) | Optional | - | getDevice(): ?CashDrawerDevice | setDevice(?CashDrawerDevice device): void | -| `createdAt` | `?string` | Optional | The shift start time in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The shift updated at time in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `locationId` | `?string` | Optional | The ID of the location the cash drawer shift belongs to. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `teamMemberIds` | `?(string[])` | Optional | The IDs of all team members that were logged into Square Point of Sale at any
point while the cash drawer shift was open. | getTeamMemberIds(): ?array | setTeamMemberIds(?array teamMemberIds): void | -| `openingTeamMemberId` | `?string` | Optional | The ID of the team member that started the cash drawer shift. | getOpeningTeamMemberId(): ?string | setOpeningTeamMemberId(?string openingTeamMemberId): void | -| `endingTeamMemberId` | `?string` | Optional | The ID of the team member that ended the cash drawer shift. | getEndingTeamMemberId(): ?string | setEndingTeamMemberId(?string endingTeamMemberId): void | -| `closingTeamMemberId` | `?string` | Optional | The ID of the team member that closed the cash drawer shift by auditing
the cash drawer contents. | getClosingTeamMemberId(): ?string | setClosingTeamMemberId(?string closingTeamMemberId): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "state": "OPEN", - "opened_at": "opened_at4", - "ended_at": "ended_at8", - "closed_at": "closed_at8" -} -``` - diff --git a/doc/models/cash-payment-details.md b/doc/models/cash-payment-details.md deleted file mode 100644 index 56b9945d..00000000 --- a/doc/models/cash-payment-details.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Cash Payment Details - -Stores details about a cash payment. Contains only non-confidential information. For more information, see -[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). - -## Structure - -`CashPaymentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `buyerSuppliedMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBuyerSuppliedMoney(): Money | setBuyerSuppliedMoney(Money buyerSuppliedMoney): void | -| `changeBackMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getChangeBackMoney(): ?Money | setChangeBackMoney(?Money changeBackMoney): void | - -## Example (as JSON) - -```json -{ - "buyer_supplied_money": { - "amount": 114, - "currency": "XTS" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } -} -``` - diff --git a/doc/models/catalog-availability-period.md b/doc/models/catalog-availability-period.md deleted file mode 100644 index ee7d1cda..00000000 --- a/doc/models/catalog-availability-period.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Availability Period - -Represents a time period of availability. - -## Structure - -`CatalogAvailabilityPeriod` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startLocalTime` | `?string` | Optional | The start time of an availability period, specified in local time using partial-time
RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | getStartLocalTime(): ?string | setStartLocalTime(?string startLocalTime): void | -| `endLocalTime` | `?string` | Optional | The end time of an availability period, specified in local time using partial-time
RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | getEndLocalTime(): ?string | setEndLocalTime(?string endLocalTime): void | -| `dayOfWeek` | [`?string(DayOfWeek)`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | getDayOfWeek(): ?string | setDayOfWeek(?string dayOfWeek): void | - -## Example (as JSON) - -```json -{ - "start_local_time": "start_local_time6", - "end_local_time": "end_local_time8", - "day_of_week": "WED" -} -``` - diff --git a/doc/models/catalog-category-type.md b/doc/models/catalog-category-type.md deleted file mode 100644 index 6d70fc37..00000000 --- a/doc/models/catalog-category-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Catalog Category Type - -Indicates the type of a category. - -## Enumeration - -`CatalogCategoryType` - -## Fields - -| Name | Description | -| --- | --- | -| `REGULAR_CATEGORY` | The regular category. | -| `MENU_CATEGORY` | The menu category. | -| `KITCHEN_CATEGORY` | Kitchen categories are used by KDS (Kitchen Display System) to route items to specific clients | - diff --git a/doc/models/catalog-category.md b/doc/models/catalog-category.md deleted file mode 100644 index fe0ed3cb..00000000 --- a/doc/models/catalog-category.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Catalog Category - -A category to which a `CatalogItem` instance belongs. - -## Structure - -`CatalogCategory` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `imageIds` | `?(string[])` | Optional | The IDs of images associated with this `CatalogCategory` instance.
Currently these images are not displayed by Square, but are free to be displayed in 3rd party applications. | getImageIds(): ?array | setImageIds(?array imageIds): void | -| `categoryType` | [`?string(CatalogCategoryType)`](../../doc/models/catalog-category-type.md) | Optional | Indicates the type of a category. | getCategoryType(): ?string | setCategoryType(?string categoryType): void | -| `parentCategory` | [`?CatalogObjectCategory`](../../doc/models/catalog-object-category.md) | Optional | A category that can be assigned to an item or a parent category that can be assigned
to another category. For example, a clothing category can be assigned to a t-shirt item or
be made as the parent category to the pants category. | getParentCategory(): ?CatalogObjectCategory | setParentCategory(?CatalogObjectCategory parentCategory): void | -| `isTopLevel` | `?bool` | Optional | Indicates whether a category is a top level category, which does not have any parent_category. | getIsTopLevel(): ?bool | setIsTopLevel(?bool isTopLevel): void | -| `channels` | `?(string[])` | Optional | A list of IDs representing channels, such as a Square Online site, where the category can be made visible. | getChannels(): ?array | setChannels(?array channels): void | -| `availabilityPeriodIds` | `?(string[])` | Optional | The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. | getAvailabilityPeriodIds(): ?array | setAvailabilityPeriodIds(?array availabilityPeriodIds): void | -| `onlineVisibility` | `?bool` | Optional | Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. | getOnlineVisibility(): ?bool | setOnlineVisibility(?bool onlineVisibility): void | -| `rootCategory` | `?string` | Optional | The top-level category in a category hierarchy. | getRootCategory(): ?string | setRootCategory(?string rootCategory): void | -| `ecomSeoData` | [`?CatalogEcomSeoData`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | getEcomSeoData(): ?CatalogEcomSeoData | setEcomSeoData(?CatalogEcomSeoData ecomSeoData): void | -| `pathToRoot` | [`?(CategoryPathToRootNode[])`](../../doc/models/category-path-to-root-node.md) | Optional | The path from the category to its root category. The first node of the path is the parent of the category
and the last is the root category. The path is empty if the category is a root category. | getPathToRoot(): ?array | setPathToRoot(?array pathToRoot): void | - -## Example (as JSON) - -```json -{ - "object": { - "category_data": { - "name": "Beverages" - }, - "id": "#Beverages", - "present_at_all_locations": true, - "type": "CATEGORY" - }, - "name": "name2", - "image_ids": [ - "image_ids7", - "image_ids6", - "image_ids5" - ], - "category_type": "REGULAR_CATEGORY", - "parent_category": { - "id": "id4", - "ordinal": 114 - }, - "is_top_level": false -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-app-visibility.md b/doc/models/catalog-custom-attribute-definition-app-visibility.md deleted file mode 100644 index 1e1bca2d..00000000 --- a/doc/models/catalog-custom-attribute-definition-app-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Custom Attribute Definition App Visibility - -Defines the visibility of a custom attribute to applications other than their -creating application. - -## Enumeration - -`CatalogCustomAttributeDefinitionAppVisibility` - -## Fields - -| Name | Description | -| --- | --- | -| `APP_VISIBILITY_HIDDEN` | Other applications cannot read this custom attribute. | -| `APP_VISIBILITY_READ_ONLY` | Other applications can read this custom attribute definition and
values. | -| `APP_VISIBILITY_READ_WRITE_VALUES` | Other applications can read and write custom attribute values on objects.
They can read but cannot edit the custom attribute definition. | - diff --git a/doc/models/catalog-custom-attribute-definition-number-config.md b/doc/models/catalog-custom-attribute-definition-number-config.md deleted file mode 100644 index bdb891b2..00000000 --- a/doc/models/catalog-custom-attribute-definition-number-config.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Catalog Custom Attribute Definition Number Config - -## Structure - -`CatalogCustomAttributeDefinitionNumberConfig` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `precision` | `?int` | Optional | An integer between 0 and 5 that represents the maximum number of
positions allowed after the decimal in number custom attribute values
For example:

- if the precision is 0, the quantity can be 1, 2, 3, etc.
- if the precision is 1, the quantity can be 0.1, 0.2, etc.
- if the precision is 2, the quantity can be 0.01, 0.12, etc.

Default: 5
**Constraints**: `<= 5` | getPrecision(): ?int | setPrecision(?int precision): void | - -## Example (as JSON) - -```json -{ - "precision": 208 -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md b/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md deleted file mode 100644 index 45ea4b62..00000000 --- a/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Custom Attribute Definition Selection Config Custom Attribute Selection - -A named selection for this `SELECTION`-type custom attribute definition. - -## Structure - -`CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID set by Square. | getUid(): ?string | setUid(?string uid): void | -| `name` | `string` | Required | Selection name, unique within `allowed_selections`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getName(): string | setName(string name): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "name": "name4" -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-selection-config.md b/doc/models/catalog-custom-attribute-definition-selection-config.md deleted file mode 100644 index 1131835f..00000000 --- a/doc/models/catalog-custom-attribute-definition-selection-config.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Catalog Custom Attribute Definition Selection Config - -Configuration associated with `SELECTION`-type custom attribute definitions. - -## Structure - -`CatalogCustomAttributeDefinitionSelectionConfig` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `maxAllowedSelections` | `?int` | Optional | The maximum number of selections that can be set. The maximum value for this
attribute is 100. The default value is 1. The value can be modified, but changing the value will not
affect existing custom attribute values on objects. Clients need to
handle custom attributes with more selected values than allowed by this limit.
**Constraints**: `<= 100` | getMaxAllowedSelections(): ?int | setMaxAllowedSelections(?int maxAllowedSelections): void | -| `allowedSelections` | [`?(CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[])`](../../doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md) | Optional | The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100
selections can be defined. Can be modified. | getAllowedSelections(): ?array | setAllowedSelections(?array allowedSelections): void | - -## Example (as JSON) - -```json -{ - "max_allowed_selections": 124, - "allowed_selections": [ - { - "uid": "uid0", - "name": "name0" - }, - { - "uid": "uid0", - "name": "name0" - }, - { - "uid": "uid0", - "name": "name0" - } - ] -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-seller-visibility.md b/doc/models/catalog-custom-attribute-definition-seller-visibility.md deleted file mode 100644 index fb20e292..00000000 --- a/doc/models/catalog-custom-attribute-definition-seller-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Custom Attribute Definition Seller Visibility - -Defines the visibility of a custom attribute to sellers in Square -client applications, Square APIs or in Square UIs (including Square Point -of Sale applications and Square Dashboard). - -## Enumeration - -`CatalogCustomAttributeDefinitionSellerVisibility` - -## Fields - -| Name | Description | -| --- | --- | -| `SELLER_VISIBILITY_HIDDEN` | Sellers cannot read this custom attribute in Square client
applications or Square APIs. | -| `SELLER_VISIBILITY_READ_WRITE_VALUES` | Sellers can read and write this custom attribute value in catalog objects,
but cannot edit the custom attribute definition. | - diff --git a/doc/models/catalog-custom-attribute-definition-string-config.md b/doc/models/catalog-custom-attribute-definition-string-config.md deleted file mode 100644 index d3cc1854..00000000 --- a/doc/models/catalog-custom-attribute-definition-string-config.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Custom Attribute Definition String Config - -Configuration associated with Custom Attribute Definitions of type `STRING`. - -## Structure - -`CatalogCustomAttributeDefinitionStringConfig` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `enforceUniqueness` | `?bool` | Optional | If true, each Custom Attribute instance associated with this Custom Attribute
Definition must have a unique value within the seller's catalog. For
example, this may be used for a value like a SKU that should not be
duplicated within a seller's catalog. May not be modified after the
definition has been created. | getEnforceUniqueness(): ?bool | setEnforceUniqueness(?bool enforceUniqueness): void | - -## Example (as JSON) - -```json -{ - "enforce_uniqueness": false -} -``` - diff --git a/doc/models/catalog-custom-attribute-definition-type.md b/doc/models/catalog-custom-attribute-definition-type.md deleted file mode 100644 index 7d5c56bd..00000000 --- a/doc/models/catalog-custom-attribute-definition-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Custom Attribute Definition Type - -Defines the possible types for a custom attribute. - -## Enumeration - -`CatalogCustomAttributeDefinitionType` - -## Fields - -| Name | Description | -| --- | --- | -| `STRING` | A free-form string containing up to 255 characters. | -| `BOOLEAN` | A `true` or `false` value. | -| `NUMBER` | A decimal string representation of a number. Can support up to 5 digits after the decimal point. | -| `SELECTION` | One or more choices from `allowed_selections`. | - diff --git a/doc/models/catalog-custom-attribute-definition.md b/doc/models/catalog-custom-attribute-definition.md deleted file mode 100644 index a748ce44..00000000 --- a/doc/models/catalog-custom-attribute-definition.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Catalog Custom Attribute Definition - -Contains information defining a custom attribute. Custom attributes are -intended to store additional information about a catalog object or to associate a -catalog object with an entity in another system. Do not use custom attributes -to store any sensitive information (personally identifiable information, card details, etc.). -[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) - -## Structure - -`CatalogCustomAttributeDefinition` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`string(CatalogCustomAttributeDefinitionType)`](../../doc/models/catalog-custom-attribute-definition-type.md) | Required | Defines the possible types for a custom attribute. | getType(): string | setType(string type): void | -| `name` | `string` | Required | The name of this definition for API and seller-facing UI purposes.
The name must be unique within the (merchant, application) pair. Required.
May not be empty and may not exceed 255 characters. Can be modified after creation.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getName(): string | setName(string name): void | -| `description` | `?string` | Optional | Seller-oriented description of the meaning of this Custom Attribute,
any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.
**Constraints**: *Maximum Length*: `255` | getDescription(): ?string | setDescription(?string description): void | -| `sourceApplication` | [`?SourceApplication`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | getSourceApplication(): ?SourceApplication | setSourceApplication(?SourceApplication sourceApplication): void | -| `allowedObjectTypes` | [`string(CatalogObjectType)[]`](../../doc/models/catalog-object-type.md) | Required | The set of `CatalogObject` types that this custom atttribute may be applied to.
Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included.
See [CatalogObjectType](#type-catalogobjecttype) for possible values | getAllowedObjectTypes(): array | setAllowedObjectTypes(array allowedObjectTypes): void | -| `sellerVisibility` | [`?string(CatalogCustomAttributeDefinitionSellerVisibility)`](../../doc/models/catalog-custom-attribute-definition-seller-visibility.md) | Optional | Defines the visibility of a custom attribute to sellers in Square
client applications, Square APIs or in Square UIs (including Square Point
of Sale applications and Square Dashboard). | getSellerVisibility(): ?string | setSellerVisibility(?string sellerVisibility): void | -| `appVisibility` | [`?string(CatalogCustomAttributeDefinitionAppVisibility)`](../../doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their
creating application. | getAppVisibility(): ?string | setAppVisibility(?string appVisibility): void | -| `stringConfig` | [`?CatalogCustomAttributeDefinitionStringConfig`](../../doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. | getStringConfig(): ?CatalogCustomAttributeDefinitionStringConfig | setStringConfig(?CatalogCustomAttributeDefinitionStringConfig stringConfig): void | -| `numberConfig` | [`?CatalogCustomAttributeDefinitionNumberConfig`](../../doc/models/catalog-custom-attribute-definition-number-config.md) | Optional | - | getNumberConfig(): ?CatalogCustomAttributeDefinitionNumberConfig | setNumberConfig(?CatalogCustomAttributeDefinitionNumberConfig numberConfig): void | -| `selectionConfig` | [`?CatalogCustomAttributeDefinitionSelectionConfig`](../../doc/models/catalog-custom-attribute-definition-selection-config.md) | Optional | Configuration associated with `SELECTION`-type custom attribute definitions. | getSelectionConfig(): ?CatalogCustomAttributeDefinitionSelectionConfig | setSelectionConfig(?CatalogCustomAttributeDefinitionSelectionConfig selectionConfig): void | -| `customAttributeUsageCount` | `?int` | Optional | The number of custom attributes that reference this
custom attribute definition. Set by the server in response to a ListCatalog
request with `include_counts` set to `true`. If the actual count is greater
than 100, `custom_attribute_usage_count` will be set to `100`. | getCustomAttributeUsageCount(): ?int | setCustomAttributeUsageCount(?int customAttributeUsageCount): void | -| `key` | `?string` | Optional | The name of the desired custom attribute key that can be used to access
the custom attribute value on catalog objects. Cannot be modified after the
custom attribute definition has been created.
Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9_-]*$` | getKey(): ?string | setKey(?string key): void | - -## Example (as JSON) - -```json -{ - "type": "STRING", - "name": "name0", - "description": "description0", - "source_application": { - "product": "BILLING", - "application_id": "application_id8", - "name": "name2" - }, - "allowed_object_types": [ - "CATEGORY", - "IMAGE" - ], - "seller_visibility": "SELLER_VISIBILITY_HIDDEN", - "app_visibility": "APP_VISIBILITY_HIDDEN", - "string_config": { - "enforce_uniqueness": false - } -} -``` - diff --git a/doc/models/catalog-custom-attribute-value.md b/doc/models/catalog-custom-attribute-value.md deleted file mode 100644 index eb3bfc83..00000000 --- a/doc/models/catalog-custom-attribute-value.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Catalog Custom Attribute Value - -An instance of a custom attribute. Custom attributes can be defined and -added to `ITEM` and `ITEM_VARIATION` type catalog objects. -[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes). - -## Structure - -`CatalogCustomAttributeValue` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The name of the custom attribute. | getName(): ?string | setName(?string name): void | -| `stringValue` | `?string` | Optional | The string value of the custom attribute. Populated if `type` = `STRING`. | getStringValue(): ?string | setStringValue(?string stringValue): void | -| `customAttributeDefinitionId` | `?string` | Optional | The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value belongs to. | getCustomAttributeDefinitionId(): ?string | setCustomAttributeDefinitionId(?string customAttributeDefinitionId): void | -| `type` | [`?string(CatalogCustomAttributeDefinitionType)`](../../doc/models/catalog-custom-attribute-definition-type.md) | Optional | Defines the possible types for a custom attribute. | getType(): ?string | setType(?string type): void | -| `numberValue` | `?string` | Optional | Populated if `type` = `NUMBER`. Contains a string
representation of a decimal number, using a `.` as the decimal separator. | getNumberValue(): ?string | setNumberValue(?string numberValue): void | -| `booleanValue` | `?bool` | Optional | A `true` or `false` value. Populated if `type` = `BOOLEAN`. | getBooleanValue(): ?bool | setBooleanValue(?bool booleanValue): void | -| `selectionUidValues` | `?(string[])` | Optional | One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. | getSelectionUidValues(): ?array | setSelectionUidValues(?array selectionUidValues): void | -| `key` | `?string` | Optional | If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this key is prefixed by the defining application ID.
For example, if the CatalogCustomAttributeDefinition has a key attribute of "cocoa_brand" and the defining application ID is "abcd1234", this key is "abcd1234:cocoa_brand"
when the application making the request is different from the application defining the custom attribute definition. Otherwise, the key is simply "cocoa_brand". | getKey(): ?string | setKey(?string key): void | - -## Example (as JSON) - -```json -{ - "name": "name2", - "string_value": "string_value6", - "custom_attribute_definition_id": "custom_attribute_definition_id0", - "type": "NUMBER", - "number_value": "number_value2" -} -``` - diff --git a/doc/models/catalog-discount-modify-tax-basis.md b/doc/models/catalog-discount-modify-tax-basis.md deleted file mode 100644 index 755c9fe2..00000000 --- a/doc/models/catalog-discount-modify-tax-basis.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Catalog Discount Modify Tax Basis - -## Enumeration - -`CatalogDiscountModifyTaxBasis` - -## Fields - -| Name | Description | -| --- | --- | -| `MODIFY_TAX_BASIS` | Application of the discount will modify the tax basis. | -| `DO_NOT_MODIFY_TAX_BASIS` | Application of the discount will not modify the tax basis. | - diff --git a/doc/models/catalog-discount-type.md b/doc/models/catalog-discount-type.md deleted file mode 100644 index 5eae9215..00000000 --- a/doc/models/catalog-discount-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Discount Type - -How to apply a CatalogDiscount to a CatalogItem. - -## Enumeration - -`CatalogDiscountType` - -## Fields - -| Name | Description | -| --- | --- | -| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (e.g., 5%) off the item price. | -| `FIXED_AMOUNT` | Apply the discount as a fixed amount (e.g., $1.00) off the item price. | -| `VARIABLE_PERCENTAGE` | Apply the discount as a variable percentage off the item price. The percentage will be specified at the time of sale. | -| `VARIABLE_AMOUNT` | Apply the discount as a variable amount off the item price. The amount will be specified at the time of sale. | - diff --git a/doc/models/catalog-discount.md b/doc/models/catalog-discount.md deleted file mode 100644 index 9793e4c5..00000000 --- a/doc/models/catalog-discount.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Catalog Discount - -A discount applicable to items. - -## Structure - -`CatalogDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The discount name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `discountType` | [`?string(CatalogDiscountType)`](../../doc/models/catalog-discount-type.md) | Optional | How to apply a CatalogDiscount to a CatalogItem. | getDiscountType(): ?string | setDiscountType(?string discountType): void | -| `percentage` | `?string` | Optional | The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal
separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type`
is `VARIABLE_PERCENTAGE`.

Do not use this field for amount-based or variable discounts. | getPercentage(): ?string | setPercentage(?string percentage): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `pinRequired` | `?bool` | Optional | Indicates whether a mobile staff member needs to enter their PIN to apply the
discount to a payment in the Square Point of Sale app. | getPinRequired(): ?bool | setPinRequired(?bool pinRequired): void | -| `labelColor` | `?string` | Optional | The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code. | getLabelColor(): ?string | setLabelColor(?string labelColor): void | -| `modifyTaxBasis` | [`?string(CatalogDiscountModifyTaxBasis)`](../../doc/models/catalog-discount-modify-tax-basis.md) | Optional | - | getModifyTaxBasis(): ?string | setModifyTaxBasis(?string modifyTaxBasis): void | -| `maximumAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMaximumAmountMoney(): ?Money | setMaximumAmountMoney(?Money maximumAmountMoney): void | - -## Example (as JSON) - -```json -{ - "object": { - "discount_data": { - "discount_type": "FIXED_PERCENTAGE", - "label_color": "red", - "name": "Welcome to the Dark(Roast) Side!", - "percentage": "5.4", - "pin_required": false - }, - "id": "#Maythe4th", - "present_at_all_locations": true, - "type": "DISCOUNT" - }, - "name": "name8", - "discount_type": "VARIABLE_PERCENTAGE", - "percentage": "percentage6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "pin_required": false -} -``` - diff --git a/doc/models/catalog-ecom-seo-data.md b/doc/models/catalog-ecom-seo-data.md deleted file mode 100644 index aad93347..00000000 --- a/doc/models/catalog-ecom-seo-data.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Ecom Seo Data - -SEO data for for a seller's Square Online store. - -## Structure - -`CatalogEcomSeoData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `pageTitle` | `?string` | Optional | The SEO title used for the Square Online store. | getPageTitle(): ?string | setPageTitle(?string pageTitle): void | -| `pageDescription` | `?string` | Optional | The SEO description used for the Square Online store. | getPageDescription(): ?string | setPageDescription(?string pageDescription): void | -| `permalink` | `?string` | Optional | The SEO permalink used for the Square Online store. | getPermalink(): ?string | setPermalink(?string permalink): void | - -## Example (as JSON) - -```json -{ - "page_title": "page_title6", - "page_description": "page_description2", - "permalink": "permalink0" -} -``` - diff --git a/doc/models/catalog-id-mapping.md b/doc/models/catalog-id-mapping.md deleted file mode 100644 index 1d50e662..00000000 --- a/doc/models/catalog-id-mapping.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Catalog Id Mapping - -A mapping between a temporary client-supplied ID and a permanent server-generated ID. - -When calling [UpsertCatalogObject](../../doc/apis/catalog.md#upsert-catalog-object) or -[BatchUpsertCatalogObjects](../../doc/apis/catalog.md#batch-upsert-catalog-objects) to -create a [CatalogObject](../../doc/models/catalog-object.md) instance, you can supply -a temporary ID for the to-be-created object, especially when the object is to be referenced -elsewhere in the same request body. This temporary ID can be any string unique within -the call, but must be prefixed by "#". - -After the request is submitted and the object created, a permanent server-generated ID is assigned -to the new object. The permanent ID is unique across the Square catalog. - -## Structure - -`CatalogIdMapping` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `clientObjectId` | `?string` | Optional | The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. | getClientObjectId(): ?string | setClientObjectId(?string clientObjectId): void | -| `objectId` | `?string` | Optional | The permanent ID for the CatalogObject created by the server. | getObjectId(): ?string | setObjectId(?string objectId): void | - -## Example (as JSON) - -```json -{ - "client_object_id": "client_object_id8", - "object_id": "object_id0" -} -``` - diff --git a/doc/models/catalog-image.md b/doc/models/catalog-image.md deleted file mode 100644 index 39a098df..00000000 --- a/doc/models/catalog-image.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Catalog Image - -An image file to use in Square catalogs. It can be associated with -`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects. -Only the images on items and item variations are exposed in Dashboard. -Only the first image on an item is displayed in Square Point of Sale (SPOS). -Images on items and variations are displayed through Square Online Store. -Images on other object types are for use by 3rd party application developers. - -## Structure - -`CatalogImage` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The internal name to identify this image in calls to the Square API.
This is a searchable attribute for use in applicable query filters
using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).
It is not unique and should not be shown in a buyer facing context. | getName(): ?string | setName(?string name): void | -| `url` | `?string` | Optional | The URL of this image, generated by Square after an image is uploaded
using the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint.
To modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field. | getUrl(): ?string | setUrl(?string url): void | -| `caption` | `?string` | Optional | A caption that describes what is shown in the image. Displayed in the
Square Online Store. This is a searchable attribute for use in applicable query filters
using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). | getCaption(): ?string | setCaption(?string caption): void | -| `photoStudioOrderId` | `?string` | Optional | The immutable order ID for this image object created by the Photo Studio service in Square Online Store. | getPhotoStudioOrderId(): ?string | setPhotoStudioOrderId(?string photoStudioOrderId): void | - -## Example (as JSON) - -```json -{ - "name": "name0", - "url": "url4", - "caption": "caption4", - "photo_studio_order_id": "photo_studio_order_id2" -} -``` - diff --git a/doc/models/catalog-info-response-limits.md b/doc/models/catalog-info-response-limits.md deleted file mode 100644 index eac2d2db..00000000 --- a/doc/models/catalog-info-response-limits.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Catalog Info Response Limits - -## Structure - -`CatalogInfoResponseLimits` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `batchUpsertMaxObjectsPerBatch` | `?int` | Optional | The maximum number of objects that may appear within a single batch in a
`/v2/catalog/batch-upsert` request. | getBatchUpsertMaxObjectsPerBatch(): ?int | setBatchUpsertMaxObjectsPerBatch(?int batchUpsertMaxObjectsPerBatch): void | -| `batchUpsertMaxTotalObjects` | `?int` | Optional | The maximum number of objects that may appear across all batches in a
`/v2/catalog/batch-upsert` request. | getBatchUpsertMaxTotalObjects(): ?int | setBatchUpsertMaxTotalObjects(?int batchUpsertMaxTotalObjects): void | -| `batchRetrieveMaxObjectIds` | `?int` | Optional | The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve`
request. | getBatchRetrieveMaxObjectIds(): ?int | setBatchRetrieveMaxObjectIds(?int batchRetrieveMaxObjectIds): void | -| `searchMaxPageLimit` | `?int` | Optional | The maximum number of results that may be returned in a page of a
`/v2/catalog/search` response. | getSearchMaxPageLimit(): ?int | setSearchMaxPageLimit(?int searchMaxPageLimit): void | -| `batchDeleteMaxObjectIds` | `?int` | Optional | The maximum number of object IDs that may be included in a single
`/v2/catalog/batch-delete` request. | getBatchDeleteMaxObjectIds(): ?int | setBatchDeleteMaxObjectIds(?int batchDeleteMaxObjectIds): void | -| `updateItemTaxesMaxItemIds` | `?int` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-taxes` request. | getUpdateItemTaxesMaxItemIds(): ?int | setUpdateItemTaxesMaxItemIds(?int updateItemTaxesMaxItemIds): void | -| `updateItemTaxesMaxTaxesToEnable` | `?int` | Optional | The maximum number of tax IDs to be enabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | getUpdateItemTaxesMaxTaxesToEnable(): ?int | setUpdateItemTaxesMaxTaxesToEnable(?int updateItemTaxesMaxTaxesToEnable): void | -| `updateItemTaxesMaxTaxesToDisable` | `?int` | Optional | The maximum number of tax IDs to be disabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | getUpdateItemTaxesMaxTaxesToDisable(): ?int | setUpdateItemTaxesMaxTaxesToDisable(?int updateItemTaxesMaxTaxesToDisable): void | -| `updateItemModifierListsMaxItemIds` | `?int` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-modifier-lists` request. | getUpdateItemModifierListsMaxItemIds(): ?int | setUpdateItemModifierListsMaxItemIds(?int updateItemModifierListsMaxItemIds): void | -| `updateItemModifierListsMaxModifierListsToEnable` | `?int` | Optional | The maximum number of modifier list IDs to be enabled that may be included in
a single `/v2/catalog/update-item-modifier-lists` request. | getUpdateItemModifierListsMaxModifierListsToEnable(): ?int | setUpdateItemModifierListsMaxModifierListsToEnable(?int updateItemModifierListsMaxModifierListsToEnable): void | -| `updateItemModifierListsMaxModifierListsToDisable` | `?int` | Optional | The maximum number of modifier list IDs to be disabled that may be included in
a single `/v2/catalog/update-item-modifier-lists` request. | getUpdateItemModifierListsMaxModifierListsToDisable(): ?int | setUpdateItemModifierListsMaxModifierListsToDisable(?int updateItemModifierListsMaxModifierListsToDisable): void | - -## Example (as JSON) - -```json -{ - "batch_upsert_max_objects_per_batch": 206, - "batch_upsert_max_total_objects": 122, - "batch_retrieve_max_object_ids": 54, - "search_max_page_limit": 144, - "batch_delete_max_object_ids": 40 -} -``` - diff --git a/doc/models/catalog-info-response.md b/doc/models/catalog-info-response.md deleted file mode 100644 index a85d2e4f..00000000 --- a/doc/models/catalog-info-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Catalog Info Response - -## Structure - -`CatalogInfoResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `limits` | [`?CatalogInfoResponseLimits`](../../doc/models/catalog-info-response-limits.md) | Optional | - | getLimits(): ?CatalogInfoResponseLimits | setLimits(?CatalogInfoResponseLimits limits): void | -| `standardUnitDescriptionGroup` | [`?StandardUnitDescriptionGroup`](../../doc/models/standard-unit-description-group.md) | Optional | Group of standard measurement units. | getStandardUnitDescriptionGroup(): ?StandardUnitDescriptionGroup | setStandardUnitDescriptionGroup(?StandardUnitDescriptionGroup standardUnitDescriptionGroup): void | - -## Example (as JSON) - -```json -{ - "limits": { - "batch_delete_max_object_ids": 200, - "batch_retrieve_max_object_ids": 1000, - "batch_upsert_max_objects_per_batch": 1000, - "batch_upsert_max_total_objects": 10000, - "search_max_page_limit": 1000, - "update_item_modifier_lists_max_item_ids": 1000, - "update_item_modifier_lists_max_modifier_lists_to_disable": 1000, - "update_item_modifier_lists_max_modifier_lists_to_enable": 1000, - "update_item_taxes_max_item_ids": 1000, - "update_item_taxes_max_taxes_to_disable": 1000, - "update_item_taxes_max_taxes_to_enable": 1000 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "standard_unit_description_group": { - "standard_unit_descriptions": [ - { - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" - }, - { - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" - } - ], - "language_code": "language_code6" - } -} -``` - diff --git a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md deleted file mode 100644 index 5e8f2401..00000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Catalog Item Food and Beverage Details Dietary Preference Standard Dietary Preference - -Standard dietary preferences for food and beverage items that are recommended on item creation. - -## Enumeration - -`CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference` - -## Fields - -| Name | -| --- | -| `DAIRY_FREE` | -| `GLUTEN_FREE` | -| `HALAL` | -| `KOSHER` | -| `NUT_FREE` | -| `VEGAN` | -| `VEGETARIAN` | - diff --git a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md deleted file mode 100644 index 8f40ee6b..00000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Item Food and Beverage Details Dietary Preference Type - -The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. - -## Enumeration - -`CatalogItemFoodAndBeverageDetailsDietaryPreferenceType` - -## Fields - -| Name | Description | -| --- | --- | -| `STANDARD` | A standard value from a pre-determined list. | -| `CUSTOM` | A user-defined custom value. | - diff --git a/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md deleted file mode 100644 index 7d89ec32..00000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Item Food and Beverage Details Dietary Preference - -Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. - -## Structure - -`CatalogItemFoodAndBeverageDetailsDietaryPreference` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`?string(CatalogItemFoodAndBeverageDetailsDietaryPreferenceType)`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md) | Optional | The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. | getType(): ?string | setType(?string type): void | -| `standardName` | [`?string(CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference)`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md) | Optional | Standard dietary preferences for food and beverage items that are recommended on item creation. | getStandardName(): ?string | setStandardName(?string standardName): void | -| `customName` | `?string` | Optional | The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference. | getCustomName(): ?string | setCustomName(?string customName): void | - -## Example (as JSON) - -```json -{ - "type": "STANDARD", - "standard_name": "GLUTEN_FREE", - "custom_name": "custom_name4" -} -``` - diff --git a/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md b/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md deleted file mode 100644 index d5275f45..00000000 --- a/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Catalog Item Food and Beverage Details Ingredient Standard Ingredient - -Standard ingredients for food and beverage items that are recommended on item creation. - -## Enumeration - -`CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient` - -## Fields - -| Name | -| --- | -| `CELERY` | -| `CRUSTACEANS` | -| `EGGS` | -| `FISH` | -| `GLUTEN` | -| `LUPIN` | -| `MILK` | -| `MOLLUSCS` | -| `MUSTARD` | -| `PEANUTS` | -| `SESAME` | -| `SOY` | -| `SULPHITES` | -| `TREE_NUTS` | - diff --git a/doc/models/catalog-item-food-and-beverage-details-ingredient.md b/doc/models/catalog-item-food-and-beverage-details-ingredient.md deleted file mode 100644 index 9862b10b..00000000 --- a/doc/models/catalog-item-food-and-beverage-details-ingredient.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Item Food and Beverage Details Ingredient - -Describes the ingredient used in a `FOOD_AND_BEV` item. - -## Structure - -`CatalogItemFoodAndBeverageDetailsIngredient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`?string(CatalogItemFoodAndBeverageDetailsDietaryPreferenceType)`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md) | Optional | The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. | getType(): ?string | setType(?string type): void | -| `standardName` | [`?string(CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient)`](../../doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md) | Optional | Standard ingredients for food and beverage items that are recommended on item creation. | getStandardName(): ?string | setStandardName(?string standardName): void | -| `customName` | `?string` | Optional | The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference. | getCustomName(): ?string | setCustomName(?string customName): void | - -## Example (as JSON) - -```json -{ - "type": "STANDARD", - "standard_name": "GLUTEN", - "custom_name": "custom_name6" -} -``` - diff --git a/doc/models/catalog-item-food-and-beverage-details.md b/doc/models/catalog-item-food-and-beverage-details.md deleted file mode 100644 index 2a388005..00000000 --- a/doc/models/catalog-item-food-and-beverage-details.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Catalog Item Food and Beverage Details - -The food and beverage-specific details of a `FOOD_AND_BEV` item. - -## Structure - -`CatalogItemFoodAndBeverageDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `calorieCount` | `?int` | Optional | The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items. | getCalorieCount(): ?int | setCalorieCount(?int calorieCount): void | -| `dietaryPreferences` | [`?(CatalogItemFoodAndBeverageDetailsDietaryPreference[])`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference.md) | Optional | The dietary preferences for the `FOOD_AND_BEV` item. | getDietaryPreferences(): ?array | setDietaryPreferences(?array dietaryPreferences): void | -| `ingredients` | [`?(CatalogItemFoodAndBeverageDetailsIngredient[])`](../../doc/models/catalog-item-food-and-beverage-details-ingredient.md) | Optional | The ingredients for the `FOOD_AND_BEV` type item. | getIngredients(): ?array | setIngredients(?array ingredients): void | - -## Example (as JSON) - -```json -{ - "calorie_count": 36, - "dietary_preferences": [ - { - "type": "STANDARD", - "standard_name": "VEGETARIAN", - "custom_name": "custom_name8" - } - ], - "ingredients": [ - { - "type": "STANDARD", - "standard_name": "MILK", - "custom_name": "custom_name8" - }, - { - "type": "STANDARD", - "standard_name": "MILK", - "custom_name": "custom_name8" - } - ] -} -``` - diff --git a/doc/models/catalog-item-modifier-list-info.md b/doc/models/catalog-item-modifier-list-info.md deleted file mode 100644 index dca32d14..00000000 --- a/doc/models/catalog-item-modifier-list-info.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Catalog Item Modifier List Info - -References a text-based modifier or a list of non text-based modifiers applied to a `CatalogItem` instance -and specifies supported behaviors of the application. - -## Structure - -`CatalogItemModifierListInfo` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `modifierListId` | `string` | Required | The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
**Constraints**: *Minimum Length*: `1` | getModifierListId(): string | setModifierListId(string modifierListId): void | -| `modifierOverrides` | [`?(CatalogModifierOverride[])`](../../doc/models/catalog-modifier-override.md) | Optional | A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. | getModifierOverrides(): ?array | setModifierOverrides(?array modifierOverrides): void | -| `minSelectedModifiers` | `?int` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | getMinSelectedModifiers(): ?int | setMinSelectedModifiers(?int minSelectedModifiers): void | -| `maxSelectedModifiers` | `?int` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | getMaxSelectedModifiers(): ?int | setMaxSelectedModifiers(?int maxSelectedModifiers): void | -| `enabled` | `?bool` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | getEnabled(): ?bool | setEnabled(?bool enabled): void | -| `ordinal` | `?int` | Optional | The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied
to a `CatalogItem` instance. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | - -## Example (as JSON) - -```json -{ - "modifier_list_id": "modifier_list_id6", - "modifier_overrides": [ - { - "modifier_id": "modifier_id8", - "on_by_default": false - }, - { - "modifier_id": "modifier_id8", - "on_by_default": false - } - ], - "min_selected_modifiers": 170, - "max_selected_modifiers": 66, - "enabled": false, - "ordinal": 204 -} -``` - diff --git a/doc/models/catalog-item-option-for-item.md b/doc/models/catalog-item-option-for-item.md deleted file mode 100644 index 8a850116..00000000 --- a/doc/models/catalog-item-option-for-item.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Catalog Item Option for Item - -An option that can be assigned to an item. -For example, a t-shirt item may offer a color option or a size option. - -## Structure - -`CatalogItemOptionForItem` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemOptionId` | `?string` | Optional | The unique id of the item option, used to form the dimensions of the item option matrix in a specified order. | getItemOptionId(): ?string | setItemOptionId(?string itemOptionId): void | - -## Example (as JSON) - -```json -{ - "item_option_id": "item_option_id4" -} -``` - diff --git a/doc/models/catalog-item-option-value-for-item-variation.md b/doc/models/catalog-item-option-value-for-item-variation.md deleted file mode 100644 index f6dff598..00000000 --- a/doc/models/catalog-item-option-value-for-item-variation.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Catalog Item Option Value for Item Variation - -A `CatalogItemOptionValue` links an item variation to an item option as -an item option value. For example, a t-shirt item may offer a color option and -a size option. An item option value would represent each variation of t-shirt: -For example, "Color:Red, Size:Small" or "Color:Blue, Size:Medium". - -## Structure - -`CatalogItemOptionValueForItemVariation` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemOptionId` | `?string` | Optional | The unique id of an item option. | getItemOptionId(): ?string | setItemOptionId(?string itemOptionId): void | -| `itemOptionValueId` | `?string` | Optional | The unique id of the selected value for the item option. | getItemOptionValueId(): ?string | setItemOptionValueId(?string itemOptionValueId): void | - -## Example (as JSON) - -```json -{ - "item_option_id": "item_option_id0", - "item_option_value_id": "item_option_value_id2" -} -``` - diff --git a/doc/models/catalog-item-option-value.md b/doc/models/catalog-item-option-value.md deleted file mode 100644 index 91a945f8..00000000 --- a/doc/models/catalog-item-option-value.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Catalog Item Option Value - -An enumerated value that can link a -`CatalogItemVariation` to an item option as one of -its item option values. - -## Structure - -`CatalogItemOptionValue` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemOptionId` | `?string` | Optional | Unique ID of the associated item option. | getItemOptionId(): ?string | setItemOptionId(?string itemOptionId): void | -| `name` | `?string` | Optional | Name of this item option value. This is a searchable attribute for use in applicable query filters. | getName(): ?string | setName(?string name): void | -| `description` | `?string` | Optional | A human-readable description for the option value. This is a searchable attribute for use in applicable query filters. | getDescription(): ?string | setDescription(?string description): void | -| `color` | `?string` | Optional | The HTML-supported hex color for the item option (e.g., "#ff8d4e85").
Only displayed if `show_colors` is enabled on the parent `ItemOption`. When
left unset, `color` defaults to white ("#ffffff") when `show_colors` is
enabled on the parent `ItemOption`. | getColor(): ?string | setColor(?string color): void | -| `ordinal` | `?int` | Optional | Determines where this option value appears in a list of option values. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | - -## Example (as JSON) - -```json -{ - "item_option_id": "item_option_id6", - "name": "name4", - "description": "description4", - "color": "color8", - "ordinal": 198 -} -``` - diff --git a/doc/models/catalog-item-option.md b/doc/models/catalog-item-option.md deleted file mode 100644 index 92d179d4..00000000 --- a/doc/models/catalog-item-option.md +++ /dev/null @@ -1,104 +0,0 @@ - -# Catalog Item Option - -A group of variations for a `CatalogItem`. - -## Structure - -`CatalogItemOption` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The item option's display name for the seller. Must be unique across
all item options. This is a searchable attribute for use in applicable query filters. | getName(): ?string | setName(?string name): void | -| `displayName` | `?string` | Optional | The item option's display name for the customer. This is a searchable attribute for use in applicable query filters. | getDisplayName(): ?string | setDisplayName(?string displayName): void | -| `description` | `?string` | Optional | The item option's human-readable description. Displayed in the Square
Point of Sale app for the seller and in the Online Store or on receipts for
the buyer. This is a searchable attribute for use in applicable query filters. | getDescription(): ?string | setDescription(?string description): void | -| `showColors` | `?bool` | Optional | If true, display colors for entries in `values` when present. | getShowColors(): ?bool | setShowColors(?bool showColors): void | -| `values` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of CatalogObjects containing the
`CatalogItemOptionValue`s for this item. | getValues(): ?array | setValues(?array values): void | - -## Example (as JSON) - -```json -{ - "name": "name2", - "display_name": "display_name2", - "description": "description2", - "show_colors": false, - "values": [ - { - "type": "IMAGE", - "id": "id0", - "updated_at": "updated_at6", - "version": 116, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "type": "IMAGE", - "id": "id0", - "updated_at": "updated_at6", - "version": 116, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ] -} -``` - diff --git a/doc/models/catalog-item-product-type.md b/doc/models/catalog-item-product-type.md deleted file mode 100644 index e08694ef..00000000 --- a/doc/models/catalog-item-product-type.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Item Product Type - -The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. - -## Enumeration - -`CatalogItemProductType` - -## Fields - -| Name | Description | -| --- | --- | -| `REGULAR` | An ordinary item. | -| `GIFT_CARD` | A Square gift card. | -| `APPOINTMENTS_SERVICE` | A service that can be booked using the Square Appointments app. | -| `FOOD_AND_BEV` | A food or beverage item that can be sold by restaurants and other food venues. | -| `EVENT` | An event which tickets can be sold for, including location, address, and times. | -| `DIGITAL` | A digital item like an ebook or song. | -| `DONATION` | A donation which site visitors can send for any cause. | -| `LEGACY_SQUARE_ONLINE_SERVICE` | A legacy Square Online service that is manually fulfilled. This corresponds to the `Other` item type displayed in the Square Seller Dashboard and Square POS apps. | -| `LEGACY_SQUARE_ONLINE_MEMBERSHIP` | A legacy Square Online membership that is manually fulfilled. This corresponds to the `Membership` item type displayed in the Square Seller Dashboard and Square POS apps. | - diff --git a/doc/models/catalog-item-variation.md b/doc/models/catalog-item-variation.md deleted file mode 100644 index 95634044..00000000 --- a/doc/models/catalog-item-variation.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Catalog Item Variation - -An item variation, representing a product for sale, in the Catalog object model. Each [item](../../doc/models/catalog-item.md) must have at least one -item variation and can have at most 250 item variations. - -An item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked -number of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both -stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass -variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be -converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes -the `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count -decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion. - -## Structure - -`CatalogItemVariation` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemId` | `?string` | Optional | The ID of the `CatalogItem` associated with this item variation. | getItemId(): ?string | setItemId(?string itemId): void | -| `name` | `?string` | Optional | The item variation's name. This is a searchable attribute for use in applicable query filters.

Its value has a maximum length of 255 Unicode code points. However, when the parent [item](entity:CatalogItem)
uses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can be
longer than 255 Unicode code points. | getName(): ?string | setName(?string name): void | -| `sku` | `?string` | Optional | The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. | getSku(): ?string | setSku(?string sku): void | -| `upc` | `?string` | Optional | The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.

The value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard,
Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned
to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps
unless it is updated to fit the expected format. | getUpc(): ?string | setUpc(?string upc): void | -| `ordinal` | `?int` | Optional | The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal
for each item variation within a parent `CatalogItem` is set according to the item variations's
position. On reads, the value is not guaranteed to be sequential or unique. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | -| `pricingType` | [`?string(CatalogPricingType)`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | getPricingType(): ?string | setPricingType(?string pricingType): void | -| `priceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | -| `locationOverrides` | [`?(ItemVariationLocationOverrides[])`](../../doc/models/item-variation-location-overrides.md) | Optional | Per-location price and inventory overrides. | getLocationOverrides(): ?array | setLocationOverrides(?array locationOverrides): void | -| `trackInventory` | `?bool` | Optional | If `true`, inventory tracking is active for the variation. | getTrackInventory(): ?bool | setTrackInventory(?bool trackInventory): void | -| `inventoryAlertType` | [`?string(InventoryAlertType)`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | getInventoryAlertType(): ?string | setInventoryAlertType(?string inventoryAlertType): void | -| `inventoryAlertThreshold` | `?int` | Optional | If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`
is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.

This value is always an integer. | getInventoryAlertThreshold(): ?int | setInventoryAlertThreshold(?int inventoryAlertThreshold): void | -| `userData` | `?string` | Optional | Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | getUserData(): ?string | setUserData(?string userData): void | -| `serviceDuration` | `?int` | Optional | If the `CatalogItem` that owns this item variation is of type
`APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For
example, a 30 minute appointment would have the value `1800000`, which is equal to
30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). | getServiceDuration(): ?int | setServiceDuration(?int serviceDuration): void | -| `availableForBooking` | `?bool` | Optional | If the `CatalogItem` that owns this item variation is of type
`APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. | getAvailableForBooking(): ?bool | setAvailableForBooking(?bool availableForBooking): void | -| `itemOptionValues` | [`?(CatalogItemOptionValueForItemVariation[])`](../../doc/models/catalog-item-option-value-for-item-variation.md) | Optional | List of item option values associated with this item variation. Listed
in the same order as the item options of the parent item. | getItemOptionValues(): ?array | setItemOptionValues(?array itemOptionValues): void | -| `measurementUnitId` | `?string` | Optional | ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity
sold of this item variation. If left unset, the item will be sold in
whole quantities. | getMeasurementUnitId(): ?string | setMeasurementUnitId(?string measurementUnitId): void | -| `sellable` | `?bool` | Optional | Whether this variation can be sold. The inventory count of a sellable variation indicates
the number of units available for sale. When a variation is both stockable and sellable,
its sellable inventory count can be smaller than or equal to its stockable count. | getSellable(): ?bool | setSellable(?bool sellable): void | -| `stockable` | `?bool` | Optional | Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE).
When a variation is both stockable and sellable, the inventory count of a stockable variation keeps track of the number of units of this variation in stock
and is not an indicator of the number of units of the variation that can be sold. | getStockable(): ?bool | setStockable(?bool stockable): void | -| `imageIds` | `?(string[])` | Optional | The IDs of images associated with this `CatalogItemVariation` instance.
These images will be shown to customers in Square Online Store. | getImageIds(): ?array | setImageIds(?array imageIds): void | -| `teamMemberIds` | `?(string[])` | Optional | Tokens of employees that can perform the service represented by this variation. Only valid for
variations of type `APPOINTMENTS_SERVICE`. | getTeamMemberIds(): ?array | setTeamMemberIds(?array teamMemberIds): void | -| `stockableConversion` | [`?CatalogStockConversion`](../../doc/models/catalog-stock-conversion.md) | Optional | Represents the rule of conversion between a stockable [CatalogItemVariation](../../doc/models/catalog-item-variation.md)
and a non-stockable sell-by or receive-by `CatalogItemVariation` that
share the same underlying stock. | getStockableConversion(): ?CatalogStockConversion | setStockableConversion(?CatalogStockConversion stockableConversion): void | - -## Example (as JSON) - -```json -{ - "item_id": "item_id4", - "name": "name4", - "sku": "sku0", - "upc": "upc2", - "ordinal": 76 -} -``` - diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md deleted file mode 100644 index 544449c8..00000000 --- a/doc/models/catalog-item.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Catalog Item - -A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. - -## Structure - -`CatalogItem` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The item's name. This is a searchable attribute for use in applicable query filters, its value must not be empty, and the length is of Unicode code points.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `description` | `?string` | Optional | The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.

Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description
of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field values are kept in sync. If you try to
set the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,
except for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null
does not nullify `description_html`.
**Constraints**: *Maximum Length*: `4096` | getDescription(): ?string | setDescription(?string description): void | -| `abbreviation` | `?string` | Optional | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.
This attribute is searchable, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `24` | getAbbreviation(): ?string | setAbbreviation(?string abbreviation): void | -| `labelColor` | `?string` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | getLabelColor(): ?string | setLabelColor(?string labelColor): void | -| `isTaxable` | `?bool` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. | getIsTaxable(): ?bool | setIsTaxable(?bool isTaxable): void | -| `availableOnline` | `?bool` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | getAvailableOnline(): ?bool | setAvailableOnline(?bool availableOnline): void | -| `availableForPickup` | `?bool` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | getAvailableForPickup(): ?bool | setAvailableForPickup(?bool availableForPickup): void | -| `availableElectronically` | `?bool` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | getAvailableElectronically(): ?bool | setAvailableElectronically(?bool availableElectronically): void | -| `categoryId` | `?string` | Optional | The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead. | getCategoryId(): ?string | setCategoryId(?string categoryId): void | -| `taxIds` | `?(string[])` | Optional | A set of IDs indicating the taxes enabled for
this item. When updating an item, any taxes listed here will be added to the item.
Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. | getTaxIds(): ?array | setTaxIds(?array taxIds): void | -| `modifierListInfo` | [`?(CatalogItemModifierListInfo[])`](../../doc/models/catalog-item-modifier-list-info.md) | Optional | A set of `CatalogItemModifierListInfo` objects
representing the modifier lists that apply to this item, along with the overrides and min
and max limits that are specific to this item. Modifier lists
may also be added to or deleted from an item using `UpdateItemModifierLists`. | getModifierListInfo(): ?array | setModifierListInfo(?array modifierListInfo): void | -| `variations` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have
at least one variation. | getVariations(): ?array | setVariations(?array variations): void | -| `productType` | [`?string(CatalogItemProductType)`](../../doc/models/catalog-item-product-type.md) | Optional | The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. | getProductType(): ?string | setProductType(?string productType): void | -| `skipModifierScreen` | `?bool` | Optional | If `false`, the Square Point of Sale app will present the `CatalogItem`'s
details screen immediately, allowing the merchant to choose `CatalogModifier`s
before adding the item to the cart. This is the default behavior.

If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected
modifiers, and merchants can edit modifiers by drilling down onto the item's details.

Third-party clients are encouraged to implement similar behaviors. | getSkipModifierScreen(): ?bool | setSkipModifierScreen(?bool skipModifierScreen): void | -| `itemOptions` | [`?(CatalogItemOptionForItem[])`](../../doc/models/catalog-item-option-for-item.md) | Optional | List of item options IDs for this item. Used to manage and group item
variations in a specified order.

Maximum: 6 item options. | getItemOptions(): ?array | setItemOptions(?array itemOptions): void | -| `imageIds` | `?(string[])` | Optional | The IDs of images associated with this `CatalogItem` instance.
These images will be shown to customers in Square Online Store.
The first image will show up as the icon for this item in POS. | getImageIds(): ?array | setImageIds(?array imageIds): void | -| `sortName` | `?string` | Optional | A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.
Its value must not be empty.

It is currently supported for sellers of the Japanese locale only. | getSortName(): ?string | setSortName(?string sortName): void | -| `categories` | [`?(CatalogObjectCategory[])`](../../doc/models/catalog-object-category.md) | Optional | The list of categories. | getCategories(): ?array | setCategories(?array categories): void | -| `descriptionHtml` | `?string` | Optional | The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags,
is of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or
unsupported HTML elements or attributes are ignored.

Supported HTML elements include:

- `a`: Link. Supports linking to website URLs, email address, and telephone numbers.
- `b`, `strong`: Bold text
- `br`: Line break
- `code`: Computer code
- `div`: Section
- `h1-h6`: Headings
- `i`, `em`: Italics
- `li`: List element
- `ol`: Numbered list
- `p`: Paragraph
- `ul`: Bullet list
- `u`: Underline

Supported HTML attributes include:

- `align`: Alignment of the text content
- `href`: Link destination
- `rel`: Relationship between link's target and source
- `target`: Place to open the linked document
**Constraints**: *Maximum Length*: `65535` | getDescriptionHtml(): ?string | setDescriptionHtml(?string descriptionHtml): void | -| `descriptionPlaintext` | `?string` | Optional | A server-generated plaintext version of the `description_html` field, without formatting tags.
**Constraints**: *Maximum Length*: `65535` | getDescriptionPlaintext(): ?string | setDescriptionPlaintext(?string descriptionPlaintext): void | -| `channels` | `?(string[])` | Optional | A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. | getChannels(): ?array | setChannels(?array channels): void | -| `isArchived` | `?bool` | Optional | Indicates whether this item is archived (`true`) or not (`false`). | getIsArchived(): ?bool | setIsArchived(?bool isArchived): void | -| `ecomSeoData` | [`?CatalogEcomSeoData`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | getEcomSeoData(): ?CatalogEcomSeoData | setEcomSeoData(?CatalogEcomSeoData ecomSeoData): void | -| `foodAndBeverageDetails` | [`?CatalogItemFoodAndBeverageDetails`](../../doc/models/catalog-item-food-and-beverage-details.md) | Optional | The food and beverage-specific details of a `FOOD_AND_BEV` item. | getFoodAndBeverageDetails(): ?CatalogItemFoodAndBeverageDetails | setFoodAndBeverageDetails(?CatalogItemFoodAndBeverageDetails foodAndBeverageDetails): void | -| `reportingCategory` | [`?CatalogObjectCategory`](../../doc/models/catalog-object-category.md) | Optional | A category that can be assigned to an item or a parent category that can be assigned
to another category. For example, a clothing category can be assigned to a t-shirt item or
be made as the parent category to the pants category. | getReportingCategory(): ?CatalogObjectCategory | setReportingCategory(?CatalogObjectCategory reportingCategory): void | - -## Example (as JSON) - -```json -{ - "name": "name6", - "description": "description6", - "abbreviation": "abbreviation8", - "label_color": "label_color8", - "is_taxable": false -} -``` - diff --git a/doc/models/catalog-measurement-unit.md b/doc/models/catalog-measurement-unit.md deleted file mode 100644 index fd3bb83c..00000000 --- a/doc/models/catalog-measurement-unit.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Catalog Measurement Unit - -Represents the unit used to measure a `CatalogItemVariation` and -specifies the precision for decimal quantities. - -## Structure - -`CatalogMeasurementUnit` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `measurementUnit` | [`?MeasurementUnit`](../../doc/models/measurement-unit.md) | Optional | Represents a unit of measurement to use with a quantity, such as ounces
or inches. Exactly one of the following fields are required: `custom_unit`,
`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. | getMeasurementUnit(): ?MeasurementUnit | setMeasurementUnit(?MeasurementUnit measurementUnit): void | -| `precision` | `?int` | Optional | An integer between 0 and 5 that represents the maximum number of
positions allowed after the decimal in quantities measured with this unit.
For example:

- if the precision is 0, the quantity can be 1, 2, 3, etc.
- if the precision is 1, the quantity can be 0.1, 0.2, etc.
- if the precision is 2, the quantity can be 0.01, 0.12, etc.

Default: 3 | getPrecision(): ?int | setPrecision(?int precision): void | - -## Example (as JSON) - -```json -{ - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 78 -} -``` - diff --git a/doc/models/catalog-modifier-list-modifier-type.md b/doc/models/catalog-modifier-list-modifier-type.md deleted file mode 100644 index eede3572..00000000 --- a/doc/models/catalog-modifier-list-modifier-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Modifier List Modifier Type - -Defines the type of `CatalogModifierList`. - -## Enumeration - -`CatalogModifierListModifierType` - -## Fields - -| Name | Description | -| --- | --- | -| `LIST` | The `CatalogModifierList` instance is a non-empty list of non text-based modifiers. | -| `TEXT` | The `CatalogModifierList` instance is a single text-based modifier. | - diff --git a/doc/models/catalog-modifier-list-selection-type.md b/doc/models/catalog-modifier-list-selection-type.md deleted file mode 100644 index 3a428181..00000000 --- a/doc/models/catalog-modifier-list-selection-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Modifier List Selection Type - -Indicates whether a CatalogModifierList supports multiple selections. - -## Enumeration - -`CatalogModifierListSelectionType` - -## Fields - -| Name | Description | -| --- | --- | -| `SINGLE` | Indicates that a CatalogModifierList allows only a
single CatalogModifier to be selected. | -| `MULTIPLE` | Indicates that a CatalogModifierList allows multiple
CatalogModifier to be selected. | - diff --git a/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md deleted file mode 100644 index 68c8e22c..00000000 --- a/doc/models/catalog-modifier-list.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Catalog Modifier List - -For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. -For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied -text string to be selected for the T-shirt at the time of sale. - -For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items -at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. -For example, a "Condiments" modifier list applicable to a "Hot Dog" item -may contain "Ketchup", "Mustard", and "Relish" modifiers. - -A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field -is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item -only once and the `selection_type` field is always set to `SINGLE`. - -## Structure - -`CatalogModifierList` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of
Unicode code points.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `ordinal` | `?int` | Optional | The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | -| `selectionType` | [`?string(CatalogModifierListSelectionType)`](../../doc/models/catalog-modifier-list-selection-type.md) | Optional | Indicates whether a CatalogModifierList supports multiple selections. | getSelectionType(): ?string | setSelectionType(?string selectionType): void | -| `modifiers` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`,
for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list
is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes:

```
{
"id": "{{catalog_modifier_id}}",
"type": "MODIFIER",
"modifier_data": {{a CatalogModifier instance>}}
}
``` | getModifiers(): ?array | setModifiers(?array modifiers): void | -| `imageIds` | `?(string[])` | Optional | The IDs of images associated with this `CatalogModifierList` instance.
Currently these images are not displayed on Square products, but may be displayed in 3rd-party applications. | getImageIds(): ?array | setImageIds(?array imageIds): void | -| `modifierType` | [`?string(CatalogModifierListModifierType)`](../../doc/models/catalog-modifier-list-modifier-type.md) | Optional | Defines the type of `CatalogModifierList`. | getModifierType(): ?string | setModifierType(?string modifierType): void | -| `maxLength` | `?int` | Optional | The maximum length, in Unicode points, of the text string of the text-based modifier as represented by
this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. | getMaxLength(): ?int | setMaxLength(?int maxLength): void | -| `textRequired` | `?bool` | Optional | Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier
as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. | getTextRequired(): ?bool | setTextRequired(?bool textRequired): void | -| `internalName` | `?string` | Optional | A note for internal use by the business.

For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of "Hello, Kitty!"
is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as
an instruction for the business to follow.

For non text-based modifiers, this `internal_name` attribute can be
used to include SKUs, internal codes, or supplemental descriptions for internal use.
**Constraints**: *Maximum Length*: `512` | getInternalName(): ?string | setInternalName(?string internalName): void | - -## Example (as JSON) - -```json -{ - "name": "name4", - "ordinal": 226, - "selection_type": "SINGLE", - "modifiers": [ - { - "type": "TAX", - "id": "id4", - "updated_at": "updated_at0", - "version": 210, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "image_ids": [ - "image_ids9" - ] -} -``` - diff --git a/doc/models/catalog-modifier-override.md b/doc/models/catalog-modifier-override.md deleted file mode 100644 index 8cddf9bf..00000000 --- a/doc/models/catalog-modifier-override.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Modifier Override - -Options to control how to override the default behavior of the specified modifier. - -## Structure - -`CatalogModifierOverride` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `modifierId` | `string` | Required | The ID of the `CatalogModifier` whose default behavior is being overridden.
**Constraints**: *Minimum Length*: `1` | getModifierId(): string | setModifierId(string modifierId): void | -| `onByDefault` | `?bool` | Optional | If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. | getOnByDefault(): ?bool | setOnByDefault(?bool onByDefault): void | - -## Example (as JSON) - -```json -{ - "modifier_id": "modifier_id2", - "on_by_default": false -} -``` - diff --git a/doc/models/catalog-modifier.md b/doc/models/catalog-modifier.md deleted file mode 100644 index abec78b2..00000000 --- a/doc/models/catalog-modifier.md +++ /dev/null @@ -1,71 +0,0 @@ - -# Catalog Modifier - -A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a Burger item. - -## Structure - -`CatalogModifier` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The modifier name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `priceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | -| `ordinal` | `?int` | Optional | Determines where this `CatalogModifier` appears in the `CatalogModifierList`. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | -| `modifierListId` | `?string` | Optional | The ID of the `CatalogModifierList` associated with this modifier. | getModifierListId(): ?string | setModifierListId(?string modifierListId): void | -| `locationOverrides` | [`?(ModifierLocationOverrides[])`](../../doc/models/modifier-location-overrides.md) | Optional | Location-specific price overrides. | getLocationOverrides(): ?array | setLocationOverrides(?array locationOverrides): void | -| `imageId` | `?string` | Optional | The ID of the image associated with this `CatalogModifier` instance.
Currently this image is not displayed by Square, but is free to be displayed in 3rd party applications. | getImageId(): ?string | setImageId(?string imageId): void | - -## Example (as JSON) - -```json -{ - "object": { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - "name": "name6", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "ordinal": 70, - "modifier_list_id": "modifier_list_id2", - "location_overrides": [ - { - "location_id": "location_id8", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "sold_out": false - }, - { - "location_id": "location_id8", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "sold_out": false - }, - { - "location_id": "location_id8", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "sold_out": false - } - ] -} -``` - diff --git a/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md deleted file mode 100644 index 6d766461..00000000 --- a/doc/models/catalog-object-batch.md +++ /dev/null @@ -1,113 +0,0 @@ - -# Catalog Object Batch - -A batch of catalog objects. - -## Structure - -`CatalogObjectBatch` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `objects` | [`CatalogObject[]`](../../doc/models/catalog-object.md) | Required | A list of CatalogObjects belonging to this batch. | getObjects(): array | setObjects(array objects): void | - -## Example (as JSON) - -```json -{ - "objects": [ - { - "type": "PRODUCT_SET", - "id": "id6", - "category_data": { - "object": { - "category_data": { - "name": "Beverages" - }, - "id": "#Beverages", - "present_at_all_locations": true, - "type": "CATEGORY" - } - }, - "tax_data": { - "object": { - "id": "#SalesTax", - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "fee_applies_to_custom_amounts": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX" - } - }, - "discount_data": { - "object": { - "discount_data": { - "discount_type": "FIXED_PERCENTAGE", - "label_color": "red", - "name": "Welcome to the Dark(Roast) Side!", - "percentage": "5.4", - "pin_required": false - }, - "id": "#Maythe4th", - "present_at_all_locations": true, - "type": "DISCOUNT" - } - }, - "modifier_data": { - "object": { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - } - }, - "updated_at": "updated_at2", - "version": 164, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ] -} -``` - diff --git a/doc/models/catalog-object-category.md b/doc/models/catalog-object-category.md deleted file mode 100644 index 3f7f3337..00000000 --- a/doc/models/catalog-object-category.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Object Category - -A category that can be assigned to an item or a parent category that can be assigned -to another category. For example, a clothing category can be assigned to a t-shirt item or -be made as the parent category to the pants category. - -## Structure - -`CatalogObjectCategory` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The ID of the object's category. | getId(): ?string | setId(?string id): void | -| `ordinal` | `?int` | Optional | The order of the object within the context of the category. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "ordinal": 8 -} -``` - diff --git a/doc/models/catalog-object-reference.md b/doc/models/catalog-object-reference.md deleted file mode 100644 index 4589f990..00000000 --- a/doc/models/catalog-object-reference.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Object Reference - -A reference to a Catalog object at a specific version. In general this is -used as an entry point into a graph of catalog objects, where the objects exist -at a specific version. - -## Structure - -`CatalogObjectReference` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `objectId` | `?string` | Optional | The ID of the referenced object. | getObjectId(): ?string | setObjectId(?string objectId): void | -| `catalogVersion` | `?int` | Optional | The version of the object. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | - -## Example (as JSON) - -```json -{ - "object_id": "object_id0", - "catalog_version": 84 -} -``` - diff --git a/doc/models/catalog-object-type.md b/doc/models/catalog-object-type.md deleted file mode 100644 index ada605a9..00000000 --- a/doc/models/catalog-object-type.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Catalog Object Type - -Possible types of CatalogObjects returned from the catalog, each -containing type-specific properties in the `*_data` field corresponding to the specified object type. - -## Enumeration - -`CatalogObjectType` - -## Fields - -| Name | Description | -| --- | --- | -| `ITEM` | The `CatalogObject` instance is of the [CatalogItem](../../doc/models/catalog-item.md) type and represents an item. The item-specific data
must be set on the `item_data` field. | -| `IMAGE` | The `CatalogObject` instance is of the [CatalogImage](../../doc/models/catalog-image.md) type and represents an image. The image-specific data
must be set on the `image_data` field. | -| `CATEGORY` | The `CatalogObject` instance is of the [CatalogCategory](../../doc/models/catalog-category.md) type and represents a category. The category-specific data
must be set on the `category_data` field. | -| `ITEM_VARIATION` | The `CatalogObject` instance is of the [CatalogItemVariation](../../doc/models/catalog-item-variation.md) type and represents an item variation, also referred to as variation.
The item variation-specific data must be set on the `item_variation_data` field. | -| `TAX` | The `CatalogObject` instance is of the [CatalogTax](../../doc/models/catalog-tax.md) type and represents a tax. The tax-specific data
must be set on the `tax_data` field. | -| `DISCOUNT` | The `CatalogObject` instance is of the [CatalogDiscount](../../doc/models/catalog-discount.md) type and represents a discount. The discount-specific data
must be set on the `discount_data` field. | -| `MODIFIER_LIST` | The `CatalogObject` instance is of the [CatalogModifierList](../../doc/models/catalog-modifier-list.md) type and represents a modifier list.
The modifier-list-specific data must be set on the `modifier_list_data` field. | -| `MODIFIER` | The `CatalogObject` instance is of the [CatalogModifier](../../doc/models/catalog-modifier.md) type and represents a modifier. The modifier-specific data
must be set on the `modifier_data` field. | -| `PRICING_RULE` | The `CatalogObject` instance is of the [CatalogPricingRule](../../doc/models/catalog-pricing-rule.md) type and represents a pricing rule. The pricing-rule-specific data
must be set on the `pricing_rule_data` field. | -| `PRODUCT_SET` | The `CatalogObject` instance is of the [CatalogProductSet](../../doc/models/catalog-product-set.md) type and represents a product set.
The product-set-specific data will be stored in the `product_set_data` field. | -| `TIME_PERIOD` | The `CatalogObject` instance is of the [CatalogTimePeriod](../../doc/models/catalog-time-period.md) type and represents a time period.
The time-period-specific data must be set on the `time_period_data` field. | -| `MEASUREMENT_UNIT` | The `CatalogObject` instance is of the [CatalogMeasurementUnit](../../doc/models/catalog-measurement-unit.md) type and represents a measurement unit specifying the unit of
measure and precision in which an item variation is sold. The measurement-unit-specific data must set on the `measurement_unit_data` field. | -| `SUBSCRIPTION_PLAN_VARIATION` | The `CatalogObject` instance is of the [CatalogSubscriptionPlan](../../doc/models/catalog-subscription-plan.md) type and represents a subscription plan.
The subscription-plan-specific data must be stored on the `subscription_plan_data` field. | -| `ITEM_OPTION` | The `CatalogObject` instance is of the [CatalogItemOption](../../doc/models/catalog-item-option.md) type and represents a list of options (such as a color or size of a T-shirt)
that can be assigned to item variations. The item-option-specific data must be on the `item_option_data` field. | -| `ITEM_OPTION_VAL` | The `CatalogObject` instance is of the [CatalogItemOptionValue](../../doc/models/catalog-item-option-value.md) type and represents a value associated with one or more item options.
For example, an item option of "Size" may have item option values such as "Small" or "Medium".
The item-option-value-specific data must be on the `item_option_value_data` field. | -| `CUSTOM_ATTRIBUTE_DEFINITION` | The `CatalogObject` instance is of the [CatalogCustomAttributeDefinition](../../doc/models/catalog-custom-attribute-definition.md) type and represents the definition of a custom attribute.
The custom-attribute-definition-specific data must be set on the `custom_attribute_definition_data` field. | -| `QUICK_AMOUNTS_SETTINGS` | The `CatalogObject` instance is of the [CatalogQuickAmountsSettings](../../doc/models/catalog-quick-amounts-settings.md) type and represents settings to configure preset charges for quick payments at each location.
For example, a location may have a list of both AUTO and MANUAL quick amounts that are set to DISABLED.
The quick-amounts-settings-specific data must be set on the `quick_amounts_settings_data` field. | -| `SUBSCRIPTION_PLAN` | The `CatalogObject` instance is of the [CatalogSubscriptionPlan](../../doc/models/catalog-subscription-plan.md) type and represents a subscription plan.
The subscription plan specific data must be stored on the `subscription_plan_data` field. | -| `AVAILABILITY_PERIOD` | The `CatalogObject` instance is of the [CatalogAvailabilityPeriod](../../doc/models/catalog-availability-period.md) type and represents an availability period.
The availability period specific data must be stored on the `availability_period_data` field. | - diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md deleted file mode 100644 index e1470eb1..00000000 --- a/doc/models/catalog-object.md +++ /dev/null @@ -1,153 +0,0 @@ - -# Catalog Object - -The wrapper object for the catalog entries of a given object type. - -Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. - -For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - -In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. - -For a more detailed discussion of the Catalog data model, please see the -[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - -## Structure - -`CatalogObject` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`string(CatalogObjectType)`](../../doc/models/catalog-object-type.md) | Required | Possible types of CatalogObjects returned from the catalog, each
containing type-specific properties in the `*_data` field corresponding to the specified object type. | getType(): string | setType(string type): void | -| `id` | `string` | Required | An identifier to reference this object in the catalog. When a new `CatalogObject`
is inserted, the client should set the id to a temporary identifier starting with
a "`#`" character. Other objects being inserted or updated within the same request
may use this identifier to refer to the new object.

When the server receives the new object, it will supply a unique identifier that
replaces the temporary identifier for all future references.
**Constraints**: *Minimum Length*: `1` | getId(): string | setId(string id): void | -| `updatedAt` | `?string` | Optional | Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"`
would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `version` | `?int` | Optional | The version of the object. When updating an object, the version supplied
must match the version in the database, otherwise the write will be rejected as conflicting. | getVersion(): ?int | setVersion(?int version): void | -| `isDeleted` | `?bool` | Optional | If `true`, the object has been deleted from the database. Must be `false` for new objects
being inserted. When deleted, the `updated_at` field will equal the deletion time. | getIsDeleted(): ?bool | setIsDeleted(?bool isDeleted): void | -| `customAttributeValues` | [`?array`](../../doc/models/catalog-custom-attribute-value.md) | Optional | A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair
is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute
value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition)
object defined by the application making the request.

If the `CatalogCustomAttributeDefinition` object is
defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by
the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of
`"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"`
if the application making the request is different from the application defining the custom attribute definition.
Otherwise, the key used in the map is simply `"cocoa_brand"`.

Application-defined custom attributes are set at a global (location-independent) level.
Custom attribute values are intended to store additional information about a catalog object
or associations with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.). | getCustomAttributeValues(): ?array | setCustomAttributeValues(?array customAttributeValues): void | -| `catalogV1Ids` | [`?(CatalogV1Id[])`](../../doc/models/catalog-v1-id.md) | Optional | The Connect v1 IDs for this object at each location where it is present, where they
differ from the object's Connect V2 ID. The field will only be present for objects that
have been created or modified by legacy APIs. | getCatalogV1Ids(): ?array | setCatalogV1Ids(?array catalogV1Ids): void | -| `presentAtAllLocations` | `?bool` | Optional | If `true`, this object is present at all locations (including future locations), except where specified in
the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations),
except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. | getPresentAtAllLocations(): ?bool | setPresentAtAllLocations(?bool presentAtAllLocations): void | -| `presentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is present, even if `present_at_all_locations` is `false`.
This can include locations that are deactivated. | getPresentAtLocationIds(): ?array | setPresentAtLocationIds(?array presentAtLocationIds): void | -| `absentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is not present, even if `present_at_all_locations` is `true`.
This can include locations that are deactivated. | getAbsentAtLocationIds(): ?array | setAbsentAtLocationIds(?array absentAtLocationIds): void | -| `itemData` | [`?CatalogItem`](../../doc/models/catalog-item.md) | Optional | A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. | getItemData(): ?CatalogItem | setItemData(?CatalogItem itemData): void | -| `categoryData` | [`?CatalogCategory`](../../doc/models/catalog-category.md) | Optional | A category to which a `CatalogItem` instance belongs. | getCategoryData(): ?CatalogCategory | setCategoryData(?CatalogCategory categoryData): void | -| `itemVariationData` | [`?CatalogItemVariation`](../../doc/models/catalog-item-variation.md) | Optional | An item variation, representing a product for sale, in the Catalog object model. Each [item](../../doc/models/catalog-item.md) must have at least one
item variation and can have at most 250 item variations.

An item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked
number of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both
stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass
variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be
converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes
the `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count
decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion. | getItemVariationData(): ?CatalogItemVariation | setItemVariationData(?CatalogItemVariation itemVariationData): void | -| `taxData` | [`?CatalogTax`](../../doc/models/catalog-tax.md) | Optional | A tax applicable to an item. | getTaxData(): ?CatalogTax | setTaxData(?CatalogTax taxData): void | -| `discountData` | [`?CatalogDiscount`](../../doc/models/catalog-discount.md) | Optional | A discount applicable to items. | getDiscountData(): ?CatalogDiscount | setDiscountData(?CatalogDiscount discountData): void | -| `modifierListData` | [`?CatalogModifierList`](../../doc/models/catalog-modifier-list.md) | Optional | For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`.
For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied
text string to be selected for the T-shirt at the time of sale.

For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items
at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type.
For example, a "Condiments" modifier list applicable to a "Hot Dog" item
may contain "Ketchup", "Mustard", and "Relish" modifiers.

A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field
is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item
only once and the `selection_type` field is always set to `SINGLE`. | getModifierListData(): ?CatalogModifierList | setModifierListData(?CatalogModifierList modifierListData): void | -| `modifierData` | [`?CatalogModifier`](../../doc/models/catalog-modifier.md) | Optional | A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a Burger item. | getModifierData(): ?CatalogModifier | setModifierData(?CatalogModifier modifierData): void | -| `timePeriodData` | [`?CatalogTimePeriod`](../../doc/models/catalog-time-period.md) | Optional | Represents a time period - either a single period or a repeating period. | getTimePeriodData(): ?CatalogTimePeriod | setTimePeriodData(?CatalogTimePeriod timePeriodData): void | -| `productSetData` | [`?CatalogProductSet`](../../doc/models/catalog-product-set.md) | Optional | Represents a collection of catalog objects for the purpose of applying a
`PricingRule`. Including a catalog object will include all of its subtypes.
For example, including a category in a product set will include all of its
items and associated item variations in the product set. Including an item in
a product set will also include its item variations. | getProductSetData(): ?CatalogProductSet | setProductSetData(?CatalogProductSet productSetData): void | -| `pricingRuleData` | [`?CatalogPricingRule`](../../doc/models/catalog-pricing-rule.md) | Optional | Defines how discounts are automatically applied to a set of items that match the pricing rule
during the active time period. | getPricingRuleData(): ?CatalogPricingRule | setPricingRuleData(?CatalogPricingRule pricingRuleData): void | -| `imageData` | [`?CatalogImage`](../../doc/models/catalog-image.md) | Optional | An image file to use in Square catalogs. It can be associated with
`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects.
Only the images on items and item variations are exposed in Dashboard.
Only the first image on an item is displayed in Square Point of Sale (SPOS).
Images on items and variations are displayed through Square Online Store.
Images on other object types are for use by 3rd party application developers. | getImageData(): ?CatalogImage | setImageData(?CatalogImage imageData): void | -| `measurementUnitData` | [`?CatalogMeasurementUnit`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | getMeasurementUnitData(): ?CatalogMeasurementUnit | setMeasurementUnitData(?CatalogMeasurementUnit measurementUnitData): void | -| `subscriptionPlanData` | [`?CatalogSubscriptionPlan`](../../doc/models/catalog-subscription-plan.md) | Optional | Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). | getSubscriptionPlanData(): ?CatalogSubscriptionPlan | setSubscriptionPlanData(?CatalogSubscriptionPlan subscriptionPlanData): void | -| `itemOptionData` | [`?CatalogItemOption`](../../doc/models/catalog-item-option.md) | Optional | A group of variations for a `CatalogItem`. | getItemOptionData(): ?CatalogItemOption | setItemOptionData(?CatalogItemOption itemOptionData): void | -| `itemOptionValueData` | [`?CatalogItemOptionValue`](../../doc/models/catalog-item-option-value.md) | Optional | An enumerated value that can link a
`CatalogItemVariation` to an item option as one of
its item option values. | getItemOptionValueData(): ?CatalogItemOptionValue | setItemOptionValueData(?CatalogItemOptionValue itemOptionValueData): void | -| `customAttributeDefinitionData` | [`?CatalogCustomAttributeDefinition`](../../doc/models/catalog-custom-attribute-definition.md) | Optional | Contains information defining a custom attribute. Custom attributes are
intended to store additional information about a catalog object or to associate a
catalog object with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) | getCustomAttributeDefinitionData(): ?CatalogCustomAttributeDefinition | setCustomAttributeDefinitionData(?CatalogCustomAttributeDefinition customAttributeDefinitionData): void | -| `quickAmountsSettingsData` | [`?CatalogQuickAmountsSettings`](../../doc/models/catalog-quick-amounts-settings.md) | Optional | A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. | getQuickAmountsSettingsData(): ?CatalogQuickAmountsSettings | setQuickAmountsSettingsData(?CatalogQuickAmountsSettings quickAmountsSettingsData): void | -| `subscriptionPlanVariationData` | [`?CatalogSubscriptionPlanVariation`](../../doc/models/catalog-subscription-plan-variation.md) | Optional | Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). | getSubscriptionPlanVariationData(): ?CatalogSubscriptionPlanVariation | setSubscriptionPlanVariationData(?CatalogSubscriptionPlanVariation subscriptionPlanVariationData): void | -| `availabilityPeriodData` | [`?CatalogAvailabilityPeriod`](../../doc/models/catalog-availability-period.md) | Optional | Represents a time period of availability. | getAvailabilityPeriodData(): ?CatalogAvailabilityPeriod | setAvailabilityPeriodData(?CatalogAvailabilityPeriod availabilityPeriodData): void | - -## Example (as JSON) - -```json -{ - "type": "TIME_PERIOD", - "id": "id4", - "category_data": { - "object": { - "category_data": { - "name": "Beverages" - }, - "id": "#Beverages", - "present_at_all_locations": true, - "type": "CATEGORY" - } - }, - "tax_data": { - "object": { - "id": "#SalesTax", - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "fee_applies_to_custom_amounts": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX" - } - }, - "discount_data": { - "object": { - "discount_data": { - "discount_type": "FIXED_PERCENTAGE", - "label_color": "red", - "name": "Welcome to the Dark(Roast) Side!", - "percentage": "5.4", - "pin_required": false - }, - "id": "#Maythe4th", - "present_at_all_locations": true, - "type": "DISCOUNT" - } - }, - "modifier_data": { - "object": { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - } - }, - "updated_at": "updated_at0", - "version": 186, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] -} -``` - diff --git a/doc/models/catalog-pricing-rule.md b/doc/models/catalog-pricing-rule.md deleted file mode 100644 index 16b9aeab..00000000 --- a/doc/models/catalog-pricing-rule.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Catalog Pricing Rule - -Defines how discounts are automatically applied to a set of items that match the pricing rule -during the active time period. - -## Structure - -`CatalogPricingRule` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | User-defined name for the pricing rule. For example, "Buy one get one
free" or "10% off". | getName(): ?string | setName(?string name): void | -| `timePeriodIds` | `?(string[])` | Optional | A list of unique IDs for the catalog time periods when
this pricing rule is in effect. If left unset, the pricing rule is always
in effect. | getTimePeriodIds(): ?array | setTimePeriodIds(?array timePeriodIds): void | -| `discountId` | `?string` | Optional | Unique ID for the `CatalogDiscount` to take off
the price of all matched items. | getDiscountId(): ?string | setDiscountId(?string discountId): void | -| `matchProductsId` | `?string` | Optional | Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule
matches within the entire cart, and can match multiple times. This field will always be set. | getMatchProductsId(): ?string | setMatchProductsId(?string matchProductsId): void | -| `applyProductsId` | `?string` | Optional | __Deprecated__: Please use the `exclude_products_id` field to apply
an exclude set instead. Exclude sets allow better control over quantity
ranges and offer more flexibility for which matched items receive a discount.

`CatalogProductSet` to apply the pricing to.
An apply rule matches within the subset of the cart that fits the match rules (the match set).
An apply rule can only match once in the match set.
If not supplied, the pricing will be applied to all products in the match set.
Other products retain their base price, or a price generated by other rules. | getApplyProductsId(): ?string | setApplyProductsId(?string applyProductsId): void | -| `excludeProductsId` | `?string` | Optional | `CatalogProductSet` to exclude from the pricing rule.
An exclude rule matches within the subset of the cart that fits the match rules (the match set).
An exclude rule can only match once in the match set.
If not supplied, the pricing will be applied to all products in the match set.
Other products retain their base price, or a price generated by other rules. | getExcludeProductsId(): ?string | setExcludeProductsId(?string excludeProductsId): void | -| `validFromDate` | `?string` | Optional | Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD). | getValidFromDate(): ?string | setValidFromDate(?string validFromDate): void | -| `validFromLocalTime` | `?string` | Optional | Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial-time format
(HH:MM:SS). Partial seconds will be truncated. | getValidFromLocalTime(): ?string | setValidFromLocalTime(?string validFromLocalTime): void | -| `validUntilDate` | `?string` | Optional | Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD). | getValidUntilDate(): ?string | setValidUntilDate(?string validUntilDate): void | -| `validUntilLocalTime` | `?string` | Optional | Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial-time format
(HH:MM:SS). Partial seconds will be truncated. | getValidUntilLocalTime(): ?string | setValidUntilLocalTime(?string validUntilLocalTime): void | -| `excludeStrategy` | [`?string(ExcludeStrategy)`](../../doc/models/exclude-strategy.md) | Optional | Indicates which products matched by a CatalogPricingRule
will be excluded if the pricing rule uses an exclude set. | getExcludeStrategy(): ?string | setExcludeStrategy(?string excludeStrategy): void | -| `minimumOrderSubtotalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMinimumOrderSubtotalMoney(): ?Money | setMinimumOrderSubtotalMoney(?Money minimumOrderSubtotalMoney): void | -| `customerGroupIdsAny` | `?(string[])` | Optional | A list of IDs of customer groups, the members of which are eligible for discounts specified in this pricing rule.
Notice that a group ID is generated by the Customers API.
If this field is not set, the specified discount applies to matched products sold to anyone whether the buyer
has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified discount
applies only to matched products sold to customers belonging to the specified customer groups. | getCustomerGroupIdsAny(): ?array | setCustomerGroupIdsAny(?array customerGroupIdsAny): void | - -## Example (as JSON) - -```json -{ - "name": "name6", - "time_period_ids": [ - "time_period_ids8" - ], - "discount_id": "discount_id4", - "match_products_id": "match_products_id4", - "apply_products_id": "apply_products_id0" -} -``` - diff --git a/doc/models/catalog-pricing-type.md b/doc/models/catalog-pricing-type.md deleted file mode 100644 index f49d4587..00000000 --- a/doc/models/catalog-pricing-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Pricing Type - -Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - -## Enumeration - -`CatalogPricingType` - -## Fields - -| Name | Description | -| --- | --- | -| `FIXED_PRICING` | The catalog item variation's price is fixed. | -| `VARIABLE_PRICING` | The catalog item variation's price is entered at the time of sale. | - diff --git a/doc/models/catalog-product-set.md b/doc/models/catalog-product-set.md deleted file mode 100644 index 081a3545..00000000 --- a/doc/models/catalog-product-set.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Catalog Product Set - -Represents a collection of catalog objects for the purpose of applying a -`PricingRule`. Including a catalog object will include all of its subtypes. -For example, including a category in a product set will include all of its -items and associated item variations in the product set. Including an item in -a product set will also include its item variations. - -## Structure - -`CatalogProductSet` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | User-defined name for the product set. For example, "Clearance Items"
or "Winter Sale Items". | getName(): ?string | setName(?string name): void | -| `productIdsAny` | `?(string[])` | Optional | Unique IDs for any `CatalogObject` included in this product set. Any
number of these catalog objects can be in an order for a pricing rule to apply.

This can be used with `product_ids_all` in a parent `CatalogProductSet` to
match groups of products for a bulk discount, such as a discount for an
entree and side combo.

Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.

Max: 500 catalog object IDs. | getProductIdsAny(): ?array | setProductIdsAny(?array productIdsAny): void | -| `productIdsAll` | `?(string[])` | Optional | Unique IDs for any `CatalogObject` included in this product set.
All objects in this set must be included in an order for a pricing rule to apply.

Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.

Max: 500 catalog object IDs. | getProductIdsAll(): ?array | setProductIdsAll(?array productIdsAll): void | -| `quantityExact` | `?int` | Optional | If set, there must be exactly this many items from `products_any` or `products_all`
in the cart for the discount to apply.

Cannot be combined with either `quantity_min` or `quantity_max`. | getQuantityExact(): ?int | setQuantityExact(?int quantityExact): void | -| `quantityMin` | `?int` | Optional | If set, there must be at least this many items from `products_any` or `products_all`
in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if
`quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. | getQuantityMin(): ?int | setQuantityMin(?int quantityMin): void | -| `quantityMax` | `?int` | Optional | If set, the pricing rule will apply to a maximum of this many items from
`products_any` or `products_all`. | getQuantityMax(): ?int | setQuantityMax(?int quantityMax): void | -| `allProducts` | `?bool` | Optional | If set to `true`, the product set will include every item in the catalog.
Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. | getAllProducts(): ?bool | setAllProducts(?bool allProducts): void | - -## Example (as JSON) - -```json -{ - "name": "name6", - "product_ids_any": [ - "product_ids_any8" - ], - "product_ids_all": [ - "product_ids_all7" - ], - "quantity_exact": 222, - "quantity_min": 100 -} -``` - diff --git a/doc/models/catalog-query-exact.md b/doc/models/catalog-query-exact.md deleted file mode 100644 index ea0e475a..00000000 --- a/doc/models/catalog-query-exact.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Query Exact - -The query filter to return the search result by exact match of the specified attribute name and value. - -## Structure - -`CatalogQueryExact` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attributeName` | `string` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | getAttributeName(): string | setAttributeName(string attributeName): void | -| `attributeValue` | `string` | Required | The desired value of the search attribute. Matching of the attribute value is case insensitive and can be partial.
For example, if a specified value of "sma", objects with the named attribute value of "Small", "small" are both matched. | getAttributeValue(): string | setAttributeValue(string attributeValue): void | - -## Example (as JSON) - -```json -{ - "attribute_name": "attribute_name4", - "attribute_value": "attribute_value6" -} -``` - diff --git a/doc/models/catalog-query-item-variations-for-item-option-values.md b/doc/models/catalog-query-item-variations-for-item-option-values.md deleted file mode 100644 index f67c1b17..00000000 --- a/doc/models/catalog-query-item-variations-for-item-option-values.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Item Variations for Item Option Values - -The query filter to return the item variations containing the specified item option value IDs. - -## Structure - -`CatalogQueryItemVariationsForItemOptionValues` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemOptionValueIds` | `?(string[])` | Optional | A set of `CatalogItemOptionValue` IDs to be used to find associated
`CatalogItemVariation`s. All ItemVariations that contain all of the given
Item Option Values (in any order) will be returned. | getItemOptionValueIds(): ?array | setItemOptionValueIds(?array itemOptionValueIds): void | - -## Example (as JSON) - -```json -{ - "item_option_value_ids": [ - "item_option_value_ids0", - "item_option_value_ids9", - "item_option_value_ids8" - ] -} -``` - diff --git a/doc/models/catalog-query-items-for-item-options.md b/doc/models/catalog-query-items-for-item-options.md deleted file mode 100644 index 82e14847..00000000 --- a/doc/models/catalog-query-items-for-item-options.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Catalog Query Items for Item Options - -The query filter to return the items containing the specified item option IDs. - -## Structure - -`CatalogQueryItemsForItemOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemOptionIds` | `?(string[])` | Optional | A set of `CatalogItemOption` IDs to be used to find associated
`CatalogItem`s. All Items that contain all of the given Item Options (in any order)
will be returned. | getItemOptionIds(): ?array | setItemOptionIds(?array itemOptionIds): void | - -## Example (as JSON) - -```json -{ - "item_option_ids": [ - "item_option_ids5", - "item_option_ids6" - ] -} -``` - diff --git a/doc/models/catalog-query-items-for-modifier-list.md b/doc/models/catalog-query-items-for-modifier-list.md deleted file mode 100644 index 7d8a78f2..00000000 --- a/doc/models/catalog-query-items-for-modifier-list.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Items for Modifier List - -The query filter to return the items containing the specified modifier list IDs. - -## Structure - -`CatalogQueryItemsForModifierList` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `modifierListIds` | `string[]` | Required | A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. | getModifierListIds(): array | setModifierListIds(array modifierListIds): void | - -## Example (as JSON) - -```json -{ - "modifier_list_ids": [ - "modifier_list_ids8", - "modifier_list_ids9", - "modifier_list_ids0" - ] -} -``` - diff --git a/doc/models/catalog-query-items-for-tax.md b/doc/models/catalog-query-items-for-tax.md deleted file mode 100644 index d8b943e8..00000000 --- a/doc/models/catalog-query-items-for-tax.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Catalog Query Items for Tax - -The query filter to return the items containing the specified tax IDs. - -## Structure - -`CatalogQueryItemsForTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `taxIds` | `string[]` | Required | A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. | getTaxIds(): array | setTaxIds(array taxIds): void | - -## Example (as JSON) - -```json -{ - "tax_ids": [ - "tax_ids9", - "tax_ids8" - ] -} -``` - diff --git a/doc/models/catalog-query-prefix.md b/doc/models/catalog-query-prefix.md deleted file mode 100644 index 10d655ef..00000000 --- a/doc/models/catalog-query-prefix.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Query Prefix - -The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. - -## Structure - -`CatalogQueryPrefix` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attributeName` | `string` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | getAttributeName(): string | setAttributeName(string attributeName): void | -| `attributePrefix` | `string` | Required | The desired prefix of the search attribute value.
**Constraints**: *Minimum Length*: `1` | getAttributePrefix(): string | setAttributePrefix(string attributePrefix): void | - -## Example (as JSON) - -```json -{ - "attribute_name": "attribute_name8", - "attribute_prefix": "attribute_prefix6" -} -``` - diff --git a/doc/models/catalog-query-range.md b/doc/models/catalog-query-range.md deleted file mode 100644 index 4d3e6875..00000000 --- a/doc/models/catalog-query-range.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Range - -The query filter to return the search result whose named attribute values fall between the specified range. - -## Structure - -`CatalogQueryRange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attributeName` | `string` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | getAttributeName(): string | setAttributeName(string attributeName): void | -| `attributeMinValue` | `?int` | Optional | The desired minimum value for the search attribute (inclusive). | getAttributeMinValue(): ?int | setAttributeMinValue(?int attributeMinValue): void | -| `attributeMaxValue` | `?int` | Optional | The desired maximum value for the search attribute (inclusive). | getAttributeMaxValue(): ?int | setAttributeMaxValue(?int attributeMaxValue): void | - -## Example (as JSON) - -```json -{ - "attribute_name": "attribute_name0", - "attribute_min_value": 184, - "attribute_max_value": 94 -} -``` - diff --git a/doc/models/catalog-query-set.md b/doc/models/catalog-query-set.md deleted file mode 100644 index 3305161a..00000000 --- a/doc/models/catalog-query-set.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Catalog Query Set - -The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of -the `attribute_values`. - -## Structure - -`CatalogQuerySet` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attributeName` | `string` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | getAttributeName(): string | setAttributeName(string attributeName): void | -| `attributeValues` | `string[]` | Required | The desired values of the search attribute. Matching of the attribute values is exact and case insensitive.
A maximum of 250 values may be searched in a request. | getAttributeValues(): array | setAttributeValues(array attributeValues): void | - -## Example (as JSON) - -```json -{ - "attribute_name": "attribute_name0", - "attribute_values": [ - "attribute_values8" - ] -} -``` - diff --git a/doc/models/catalog-query-sorted-attribute.md b/doc/models/catalog-query-sorted-attribute.md deleted file mode 100644 index b8d67edd..00000000 --- a/doc/models/catalog-query-sorted-attribute.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Sorted Attribute - -The query expression to specify the key to sort search results. - -## Structure - -`CatalogQuerySortedAttribute` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attributeName` | `string` | Required | The attribute whose value is used as the sort key.
**Constraints**: *Minimum Length*: `1` | getAttributeName(): string | setAttributeName(string attributeName): void | -| `initialAttributeValue` | `?string` | Optional | The first attribute value to be returned by the query. Ascending sorts will return only
objects with this value or greater, while descending sorts will return only objects with this value
or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts). | getInitialAttributeValue(): ?string | setInitialAttributeValue(?string initialAttributeValue): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "attribute_name": "attribute_name2", - "initial_attribute_value": "initial_attribute_value4", - "sort_order": "DESC" -} -``` - diff --git a/doc/models/catalog-query-text.md b/doc/models/catalog-query-text.md deleted file mode 100644 index 1fddbdfb..00000000 --- a/doc/models/catalog-query-text.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Query Text - -The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. - -## Structure - -`CatalogQueryText` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `keywords` | `string[]` | Required | A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. | getKeywords(): array | setKeywords(array keywords): void | - -## Example (as JSON) - -```json -{ - "keywords": [ - "keywords1" - ] -} -``` - diff --git a/doc/models/catalog-query.md b/doc/models/catalog-query.md deleted file mode 100644 index be9e7448..00000000 --- a/doc/models/catalog-query.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Catalog Query - -A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint. - -Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](../../doc/apis/catalog.md#search-catalog-objects). -Any combination of the following types may be used together: - -- [exact_query](../../doc/models/catalog-query-exact.md) -- [prefix_query](../../doc/models/catalog-query-prefix.md) -- [range_query](../../doc/models/catalog-query-range.md) -- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md) -- [text_query](../../doc/models/catalog-query-text.md) - -All other query types cannot be combined with any others. - -When a query filter is based on an attribute, the attribute must be searchable. -Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters. - -Searchable attribute and objects queryable by searchable attributes: - -- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue` -- `description`: `CatalogItem`, `CatalogItemOptionValue` -- `abbreviation`: `CatalogItem` -- `upc`: `CatalogItemVariation` -- `sku`: `CatalogItemVariation` -- `caption`: `CatalogImage` -- `display_name`: `CatalogItemOption` - -For example, to search for [CatalogItem](../../doc/models/catalog-item.md) objects by searchable attributes, you can use -the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. - -## Structure - -`CatalogQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortedAttributeQuery` | [`?CatalogQuerySortedAttribute`](../../doc/models/catalog-query-sorted-attribute.md) | Optional | The query expression to specify the key to sort search results. | getSortedAttributeQuery(): ?CatalogQuerySortedAttribute | setSortedAttributeQuery(?CatalogQuerySortedAttribute sortedAttributeQuery): void | -| `exactQuery` | [`?CatalogQueryExact`](../../doc/models/catalog-query-exact.md) | Optional | The query filter to return the search result by exact match of the specified attribute name and value. | getExactQuery(): ?CatalogQueryExact | setExactQuery(?CatalogQueryExact exactQuery): void | -| `setQuery` | [`?CatalogQuerySet`](../../doc/models/catalog-query-set.md) | Optional | The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of
the `attribute_values`. | getSetQuery(): ?CatalogQuerySet | setSetQuery(?CatalogQuerySet setQuery): void | -| `prefixQuery` | [`?CatalogQueryPrefix`](../../doc/models/catalog-query-prefix.md) | Optional | The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. | getPrefixQuery(): ?CatalogQueryPrefix | setPrefixQuery(?CatalogQueryPrefix prefixQuery): void | -| `rangeQuery` | [`?CatalogQueryRange`](../../doc/models/catalog-query-range.md) | Optional | The query filter to return the search result whose named attribute values fall between the specified range. | getRangeQuery(): ?CatalogQueryRange | setRangeQuery(?CatalogQueryRange rangeQuery): void | -| `textQuery` | [`?CatalogQueryText`](../../doc/models/catalog-query-text.md) | Optional | The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. | getTextQuery(): ?CatalogQueryText | setTextQuery(?CatalogQueryText textQuery): void | -| `itemsForTaxQuery` | [`?CatalogQueryItemsForTax`](../../doc/models/catalog-query-items-for-tax.md) | Optional | The query filter to return the items containing the specified tax IDs. | getItemsForTaxQuery(): ?CatalogQueryItemsForTax | setItemsForTaxQuery(?CatalogQueryItemsForTax itemsForTaxQuery): void | -| `itemsForModifierListQuery` | [`?CatalogQueryItemsForModifierList`](../../doc/models/catalog-query-items-for-modifier-list.md) | Optional | The query filter to return the items containing the specified modifier list IDs. | getItemsForModifierListQuery(): ?CatalogQueryItemsForModifierList | setItemsForModifierListQuery(?CatalogQueryItemsForModifierList itemsForModifierListQuery): void | -| `itemsForItemOptionsQuery` | [`?CatalogQueryItemsForItemOptions`](../../doc/models/catalog-query-items-for-item-options.md) | Optional | The query filter to return the items containing the specified item option IDs. | getItemsForItemOptionsQuery(): ?CatalogQueryItemsForItemOptions | setItemsForItemOptionsQuery(?CatalogQueryItemsForItemOptions itemsForItemOptionsQuery): void | -| `itemVariationsForItemOptionValuesQuery` | [`?CatalogQueryItemVariationsForItemOptionValues`](../../doc/models/catalog-query-item-variations-for-item-option-values.md) | Optional | The query filter to return the item variations containing the specified item option value IDs. | getItemVariationsForItemOptionValuesQuery(): ?CatalogQueryItemVariationsForItemOptionValues | setItemVariationsForItemOptionValuesQuery(?CatalogQueryItemVariationsForItemOptionValues itemVariationsForItemOptionValuesQuery): void | - -## Example (as JSON) - -```json -{ - "sorted_attribute_query": { - "attribute_name": "attribute_name0", - "initial_attribute_value": "initial_attribute_value8", - "sort_order": "DESC" - }, - "exact_query": { - "attribute_name": "attribute_name4", - "attribute_value": "attribute_value6" - }, - "set_query": { - "attribute_name": "attribute_name2", - "attribute_values": [ - "attribute_values6" - ] - }, - "prefix_query": { - "attribute_name": "attribute_name6", - "attribute_prefix": "attribute_prefix8" - }, - "range_query": { - "attribute_name": "attribute_name0", - "attribute_min_value": 208, - "attribute_max_value": 138 - } -} -``` - diff --git a/doc/models/catalog-quick-amount-type.md b/doc/models/catalog-quick-amount-type.md deleted file mode 100644 index 4b35cc8c..00000000 --- a/doc/models/catalog-quick-amount-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Quick Amount Type - -Determines the type of a specific Quick Amount. - -## Enumeration - -`CatalogQuickAmountType` - -## Fields - -| Name | Description | -| --- | --- | -| `QUICK_AMOUNT_TYPE_MANUAL` | Quick Amount is created manually by the seller. | -| `QUICK_AMOUNT_TYPE_AUTO` | Quick Amount is generated automatically by machine learning algorithms. | - diff --git a/doc/models/catalog-quick-amount.md b/doc/models/catalog-quick-amount.md deleted file mode 100644 index 738845ce..00000000 --- a/doc/models/catalog-quick-amount.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Catalog Quick Amount - -Represents a Quick Amount in the Catalog. - -## Structure - -`CatalogQuickAmount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`string(CatalogQuickAmountType)`](../../doc/models/catalog-quick-amount-type.md) | Required | Determines the type of a specific Quick Amount. | getType(): string | setType(string type): void | -| `amount` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmount(): Money | setAmount(Money amount): void | -| `score` | `?int` | Optional | Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100].
MANUAL type amount will always have score = 100. | getScore(): ?int | setScore(?int score): void | -| `ordinal` | `?int` | Optional | The order in which this Quick Amount should be displayed. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | - -## Example (as JSON) - -```json -{ - "type": "QUICK_AMOUNT_TYPE_MANUAL", - "amount": { - "amount": 0, - "currency": "LAK" - }, - "score": 12, - "ordinal": 200 -} -``` - diff --git a/doc/models/catalog-quick-amounts-settings-option.md b/doc/models/catalog-quick-amounts-settings-option.md deleted file mode 100644 index 52672a35..00000000 --- a/doc/models/catalog-quick-amounts-settings-option.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Catalog Quick Amounts Settings Option - -Determines a seller's option on Quick Amounts feature. - -## Enumeration - -`CatalogQuickAmountsSettingsOption` - -## Fields - -| Name | Description | -| --- | --- | -| `DISABLED` | Option for seller to disable Quick Amounts. | -| `MANUAL` | Option for seller to choose manually created Quick Amounts. | -| `AUTO` | Option for seller to choose automatically created Quick Amounts. | - diff --git a/doc/models/catalog-quick-amounts-settings.md b/doc/models/catalog-quick-amounts-settings.md deleted file mode 100644 index 5c5ff893..00000000 --- a/doc/models/catalog-quick-amounts-settings.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Catalog Quick Amounts Settings - -A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. - -## Structure - -`CatalogQuickAmountsSettings` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `option` | [`string(CatalogQuickAmountsSettingsOption)`](../../doc/models/catalog-quick-amounts-settings-option.md) | Required | Determines a seller's option on Quick Amounts feature. | getOption(): string | setOption(string option): void | -| `eligibleForAutoAmounts` | `?bool` | Optional | Represents location's eligibility for auto amounts
The boolean should be consistent with whether there are AUTO amounts in the `amounts`. | getEligibleForAutoAmounts(): ?bool | setEligibleForAutoAmounts(?bool eligibleForAutoAmounts): void | -| `amounts` | [`?(CatalogQuickAmount[])`](../../doc/models/catalog-quick-amount.md) | Optional | Represents a set of Quick Amounts at this location. | getAmounts(): ?array | setAmounts(?array amounts): void | - -## Example (as JSON) - -```json -{ - "option": "AUTO", - "eligible_for_auto_amounts": false, - "amounts": [ - { - "type": "QUICK_AMOUNT_TYPE_MANUAL", - "amount": { - "amount": 0, - "currency": "LAK" - }, - "score": 116, - "ordinal": 48 - }, - { - "type": "QUICK_AMOUNT_TYPE_MANUAL", - "amount": { - "amount": 0, - "currency": "LAK" - }, - "score": 116, - "ordinal": 48 - } - ] -} -``` - diff --git a/doc/models/catalog-stock-conversion.md b/doc/models/catalog-stock-conversion.md deleted file mode 100644 index aad6fcd5..00000000 --- a/doc/models/catalog-stock-conversion.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Catalog Stock Conversion - -Represents the rule of conversion between a stockable [CatalogItemVariation](../../doc/models/catalog-item-variation.md) -and a non-stockable sell-by or receive-by `CatalogItemVariation` that -share the same underlying stock. - -## Structure - -`CatalogStockConversion` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `stockableItemVariationId` | `string` | Required | References to the stockable [CatalogItemVariation](entity:CatalogItemVariation)
for this stock conversion. Selling, receiving or recounting the non-stockable `CatalogItemVariation`
defined with a stock conversion results in adjustments of this stockable `CatalogItemVariation`.
This immutable field must reference a stockable `CatalogItemVariation`
that shares the parent [CatalogItem](entity:CatalogItem) of the converted `CatalogItemVariation.`
**Constraints**: *Minimum Length*: `1` | getStockableItemVariationId(): string | setStockableItemVariationId(string stockableItemVariationId): void | -| `stockableQuantity` | `string` | Required | The quantity of the stockable item variation (as identified by `stockable_item_variation_id`)
equivalent to the non-stockable item variation quantity (as specified in `nonstockable_quantity`)
as defined by this stock conversion. It accepts a decimal number in a string format that can take
up to 10 digits before the decimal point and up to 5 digits after the decimal point.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16` | getStockableQuantity(): string | setStockableQuantity(string stockableQuantity): void | -| `nonstockableQuantity` | `string` | Required | The converted equivalent quantity of the non-stockable [CatalogItemVariation](entity:CatalogItemVariation)
in its measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value together
define the conversion ratio between stockable item variation and the non-stockable item variation.
It accepts a decimal number in a string format that can take up to 10 digits before the decimal point
and up to 5 digits after the decimal point.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16` | getNonstockableQuantity(): string | setNonstockableQuantity(string nonstockableQuantity): void | - -## Example (as JSON) - -```json -{ - "stockable_item_variation_id": "stockable_item_variation_id2", - "stockable_quantity": "stockable_quantity0", - "nonstockable_quantity": "nonstockable_quantity2" -} -``` - diff --git a/doc/models/catalog-subscription-plan-variation.md b/doc/models/catalog-subscription-plan-variation.md deleted file mode 100644 index 4797b895..00000000 --- a/doc/models/catalog-subscription-plan-variation.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Catalog Subscription Plan Variation - -Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold. -For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). - -## Structure - -`CatalogSubscriptionPlanVariation` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | The name of the plan variation. | getName(): string | setName(string name): void | -| `phases` | [`SubscriptionPhase[]`](../../doc/models/subscription-phase.md) | Required | A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. | getPhases(): array | setPhases(array phases): void | -| `subscriptionPlanId` | `?string` | Optional | The id of the subscription plan, if there is one. | getSubscriptionPlanId(): ?string | setSubscriptionPlanId(?string subscriptionPlanId): void | -| `monthlyBillingAnchorDate` | `?int` | Optional | The day of the month the billing period starts.
**Constraints**: `>= 1`, `<= 31` | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `canProrate` | `?bool` | Optional | Whether bills for this plan variation can be split for proration. | getCanProrate(): ?bool | setCanProrate(?bool canProrate): void | -| `successorPlanVariationId` | `?string` | Optional | The ID of a "successor" plan variation to this one. If the field is set, and this object is disabled at all
locations, it indicates that this variation is deprecated and the object identified by the successor ID be used in
its stead. | getSuccessorPlanVariationId(): ?string | setSuccessorPlanVariationId(?string successorPlanVariationId): void | - -## Example (as JSON) - -```json -{ - "name": "name2", - "phases": [ - { - "uid": "uid0", - "cadence": "QUARTERLY", - "periods": 112, - "recurring_price_money": { - "amount": 66, - "currency": "ZMW" - }, - "ordinal": 78, - "pricing": { - "type": "STATIC", - "discount_ids": [ - "discount_ids5", - "discount_ids6" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } - } - } - ], - "subscription_plan_id": "subscription_plan_id0", - "monthly_billing_anchor_date": 38, - "can_prorate": false, - "successor_plan_variation_id": "successor_plan_variation_id2" -} -``` - diff --git a/doc/models/catalog-subscription-plan.md b/doc/models/catalog-subscription-plan.md deleted file mode 100644 index 9e7ad4dc..00000000 --- a/doc/models/catalog-subscription-plan.md +++ /dev/null @@ -1,194 +0,0 @@ - -# Catalog Subscription Plan - -Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations. -For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). - -## Structure - -`CatalogSubscriptionPlan` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | The name of the plan. | getName(): string | setName(string name): void | -| `phases` | [`?(SubscriptionPhase[])`](../../doc/models/subscription-phase.md) | Optional | A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this plan.
This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error | getPhases(): ?array | setPhases(?array phases): void | -| `subscriptionPlanVariations` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The list of subscription plan variations available for this product | getSubscriptionPlanVariations(): ?array | setSubscriptionPlanVariations(?array subscriptionPlanVariations): void | -| `eligibleItemIds` | `?(string[])` | Optional | The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. | getEligibleItemIds(): ?array | setEligibleItemIds(?array eligibleItemIds): void | -| `eligibleCategoryIds` | `?(string[])` | Optional | The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations. | getEligibleCategoryIds(): ?array | setEligibleCategoryIds(?array eligibleCategoryIds): void | -| `allItems` | `?bool` | Optional | If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. | getAllItems(): ?bool | setAllItems(?bool allItems): void | - -## Example (as JSON) - -```json -{ - "name": "name6", - "phases": [ - { - "uid": "uid0", - "cadence": "QUARTERLY", - "periods": 112, - "recurring_price_money": { - "amount": 66, - "currency": "ZMW" - }, - "ordinal": 78, - "pricing": { - "type": "STATIC", - "discount_ids": [ - "discount_ids5", - "discount_ids6" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } - } - }, - { - "uid": "uid0", - "cadence": "QUARTERLY", - "periods": 112, - "recurring_price_money": { - "amount": 66, - "currency": "ZMW" - }, - "ordinal": 78, - "pricing": { - "type": "STATIC", - "discount_ids": [ - "discount_ids5", - "discount_ids6" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } - } - }, - { - "uid": "uid0", - "cadence": "QUARTERLY", - "periods": 112, - "recurring_price_money": { - "amount": 66, - "currency": "ZMW" - }, - "ordinal": 78, - "pricing": { - "type": "STATIC", - "discount_ids": [ - "discount_ids5", - "discount_ids6" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } - } - } - ], - "subscription_plan_variations": [ - { - "type": "MODIFIER", - "id": "id4", - "updated_at": "updated_at0", - "version": 208, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "type": "MODIFIER", - "id": "id4", - "updated_at": "updated_at0", - "version": 208, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "eligible_item_ids": [ - "eligible_item_ids8", - "eligible_item_ids7" - ], - "eligible_category_ids": [ - "eligible_category_ids5", - "eligible_category_ids6", - "eligible_category_ids7" - ], - "all_items": false -} -``` - diff --git a/doc/models/catalog-tax.md b/doc/models/catalog-tax.md deleted file mode 100644 index a856a1c9..00000000 --- a/doc/models/catalog-tax.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Catalog Tax - -A tax applicable to an item. - -## Structure - -`CatalogTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `calculationPhase` | [`?string(TaxCalculationPhase)`](../../doc/models/tax-calculation-phase.md) | Optional | When to calculate the taxes due on a cart. | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | -| `inclusionType` | [`?string(TaxInclusionType)`](../../doc/models/tax-inclusion-type.md) | Optional | Whether to the tax amount should be additional to or included in the CatalogItem price. | getInclusionType(): ?string | setInclusionType(?string inclusionType): void | -| `percentage` | `?string` | Optional | The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign.
A value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of the location or a tax consultant. | getPercentage(): ?string | setPercentage(?string percentage): void | -| `appliesToCustomAmounts` | `?bool` | Optional | If `true`, the fee applies to custom amounts entered into the Square Point of Sale
app that are not associated with a particular `CatalogItem`. | getAppliesToCustomAmounts(): ?bool | setAppliesToCustomAmounts(?bool appliesToCustomAmounts): void | -| `enabled` | `?bool` | Optional | A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`). | getEnabled(): ?bool | setEnabled(?bool enabled): void | -| `appliesToProductSetId` | `?string` | Optional | The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product set. | getAppliesToProductSetId(): ?string | setAppliesToProductSetId(?string appliesToProductSetId): void | - -## Example (as JSON) - -```json -{ - "object": { - "id": "#SalesTax", - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "fee_applies_to_custom_amounts": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX" - }, - "name": "name2", - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "inclusion_type": "ADDITIVE", - "percentage": "percentage0", - "applies_to_custom_amounts": false -} -``` - diff --git a/doc/models/catalog-time-period.md b/doc/models/catalog-time-period.md deleted file mode 100644 index bae4fc58..00000000 --- a/doc/models/catalog-time-period.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Time Period - -Represents a time period - either a single period or a repeating period. - -## Structure - -`CatalogTimePeriod` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `event` | `?string` | Optional | An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which
specifies the name, timing, duration and recurrence of this time period.

Example:

```
DTSTART:20190707T180000
DURATION:P2H
RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR
```

Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported.
`DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT`
and `END:VEVENT` is not required in the request. The response will always
include them. | getEvent(): ?string | setEvent(?string event): void | - -## Example (as JSON) - -```json -{ - "event": "event8" -} -``` - diff --git a/doc/models/catalog-v1-id.md b/doc/models/catalog-v1-id.md deleted file mode 100644 index 5e93175c..00000000 --- a/doc/models/catalog-v1-id.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog V1 Id - -A Square API V1 identifier of an item, including the object ID and its associated location ID. - -## Structure - -`CatalogV1Id` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `catalogV1Id` | `?string` | Optional | The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID. | getCatalogV1Id(): ?string | setCatalogV1Id(?string catalogV1Id): void | -| `locationId` | `?string` | Optional | The ID of the `Location` this Connect V1 ID is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "catalog_v1_id": "catalog_v1_id2", - "location_id": "location_id2" -} -``` - diff --git a/doc/models/category-path-to-root-node.md b/doc/models/category-path-to-root-node.md deleted file mode 100644 index bb5590b2..00000000 --- a/doc/models/category-path-to-root-node.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Category Path to Root Node - -A node in the path from a retrieved category to its root node. - -## Structure - -`CategoryPathToRootNode` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `categoryId` | `?string` | Optional | The category's ID. | getCategoryId(): ?string | setCategoryId(?string categoryId): void | -| `categoryName` | `?string` | Optional | The category's name. | getCategoryName(): ?string | setCategoryName(?string categoryName): void | - -## Example (as JSON) - -```json -{ - "category_id": "category_id0", - "category_name": "category_name0" -} -``` - diff --git a/doc/models/change-billing-anchor-date-request.md b/doc/models/change-billing-anchor-date-request.md deleted file mode 100644 index fcb20075..00000000 --- a/doc/models/change-billing-anchor-date-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Change Billing Anchor Date Request - -Defines input parameters in a request to the -[ChangeBillingAnchorDate](../../doc/apis/subscriptions.md#change-billing-anchor-date) endpoint. - -## Structure - -`ChangeBillingAnchorDateRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `monthlyBillingAnchorDate` | `?int` | Optional | The anchor day for the billing cycle.
**Constraints**: `>= 1`, `<= 31` | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `effectiveDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes
place on the subscription.

When this date is unspecified or falls within the current billing cycle, the billing anchor date
is changed immediately. | getEffectiveDate(): ?string | setEffectiveDate(?string effectiveDate): void | - -## Example (as JSON) - -```json -{ - "monthly_billing_anchor_date": 1, - "effective_date": "effective_date8" -} -``` - diff --git a/doc/models/change-billing-anchor-date-response.md b/doc/models/change-billing-anchor-date-response.md deleted file mode 100644 index d8839795..00000000 --- a/doc/models/change-billing-anchor-date-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Change Billing Anchor Date Response - -Defines output parameters in a request to the -[ChangeBillingAnchorDate](../../doc/apis/subscriptions.md#change-billing-anchor-date) endpoint. - -## Structure - -`ChangeBillingAnchorDateResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a single billing anchor date change for the subscription. | getActions(): ?array | setActions(?array actions): void | - -## Example (as JSON) - -```json -{ - "actions": [ - { - "effective_date": "2023-11-01", - "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", - "monthly_billing_anchor_date": 1, - "type": "CHANGE_BILLING_ANCHOR_DATE", - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - } - ], - "subscription": { - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", - "location_id": "S8GWD5R9QB376", - "monthly_billing_anchor_date": 20, - "phases": [ - { - "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", - "ordinal": 0, - "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", - "uid": "98d6f53b-40e1-4714-8827-032fd923be25" - } - ], - "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", - "price_override_money": { - "amount": 2000, - "currency": "USD" - }, - "source": { - "name": "My Application" - }, - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 3, - "start_date": "start_date8" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/change-timing.md b/doc/models/change-timing.md deleted file mode 100644 index 1934eb99..00000000 --- a/doc/models/change-timing.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Change Timing - -Supported timings when a pending change, as an action, takes place to a subscription. - -## Enumeration - -`ChangeTiming` - -## Fields - -| Name | Description | -| --- | --- | -| `IMMEDIATE` | The action occurs immediately. | -| `END_OF_BILLING_CYCLE` | The action occurs at the end of the billing cycle. | - diff --git a/doc/models/charge-request-additional-recipient.md b/doc/models/charge-request-additional-recipient.md deleted file mode 100644 index 2a3127ab..00000000 --- a/doc/models/charge-request-additional-recipient.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Charge Request Additional Recipient - -Represents an additional recipient (other than the merchant) entitled to a portion of the tender. -Support is currently limited to USD, CAD and GBP currencies - -## Structure - -`ChargeRequestAdditionalRecipient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of the tender.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getLocationId(): string | setLocationId(string locationId): void | -| `description` | `string` | Required | The description of the additional recipient.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | getDescription(): string | setDescription(string description): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id6", - "description": "description2", - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/charge-request.md b/doc/models/charge-request.md deleted file mode 100644 index 64131d3a..00000000 --- a/doc/models/charge-request.md +++ /dev/null @@ -1,73 +0,0 @@ - -# Charge Request - -Defines the parameters that can be included in the body of -a request to the [Charge](api-endpoint:Transactions-Charge) endpoint. - -Deprecated - recommend using [CreatePayment](api-endpoint:Payments-CreatePayment) - -## Structure - -`ChargeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
transaction among transactions you've created.

If you're unsure whether a particular transaction succeeded,
you can reattempt it with the same idempotency key without
worrying about double-charging the buyer.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `cardNonce` | `?string` | Optional | A payment token generated from the [Card.tokenize()](https://developer.squareup.com/reference/sdks/web/payments/objects/Card#Card.tokenize) that represents the card
to charge.

The application that provides a payment token to this endpoint must be the
_same application_ that generated the payment token with the Web Payments SDK.
Otherwise, the nonce is invalid.

Do not provide a value for this field if you provide a value for
`customer_card_id`.
**Constraints**: *Maximum Length*: `192` | getCardNonce(): ?string | setCardNonce(?string cardNonce): void | -| `customerCardId` | `?string` | Optional | The ID of the customer card on file to charge. Do
not provide a value for this field if you provide a value for `card_nonce`.

If you provide this value, you _must_ also provide a value for
`customer_id`.
**Constraints**: *Maximum Length*: `192` | getCustomerCardId(): ?string | setCustomerCardId(?string customerCardId): void | -| `delayCapture` | `?bool` | Optional | If `true`, the request will only perform an Auth on the provided
card. You can then later perform either a Capture (with the
[CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint) or a Void
(with the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint).

Default value: `false` | getDelayCapture(): ?bool | setDelayCapture(?bool delayCapture): void | -| `referenceId` | `?string` | Optional | An optional ID you can associate with the transaction for your own
purposes (such as to associate the transaction with an entity ID in your
own database).

This value cannot exceed 40 characters.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | An optional note to associate with the transaction.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | getNote(): ?string | setNote(?string note): void | -| `customerId` | `?string` | Optional | The ID of the customer to associate this transaction with. This field
is required if you provide a value for `customer_card_id`, and optional
otherwise.
**Constraints**: *Maximum Length*: `50` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `billingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | -| `shippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | -| `buyerEmailAddress` | `?string` | Optional | The buyer's email address, if available. This value is optional,
but this transaction is ineligible for chargeback protection if it is not
provided. | getBuyerEmailAddress(): ?string | setBuyerEmailAddress(?string buyerEmailAddress): void | -| `orderId` | `?string` | Optional | The ID of the order to associate with this transaction.

If you provide this value, the `amount_money` value of your request must
__exactly match__ the value of the order's `total_money` field.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | -| `additionalRecipients` | [`?(ChargeRequestAdditionalRecipient[])`](../../doc/models/charge-request-additional-recipient.md) | Optional | The basic primitive of multi-party transaction. The value is optional.
The transaction facilitated by you can be split from here.

If you provide this value, the `amount_money` value in your additional_recipients
must not be more than 90% of the `amount_money` value in the charge request.
The `location_id` must be the valid location of the app owner merchant.

This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission.

This field is currently not supported in sandbox. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | -| `verificationToken` | `?string` | Optional | A token generated by SqPaymentForm's verifyBuyer() that represents
customer's device info and 3ds challenge result. | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | - -## Example (as JSON) - -```json -{ - "additional_recipients": [ - { - "amount_money": { - "amount": 20, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1" - } - ], - "amount_money": { - "amount": 200, - "currency": "USD" - }, - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "card_nonce": "card_nonce_from_square_123", - "delay_capture": false, - "idempotency_key": "74ae1696-b1e3-4328-af6d-f1e04d947a13", - "note": "some optional note", - "reference_id": "some optional reference id", - "shipping_address": { - "address_line_1": "123 Main St", - "administrative_district_level_1": "CA", - "country": "US", - "locality": "San Francisco", - "postal_code": "94114" - }, - "customer_card_id": "customer_card_id0" -} -``` - diff --git a/doc/models/charge-response.md b/doc/models/charge-response.md deleted file mode 100644 index 4a17639e..00000000 --- a/doc/models/charge-response.md +++ /dev/null @@ -1,187 +0,0 @@ - -# Charge Response - -Defines the fields that are included in the response body of -a request to the [Charge](api-endpoint:Transactions-Charge) endpoint. - -One of `errors` or `transaction` is present in a given response (never both). - -## Structure - -`ChargeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `transaction` | [`?Transaction`](../../doc/models/transaction.md) | Optional | Represents a transaction processed with Square, either with the
Connect API or with Square Point of Sale.

The `tenders` field of this object lists all methods of payment used to pay in
the transaction. | getTransaction(): ?Transaction | setTransaction(?Transaction transaction): void | - -## Example (as JSON) - -```json -{ - "transaction": { - "created_at": "2016-03-10T22:57:56Z", - "id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "location_id": "18YC4JDH91E1H", - "product": "EXTERNAL_API", - "reference_id": "some optional reference id", - "tenders": [ - { - "additional_recipients": [ - { - "amount_money": { - "amount": 20, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1", - "receivable_id": "ISu5xwxJ5v0CMJTQq7RvqyMF" - } - ], - "amount_money": { - "amount": 200, - "currency": "USD" - }, - "card_details": { - "card": { - "card_brand": "VISA", - "last_4": "1111" - }, - "entry_method": "KEYED", - "status": "CAPTURED" - }, - "created_at": "2016-03-10T22:57:56Z", - "id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "location_id": "18YC4JDH91E1H", - "note": "some optional note", - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "type": "CARD" - } - ], - "refunds": [ - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/checkout-location-settings-branding-button-shape.md b/doc/models/checkout-location-settings-branding-button-shape.md deleted file mode 100644 index 788cac88..00000000 --- a/doc/models/checkout-location-settings-branding-button-shape.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Checkout Location Settings Branding Button Shape - -## Enumeration - -`CheckoutLocationSettingsBrandingButtonShape` - -## Fields - -| Name | -| --- | -| `SQUARED` | -| `ROUNDED` | -| `PILL` | - diff --git a/doc/models/checkout-location-settings-branding-header-type.md b/doc/models/checkout-location-settings-branding-header-type.md deleted file mode 100644 index b78204a8..00000000 --- a/doc/models/checkout-location-settings-branding-header-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Checkout Location Settings Branding Header Type - -## Enumeration - -`CheckoutLocationSettingsBrandingHeaderType` - -## Fields - -| Name | -| --- | -| `BUSINESS_NAME` | -| `FRAMED_LOGO` | -| `FULL_WIDTH_LOGO` | - diff --git a/doc/models/checkout-location-settings-branding.md b/doc/models/checkout-location-settings-branding.md deleted file mode 100644 index 4887e3c5..00000000 --- a/doc/models/checkout-location-settings-branding.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Checkout Location Settings Branding - -## Structure - -`CheckoutLocationSettingsBranding` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `headerType` | [`?string(CheckoutLocationSettingsBrandingHeaderType)`](../../doc/models/checkout-location-settings-branding-header-type.md) | Optional | - | getHeaderType(): ?string | setHeaderType(?string headerType): void | -| `buttonColor` | `?string` | Optional | The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF").
**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7` | getButtonColor(): ?string | setButtonColor(?string buttonColor): void | -| `buttonShape` | [`?string(CheckoutLocationSettingsBrandingButtonShape)`](../../doc/models/checkout-location-settings-branding-button-shape.md) | Optional | - | getButtonShape(): ?string | setButtonShape(?string buttonShape): void | - -## Example (as JSON) - -```json -{ - "header_type": "FULL_WIDTH_LOGO", - "button_color": "button_color2", - "button_shape": "ROUNDED" -} -``` - diff --git a/doc/models/checkout-location-settings-coupons.md b/doc/models/checkout-location-settings-coupons.md deleted file mode 100644 index 8ca0bcf9..00000000 --- a/doc/models/checkout-location-settings-coupons.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Checkout Location Settings Coupons - -## Structure - -`CheckoutLocationSettingsCoupons` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `enabled` | `?bool` | Optional | Indicates whether coupons are enabled for this location. | getEnabled(): ?bool | setEnabled(?bool enabled): void | - -## Example (as JSON) - -```json -{ - "enabled": false -} -``` - diff --git a/doc/models/checkout-location-settings-policy.md b/doc/models/checkout-location-settings-policy.md deleted file mode 100644 index da092569..00000000 --- a/doc/models/checkout-location-settings-policy.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Checkout Location Settings Policy - -## Structure - -`CheckoutLocationSettingsPolicy` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies. | getUid(): ?string | setUid(?string uid): void | -| `title` | `?string` | Optional | The title of the policy. This is required when setting the description, though you can update it in a different request.
**Constraints**: *Maximum Length*: `50` | getTitle(): ?string | setTitle(?string title): void | -| `description` | `?string` | Optional | The description of the policy.
**Constraints**: *Maximum Length*: `4096` | getDescription(): ?string | setDescription(?string description): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title6", - "description": "description0" -} -``` - diff --git a/doc/models/checkout-location-settings-tipping.md b/doc/models/checkout-location-settings-tipping.md deleted file mode 100644 index 81e0d882..00000000 --- a/doc/models/checkout-location-settings-tipping.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Checkout Location Settings Tipping - -## Structure - -`CheckoutLocationSettingsTipping` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `percentages` | `?(int[])` | Optional | Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. | getPercentages(): ?array | setPercentages(?array percentages): void | -| `smartTippingEnabled` | `?bool` | Optional | Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows:
If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3.
If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%.
You can set custom percentage amounts with the `percentages` field. | getSmartTippingEnabled(): ?bool | setSmartTippingEnabled(?bool smartTippingEnabled): void | -| `defaultPercent` | `?int` | Optional | Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. | getDefaultPercent(): ?int | setDefaultPercent(?int defaultPercent): void | -| `smartTips` | [`?(Money[])`](../../doc/models/money.md) | Optional | Show the Smart Tip Amounts for this location. | getSmartTips(): ?array | setSmartTips(?array smartTips): void | -| `defaultSmartTip` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getDefaultSmartTip(): ?Money | setDefaultSmartTip(?Money defaultSmartTip): void | - -## Example (as JSON) - -```json -{ - "percentages": [ - 192, - 193 - ], - "smart_tipping_enabled": false, - "default_percent": 72, - "smart_tips": [ - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - } - ], - "default_smart_tip": { - "amount": 58, - "currency": "KWD" - } -} -``` - diff --git a/doc/models/checkout-location-settings.md b/doc/models/checkout-location-settings.md deleted file mode 100644 index 4d8c06c7..00000000 --- a/doc/models/checkout-location-settings.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Checkout Location Settings - -## Structure - -`CheckoutLocationSettings` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the location that these settings apply to. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `customerNotesEnabled` | `?bool` | Optional | Indicates whether customers are allowed to leave notes at checkout. | getCustomerNotesEnabled(): ?bool | setCustomerNotesEnabled(?bool customerNotesEnabled): void | -| `policies` | [`?(CheckoutLocationSettingsPolicy[])`](../../doc/models/checkout-location-settings-policy.md) | Optional | Policy information is displayed at the bottom of the checkout pages.
You can set a maximum of two policies. | getPolicies(): ?array | setPolicies(?array policies): void | -| `branding` | [`?CheckoutLocationSettingsBranding`](../../doc/models/checkout-location-settings-branding.md) | Optional | - | getBranding(): ?CheckoutLocationSettingsBranding | setBranding(?CheckoutLocationSettingsBranding branding): void | -| `tipping` | [`?CheckoutLocationSettingsTipping`](../../doc/models/checkout-location-settings-tipping.md) | Optional | - | getTipping(): ?CheckoutLocationSettingsTipping | setTipping(?CheckoutLocationSettingsTipping tipping): void | -| `coupons` | [`?CheckoutLocationSettingsCoupons`](../../doc/models/checkout-location-settings-coupons.md) | Optional | - | getCoupons(): ?CheckoutLocationSettingsCoupons | setCoupons(?CheckoutLocationSettingsCoupons coupons): void | -| `updatedAt` | `?string` | Optional | The timestamp when the settings were last updated, in RFC 3339 format.
Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
UTC: 2020-01-26T02:25:34Z
Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id4", - "customer_notes_enabled": false, - "policies": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8" - }, - { - "uid": "uid8", - "title": "title4", - "description": "description8" - } - ], - "branding": { - "header_type": "FULL_WIDTH_LOGO", - "button_color": "button_color2", - "button_shape": "PILL" - }, - "tipping": { - "percentages": [ - 246, - 247 - ], - "smart_tipping_enabled": false, - "default_percent": 46, - "smart_tips": [ - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - } - ], - "default_smart_tip": { - "amount": 58, - "currency": "KWD" - } - } -} -``` - diff --git a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md deleted file mode 100644 index 3288f551..00000000 --- a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range - -A range of purchase price that qualifies. - -## Structure - -`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `min` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMin(): Money | setMin(Money min): void | -| `max` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMax(): Money | setMax(Money max): void | - -## Example (as JSON) - -```json -{ - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } -} -``` - diff --git a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md deleted file mode 100644 index e983896f..00000000 --- a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Afterpay Clearpay - -The settings allowed for AfterpayClearpay. - -## Structure - -`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderEligibilityRange` | [`?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | getOrderEligibilityRange(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange | setOrderEligibilityRange(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange orderEligibilityRange): void | -| `itemEligibilityRange` | [`?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | getItemEligibilityRange(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange | setItemEligibilityRange(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange itemEligibilityRange): void | -| `enabled` | `?bool` | Optional | Indicates whether the payment method is enabled for the account. | getEnabled(): ?bool | setEnabled(?bool enabled): void | - -## Example (as JSON) - -```json -{ - "order_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "item_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "enabled": false -} -``` - diff --git a/doc/models/checkout-merchant-settings-payment-methods-payment-method.md b/doc/models/checkout-merchant-settings-payment-methods-payment-method.md deleted file mode 100644 index 8ba99f7d..00000000 --- a/doc/models/checkout-merchant-settings-payment-methods-payment-method.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Payment Method - -The settings allowed for a payment method. - -## Structure - -`CheckoutMerchantSettingsPaymentMethodsPaymentMethod` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `enabled` | `?bool` | Optional | Indicates whether the payment method is enabled for the account. | getEnabled(): ?bool | setEnabled(?bool enabled): void | - -## Example (as JSON) - -```json -{ - "enabled": false -} -``` - diff --git a/doc/models/checkout-merchant-settings-payment-methods.md b/doc/models/checkout-merchant-settings-payment-methods.md deleted file mode 100644 index d061537a..00000000 --- a/doc/models/checkout-merchant-settings-payment-methods.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Checkout Merchant Settings Payment Methods - -## Structure - -`CheckoutMerchantSettingsPaymentMethods` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `applePay` | [`?CheckoutMerchantSettingsPaymentMethodsPaymentMethod`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | getApplePay(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod | setApplePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod applePay): void | -| `googlePay` | [`?CheckoutMerchantSettingsPaymentMethodsPaymentMethod`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | getGooglePay(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod | setGooglePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod googlePay): void | -| `cashApp` | [`?CheckoutMerchantSettingsPaymentMethodsPaymentMethod`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | getCashApp(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod | setCashApp(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod cashApp): void | -| `afterpayClearpay` | [`?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md) | Optional | The settings allowed for AfterpayClearpay. | getAfterpayClearpay(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay | setAfterpayClearpay(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay afterpayClearpay): void | - -## Example (as JSON) - -```json -{ - "apple_pay": { - "enabled": false - }, - "google_pay": { - "enabled": false - }, - "cash_app": { - "enabled": false - }, - "afterpay_clearpay": { - "order_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "item_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "enabled": false - } -} -``` - diff --git a/doc/models/checkout-merchant-settings.md b/doc/models/checkout-merchant-settings.md deleted file mode 100644 index d91a48fc..00000000 --- a/doc/models/checkout-merchant-settings.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Checkout Merchant Settings - -## Structure - -`CheckoutMerchantSettings` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentMethods` | [`?CheckoutMerchantSettingsPaymentMethods`](../../doc/models/checkout-merchant-settings-payment-methods.md) | Optional | - | getPaymentMethods(): ?CheckoutMerchantSettingsPaymentMethods | setPaymentMethods(?CheckoutMerchantSettingsPaymentMethods paymentMethods): void | -| `updatedAt` | `?string` | Optional | The timestamp when the settings were last updated, in RFC 3339 format.
Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
UTC: 2020-01-26T02:25:34Z
Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "payment_methods": { - "apple_pay": { - "enabled": false - }, - "google_pay": { - "enabled": false - }, - "cash_app": { - "enabled": false - }, - "afterpay_clearpay": { - "order_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "item_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "enabled": false - } - }, - "updated_at": "updated_at0" -} -``` - diff --git a/doc/models/checkout-options-payment-type.md b/doc/models/checkout-options-payment-type.md deleted file mode 100644 index 3ea1b1ce..00000000 --- a/doc/models/checkout-options-payment-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Checkout Options Payment Type - -## Enumeration - -`CheckoutOptionsPaymentType` - -## Fields - -| Name | Description | -| --- | --- | -| `CARD_PRESENT` | Accept credit card or debit card payments via tap, dip or swipe. | -| `MANUAL_CARD_ENTRY` | Launches the manual credit or debit card entry screen for the buyer to complete. | -| `FELICA_ID` | Launches the iD checkout screen for the buyer to complete. | -| `FELICA_QUICPAY` | Launches the QUICPay checkout screen for the buyer to complete. | -| `FELICA_TRANSPORTATION_GROUP` | Launches the Transportation Group checkout screen for the buyer to complete. | -| `FELICA_ALL` | Launches a checkout screen for the buyer on the Square Terminal that
allows them to select a specific FeliCa brand or select the check balance screen. | -| `PAYPAY` | Replaced by `QR_CODE`. | -| `QR_CODE` | Launches Square's QR Code checkout screen for the buyer to complete.
Displays a single code that supports all digital wallets connected to the target
Seller location (e.g. PayPay) | - diff --git a/doc/models/checkout-options.md b/doc/models/checkout-options.md deleted file mode 100644 index c5e7a3d1..00000000 --- a/doc/models/checkout-options.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Checkout Options - -## Structure - -`CheckoutOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `allowTipping` | `?bool` | Optional | Indicates whether the payment allows tipping. | getAllowTipping(): ?bool | setAllowTipping(?bool allowTipping): void | -| `customFields` | [`?(CustomField[])`](../../doc/models/custom-field.md) | Optional | The custom fields requesting information from the buyer. | getCustomFields(): ?array | setCustomFields(?array customFields): void | -| `subscriptionPlanId` | `?string` | Optional | The ID of the subscription plan for the buyer to pay and subscribe.
For more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout).
**Constraints**: *Maximum Length*: `255` | getSubscriptionPlanId(): ?string | setSubscriptionPlanId(?string subscriptionPlanId): void | -| `redirectUrl` | `?string` | Optional | The confirmation page URL to redirect the buyer to after Square processes the payment.
**Constraints**: *Maximum Length*: `2048` | getRedirectUrl(): ?string | setRedirectUrl(?string redirectUrl): void | -| `merchantSupportEmail` | `?string` | Optional | The email address that buyers can use to contact the seller.
**Constraints**: *Maximum Length*: `256` | getMerchantSupportEmail(): ?string | setMerchantSupportEmail(?string merchantSupportEmail): void | -| `askForShippingAddress` | `?bool` | Optional | Indicates whether to include the address fields in the payment form. | getAskForShippingAddress(): ?bool | setAskForShippingAddress(?bool askForShippingAddress): void | -| `acceptedPaymentMethods` | [`?AcceptedPaymentMethods`](../../doc/models/accepted-payment-methods.md) | Optional | - | getAcceptedPaymentMethods(): ?AcceptedPaymentMethods | setAcceptedPaymentMethods(?AcceptedPaymentMethods acceptedPaymentMethods): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `shippingFee` | [`?ShippingFee`](../../doc/models/shipping-fee.md) | Optional | - | getShippingFee(): ?ShippingFee | setShippingFee(?ShippingFee shippingFee): void | -| `enableCoupon` | `?bool` | Optional | Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form. | getEnableCoupon(): ?bool | setEnableCoupon(?bool enableCoupon): void | -| `enableLoyalty` | `?bool` | Optional | Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both. | getEnableLoyalty(): ?bool | setEnableLoyalty(?bool enableLoyalty): void | - -## Example (as JSON) - -```json -{ - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id0", - "redirect_url": "redirect_url4", - "merchant_support_email": "merchant_support_email0" -} -``` - diff --git a/doc/models/checkout.md b/doc/models/checkout.md deleted file mode 100644 index 00d3fb64..00000000 --- a/doc/models/checkout.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Checkout - -Square Checkout lets merchants accept online payments for supported -payment types using a checkout workflow hosted on squareup.com. - -## Structure - -`Checkout` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | ID generated by Square Checkout when a new checkout is requested. | getId(): ?string | setId(?string id): void | -| `checkoutPageUrl` | `?string` | Optional | The URL that the buyer's browser should be redirected to after the
checkout is completed. | getCheckoutPageUrl(): ?string | setCheckoutPageUrl(?string checkoutPageUrl): void | -| `askForShippingAddress` | `?bool` | Optional | If `true`, Square Checkout will collect shipping information on your
behalf and store that information with the transaction information in your
Square Dashboard.

Default: `false`. | getAskForShippingAddress(): ?bool | setAskForShippingAddress(?bool askForShippingAddress): void | -| `merchantSupportEmail` | `?string` | Optional | The email address to display on the Square Checkout confirmation page
and confirmation email that the buyer can use to contact the merchant.

If this value is not set, the confirmation page and email will display the
primary email address associated with the merchant's Square account.

Default: none; only exists if explicitly set. | getMerchantSupportEmail(): ?string | setMerchantSupportEmail(?string merchantSupportEmail): void | -| `prePopulateBuyerEmail` | `?string` | Optional | If provided, the buyer's email is pre-populated on the checkout page
as an editable text field.

Default: none; only exists if explicitly set. | getPrePopulateBuyerEmail(): ?string | setPrePopulateBuyerEmail(?string prePopulateBuyerEmail): void | -| `prePopulateShippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getPrePopulateShippingAddress(): ?Address | setPrePopulateShippingAddress(?Address prePopulateShippingAddress): void | -| `redirectUrl` | `?string` | Optional | The URL to redirect to after checkout is completed with `checkoutId`,
Square's `orderId`, `transactionId`, and `referenceId` appended as URL
parameters. For example, if the provided redirect_url is
`http://www.example.com/order-complete`, a successful transaction redirects
the customer to:

http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx

If you do not provide a redirect URL, Square Checkout will display an order
confirmation page on your behalf; however Square strongly recommends that
you provide a redirect URL so you can verify the transaction results and
finalize the order through your existing/normal confirmation workflow. | getRedirectUrl(): ?string | setRedirectUrl(?string redirectUrl): void | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `createdAt` | `?string` | Optional | The time when the checkout was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `additionalRecipients` | [`?(AdditionalRecipient[])`](../../doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this checkout.
For example, fees assessed on the purchase by a third party integration. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "checkout_page_url": "checkout_page_url4", - "ask_for_shipping_address": false, - "merchant_support_email": "merchant_support_email8", - "pre_populate_buyer_email": "pre_populate_buyer_email2" -} -``` - diff --git a/doc/models/clearpay-details.md b/doc/models/clearpay-details.md deleted file mode 100644 index 38d7e9e5..00000000 --- a/doc/models/clearpay-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Clearpay Details - -Additional details about Clearpay payments. - -## Structure - -`ClearpayDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `emailAddress` | `?string` | Optional | Email address on the buyer's Clearpay account.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | - -## Example (as JSON) - -```json -{ - "email_address": "email_address6" -} -``` - diff --git a/doc/models/clone-order-request.md b/doc/models/clone-order-request.md deleted file mode 100644 index 732d472c..00000000 --- a/doc/models/clone-order-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Clone Order Request - -Defines the fields that are included in requests to the -[CloneOrder](../../doc/apis/orders.md#clone-order) endpoint. - -## Structure - -`CloneOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `string` | Required | The ID of the order to clone. | getOrderId(): string | setOrderId(string orderId): void | -| `version` | `?int` | Optional | An optional order version for concurrency protection.

If a version is provided, it must match the latest stored version of the order to clone.
If a version is not provided, the API clones the latest version. | getVersion(): ?int | setVersion(?int version): void | -| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this clone request.

If you are unsure whether a particular order was cloned successfully,
you can reattempt the call with the same idempotency key without
worrying about creating duplicate cloned orders.
The originally cloned order is returned.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "UNIQUE_STRING", - "order_id": "ZAISEM52YcpmcWAzERDOyiWS123", - "version": 3 -} -``` - diff --git a/doc/models/clone-order-response.md b/doc/models/clone-order-response.md deleted file mode 100644 index 4288480f..00000000 --- a/doc/models/clone-order-response.md +++ /dev/null @@ -1,333 +0,0 @@ - -# Clone Order Response - -Defines the fields that are included in the response body of -a request to the [CloneOrder](../../doc/apis/orders.md#clone-order) endpoint. - -## Structure - -`CloneOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "order": { - "created_at": "2020-01-17T20:47:53.293Z", - "discounts": [ - { - "applied_money": { - "amount": 30, - "currency": "USD" - }, - "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", - "name": "Membership Discount", - "percentage": "0.5", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "membership-discount" - }, - { - "applied_money": { - "amount": 303, - "currency": "USD" - }, - "name": "Labor Day Sale", - "percentage": "5", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "labor-day-sale" - }, - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "name": "Sale - $1.00 off", - "scope": "LINE_ITEM", - "type": "FIXED_AMOUNT", - "uid": "one-dollar-off" - } - ], - "id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "line_items": [ - { - "applied_discounts": [ - { - "applied_money": { - "amount": 8, - "currency": "USD" - }, - "discount_uid": "membership-discount", - "uid": "jWdgP1TpHPFBuVrz81mXVC" - }, - { - "applied_money": { - "amount": 79, - "currency": "USD" - }, - "discount_uid": "labor-day-sale", - "uid": "jnZOjjVY57eRcQAVgEwFuC" - } - ], - "applied_taxes": [ - { - "applied_money": { - "amount": 136, - "currency": "USD" - }, - "tax_uid": "state-sales-tax", - "uid": "aKG87ArnDpvMLSZJHxWUl" - } - ], - "base_price_money": { - "amount": 1599, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 1599, - "currency": "USD" - }, - "name": "New York Strip Steak", - "quantity": "1", - "total_discount_money": { - "amount": 87, - "currency": "USD" - }, - "total_money": { - "amount": 1648, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 136, - "currency": "USD" - }, - "uid": "8uSwfzvUImn3IRrvciqlXC", - "variation_total_price_money": { - "amount": 1599, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "applied_discounts": [ - { - "applied_money": { - "amount": 22, - "currency": "USD" - }, - "discount_uid": "membership-discount", - "uid": "nUXvdsIItfKko0dbYtY58C" - }, - { - "applied_money": { - "amount": 224, - "currency": "USD" - }, - "discount_uid": "labor-day-sale", - "uid": "qSdkOOOernlVQqsJ94SPjB" - }, - { - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "discount_uid": "one-dollar-off", - "uid": "y7bVl4njrWAnfDwmz19izB" - } - ], - "applied_taxes": [ - { - "applied_money": { - "amount": 374, - "currency": "USD" - }, - "tax_uid": "state-sales-tax", - "uid": "v1dAgrfUVUPTnVTf9sRPz" - } - ], - "base_price_money": { - "amount": 2200, - "currency": "USD" - }, - "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", - "gross_sales_money": { - "amount": 4500, - "currency": "USD" - }, - "modifiers": [ - { - "base_price_money": { - "amount": 50, - "currency": "USD" - }, - "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", - "name": "Well", - "total_price_money": { - "amount": 100, - "currency": "USD" - }, - "uid": "Lo3qMMckDluu9Qsb58d4CC" - } - ], - "name": "New York Steak", - "quantity": "2", - "total_discount_money": { - "amount": 346, - "currency": "USD" - }, - "total_money": { - "amount": 4528, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 374, - "currency": "USD" - }, - "uid": "v8ZuEXpOJpb0bazLuvrLDB", - "variation_name": "Larger", - "variation_total_price_money": { - "amount": 4400, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4" - } - ], - "location_id": "057P5VYJ4A5X1", - "net_amounts": { - "discount_money": { - "amount": 433, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 510, - "currency": "USD" - }, - "tip_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 6176, - "currency": "USD" - } - }, - "reference_id": "my-order-001", - "source": { - "name": "My App" - }, - "state": "DRAFT", - "taxes": [ - { - "applied_money": { - "amount": 510, - "currency": "USD" - }, - "name": "State Sales Tax", - "percentage": "9", - "scope": "ORDER", - "type": "ADDITIVE", - "uid": "state-sales-tax" - } - ], - "total_discount_money": { - "amount": 433, - "currency": "USD" - }, - "total_money": { - "amount": 6176, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 510, - "currency": "USD" - }, - "total_tip_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2020-01-17T20:47:53.293Z", - "version": 1, - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/collected-data.md b/doc/models/collected-data.md deleted file mode 100644 index 0951820c..00000000 --- a/doc/models/collected-data.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Collected Data - -## Structure - -`CollectedData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `inputText` | `?string` | Optional | The buyer's input text. | getInputText(): ?string | setInputText(?string inputText): void | - -## Example (as JSON) - -```json -{ - "input_text": "input_text8" -} -``` - diff --git a/doc/models/complete-payment-request.md b/doc/models/complete-payment-request.md deleted file mode 100644 index 7aac0ae1..00000000 --- a/doc/models/complete-payment-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Complete Payment Request - -Describes a request to complete (capture) a payment using -[CompletePayment](../../doc/apis/payments.md#complete-payment). - -By default, payments are set to `autocomplete` immediately after they are created. -To complete payments manually, set `autocomplete` to `false`. - -## Structure - -`CompletePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `versionToken` | `?string` | Optional | Used for optimistic concurrency. This opaque token identifies the current `Payment`
version that the caller expects. If the server has a different version of the Payment,
the update fails and a response with a VERSION_MISMATCH error is returned. | getVersionToken(): ?string | setVersionToken(?string versionToken): void | - -## Example (as JSON) - -```json -{ - "version_token": "version_token8" -} -``` - diff --git a/doc/models/complete-payment-response.md b/doc/models/complete-payment-response.md deleted file mode 100644 index 593d37cf..00000000 --- a/doc/models/complete-payment-response.md +++ /dev/null @@ -1,107 +0,0 @@ - -# Complete Payment Response - -Defines the response returned by[CompletePayment](../../doc/apis/payments.md#complete-payment). - -## Structure - -`CompletePaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | - -## Example (as JSON) - -```json -{ - "payment": { - "amount_money": { - "amount": 555, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", - "square_product": "VIRTUAL_TERMINAL" - }, - "approved_money": { - "amount": 555, - "currency": "USD" - }, - "card_details": { - "auth_result_code": "2Nkw7q", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T19:34:33.680Z", - "captured_at": "2021-10-13T19:34:34.340Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "KEYED", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "CAPTURED" - }, - "created_at": "2021-10-13T19:34:33.524Z", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T19:34:33.524Z", - "employee_id": "TMoK_ogh6rH1o4dV", - "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "location_id": "L88917AVBK2S5", - "note": "Test Note", - "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", - "processing_fee": [ - { - "amount_money": { - "amount": 34, - "currency": "USD" - }, - "effective_at": "2021-10-13T21:34:35.000Z", - "type": "INITIAL" - } - ], - "receipt_number": "bP9m", - "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "source_type": "CARD", - "status": "COMPLETED", - "team_member_id": "TMoK_ogh6rH1o4dV", - "total_money": { - "amount": 555, - "currency": "USD" - }, - "updated_at": "2021-10-13T19:34:34.339Z", - "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", - "tip_money": { - "amount": 190, - "currency": "TWD" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/component-component-type.md b/doc/models/component-component-type.md deleted file mode 100644 index 3619b08e..00000000 --- a/doc/models/component-component-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Component Component Type - -An enum for ComponentType. - -## Enumeration - -`ComponentComponentType` - -## Fields - -| Name | -| --- | -| `APPLICATION` | -| `CARD_READER` | -| `BATTERY` | -| `WIFI` | -| `ETHERNET` | -| `PRINTER` | - diff --git a/doc/models/component.md b/doc/models/component.md deleted file mode 100644 index 7aa6be7b..00000000 --- a/doc/models/component.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Component - -The wrapper object for the component entries of a given component type. - -## Structure - -`Component` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`string(ComponentComponentType)`](../../doc/models/component-component-type.md) | Required | An enum for ComponentType. | getType(): string | setType(string type): void | -| `applicationDetails` | [`?DeviceComponentDetailsApplicationDetails`](../../doc/models/device-component-details-application-details.md) | Optional | - | getApplicationDetails(): ?DeviceComponentDetailsApplicationDetails | setApplicationDetails(?DeviceComponentDetailsApplicationDetails applicationDetails): void | -| `cardReaderDetails` | [`?DeviceComponentDetailsCardReaderDetails`](../../doc/models/device-component-details-card-reader-details.md) | Optional | - | getCardReaderDetails(): ?DeviceComponentDetailsCardReaderDetails | setCardReaderDetails(?DeviceComponentDetailsCardReaderDetails cardReaderDetails): void | -| `batteryDetails` | [`?DeviceComponentDetailsBatteryDetails`](../../doc/models/device-component-details-battery-details.md) | Optional | - | getBatteryDetails(): ?DeviceComponentDetailsBatteryDetails | setBatteryDetails(?DeviceComponentDetailsBatteryDetails batteryDetails): void | -| `wifiDetails` | [`?DeviceComponentDetailsWiFiDetails`](../../doc/models/device-component-details-wi-fi-details.md) | Optional | - | getWifiDetails(): ?DeviceComponentDetailsWiFiDetails | setWifiDetails(?DeviceComponentDetailsWiFiDetails wifiDetails): void | -| `ethernetDetails` | [`?DeviceComponentDetailsEthernetDetails`](../../doc/models/device-component-details-ethernet-details.md) | Optional | - | getEthernetDetails(): ?DeviceComponentDetailsEthernetDetails | setEthernetDetails(?DeviceComponentDetailsEthernetDetails ethernetDetails): void | - -## Example (as JSON) - -```json -{ - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } -} -``` - diff --git a/doc/models/confirmation-decision.md b/doc/models/confirmation-decision.md deleted file mode 100644 index f3038a99..00000000 --- a/doc/models/confirmation-decision.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Confirmation Decision - -## Structure - -`ConfirmationDecision` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `hasAgreed` | `?bool` | Optional | The buyer's decision to the displayed terms. | getHasAgreed(): ?bool | setHasAgreed(?bool hasAgreed): void | - -## Example (as JSON) - -```json -{ - "has_agreed": false -} -``` - diff --git a/doc/models/confirmation-options.md b/doc/models/confirmation-options.md deleted file mode 100644 index 5ed5778a..00000000 --- a/doc/models/confirmation-options.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Confirmation Options - -## Structure - -`ConfirmationOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title text to display in the confirmation screen flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | -| `body` | `string` | Required | The agreement details to display in the confirmation flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | -| `agreeButtonText` | `string` | Required | The button text to display indicating the customer agrees to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getAgreeButtonText(): string | setAgreeButtonText(string agreeButtonText): void | -| `disagreeButtonText` | `?string` | Optional | The button text to display indicating the customer does not agree to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getDisagreeButtonText(): ?string | setDisagreeButtonText(?string disagreeButtonText): void | -| `decision` | [`?ConfirmationDecision`](../../doc/models/confirmation-decision.md) | Optional | - | getDecision(): ?ConfirmationDecision | setDecision(?ConfirmationDecision decision): void | - -## Example (as JSON) - -```json -{ - "title": "title0", - "body": "body0", - "agree_button_text": "agree_button_text8", - "disagree_button_text": "disagree_button_text8", - "decision": { - "has_agreed": false - } -} -``` - diff --git a/doc/models/coordinates.md b/doc/models/coordinates.md deleted file mode 100644 index 3bc70606..00000000 --- a/doc/models/coordinates.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Coordinates - -Latitude and longitude coordinates. - -## Structure - -`Coordinates` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `latitude` | `?float` | Optional | The latitude of the coordinate expressed in degrees. | getLatitude(): ?float | setLatitude(?float latitude): void | -| `longitude` | `?float` | Optional | The longitude of the coordinate expressed in degrees. | getLongitude(): ?float | setLongitude(?float longitude): void | - -## Example (as JSON) - -```json -{ - "latitude": 200.94, - "longitude": 52.86 -} -``` - diff --git a/doc/models/country.md b/doc/models/country.md deleted file mode 100644 index 39422596..00000000 --- a/doc/models/country.md +++ /dev/null @@ -1,265 +0,0 @@ - -# Country - -Indicates the country associated with another entity, such as a business. -Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - -## Enumeration - -`Country` - -## Fields - -| Name | Description | -| --- | --- | -| `ZZ` | Unknown | -| `AD` | Andorra | -| `AE` | United Arab Emirates | -| `AF` | Afghanistan | -| `AG` | Antigua and Barbuda | -| `AI` | Anguilla | -| `AL` | Albania | -| `AM` | Armenia | -| `AO` | Angola | -| `AQ` | Antartica | -| `AR` | Argentina | -| `AS` | American Samoa | -| `AT` | Austria | -| `AU` | Australia | -| `AW` | Aruba | -| `AX` | Åland Islands | -| `AZ` | Azerbaijan | -| `BA` | Bosnia and Herzegovina | -| `BB` | Barbados | -| `BD` | Bangladesh | -| `BE` | Belgium | -| `BF` | Burkina Faso | -| `BG` | Bulgaria | -| `BH` | Bahrain | -| `BI` | Burundi | -| `BJ` | Benin | -| `BL` | Saint Barthélemy | -| `BM` | Bermuda | -| `BN` | Brunei | -| `BO` | Bolivia | -| `BQ` | Bonaire | -| `BR` | Brazil | -| `BS` | Bahamas | -| `BT` | Bhutan | -| `BV` | Bouvet Island | -| `BW` | Botswana | -| `BY` | Belarus | -| `BZ` | Belize | -| `CA` | Canada | -| `CC` | Cocos Islands | -| `CD` | Democratic Republic of the Congo | -| `CF` | Central African Republic | -| `CG` | Congo | -| `CH` | Switzerland | -| `CI` | Ivory Coast | -| `CK` | Cook Islands | -| `CL` | Chile | -| `CM` | Cameroon | -| `CN` | China | -| `CO` | Colombia | -| `CR` | Costa Rica | -| `CU` | Cuba | -| `CV` | Cabo Verde | -| `CW` | Curaçao | -| `CX` | Christmas Island | -| `CY` | Cyprus | -| `CZ` | Czechia | -| `DE` | Germany | -| `DJ` | Djibouti | -| `DK` | Denmark | -| `DM` | Dominica | -| `DO` | Dominican Republic | -| `DZ` | Algeria | -| `EC` | Ecuador | -| `EE` | Estonia | -| `EG` | Egypt | -| `EH` | Western Sahara | -| `ER` | Eritrea | -| `ES` | Spain | -| `ET` | Ethiopia | -| `FI` | Finland | -| `FJ` | Fiji | -| `FK` | Falkland Islands | -| `FM` | Federated States of Micronesia | -| `FO` | Faroe Islands | -| `FR` | France | -| `GA` | Gabon | -| `GB` | United Kingdom | -| `GD` | Grenada | -| `GE` | Georgia | -| `GF` | French Guiana | -| `GG` | Guernsey | -| `GH` | Ghana | -| `GI` | Gibraltar | -| `GL` | Greenland | -| `GM` | Gambia | -| `GN` | Guinea | -| `GP` | Guadeloupe | -| `GQ` | Equatorial Guinea | -| `GR` | Greece | -| `GS` | South Georgia and the South Sandwich Islands | -| `GT` | Guatemala | -| `GU` | Guam | -| `GW` | Guinea-Bissau | -| `GY` | Guyana | -| `HK` | Hong Kong | -| `HM` | Heard Island and McDonald Islands | -| `HN` | Honduras | -| `HR` | Croatia | -| `HT` | Haiti | -| `HU` | Hungary | -| `ID` | Indonesia | -| `IE` | Ireland | -| `IL` | Israel | -| `IM` | Isle of Man | -| `IN` | India | -| `IO` | British Indian Ocean Territory | -| `IQ` | Iraq | -| `IR` | Iran | -| `IS` | Iceland | -| `IT` | Italy | -| `JE` | Jersey | -| `JM` | Jamaica | -| `JO` | Jordan | -| `JP` | Japan | -| `KE` | Kenya | -| `KG` | Kyrgyzstan | -| `KH` | Cambodia | -| `KI` | Kiribati | -| `KM` | Comoros | -| `KN` | Saint Kitts and Nevis | -| `KP` | Democratic People's Republic of Korea | -| `KR` | Republic of Korea | -| `KW` | Kuwait | -| `KY` | Cayman Islands | -| `KZ` | Kazakhstan | -| `LA` | Lao People's Democratic Republic | -| `LB` | Lebanon | -| `LC` | Saint Lucia | -| `LI` | Liechtenstein | -| `LK` | Sri Lanka | -| `LR` | Liberia | -| `LS` | Lesotho | -| `LT` | Lithuania | -| `LU` | Luxembourg | -| `LV` | Latvia | -| `LY` | Libya | -| `MA` | Morocco | -| `MC` | Monaco | -| `MD` | Moldova | -| `ME` | Montenegro | -| `MF` | Saint Martin | -| `MG` | Madagascar | -| `MH` | Marshall Islands | -| `MK` | North Macedonia | -| `ML` | Mali | -| `MM` | Myanmar | -| `MN` | Mongolia | -| `MO` | Macao | -| `MP` | Northern Mariana Islands | -| `MQ` | Martinique | -| `MR` | Mauritania | -| `MS` | Montserrat | -| `MT` | Malta | -| `MU` | Mauritius | -| `MV` | Maldives | -| `MW` | Malawi | -| `MX` | Mexico | -| `MY` | Malaysia | -| `MZ` | Mozambique | -| `NA` | Namibia | -| `NC` | New Caledonia | -| `NE` | Niger | -| `NF` | Norfolk Island | -| `NG` | Nigeria | -| `NI` | Nicaragua | -| `NL` | Netherlands | -| `NO` | Norway | -| `NP` | Nepal | -| `NR` | Nauru | -| `NU` | Niue | -| `NZ` | New Zealand | -| `OM` | Oman | -| `PA` | Panama | -| `PE` | Peru | -| `PF` | French Polynesia | -| `PG` | Papua New Guinea | -| `PH` | Philippines | -| `PK` | Pakistan | -| `PL` | Poland | -| `PM` | Saint Pierre and Miquelon | -| `PN` | Pitcairn | -| `PR` | Puerto Rico | -| `PS` | Palestine | -| `PT` | Portugal | -| `PW` | Palau | -| `PY` | Paraguay | -| `QA` | Qatar | -| `RE` | Réunion | -| `RO` | Romania | -| `RS` | Serbia | -| `RU` | Russia | -| `RW` | Rwanda | -| `SA` | Saudi Arabia | -| `SB` | Solomon Islands | -| `SC` | Seychelles | -| `SD` | Sudan | -| `SE` | Sweden | -| `SG` | Singapore | -| `SH` | Saint Helena, Ascension and Tristan da Cunha | -| `SI` | Slovenia | -| `SJ` | Svalbard and Jan Mayen | -| `SK` | Slovakia | -| `SL` | Sierra Leone | -| `SM` | San Marino | -| `SN` | Senegal | -| `SO` | Somalia | -| `SR` | Suriname | -| `SS` | South Sudan | -| `ST` | Sao Tome and Principe | -| `SV` | El Salvador | -| `SX` | Sint Maarten | -| `SY` | Syrian Arab Republic | -| `SZ` | Eswatini | -| `TC` | Turks and Caicos Islands | -| `TD` | Chad | -| `TF` | French Southern Territories | -| `TG` | Togo | -| `TH` | Thailand | -| `TJ` | Tajikistan | -| `TK` | Tokelau | -| `TL` | Timor-Leste | -| `TM` | Turkmenistan | -| `TN` | Tunisia | -| `TO` | Tonga | -| `TR` | Turkey | -| `TT` | Trinidad and Tobago | -| `TV` | Tuvalu | -| `TW` | Taiwan | -| `TZ` | Tanzania | -| `UA` | Ukraine | -| `UG` | Uganda | -| `UM` | United States Minor Outlying Islands | -| `US` | United States of America | -| `UY` | Uruguay | -| `UZ` | Uzbekistan | -| `VA` | Vatican City | -| `VC` | Saint Vincent and the Grenadines | -| `VE` | Venezuela | -| `VG` | British Virgin Islands | -| `VI` | U.S. Virgin Islands | -| `VN` | Vietnam | -| `VU` | Vanuatu | -| `WF` | Wallis and Futuna | -| `WS` | Samoa | -| `YE` | Yemen | -| `YT` | Mayotte | -| `ZA` | South Africa | -| `ZM` | Zambia | -| `ZW` | Zimbabwe | - diff --git a/doc/models/create-booking-custom-attribute-definition-request.md b/doc/models/create-booking-custom-attribute-definition-request.md deleted file mode 100644 index 4a915dff..00000000 --- a/doc/models/create-booking-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Booking Custom Attribute Definition Request - -Represents a [CreateBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#create-booking-custom-attribute-definition) request. - -## Structure - -`CreateBookingCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "key": "key2", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2", - "description": "description8", - "visibility": "VISIBILITY_HIDDEN" - }, - "idempotency_key": "idempotency_key6" -} -``` - diff --git a/doc/models/create-booking-custom-attribute-definition-response.md b/doc/models/create-booking-custom-attribute-definition-response.md deleted file mode 100644 index 3eb18b0e..00000000 --- a/doc/models/create-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Create Booking Custom Attribute Definition Response - -Represents a [CreateBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#create-booking-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`CreateBookingCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-11-16T15:27:30Z", - "description": "The favorite shampoo of the customer.", - "key": "favoriteShampoo", - "name": "Favorite Shampoo", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T15:27:30Z", - "version": 1, - "visibility": "VISIBILITY_HIDDEN" - }, - "errors": [] -} -``` - diff --git a/doc/models/create-booking-request.md b/doc/models/create-booking-request.md deleted file mode 100644 index a171eae3..00000000 --- a/doc/models/create-booking-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Create Booking Request - -## Structure - -`CreateBookingRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `booking` | [`Booking`](../../doc/models/booking.md) | Required | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): Booking | setBooking(Booking booking): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key4", - "booking": { - "id": "id4", - "version": 156, - "status": "CANCELLED_BY_SELLER", - "created_at": "created_at2", - "updated_at": "updated_at0" - } -} -``` - diff --git a/doc/models/create-booking-response.md b/doc/models/create-booking-response.md deleted file mode 100644 index eecf6e06..00000000 --- a/doc/models/create-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Create Booking Response - -## Structure - -`CreateBookingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `booking` | [`?Booking`](../../doc/models/booking.md) | Optional | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): ?Booking | setBooking(?Booking booking): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking": { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t" - } - ], - "created_at": "2020-10-28T15:47:41Z", - "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - "customer_note": "", - "id": "zkras0xv0xwswx", - "location_id": "LEQHH0YY8B42M", - "seller_note": "", - "start_at": "2020-11-26T13:00:00Z", - "status": "ACCEPTED", - "updated_at": "2020-10-28T15:47:41Z", - "version": 0 - }, - "errors": [] -} -``` - diff --git a/doc/models/create-break-type-request.md b/doc/models/create-break-type-request.md deleted file mode 100644 index 6ec62e9e..00000000 --- a/doc/models/create-break-type-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Break Type Request - -A request to create a new `BreakType`. - -## Structure - -`CreateBreakTypeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `breakType` | [`BreakType`](../../doc/models/break-type.md) | Required | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | getBreakType(): BreakType | setBreakType(BreakType breakType): void | - -## Example (as JSON) - -```json -{ - "break_type": { - "break_name": "Lunch Break", - "expected_duration": "PT30M", - "is_paid": true, - "location_id": "CGJN03P1D08GF", - "id": "id8", - "version": 132, - "created_at": "created_at6", - "updated_at": "updated_at4" - }, - "idempotency_key": "PAD3NG5KSN2GL" -} -``` - diff --git a/doc/models/create-break-type-response.md b/doc/models/create-break-type-response.md deleted file mode 100644 index 678bbefb..00000000 --- a/doc/models/create-break-type-response.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Create Break Type Response - -The response to the request to create a `BreakType`. The response contains -the created `BreakType` object and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`CreateBreakTypeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `breakType` | [`?BreakType`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | getBreakType(): ?BreakType | setBreakType(?BreakType breakType): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "break_type": { - "break_name": "Lunch Break", - "created_at": "2019-02-26T22:42:54Z", - "expected_duration": "PT30M", - "id": "49SSVDJG76WF3", - "is_paid": true, - "location_id": "CGJN03P1D08GF", - "updated_at": "2019-02-26T22:42:54Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-card-request.md b/doc/models/create-card-request.md deleted file mode 100644 index e4255f44..00000000 --- a/doc/models/create-card-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Create Card Request - -Creates a card from the source (payment token or payment id). Accessible via -HTTP requests at POST https://connect.squareup.com/v2/cards - -## Structure - -`CreateCardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this CreateCard request. Keys can be
any valid string and must be unique for every request.

Max: 45 characters

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `sourceId` | `string` | Required | The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16384` | getSourceId(): string | setSourceId(string sourceId): void | -| `verificationToken` | `?string` | Optional | An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity.

See the [SCA Overview](https://developer.squareup.com/docs/sca-overview). | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | -| `card` | [`Card`](../../doc/models/card.md) | Required | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): Card | setCard(Card card): void | - -## Example (as JSON) - -```json -{ - "card": { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "cardholder_name": "Amelia Earhart", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", - "reference_id": "user-id-1", - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "idempotency_key": "4935a656-a929-4792-b97c-8848be85c27c", - "source_id": "cnon:uIbfJXhXETSP197M3GB", - "verification_token": "verification_token4" -} -``` - diff --git a/doc/models/create-card-response.md b/doc/models/create-card-response.md deleted file mode 100644 index e81d314a..00000000 --- a/doc/models/create-card-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Create Card Response - -Defines the fields that are included in the response body of -a request to the [CreateCard](../../doc/apis/cards.md#create-card) endpoint. - -Note: if there are errors processing the request, the card field will not be -present. - -## Structure - -`CreateCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors resulting from the request. | getErrors(): ?array | setErrors(?array errors): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | - -## Example (as JSON) - -```json -{ - "card": { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "bin": "411111", - "card_brand": "VISA", - "card_type": "CREDIT", - "cardholder_name": "Amelia Earhart", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", - "enabled": true, - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - "id": "ccof:uIbfJXhXETSP197M3GB", - "last_4": "1111", - "merchant_id": "6SSW7HV8K2ST5", - "prepaid_type": "NOT_PREPAID", - "reference_id": "user-id-1", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-catalog-image-request.md b/doc/models/create-catalog-image-request.md deleted file mode 100644 index d458e6ae..00000000 --- a/doc/models/create-catalog-image-request.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Create Catalog Image Request - -## Structure - -`CreateCatalogImageRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this CreateCatalogImage request.
Keys can be any valid string but must be unique for every CreateCatalogImage request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `objectId` | `?string` | Optional | Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this
field empty to create unattached images, for example if you are building an integration
where an image can be attached to catalog items at a later time. | getObjectId(): ?string | setObjectId(?string objectId): void | -| `image` | [`CatalogObject`](../../doc/models/catalog-object.md) | Required | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getImage(): CatalogObject | setImage(CatalogObject image): void | -| `isPrimary` | `?bool` | Optional | If this is set to `true`, the image created will be the primary, or first image of the object referenced by `object_id`.
If the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will replace the primary image.
If this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will be appended to the list of `image_ids` on the object.

With Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective default value is `true`. | getIsPrimary(): ?bool | setIsPrimary(?bool isPrimary): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", - "image": { - "id": "#TEMP_ID", - "image_data": { - "caption": "A picture of a cup of coffee" - }, - "type": "IMAGE", - "updated_at": "updated_at2", - "version": 100, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - "object_id": "ND6EA5AAJEO5WL3JNNIAQA32", - "is_primary": false -} -``` - diff --git a/doc/models/create-catalog-image-response.md b/doc/models/create-catalog-image-response.md deleted file mode 100644 index e23eec82..00000000 --- a/doc/models/create-catalog-image-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Create Catalog Image Response - -## Structure - -`CreateCatalogImageResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `image` | [`?CatalogObject`](../../doc/models/catalog-object.md) | Optional | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getImage(): ?CatalogObject | setImage(?CatalogObject image): void | - -## Example (as JSON) - -```json -{ - "image": { - "id": "KQLFFHA6K6J3YQAQAWDQAL57", - "image_data": { - "caption": "A picture of a cup of coffee", - "url": "https://..." - }, - "type": "IMAGE", - "updated_at": "updated_at2", - "version": 100, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-checkout-request.md b/doc/models/create-checkout-request.md deleted file mode 100644 index a630c19a..00000000 --- a/doc/models/create-checkout-request.md +++ /dev/null @@ -1,179 +0,0 @@ - -# Create Checkout Request - -Defines the parameters that can be included in the body of -a request to the `CreateCheckout` endpoint. - -## Structure - -`CreateCheckoutRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this checkout among others you have created. It can be
any valid string but must be unique for every order sent to Square Checkout for a given location ID.

The idempotency key is used to avoid processing the same order more than once. If you are
unsure whether a particular checkout was created successfully, you can attempt it again with
the same idempotency key and all the same other parameters without worrying about creating duplicates.

You should use a random number/string generator native to the language
you are working in to generate strings for your idempotency keys.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `order` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Required | - | getOrder(): CreateOrderRequest | setOrder(CreateOrderRequest order): void | -| `askForShippingAddress` | `?bool` | Optional | If `true`, Square Checkout collects shipping information on your behalf and stores
that information with the transaction information in the Square Seller Dashboard.

Default: `false`. | getAskForShippingAddress(): ?bool | setAskForShippingAddress(?bool askForShippingAddress): void | -| `merchantSupportEmail` | `?string` | Optional | The email address to display on the Square Checkout confirmation page
and confirmation email that the buyer can use to contact the seller.

If this value is not set, the confirmation page and email display the
primary email address associated with the seller's Square account.

Default: none; only exists if explicitly set.
**Constraints**: *Maximum Length*: `254` | getMerchantSupportEmail(): ?string | setMerchantSupportEmail(?string merchantSupportEmail): void | -| `prePopulateBuyerEmail` | `?string` | Optional | If provided, the buyer's email is prepopulated on the checkout page
as an editable text field.

Default: none; only exists if explicitly set.
**Constraints**: *Maximum Length*: `254` | getPrePopulateBuyerEmail(): ?string | setPrePopulateBuyerEmail(?string prePopulateBuyerEmail): void | -| `prePopulateShippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getPrePopulateShippingAddress(): ?Address | setPrePopulateShippingAddress(?Address prePopulateShippingAddress): void | -| `redirectUrl` | `?string` | Optional | The URL to redirect to after the checkout is completed with `checkoutId`,
`transactionId`, and `referenceId` appended as URL parameters. For example,
if the provided redirect URL is `http://www.example.com/order-complete`, a
successful transaction redirects the customer to:

`http://www.example.com/order-complete?checkoutId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx`

If you do not provide a redirect URL, Square Checkout displays an order
confirmation page on your behalf; however, it is strongly recommended that
you provide a redirect URL so you can verify the transaction results and
finalize the order through your existing/normal confirmation workflow.

Default: none; only exists if explicitly set.
**Constraints**: *Maximum Length*: `800` | getRedirectUrl(): ?string | setRedirectUrl(?string redirectUrl): void | -| `additionalRecipients` | [`?(ChargeRequestAdditionalRecipient[])`](../../doc/models/charge-request-additional-recipient.md) | Optional | The basic primitive of a multi-party transaction. The value is optional.
The transaction facilitated by you can be split from here.

If you provide this value, the `amount_money` value in your `additional_recipients` field
cannot be more than 90% of the `total_money` calculated by Square for your order.
The `location_id` must be a valid seller location where the checkout is occurring.

This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission.

This field is currently not supported in the Square Sandbox. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | -| `note` | `?string` | Optional | An optional note to associate with the `checkout` object.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | getNote(): ?string | setNote(?string note): void | - -## Example (as JSON) - -```json -{ - "additional_recipients": [ - { - "amount_money": { - "amount": 60, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1" - } - ], - "ask_for_shipping_address": true, - "idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad6", - "merchant_support_email": "merchant+support@website.com", - "order": { - "idempotency_key": "12ae1696-z1e3-4328-af6d-f1e04d947gd4", - "order": { - "customer_id": "customer_id", - "discounts": [ - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "scope": "LINE_ITEM", - "type": "FIXED_AMOUNT", - "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - } - ], - "line_items": [ - { - "applied_discounts": [ - { - "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - } - ], - "applied_taxes": [ - { - "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - } - ], - "base_price_money": { - "amount": 1500, - "currency": "USD" - }, - "name": "Printed T Shirt", - "quantity": "2", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 2500, - "currency": "USD" - }, - "name": "Slim Jeans", - "quantity": "1", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 3500, - "currency": "USD" - }, - "name": "Woven Sweater", - "quantity": "3", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "location_id", - "reference_id": "reference_id", - "taxes": [ - { - "percentage": "7.75", - "scope": "LINE_ITEM", - "type": "INCLUSIVE", - "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - } - ], - "id": "id6", - "source": { - "name": "name4" - } - } - }, - "pre_populate_buyer_email": "example@email.com", - "pre_populate_shipping_address": { - "address_line_1": "1455 Market St.", - "address_line_2": "Suite 600", - "administrative_district_level_1": "CA", - "country": "US", - "first_name": "Jane", - "last_name": "Doe", - "locality": "San Francisco", - "postal_code": "94103", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "redirect_url": "https://merchant.website.com/order-confirm" -} -``` - diff --git a/doc/models/create-checkout-response.md b/doc/models/create-checkout-response.md deleted file mode 100644 index f602d186..00000000 --- a/doc/models/create-checkout-response.md +++ /dev/null @@ -1,172 +0,0 @@ - -# Create Checkout Response - -Defines the fields that are included in the response body of -a request to the `CreateCheckout` endpoint. - -## Structure - -`CreateCheckoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `checkout` | [`?Checkout`](../../doc/models/checkout.md) | Optional | Square Checkout lets merchants accept online payments for supported
payment types using a checkout workflow hosted on squareup.com. | getCheckout(): ?Checkout | setCheckout(?Checkout checkout): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "additional_recipients": [ - { - "amount_money": { - "amount": 60, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1" - } - ], - "ask_for_shipping_address": true, - "checkout_page_url": "https://connect.squareup.com/v2/checkout?c=CAISEHGimXh-C3RIT4og1a6u1qw&l=CYTKRM7R7JMV8", - "created_at": "2017-06-16T22:25:35Z", - "id": "CAISEHGimXh-C3RIT4og1a6u1qw", - "merchant_support_email": "merchant+support@website.com", - "order": { - "customer_id": "customer_id", - "discounts": [ - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "scope": "LINE_ITEM", - "type": "FIXED_AMOUNT", - "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - } - ], - "line_items": [ - { - "applied_discounts": [ - { - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - } - ], - "applied_taxes": [ - { - "applied_money": { - "amount": 103, - "currency": "USD" - }, - "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - } - ], - "base_price_money": { - "amount": 1500, - "currency": "USD" - }, - "name": "Printed T Shirt", - "quantity": "2", - "total_discount_money": { - "amount": 100, - "currency": "USD" - }, - "total_money": { - "amount": 1503, - "currency": "USD" - }, - "total_tax_money": { - "amount": 103, - "currency": "USD" - } - }, - { - "base_price_money": { - "amount": 2500, - "currency": "USD" - }, - "name": "Slim Jeans", - "quantity": "1", - "total_money": { - "amount": 2500, - "currency": "USD" - } - }, - { - "base_price_money": { - "amount": 3500, - "currency": "USD" - }, - "name": "Woven Sweater", - "quantity": "3", - "total_money": { - "amount": 10500, - "currency": "USD" - } - } - ], - "location_id": "location_id", - "reference_id": "reference_id", - "taxes": [ - { - "percentage": "7.75", - "scope": "LINE_ITEM", - "type": "INCLUSIVE", - "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - } - ], - "total_discount_money": { - "amount": 100, - "currency": "USD" - }, - "total_money": { - "amount": 14503, - "currency": "USD" - }, - "total_tax_money": { - "amount": 103, - "currency": "USD" - } - }, - "pre_populate_buyer_email": "example@email.com", - "pre_populate_shipping_address": { - "address_line_1": "1455 Market St.", - "address_line_2": "Suite 600", - "administrative_district_level_1": "CA", - "country": "US", - "first_name": "Jane", - "last_name": "Doe", - "locality": "San Francisco", - "postal_code": "94103" - }, - "redirect_url": "https://merchant.website.com/order-confirm", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-customer-card-request.md b/doc/models/create-customer-card-request.md deleted file mode 100644 index bb150458..00000000 --- a/doc/models/create-customer-card-request.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Create Customer Card Request - -Defines the fields that are included in the request body of a request -to the `CreateCustomerCard` endpoint. - -## Structure - -`CreateCustomerCardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cardNonce` | `string` | Required | A card nonce representing the credit card to link to the customer.

Card nonces are generated by the Square payment form when customers enter
their card information. For more information, see
[Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web-payments/take-card-payment).

__NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)
cannot be used to create a customer card. | getCardNonce(): string | setCardNonce(string cardNonce): void | -| `billingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | -| `cardholderName` | `?string` | Optional | The full name printed on the credit card. | getCardholderName(): ?string | setCardholderName(?string cardholderName): void | -| `verificationToken` | `?string` | Optional | An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity. | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | - -## Example (as JSON) - -```json -{ - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003", - "address_line_3": "address_line_34", - "sublocality": "sublocality8" - }, - "card_nonce": "YOUR_CARD_NONCE", - "cardholder_name": "Amelia Earhart", - "verification_token": "verification_token0" -} -``` - diff --git a/doc/models/create-customer-card-response.md b/doc/models/create-customer-card-response.md deleted file mode 100644 index 2c7fdc75..00000000 --- a/doc/models/create-customer-card-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Customer Card Response - -Defines the fields that are included in the response body of -a request to the `CreateCustomerCard` endpoint. - -Either `errors` or `card` is present in a given response (never both). - -## Structure - -`CreateCustomerCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | - -## Example (as JSON) - -```json -{ - "card": { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "card_brand": "VISA", - "cardholder_name": "Amelia Earhart", - "exp_month": 11, - "exp_year": 2018, - "id": "icard-card_id", - "last_4": "1111" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-customer-custom-attribute-definition-request.md b/doc/models/create-customer-custom-attribute-definition-request.md deleted file mode 100644 index 5d8403ea..00000000 --- a/doc/models/create-customer-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Customer Custom Attribute Definition Request - -Represents a [CreateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) request. - -## Structure - -`CreateCustomerCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "The favorite movie of the customer.", - "key": "favoritemovie", - "name": "Favorite Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "visibility": "VISIBILITY_HIDDEN" - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/create-customer-custom-attribute-definition-response.md b/doc/models/create-customer-custom-attribute-definition-response.md deleted file mode 100644 index 9ddea2df..00000000 --- a/doc/models/create-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Create Customer Custom Attribute Definition Response - -Represents a [CreateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`CreateCustomerCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-04-26T15:27:30Z", - "description": "The favorite movie of the customer.", - "key": "favoritemovie", - "name": "Favorite Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-04-26T15:27:30Z", - "version": 1, - "visibility": "VISIBILITY_HIDDEN" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-customer-group-request.md b/doc/models/create-customer-group-request.md deleted file mode 100644 index ecccf074..00000000 --- a/doc/models/create-customer-group-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Create Customer Group Request - -Defines the body parameters that can be included in a request to the -[CreateCustomerGroup](../../doc/apis/customer-groups.md#create-customer-group) endpoint. - -## Structure - -`CreateCustomerGroupRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `group` | [`CustomerGroup`](../../doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | - -## Example (as JSON) - -```json -{ - "group": { - "name": "Loyal Customers", - "id": "id8", - "created_at": "created_at4", - "updated_at": "updated_at6" - }, - "idempotency_key": "idempotency_key0" -} -``` - diff --git a/doc/models/create-customer-group-response.md b/doc/models/create-customer-group-response.md deleted file mode 100644 index 01efb7be..00000000 --- a/doc/models/create-customer-group-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Customer Group Response - -Defines the fields that are included in the response body of -a request to the [CreateCustomerGroup](../../doc/apis/customer-groups.md#create-customer-group) endpoint. - -Either `errors` or `group` is present in a given response (never both). - -## Structure - -`CreateCustomerGroupResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](../../doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | - -## Example (as JSON) - -```json -{ - "group": { - "created_at": "2020-04-13T21:54:57.863Z", - "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", - "name": "Loyal Customers", - "updated_at": "2020-04-13T21:54:58Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md deleted file mode 100644 index 1eca73c3..00000000 --- a/doc/models/create-customer-request.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Create Customer Request - -Defines the body parameters that can be included in a request to the -`CreateCustomer` endpoint. - -## Structure - -`CreateCustomerRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. For more information, see
[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters. | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `companyName` | `?string` | Optional | A business name associated with the customer profile.

The maximum length for this value is 500 characters. | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `nickname` | `?string` | Optional | A nickname for the customer profile.

The maximum length for this value is 100 characters. | getNickname(): ?string | setNickname(?string nickname): void | -| `emailAddress` | `?string` | Optional | The email address associated with the customer profile.

The maximum length for this value is 254 characters. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The phone number associated with the customer profile. The phone number must be valid and can contain
9–16 digits, with an optional `+` prefix and country code. For more information, see
[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.

The maximum length for this value is 100 characters. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`
format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. | getBirthday(): ?string | setBirthday(?string birthday): void | -| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "reference_id": "YOUR_REFERENCE_ID", - "idempotency_key": "idempotency_key4", - "company_name": "company_name4", - "nickname": "nickname4" -} -``` - diff --git a/doc/models/create-customer-response.md b/doc/models/create-customer-response.md deleted file mode 100644 index e87db6f3..00000000 --- a/doc/models/create-customer-response.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Create Customer Response - -Defines the fields that are included in the response body of -a request to the [CreateCustomer](../../doc/apis/customers.md#create-customer) or -[BulkCreateCustomers](../../doc/apis/customers.md#bulk-create-customers) endpoint. - -Either `errors` or `customer` is present in a given response (never both). - -## Structure - -`CreateCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `customer` | [`?Customer`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | getCustomer(): ?Customer | setCustomer(?Customer customer): void | - -## Example (as JSON) - -```json -{ - "customer": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2016-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2016-03-23T20:21:54.859Z", - "version": 0, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-device-code-request.md b/doc/models/create-device-code-request.md deleted file mode 100644 index c93ee39c..00000000 --- a/doc/models/create-device-code-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Create Device Code Request - -## Structure - -`CreateDeviceCodeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this CreateDeviceCode request. Keys can
be any valid string but must be unique for every CreateDeviceCode request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `deviceCode` | [`DeviceCode`](../../doc/models/device-code.md) | Required | - | getDeviceCode(): DeviceCode | setDeviceCode(DeviceCode deviceCode): void | - -## Example (as JSON) - -```json -{ - "device_code": { - "location_id": "B5E4484SHHNYH", - "name": "Counter 1", - "product_type": "TERMINAL_API", - "id": "id4", - "code": "code2", - "device_id": "device_id0" - }, - "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56" -} -``` - diff --git a/doc/models/create-device-code-response.md b/doc/models/create-device-code-response.md deleted file mode 100644 index 14672b2b..00000000 --- a/doc/models/create-device-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Create Device Code Response - -## Structure - -`CreateDeviceCodeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `deviceCode` | [`?DeviceCode`](../../doc/models/device-code.md) | Optional | - | getDeviceCode(): ?DeviceCode | setDeviceCode(?DeviceCode deviceCode): void | - -## Example (as JSON) - -```json -{ - "device_code": { - "code": "EBCARJ", - "created_at": "2020-02-06T18:44:33.000Z", - "id": "B3Z6NAMYQSMTM", - "location_id": "B5E4484SHHNYH", - "name": "Counter 1", - "pair_by": "2020-02-06T18:49:33.000Z", - "product_type": "TERMINAL_API", - "status": "UNPAIRED", - "status_changed_at": "2020-02-06T18:44:33.000Z", - "device_id": "device_id0" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-dispute-evidence-file-request.md b/doc/models/create-dispute-evidence-file-request.md deleted file mode 100644 index 02886c70..00000000 --- a/doc/models/create-dispute-evidence-file-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Create Dispute Evidence File Request - -Defines the parameters for a `CreateDisputeEvidenceFile` request. - -## Structure - -`CreateDisputeEvidenceFileRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `evidenceType` | [`?string(DisputeEvidenceType)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | -| `contentType` | `?string` | Optional | The MIME type of the uploaded file.
The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getContentType(): ?string | setContentType(?string contentType): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key8", - "evidence_type": "REBUTTAL_EXPLANATION", - "content_type": "content_type6" -} -``` - diff --git a/doc/models/create-dispute-evidence-file-response.md b/doc/models/create-dispute-evidence-file-response.md deleted file mode 100644 index 7b4616e9..00000000 --- a/doc/models/create-dispute-evidence-file-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Create Dispute Evidence File Response - -Defines the fields in a `CreateDisputeEvidenceFile` response. - -## Structure - -`CreateDisputeEvidenceFileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `evidence` | [`?DisputeEvidence`](../../doc/models/dispute-evidence.md) | Optional | - | getEvidence(): ?DisputeEvidence | setEvidence(?DisputeEvidence evidence): void | - -## Example (as JSON) - -```json -{ - "evidence": { - "dispute_id": "bVTprrwk0gygTLZ96VX1oB", - "evidence_file": { - "filename": "customer-interaction.jpg", - "filetype": "image/jpeg" - }, - "id": "TOomLInj6iWmP3N8qfCXrB", - "uploaded_at": "2022-05-18T16:01:10.000Z", - "evidence_id": "evidence_id0", - "evidence_text": "evidence_text6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-dispute-evidence-text-request.md b/doc/models/create-dispute-evidence-text-request.md deleted file mode 100644 index 7b756318..00000000 --- a/doc/models/create-dispute-evidence-text-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Create Dispute Evidence Text Request - -Defines the parameters for a `CreateDisputeEvidenceText` request. - -## Structure - -`CreateDisputeEvidenceTextRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `evidenceType` | [`?string(DisputeEvidenceType)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | -| `evidenceText` | `string` | Required | The evidence string.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | getEvidenceText(): string | setEvidenceText(string evidenceText): void | - -## Example (as JSON) - -```json -{ - "evidence_text": "1Z8888888888888888", - "evidence_type": "TRACKING_NUMBER", - "idempotency_key": "ed3ee3933d946f1514d505d173c82648" -} -``` - diff --git a/doc/models/create-dispute-evidence-text-response.md b/doc/models/create-dispute-evidence-text-response.md deleted file mode 100644 index 23658f2b..00000000 --- a/doc/models/create-dispute-evidence-text-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Create Dispute Evidence Text Response - -Defines the fields in a `CreateDisputeEvidenceText` response. - -## Structure - -`CreateDisputeEvidenceTextResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `evidence` | [`?DisputeEvidence`](../../doc/models/dispute-evidence.md) | Optional | - | getEvidence(): ?DisputeEvidence | setEvidence(?DisputeEvidence evidence): void | - -## Example (as JSON) - -```json -{ - "evidence": { - "dispute_id": "bVTprrwk0gygTLZ96VX1oB", - "evidence_text": "The customer purchased the item twice, on April 11 and April 28.", - "evidence_type": "REBUTTAL_EXPLANATION", - "id": "TOomLInj6iWmP3N8qfCXrB", - "uploaded_at": "2022-05-18T16:01:10.000Z", - "evidence_id": "evidence_id0", - "evidence_file": { - "filename": "filename8", - "filetype": "filetype8" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-gift-card-activity-request.md b/doc/models/create-gift-card-activity-request.md deleted file mode 100644 index 175d48e5..00000000 --- a/doc/models/create-gift-card-activity-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Gift Card Activity Request - -A request to create a gift card activity. - -## Structure - -`CreateGiftCardActivityRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies the `CreateGiftCardActivity` request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `giftCardActivity` | [`GiftCardActivity`](../../doc/models/gift-card-activity.md) | Required | Represents an action performed on a [gift card](../../doc/models/gift-card.md) that affects its state or balance.
A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity
includes a `redeem_activity_details` field that contains information about the redemption. | getGiftCardActivity(): GiftCardActivity | setGiftCardActivity(GiftCardActivity giftCardActivity): void | - -## Example (as JSON) - -```json -{ - "gift_card_activity": { - "activate_activity_details": { - "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", - "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" - }, - "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - "location_id": "81FN9BNFZTKS4", - "type": "ACTIVATE", - "id": "id6", - "created_at": "created_at6", - "gift_card_gan": "gift_card_gan2", - "gift_card_balance_money": { - "amount": 82, - "currency": "IRR" - } - }, - "idempotency_key": "U16kfr-kA70er-q4Rsym-7U7NnY" -} -``` - diff --git a/doc/models/create-gift-card-activity-response.md b/doc/models/create-gift-card-activity-response.md deleted file mode 100644 index a65bc80b..00000000 --- a/doc/models/create-gift-card-activity-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Create Gift Card Activity Response - -A response that contains a `GiftCardActivity` that was created. -The response might contain a set of `Error` objects if the request resulted in errors. - -## Structure - -`CreateGiftCardActivityResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCardActivity` | [`?GiftCardActivity`](../../doc/models/gift-card-activity.md) | Optional | Represents an action performed on a [gift card](../../doc/models/gift-card.md) that affects its state or balance.
A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity
includes a `redeem_activity_details` field that contains information about the redemption. | getGiftCardActivity(): ?GiftCardActivity | setGiftCardActivity(?GiftCardActivity giftCardActivity): void | - -## Example (as JSON) - -```json -{ - "gift_card_activity": { - "activate_activity_details": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", - "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gift_card_balance_money": { - "amount": 1000, - "currency": "USD" - }, - "gift_card_gan": "7783320002929081", - "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", - "location_id": "81FN9BNFZTKS4", - "type": "ACTIVATE" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-gift-card-request.md b/doc/models/create-gift-card-request.md deleted file mode 100644 index f829c842..00000000 --- a/doc/models/create-gift-card-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Create Gift Card Request - -Represents a [CreateGiftCard](../../doc/apis/gift-cards.md#create-gift-card) request. - -## Structure - -`CreateGiftCardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `locationId` | `string` | Required | The ID of the [location](entity:Location) where the gift card should be registered for
reporting purposes. Gift cards can be redeemed at any of the seller's locations.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `giftCard` | [`GiftCard`](../../doc/models/gift-card.md) | Required | Represents a Square gift card. | getGiftCard(): GiftCard | setGiftCard(GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "type": "DIGITAL", - "id": "id0", - "gan_source": "SQUARE", - "state": "ACTIVE", - "balance_money": { - "amount": 146, - "currency": "BBD" - }, - "gan": "gan6" - }, - "idempotency_key": "NC9Tm69EjbjtConu", - "location_id": "81FN9BNFZTKS4" -} -``` - diff --git a/doc/models/create-gift-card-response.md b/doc/models/create-gift-card-response.md deleted file mode 100644 index 3c087fb4..00000000 --- a/doc/models/create-gift-card-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Gift Card Response - -A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request -resulted in errors. - -## Structure - -`CreateGiftCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 0, - "currency": "USD" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gan": "7783320006753271", - "gan_source": "SQUARE", - "id": "gftc:6cbacbb64cf54e2ca9f573d619038059", - "state": "PENDING", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-invoice-attachment-request.md b/doc/models/create-invoice-attachment-request.md deleted file mode 100644 index 4ccbc8c0..00000000 --- a/doc/models/create-invoice-attachment-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Create Invoice Attachment Request - -Represents a [CreateInvoiceAttachment](../../doc/apis/invoices.md#create-invoice-attachment) request. - -## Structure - -`CreateInvoiceAttachmentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the `CreateInvoiceAttachment` request.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `description` | `?string` | Optional | The description of the attachment to display on the invoice.
**Constraints**: *Maximum Length*: `128` | getDescription(): ?string | setDescription(?string description): void | - -## Example (as JSON) - -```json -{ - "description": "Service contract", - "idempotency_key": "ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3" -} -``` - diff --git a/doc/models/create-invoice-attachment-response.md b/doc/models/create-invoice-attachment-response.md deleted file mode 100644 index 2b37a82d..00000000 --- a/doc/models/create-invoice-attachment-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Create Invoice Attachment Response - -Represents a [CreateInvoiceAttachment](../../doc/apis/invoices.md#create-invoice-attachment) response. - -## Structure - -`CreateInvoiceAttachmentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `attachment` | [`?InvoiceAttachment`](../../doc/models/invoice-attachment.md) | Optional | Represents a file attached to an [invoice](../../doc/models/invoice.md). | getAttachment(): ?InvoiceAttachment | setAttachment(?InvoiceAttachment attachment): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "attachment": { - "description": "Service contract", - "filename": "file.jpg", - "filesize": 102705, - "hash": "273ee02cb6f5f8a3a8ca23604930dd53", - "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", - "mime_type": "image/jpeg", - "uploaded_at": "2023-02-03T20:28:14Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md deleted file mode 100644 index 8f945891..00000000 --- a/doc/models/create-invoice-request.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Create Invoice Request - -Describes a `CreateInvoice` request. - -## Structure - -`CreateInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): Invoice | setInvoice(Invoice invoice): void | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the `CreateInvoice` request. If you do not
provide `idempotency_key` (or provide an empty string as the value), the endpoint
treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1 - } - ], - "request_type": "BALANCE", - "tipping_enabled": true - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "given_name": "given_name6", - "family_name": "family_name8", - "email_address": "email_address2", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "store_payment_method_enabled": false, - "title": "Event Planning Services", - "id": "id6", - "version": 118 - } -} -``` - diff --git a/doc/models/create-invoice-response.md b/doc/models/create-invoice-response.md deleted file mode 100644 index 4887197e..00000000 --- a/doc/models/create-invoice-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# Create Invoice Response - -The response returned by the `CreateInvoice` request. - -## Structure - -`CreateInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`?Invoice`](../../doc/models/invoice.md) | Optional | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): ?Invoice | setInvoice(?Invoice invoice): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T17:45:13Z", - "version": 0 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-job-request.md b/doc/models/create-job-request.md deleted file mode 100644 index 6274d5c2..00000000 --- a/doc/models/create-job-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Create Job Request - -Represents a [CreateJob](../../doc/apis/team.md#create-job) request. - -## Structure - -`CreateJobRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `job` | [`Job`](../../doc/models/job.md) | Required | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | getJob(): Job | setJob(Job job): void | -| `idempotencyKey` | `string` | Required | A unique identifier for the `CreateJob` request. Keys can be any valid string,
but must be unique for each request. For more information, see
[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency-key-0", - "job": { - "is_tip_eligible": true, - "title": "Cashier", - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at8" - } -} -``` - diff --git a/doc/models/create-job-response.md b/doc/models/create-job-response.md deleted file mode 100644 index 02c7de71..00000000 --- a/doc/models/create-job-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Job Response - -Represents a [CreateJob](../../doc/apis/team.md#create-job) response. Either `job` or `errors` -is present in the response. - -## Structure - -`CreateJobResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `job` | [`?Job`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | getJob(): ?Job | setJob(?Job job): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "job": { - "created_at": "2021-06-11T22:55:45Z", - "id": "1yJlHapkseYnNPETIU1B", - "is_tip_eligible": true, - "title": "Cashier", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-location-custom-attribute-definition-request.md b/doc/models/create-location-custom-attribute-definition-request.md deleted file mode 100644 index 86515713..00000000 --- a/doc/models/create-location-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Location Custom Attribute Definition Request - -Represents a [CreateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#create-location-custom-attribute-definition) request. - -## Structure - -`CreateLocationCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "Bestselling item at location", - "key": "bestseller", - "name": "Bestseller", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "idempotency_key": "idempotency_key6" -} -``` - diff --git a/doc/models/create-location-custom-attribute-definition-response.md b/doc/models/create-location-custom-attribute-definition-response.md deleted file mode 100644 index 72988023..00000000 --- a/doc/models/create-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Create Location Custom Attribute Definition Response - -Represents a [CreateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#create-location-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`CreateLocationCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-12-02T19:06:36.559Z", - "description": "Bestselling item at location", - "key": "bestseller", - "name": "Bestseller", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-12-02T19:06:36.559Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-location-request.md b/doc/models/create-location-request.md deleted file mode 100644 index cd401a39..00000000 --- a/doc/models/create-location-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Location Request - -The request object for the [CreateLocation](../../doc/apis/locations.md#create-location) endpoint. - -## Structure - -`CreateLocationRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `location` | [`?Location`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | getLocation(): ?Location | setLocation(?Location location): void | - -## Example (as JSON) - -```json -{ - "location": { - "address": { - "address_line_1": "1234 Peachtree St. NE", - "administrative_district_level_1": "GA", - "locality": "Atlanta", - "postal_code": "30309", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "description": "Midtown Atlanta store", - "name": "Midtown", - "id": "id4", - "timezone": "timezone6", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ] - } -} -``` - diff --git a/doc/models/create-location-response.md b/doc/models/create-location-response.md deleted file mode 100644 index 72eaf549..00000000 --- a/doc/models/create-location-response.md +++ /dev/null @@ -1,74 +0,0 @@ - -# Create Location Response - -The response object returned by the [CreateLocation](../../doc/apis/locations.md#create-location) endpoint. - -## Structure - -`CreateLocationResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `location` | [`?Location`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | getLocation(): ?Location | setLocation(?Location location): void | - -## Example (as JSON) - -```json -{ - "location": { - "address": { - "address_line_1": "1234 Peachtree St. NE", - "administrative_district_level_1": "GA", - "locality": "Atlanta", - "postal_code": "30309", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "business_name": "Jet Fuel Coffee", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ], - "coordinates": { - "latitude": 33.7889, - "longitude": -84.3841 - }, - "country": "US", - "created_at": "2022-02-19T17:58:25Z", - "currency": "USD", - "description": "Midtown Atlanta store", - "id": "3Z4V4WHQK64X9", - "language_code": "en-US", - "mcc": "7299", - "merchant_id": "3MYCJG5GVYQ8Q", - "name": "Midtown", - "status": "ACTIVE", - "timezone": "America/New_York", - "type": "PHYSICAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-loyalty-account-request.md b/doc/models/create-loyalty-account-request.md deleted file mode 100644 index f2f5b7b1..00000000 --- a/doc/models/create-loyalty-account-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Create Loyalty Account Request - -A request to create a new loyalty account. - -## Structure - -`CreateLoyaltyAccountRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyAccount` | [`LoyaltyAccount`](../../doc/models/loyalty-account.md) | Required | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | getLoyaltyAccount(): LoyaltyAccount | setLoyaltyAccount(LoyaltyAccount loyaltyAccount): void | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateLoyaltyAccount` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", - "loyalty_account": { - "mapping": { - "phone_number": "+14155551234" - }, - "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "id": "id6", - "balance": 6, - "lifetime_points": 30, - "customer_id": "customer_id4", - "enrolled_at": "enrolled_at6" - } -} -``` - diff --git a/doc/models/create-loyalty-account-response.md b/doc/models/create-loyalty-account-response.md deleted file mode 100644 index cc023aca..00000000 --- a/doc/models/create-loyalty-account-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Create Loyalty Account Response - -A response that includes loyalty account created. - -## Structure - -`CreateLoyaltyAccountResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyAccount` | [`?LoyaltyAccount`](../../doc/models/loyalty-account.md) | Optional | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | getLoyaltyAccount(): ?LoyaltyAccount | setLoyaltyAccount(?LoyaltyAccount loyaltyAccount): void | - -## Example (as JSON) - -```json -{ - "loyalty_account": { - "balance": 0, - "created_at": "2020-05-08T21:44:32Z", - "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", - "id": "79b807d2-d786-46a9-933b-918028d7a8c5", - "lifetime_points": 0, - "mapping": { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234" - }, - "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "updated_at": "2020-05-08T21:44:32Z", - "enrolled_at": "enrolled_at6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-loyalty-promotion-request.md b/doc/models/create-loyalty-promotion-request.md deleted file mode 100644 index 48151692..00000000 --- a/doc/models/create-loyalty-promotion-request.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Create Loyalty Promotion Request - -Represents a [CreateLoyaltyPromotion](../../doc/apis/loyalty.md#create-loyalty-promotion) request. - -## Structure - -`CreateLoyaltyPromotionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyPromotion` | [`LoyaltyPromotion`](../../doc/models/loyalty-promotion.md) | Required | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). Loyalty promotions enable buyers
to earn extra points on top of those earned from the base program.

A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. | getLoyaltyPromotion(): LoyaltyPromotion | setLoyaltyPromotion(LoyaltyPromotion loyaltyPromotion): void | -| `idempotencyKey` | `string` | Required | A unique identifier for this request, which is used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", - "loyalty_promotion": { - "available_time": { - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" - ], - "start_date": "start_date4", - "end_date": "end_date8" - }, - "incentive": { - "points_multiplier_data": { - "multiplier": "3.0", - "points_multiplier": 134 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "minimum_spend_amount_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "Tuesday Happy Hour Promo", - "qualifying_category_ids": [ - "XTQPYLR3IIU9C44VRCB3XD12" - ], - "trigger_limit": { - "interval": "DAY", - "times": 1 - }, - "id": "id4", - "status": "ACTIVE", - "created_at": "created_at2", - "canceled_at": "canceled_at0" - } -} -``` - diff --git a/doc/models/create-loyalty-promotion-response.md b/doc/models/create-loyalty-promotion-response.md deleted file mode 100644 index 5a6b5e38..00000000 --- a/doc/models/create-loyalty-promotion-response.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Create Loyalty Promotion Response - -Represents a [CreateLoyaltyPromotion](../../doc/apis/loyalty.md#create-loyalty-promotion) response. -Either `loyalty_promotion` or `errors` is present in the response. - -## Structure - -`CreateLoyaltyPromotionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyPromotion` | [`?LoyaltyPromotion`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). Loyalty promotions enable buyers
to earn extra points on top of those earned from the base program.

A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. | getLoyaltyPromotion(): ?LoyaltyPromotion | setLoyaltyPromotion(?LoyaltyPromotion loyaltyPromotion): void | - -## Example (as JSON) - -```json -{ - "loyalty_promotion": { - "available_time": { - "start_date": "2022-08-16", - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" - ], - "end_date": "end_date8" - }, - "created_at": "2022-08-16T08:38:54Z", - "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - "incentive": { - "points_multiplier_data": { - "multiplier": "3.000", - "points_multiplier": 3 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "minimum_spend_amount_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "Tuesday Happy Hour Promo", - "qualifying_category_ids": [ - "XTQPYLR3IIU9C44VRCB3XD12" - ], - "status": "ACTIVE", - "trigger_limit": { - "interval": "DAY", - "times": 1 - }, - "updated_at": "2022-08-16T08:38:54Z", - "canceled_at": "canceled_at0" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-loyalty-reward-request.md b/doc/models/create-loyalty-reward-request.md deleted file mode 100644 index 0c136aea..00000000 --- a/doc/models/create-loyalty-reward-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Create Loyalty Reward Request - -A request to create a loyalty reward. - -## Structure - -`CreateLoyaltyRewardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `reward` | [`LoyaltyReward`](../../doc/models/loyalty-reward.md) | Required | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state.
For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). | getReward(): LoyaltyReward | setReward(LoyaltyReward reward): void | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451", - "reward": { - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "id": "id0", - "status": "ISSUED", - "points": 222, - "created_at": "created_at8" - } -} -``` - diff --git a/doc/models/create-loyalty-reward-response.md b/doc/models/create-loyalty-reward-response.md deleted file mode 100644 index 6da4dc5f..00000000 --- a/doc/models/create-loyalty-reward-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Create Loyalty Reward Response - -A response that includes the loyalty reward created. - -## Structure - -`CreateLoyaltyRewardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `reward` | [`?LoyaltyReward`](../../doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state.
For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | - -## Example (as JSON) - -```json -{ - "reward": { - "created_at": "2020-05-01T21:49:54Z", - "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - "points": 10, - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "ISSUED", - "updated_at": "2020-05-01T21:49:54Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-merchant-custom-attribute-definition-request.md b/doc/models/create-merchant-custom-attribute-definition-request.md deleted file mode 100644 index 30790ee3..00000000 --- a/doc/models/create-merchant-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Merchant Custom Attribute Definition Request - -Represents a [CreateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) request. - -## Structure - -`CreateMerchantCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "This is the other name this merchant goes by.", - "key": "alternative_seller_name", - "name": "Alternative Merchant Name", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "visibility": "VISIBILITY_READ_ONLY" - }, - "idempotency_key": "idempotency_key6" -} -``` - diff --git a/doc/models/create-merchant-custom-attribute-definition-response.md b/doc/models/create-merchant-custom-attribute-definition-response.md deleted file mode 100644 index 3ac7ac28..00000000 --- a/doc/models/create-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Create Merchant Custom Attribute Definition Response - -Represents a [CreateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`CreateMerchantCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2023-05-05T19:06:36.559Z", - "description": "This is the other name this merchant goes by.", - "key": "alternative_seller_name", - "name": "Alternative Merchant Name", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2023-05-05T19:06:36.559Z", - "version": 1, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-mobile-authorization-code-request.md b/doc/models/create-mobile-authorization-code-request.md deleted file mode 100644 index 7a3de350..00000000 --- a/doc/models/create-mobile-authorization-code-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Create Mobile Authorization Code Request - -Defines the body parameters that can be provided in a request to the -`CreateMobileAuthorizationCode` endpoint. - -## Structure - -`CreateMobileAuthorizationCodeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The Square location ID that the authorization code should be tied to.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "location_id": "YOUR_LOCATION_ID" -} -``` - diff --git a/doc/models/create-mobile-authorization-code-response.md b/doc/models/create-mobile-authorization-code-response.md deleted file mode 100644 index 3a576bc0..00000000 --- a/doc/models/create-mobile-authorization-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Create Mobile Authorization Code Response - -Defines the fields that are included in the response body of -a request to the `CreateMobileAuthorizationCode` endpoint. - -## Structure - -`CreateMobileAuthorizationCodeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `authorizationCode` | `?string` | Optional | The generated authorization code that connects a mobile application instance
to a Square account.
**Constraints**: *Maximum Length*: `191` | getAuthorizationCode(): ?string | setAuthorizationCode(?string authorizationCode): void | -| `expiresAt` | `?string` | Optional | The timestamp when `authorization_code` expires, in
[RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z").
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", - "expires_at": "2019-01-10T19:42:08Z", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-order-custom-attribute-definition-request.md b/doc/models/create-order-custom-attribute-definition-request.md deleted file mode 100644 index b61fd1f8..00000000 --- a/doc/models/create-order-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Order Custom Attribute Definition Request - -Represents a create request for an order custom attribute definition. - -## Structure - -`CreateOrderCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "The number of people seated at a table", - "key": "cover-count", - "name": "Cover count", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "idempotency_key": "IDEMPOTENCY_KEY" -} -``` - diff --git a/doc/models/create-order-custom-attribute-definition-response.md b/doc/models/create-order-custom-attribute-definition-response.md deleted file mode 100644 index 14df7b9c..00000000 --- a/doc/models/create-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Order Custom Attribute Definition Response - -Represents a response from creating an order custom attribute definition. - -## Structure - -`CreateOrderCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-10-06T16:53:23.141Z", - "description": "The number of people seated at a table", - "key": "cover-count", - "name": "Cover count", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-10-06T16:53:23.141Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-order-request.md b/doc/models/create-order-request.md deleted file mode 100644 index 4d6aac30..00000000 --- a/doc/models/create-order-request.md +++ /dev/null @@ -1,121 +0,0 @@ - -# Create Order Request - -## Structure - -`CreateOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this
order among orders you have created.

If you are unsure whether a particular order was created successfully,
you can try it again with the same idempotency key without
worrying about creating duplicate orders.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", - "order": { - "discounts": [ - { - "name": "Labor Day Sale", - "percentage": "5", - "scope": "ORDER", - "uid": "labor-day-sale" - }, - { - "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", - "scope": "ORDER", - "uid": "membership-discount" - }, - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "name": "Sale - $1.00 off", - "scope": "LINE_ITEM", - "uid": "one-dollar-off" - } - ], - "line_items": [ - { - "base_price_money": { - "amount": 1599, - "currency": "USD" - }, - "name": "New York Strip Steak", - "quantity": "1", - "uid": "uid8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "applied_discounts": [ - { - "discount_uid": "one-dollar-off" - } - ], - "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", - "modifiers": [ - { - "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ" - } - ], - "quantity": "2", - "uid": "uid8", - "name": "name8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4" - } - ], - "location_id": "057P5VYJ4A5X1", - "reference_id": "my-order-001", - "taxes": [ - { - "name": "State Sales Tax", - "percentage": "9", - "scope": "ORDER", - "uid": "state-sales-tax" - } - ], - "id": "id6", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4" - } -} -``` - diff --git a/doc/models/create-order-response.md b/doc/models/create-order-response.md deleted file mode 100644 index fb0a3a56..00000000 --- a/doc/models/create-order-response.md +++ /dev/null @@ -1,329 +0,0 @@ - -# Create Order Response - -Defines the fields that are included in the response body of -a request to the `CreateOrder` endpoint. - -Either `errors` or `order` is present in a given response, but never both. - -## Structure - -`CreateOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "order": { - "created_at": "2020-01-17T20:47:53.293Z", - "discounts": [ - { - "applied_money": { - "amount": 30, - "currency": "USD" - }, - "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", - "name": "Membership Discount", - "percentage": "0.5", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "membership-discount" - }, - { - "applied_money": { - "amount": 303, - "currency": "USD" - }, - "name": "Labor Day Sale", - "percentage": "5", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "labor-day-sale" - }, - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "name": "Sale - $1.00 off", - "scope": "LINE_ITEM", - "type": "FIXED_AMOUNT", - "uid": "one-dollar-off" - } - ], - "id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "line_items": [ - { - "applied_discounts": [ - { - "applied_money": { - "amount": 8, - "currency": "USD" - }, - "discount_uid": "membership-discount", - "uid": "jWdgP1TpHPFBuVrz81mXVC" - }, - { - "applied_money": { - "amount": 79, - "currency": "USD" - }, - "discount_uid": "labor-day-sale", - "uid": "jnZOjjVY57eRcQAVgEwFuC" - } - ], - "applied_taxes": [ - { - "applied_money": { - "amount": 136, - "currency": "USD" - }, - "tax_uid": "state-sales-tax", - "uid": "aKG87ArnDpvMLSZJHxWUl" - } - ], - "base_price_money": { - "amount": 1599, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 1599, - "currency": "USD" - }, - "name": "New York Strip Steak", - "quantity": "1", - "total_discount_money": { - "amount": 87, - "currency": "USD" - }, - "total_money": { - "amount": 1648, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 136, - "currency": "USD" - }, - "uid": "8uSwfzvUImn3IRrvciqlXC", - "variation_total_price_money": { - "amount": 1599, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "applied_discounts": [ - { - "applied_money": { - "amount": 22, - "currency": "USD" - }, - "discount_uid": "membership-discount", - "uid": "nUXvdsIItfKko0dbYtY58C" - }, - { - "applied_money": { - "amount": 224, - "currency": "USD" - }, - "discount_uid": "labor-day-sale", - "uid": "qSdkOOOernlVQqsJ94SPjB" - }, - { - "applied_money": { - "amount": 100, - "currency": "USD" - }, - "discount_uid": "one-dollar-off", - "uid": "y7bVl4njrWAnfDwmz19izB" - } - ], - "applied_taxes": [ - { - "applied_money": { - "amount": 374, - "currency": "USD" - }, - "tax_uid": "state-sales-tax", - "uid": "v1dAgrfUVUPTnVTf9sRPz" - } - ], - "base_price_money": { - "amount": 2200, - "currency": "USD" - }, - "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", - "gross_sales_money": { - "amount": 4500, - "currency": "USD" - }, - "modifiers": [ - { - "base_price_money": { - "amount": 50, - "currency": "USD" - }, - "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", - "name": "Well", - "total_price_money": { - "amount": 100, - "currency": "USD" - }, - "uid": "Lo3qMMckDluu9Qsb58d4CC" - } - ], - "name": "New York Steak", - "quantity": "2", - "total_discount_money": { - "amount": 346, - "currency": "USD" - }, - "total_money": { - "amount": 4528, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 374, - "currency": "USD" - }, - "uid": "v8ZuEXpOJpb0bazLuvrLDB", - "variation_name": "Larger", - "variation_total_price_money": { - "amount": 4400, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4" - } - ], - "location_id": "057P5VYJ4A5X1", - "net_amounts": { - "discount_money": { - "amount": 433, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 510, - "currency": "USD" - }, - "tip_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 6176, - "currency": "USD" - } - }, - "reference_id": "my-order-001", - "source": { - "name": "My App" - }, - "state": "OPEN", - "taxes": [ - { - "applied_money": { - "amount": 510, - "currency": "USD" - }, - "name": "State Sales Tax", - "percentage": "9", - "scope": "ORDER", - "type": "ADDITIVE", - "uid": "state-sales-tax" - } - ], - "total_discount_money": { - "amount": 433, - "currency": "USD" - }, - "total_money": { - "amount": 6176, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 510, - "currency": "USD" - }, - "total_tip_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2020-01-17T20:47:53.293Z", - "version": 1, - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-payment-link-request.md b/doc/models/create-payment-link-request.md deleted file mode 100644 index 71730158..00000000 --- a/doc/models/create-payment-link-request.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Create Payment Link Request - -## Structure - -`CreatePaymentLinkRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies this `CreatePaymentLinkRequest` request.
If you do not provide a unique string (or provide an empty string as the value),
the endpoint treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `description` | `?string` | Optional | A description of the payment link. You provide this optional description that is useful in your
application context. It is not used anywhere.
**Constraints**: *Maximum Length*: `4096` | getDescription(): ?string | setDescription(?string description): void | -| `quickPay` | [`?QuickPay`](../../doc/models/quick-pay.md) | Optional | Describes an ad hoc item and price to generate a quick pay checkout link.
For more information,
see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). | getQuickPay(): ?QuickPay | setQuickPay(?QuickPay quickPay): void | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `checkoutOptions` | [`?CheckoutOptions`](../../doc/models/checkout-options.md) | Optional | - | getCheckoutOptions(): ?CheckoutOptions | setCheckoutOptions(?CheckoutOptions checkoutOptions): void | -| `prePopulatedData` | [`?PrePopulatedData`](../../doc/models/pre-populated-data.md) | Optional | Describes buyer data to prepopulate in the payment form.
For more information,
see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). | getPrePopulatedData(): ?PrePopulatedData | setPrePopulatedData(?PrePopulatedData prePopulatedData): void | -| `paymentNote` | `?string` | Optional | A note for the payment. After processing the payment, Square adds this note to the resulting `Payment`.
**Constraints**: *Maximum Length*: `500` | getPaymentNote(): ?string | setPaymentNote(?string paymentNote): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "cd9e25dc-d9f2-4430-aedb-61605070e95f", - "quick_pay": { - "location_id": "A9Y43N9ABXZBP", - "name": "Auto Detailing", - "price_money": { - "amount": 10000, - "currency": "USD" - } - }, - "description": "description6", - "order": { - "id": "id6", - "location_id": "location_id0", - "reference_id": "reference_id4", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - }, - "checkout_options": { - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - } -} -``` - diff --git a/doc/models/create-payment-link-response.md b/doc/models/create-payment-link-response.md deleted file mode 100644 index 408c3f1b..00000000 --- a/doc/models/create-payment-link-response.md +++ /dev/null @@ -1,266 +0,0 @@ - -# Create Payment Link Response - -## Structure - -`CreatePaymentLinkResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `paymentLink` | [`?PaymentLink`](../../doc/models/payment-link.md) | Optional | - | getPaymentLink(): ?PaymentLink | setPaymentLink(?PaymentLink paymentLink): void | -| `relatedResources` | [`?PaymentLinkRelatedResources`](../../doc/models/payment-link-related-resources.md) | Optional | - | getRelatedResources(): ?PaymentLinkRelatedResources | setRelatedResources(?PaymentLinkRelatedResources relatedResources): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "payment_link": { - "id": "id2", - "version": 184, - "description": "description2", - "order_id": "order_id6", - "checkout_options": { - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - }, - "related_resources": { - "orders": [ - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - } - ], - "subscription_plans": [ - { - "type": "ITEM_OPTION", - "id": "id4", - "updated_at": "updated_at0", - "version": 112, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "type": "ITEM_OPTION", - "id": "id4", - "updated_at": "updated_at0", - "version": 112, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "type": "ITEM_OPTION", - "id": "id4", - "updated_at": "updated_at0", - "version": 112, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ] - } -} -``` - diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md deleted file mode 100644 index a450f592..00000000 --- a/doc/models/create-payment-request.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Create Payment Request - -Describes a request to create a payment using -[CreatePayment](../../doc/apis/payments.md#create-payment). - -## Structure - -`CreatePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sourceId` | `string` | Required | The ID for the source of funds for this payment.
This could be a payment token generated by the Web Payments SDK for any of its
[supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods),
including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment
that the seller received outside of Square, specify either "CASH" or "EXTERNAL".
For more information, see
[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).
**Constraints**: *Minimum Length*: `1` | getSourceId(): string | setSourceId(string sourceId): void | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreatePayment` request. Keys can be any valid string
but must be unique for every `CreatePayment` request.

Note: The number of allowed characters might be less than the stated maximum, if multi-byte
characters are used.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `tipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `delayDuration` | `?string` | Optional | The duration of time after the payment's creation when Square automatically
either completes or cancels the payment depending on the `delay_action` field value.
For more information, see
[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).

This parameter should be specified as a time duration, in RFC 3339 format.

Note: This feature is only supported for card payments. This parameter can only be set for a delayed
capture payment (`autocomplete=false`).

Default:

- Card-present payments: "PT36H" (36 hours) from the creation time.
- Card-not-present payments: "P7D" (7 days) from the creation time. | getDelayDuration(): ?string | setDelayDuration(?string delayDuration): void | -| `delayAction` | `?string` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed. The action must be
CANCEL or COMPLETE. For more information, see
[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).

Default: CANCEL | getDelayAction(): ?string | setDelayAction(?string delayAction): void | -| `autocomplete` | `?bool` | Optional | If set to `true`, this payment will be completed when possible. If
set to `false`, this payment is held in an approved state until either
explicitly completed (captured) or canceled (voided). For more information, see
[Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).

Default: true | getAutocomplete(): ?bool | setAutocomplete(?bool autocomplete): void | -| `orderId` | `?string` | Optional | Associates a previously created order with this payment. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `customerId` | `?string` | Optional | The [Customer](entity:Customer) ID of the customer associated with the payment.

This is required if the `source_id` refers to a card on file created using the Cards API. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `locationId` | `?string` | Optional | The location ID to associate with the payment. If not specified, the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location) is
used. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `teamMemberId` | `?string` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with
this payment. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `referenceId` | `?string` | Optional | A user-defined ID to associate with the payment.

You can use this field to associate the payment to an entity in an external system
(for example, you might specify an order ID that is generated by a third-party shopping cart).
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `verificationToken` | `?string` | Optional | An identifying token generated by [payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity.

For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview). | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | -| `acceptPartialAuthorization` | `?bool` | Optional | If set to `true` and charging a Square Gift Card, a payment might be returned with
`amount_money` equal to less than what was requested. For example, a request for $20 when charging
a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose
to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card
payment. This field cannot be `true` when `autocomplete = true`.

For more information, see
[Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card).

Default: false | getAcceptPartialAuthorization(): ?bool | setAcceptPartialAuthorization(?bool acceptPartialAuthorization): void | -| `buyerEmailAddress` | `?string` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | getBuyerEmailAddress(): ?string | setBuyerEmailAddress(?string buyerEmailAddress): void | -| `buyerPhoneNumber` | `?string` | Optional | The buyer's phone number.
Must follow the following format:

1. A leading + symbol (followed by a country code)
2. The phone number can contain spaces and the special characters `(` , `)` , `-` , and `.`.
Alphabetical characters aren't allowed.
3. The phone number must contain between 9 and 16 digits. | getBuyerPhoneNumber(): ?string | setBuyerPhoneNumber(?string buyerPhoneNumber): void | -| `billingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | -| `shippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | -| `note` | `?string` | Optional | An optional note to be entered by the developer when creating a payment.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `statementDescriptionIdentifier` | `?string` | Optional | Optional additional payment information to include on the customer's card statement
as part of the statement description. This can be, for example, an invoice number, ticket number,
or short description that uniquely identifies the purchase.

Note that the `statement_description_identifier` might get truncated on the statement description
to fit the required information including the Square identifier (SQ *) and name of the
seller taking the payment.
**Constraints**: *Maximum Length*: `20` | getStatementDescriptionIdentifier(): ?string | setStatementDescriptionIdentifier(?string statementDescriptionIdentifier): void | -| `cashDetails` | [`?CashPaymentDetails`](../../doc/models/cash-payment-details.md) | Optional | Stores details about a cash payment. Contains only non-confidential information. For more information, see
[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). | getCashDetails(): ?CashPaymentDetails | setCashDetails(?CashPaymentDetails cashDetails): void | -| `externalDetails` | [`?ExternalPaymentDetails`](../../doc/models/external-payment-details.md) | Optional | Stores details about an external payment. Contains only non-confidential information.
For more information, see
[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). | getExternalDetails(): ?ExternalPaymentDetails | setExternalDetails(?ExternalPaymentDetails externalDetails): void | -| `customerDetails` | [`?CustomerDetails`](../../doc/models/customer-details.md) | Optional | Details about the customer making the payment. | getCustomerDetails(): ?CustomerDetails | setCustomerDetails(?CustomerDetails customerDetails): void | -| `offlinePaymentDetails` | [`?OfflinePaymentDetails`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | getOfflinePaymentDetails(): ?OfflinePaymentDetails | setOfflinePaymentDetails(?OfflinePaymentDetails offlinePaymentDetails): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "app_fee_money": { - "amount": 10, - "currency": "USD" - }, - "autocomplete": true, - "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", - "idempotency_key": "7b0f3ec5-086a-4871-8f13-3c81b3875218", - "location_id": "L88917AVBK2S5", - "note": "Brief description", - "reference_id": "123456", - "source_id": "ccof:GaJGNaZa8x4OgDJn4GB", - "tip_money": { - "amount": 190, - "currency": "TWD" - }, - "delay_duration": "delay_duration6", - "delay_action": "delay_action6" -} -``` - diff --git a/doc/models/create-payment-response.md b/doc/models/create-payment-response.md deleted file mode 100644 index 12671903..00000000 --- a/doc/models/create-payment-response.md +++ /dev/null @@ -1,114 +0,0 @@ - -# Create Payment Response - -Defines the response returned by [CreatePayment](../../doc/apis/payments.md#create-payment). - -If there are errors processing the request, the `payment` field might not be -present, or it might be present with a status of `FAILED`. - -## Structure - -`CreatePaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | - -## Example (as JSON) - -```json -{ - "payment": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "app_fee_money": { - "amount": 10, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", - "square_product": "ECOMMERCE_API" - }, - "approved_money": { - "amount": 1000, - "currency": "USD" - }, - "card_details": { - "auth_result_code": "vNEn2f", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T21:14:29.732Z", - "captured_at": "2021-10-13T21:14:30.504Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "ON_FILE", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "CAPTURED" - }, - "created_at": "2021-10-13T21:14:29.577Z", - "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T21:14:29.577Z", - "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", - "location_id": "L88917AVBK2S5", - "note": "Brief Description", - "order_id": "pRsjRTgFWATl7so6DxdKBJa7ssbZY", - "receipt_number": "R2B3", - "receipt_url": "https://squareup.com/receipt/preview/EXAMPLE_RECEIPT_ID", - "reference_id": "123456", - "risk_evaluation": { - "created_at": "2021-10-13T21:14:30.423Z", - "risk_level": "NORMAL" - }, - "source_type": "CARD", - "status": "COMPLETED", - "total_money": { - "amount": 1000, - "currency": "USD" - }, - "updated_at": "2021-10-13T21:14:30.504Z", - "version_token": "TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o", - "tip_money": { - "amount": 190, - "currency": "TWD" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-refund-request.md b/doc/models/create-refund-request.md deleted file mode 100644 index f0c0c14c..00000000 --- a/doc/models/create-refund-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Create Refund Request - -Defines the body parameters that can be included in -a request to the [CreateRefund](api-endpoint:Transactions-CreateRefund) endpoint. - -Deprecated - recommend using [RefundPayment](api-endpoint:Refunds-RefundPayment) - -## Structure - -`CreateRefundRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
refund among refunds you've created for the tender.

If you're unsure whether a particular refund succeeded,
you can reattempt it with the same idempotency key without
worrying about duplicating the refund.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `tenderId` | `string` | Required | The ID of the tender to refund.

A [`Transaction`](entity:Transaction) has one or more `tenders` (i.e., methods
of payment) associated with it, and you refund each tender separately with
the Connect API.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getTenderId(): string | setTenderId(string tenderId): void | -| `reason` | `?string` | Optional | A description of the reason for the refund.

Default value: `Refund via API`
**Constraints**: *Maximum Length*: `192` | getReason(): ?string | setReason(?string reason): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad2", - "reason": "a reason", - "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF" -} -``` - diff --git a/doc/models/create-refund-response.md b/doc/models/create-refund-response.md deleted file mode 100644 index 5c067db0..00000000 --- a/doc/models/create-refund-response.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Create Refund Response - -Defines the fields that are included in the response body of -a request to the [CreateRefund](api-endpoint:Transactions-CreateRefund) endpoint. - -One of `errors` or `refund` is present in a given response (never both). - -## Structure - -`CreateRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?Refund`](../../doc/models/refund.md) | Optional | Represents a refund processed for a Square transaction. | getRefund(): ?Refund | setRefund(?Refund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "additional_recipients": [ - { - "amount_money": { - "amount": 10, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1", - "receivable_id": "ISu5xwxJ5v0CMJTQq7RvqyMF" - } - ], - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "created_at": "2016-02-12T00:28:18Z", - "id": "b27436d1-7f8e-5610-45c6-417ef71434b4-SW", - "location_id": "18YC4JDH91E1H", - "reason": "some reason", - "status": "PENDING", - "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-shift-request.md b/doc/models/create-shift-request.md deleted file mode 100644 index 7c3b3862..00000000 --- a/doc/models/create-shift-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Shift Request - -Represents a request to create a `Shift`. - -## Structure - -`CreateShiftRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `shift` | [`Shift`](../../doc/models/shift.md) | Required | A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift. | getShift(): Shift | setShift(Shift shift): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "HIDSNG5KS478L", - "shift": { - "breaks": [ - { - "break_type_id": "REGS1EQR1TPZ5", - "end_at": "2019-01-25T06:16:00-05:00", - "expected_duration": "PT5M", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-25T06:11:00-05:00" - } - ], - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "end_at": "2019-01-25T13:11:00-05:00", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-25T03:11:00-05:00", - "team_member_id": "ormj0jJJZ5OZIzxrZYJI", - "wage": { - "hourly_rate": { - "amount": 1100, - "currency": "USD" - }, - "tip_eligible": true, - "title": "Barista", - "job_id": "job_id0" - }, - "id": "id4", - "employee_id": "employee_id4", - "timezone": "timezone4" - } -} -``` - diff --git a/doc/models/create-shift-response.md b/doc/models/create-shift-response.md deleted file mode 100644 index c58cd34a..00000000 --- a/doc/models/create-shift-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Create Shift Response - -The response to a request to create a `Shift`. The response contains -the created `Shift` object and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`CreateShiftResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `shift` | [`?Shift`](../../doc/models/shift.md) | Optional | A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift. | getShift(): ?Shift | setShift(?Shift shift): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "shift": { - "breaks": [ - { - "break_type_id": "REGS1EQR1TPZ5", - "end_at": "2019-01-25T06:16:00-05:00", - "expected_duration": "PT5M", - "id": "X7GAQYVVRRG6P", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-25T06:11:00-05:00" - } - ], - "created_at": "2019-02-28T00:39:02Z", - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "employee_id": "ormj0jJJZ5OZIzxrZYJI", - "end_at": "2019-01-25T13:11:00-05:00", - "id": "K0YH4CV5462JB", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-25T03:11:00-05:00", - "status": "CLOSED", - "team_member_id": "ormj0jJJZ5OZIzxrZYJI", - "timezone": "America/New_York", - "updated_at": "2019-02-28T00:39:02Z", - "version": 1, - "wage": { - "hourly_rate": { - "amount": 1100, - "currency": "USD" - }, - "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", - "tip_eligible": true, - "title": "Barista" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md deleted file mode 100644 index 45c0e815..00000000 --- a/doc/models/create-subscription-request.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Create Subscription Request - -Defines input parameters in a request to the -[CreateSubscription](../../doc/apis/subscriptions.md#create-subscription) endpoint. - -## Structure - -`CreateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies this `CreateSubscription` request.
If you do not provide a unique string (or provide an empty string as the value),
the endpoint treats each request as independent.

For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `locationId` | `string` | Required | The ID of the location the subscription is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `planVariationId` | `?string` | Optional | The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API. | getPlanVariationId(): ?string | setPlanVariationId(?string planVariationId): void | -| `customerId` | `string` | Required | The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | -| `startDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date to start the subscription.
If it is unspecified, the subscription starts immediately. | getStartDate(): ?string | setStartDate(?string startDate): void | -| `canceledDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation.

This date overrides the cancellation date set in the plan variation configuration.
If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops
at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date`
occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription
stops through the end of the last cycle. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | -| `taxPercentage` | `?string` | Optional | The tax to add when billing the subscription.
The percentage is expressed in decimal form, using a `'.'` as the decimal
separator and without a `'%'` sign. For example, a value of 7.5
corresponds to 7.5%.
**Constraints**: *Maximum Length*: `10` | getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void | -| `priceOverrideMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void | -| `cardId` | `?string` | Optional | The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge.
If it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription. | getCardId(): ?string | setCardId(?string cardId): void | -| `timezone` | `?string` | Optional | The timezone that is used in date calculations for the subscription. If unset, defaults to
the location timezone. If a timezone is not configured for the location, defaults to "America/New_York".
Format: the IANA Timezone Database identifier for the location timezone. For
a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | getTimezone(): ?string | setTimezone(?string timezone): void | -| `source` | [`?SubscriptionSource`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | getSource(): ?SubscriptionSource | setSource(?SubscriptionSource source): void | -| `monthlyBillingAnchorDate` | `?int` | Optional | The day-of-the-month to change the billing date to.
**Constraints**: `>= 1`, `<= 31` | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | array of phases for this subscription | getPhases(): ?array | setPhases(?array phases): void | - -## Example (as JSON) - -```json -{ - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - "ordinal": 0 - } - ], - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2023-06-20", - "timezone": "America/Los_Angeles", - "canceled_date": "canceled_date6", - "tax_percentage": "tax_percentage6" -} -``` - diff --git a/doc/models/create-subscription-response.md b/doc/models/create-subscription-response.md deleted file mode 100644 index fd623c70..00000000 --- a/doc/models/create-subscription-response.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Create Subscription Response - -Defines output parameters in a response from the -[CreateSubscription](../../doc/apis/subscriptions.md#create-subscription) endpoint. - -## Structure - -`CreateSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - "ordinal": 0, - "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", - "uid": "873451e0-745b-4e87-ab0b-c574933fe616" - } - ], - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2023-06-20", - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-team-member-request.md b/doc/models/create-team-member-request.md deleted file mode 100644 index 3595bcf9..00000000 --- a/doc/models/create-team-member-request.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Create Team Member Request - -Represents a create request for a `TeamMember` object. - -## Structure - -`CreateTeamMemberRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies this `CreateTeamMember` request.
Keys can be any valid string, but must be unique for every request.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).

The minimum length is 1 and the maximum length is 45. | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `teamMember` | [`?TeamMember`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | getTeamMember(): ?TeamMember | setTeamMember(?TeamMember teamMember): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency-key-0", - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "YSGH2WBKG94QZ", - "GA2Y9HSJ8KRYT" - ] - }, - "email_address": "joe_doe@gmail.com", - "family_name": "Doe", - "given_name": "Joe", - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "wage_setting": { - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "pay_type": "HOURLY" - } - ] - }, - "id": "id6", - "is_owner": false - } -} -``` - diff --git a/doc/models/create-team-member-response.md b/doc/models/create-team-member-response.md deleted file mode 100644 index b2b600fb..00000000 --- a/doc/models/create-team-member-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Create Team Member Response - -Represents a response from a create request containing the created `TeamMember` object or error messages. - -## Structure - -`CreateTeamMemberResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMember` | [`?TeamMember`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | getTeamMember(): ?TeamMember | setTeamMember(?TeamMember teamMember): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "GA2Y9HSJ8KRYT", - "YSGH2WBKG94QZ" - ] - }, - "created_at": "2021-06-11T22:55:45Z", - "email_address": "joe_doe@example.com", - "family_name": "Doe", - "given_name": "Joe", - "id": "1yJlHapkseYnNPETIU1B", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "updated_at": "2021-06-11T22:55:45Z", - "wage_setting": { - "created_at": "2021-06-11T22:55:45Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 1443, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "1yJlHapkseYnNPETIU1B", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-terminal-action-request.md b/doc/models/create-terminal-action-request.md deleted file mode 100644 index 39e1d1f5..00000000 --- a/doc/models/create-terminal-action-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Terminal Action Request - -## Structure - -`CreateTerminalActionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateAction` request. Keys can be any valid string
but must be unique for every `CreateAction` request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more
information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `action` | [`TerminalAction`](../../doc/models/terminal-action.md) | Required | Represents an action processed by the Square Terminal. | getAction(): TerminalAction | setAction(TerminalAction action): void | - -## Example (as JSON) - -```json -{ - "action": { - "deadline_duration": "PT5M", - "device_id": "{{DEVICE_ID}}", - "save_card_options": { - "customer_id": "{{CUSTOMER_ID}}", - "reference_id": "user-id-1" - }, - "type": "SAVE_CARD", - "id": "id2", - "status": "status4", - "cancel_reason": "TIMED_OUT" - }, - "idempotency_key": "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e" -} -``` - diff --git a/doc/models/create-terminal-action-response.md b/doc/models/create-terminal-action-response.md deleted file mode 100644 index 0ef5bbbf..00000000 --- a/doc/models/create-terminal-action-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Create Terminal Action Response - -## Structure - -`CreateTerminalActionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void | - -## Example (as JSON) - -```json -{ - "action": { - "app_id": "APP_ID", - "created_at": "2021-07-28T23:22:07.476Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:jveJIAkkAjILHkdCE", - "location_id": "LOCATION_ID", - "save_card_options": { - "customer_id": "CUSTOMER_ID", - "reference_id": "user-id-1" - }, - "status": "PENDING", - "type": "SAVE_CARD", - "updated_at": "2021-07-28T23:22:07.476Z", - "cancel_reason": "TIMED_OUT" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-terminal-checkout-request.md b/doc/models/create-terminal-checkout-request.md deleted file mode 100644 index f89fddc8..00000000 --- a/doc/models/create-terminal-checkout-request.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Create Terminal Checkout Request - -## Structure - -`CreateTerminalCheckoutRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateCheckout` request. Keys can be any valid string but
must be unique for every `CreateCheckout` request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `checkout` | [`TerminalCheckout`](../../doc/models/terminal-checkout.md) | Required | Represents a checkout processed by the Square Terminal. | getCheckout(): TerminalCheckout | setCheckout(TerminalCheckout checkout): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": false, - "collect_signature": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "show_itemized_cart": false - }, - "note": "A brief note", - "reference_id": "id11572", - "id": "id2", - "order_id": "order_id6", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - }, - "idempotency_key": "28a0c3bc-7839-11ea-bc55-0242ac130003" -} -``` - diff --git a/doc/models/create-terminal-checkout-response.md b/doc/models/create-terminal-checkout-response.md deleted file mode 100644 index dfea2411..00000000 --- a/doc/models/create-terminal-checkout-response.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Create Terminal Checkout Response - -## Structure - -`CreateTerminalCheckoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `checkout` | [`?TerminalCheckout`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | getCheckout(): ?TerminalCheckout | setCheckout(?TerminalCheckout checkout): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "app_id": "APP_ID", - "created_at": "2020-04-06T16:39:32.545Z", - "deadline_duration": "PT5M", - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "collect_signature": false, - "show_itemized_cart": false - }, - "id": "08YceKh7B3ZqO", - "location_id": "LOCATION_ID", - "note": "A brief note", - "payment_type": "CARD_PRESENT", - "reference_id": "id11572", - "status": "PENDING", - "updated_at": "2020-04-06T16:39:32.545Z", - "order_id": "order_id6", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-terminal-refund-request.md b/doc/models/create-terminal-refund-request.md deleted file mode 100644 index c8232415..00000000 --- a/doc/models/create-terminal-refund-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Create Terminal Refund Request - -## Structure - -`CreateTerminalRefundRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateRefund` request. Keys can be any valid string but
must be unique for every `CreateRefund` request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `refund` | [`?TerminalRefund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | getRefund(): ?TerminalRefund | setRefund(?TerminalRefund refund): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "402a640b-b26f-401f-b406-46f839590c04", - "refund": { - "amount_money": { - "amount": 111, - "currency": "CAD" - }, - "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "reason": "Returning items", - "id": "id8", - "refund_id": "refund_id2", - "order_id": "order_id2", - "deadline_duration": "deadline_duration0", - "status": "status0" - } -} -``` - diff --git a/doc/models/create-terminal-refund-response.md b/doc/models/create-terminal-refund-response.md deleted file mode 100644 index 78933915..00000000 --- a/doc/models/create-terminal-refund-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Terminal Refund Response - -## Structure - -`CreateTerminalRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?TerminalRefund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | getRefund(): ?TerminalRefund | setRefund(?TerminalRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 111, - "currency": "CAD" - }, - "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", - "card": { - "bin": "411111", - "card_brand": "INTERAC", - "card_type": "CREDIT", - "exp_month": 1, - "exp_year": 2022, - "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", - "last_4": "1111" - }, - "created_at": "2020-09-29T15:21:46.771Z", - "deadline_duration": "PT5M", - "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "location_id": "76C9W6K8CNNQ5", - "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", - "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "reason": "Returning items", - "status": "PENDING", - "updated_at": "2020-09-29T15:21:46.771Z", - "refund_id": "refund_id2" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/create-vendor-request.md b/doc/models/create-vendor-request.md deleted file mode 100644 index 9b9075e4..00000000 --- a/doc/models/create-vendor-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Create Vendor Request - -Represents an input to a call to [CreateVendor](../../doc/apis/vendors.md#create-vendor). - -## Structure - -`CreateVendorRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint:Vendors-CreateVendor) call idempotent.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more
information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `vendor` | [`?Vendor`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | getVendor(): ?Vendor | setVendor(?Vendor vendor): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key6", - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } -} -``` - diff --git a/doc/models/create-vendor-response.md b/doc/models/create-vendor-response.md deleted file mode 100644 index e5affc10..00000000 --- a/doc/models/create-vendor-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Create Vendor Response - -Represents an output from a call to [CreateVendor](../../doc/apis/vendors.md#create-vendor). - -## Structure - -`CreateVendorResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | getErrors(): ?array | setErrors(?array errors): void | -| `vendor` | [`?Vendor`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | getVendor(): ?Vendor | setVendor(?Vendor vendor): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } -} -``` - diff --git a/doc/models/create-webhook-subscription-request.md b/doc/models/create-webhook-subscription-request.md deleted file mode 100644 index 2dcc2533..00000000 --- a/doc/models/create-webhook-subscription-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Create Webhook Subscription Request - -Creates a [Subscription](../../doc/models/webhook-subscription.md). - -## Structure - -`CreateWebhookSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) request.
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `subscription` | [`WebhookSubscription`](../../doc/models/webhook-subscription.md) | Required | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscription(): WebhookSubscription | setSubscription(WebhookSubscription subscription): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "63f84c6c-2200-4c99-846c-2670a1311fbf", - "subscription": { - "api_version": "2021-12-15", - "event_types": [ - "payment.created", - "payment.updated" - ], - "name": "Example Webhook Subscription", - "notification_url": "https://example-webhook-url.com", - "id": "id4", - "enabled": false - } -} -``` - diff --git a/doc/models/create-webhook-subscription-response.md b/doc/models/create-webhook-subscription-response.md deleted file mode 100644 index e9894279..00000000 --- a/doc/models/create-webhook-subscription-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Create Webhook Subscription Response - -Defines the fields that are included in the response body of -a request to the [CreateWebhookSubscription](../../doc/apis/webhook-subscriptions.md#create-webhook-subscription) endpoint. - -Note: if there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) will not be -present. - -## Structure - -`CreateWebhookSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?WebhookSubscription`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscription(): ?WebhookSubscription | setSubscription(?WebhookSubscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "api_version": "2021-12-15", - "created_at": "2022-01-10 23:29:48 +0000 UTC", - "enabled": true, - "event_types": [ - "payment.created", - "payment.updated" - ], - "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", - "name": "Example Webhook Subscription", - "notification_url": "https://example-webhook-url.com", - "signature_key": "1k9bIJKCeTmSQwyagtNRLg", - "updated_at": "2022-01-10 23:29:48 +0000 UTC" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/currency.md b/doc/models/currency.md deleted file mode 100644 index 3667d5fe..00000000 --- a/doc/models/currency.md +++ /dev/null @@ -1,198 +0,0 @@ - -# Currency - -Indicates the associated currency for an amount of money. Values correspond -to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - -## Enumeration - -`Currency` - -## Fields - -| Name | Description | -| --- | --- | -| `UNKNOWN_CURRENCY` | Unknown currency | -| `AED` | United Arab Emirates dirham | -| `AFN` | Afghan afghani | -| `ALL` | Albanian lek | -| `AMD` | Armenian dram | -| `ANG` | Netherlands Antillean guilder | -| `AOA` | Angolan kwanza | -| `ARS` | Argentine peso | -| `AUD` | Australian dollar | -| `AWG` | Aruban florin | -| `AZN` | Azerbaijani manat | -| `BAM` | Bosnia and Herzegovina convertible mark | -| `BBD` | Barbados dollar | -| `BDT` | Bangladeshi taka | -| `BGN` | Bulgarian lev | -| `BHD` | Bahraini dinar | -| `BIF` | Burundian franc | -| `BMD` | Bermudian dollar | -| `BND` | Brunei dollar | -| `BOB` | Boliviano | -| `BOV` | Bolivian Mvdol | -| `BRL` | Brazilian real | -| `BSD` | Bahamian dollar | -| `BTN` | Bhutanese ngultrum | -| `BWP` | Botswana pula | -| `BYR` | Belarusian ruble | -| `BZD` | Belize dollar | -| `CAD` | Canadian dollar | -| `CDF` | Congolese franc | -| `CHE` | WIR Euro | -| `CHF` | Swiss franc | -| `CHW` | WIR Franc | -| `CLF` | Unidad de Fomento | -| `CLP` | Chilean peso | -| `CNY` | Chinese yuan | -| `COP` | Colombian peso | -| `COU` | Unidad de Valor Real | -| `CRC` | Costa Rican colon | -| `CUC` | Cuban convertible peso | -| `CUP` | Cuban peso | -| `CVE` | Cape Verdean escudo | -| `CZK` | Czech koruna | -| `DJF` | Djiboutian franc | -| `DKK` | Danish krone | -| `DOP` | Dominican peso | -| `DZD` | Algerian dinar | -| `EGP` | Egyptian pound | -| `ERN` | Eritrean nakfa | -| `ETB` | Ethiopian birr | -| `EUR` | Euro | -| `FJD` | Fiji dollar | -| `FKP` | Falkland Islands pound | -| `GBP` | Pound sterling | -| `GEL` | Georgian lari | -| `GHS` | Ghanaian cedi | -| `GIP` | Gibraltar pound | -| `GMD` | Gambian dalasi | -| `GNF` | Guinean franc | -| `GTQ` | Guatemalan quetzal | -| `GYD` | Guyanese dollar | -| `HKD` | Hong Kong dollar | -| `HNL` | Honduran lempira | -| `HRK` | Croatian kuna | -| `HTG` | Haitian gourde | -| `HUF` | Hungarian forint | -| `IDR` | Indonesian rupiah | -| `ILS` | Israeli new shekel | -| `INR` | Indian rupee | -| `IQD` | Iraqi dinar | -| `IRR` | Iranian rial | -| `ISK` | Icelandic króna | -| `JMD` | Jamaican dollar | -| `JOD` | Jordanian dinar | -| `JPY` | Japanese yen | -| `KES` | Kenyan shilling | -| `KGS` | Kyrgyzstani som | -| `KHR` | Cambodian riel | -| `KMF` | Comoro franc | -| `KPW` | North Korean won | -| `KRW` | South Korean won | -| `KWD` | Kuwaiti dinar | -| `KYD` | Cayman Islands dollar | -| `KZT` | Kazakhstani tenge | -| `LAK` | Lao kip | -| `LBP` | Lebanese pound | -| `LKR` | Sri Lankan rupee | -| `LRD` | Liberian dollar | -| `LSL` | Lesotho loti | -| `LTL` | Lithuanian litas | -| `LVL` | Latvian lats | -| `LYD` | Libyan dinar | -| `MAD` | Moroccan dirham | -| `MDL` | Moldovan leu | -| `MGA` | Malagasy ariary | -| `MKD` | Macedonian denar | -| `MMK` | Myanmar kyat | -| `MNT` | Mongolian tögrög | -| `MOP` | Macanese pataca | -| `MRO` | Mauritanian ouguiya | -| `MUR` | Mauritian rupee | -| `MVR` | Maldivian rufiyaa | -| `MWK` | Malawian kwacha | -| `MXN` | Mexican peso | -| `MXV` | Mexican Unidad de Inversion | -| `MYR` | Malaysian ringgit | -| `MZN` | Mozambican metical | -| `NAD` | Namibian dollar | -| `NGN` | Nigerian naira | -| `NIO` | Nicaraguan córdoba | -| `NOK` | Norwegian krone | -| `NPR` | Nepalese rupee | -| `NZD` | New Zealand dollar | -| `OMR` | Omani rial | -| `PAB` | Panamanian balboa | -| `PEN` | Peruvian sol | -| `PGK` | Papua New Guinean kina | -| `PHP` | Philippine peso | -| `PKR` | Pakistani rupee | -| `PLN` | Polish złoty | -| `PYG` | Paraguayan guaraní | -| `QAR` | Qatari riyal | -| `RON` | Romanian leu | -| `RSD` | Serbian dinar | -| `RUB` | Russian ruble | -| `RWF` | Rwandan franc | -| `SAR` | Saudi riyal | -| `SBD` | Solomon Islands dollar | -| `SCR` | Seychelles rupee | -| `SDG` | Sudanese pound | -| `SEK` | Swedish krona | -| `SGD` | Singapore dollar | -| `SHP` | Saint Helena pound | -| `SLL` | Sierra Leonean first leone | -| `SLE` | Sierra Leonean second leone | -| `SOS` | Somali shilling | -| `SRD` | Surinamese dollar | -| `SSP` | South Sudanese pound | -| `STD` | São Tomé and Príncipe dobra | -| `SVC` | Salvadoran colón | -| `SYP` | Syrian pound | -| `SZL` | Swazi lilangeni | -| `THB` | Thai baht | -| `TJS` | Tajikstani somoni | -| `TMT` | Turkmenistan manat | -| `TND` | Tunisian dinar | -| `TOP` | Tongan pa'anga | -| `TRY` | Turkish lira | -| `TTD` | Trinidad and Tobago dollar | -| `TWD` | New Taiwan dollar | -| `TZS` | Tanzanian shilling | -| `UAH` | Ukrainian hryvnia | -| `UGX` | Ugandan shilling | -| `USD` | United States dollar | -| `USN` | United States dollar (next day) | -| `USS` | United States dollar (same day) | -| `UYI` | Uruguay Peso en Unidedades Indexadas | -| `UYU` | Uruguyan peso | -| `UZS` | Uzbekistan som | -| `VEF` | Venezuelan bolívar soberano | -| `VND` | Vietnamese đồng | -| `VUV` | Vanuatu vatu | -| `WST` | Samoan tala | -| `XAF` | CFA franc BEAC | -| `XAG` | Silver | -| `XAU` | Gold | -| `XBA` | European Composite Unit | -| `XBB` | European Monetary Unit | -| `XBC` | European Unit of Account 9 | -| `XBD` | European Unit of Account 17 | -| `XCD` | East Caribbean dollar | -| `XDR` | Special drawing rights (International Monetary Fund) | -| `XOF` | CFA franc BCEAO | -| `XPD` | Palladium | -| `XPF` | CFP franc | -| `XPT` | Platinum | -| `XTS` | Code reserved for testing | -| `XXX` | No currency | -| `YER` | Yemeni rial | -| `ZAR` | South African rand | -| `ZMK` | Zambian kwacha | -| `ZMW` | Zambian kwacha | -| `BTC` | Bitcoin | -| `XUS` | USD Coin | - diff --git a/doc/models/custom-attribute-definition-visibility.md b/doc/models/custom-attribute-definition-visibility.md deleted file mode 100644 index 3e51a4af..00000000 --- a/doc/models/custom-attribute-definition-visibility.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Custom Attribute Definition Visibility - -The level of permission that a seller or other applications requires to -view this custom attribute definition. -The `Visibility` field controls who can read and write the custom attribute values -and custom attribute definition. - -## Enumeration - -`CustomAttributeDefinitionVisibility` - -## Fields - -| Name | Description | -| --- | --- | -| `VISIBILITY_HIDDEN` | The custom attribute definition and values are hidden from the seller (except on export
of all seller data) and other developers. | -| `VISIBILITY_READ_ONLY` | The seller and other developers can read the custom attribute definition and values
on resources. | -| `VISIBILITY_READ_WRITE_VALUES` | The seller and other developers can read the custom attribute definition,
and can read and write values on resources. A custom attribute definition
can only be edited or deleted by the application that created it. | - diff --git a/doc/models/custom-attribute-definition.md b/doc/models/custom-attribute-definition.md deleted file mode 100644 index 68cdc072..00000000 --- a/doc/models/custom-attribute-definition.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Custom Attribute Definition - -Represents a definition for custom attribute values. A custom attribute definition -specifies the key, visibility, schema, and other properties for a custom attribute. - -## Structure - -`CustomAttributeDefinition` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `?string` | Optional | The identifier
of the custom attribute definition and its corresponding custom attributes. This value
can be a simple key, which is the key that is provided when the custom attribute definition
is created, or a qualified key, if the requesting
application is not the definition owner. The qualified key consists of the application ID
of the custom attribute definition owner
followed by the simple key that was provided when the definition was created. It has the
format application_id:simple key.

The value for a simple key can contain up to 60 alphanumeric characters, periods (.),
underscores (_), and hyphens (-).

This field can not be changed
after the custom attribute definition is created. This field is required when creating
a definition and must be unique per application, seller, and resource type.
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$` | getKey(): ?string | setKey(?string key): void | -| `schema` | `mixed` | Optional | The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition. | getSchema(): | setSchema( schema): void | -| `name` | `?string` | Optional | The name of the custom attribute definition for API and seller-facing UI purposes. The name must
be unique within the seller and application pair. This field is required if the
`visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `description` | `?string` | Optional | Seller-oriented description of the custom attribute definition, including any constraints
that the seller should observe. May be displayed as a tooltip in Square UIs. This field is
required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
**Constraints**: *Maximum Length*: `255` | getDescription(): ?string | setDescription(?string description): void | -| `visibility` | [`?string(CustomAttributeDefinitionVisibility)`](../../doc/models/custom-attribute-definition-visibility.md) | Optional | The level of permission that a seller or other applications requires to
view this custom attribute definition.
The `Visibility` field controls who can read and write the custom attribute values
and custom attribute definition. | getVisibility(): ?string | setVisibility(?string visibility): void | -| `version` | `?int` | Optional | Read only. The current version of the custom attribute definition.
The value is incremented each time the custom attribute definition is updated.
When updating a custom attribute definition, you can provide this field
and specify the current version of the custom attribute definition to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).

On writes, this field must be set to the latest version. Stale writes are rejected.

This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). | getVersion(): ?int | setVersion(?int version): void | -| `updatedAt` | `?string` | Optional | The timestamp that indicates when the custom attribute definition was created or most recently updated,
in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `createdAt` | `?string` | Optional | The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "key": "key8", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name8", - "description": "description2", - "visibility": "VISIBILITY_READ_WRITE_VALUES" -} -``` - diff --git a/doc/models/custom-attribute-filter.md b/doc/models/custom-attribute-filter.md deleted file mode 100644 index a1e65381..00000000 --- a/doc/models/custom-attribute-filter.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Custom Attribute Filter - -Supported custom attribute query expressions for calling the -[SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items) -endpoint to search for items or item variations. - -## Structure - -`CustomAttributeFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitionId` | `?string` | Optional | A query expression to filter items or item variations by matching their custom attributes'
`custom_attribute_definition_id` property value against the the specified id.
Exactly one of `custom_attribute_definition_id` or `key` must be specified. | getCustomAttributeDefinitionId(): ?string | setCustomAttributeDefinitionId(?string customAttributeDefinitionId): void | -| `key` | `?string` | Optional | A query expression to filter items or item variations by matching their custom attributes'
`key` property value against the specified key.
Exactly one of `custom_attribute_definition_id` or `key` must be specified. | getKey(): ?string | setKey(?string key): void | -| `stringFilter` | `?string` | Optional | A query expression to filter items or item variations by matching their custom attributes'
`string_value` property value against the specified text.
Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified. | getStringFilter(): ?string | setStringFilter(?string stringFilter): void | -| `numberFilter` | [`?Range`](../../doc/models/range.md) | Optional | The range of a number value between the specified lower and upper bounds. | getNumberFilter(): ?Range | setNumberFilter(?Range numberFilter): void | -| `selectionUidsFilter` | `?(string[])` | Optional | A query expression to filter items or item variations by matching their custom attributes'
`selection_uid_values` values against the specified selection uids.
Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified. | getSelectionUidsFilter(): ?array | setSelectionUidsFilter(?array selectionUidsFilter): void | -| `boolFilter` | `?bool` | Optional | A query expression to filter items or item variations by matching their custom attributes'
`boolean_value` property values against the specified Boolean expression.
Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified. | getBoolFilter(): ?bool | setBoolFilter(?bool boolFilter): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition_id": "custom_attribute_definition_id0", - "key": "key2", - "string_filter": "string_filter4", - "number_filter": { - "min": "min8", - "max": "max4" - }, - "selection_uids_filter": [ - "selection_uids_filter0", - "selection_uids_filter9", - "selection_uids_filter8" - ] -} -``` - diff --git a/doc/models/custom-attribute.md b/doc/models/custom-attribute.md deleted file mode 100644 index 3e45e6e6..00000000 --- a/doc/models/custom-attribute.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Custom Attribute - -A custom attribute value. Each custom attribute value has a corresponding -`CustomAttributeDefinition` object. - -## Structure - -`CustomAttribute` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `?string` | Optional | The identifier
of the custom attribute definition and its corresponding custom attributes. This value
can be a simple key, which is the key that is provided when the custom attribute definition
is created, or a qualified key, if the requesting
application is not the definition owner. The qualified key consists of the application ID
of the custom attribute definition owner
followed by the simple key that was provided when the definition was created. It has the
format application_id:simple key.

The value for a simple key can contain up to 60 alphanumeric characters, periods (.),
underscores (_), and hyphens (-).
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$` | getKey(): ?string | setKey(?string key): void | -| `value` | `mixed` | Optional | The value assigned to the custom attribute. It is validated against the custom
attribute definition's schema on write operations. For more information about custom
attribute values,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). | getValue(): | setValue( value): void | -| `version` | `?int` | Optional | Read only. The current version of the custom attribute. This field is incremented when the custom attribute is changed.
When updating an existing custom attribute value, you can provide this field
and specify the current version of the custom attribute to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).
This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). | getVersion(): ?int | setVersion(?int version): void | -| `visibility` | [`?string(CustomAttributeDefinitionVisibility)`](../../doc/models/custom-attribute-definition-visibility.md) | Optional | The level of permission that a seller or other applications requires to
view this custom attribute definition.
The `Visibility` field controls who can read and write the custom attribute values
and custom attribute definition. | getVisibility(): ?string | setVisibility(?string visibility): void | -| `definition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getDefinition(): ?CustomAttributeDefinition | setDefinition(?CustomAttributeDefinition definition): void | -| `updatedAt` | `?string` | Optional | The timestamp that indicates when the custom attribute was created or was most recently
updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `createdAt` | `?string` | Optional | The timestamp that indicates when the custom attribute was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "key": "key0", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 20, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } -} -``` - diff --git a/doc/models/custom-field.md b/doc/models/custom-field.md deleted file mode 100644 index e89747d9..00000000 --- a/doc/models/custom-field.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Custom Field - -Describes a custom form field to add to the checkout page to collect more information from buyers during checkout. -For more information, -see [Specify checkout options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1). - -## Structure - -`CustomField` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title of the custom field.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getTitle(): string | setTitle(string title): void | - -## Example (as JSON) - -```json -{ - "title": "title4" -} -``` - diff --git a/doc/models/customer-address-filter.md b/doc/models/customer-address-filter.md deleted file mode 100644 index 36979e12..00000000 --- a/doc/models/customer-address-filter.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Customer Address Filter - -The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](../../doc/models/customer-custom-attribute-filter-value.md) filter when -searching by an `Address`-type custom attribute. - -## Structure - -`CustomerAddressFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `postalCode` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getPostalCode(): ?CustomerTextFilter | setPostalCode(?CustomerTextFilter postalCode): void | -| `country` | [`?string(Country)`](../../doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | getCountry(): ?string | setCountry(?string country): void | - -## Example (as JSON) - -```json -{ - "postal_code": { - "exact": "exact2", - "fuzzy": "fuzzy2" - }, - "country": "ZM" -} -``` - diff --git a/doc/models/customer-creation-source-filter.md b/doc/models/customer-creation-source-filter.md deleted file mode 100644 index 460e1e8a..00000000 --- a/doc/models/customer-creation-source-filter.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Customer Creation Source Filter - -The creation source filter. - -If one or more creation sources are set, customer profiles are included in, -or excluded from, the result if they match at least one of the filter criteria. - -## Structure - -`CustomerCreationSourceFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `values` | [`?(string(CustomerCreationSource)[])`](../../doc/models/customer-creation-source.md) | Optional | The list of creation sources used as filtering criteria.
See [CustomerCreationSource](#type-customercreationsource) for possible values | getValues(): ?array | setValues(?array values): void | -| `rule` | [`?string(CustomerInclusionExclusion)`](../../doc/models/customer-inclusion-exclusion.md) | Optional | Indicates whether customers should be included in, or excluded from,
the result set when they match the filtering criteria. | getRule(): ?string | setRule(?string rule): void | - -## Example (as JSON) - -```json -{ - "values": [ - "EGIFTING", - "EMAIL_COLLECTION", - "FEEDBACK" - ], - "rule": "INCLUDE" -} -``` - diff --git a/doc/models/customer-creation-source.md b/doc/models/customer-creation-source.md deleted file mode 100644 index 8a4997f5..00000000 --- a/doc/models/customer-creation-source.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Customer Creation Source - -Indicates the method used to create the customer profile. - -## Enumeration - -`CustomerCreationSource` - -## Fields - -| Name | Description | -| --- | --- | -| `OTHER` | The default creation source. This source is typically used for backward/future
compatibility when the original source of a customer profile is
unrecognized. For example, when older clients do not support newer
source types. | -| `APPOINTMENTS` | The customer profile was created automatically when an appointment
was scheduled. | -| `COUPON` | The customer profile was created automatically when a coupon was issued
using Square Point of Sale. | -| `DELETION_RECOVERY` | The customer profile was restored through Square's deletion recovery
process. | -| `DIRECTORY` | The customer profile was created manually through Square Seller Dashboard or the
Point of Sale application. | -| `EGIFTING` | The customer profile was created automatically when a gift card was
issued using Square Point of Sale. Customer profiles are created for
both the buyer and the recipient of the gift card. | -| `EMAIL_COLLECTION` | The customer profile was created through Square Point of Sale when
signing up for marketing emails during checkout. | -| `FEEDBACK` | The customer profile was created automatically when providing feedback
through a digital receipt. | -| `IMPORT` | The customer profile was created automatically when importing customer
data through Square Seller Dashboard. | -| `INVOICES` | The customer profile was created automatically during an invoice payment. | -| `LOYALTY` | The customer profile was created automatically when customers provide a
phone number for loyalty reward programs during checkout. | -| `MARKETING` | The customer profile was created as the result of a campaign managed
through Square’s Facebook integration. | -| `MERGE` | The customer profile was created as the result of explicitly merging
multiple customer profiles through the Square Seller Dashboard or the Point of
Sale application. | -| `ONLINE_STORE` | The customer profile was created through Square's Online Store solution
(legacy service). | -| `INSTANT_PROFILE` | The customer profile was created automatically as the result of a successful
transaction that did not explicitly link to an existing customer profile. | -| `TERMINAL` | The customer profile was created through Square's Virtual Terminal. | -| `THIRD_PARTY` | The customer profile was created through a Square API call. | -| `THIRD_PARTY_IMPORT` | The customer profile was created by a third-party product and imported
through an official integration. | -| `UNMERGE_RECOVERY` | The customer profile was restored through Square's unmerge recovery
process. | - diff --git a/doc/models/customer-custom-attribute-filter-value.md b/doc/models/customer-custom-attribute-filter-value.md deleted file mode 100644 index 164821d8..00000000 --- a/doc/models/customer-custom-attribute-filter-value.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Customer Custom Attribute Filter Value - -A type-specific filter used in a [custom attribute filter](../../doc/models/customer-custom-attribute-filter.md) to search based on the value -of a customer-related [custom attribute](../../doc/models/custom-attribute.md). - -## Structure - -`CustomerCustomAttributeFilterValue` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `email` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getEmail(): ?CustomerTextFilter | setEmail(?CustomerTextFilter email): void | -| `phone` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getPhone(): ?CustomerTextFilter | setPhone(?CustomerTextFilter phone): void | -| `text` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getText(): ?CustomerTextFilter | setText(?CustomerTextFilter text): void | -| `selection` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getSelection(): ?FilterValue | setSelection(?FilterValue selection): void | -| `date` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getDate(): ?TimeRange | setDate(?TimeRange date): void | -| `number` | [`?FloatNumberRange`](../../doc/models/float-number-range.md) | Optional | Specifies a decimal number range. | getNumber(): ?FloatNumberRange | setNumber(?FloatNumberRange number): void | -| `boolean` | `?bool` | Optional | A filter for a query based on the value of a `Boolean`-type custom attribute. | getBoolean(): ?bool | setBoolean(?bool boolean): void | -| `address` | [`?CustomerAddressFilter`](../../doc/models/customer-address-filter.md) | Optional | The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](../../doc/models/customer-custom-attribute-filter-value.md) filter when
searching by an `Address`-type custom attribute. | getAddress(): ?CustomerAddressFilter | setAddress(?CustomerAddressFilter address): void | - -## Example (as JSON) - -```json -{ - "email": { - "exact": "exact6", - "fuzzy": "fuzzy2" - }, - "phone": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "text": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "selection": { - "all": [ - "all1" - ], - "any": [ - "any8", - "any9" - ], - "none": [ - "none3" - ] - }, - "date": { - "start_at": "start_at6", - "end_at": "end_at6" - } -} -``` - diff --git a/doc/models/customer-custom-attribute-filter.md b/doc/models/customer-custom-attribute-filter.md deleted file mode 100644 index 653d620e..00000000 --- a/doc/models/customer-custom-attribute-filter.md +++ /dev/null @@ -1,60 +0,0 @@ - -# Customer Custom Attribute Filter - -The custom attribute filter. Use this filter in a set of [custom attribute filters](../../doc/models/customer-custom-attribute-filters.md) to search -based on the value or last updated date of a customer-related [custom attribute](../../doc/models/custom-attribute.md). - -## Structure - -`CustomerCustomAttributeFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `key` | `string` | Required | The `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier of the custom attribute
(and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes). | getKey(): string | setKey(string key): void | -| `filter` | [`?CustomerCustomAttributeFilterValue`](../../doc/models/customer-custom-attribute-filter-value.md) | Optional | A type-specific filter used in a [custom attribute filter](../../doc/models/customer-custom-attribute-filter.md) to search based on the value
of a customer-related [custom attribute](../../doc/models/custom-attribute.md). | getFilter(): ?CustomerCustomAttributeFilterValue | setFilter(?CustomerCustomAttributeFilterValue filter): void | -| `updatedAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getUpdatedAt(): ?TimeRange | setUpdatedAt(?TimeRange updatedAt): void | - -## Example (as JSON) - -```json -{ - "key": "key6", - "filter": { - "email": { - "exact": "exact6", - "fuzzy": "fuzzy2" - }, - "phone": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "text": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "selection": { - "all": [ - "all1" - ], - "any": [ - "any8", - "any9" - ], - "none": [ - "none3" - ] - }, - "date": { - "start_at": "start_at6", - "end_at": "end_at6" - } - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - } -} -``` - diff --git a/doc/models/customer-custom-attribute-filters.md b/doc/models/customer-custom-attribute-filters.md deleted file mode 100644 index 42741957..00000000 --- a/doc/models/customer-custom-attribute-filters.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Customer Custom Attribute Filters - -The custom attribute filters in a set of [customer filters](../../doc/models/customer-filter.md) used in a search query. Use this filter -to search based on [custom attributes](../../doc/models/custom-attribute.md) that are assigned to customer profiles. For more information, see -[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). - -## Structure - -`CustomerCustomAttributeFilters` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filters` | [`?(CustomerCustomAttributeFilter[])`](../../doc/models/customer-custom-attribute-filter.md) | Optional | The custom attribute filters. Each filter must specify `key` and include the `filter` field with a type-specific filter,
the `updated_at` field, or both. The provided keys must be unique within the list of custom attribute filters. | getFilters(): ?array | setFilters(?array filters): void | - -## Example (as JSON) - -```json -{ - "filters": [ - { - "key": "key0", - "filter": { - "email": { - "exact": "exact6", - "fuzzy": "fuzzy2" - }, - "phone": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "text": { - "exact": "exact0", - "fuzzy": "fuzzy6" - }, - "selection": { - "all": [ - "all1" - ], - "any": [ - "any8", - "any9" - ], - "none": [ - "none3" - ] - }, - "date": { - "start_at": "start_at6", - "end_at": "end_at6" - } - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - } - } - ] -} -``` - diff --git a/doc/models/customer-details.md b/doc/models/customer-details.md deleted file mode 100644 index a63cb74a..00000000 --- a/doc/models/customer-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Customer Details - -Details about the customer making the payment. - -## Structure - -`CustomerDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerInitiated` | `?bool` | Optional | Indicates whether the customer initiated the payment. | getCustomerInitiated(): ?bool | setCustomerInitiated(?bool customerInitiated): void | -| `sellerKeyedIn` | `?bool` | Optional | Indicates that the seller keyed in payment details on behalf of the customer.
This is used to flag a payment as Mail Order / Telephone Order (MOTO). | getSellerKeyedIn(): ?bool | setSellerKeyedIn(?bool sellerKeyedIn): void | - -## Example (as JSON) - -```json -{ - "customer_initiated": false, - "seller_keyed_in": false -} -``` - diff --git a/doc/models/customer-filter.md b/doc/models/customer-filter.md deleted file mode 100644 index 487461fa..00000000 --- a/doc/models/customer-filter.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Customer Filter - -Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter -customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. - -## Structure - -`CustomerFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `creationSource` | [`?CustomerCreationSourceFilter`](../../doc/models/customer-creation-source-filter.md) | Optional | The creation source filter.

If one or more creation sources are set, customer profiles are included in,
or excluded from, the result if they match at least one of the filter criteria. | getCreationSource(): ?CustomerCreationSourceFilter | setCreationSource(?CustomerCreationSourceFilter creationSource): void | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | -| `updatedAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getUpdatedAt(): ?TimeRange | setUpdatedAt(?TimeRange updatedAt): void | -| `emailAddress` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getEmailAddress(): ?CustomerTextFilter | setEmailAddress(?CustomerTextFilter emailAddress): void | -| `phoneNumber` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getPhoneNumber(): ?CustomerTextFilter | setPhoneNumber(?CustomerTextFilter phoneNumber): void | -| `referenceId` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getReferenceId(): ?CustomerTextFilter | setReferenceId(?CustomerTextFilter referenceId): void | -| `groupIds` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getGroupIds(): ?FilterValue | setGroupIds(?FilterValue groupIds): void | -| `customAttribute` | [`?CustomerCustomAttributeFilters`](../../doc/models/customer-custom-attribute-filters.md) | Optional | The custom attribute filters in a set of [customer filters](../../doc/models/customer-filter.md) used in a search query. Use this filter
to search based on [custom attributes](../../doc/models/custom-attribute.md) that are assigned to customer profiles. For more information, see
[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). | getCustomAttribute(): ?CustomerCustomAttributeFilters | setCustomAttribute(?CustomerCustomAttributeFilters customAttribute): void | -| `segmentIds` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getSegmentIds(): ?FilterValue | setSegmentIds(?FilterValue segmentIds): void | - -## Example (as JSON) - -```json -{ - "creation_source": { - "values": [ - "THIRD_PARTY_IMPORT", - "THIRD_PARTY", - "TERMINAL" - ], - "rule": "INCLUDE" - }, - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "email_address": { - "exact": "exact2", - "fuzzy": "fuzzy8" - }, - "phone_number": { - "exact": "exact2", - "fuzzy": "fuzzy8" - } -} -``` - diff --git a/doc/models/customer-group.md b/doc/models/customer-group.md deleted file mode 100644 index bc4c2c8a..00000000 --- a/doc/models/customer-group.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Customer Group - -Represents a group of customer profiles. - -Customer groups can be created, be modified, and have their membership defined using -the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - -## Structure - -`CustomerGroup` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-generated ID for the customer group.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `name` | `string` | Required | The name of the customer group. | getName(): string | setName(string name): void | -| `createdAt` | `?string` | Optional | The timestamp when the customer group was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the customer group was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "name": "name0", - "created_at": "created_at8", - "updated_at": "updated_at6" -} -``` - diff --git a/doc/models/customer-inclusion-exclusion.md b/doc/models/customer-inclusion-exclusion.md deleted file mode 100644 index 037c202c..00000000 --- a/doc/models/customer-inclusion-exclusion.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Customer Inclusion Exclusion - -Indicates whether customers should be included in, or excluded from, -the result set when they match the filtering criteria. - -## Enumeration - -`CustomerInclusionExclusion` - -## Fields - -| Name | Description | -| --- | --- | -| `INCLUDE` | Customers should be included in the result set when they match the
filtering criteria. | -| `EXCLUDE` | Customers should be excluded from the result set when they match
the filtering criteria. | - diff --git a/doc/models/customer-preferences.md b/doc/models/customer-preferences.md deleted file mode 100644 index fda0d22c..00000000 --- a/doc/models/customer-preferences.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Customer Preferences - -Represents communication preferences for the customer profile. - -## Structure - -`CustomerPreferences` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `emailUnsubscribed` | `?bool` | Optional | Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API. | getEmailUnsubscribed(): ?bool | setEmailUnsubscribed(?bool emailUnsubscribed): void | - -## Example (as JSON) - -```json -{ - "email_unsubscribed": false -} -``` - diff --git a/doc/models/customer-query.md b/doc/models/customer-query.md deleted file mode 100644 index f3174a70..00000000 --- a/doc/models/customer-query.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Customer Query - -Represents filtering and sorting criteria for a [SearchCustomers](../../doc/apis/customers.md#search-customers) request. - -## Structure - -`CustomerQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?CustomerFilter`](../../doc/models/customer-filter.md) | Optional | Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter
customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. | getFilter(): ?CustomerFilter | setFilter(?CustomerFilter filter): void | -| `sort` | [`?CustomerSort`](../../doc/models/customer-sort.md) | Optional | Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort
customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. | getSort(): ?CustomerSort | setSort(?CustomerSort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "creation_source": { - "values": [ - "THIRD_PARTY_IMPORT", - "THIRD_PARTY", - "TERMINAL" - ], - "rule": "INCLUDE" - }, - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "email_address": { - "exact": "exact2", - "fuzzy": "fuzzy8" - }, - "phone_number": { - "exact": "exact2", - "fuzzy": "fuzzy8" - } - }, - "sort": { - "field": "DEFAULT", - "order": "DESC" - } -} -``` - diff --git a/doc/models/customer-segment.md b/doc/models/customer-segment.md deleted file mode 100644 index 5fdfcc63..00000000 --- a/doc/models/customer-segment.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Customer Segment - -Represents a group of customer profiles that match one or more predefined filter criteria. - -Segments (also known as Smart Groups) are defined and created within the Customer Directory in the -Square Seller Dashboard or Point of Sale. - -## Structure - -`CustomerSegment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-generated ID for the segment.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `name` | `string` | Required | The name of the segment. | getName(): string | setName(string name): void | -| `createdAt` | `?string` | Optional | The timestamp when the segment was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the segment was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "name": "name0", - "created_at": "created_at8", - "updated_at": "updated_at6" -} -``` - diff --git a/doc/models/customer-sort-field.md b/doc/models/customer-sort-field.md deleted file mode 100644 index 7052f404..00000000 --- a/doc/models/customer-sort-field.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Customer Sort Field - -Specifies customer attributes as the sort key to customer profiles returned from a search. - -## Enumeration - -`CustomerSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `DEFAULT` | Use the default sort key. By default, customers are sorted
alphanumerically by concatenating their `given_name` and `family_name`. If
neither name field is set, string comparison is performed using one of the
remaining fields in the following order: `company_name`, `email`,
`phone_number`. | -| `CREATED_AT` | Use the creation date attribute (`created_at`) of customer profiles as the sort key. | - diff --git a/doc/models/customer-sort.md b/doc/models/customer-sort.md deleted file mode 100644 index e93773cb..00000000 --- a/doc/models/customer-sort.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Customer Sort - -Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort -customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. - -## Structure - -`CustomerSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `field` | [`?string(CustomerSortField)`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | getField(): ?string | setField(?string field): void | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | - -## Example (as JSON) - -```json -{ - "field": "DEFAULT", - "order": "DESC" -} -``` - diff --git a/doc/models/customer-tax-ids.md b/doc/models/customer-tax-ids.md deleted file mode 100644 index 495ba40c..00000000 --- a/doc/models/customer-tax-ids.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Customer Tax Ids - -Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. -For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). - -## Structure - -`CustomerTaxIds` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `euVat` | `?string` | Optional | The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.
**Constraints**: *Maximum Length*: `20` | getEuVat(): ?string | setEuVat(?string euVat): void | - -## Example (as JSON) - -```json -{ - "eu_vat": "eu_vat6" -} -``` - diff --git a/doc/models/customer-text-filter.md b/doc/models/customer-text-filter.md deleted file mode 100644 index cbd0a5a0..00000000 --- a/doc/models/customer-text-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Customer Text Filter - -A filter to select customers based on exact or fuzzy matching of -customer attributes against a specified query. Depending on the customer attributes, -the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - -## Structure - -`CustomerTextFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `exact` | `?string` | Optional | Use the exact filter to select customers whose attributes match exactly the specified query. | getExact(): ?string | setExact(?string exact): void | -| `fuzzy` | `?string` | Optional | Use the fuzzy filter to select customers whose attributes match the specified query
in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then
each query token must be matched somewhere in the searched attribute. For single token queries,
this is effectively the same behavior as a partial match operation. | getFuzzy(): ?string | setFuzzy(?string fuzzy): void | - -## Example (as JSON) - -```json -{ - "exact": "exact4", - "fuzzy": "fuzzy0" -} -``` - diff --git a/doc/models/customer.md b/doc/models/customer.md deleted file mode 100644 index 641b4709..00000000 --- a/doc/models/customer.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Customer - -Represents a Square customer profile in the Customer Directory of a Square seller. - -## Structure - -`Customer` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-assigned ID for the customer profile.

If you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](api-endpoint:Customers-SearchCustomers)
or [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint. | getId(): ?string | setId(?string id): void | -| `createdAt` | `?string` | Optional | The timestamp when the customer profile was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the customer profile was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `cards` | [`?(Card[])`](../../doc/models/card.md) | Optional | Payment details of the credit, debit, and gift cards stored on file for the customer profile.

DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file)
or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the `customer_id` query parameter.
For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what-it-does#migrate-customer-cards). | getCards(): ?array | setCards(?array cards): void | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `nickname` | `?string` | Optional | A nickname for the customer profile. | getNickname(): ?string | setNickname(?string nickname): void | -| `companyName` | `?string` | Optional | A business name associated with the customer profile. | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `emailAddress` | `?string` | Optional | The email address associated with the customer profile. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The phone number associated with the customer profile. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09-21`
represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year). | getBirthday(): ?string | setBirthday(?string birthday): void | -| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `preferences` | [`?CustomerPreferences`](../../doc/models/customer-preferences.md) | Optional | Represents communication preferences for the customer profile. | getPreferences(): ?CustomerPreferences | setPreferences(?CustomerPreferences preferences): void | -| `creationSource` | [`?string(CustomerCreationSource)`](../../doc/models/customer-creation-source.md) | Optional | Indicates the method used to create the customer profile. | getCreationSource(): ?string | setCreationSource(?string creationSource): void | -| `groupIds` | `?(string[])` | Optional | The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. | getGroupIds(): ?array | setGroupIds(?array groupIds): void | -| `segmentIds` | `?(string[])` | Optional | The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. | getSegmentIds(): ?array | setSegmentIds(?array segmentIds): void | -| `version` | `?int` | Optional | The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file. | getVersion(): ?int | setVersion(?int version): void | -| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at6", - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ], - "given_name": "given_name0" -} -``` - diff --git a/doc/models/data-collection-options-input-type.md b/doc/models/data-collection-options-input-type.md deleted file mode 100644 index 083724f8..00000000 --- a/doc/models/data-collection-options-input-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Data Collection Options Input Type - -Describes the input type of the data. - -## Enumeration - -`DataCollectionOptionsInputType` - -## Fields - -| Name | Description | -| --- | --- | -| `EMAIL` | This value is used to represent an input text that contains a email validation on the
client. | -| `PHONE_NUMBER` | This value is used to represent an input text that contains a phone number validation on
the client. | - diff --git a/doc/models/data-collection-options.md b/doc/models/data-collection-options.md deleted file mode 100644 index 5d7545a9..00000000 --- a/doc/models/data-collection-options.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Data Collection Options - -## Structure - -`DataCollectionOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title text to display in the data collection flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | -| `body` | `string` | Required | The body text to display under the title in the data collection screen flow on the
Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | -| `inputType` | [`string(DataCollectionOptionsInputType)`](../../doc/models/data-collection-options-input-type.md) | Required | Describes the input type of the data. | getInputType(): string | setInputType(string inputType): void | -| `collectedData` | [`?CollectedData`](../../doc/models/collected-data.md) | Optional | - | getCollectedData(): ?CollectedData | setCollectedData(?CollectedData collectedData): void | - -## Example (as JSON) - -```json -{ - "title": "title4", - "body": "body4", - "input_type": "EMAIL", - "collected_data": { - "input_text": "input_text0" - } -} -``` - diff --git a/doc/models/date-range.md b/doc/models/date-range.md deleted file mode 100644 index 7239b395..00000000 --- a/doc/models/date-range.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Date Range - -A range defined by two dates. Used for filtering a query for Connect v2 -objects that have date properties. - -## Structure - -`DateRange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startDate` | `?string` | Optional | A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601
extended format for calendar dates.
The beginning of a date range (inclusive). | getStartDate(): ?string | setStartDate(?string startDate): void | -| `endDate` | `?string` | Optional | A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601
extended format for calendar dates.
The end of a date range (inclusive). | getEndDate(): ?string | setEndDate(?string endDate): void | - -## Example (as JSON) - -```json -{ - "start_date": "start_date0", - "end_date": "end_date6" -} -``` - diff --git a/doc/models/day-of-week.md b/doc/models/day-of-week.md deleted file mode 100644 index 2ce16311..00000000 --- a/doc/models/day-of-week.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Day of Week - -Indicates the specific day of the week. - -## Enumeration - -`DayOfWeek` - -## Fields - -| Name | Description | -| --- | --- | -| `SUN` | Sunday | -| `MON` | Monday | -| `TUE` | Tuesday | -| `WED` | Wednesday | -| `THU` | Thursday | -| `FRI` | Friday | -| `SAT` | Saturday | - diff --git a/doc/models/delete-booking-custom-attribute-definition-response.md b/doc/models/delete-booking-custom-attribute-definition-response.md deleted file mode 100644 index 8028be5b..00000000 --- a/doc/models/delete-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Delete Booking Custom Attribute Definition Response - -Represents a [DeleteBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#delete-booking-custom-attribute-definition) response -containing error messages when errors occurred during the request. The successful response does not contain any payload. - -## Structure - -`DeleteBookingCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [] -} -``` - diff --git a/doc/models/delete-booking-custom-attribute-response.md b/doc/models/delete-booking-custom-attribute-response.md deleted file mode 100644 index f0507cab..00000000 --- a/doc/models/delete-booking-custom-attribute-response.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Delete Booking Custom Attribute Response - -Represents a [DeleteBookingCustomAttribute](../../doc/apis/booking-custom-attributes.md#delete-booking-custom-attribute) response. -Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. - -## Structure - -`DeleteBookingCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [] -} -``` - diff --git a/doc/models/delete-break-type-response.md b/doc/models/delete-break-type-response.md deleted file mode 100644 index 475610fb..00000000 --- a/doc/models/delete-break-type-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Delete Break Type Response - -The response to a request to delete a `BreakType`. The response might contain a set -of `Error` objects if the request resulted in errors. - -## Structure - -`DeleteBreakTypeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-catalog-object-response.md b/doc/models/delete-catalog-object-response.md deleted file mode 100644 index 003853d9..00000000 --- a/doc/models/delete-catalog-object-response.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Delete Catalog Object Response - -## Structure - -`DeleteCatalogObjectResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `deletedObjectIds` | `?(string[])` | Optional | The IDs of all catalog objects deleted by this request.
Multiple IDs may be returned when associated objects are also deleted, for example
a catalog item variation will be deleted (and its ID included in this field)
when its parent catalog item is deleted. | getDeletedObjectIds(): ?array | setDeletedObjectIds(?array deletedObjectIds): void | -| `deletedAt` | `?string` | Optional | The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. | getDeletedAt(): ?string | setDeletedAt(?string deletedAt): void | - -## Example (as JSON) - -```json -{ - "deleted_at": "2016-11-16T22:25:24.878Z", - "deleted_object_ids": [ - "7SB3ZQYJ5GDMVFL7JK46JCHT", - "KQLFFHA6K6J3YQAQAWDQAL57" - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-customer-card-response.md b/doc/models/delete-customer-card-response.md deleted file mode 100644 index e2b96019..00000000 --- a/doc/models/delete-customer-card-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Delete Customer Card Response - -Defines the fields that are included in the response body of -a request to the `DeleteCustomerCard` endpoint. - -## Structure - -`DeleteCustomerCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-customer-custom-attribute-definition-response.md b/doc/models/delete-customer-custom-attribute-definition-response.md deleted file mode 100644 index 5840837e..00000000 --- a/doc/models/delete-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Customer Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`DeleteCustomerCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-customer-custom-attribute-response.md b/doc/models/delete-customer-custom-attribute-response.md deleted file mode 100644 index 9999692f..00000000 --- a/doc/models/delete-customer-custom-attribute-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Delete Customer Custom Attribute Response - -Represents a [DeleteCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#delete-customer-custom-attribute) response. -Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. - -## Structure - -`DeleteCustomerCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-customer-group-response.md b/doc/models/delete-customer-group-response.md deleted file mode 100644 index ec3f237e..00000000 --- a/doc/models/delete-customer-group-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Delete Customer Group Response - -Defines the fields that are included in the response body of -a request to the [DeleteCustomerGroup](../../doc/apis/customer-groups.md#delete-customer-group) endpoint. - -## Structure - -`DeleteCustomerGroupResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-customer-request.md b/doc/models/delete-customer-request.md deleted file mode 100644 index 8f421988..00000000 --- a/doc/models/delete-customer-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Delete Customer Request - -Defines the fields that are included in a request to the `DeleteCustomer` -endpoint. - -## Structure - -`DeleteCustomerRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The current version of the customer profile.

As a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 222 -} -``` - diff --git a/doc/models/delete-customer-response.md b/doc/models/delete-customer-response.md deleted file mode 100644 index 94922bb1..00000000 --- a/doc/models/delete-customer-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Delete Customer Response - -Defines the fields that are included in the response body of -a request to the `DeleteCustomer` endpoint. - -## Structure - -`DeleteCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-dispute-evidence-response.md b/doc/models/delete-dispute-evidence-response.md deleted file mode 100644 index 716903ed..00000000 --- a/doc/models/delete-dispute-evidence-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Dispute Evidence Response - -Defines the fields in a `DeleteDisputeEvidence` response. - -## Structure - -`DeleteDisputeEvidenceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-invoice-attachment-response.md b/doc/models/delete-invoice-attachment-response.md deleted file mode 100644 index 2a062d42..00000000 --- a/doc/models/delete-invoice-attachment-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Invoice Attachment Response - -Represents a [DeleteInvoiceAttachment](../../doc/apis/invoices.md#delete-invoice-attachment) response. - -## Structure - -`DeleteInvoiceAttachmentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-invoice-request.md b/doc/models/delete-invoice-request.md deleted file mode 100644 index 976b5622..00000000 --- a/doc/models/delete-invoice-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Delete Invoice Request - -Describes a `DeleteInvoice` request. - -## Structure - -`DeleteInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The version of the [invoice](entity:Invoice) to delete.
If you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or
[ListInvoices](api-endpoint:Invoices-ListInvoices). | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 26 -} -``` - diff --git a/doc/models/delete-invoice-response.md b/doc/models/delete-invoice-response.md deleted file mode 100644 index 328d1bfe..00000000 --- a/doc/models/delete-invoice-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Invoice Response - -Describes a `DeleteInvoice` response. - -## Structure - -`DeleteInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-location-custom-attribute-definition-response.md b/doc/models/delete-location-custom-attribute-definition-response.md deleted file mode 100644 index a2fd2d97..00000000 --- a/doc/models/delete-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Location Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`DeleteLocationCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-location-custom-attribute-response.md b/doc/models/delete-location-custom-attribute-response.md deleted file mode 100644 index 1108feb7..00000000 --- a/doc/models/delete-location-custom-attribute-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Delete Location Custom Attribute Response - -Represents a [DeleteLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#delete-location-custom-attribute) response. -Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. - -## Structure - -`DeleteLocationCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-loyalty-reward-response.md b/doc/models/delete-loyalty-reward-response.md deleted file mode 100644 index c8fdb995..00000000 --- a/doc/models/delete-loyalty-reward-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Loyalty Reward Response - -A response returned by the API call. - -## Structure - -`DeleteLoyaltyRewardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-merchant-custom-attribute-definition-response.md b/doc/models/delete-merchant-custom-attribute-definition-response.md deleted file mode 100644 index 5e1e57f3..00000000 --- a/doc/models/delete-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Merchant Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`DeleteMerchantCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-merchant-custom-attribute-response.md b/doc/models/delete-merchant-custom-attribute-response.md deleted file mode 100644 index fc1f28ff..00000000 --- a/doc/models/delete-merchant-custom-attribute-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Delete Merchant Custom Attribute Response - -Represents a [DeleteMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#delete-merchant-custom-attribute) response. -Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. - -## Structure - -`DeleteMerchantCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-order-custom-attribute-definition-response.md b/doc/models/delete-order-custom-attribute-definition-response.md deleted file mode 100644 index dbf45866..00000000 --- a/doc/models/delete-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Delete Order Custom Attribute Definition Response - -Represents a response from deleting an order custom attribute definition. - -## Structure - -`DeleteOrderCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-order-custom-attribute-response.md b/doc/models/delete-order-custom-attribute-response.md deleted file mode 100644 index 2b2e368a..00000000 --- a/doc/models/delete-order-custom-attribute-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Delete Order Custom Attribute Response - -Represents a response from deleting an order custom attribute. - -## Structure - -`DeleteOrderCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-payment-link-response.md b/doc/models/delete-payment-link-response.md deleted file mode 100644 index 68b8dbd0..00000000 --- a/doc/models/delete-payment-link-response.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Delete Payment Link Response - -## Structure - -`DeletePaymentLinkResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | - | getErrors(): ?array | setErrors(?array errors): void | -| `id` | `?string` | Optional | The ID of the link that is deleted. | getId(): ?string | setId(?string id): void | -| `cancelledOrderId` | `?string` | Optional | The ID of the order that is canceled. When a payment link is deleted, Square updates the
the `state` (of the order that the checkout link created) to CANCELED. | getCancelledOrderId(): ?string | setCancelledOrderId(?string cancelledOrderId): void | - -## Example (as JSON) - -```json -{ - "cancelled_order_id": "asx8LgZ6MRzD0fObfkJ6obBmSh4F", - "id": "MQASNYL6QB6DFCJ3", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-shift-response.md b/doc/models/delete-shift-response.md deleted file mode 100644 index 6de5690a..00000000 --- a/doc/models/delete-shift-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Delete Shift Response - -The response to a request to delete a `Shift`. The response might contain a set of -`Error` objects if the request resulted in errors. - -## Structure - -`DeleteShiftResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-snippet-response.md b/doc/models/delete-snippet-response.md deleted file mode 100644 index 588e6c3d..00000000 --- a/doc/models/delete-snippet-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Snippet Response - -Represents a `DeleteSnippet` response. - -## Structure - -`DeleteSnippetResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-subscription-action-response.md b/doc/models/delete-subscription-action-response.md deleted file mode 100644 index ba2f80c1..00000000 --- a/doc/models/delete-subscription-action-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Delete Subscription Action Response - -Defines output parameters in a response of the [DeleteSubscriptionAction](../../doc/apis/subscriptions.md#delete-subscription-action) -endpoint. - -## Structure - -`DeleteSubscriptionActionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "charged_through_date": "2023-11-20", - "created_at": "2022-07-27T21:53:10Z", - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", - "invoice_ids": [ - "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" - ], - "location_id": "S8GWD5R9QB376", - "paid_until_date": "2024-08-01", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "price_override_money": { - "amount": 25000, - "currency": "USD" - }, - "source": { - "name": "My Application" - }, - "start_date": "2022-07-27", - "status": "ACTIVE", - "timezone": "America/Los_Angeles" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/delete-webhook-subscription-response.md b/doc/models/delete-webhook-subscription-response.md deleted file mode 100644 index ebd14550..00000000 --- a/doc/models/delete-webhook-subscription-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Delete Webhook Subscription Response - -Defines the fields that are included in the response body of -a request to the [DeleteWebhookSubscription](../../doc/apis/webhook-subscriptions.md#delete-webhook-subscription) endpoint. - -## Structure - -`DeleteWebhookSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/deprecated-create-dispute-evidence-file-request.md b/doc/models/deprecated-create-dispute-evidence-file-request.md deleted file mode 100644 index 2bc70a9c..00000000 --- a/doc/models/deprecated-create-dispute-evidence-file-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Deprecated Create Dispute Evidence File Request - -Defines the parameters for a `DeprecatedCreateDisputeEvidenceFile` request. - -## Structure - -`DeprecatedCreateDisputeEvidenceFileRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `evidenceType` | [`?string(DisputeEvidenceType)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | -| `contentType` | `?string` | Optional | The MIME type of the uploaded file.
The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getContentType(): ?string | setContentType(?string contentType): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key4", - "evidence_type": "ONLINE_OR_APP_ACCESS_LOG", - "content_type": "content_type2" -} -``` - diff --git a/doc/models/deprecated-create-dispute-evidence-file-response.md b/doc/models/deprecated-create-dispute-evidence-file-response.md deleted file mode 100644 index ba234d9f..00000000 --- a/doc/models/deprecated-create-dispute-evidence-file-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Deprecated Create Dispute Evidence File Response - -Defines the fields in a `DeprecatedCreateDisputeEvidenceFile` response. - -## Structure - -`DeprecatedCreateDisputeEvidenceFileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `evidence` | [`?DisputeEvidence`](../../doc/models/dispute-evidence.md) | Optional | - | getEvidence(): ?DisputeEvidence | setEvidence(?DisputeEvidence evidence): void | - -## Example (as JSON) - -```json -{ - "evidence": { - "dispute_id": "bVTprrwk0gygTLZ96VX1oB", - "evidence_file": { - "filename": "evidence.tiff", - "filetype": "image/tiff" - }, - "evidence_id": "TOomLInj6iWmP3N8qfCXrB", - "evidence_type": "GENERIC_EVIDENCE", - "uploaded_at": "2018-10-18T16:01:10.000Z", - "id": "id2", - "evidence_text": "evidence_text6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/deprecated-create-dispute-evidence-text-request.md b/doc/models/deprecated-create-dispute-evidence-text-request.md deleted file mode 100644 index 476e4d09..00000000 --- a/doc/models/deprecated-create-dispute-evidence-text-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Deprecated Create Dispute Evidence Text Request - -Defines the parameters for a `DeprecatedCreateDisputeEvidenceText` request. - -## Structure - -`DeprecatedCreateDisputeEvidenceTextRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `evidenceType` | [`?string(DisputeEvidenceType)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | -| `evidenceText` | `string` | Required | The evidence string.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | getEvidenceText(): string | setEvidenceText(string evidenceText): void | - -## Example (as JSON) - -```json -{ - "evidence_text": "1Z8888888888888888", - "evidence_type": "TRACKING_NUMBER", - "idempotency_key": "ed3ee3933d946f1514d505d173c82648" -} -``` - diff --git a/doc/models/deprecated-create-dispute-evidence-text-response.md b/doc/models/deprecated-create-dispute-evidence-text-response.md deleted file mode 100644 index c186c221..00000000 --- a/doc/models/deprecated-create-dispute-evidence-text-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Deprecated Create Dispute Evidence Text Response - -Defines the fields in a `DeprecatedCreateDisputeEvidenceText` response. - -## Structure - -`DeprecatedCreateDisputeEvidenceTextResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `evidence` | [`?DisputeEvidence`](../../doc/models/dispute-evidence.md) | Optional | - | getEvidence(): ?DisputeEvidence | setEvidence(?DisputeEvidence evidence): void | - -## Example (as JSON) - -```json -{ - "evidence": { - "dispute_id": "bVTprrwk0gygTLZ96VX1oB", - "evidence_text": "The customer purchased the item twice, on April 11 and April 28.", - "evidence_type": "REBUTTAL_EXPLANATION", - "id": "TOomLInj6iWmP3N8qfCXrB", - "uploaded_at": "2022-05-18T16:01:10.000Z", - "evidence_id": "evidence_id0", - "evidence_file": { - "filename": "filename8", - "filetype": "filetype8" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/destination-details-card-refund-details.md b/doc/models/destination-details-card-refund-details.md deleted file mode 100644 index d22a6798..00000000 --- a/doc/models/destination-details-card-refund-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Destination Details Card Refund Details - -## Structure - -`DestinationDetailsCardRefundDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | -| `entryMethod` | `?string` | Optional | The method used to enter the card's details for the refund. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | getEntryMethod(): ?string | setEntryMethod(?string entryMethod): void | -| `authResultCode` | `?string` | Optional | The authorization code provided by the issuer when a refund is approved.
**Constraints**: *Maximum Length*: `10` | getAuthResultCode(): ?string | setAuthResultCode(?string authResultCode): void | - -## Example (as JSON) - -```json -{ - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method4", - "auth_result_code": "auth_result_code6" -} -``` - diff --git a/doc/models/destination-details-cash-refund-details.md b/doc/models/destination-details-cash-refund-details.md deleted file mode 100644 index 1364858a..00000000 --- a/doc/models/destination-details-cash-refund-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Destination Details Cash Refund Details - -Stores details about a cash refund. Contains only non-confidential information. - -## Structure - -`DestinationDetailsCashRefundDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sellerSuppliedMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getSellerSuppliedMoney(): Money | setSellerSuppliedMoney(Money sellerSuppliedMoney): void | -| `changeBackMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getChangeBackMoney(): ?Money | setChangeBackMoney(?Money changeBackMoney): void | - -## Example (as JSON) - -```json -{ - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } -} -``` - diff --git a/doc/models/destination-details-external-refund-details.md b/doc/models/destination-details-external-refund-details.md deleted file mode 100644 index 7ad3bfe7..00000000 --- a/doc/models/destination-details-external-refund-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Destination Details External Refund Details - -Stores details about an external refund. Contains only non-confidential information. - -## Structure - -`DestinationDetailsExternalRefundDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `string` | Required | The type of external refund the seller paid to the buyer. It can be one of the
following:

- CHECK - Refunded using a physical check.
- BANK_TRANSFER - Refunded using external bank transfer.
- OTHER\_GIFT\_CARD - Refunded using a non-Square gift card.
- CRYPTO - Refunded using a crypto currency.
- SQUARE_CASH - Refunded using Square Cash App.
- SOCIAL - Refunded using peer-to-peer payment applications.
- EXTERNAL - A third-party application gathered this refund outside of Square.
- EMONEY - Refunded using an E-money provider.
- CARD - A credit or debit card that Square does not support.
- STORED_BALANCE - Use for house accounts, store credit, and so forth.
- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals
- OTHER - A type not listed here.
**Constraints**: *Maximum Length*: `50` | getType(): string | setType(string type): void | -| `source` | `string` | Required | A description of the external refund source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | getSource(): string | setSource(string source): void | -| `sourceId` | `?string` | Optional | An ID to associate the refund to its originating source.
**Constraints**: *Maximum Length*: `255` | getSourceId(): ?string | setSourceId(?string sourceId): void | - -## Example (as JSON) - -```json -{ - "type": "type4", - "source": "source2", - "source_id": "source_id0" -} -``` - diff --git a/doc/models/destination-details.md b/doc/models/destination-details.md deleted file mode 100644 index 58a4cab5..00000000 --- a/doc/models/destination-details.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Destination Details - -Details about a refund's destination. - -## Structure - -`DestinationDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cardDetails` | [`?DestinationDetailsCardRefundDetails`](../../doc/models/destination-details-card-refund-details.md) | Optional | - | getCardDetails(): ?DestinationDetailsCardRefundDetails | setCardDetails(?DestinationDetailsCardRefundDetails cardDetails): void | -| `cashDetails` | [`?DestinationDetailsCashRefundDetails`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | getCashDetails(): ?DestinationDetailsCashRefundDetails | setCashDetails(?DestinationDetailsCashRefundDetails cashDetails): void | -| `externalDetails` | [`?DestinationDetailsExternalRefundDetails`](../../doc/models/destination-details-external-refund-details.md) | Optional | Stores details about an external refund. Contains only non-confidential information. | getExternalDetails(): ?DestinationDetailsExternalRefundDetails | setExternalDetails(?DestinationDetailsExternalRefundDetails externalDetails): void | - -## Example (as JSON) - -```json -{ - "card_details": { - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "auth_result_code": "auth_result_code0" - }, - "cash_details": { - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } - }, - "external_details": { - "type": "type6", - "source": "source0", - "source_id": "source_id8" - } -} -``` - diff --git a/doc/models/destination-type.md b/doc/models/destination-type.md deleted file mode 100644 index f1d7bddd..00000000 --- a/doc/models/destination-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Destination Type - -List of possible destinations against which a payout can be made. - -## Enumeration - -`DestinationType` - -## Fields - -| Name | Description | -| --- | --- | -| `BANK_ACCOUNT` | An external bank account outside of Square. | -| `CARD` | An external card outside of Square used for the transfer. | -| `SQUARE_BALANCE` | | -| `SQUARE_STORED_BALANCE` | Square Checking or Savings account (US), Square Card (CA) | - diff --git a/doc/models/destination.md b/doc/models/destination.md deleted file mode 100644 index 5e0ef8dc..00000000 --- a/doc/models/destination.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Destination - -Information about the destination against which the payout was made. - -## Structure - -`Destination` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`?string(DestinationType)`](../../doc/models/destination-type.md) | Optional | List of possible destinations against which a payout can be made. | getType(): ?string | setType(?string type): void | -| `id` | `?string` | Optional | Square issued unique ID (also known as the instrument ID) associated with this destination. | getId(): ?string | setId(?string id): void | - -## Example (as JSON) - -```json -{ - "type": "SQUARE_BALANCE", - "id": "id6" -} -``` - diff --git a/doc/models/device-attributes-device-type.md b/doc/models/device-attributes-device-type.md deleted file mode 100644 index 19c965a2..00000000 --- a/doc/models/device-attributes-device-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Device Attributes Device Type - -An enum identifier of the device type. - -## Enumeration - -`DeviceAttributesDeviceType` - -## Fields - -| Name | -| --- | -| `TERMINAL` | - diff --git a/doc/models/device-attributes.md b/doc/models/device-attributes.md deleted file mode 100644 index d2c544a3..00000000 --- a/doc/models/device-attributes.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Device Attributes - -## Structure - -`DeviceAttributes` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `string` | Required, Constant | An enum identifier of the device type.
**Default**: `'TERMINAL'` | getType(): string | setType(string type): void | -| `manufacturer` | `string` | Required | The maker of the device. | getManufacturer(): string | setManufacturer(string manufacturer): void | -| `model` | `?string` | Optional | The specific model of the device. | getModel(): ?string | setModel(?string model): void | -| `name` | `?string` | Optional | A seller-specified name for the device. | getName(): ?string | setName(?string name): void | -| `manufacturersId` | `?string` | Optional | The manufacturer-supplied identifier for the device (where available). In many cases,
this identifier will be a serial number. | getManufacturersId(): ?string | setManufacturersId(?string manufacturersId): void | -| `updatedAt` | `?string` | Optional | The RFC 3339-formatted value of the most recent update to the device information.
(Could represent any field update on the device.) | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `version` | `?string` | Optional | The current version of software installed on the device. | getVersion(): ?string | setVersion(?string version): void | -| `merchantToken` | `?string` | Optional | The merchant_token identifying the merchant controlling the device. | getMerchantToken(): ?string | setMerchantToken(?string merchantToken): void | - -## Example (as JSON) - -```json -{ - "type": "TERMINAL", - "manufacturer": "manufacturer0", - "model": "model4", - "name": "name6", - "manufacturers_id": "manufacturers_id2", - "updated_at": "updated_at2", - "version": "version2" -} -``` - diff --git a/doc/models/device-checkout-options.md b/doc/models/device-checkout-options.md deleted file mode 100644 index 38d798f7..00000000 --- a/doc/models/device-checkout-options.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Device Checkout Options - -## Structure - -`DeviceCheckoutOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `deviceId` | `string` | Required | The unique ID of the device intended for this `TerminalCheckout`.
A list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint.
Match a `DeviceCode.device_id` value with `device_id` to get the associated device code. | getDeviceId(): string | setDeviceId(string deviceId): void | -| `skipReceiptScreen` | `?bool` | Optional | Instructs the device to skip the receipt screen. Defaults to false. | getSkipReceiptScreen(): ?bool | setSkipReceiptScreen(?bool skipReceiptScreen): void | -| `collectSignature` | `?bool` | Optional | Indicates that signature collection is desired during checkout. Defaults to false. | getCollectSignature(): ?bool | setCollectSignature(?bool collectSignature): void | -| `tipSettings` | [`?TipSettings`](../../doc/models/tip-settings.md) | Optional | - | getTipSettings(): ?TipSettings | setTipSettings(?TipSettings tipSettings): void | -| `showItemizedCart` | `?bool` | Optional | Show the itemization screen prior to taking a payment. This field is only meaningful when the
checkout includes an order ID. Defaults to true. | getShowItemizedCart(): ?bool | setShowItemizedCart(?bool showItemizedCart): void | - -## Example (as JSON) - -```json -{ - "device_id": "device_id4", - "skip_receipt_screen": false, - "collect_signature": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "show_itemized_cart": false -} -``` - diff --git a/doc/models/device-code-status.md b/doc/models/device-code-status.md deleted file mode 100644 index 84f9da02..00000000 --- a/doc/models/device-code-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Device Code Status - -DeviceCode.Status enum. - -## Enumeration - -`DeviceCodeStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `UNKNOWN` | The status cannot be determined or does not exist. | -| `UNPAIRED` | The device code is just created and unpaired. | -| `PAIRED` | The device code has been signed in and paired to a device. | -| `EXPIRED` | The device code was unpaired and expired before it was paired. | - diff --git a/doc/models/device-code.md b/doc/models/device-code.md deleted file mode 100644 index e0987c9c..00000000 --- a/doc/models/device-code.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Device Code - -## Structure - -`DeviceCode` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The unique id for this device code. | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | An optional user-defined name for the device code.
**Constraints**: *Maximum Length*: `128` | getName(): ?string | setName(?string name): void | -| `code` | `?string` | Optional | The unique code that can be used to login. | getCode(): ?string | setCode(?string code): void | -| `deviceId` | `?string` | Optional | The unique id of the device that used this code. Populated when the device is paired up. | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `productType` | `string` | Required, Constant | **Default**: `'TERMINAL_API'` | getProductType(): string | setProductType(string productType): void | -| `locationId` | `?string` | Optional | The location assigned to this code.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | [`?string(DeviceCodeStatus)`](../../doc/models/device-code-status.md) | Optional | DeviceCode.Status enum. | getStatus(): ?string | setStatus(?string status): void | -| `pairBy` | `?string` | Optional | When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. | getPairBy(): ?string | setPairBy(?string pairBy): void | -| `createdAt` | `?string` | Optional | When this DeviceCode was created. Timestamp in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `statusChangedAt` | `?string` | Optional | When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. | getStatusChangedAt(): ?string | setStatusChangedAt(?string statusChangedAt): void | -| `pairedAt` | `?string` | Optional | When this DeviceCode was paired. Timestamp in RFC 3339 format. | getPairedAt(): ?string | setPairedAt(?string pairedAt): void | - -## Example (as JSON) - -```json -{ - "product_type": "TERMINAL_API", - "id": "id4", - "name": "name4", - "code": "code2", - "device_id": "device_id0", - "location_id": "location_id8" -} -``` - diff --git a/doc/models/device-component-details-application-details.md b/doc/models/device-component-details-application-details.md deleted file mode 100644 index e1a7a2cb..00000000 --- a/doc/models/device-component-details-application-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Device Component Details Application Details - -## Structure - -`DeviceComponentDetailsApplicationDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `applicationType` | [`?string(ApplicationType)`](../../doc/models/application-type.md) | Optional | - | getApplicationType(): ?string | setApplicationType(?string applicationType): void | -| `version` | `?string` | Optional | The version of the application. | getVersion(): ?string | setVersion(?string version): void | -| `sessionLocation` | `?string` | Optional | The location_id of the session for the application. | getSessionLocation(): ?string | setSessionLocation(?string sessionLocation): void | -| `deviceCodeId` | `?string` | Optional | The id of the device code that was used to log in to the device. | getDeviceCodeId(): ?string | setDeviceCodeId(?string deviceCodeId): void | - -## Example (as JSON) - -```json -{ - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" -} -``` - diff --git a/doc/models/device-component-details-battery-details.md b/doc/models/device-component-details-battery-details.md deleted file mode 100644 index 06cdf295..00000000 --- a/doc/models/device-component-details-battery-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Battery Details - -## Structure - -`DeviceComponentDetailsBatteryDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visiblePercent` | `?int` | Optional | The battery charge percentage as displayed on the device. | getVisiblePercent(): ?int | setVisiblePercent(?int visiblePercent): void | -| `externalPower` | [`?string(DeviceComponentDetailsExternalPower)`](../../doc/models/device-component-details-external-power.md) | Optional | An enum for ExternalPower. | getExternalPower(): ?string | setExternalPower(?string externalPower): void | - -## Example (as JSON) - -```json -{ - "visible_percent": 48, - "external_power": "AVAILABLE_CHARGING" -} -``` - diff --git a/doc/models/device-component-details-card-reader-details.md b/doc/models/device-component-details-card-reader-details.md deleted file mode 100644 index 5bd610a7..00000000 --- a/doc/models/device-component-details-card-reader-details.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Component Details Card Reader Details - -## Structure - -`DeviceComponentDetailsCardReaderDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?string` | Optional | The version of the card reader. | getVersion(): ?string | setVersion(?string version): void | - -## Example (as JSON) - -```json -{ - "version": "version8" -} -``` - diff --git a/doc/models/device-component-details-ethernet-details.md b/doc/models/device-component-details-ethernet-details.md deleted file mode 100644 index 2fe4e83f..00000000 --- a/doc/models/device-component-details-ethernet-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Ethernet Details - -## Structure - -`DeviceComponentDetailsEthernetDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `active` | `?bool` | Optional | A boolean to represent whether the Ethernet interface is currently active. | getActive(): ?bool | setActive(?bool active): void | -| `ipAddressV4` | `?string` | Optional | The string representation of the device’s IPv4 address. | getIpAddressV4(): ?string | setIpAddressV4(?string ipAddressV4): void | - -## Example (as JSON) - -```json -{ - "active": false, - "ip_address_v4": "ip_address_v46" -} -``` - diff --git a/doc/models/device-component-details-external-power.md b/doc/models/device-component-details-external-power.md deleted file mode 100644 index 713c92ae..00000000 --- a/doc/models/device-component-details-external-power.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Device Component Details External Power - -An enum for ExternalPower. - -## Enumeration - -`DeviceComponentDetailsExternalPower` - -## Fields - -| Name | Description | -| --- | --- | -| `AVAILABLE_CHARGING` | Plugged in and charging. | -| `AVAILABLE_NOT_IN_USE` | Fully charged. | -| `UNAVAILABLE` | On battery power. | -| `AVAILABLE_INSUFFICIENT` | Not providing enough power for the device. | - diff --git a/doc/models/device-component-details-measurement.md b/doc/models/device-component-details-measurement.md deleted file mode 100644 index b9ce2fa7..00000000 --- a/doc/models/device-component-details-measurement.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Measurement - -A value qualified by unit of measure. - -## Structure - -`DeviceComponentDetailsMeasurement` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `value` | `?int` | Optional | - | getValue(): ?int | setValue(?int value): void | - -## Example (as JSON) - -```json -{ - "value": 132 -} -``` - diff --git a/doc/models/device-component-details-network-interface-details.md b/doc/models/device-component-details-network-interface-details.md deleted file mode 100644 index c37c4260..00000000 --- a/doc/models/device-component-details-network-interface-details.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Component Details Network Interface Details - -## Structure - -`DeviceComponentDetailsNetworkInterfaceDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `ipAddressV4` | `?string` | Optional | The string representation of the device’s IPv4 address. | getIpAddressV4(): ?string | setIpAddressV4(?string ipAddressV4): void | - -## Example (as JSON) - -```json -{ - "ip_address_v4": "ip_address_v46" -} -``` - diff --git a/doc/models/device-component-details-wi-fi-details.md b/doc/models/device-component-details-wi-fi-details.md deleted file mode 100644 index cb37f31f..00000000 --- a/doc/models/device-component-details-wi-fi-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Device Component Details Wi Fi Details - -## Structure - -`DeviceComponentDetailsWiFiDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `active` | `?bool` | Optional | A boolean to represent whether the WiFI interface is currently active. | getActive(): ?bool | setActive(?bool active): void | -| `ssid` | `?string` | Optional | The name of the connected WIFI network. | getSsid(): ?string | setSsid(?string ssid): void | -| `ipAddressV4` | `?string` | Optional | The string representation of the device’s IPv4 address. | getIpAddressV4(): ?string | setIpAddressV4(?string ipAddressV4): void | -| `secureConnection` | `?string` | Optional | The security protocol for a secure connection (e.g. WPA2). None provided if the connection
is unsecured. | getSecureConnection(): ?string | setSecureConnection(?string secureConnection): void | -| `signalStrength` | [`?DeviceComponentDetailsMeasurement`](../../doc/models/device-component-details-measurement.md) | Optional | A value qualified by unit of measure. | getSignalStrength(): ?DeviceComponentDetailsMeasurement | setSignalStrength(?DeviceComponentDetailsMeasurement signalStrength): void | - -## Example (as JSON) - -```json -{ - "active": false, - "ssid": "ssid6", - "ip_address_v4": "ip_address_v40", - "secure_connection": "secure_connection6", - "signal_strength": { - "value": 222 - } -} -``` - diff --git a/doc/models/device-details.md b/doc/models/device-details.md deleted file mode 100644 index d32194af..00000000 --- a/doc/models/device-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Device Details - -Details about the device that took the payment. - -## Structure - -`DeviceDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `deviceId` | `?string` | Optional | The Square-issued ID of the device.
**Constraints**: *Maximum Length*: `255` | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `deviceInstallationId` | `?string` | Optional | The Square-issued installation ID for the device.
**Constraints**: *Maximum Length*: `255` | getDeviceInstallationId(): ?string | setDeviceInstallationId(?string deviceInstallationId): void | -| `deviceName` | `?string` | Optional | The name of the device set by the seller.
**Constraints**: *Maximum Length*: `255` | getDeviceName(): ?string | setDeviceName(?string deviceName): void | - -## Example (as JSON) - -```json -{ - "device_id": "device_id0", - "device_installation_id": "device_installation_id2", - "device_name": "device_name2" -} -``` - diff --git a/doc/models/device-metadata.md b/doc/models/device-metadata.md deleted file mode 100644 index 3aad13a7..00000000 --- a/doc/models/device-metadata.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Device Metadata - -## Structure - -`DeviceMetadata` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `batteryPercentage` | `?string` | Optional | The Terminal’s remaining battery percentage, between 1-100. | getBatteryPercentage(): ?string | setBatteryPercentage(?string batteryPercentage): void | -| `chargingState` | `?string` | Optional | The current charging state of the Terminal.
Options: `CHARGING`, `NOT_CHARGING` | getChargingState(): ?string | setChargingState(?string chargingState): void | -| `locationId` | `?string` | Optional | The ID of the Square seller business location associated with the Terminal. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `merchantId` | `?string` | Optional | The ID of the Square merchant account that is currently signed-in to the Terminal. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `networkConnectionType` | `?string` | Optional | The Terminal’s current network connection type.
Options: `WIFI`, `ETHERNET` | getNetworkConnectionType(): ?string | setNetworkConnectionType(?string networkConnectionType): void | -| `paymentRegion` | `?string` | Optional | The country in which the Terminal is authorized to take payments. | getPaymentRegion(): ?string | setPaymentRegion(?string paymentRegion): void | -| `serialNumber` | `?string` | Optional | The unique identifier assigned to the Terminal, which can be found on the lower back
of the device. | getSerialNumber(): ?string | setSerialNumber(?string serialNumber): void | -| `osVersion` | `?string` | Optional | The current version of the Terminal’s operating system. | getOsVersion(): ?string | setOsVersion(?string osVersion): void | -| `appVersion` | `?string` | Optional | The current version of the application running on the Terminal. | getAppVersion(): ?string | setAppVersion(?string appVersion): void | -| `wifiNetworkName` | `?string` | Optional | The name of the Wi-Fi network to which the Terminal is connected. | getWifiNetworkName(): ?string | setWifiNetworkName(?string wifiNetworkName): void | -| `wifiNetworkStrength` | `?string` | Optional | The signal strength of the Wi-FI network connection.
Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` | getWifiNetworkStrength(): ?string | setWifiNetworkStrength(?string wifiNetworkStrength): void | -| `ipAddress` | `?string` | Optional | The IP address of the Terminal. | getIpAddress(): ?string | setIpAddress(?string ipAddress): void | - -## Example (as JSON) - -```json -{ - "battery_percentage": "battery_percentage4", - "charging_state": "charging_state6", - "location_id": "location_id2", - "merchant_id": "merchant_id8", - "network_connection_type": "network_connection_type8" -} -``` - diff --git a/doc/models/device-status-category.md b/doc/models/device-status-category.md deleted file mode 100644 index 96ca1c67..00000000 --- a/doc/models/device-status-category.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Device Status Category - -## Enumeration - -`DeviceStatusCategory` - -## Fields - -| Name | -| --- | -| `AVAILABLE` | -| `NEEDS_ATTENTION` | -| `OFFLINE` | - diff --git a/doc/models/device-status.md b/doc/models/device-status.md deleted file mode 100644 index 936a5898..00000000 --- a/doc/models/device-status.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Status - -## Structure - -`DeviceStatus` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `category` | [`?string(DeviceStatusCategory)`](../../doc/models/device-status-category.md) | Optional | - | getCategory(): ?string | setCategory(?string category): void | - -## Example (as JSON) - -```json -{ - "category": "NEEDS_ATTENTION" -} -``` - diff --git a/doc/models/device.md b/doc/models/device.md deleted file mode 100644 index b8ecb4a8..00000000 --- a/doc/models/device.md +++ /dev/null @@ -1,125 +0,0 @@ - -# Device - -## Structure - -`Device` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A synthetic identifier for the device. The identifier includes a standardized prefix and
is otherwise an opaque id generated from key device fields. | getId(): ?string | setId(?string id): void | -| `attributes` | [`DeviceAttributes`](../../doc/models/device-attributes.md) | Required | - | getAttributes(): DeviceAttributes | setAttributes(DeviceAttributes attributes): void | -| `components` | [`?(Component[])`](../../doc/models/component.md) | Optional | A list of components applicable to the device. | getComponents(): ?array | setComponents(?array components): void | -| `status` | [`?DeviceStatus`](../../doc/models/device-status.md) | Optional | - | getStatus(): ?DeviceStatus | setStatus(?DeviceStatus status): void | - -## Example (as JSON) - -```json -{ - "attributes": { - "type": "TERMINAL", - "manufacturer": "manufacturer2", - "model": "model2", - "name": "name4", - "manufacturers_id": "manufacturers_id0", - "updated_at": "updated_at0", - "version": "version0" - }, - "id": "id0", - "components": [ - { - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - } - ], - "status": { - "category": "AVAILABLE" - } -} -``` - diff --git a/doc/models/digital-wallet-details.md b/doc/models/digital-wallet-details.md deleted file mode 100644 index 9f60caae..00000000 --- a/doc/models/digital-wallet-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Digital Wallet Details - -Additional details about `WALLET` type payments. Contains only non-confidential information. - -## Structure - -`DigitalWalletDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | `?string` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | -| `brand` | `?string` | Optional | The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`,
`RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getBrand(): ?string | setBrand(?string brand): void | -| `cashAppDetails` | [`?CashAppDetails`](../../doc/models/cash-app-details.md) | Optional | Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. | getCashAppDetails(): ?CashAppDetails | setCashAppDetails(?CashAppDetails cashAppDetails): void | - -## Example (as JSON) - -```json -{ - "status": "status4", - "brand": "brand8", - "cash_app_details": { - "buyer_full_name": "buyer_full_name2", - "buyer_country_code": "buyer_country_code8", - "buyer_cashtag": "buyer_cashtag4" - } -} -``` - diff --git a/doc/models/disable-card-response.md b/doc/models/disable-card-response.md deleted file mode 100644 index bd773347..00000000 --- a/doc/models/disable-card-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Disable Card Response - -Defines the fields that are included in the response body of -a request to the [DisableCard](../../doc/apis/cards.md#disable-card) endpoint. - -Note: if there are errors processing the request, the card field will not be -present. - -## Structure - -`DisableCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | - -## Example (as JSON) - -```json -{ - "card": { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "bin": "411111", - "card_brand": "VISA", - "card_type": "CREDIT", - "cardholder_name": "Amelia Earhart", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", - "enabled": false, - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - "id": "ccof:uIbfJXhXETSP197M3GB", - "last_4": "1111", - "merchant_id": "6SSW7HV8K2ST5", - "prepaid_type": "NOT_PREPAID", - "reference_id": "user-id-1", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/disable-events-response.md b/doc/models/disable-events-response.md deleted file mode 100644 index 5db137a5..00000000 --- a/doc/models/disable-events-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Disable Events Response - -Defines the fields that are included in the response body of -a request to the [DisableEvents](../../doc/apis/events.md#disable-events) endpoint. - -Note: if there are errors processing the request, the events field will not be -present. - -## Structure - -`DisableEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/dismiss-terminal-action-response.md b/doc/models/dismiss-terminal-action-response.md deleted file mode 100644 index 7de9a7a9..00000000 --- a/doc/models/dismiss-terminal-action-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Dismiss Terminal Action Response - -## Structure - -`DismissTerminalActionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void | - -## Example (as JSON) - -```json -{ - "action": { - "app_id": "APP_ID", - "await_next_action": true, - "await_next_action_duration": "PT5M", - "confirmation_options": { - "agree_button_text": "Agree", - "body": "I agree to receive promotional emails about future events and activities.", - "decision": { - "has_agreed": true - }, - "disagree_button_text": "Decline", - "title": "Marketing communications" - }, - "created_at": "2021-07-28T23:22:07.476Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:abcdefg1234567", - "status": "COMPLETED", - "type": "CONFIRMATION", - "updated_at": "2021-07-28T23:22:29.511Z", - "cancel_reason": "TIMED_OUT" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/dismiss-terminal-checkout-response.md b/doc/models/dismiss-terminal-checkout-response.md deleted file mode 100644 index 260302a0..00000000 --- a/doc/models/dismiss-terminal-checkout-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Dismiss Terminal Checkout Response - -## Structure - -`DismissTerminalCheckoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `checkout` | [`?TerminalCheckout`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | getCheckout(): ?TerminalCheckout | setCheckout(?TerminalCheckout checkout): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "app_id": "APP_ID", - "created_at": "2023-11-29T14:59:50.682Z", - "deadline_duration": "PT5M", - "device_options": { - "collect_signature": true, - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "loyalty_settings": { - "loyalty_screen_max_display_duration": "PT60S", - "show_card_linked_reward_redemption_screen": false, - "show_loyalty_screen": false, - "show_non_qualifying_loyalty_screen": false - }, - "skip_receipt_screen": false, - "tip_settings": { - "allow_tipping": true, - "custom_tip_field": false, - "separate_tip_screen": true, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "show_itemized_cart": false - }, - "id": "LmZEKbo3SBfqO", - "location_id": "LOCATION_ID", - "payment_ids": [ - "D7vLJqMkvSoAlX4yyFzUitOy4EPZY" - ], - "payment_options": { - "autocomplete": true, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - }, - "payment_type": "CARD_PRESENT", - "status": "COMPLETED", - "updated_at": "2023-11-29T15:00:18.936Z", - "reference_id": "reference_id0", - "note": "note8", - "order_id": "order_id6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/dismiss-terminal-refund-response.md b/doc/models/dismiss-terminal-refund-response.md deleted file mode 100644 index eebe2a54..00000000 --- a/doc/models/dismiss-terminal-refund-response.md +++ /dev/null @@ -1,92 +0,0 @@ - -# Dismiss Terminal Refund Response - -## Structure - -`DismissTerminalRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?TerminalRefund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | getRefund(): ?TerminalRefund | setRefund(?TerminalRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 111, - "currency": "CAD" - }, - "app_id": "APP_ID", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 12, - "exp_year": 2024, - "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp4qQDGIPtxnFvTTWoqdfdP6TV8gLsSxoztXA", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_details": { - "auth_result_code": "RNy6Lf", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 12, - "exp_year": 2024, - "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp3qQDGIPtxnFvTTWoqdfdP6TV9gLsSxoztXA", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2023-11-30T16:15:06.645Z", - "captured_at": "2023-11-30T16:15:13.272Z" - }, - "cvv_status": "CVV_ACCEPTED", - "device_details": { - "device_credential": { - "name": "Terminal API Device created on Nov 2, 2023", - "token": "9BFDXEYKB7H8Y" - }, - "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - "device_installation_id": "0ef67d8e-61a3-4418-a0be-c143bfe6108d" - }, - "entry_method": "SWIPED", - "statement_description": "SQ TREATS", - "status": "CAPTURED" - }, - "created_at": "2023-11-30T16:16:39.299Z", - "deadline_duration": "PT5M", - "device_id": "47776348fd8b32b9", - "id": "vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", - "order_id": "s8OMhQcpEp1b61YywlccSHWqUaQZY", - "payment_id": "xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", - "reason": "Returning item", - "status": "IN_PROGRESS", - "updated_at": "2023-11-30T16:16:57.863Z", - "refund_id": "refund_id2" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/dispute-evidence-file.md b/doc/models/dispute-evidence-file.md deleted file mode 100644 index c055bf74..00000000 --- a/doc/models/dispute-evidence-file.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Dispute Evidence File - -A file to be uploaded as dispute evidence. - -## Structure - -`DisputeEvidenceFile` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filename` | `?string` | Optional | The file name including the file extension. For example: "receipt.tiff".
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getFilename(): ?string | setFilename(?string filename): void | -| `filetype` | `?string` | Optional | Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or image/tiff formats.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getFiletype(): ?string | setFiletype(?string filetype): void | - -## Example (as JSON) - -```json -{ - "filename": "filename0", - "filetype": "filetype0" -} -``` - diff --git a/doc/models/dispute-evidence-type.md b/doc/models/dispute-evidence-type.md deleted file mode 100644 index 9808a2a3..00000000 --- a/doc/models/dispute-evidence-type.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Dispute Evidence Type - -The type of the dispute evidence. - -## Enumeration - -`DisputeEvidenceType` - -## Fields - -| Name | Description | -| --- | --- | -| `GENERIC_EVIDENCE` | Square assumes this evidence type if you do not provide a type when uploading evidence.

Use when uploading evidence as a file or string. | -| `ONLINE_OR_APP_ACCESS_LOG` | Server or activity logs that show proof of the cardholder’s identity and that the
cardholder successfully ordered and received the goods (digitally or otherwise).
Example evidence includes IP addresses, corresponding timestamps/dates, cardholder’s name and email
address linked to a cardholder profile held by the seller, proof the same device and card (used
in dispute) were previously used in prior undisputed transaction, and any related detailed activity.

Use when uploading evidence as a file or string. | -| `AUTHORIZATION_DOCUMENTATION` | Evidence that the cardholder did provide authorization for the charge.
Example evidence includes a signed credit card authorization.

Use when uploading evidence as a file. | -| `CANCELLATION_OR_REFUND_DOCUMENTATION` | Evidence that the cardholder acknowledged your refund or cancellation policy.
Example evidence includes a signature or checkbox showing the cardholder’s acknowledgement of your
refund or cancellation policy.

Use when uploading evidence as a file or string. | -| `CARDHOLDER_COMMUNICATION` | Evidence that shows relevant communication with the cardholder.
Example evidence includes emails or texts that show the cardholder received goods/services or
demonstrate cardholder satisfaction.

Use when uploading evidence as a file. | -| `CARDHOLDER_INFORMATION` | Evidence that validates the customer's identity.
Example evidence includes personally identifiable details such as name, email address, purchaser IP
address, and a copy of the cardholder ID.

Use when uploading evidence as a file or string. | -| `PURCHASE_ACKNOWLEDGEMENT` | Evidence that shows proof of the sale/transaction.
Example evidence includes an invoice, contract, or other item showing the customer’s acknowledgement
of the purchase and your terms.

Use when uploading evidence as a file or string. | -| `DUPLICATE_CHARGE_DOCUMENTATION` | Evidence that shows the charges in question are valid and distinct from one another.
Example evidence includes receipts, shipping labels, and invoices along with their distinct payment IDs.

Use when uploading evidence as a file. | -| `PRODUCT_OR_SERVICE_DESCRIPTION` | A description of the product or service sold.

Use when uploading evidence as a file or string. | -| `RECEIPT` | A receipt or message sent to the cardholder detailing the charge.
Note: You do not need to upload the Square receipt; Square submits the receipt on your behalf.

Use when uploading evidence as a file or string. | -| `SERVICE_RECEIVED_DOCUMENTATION` | Evidence that the service was provided to the cardholder or the expected date that services will be rendered.
Example evidence includes a signed delivery form, work order, expected delivery date, or other written agreements.

Use when uploading evidence as a file or string. | -| `PROOF_OF_DELIVERY_DOCUMENTATION` | Evidence that shows the product was provided to the cardholder or the expected date of delivery.
Example evidence includes a signed delivery form or written agreement acknowledging receipt of the goods or services.

Use when uploading evidence as a file or string. | -| `RELATED_TRANSACTION_DOCUMENTATION` | Evidence that shows the cardholder previously processed transactions on the same card and did not dispute them.
Note: Square automatically provides up to five distinct Square receipts for related transactions, when available.

Use when uploading evidence as a file or string. | -| `REBUTTAL_EXPLANATION` | An explanation of why the cardholder’s claim is invalid.
Example evidence includes an explanation of why each distinct charge is a legitimate purchase, why the cardholder’s claim
for credit owed due to their attempt to cancel, return, or refund is invalid per your stated policy and cardholder
agreement, or an explanation of how the cardholder did not attempt to remedy the issue with you first to receive credit.

Use when uploading evidence as a file or string. | -| `TRACKING_NUMBER` | The tracking number for the order provided by the shipping carrier. If you have multiple numbers, they need to be
submitted individually as separate pieces of evidence.

Use when uploading evidence as a string. | - diff --git a/doc/models/dispute-evidence.md b/doc/models/dispute-evidence.md deleted file mode 100644 index de33783f..00000000 --- a/doc/models/dispute-evidence.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Dispute Evidence - -## Structure - -`DisputeEvidence` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `evidenceId` | `?string` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getEvidenceId(): ?string | setEvidenceId(?string evidenceId): void | -| `id` | `?string` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getId(): ?string | setId(?string id): void | -| `disputeId` | `?string` | Optional | The ID of the dispute the evidence is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getDisputeId(): ?string | setDisputeId(?string disputeId): void | -| `evidenceFile` | [`?DisputeEvidenceFile`](../../doc/models/dispute-evidence-file.md) | Optional | A file to be uploaded as dispute evidence. | getEvidenceFile(): ?DisputeEvidenceFile | setEvidenceFile(?DisputeEvidenceFile evidenceFile): void | -| `evidenceText` | `?string` | Optional | Raw text
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | getEvidenceText(): ?string | setEvidenceText(?string evidenceText): void | -| `uploadedAt` | `?string` | Optional | The time when the evidence was uploaded, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getUploadedAt(): ?string | setUploadedAt(?string uploadedAt): void | -| `evidenceType` | [`?string(DisputeEvidenceType)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | - -## Example (as JSON) - -```json -{ - "evidence_id": "evidence_id0", - "id": "id2", - "dispute_id": "dispute_id4", - "evidence_file": { - "filename": "filename8", - "filetype": "filetype8" - }, - "evidence_text": "evidence_text6" -} -``` - diff --git a/doc/models/dispute-reason.md b/doc/models/dispute-reason.md deleted file mode 100644 index b348da05..00000000 --- a/doc/models/dispute-reason.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Dispute Reason - -The list of possible reasons why a cardholder might initiate a -dispute with their bank. - -## Enumeration - -`DisputeReason` - -## Fields - -| Name | Description | -| --- | --- | -| `AMOUNT_DIFFERS` | The cardholder claims that they were charged the wrong amount for the purchase.
To challenge this dispute, provide specific and concrete evidence that the cardholder agreed
to the amount charged. | -| `CANCELLED` | The cardholder claims that they attempted to return the goods or cancel the service.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder
is not due a refund and that the cardholder acknowledged your cancellation policy. | -| `DUPLICATE` | The cardholder claims that they were charged twice for the same purchase.
To challenge this dispute, provide specific and concrete evidence that shows both charges are
legitimate and independent of one another. | -| `NO_KNOWLEDGE` | The cardholder claims that they did not make this purchase nor authorized the charge.
To challenge this dispute, provide specific and concrete evidence that proves that the cardholder
identity was verified at the time of purchase and that the purchase was authorized. | -| `NOT_AS_DESCRIBED` | The cardholder claims the product or service was provided, but the quality of the deliverable
did not align with the expectations of the cardholder based on the description.
To challenge this dispute, provide specific and concrete evidence that shows the cardholder is in
possession of the product as described or received the service as described and agreed on. | -| `NOT_RECEIVED` | The cardholder claims the product or service was not received by the cardholder within the
stated time frame.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder is
in possession of or received the product or service sold. | -| `PAID_BY_OTHER_MEANS` | The cardholder claims that they previously paid for this purchase.
To challenge this dispute, provide specific and concrete evidence that shows both charges are
legitimate and independent of one another or proof that you already provided a credit for the charge. | -| `CUSTOMER_REQUESTS_CREDIT` | The cardholder claims that the purchase was canceled or returned, but they have not yet received
the credit.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder is not
due a refund and that they acknowledged your cancellation and/or refund policy. | -| `EMV_LIABILITY_SHIFT` | A chip-enabled card was not processed through a compliant chip-card reader (for example, it was swiped
instead of dipped into a chip-card reader).
You cannot challenge this dispute because the payment did not comply with EMV security requirements.
For more information, see [What Is EMV?](https://squareup.com/emv) | - diff --git a/doc/models/dispute-state.md b/doc/models/dispute-state.md deleted file mode 100644 index d629040d..00000000 --- a/doc/models/dispute-state.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Dispute State - -The list of possible dispute states. - -## Enumeration - -`DisputeState` - -## Fields - -| Name | Description | -| --- | --- | -| `INQUIRY_EVIDENCE_REQUIRED` | The initial state of an inquiry with evidence required | -| `INQUIRY_PROCESSING` | Inquiry evidence has been submitted and the bank is processing the inquiry | -| `INQUIRY_CLOSED` | The inquiry is complete | -| `EVIDENCE_REQUIRED` | The initial state of a dispute with evidence required | -| `PROCESSING` | Dispute evidence has been submitted and the bank is processing the dispute | -| `WON` | The bank has completed processing the dispute and the seller has won | -| `LOST` | The bank has completed processing the dispute and the seller has lost | -| `ACCEPTED` | The seller has accepted the dispute | - diff --git a/doc/models/dispute.md b/doc/models/dispute.md deleted file mode 100644 index 8ca6f08a..00000000 --- a/doc/models/dispute.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Dispute - -Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. - -## Structure - -`Dispute` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `disputeId` | `?string` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getDisputeId(): ?string | setDisputeId(?string disputeId): void | -| `id` | `?string` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getId(): ?string | setId(?string id): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `reason` | [`?string(DisputeReason)`](../../doc/models/dispute-reason.md) | Optional | The list of possible reasons why a cardholder might initiate a
dispute with their bank. | getReason(): ?string | setReason(?string reason): void | -| `state` | [`?string(DisputeState)`](../../doc/models/dispute-state.md) | Optional | The list of possible dispute states. | getState(): ?string | setState(?string state): void | -| `dueAt` | `?string` | Optional | The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getDueAt(): ?string | setDueAt(?string dueAt): void | -| `disputedPayment` | [`?DisputedPayment`](../../doc/models/disputed-payment.md) | Optional | The payment the cardholder disputed. | getDisputedPayment(): ?DisputedPayment | setDisputedPayment(?DisputedPayment disputedPayment): void | -| `evidenceIds` | `?(string[])` | Optional | The IDs of the evidence associated with the dispute. | getEvidenceIds(): ?array | setEvidenceIds(?array evidenceIds): void | -| `cardBrand` | [`?string(CardBrand)`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | getCardBrand(): ?string | setCardBrand(?string cardBrand): void | -| `createdAt` | `?string` | Optional | The timestamp when the dispute was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the dispute was last updated, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `brandDisputeId` | `?string` | Optional | The ID of the dispute in the card brand system, generated by the card brand.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getBrandDisputeId(): ?string | setBrandDisputeId(?string brandDisputeId): void | -| `reportedDate` | `?string` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getReportedDate(): ?string | setReportedDate(?string reportedDate): void | -| `reportedAt` | `?string` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getReportedAt(): ?string | setReportedAt(?string reportedAt): void | -| `version` | `?int` | Optional | The current version of the `Dispute`. | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The ID of the location where the dispute originated.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "dispute_id": "dispute_id2", - "id": "id0", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reason": "NOT_AS_DESCRIBED", - "state": "LOST" -} -``` - diff --git a/doc/models/disputed-payment.md b/doc/models/disputed-payment.md deleted file mode 100644 index 976dec66..00000000 --- a/doc/models/disputed-payment.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Disputed Payment - -The payment the cardholder disputed. - -## Structure - -`DisputedPayment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | Square-generated unique ID of the payment being disputed.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/ecom-visibility.md b/doc/models/ecom-visibility.md deleted file mode 100644 index 17f24573..00000000 --- a/doc/models/ecom-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Ecom Visibility - -Determines item visibility in Ecom (Online Store) and Online Checkout. - -## Enumeration - -`EcomVisibility` - -## Fields - -| Name | Description | -| --- | --- | -| `UNINDEXED` | Item is not synced with Ecom (Weebly). This is the default state | -| `UNAVAILABLE` | Item is synced but is unavailable within Ecom (Weebly) and Online Checkout | -| `HIDDEN` | Option for seller to choose manually created Quick Amounts. | -| `VISIBLE` | Item is synced but available within Ecom (Weebly) and Online Checkout but is hidden from Ecom Store. | - diff --git a/doc/models/employee-status.md b/doc/models/employee-status.md deleted file mode 100644 index c56cca14..00000000 --- a/doc/models/employee-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Employee Status - -The status of the Employee being retrieved. - -DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - -## Enumeration - -`EmployeeStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | Specifies that the employee is in the Active state. | -| `INACTIVE` | Specifies that the employee is in the Inactive state. | - diff --git a/doc/models/employee-wage.md b/doc/models/employee-wage.md deleted file mode 100644 index 618db7dd..00000000 --- a/doc/models/employee-wage.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Employee Wage - -The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). - -## Structure - -`EmployeeWage` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object. | getId(): ?string | setId(?string id): void | -| `employeeId` | `?string` | Optional | The `Employee` that this wage is assigned to. | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `title` | `?string` | Optional | The job title that this wage relates to. | getTitle(): ?string | setTitle(?string title): void | -| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "employee_id": "employee_id0", - "title": "title6", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - } -} -``` - diff --git a/doc/models/employee.md b/doc/models/employee.md deleted file mode 100644 index 868a07c3..00000000 --- a/doc/models/employee.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Employee - -An employee object that is used by the external API. - -DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). - -## Structure - -`Employee` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | UUID for this object. | getId(): ?string | setId(?string id): void | -| `firstName` | `?string` | Optional | The employee's first name. | getFirstName(): ?string | setFirstName(?string firstName): void | -| `lastName` | `?string` | Optional | The employee's last name. | getLastName(): ?string | setLastName(?string lastName): void | -| `email` | `?string` | Optional | The employee's email address | getEmail(): ?string | setEmail(?string email): void | -| `phoneNumber` | `?string` | Optional | The employee's phone number in E.164 format, i.e. "+12125554250" | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `locationIds` | `?(string[])` | Optional | A list of location IDs where this employee has access to. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `status` | [`?string(EmployeeStatus)`](../../doc/models/employee-status.md) | Optional | The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). | getStatus(): ?string | setStatus(?string status): void | -| `isOwner` | `?bool` | Optional | Whether this employee is the owner of the merchant. Each merchant
has one owner employee, and that employee has full authority over
the account. | getIsOwner(): ?bool | setIsOwner(?bool isOwner): void | -| `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "first_name": "first_name6", - "last_name": "last_name4", - "email": "email0", - "phone_number": "phone_number6" -} -``` - diff --git a/doc/models/enable-events-response.md b/doc/models/enable-events-response.md deleted file mode 100644 index 0d935dde..00000000 --- a/doc/models/enable-events-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Enable Events Response - -Defines the fields that are included in the response body of -a request to the [EnableEvents](../../doc/apis/events.md#enable-events) endpoint. - -Note: if there are errors processing the request, the events field will not be -present. - -## Structure - -`EnableEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/error-category.md b/doc/models/error-category.md deleted file mode 100644 index 2fb6f113..00000000 --- a/doc/models/error-category.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Error Category - -Indicates which high-level category of error has occurred during a -request to the Connect API. - -## Enumeration - -`ErrorCategory` - -## Fields - -| Name | Description | -| --- | --- | -| `API_ERROR` | An error occurred with the Connect API itself. | -| `AUTHENTICATION_ERROR` | An authentication error occurred. Most commonly, the request had
a missing, malformed, or otherwise invalid `Authorization` header. | -| `INVALID_REQUEST_ERROR` | The request was invalid. Most commonly, a required parameter was
missing, or a provided parameter had an invalid value. | -| `RATE_LIMIT_ERROR` | Your application reached the Square API rate limit. You might receive this error if your application sends a high number of requests
to Square APIs in a short period of time.

Your application should monitor responses for `429 RATE_LIMITED` errors and use a retry mechanism with an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)
schedule to resend the requests at an increasingly slower rate. It is also a good practice to use a randomized delay (jitter) in your retry schedule. | -| `PAYMENT_METHOD_ERROR` | An error occurred while processing a payment method. Most commonly,
the details of the payment method were invalid (such as a card's CVV
or expiration date). | -| `REFUND_ERROR` | An error occurred while attempting to process a refund. | -| `MERCHANT_SUBSCRIPTION_ERROR` | An error occurred when checking a merchant subscription status | -| `EXTERNAL_VENDOR_ERROR` | An error that is returned from an external vendor's API | - diff --git a/doc/models/error-code.md b/doc/models/error-code.md deleted file mode 100644 index 32884931..00000000 --- a/doc/models/error-code.md +++ /dev/null @@ -1,165 +0,0 @@ - -# Error Code - -Indicates the specific error that occurred during a request to a -Square API. - -## Enumeration - -`ErrorCode` - -## Fields - -| Name | Description | -| --- | --- | -| `INTERNAL_SERVER_ERROR` | A general server error occurred. | -| `UNAUTHORIZED` | A general authorization error occurred. | -| `ACCESS_TOKEN_EXPIRED` | The provided access token has expired. | -| `ACCESS_TOKEN_REVOKED` | The provided access token has been revoked. | -| `CLIENT_DISABLED` | The provided client has been disabled. | -| `FORBIDDEN` | A general access error occurred. | -| `INSUFFICIENT_SCOPES` | The provided access token does not have permission
to execute the requested action. | -| `APPLICATION_DISABLED` | The calling application was disabled. | -| `V1_APPLICATION` | The calling application was created prior to
2016-03-30 and is not compatible with v2 Square API calls. | -| `V1_ACCESS_TOKEN` | The calling application is using an access token
created prior to 2016-03-30 and is not compatible with v2 Square API
calls. | -| `CARD_PROCESSING_NOT_ENABLED` | The location provided in the API call is not
enabled for credit card processing. | -| `MERCHANT_SUBSCRIPTION_NOT_FOUND` | A required subscription was not found for the merchant | -| `BAD_REQUEST` | A general error occurred with the request. | -| `MISSING_REQUIRED_PARAMETER` | The request is missing a required path, query, or
body parameter. | -| `INCORRECT_TYPE` | The value provided in the request is the wrong
type. For example, a string instead of an integer. | -| `INVALID_TIME` | Formatting for the provided time value is
incorrect. | -| `INVALID_TIME_RANGE` | The time range provided in the request is invalid.
For example, the end time is before the start time. | -| `INVALID_VALUE` | The provided value is invalid. For example,
including `%` in a phone number. | -| `INVALID_CURSOR` | The pagination cursor included in the request is
invalid. | -| `UNKNOWN_QUERY_PARAMETER` | The query parameters provided is invalid for the
requested endpoint. | -| `CONFLICTING_PARAMETERS` | One or more of the request parameters conflict with
each other. | -| `EXPECTED_JSON_BODY` | The request body is not a JSON object. | -| `INVALID_SORT_ORDER` | The provided sort order is not a valid key.
Currently, sort order must be `ASC` or `DESC`. | -| `VALUE_REGEX_MISMATCH` | The provided value does not match an expected
regular expression. | -| `VALUE_TOO_SHORT` | The provided string value is shorter than the
minimum length allowed. | -| `VALUE_TOO_LONG` | The provided string value is longer than the
maximum length allowed. | -| `VALUE_TOO_LOW` | The provided value is less than the supported
minimum. | -| `VALUE_TOO_HIGH` | The provided value is greater than the supported
maximum. | -| `VALUE_EMPTY` | The provided value has a default (empty) value
such as a blank string. | -| `ARRAY_LENGTH_TOO_LONG` | The provided array has too many elements. | -| `ARRAY_LENGTH_TOO_SHORT` | The provided array has too few elements. | -| `ARRAY_EMPTY` | The provided array is empty. | -| `EXPECTED_BOOLEAN` | The endpoint expected the provided value to be a
boolean. | -| `EXPECTED_INTEGER` | The endpoint expected the provided value to be an
integer. | -| `EXPECTED_FLOAT` | The endpoint expected the provided value to be a
float. | -| `EXPECTED_STRING` | The endpoint expected the provided value to be a
string. | -| `EXPECTED_OBJECT` | The endpoint expected the provided value to be a
JSON object. | -| `EXPECTED_ARRAY` | The endpoint expected the provided value to be an
array or list. | -| `EXPECTED_MAP` | The endpoint expected the provided value to be a
map or associative array. | -| `EXPECTED_BASE64_ENCODED_BYTE_ARRAY` | The endpoint expected the provided value to be an
array encoded in base64. | -| `INVALID_ARRAY_VALUE` | One or more objects in the array does not match the
array type. | -| `INVALID_ENUM_VALUE` | The provided static string is not valid for the
field. | -| `INVALID_CONTENT_TYPE` | Invalid content type header. | -| `INVALID_FORM_VALUE` | Only relevant for applications created prior to
2016-03-30. Indicates there was an error while parsing form values. | -| `CUSTOMER_NOT_FOUND` | The provided customer id can't be found in the merchant's customers list. | -| `ONE_INSTRUMENT_EXPECTED` | A general error occurred. | -| `NO_FIELDS_SET` | A general error occurred. | -| `TOO_MANY_MAP_ENTRIES` | Too many entries in the map field. | -| `MAP_KEY_LENGTH_TOO_SHORT` | The length of one of the provided keys in the map is too short. | -| `MAP_KEY_LENGTH_TOO_LONG` | The length of one of the provided keys in the map is too long. | -| `CUSTOMER_MISSING_NAME` | The provided customer does not have a recorded name. | -| `CUSTOMER_MISSING_EMAIL` | The provided customer does not have a recorded email. | -| `INVALID_PAUSE_LENGTH` | The subscription cannot be paused longer than the duration of the current phase. | -| `INVALID_DATE` | The subscription cannot be paused/resumed on the given date. | -| `UNSUPPORTED_COUNTRY` | The API request references an unsupported country. | -| `UNSUPPORTED_CURRENCY` | The API request references an unsupported currency. | -| `APPLE_TTP_PIN_TOKEN` | The payment was declined by the card issuer during an Apple Tap to Pay (TTP)
transaction with a request for the card's PIN. This code will be returned alongside
`CARD_DECLINED_VERIFICATION_REQUIRED` as a supplemental error, and will include an
issuer-provided token in the `details` field that is needed to initiate the PIN
collection flow on the iOS device. | -| `CARD_EXPIRED` | The card issuer declined the request because the card is expired. | -| `INVALID_EXPIRATION` | The expiration date for the payment card is invalid. For example,
it indicates a date in the past. | -| `INVALID_EXPIRATION_YEAR` | The expiration year for the payment card is invalid. For example,
it indicates a year in the past or contains invalid characters. | -| `INVALID_EXPIRATION_DATE` | The expiration date for the payment card is invalid. For example,
it contains invalid characters. | -| `UNSUPPORTED_CARD_BRAND` | The credit card provided is not from a supported issuer. | -| `UNSUPPORTED_ENTRY_METHOD` | The entry method for the credit card (swipe, dip, tap) is not supported. | -| `INVALID_ENCRYPTED_CARD` | The encrypted card information is invalid. | -| `INVALID_CARD` | The credit card cannot be validated based on the provided details. | -| `PAYMENT_AMOUNT_MISMATCH` | The payment was declined because there was a payment amount mismatch.
The money amount Square was expecting does not match the amount provided. | -| `GENERIC_DECLINE` | Square received a decline without any additional information.
If the payment information seems correct, the buyer can contact their
issuer to ask for more information. | -| `CVV_FAILURE` | The card issuer declined the request because the CVV value is invalid. | -| `ADDRESS_VERIFICATION_FAILURE` | The card issuer declined the request because the postal code is invalid. | -| `INVALID_ACCOUNT` | The issuer was not able to locate the account on record. | -| `CURRENCY_MISMATCH` | The currency associated with the payment is not valid for the provided
funding source. For example, a gift card funded in USD cannot be used to process
payments in GBP. | -| `INSUFFICIENT_FUNDS` | The funding source has insufficient funds to cover the payment. | -| `INSUFFICIENT_PERMISSIONS` | The Square account does not have the permissions to accept
this payment. For example, Square may limit which merchants are
allowed to receive gift card payments. | -| `CARDHOLDER_INSUFFICIENT_PERMISSIONS` | The card issuer has declined the transaction due to restrictions on where the card can be used.
For example, a gift card is limited to a single merchant. | -| `INVALID_LOCATION` | The Square account cannot take payments in the specified region.
A Square account can take payments only from the region where the account was created. | -| `TRANSACTION_LIMIT` | The card issuer has determined the payment amount is either too high or too low.
The API returns the error code mostly for credit cards (for example, the card reached
the credit limit). However, sometimes the issuer bank can indicate the error for debit
or prepaid cards (for example, card has insufficient funds). | -| `VOICE_FAILURE` | The card issuer declined the request because the issuer requires voice authorization from the cardholder. The seller should ask the customer to contact the card issuing bank to authorize the payment. | -| `PAN_FAILURE` | The specified card number is invalid. For example, it is of
incorrect length or is incorrectly formatted. | -| `EXPIRATION_FAILURE` | The card expiration date is either invalid or indicates that the
card is expired. | -| `CARD_NOT_SUPPORTED` | The card is not supported either in the geographic region or by
the [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) (MCC). | -| `INVALID_PIN` | The card issuer declined the request because the PIN is invalid. | -| `MISSING_PIN` | The payment is missing a required PIN. | -| `MISSING_ACCOUNT_TYPE` | The payment is missing a required ACCOUNT_TYPE parameter. | -| `INVALID_POSTAL_CODE` | The postal code is incorrectly formatted. | -| `INVALID_FEES` | The app_fee_money on a payment is too high. | -| `MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED` | The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined. | -| `PAYMENT_LIMIT_EXCEEDED` | Square declined the request because the payment amount exceeded the processing limit for this merchant. | -| `GIFT_CARD_AVAILABLE_AMOUNT` | When a Gift Card is a payment source, you can allow taking a partial payment
by adding the `accept_partial_authorization` parameter in the request.
However, taking such a partial payment does not work if your request also includes
`tip_money`, `app_fee_money`, or both. Square declines such payments and returns
the `GIFT_CARD_AVAILABLE_AMOUNT` error.
For more information, see
[CreatePayment errors (additional information)](https://developer.squareup.com/docs/payments-api/error-codes#createpayment-errors-additional-information). | -| `ACCOUNT_UNUSABLE` | The account provided cannot carry out transactions. | -| `BUYER_REFUSED_PAYMENT` | Bank account rejected or was not authorized for the payment. | -| `DELAYED_TRANSACTION_EXPIRED` | The application tried to update a delayed-capture payment that has expired. | -| `DELAYED_TRANSACTION_CANCELED` | The application tried to cancel a delayed-capture payment that was already cancelled. | -| `DELAYED_TRANSACTION_CAPTURED` | The application tried to capture a delayed-capture payment that was already captured. | -| `DELAYED_TRANSACTION_FAILED` | The application tried to update a delayed-capture payment that failed. | -| `CARD_TOKEN_EXPIRED` | The provided card token (nonce) has expired. | -| `CARD_TOKEN_USED` | The provided card token (nonce) was already used to process the payment or refund. | -| `AMOUNT_TOO_HIGH` | The requested payment amount is too high for the provided payment source. | -| `UNSUPPORTED_INSTRUMENT_TYPE` | The API request references an unsupported instrument type. | -| `REFUND_AMOUNT_INVALID` | The requested refund amount exceeds the amount available to refund. | -| `REFUND_ALREADY_PENDING` | The payment already has a pending refund. | -| `PAYMENT_NOT_REFUNDABLE` | The payment is not refundable. For example, the payment is too old to be refunded. | -| `PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE` | The payment is not refundable because it has been disputed. | -| `REFUND_DECLINED` | Request failed - The card issuer declined the refund. | -| `INSUFFICIENT_PERMISSIONS_FOR_REFUND` | The Square account does not have the permissions to process this refund. | -| `INVALID_CARD_DATA` | Generic error - the provided card data is invalid. | -| `SOURCE_USED` | The provided source id was already used to create a card. | -| `SOURCE_EXPIRED` | The provided source id has expired. | -| `UNSUPPORTED_LOYALTY_REWARD_TIER` | The referenced loyalty program reward tier is not supported.
This could happen if the reward tier created in a first party
application is incompatible with the Loyalty API. | -| `LOCATION_MISMATCH` | Generic error - the given location does not matching what is expected. | -| `IDEMPOTENCY_KEY_REUSED` | The provided idempotency key has already been used. | -| `UNEXPECTED_VALUE` | General error - the value provided was unexpected. | -| `SANDBOX_NOT_SUPPORTED` | The API request is not supported in sandbox. | -| `INVALID_EMAIL_ADDRESS` | The provided email address is invalid. | -| `INVALID_PHONE_NUMBER` | The provided phone number is invalid. | -| `CHECKOUT_EXPIRED` | The provided checkout URL has expired. | -| `BAD_CERTIFICATE` | Bad certificate. | -| `INVALID_SQUARE_VERSION_FORMAT` | The provided Square-Version is incorrectly formatted. | -| `API_VERSION_INCOMPATIBLE` | The provided Square-Version is incompatible with the requested action. | -| `CARD_PRESENCE_REQUIRED` | The transaction requires that a card be present. | -| `UNSUPPORTED_SOURCE_TYPE` | The API request references an unsupported source type. | -| `CARD_MISMATCH` | The provided card does not match what is expected. | -| `PLAID_ERROR` | Generic plaid error | -| `PLAID_ERROR_ITEM_LOGIN_REQUIRED` | Plaid error - ITEM_LOGIN_REQUIRED | -| `PLAID_ERROR_RATE_LIMIT` | Plaid error - RATE_LIMIT | -| `CARD_DECLINED` | The card was declined. | -| `VERIFY_CVV_FAILURE` | The CVV could not be verified. | -| `VERIFY_AVS_FAILURE` | The AVS could not be verified. | -| `CARD_DECLINED_CALL_ISSUER` | The payment card was declined with a request
for the card holder to call the issuer. | -| `CARD_DECLINED_VERIFICATION_REQUIRED` | The payment card was declined with a request
for additional verification. | -| `BAD_EXPIRATION` | The card expiration date is either missing or
incorrectly formatted. | -| `CHIP_INSERTION_REQUIRED` | The card issuer requires that the card be read
using a chip reader. | -| `ALLOWABLE_PIN_TRIES_EXCEEDED` | The card has exhausted its available pin entry
retries set by the card issuer. Resolving the error typically requires the
card holder to contact the card issuer. | -| `RESERVATION_DECLINED` | The card issuer declined the refund. | -| `UNKNOWN_BODY_PARAMETER` | The body parameter is not recognized by the requested endpoint. | -| `NOT_FOUND` | Not Found - a general error occurred. | -| `APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND` | Square could not find the associated Apple Pay certificate. | -| `METHOD_NOT_ALLOWED` | Method Not Allowed - a general error occurred. | -| `NOT_ACCEPTABLE` | Not Acceptable - a general error occurred. | -| `REQUEST_TIMEOUT` | Request Timeout - a general error occurred. | -| `CONFLICT` | Conflict - a general error occurred. | -| `GONE` | The target resource is no longer available and this
condition is likely to be permanent. | -| `REQUEST_ENTITY_TOO_LARGE` | Request Entity Too Large - a general error occurred. | -| `UNSUPPORTED_MEDIA_TYPE` | Unsupported Media Type - a general error occurred. | -| `UNPROCESSABLE_ENTITY` | Unprocessable Entity - a general error occurred. | -| `RATE_LIMITED` | Rate Limited - a general error occurred. | -| `NOT_IMPLEMENTED` | Not Implemented - a general error occurred. | -| `BAD_GATEWAY` | Bad Gateway - a general error occurred. | -| `SERVICE_UNAVAILABLE` | Service Unavailable - a general error occurred. | -| `TEMPORARY_ERROR` | A temporary internal error occurred. You can safely retry your call
using the same idempotency key. | -| `GATEWAY_TIMEOUT` | Gateway Timeout - a general error occurred. | - diff --git a/doc/models/error.md b/doc/models/error.md deleted file mode 100644 index 44f66e5a..00000000 --- a/doc/models/error.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Error - -Represents an error encountered during a request to the Connect API. - -See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. - -## Structure - -`Error` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `category` | [`string(ErrorCategory)`](../../doc/models/error-category.md) | Required | Indicates which high-level category of error has occurred during a
request to the Connect API. | getCategory(): string | setCategory(string category): void | -| `code` | [`string(ErrorCode)`](../../doc/models/error-code.md) | Required | Indicates the specific error that occurred during a request to a
Square API. | getCode(): string | setCode(string code): void | -| `detail` | `?string` | Optional | A human-readable description of the error for debugging purposes. | getDetail(): ?string | setDetail(?string detail): void | -| `field` | `?string` | Optional | The name of the field provided in the original request (if any) that
the error pertains to. | getField(): ?string | setField(?string field): void | - -## Example (as JSON) - -```json -{ - "category": "API_ERROR", - "code": "INVALID_PAUSE_LENGTH", - "detail": "detail0", - "field": "field8" -} -``` - diff --git a/doc/models/event-data.md b/doc/models/event-data.md deleted file mode 100644 index 545af008..00000000 --- a/doc/models/event-data.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Event Data - -## Structure - -`EventData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `?string` | Optional | The name of the affected object’s type. | getType(): ?string | setType(?string type): void | -| `id` | `?string` | Optional | The ID of the affected object. | getId(): ?string | setId(?string id): void | -| `deleted` | `?bool` | Optional | This is true if the affected object has been deleted; otherwise, it's absent. | getDeleted(): ?bool | setDeleted(?bool deleted): void | -| `object` | `mixed` | Optional | An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. | getObject(): | setObject( object): void | - -## Example (as JSON) - -```json -{ - "type": "type2", - "id": "id8", - "deleted": false, - "object": { - "key1": "val1", - "key2": "val2" - } -} -``` - diff --git a/doc/models/event-metadata.md b/doc/models/event-metadata.md deleted file mode 100644 index bf9b88cc..00000000 --- a/doc/models/event-metadata.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Event Metadata - -Contains metadata about a particular [Event](../../doc/models/event.md). - -## Structure - -`EventMetadata` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `eventId` | `?string` | Optional | A unique ID for the event. | getEventId(): ?string | setEventId(?string eventId): void | -| `apiVersion` | `?string` | Optional | The API version of the event. This corresponds to the default API version of the developer application at the time when the event was created. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | - -## Example (as JSON) - -```json -{ - "event_id": "event_id0", - "api_version": "api_version6" -} -``` - diff --git a/doc/models/event-type-metadata.md b/doc/models/event-type-metadata.md deleted file mode 100644 index 3384a281..00000000 --- a/doc/models/event-type-metadata.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Event Type Metadata - -Contains the metadata of a webhook event type. - -## Structure - -`EventTypeMetadata` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `eventType` | `?string` | Optional | The event type. | getEventType(): ?string | setEventType(?string eventType): void | -| `apiVersionIntroduced` | `?string` | Optional | The API version at which the event type was introduced. | getApiVersionIntroduced(): ?string | setApiVersionIntroduced(?string apiVersionIntroduced): void | -| `releaseStatus` | `?string` | Optional | The release status of the event type. | getReleaseStatus(): ?string | setReleaseStatus(?string releaseStatus): void | - -## Example (as JSON) - -```json -{ - "event_type": "event_type0", - "api_version_introduced": "api_version_introduced0", - "release_status": "release_status4" -} -``` - diff --git a/doc/models/event.md b/doc/models/event.md deleted file mode 100644 index eaebb946..00000000 --- a/doc/models/event.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Event - -## Structure - -`Event` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `merchantId` | `?string` | Optional | The ID of the target merchant associated with the event. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `locationId` | `?string` | Optional | The ID of the target location associated with the event. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `type` | `?string` | Optional | The type of event this represents. | getType(): ?string | setType(?string type): void | -| `eventId` | `?string` | Optional | A unique ID for the event. | getEventId(): ?string | setEventId(?string eventId): void | -| `createdAt` | `?string` | Optional | Timestamp of when the event was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `data` | [`?EventData`](../../doc/models/event-data.md) | Optional | - | getData(): ?EventData | setData(?EventData data): void | - -## Example (as JSON) - -```json -{ - "merchant_id": "merchant_id2", - "location_id": "location_id6", - "type": "type8", - "event_id": "event_id8", - "created_at": "created_at0" -} -``` - diff --git a/doc/models/exclude-strategy.md b/doc/models/exclude-strategy.md deleted file mode 100644 index a86dcc1a..00000000 --- a/doc/models/exclude-strategy.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Exclude Strategy - -Indicates which products matched by a CatalogPricingRule -will be excluded if the pricing rule uses an exclude set. - -## Enumeration - -`ExcludeStrategy` - -## Fields - -| Name | Description | -| --- | --- | -| `LEAST_EXPENSIVE` | The least expensive matched products are excluded from the pricing. If
the pricing rule is set to exclude one product and multiple products in the
match set qualify as least expensive, then one will be excluded at random.

Excluding the least expensive product gives the best discount value to the buyer. | -| `MOST_EXPENSIVE` | The most expensive matched product is excluded from the pricing rule.
If multiple products have the same price and all qualify as least expensive,
one will be excluded at random.

This guarantees that the most expensive product is purchased at full price. | - diff --git a/doc/models/external-payment-details.md b/doc/models/external-payment-details.md deleted file mode 100644 index c7d063b2..00000000 --- a/doc/models/external-payment-details.md +++ /dev/null @@ -1,34 +0,0 @@ - -# External Payment Details - -Stores details about an external payment. Contains only non-confidential information. -For more information, see -[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). - -## Structure - -`ExternalPaymentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `string` | Required | The type of external payment the seller received. It can be one of the following:

- CHECK - Paid using a physical check.
- BANK_TRANSFER - Paid using external bank transfer.
- OTHER\_GIFT\_CARD - Paid using a non-Square gift card.
- CRYPTO - Paid using a crypto currency.
- SQUARE_CASH - Paid using Square Cash App.
- SOCIAL - Paid using peer-to-peer payment applications.
- EXTERNAL - A third-party application gathered this payment outside of Square.
- EMONEY - Paid using an E-money provider.
- CARD - A credit or debit card that Square does not support.
- STORED_BALANCE - Use for house accounts, store credit, and so forth.
- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals
- OTHER - A type not listed here.
**Constraints**: *Maximum Length*: `50` | getType(): string | setType(string type): void | -| `source` | `string` | Required | A description of the external payment source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | getSource(): string | setSource(string source): void | -| `sourceId` | `?string` | Optional | An ID to associate the payment to its originating source.
**Constraints**: *Maximum Length*: `255` | getSourceId(): ?string | setSourceId(?string sourceId): void | -| `sourceFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getSourceFeeMoney(): ?Money | setSourceFeeMoney(?Money sourceFeeMoney): void | - -## Example (as JSON) - -```json -{ - "type": "type8", - "source": "source8", - "source_id": "source_id6", - "source_fee_money": { - "amount": 130, - "currency": "NIO" - } -} -``` - diff --git a/doc/models/filter-value.md b/doc/models/filter-value.md deleted file mode 100644 index d2a565f2..00000000 --- a/doc/models/filter-value.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Filter Value - -A filter to select resources based on an exact field value. For any given -value, the value can only be in one property. Depending on the field, either -all properties can be set or only a subset will be available. - -Refer to the documentation of the field. - -## Structure - -`FilterValue` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `all` | `?(string[])` | Optional | A list of terms that must be present on the field of the resource. | getAll(): ?array | setAll(?array all): void | -| `any` | `?(string[])` | Optional | A list of terms where at least one of them must be present on the
field of the resource. | getAny(): ?array | setAny(?array any): void | -| `none` | `?(string[])` | Optional | A list of terms that must not be present on the field the resource | getNone(): ?array | setNone(?array none): void | - -## Example (as JSON) - -```json -{ - "all": [ - "all9", - "all0", - "all1" - ], - "any": [ - "any8", - "any9", - "any0" - ], - "none": [ - "none3", - "none4" - ] -} -``` - diff --git a/doc/models/float-number-range.md b/doc/models/float-number-range.md deleted file mode 100644 index 48aebe4f..00000000 --- a/doc/models/float-number-range.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Float Number Range - -Specifies a decimal number range. - -## Structure - -`FloatNumberRange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startAt` | `?string` | Optional | A decimal value indicating where the range starts. | getStartAt(): ?string | setStartAt(?string startAt): void | -| `endAt` | `?string` | Optional | A decimal value indicating where the range ends. | getEndAt(): ?string | setEndAt(?string endAt): void | - -## Example (as JSON) - -```json -{ - "start_at": "start_at0", - "end_at": "end_at2" -} -``` - diff --git a/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md b/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md deleted file mode 100644 index 0b4d55d6..00000000 --- a/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Fulfillment Delivery Details Order Fulfillment Delivery Details Schedule Type - -The schedule type of the delivery fulfillment. - -## Enumeration - -`FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType` - -## Fields - -| Name | Description | -| --- | --- | -| `SCHEDULED` | Indicates the fulfillment to deliver at a scheduled deliver time. | -| `ASAP` | Indicates that the fulfillment to deliver as soon as possible and should be prepared
immediately. | - diff --git a/doc/models/fulfillment-delivery-details.md b/doc/models/fulfillment-delivery-details.md deleted file mode 100644 index 0edfc240..00000000 --- a/doc/models/fulfillment-delivery-details.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Fulfillment Delivery Details - -Describes delivery details of an order fulfillment. - -## Structure - -`FulfillmentDeliveryDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?FulfillmentRecipient`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?FulfillmentRecipient | setRecipient(?FulfillmentRecipient recipient): void | -| `scheduleType` | [`?string(FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType)`](../../doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | getScheduleType(): ?string | setScheduleType(?string scheduleType): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z").

Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `deliverAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
that represents the start of the delivery period.
When the fulfillment `schedule_type` is `ASAP`, the field is automatically
set to the current time plus the `prep_time_duration`.
Otherwise, the application can set this field while the fulfillment `state` is
`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the
terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).

The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getDeliverAt(): ?string | setDeliverAt(?string deliverAt): void | -| `prepTimeDuration` | `?string` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getPrepTimeDuration(): ?string | setPrepTimeDuration(?string prepTimeDuration): void | -| `deliveryWindowDuration` | `?string` | Optional | The time period after `deliver_at` in which to deliver the order.
Applications can set this field when the fulfillment `state` is
`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state
such as `COMPLETED`, `CANCELED`, and `FAILED`).

The duration must be in RFC 3339 format (for example, "P1W3D"). | getDeliveryWindowDuration(): ?string | setDeliveryWindowDuration(?string deliveryWindowDuration): void | -| `note` | `?string` | Optional | Provides additional instructions about the delivery fulfillment.
It is displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `550` | getNote(): ?string | setNote(?string note): void | -| `completedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicates when the seller completed the fulfillment.
This field is automatically set when fulfillment `state` changes to `COMPLETED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCompletedAt(): ?string | setCompletedAt(?string completedAt): void | -| `inProgressAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicates when the seller started processing the fulfillment.
This field is automatically set when the fulfillment `state` changes to `RESERVED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | -| `rejectedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was rejected. This field is
automatically set when the fulfillment `state` changes to `FAILED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | -| `readyAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the seller marked the fulfillment as ready for
courier pickup. This field is automatically set when the fulfillment `state` changes
to PREPARED.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getReadyAt(): ?string | setReadyAt(?string readyAt): void | -| `deliveredAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was delivered to the recipient.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getDeliveredAt(): ?string | setDeliveredAt(?string deliveredAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was canceled. This field is automatically
set when the fulfillment `state` changes to `CANCELED`.

The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `courierPickupAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when an order can be picked up by the courier for delivery.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCourierPickupAt(): ?string | setCourierPickupAt(?string courierPickupAt): void | -| `courierPickupWindowDuration` | `?string` | Optional | The time period after `courier_pickup_at` in which the courier should pick up the order.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getCourierPickupWindowDuration(): ?string | setCourierPickupWindowDuration(?string courierPickupWindowDuration): void | -| `isNoContactDelivery` | `?bool` | Optional | Whether the delivery is preferred to be no contact. | getIsNoContactDelivery(): ?bool | setIsNoContactDelivery(?bool isNoContactDelivery): void | -| `dropoffNotes` | `?string` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | getDropoffNotes(): ?string | setDropoffNotes(?string dropoffNotes): void | -| `courierProviderName` | `?string` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | getCourierProviderName(): ?string | setCourierProviderName(?string courierProviderName): void | -| `courierSupportPhoneNumber` | `?string` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | getCourierSupportPhoneNumber(): ?string | setCourierSupportPhoneNumber(?string courierSupportPhoneNumber): void | -| `squareDeliveryId` | `?string` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | getSquareDeliveryId(): ?string | setSquareDeliveryId(?string squareDeliveryId): void | -| `externalDeliveryId` | `?string` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | getExternalDeliveryId(): ?string | setExternalDeliveryId(?string externalDeliveryId): void | -| `managedDelivery` | `?bool` | Optional | The flag to indicate the delivery is managed by a third party (ie DoorDash), which means
we may not receive all recipient information for PII purposes. | getManagedDelivery(): ?bool | setManagedDelivery(?bool managedDelivery): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "schedule_type": "SCHEDULED", - "placed_at": "placed_at6", - "deliver_at": "deliver_at2", - "prep_time_duration": "prep_time_duration6" -} -``` - diff --git a/doc/models/fulfillment-fulfillment-entry.md b/doc/models/fulfillment-fulfillment-entry.md deleted file mode 100644 index 06f3a55a..00000000 --- a/doc/models/fulfillment-fulfillment-entry.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Fulfillment Fulfillment Entry - -Links an order line item to a fulfillment. Each entry must reference -a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to -fulfill. - -## Structure - -`FulfillmentFulfillmentEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `lineItemUid` | `string` | Required | The `uid` from the order line item.
**Constraints**: *Minimum Length*: `1` | getLineItemUid(): string | setLineItemUid(string lineItemUid): void | -| `quantity` | `string` | Required | The quantity of the line item being fulfilled, formatted as a decimal number.
For example, `"3"`.

Fulfillments for line items with a `quantity_unit` can have non-integer quantities.
For example, `"1.70000"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this fulfillment entry. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "line_item_uid": "line_item_uid0", - "quantity": "quantity6", - "metadata": { - "key0": "metadata3", - "key1": "metadata4" - } -} -``` - diff --git a/doc/models/fulfillment-fulfillment-line-item-application.md b/doc/models/fulfillment-fulfillment-line-item-application.md deleted file mode 100644 index 1e4dd975..00000000 --- a/doc/models/fulfillment-fulfillment-line-item-application.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Fulfillment Fulfillment Line Item Application - -The `line_item_application` describes what order line items this fulfillment applies -to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - -## Enumeration - -`FulfillmentFulfillmentLineItemApplication` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL` | If `ALL`, `entries` must be unset. | -| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | - diff --git a/doc/models/fulfillment-pickup-details-curbside-pickup-details.md b/doc/models/fulfillment-pickup-details-curbside-pickup-details.md deleted file mode 100644 index e4e5f20e..00000000 --- a/doc/models/fulfillment-pickup-details-curbside-pickup-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Fulfillment Pickup Details Curbside Pickup Details - -Specific details for curbside pickup. - -## Structure - -`FulfillmentPickupDetailsCurbsidePickupDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `curbsideDetails` | `?string` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | getCurbsideDetails(): ?string | setCurbsideDetails(?string curbsideDetails): void | -| `buyerArrivedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getBuyerArrivedAt(): ?string | setBuyerArrivedAt(?string buyerArrivedAt): void | - -## Example (as JSON) - -```json -{ - "curbside_details": "curbside_details0", - "buyer_arrived_at": "buyer_arrived_at6" -} -``` - diff --git a/doc/models/fulfillment-pickup-details-schedule-type.md b/doc/models/fulfillment-pickup-details-schedule-type.md deleted file mode 100644 index 6879ccc4..00000000 --- a/doc/models/fulfillment-pickup-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Fulfillment Pickup Details Schedule Type - -The schedule type of the pickup fulfillment. - -## Enumeration - -`FulfillmentPickupDetailsScheduleType` - -## Fields - -| Name | Description | -| --- | --- | -| `SCHEDULED` | Indicates that the fulfillment will be picked up at a scheduled pickup time. | -| `ASAP` | Indicates that the fulfillment will be picked up as soon as possible and
should be prepared immediately. | - diff --git a/doc/models/fulfillment-pickup-details.md b/doc/models/fulfillment-pickup-details.md deleted file mode 100644 index 350355ea..00000000 --- a/doc/models/fulfillment-pickup-details.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Fulfillment Pickup Details - -Contains details necessary to fulfill a pickup order. - -## Structure - -`FulfillmentPickupDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?FulfillmentRecipient`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?FulfillmentRecipient | setRecipient(?FulfillmentRecipient recipient): void | -| `expiresAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment expires if it is not marked in progress. The timestamp must be
in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set
up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order
are automatically completed. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `autoCompleteDuration` | `?string` | Optional | The duration of time after which an in progress pickup fulfillment is automatically moved
to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D").

If not set, this pickup fulfillment remains in progress until it is canceled or completed. | getAutoCompleteDuration(): ?string | setAutoCompleteDuration(?string autoCompleteDuration): void | -| `scheduleType` | [`?string(FulfillmentPickupDetailsScheduleType)`](../../doc/models/fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | getScheduleType(): ?string | setScheduleType(?string scheduleType): void | -| `pickupAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z".

For fulfillments with the schedule type `ASAP`, this is automatically set
to the current time plus the expected duration to prepare the fulfillment. | getPickupAt(): ?string | setPickupAt(?string pickupAt): void | -| `pickupWindowDuration` | `?string` | Optional | The window of time in which the order should be picked up after the `pickup_at` timestamp.
Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an
informational guideline for merchants. | getPickupWindowDuration(): ?string | setPickupWindowDuration(?string pickupWindowDuration): void | -| `prepTimeDuration` | `?string` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getPrepTimeDuration(): ?string | setPrepTimeDuration(?string prepTimeDuration): void | -| `note` | `?string` | Optional | A note to provide additional instructions about the pickup
fulfillment displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `acceptedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getAcceptedAt(): ?string | setAcceptedAt(?string acceptedAt): void | -| `rejectedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | -| `readyAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getReadyAt(): ?string | setReadyAt(?string readyAt): void | -| `expiredAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment expired. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getExpiredAt(): ?string | setExpiredAt(?string expiredAt): void | -| `pickedUpAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPickedUpAt(): ?string | setPickedUpAt(?string pickedUpAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `isCurbsidePickup` | `?bool` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | getIsCurbsidePickup(): ?bool | setIsCurbsidePickup(?bool isCurbsidePickup): void | -| `curbsidePickupDetails` | [`?FulfillmentPickupDetailsCurbsidePickupDetails`](../../doc/models/fulfillment-pickup-details-curbside-pickup-details.md) | Optional | Specific details for curbside pickup. | getCurbsidePickupDetails(): ?FulfillmentPickupDetailsCurbsidePickupDetails | setCurbsidePickupDetails(?FulfillmentPickupDetailsCurbsidePickupDetails curbsidePickupDetails): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "expires_at": "expires_at0", - "auto_complete_duration": "auto_complete_duration0", - "schedule_type": "SCHEDULED", - "pickup_at": "pickup_at8" -} -``` - diff --git a/doc/models/fulfillment-recipient.md b/doc/models/fulfillment-recipient.md deleted file mode 100644 index 98eb9db0..00000000 --- a/doc/models/fulfillment-recipient.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Fulfillment Recipient - -Information about the fulfillment recipient. - -## Structure - -`FulfillmentRecipient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `?string` | Optional | The ID of the customer associated with the fulfillment.

If `customer_id` is provided, the fulfillment recipient's `display_name`,
`email_address`, and `phone_number` are automatically populated from the
targeted customer profile. If these fields are set in the request, the request
values override the information from the customer profile. If the
targeted customer profile does not contain the necessary information and
these fields are left unset, the request results in an error.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `displayName` | `?string` | Optional | The display name of the fulfillment recipient. This field is required.

If provided, the display name overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getDisplayName(): ?string | setDisplayName(?string displayName): void | -| `emailAddress` | `?string` | Optional | The email address of the fulfillment recipient.

If provided, the email address overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `phoneNumber` | `?string` | Optional | The phone number of the fulfillment recipient. This field is required.

If provided, the phone number overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `17` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id2", - "display_name": "display_name4", - "email_address": "email_address2", - "phone_number": "phone_number2", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } -} -``` - diff --git a/doc/models/fulfillment-shipment-details.md b/doc/models/fulfillment-shipment-details.md deleted file mode 100644 index 5eb0c9d5..00000000 --- a/doc/models/fulfillment-shipment-details.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Fulfillment Shipment Details - -Contains the details necessary to fulfill a shipment order. - -## Structure - -`FulfillmentShipmentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?FulfillmentRecipient`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?FulfillmentRecipient | setRecipient(?FulfillmentRecipient recipient): void | -| `carrier` | `?string` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | getCarrier(): ?string | setCarrier(?string carrier): void | -| `shippingNote` | `?string` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | getShippingNote(): ?string | setShippingNote(?string shippingNote): void | -| `shippingType` | `?string` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | getShippingType(): ?string | setShippingType(?string shippingType): void | -| `trackingNumber` | `?string` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | getTrackingNumber(): ?string | setTrackingNumber(?string trackingNumber): void | -| `trackingUrl` | `?string` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | getTrackingUrl(): ?string | setTrackingUrl(?string trackingUrl): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment was requested. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `inProgressAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `RESERVED` state, which indicates that preparation
of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | -| `packagedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the
fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getPackagedAt(): ?string | setPackagedAt(?string packagedAt): void | -| `expectedShippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment is expected to be delivered to the shipping carrier.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getExpectedShippedAt(): ?string | setExpectedShippedAt(?string expectedShippedAt): void | -| `shippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that
the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getShippedAt(): ?string | setShippedAt(?string shippedAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating the shipment was canceled.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `failedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getFailedAt(): ?string | setFailedAt(?string failedAt): void | -| `failureReason` | `?string` | Optional | A description of why the shipment failed to be completed.
**Constraints**: *Maximum Length*: `100` | getFailureReason(): ?string | setFailureReason(?string failureReason): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "carrier": "carrier6", - "shipping_note": "shipping_note0", - "shipping_type": "shipping_type2", - "tracking_number": "tracking_number2" -} -``` - diff --git a/doc/models/fulfillment-state.md b/doc/models/fulfillment-state.md deleted file mode 100644 index 7d4cc072..00000000 --- a/doc/models/fulfillment-state.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Fulfillment State - -The current state of this fulfillment. - -## Enumeration - -`FulfillmentState` - -## Fields - -| Name | Description | -| --- | --- | -| `PROPOSED` | Indicates that the fulfillment has been proposed. | -| `RESERVED` | Indicates that the fulfillment has been reserved. | -| `PREPARED` | Indicates that the fulfillment has been prepared. | -| `COMPLETED` | Indicates that the fulfillment was successfully completed. | -| `CANCELED` | Indicates that the fulfillment was canceled. | -| `FAILED` | Indicates that the fulfillment failed to be completed, but was not explicitly
canceled. | - diff --git a/doc/models/fulfillment-type.md b/doc/models/fulfillment-type.md deleted file mode 100644 index cada76fd..00000000 --- a/doc/models/fulfillment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Fulfillment Type - -The type of fulfillment. - -## Enumeration - -`FulfillmentType` - -## Fields - -| Name | Description | -| --- | --- | -| `PICKUP` | A recipient to pick up the fulfillment from a physical [location](../../doc/models/location.md). | -| `SHIPMENT` | A shipping carrier to ship the fulfillment. | -| `DELIVERY` | A courier to deliver the fulfillment. | - diff --git a/doc/models/fulfillment.md b/doc/models/fulfillment.md deleted file mode 100644 index fe5f709e..00000000 --- a/doc/models/fulfillment.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Fulfillment - -Contains details about how to fulfill this order. -Orders can only be created with at most one fulfillment using the API. -However, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online. - -## Structure - -`Fulfillment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `type` | [`?string(FulfillmentType)`](../../doc/models/fulfillment-type.md) | Optional | The type of fulfillment. | getType(): ?string | setType(?string type): void | -| `state` | [`?string(FulfillmentState)`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | getState(): ?string | setState(?string state): void | -| `lineItemApplication` | [`?string(FulfillmentFulfillmentLineItemApplication)`](../../doc/models/fulfillment-fulfillment-line-item-application.md) | Optional | The `line_item_application` describes what order line items this fulfillment applies
to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. | getLineItemApplication(): ?string | setLineItemApplication(?string lineItemApplication): void | -| `entries` | [`?(FulfillmentFulfillmentEntry[])`](../../doc/models/fulfillment-fulfillment-entry.md) | Optional | A list of entries pertaining to the fulfillment of an order. Each entry must reference
a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to
fulfill.

Multiple entries can reference the same line item `uid`, as long as the total quantity among
all fulfillment entries referencing a single line item does not exceed the quantity of the
order's line item itself.

An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`,
`CANCELED`, or `FAILED`. Fulfillments can be created and completed independently
before order completion. | getEntries(): ?array | setEntries(?array entries): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this fulfillment. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `pickupDetails` | [`?FulfillmentPickupDetails`](../../doc/models/fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | getPickupDetails(): ?FulfillmentPickupDetails | setPickupDetails(?FulfillmentPickupDetails pickupDetails): void | -| `shipmentDetails` | [`?FulfillmentShipmentDetails`](../../doc/models/fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | getShipmentDetails(): ?FulfillmentShipmentDetails | setShipmentDetails(?FulfillmentShipmentDetails shipmentDetails): void | -| `deliveryDetails` | [`?FulfillmentDeliveryDetails`](../../doc/models/fulfillment-delivery-details.md) | Optional | Describes delivery details of an order fulfillment. | getDeliveryDetails(): ?FulfillmentDeliveryDetails | setDeliveryDetails(?FulfillmentDeliveryDetails deliveryDetails): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "type": "DELIVERY", - "state": "CANCELED", - "line_item_application": "ALL", - "entries": [ - { - "uid": "uid0", - "line_item_uid": "line_item_uid0", - "quantity": "quantity6", - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } - } - ] -} -``` - diff --git a/doc/models/get-bank-account-by-v1-id-response.md b/doc/models/get-bank-account-by-v1-id-response.md deleted file mode 100644 index 095a8e4c..00000000 --- a/doc/models/get-bank-account-by-v1-id-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Get Bank Account by V1 Id Response - -Response object returned by GetBankAccountByV1Id. - -## Structure - -`GetBankAccountByV1IdResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `bankAccount` | [`?BankAccount`](../../doc/models/bank-account.md) | Optional | Represents a bank account. For more information about
linking a bank account to a Square account, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). | getBankAccount(): ?BankAccount | setBankAccount(?BankAccount bankAccount): void | - -## Example (as JSON) - -```json -{ - "bank_account": { - "account_number_suffix": "971", - "account_type": "CHECKING", - "bank_name": "Bank Name", - "country": "US", - "creditable": false, - "currency": "USD", - "debitable": false, - "holder_name": "Jane Doe", - "id": "w3yRgCGYQnwmdl0R3GB", - "location_id": "S8GWD5example", - "primary_bank_identification_number": "112200303", - "status": "VERIFICATION_IN_PROGRESS", - "version": 5, - "secondary_bank_identification_number": "secondary_bank_identification_number4", - "debit_mandate_reference_id": "debit_mandate_reference_id0", - "reference_id": "reference_id2", - "fingerprint": "fingerprint0" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-bank-account-response.md b/doc/models/get-bank-account-response.md deleted file mode 100644 index 9bf91fa5..00000000 --- a/doc/models/get-bank-account-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Get Bank Account Response - -Response object returned by `GetBankAccount`. - -## Structure - -`GetBankAccountResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `bankAccount` | [`?BankAccount`](../../doc/models/bank-account.md) | Optional | Represents a bank account. For more information about
linking a bank account to a Square account, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). | getBankAccount(): ?BankAccount | setBankAccount(?BankAccount bankAccount): void | - -## Example (as JSON) - -```json -{ - "bank_account": { - "account_number_suffix": "971", - "account_type": "CHECKING", - "bank_name": "Bank Name", - "country": "US", - "creditable": false, - "currency": "USD", - "debitable": false, - "holder_name": "Jane Doe", - "id": "w3yRgCGYQnwmdl0R3GB", - "location_id": "S8GWD5example", - "primary_bank_identification_number": "112200303", - "status": "VERIFICATION_IN_PROGRESS", - "version": 5, - "secondary_bank_identification_number": "secondary_bank_identification_number4", - "debit_mandate_reference_id": "debit_mandate_reference_id0", - "reference_id": "reference_id2", - "fingerprint": "fingerprint0" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-break-type-response.md b/doc/models/get-break-type-response.md deleted file mode 100644 index abc0fc26..00000000 --- a/doc/models/get-break-type-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Get Break Type Response - -The response to a request to get a `BreakType`. The response contains -the requested `BreakType` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`GetBreakTypeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `breakType` | [`?BreakType`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | getBreakType(): ?BreakType | setBreakType(?BreakType breakType): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "break_type": { - "break_name": "Lunch Break", - "created_at": "2019-02-21T17:50:00Z", - "expected_duration": "PT30M", - "id": "lA0mj_RSOprNPwMUXdYp", - "is_paid": true, - "location_id": "059SB0E0WCNWS", - "updated_at": "2019-02-21T17:50:00Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-device-code-response.md b/doc/models/get-device-code-response.md deleted file mode 100644 index 4679861a..00000000 --- a/doc/models/get-device-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Get Device Code Response - -## Structure - -`GetDeviceCodeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `deviceCode` | [`?DeviceCode`](../../doc/models/device-code.md) | Optional | - | getDeviceCode(): ?DeviceCode | setDeviceCode(?DeviceCode deviceCode): void | - -## Example (as JSON) - -```json -{ - "device_code": { - "code": "EBCARJ", - "created_at": "2020-02-06T18:44:33.000Z", - "device_id": "907CS13101300122", - "id": "B3Z6NAMYQSMTM", - "location_id": "B5E4484SHHNYH", - "name": "Counter 1", - "pair_by": "2020-02-06T18:49:33.000Z", - "product_type": "TERMINAL_API", - "status": "PAIRED", - "status_changed_at": "2020-02-06T18:47:28.000Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-device-response.md b/doc/models/get-device-response.md deleted file mode 100644 index e3c64dab..00000000 --- a/doc/models/get-device-response.md +++ /dev/null @@ -1,191 +0,0 @@ - -# Get Device Response - -## Structure - -`GetDeviceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `device` | [`?Device`](../../doc/models/device.md) | Optional | - | getDevice(): ?Device | setDevice(?Device device): void | - -## Example (as JSON) - -```json -{ - "device": { - "attributes": { - "manufacturer": "Square", - "manufacturers_id": "995CS397A6475287", - "merchant_token": "MLCHXZCBWFGDW", - "model": "T2", - "name": "Square Terminal 995", - "type": "TERMINAL", - "updated_at": "2023-09-29T13:12:22.365049321Z", - "version": "5.41.0085" - }, - "components": [ - { - "application_details": { - "application_type": "TERMINAL_API", - "session_location": "LMN2K7S3RTOU3", - "version": "6.25", - "device_code_id": "device_code_id2" - }, - "type": "APPLICATION", - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "card_reader_details": { - "version": "3.53.70" - }, - "type": "CARD_READER", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "battery_details": { - "external_power": "AVAILABLE_CHARGING", - "visible_percent": 5 - }, - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "type": "WIFI", - "wifi_details": { - "active": true, - "ip_address_v4": "10.0.0.7", - "secure_connection": "WPA/WPA2 PSK", - "signal_strength": { - "value": 2 - }, - "ssid": "Staff Network" - }, - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "ethernet_details": { - "active": false - }, - "type": "ETHERNET", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - } - } - ], - "id": "device:995CS397A6475287", - "status": { - "category": "AVAILABLE" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-employee-wage-response.md b/doc/models/get-employee-wage-response.md deleted file mode 100644 index 112b48d2..00000000 --- a/doc/models/get-employee-wage-response.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Get Employee Wage Response - -A response to a request to get an `EmployeeWage`. The response contains -the requested `EmployeeWage` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`GetEmployeeWageResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `employeeWage` | [`?EmployeeWage`](../../doc/models/employee-wage.md) | Optional | The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). | getEmployeeWage(): ?EmployeeWage | setEmployeeWage(?EmployeeWage employeeWage): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "employee_wage": { - "employee_id": "33fJchumvVdJwxV0H6L9", - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "id": "pXS3qCv7BERPnEGedM4S8mhm", - "title": "Manager" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-invoice-response.md b/doc/models/get-invoice-response.md deleted file mode 100644 index 6a9fc1de..00000000 --- a/doc/models/get-invoice-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# Get Invoice Response - -Describes a `GetInvoice` response. - -## Structure - -`GetInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`?Invoice`](../../doc/models/invoice.md) | Optional | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): ?Invoice | setInvoice(?Invoice invoice): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T17:45:13Z", - "version": 0 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-payment-refund-response.md b/doc/models/get-payment-refund-response.md deleted file mode 100644 index 091fd761..00000000 --- a/doc/models/get-payment-refund-response.md +++ /dev/null @@ -1,100 +0,0 @@ - -# Get Payment Refund Response - -Defines the response returned by [GetRefund](../../doc/apis/refunds.md#get-payment-refund). - -Note: If there are errors processing the request, the refund field might not be -present or it might be present in a FAILED state. - -## Structure - -`GetPaymentRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?PaymentRefund`](../../doc/models/payment-refund.md) | Optional | Represents a refund of a payment made using Square. Contains information about
the original payment and the amount of money refunded. | getRefund(): ?PaymentRefund | setRefund(?PaymentRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 555, - "currency": "USD" - }, - "created_at": "2021-10-13T19:59:05.073Z", - "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", - "location_id": "L88917AVBK2S5", - "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", - "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "processing_fee": [ - { - "amount_money": { - "amount": -34, - "currency": "USD" - }, - "effective_at": "2021-10-13T21:34:35.000Z", - "type": "INITIAL" - } - ], - "reason": "Example Refund", - "status": "COMPLETED", - "updated_at": "2021-10-13T20:00:02.442Z", - "unlinked": false, - "destination_type": "destination_type2", - "destination_details": { - "card_details": { - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "auth_result_code": "auth_result_code0" - }, - "cash_details": { - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } - }, - "external_details": { - "type": "type6", - "source": "source0", - "source_id": "source_id8" - } - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-payment-response.md b/doc/models/get-payment-response.md deleted file mode 100644 index ef32b1a5..00000000 --- a/doc/models/get-payment-response.md +++ /dev/null @@ -1,101 +0,0 @@ - -# Get Payment Response - -Defines the response returned by [GetPayment](../../doc/apis/payments.md#get-payment). - -## Structure - -`GetPaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | - -## Example (as JSON) - -```json -{ - "payment": { - "amount_money": { - "amount": 555, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", - "square_product": "VIRTUAL_TERMINAL" - }, - "approved_money": { - "amount": 555, - "currency": "USD" - }, - "card_details": { - "auth_result_code": "2Nkw7q", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T19:34:33.680Z", - "captured_at": "2021-10-13T19:34:34.340Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "KEYED", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "CAPTURED" - }, - "created_at": "2021-10-13T19:34:33.524Z", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T19:34:33.524Z", - "employee_id": "TMoK_ogh6rH1o4dV", - "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "location_id": "L88917AVBK2S5", - "note": "Test Note", - "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", - "processing_fee": [ - { - "amount_money": { - "amount": 34, - "currency": "USD" - }, - "effective_at": "2021-10-13T21:34:35.000Z", - "type": "INITIAL" - } - ], - "receipt_number": "bP9m", - "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "source_type": "CARD", - "status": "COMPLETED", - "team_member_id": "TMoK_ogh6rH1o4dV", - "total_money": { - "amount": 555, - "currency": "USD" - }, - "updated_at": "2021-10-13T19:34:34.339Z", - "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", - "tip_money": { - "amount": 190, - "currency": "TWD" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-payout-response.md b/doc/models/get-payout-response.md deleted file mode 100644 index 29f24d62..00000000 --- a/doc/models/get-payout-response.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Get Payout Response - -## Structure - -`GetPayoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payout` | [`?Payout`](../../doc/models/payout.md) | Optional | An accounting of the amount owed the seller and record of the actual transfer to their
external bank account or to the Square balance. | getPayout(): ?Payout | setPayout(?Payout payout): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "payout": { - "amount_money": { - "amount": -103, - "currency_code": "USD", - "currency": "AUD" - }, - "arrival_date": "2022-03-24", - "created_at": "2022-03-24T03:07:09Z", - "destination": { - "id": "bact:ZPp3oedR3AeEUNd3z7", - "type": "BANK_ACCOUNT" - }, - "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", - "location_id": "L88917AVBK2S5", - "status": "PAID", - "type": "BATCH", - "updated_at": "2022-03-24T03:07:09Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-shift-response.md b/doc/models/get-shift-response.md deleted file mode 100644 index 076a54f6..00000000 --- a/doc/models/get-shift-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Get Shift Response - -A response to a request to get a `Shift`. The response contains -the requested `Shift` object and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`GetShiftResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `shift` | [`?Shift`](../../doc/models/shift.md) | Optional | A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift. | getShift(): ?Shift | setShift(?Shift shift): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "shift": { - "breaks": [ - { - "break_type_id": "92EPDRQKJ5088", - "end_at": "2019-02-23T20:00:00-05:00", - "expected_duration": "PT1H", - "id": "M9BBKEPQAQD2T", - "is_paid": true, - "name": "Lunch Break", - "start_at": "2019-02-23T19:00:00-05:00" - } - ], - "created_at": "2019-02-27T00:12:12Z", - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "employee_id": "D71KRMQof6cXGUW0aAv7", - "end_at": "2019-02-23T21:00:00-05:00", - "id": "T35HMQSN89SV4", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-02-23T18:00:00-05:00", - "status": "CLOSED", - "team_member_id": "D71KRMQof6cXGUW0aAv7", - "timezone": "America/New_York", - "updated_at": "2019-02-27T00:12:12Z", - "version": 1, - "wage": { - "hourly_rate": { - "amount": 1457, - "currency": "USD" - }, - "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", - "tip_eligible": true, - "title": "Cashier" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-team-member-wage-response.md b/doc/models/get-team-member-wage-response.md deleted file mode 100644 index eaed40df..00000000 --- a/doc/models/get-team-member-wage-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Get Team Member Wage Response - -A response to a request to get a `TeamMemberWage`. The response contains -the requested `TeamMemberWage` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`GetTeamMemberWageResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberWage` | [`?TeamMemberWage`](../../doc/models/team-member-wage.md) | Optional | The hourly wage rate that a team member earns on a `Shift` for doing the job
specified by the `title` property of this object. | getTeamMemberWage(): ?TeamMemberWage | setTeamMemberWage(?TeamMemberWage teamMemberWage): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_member_wage": { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "id": "pXS3qCv7BERPnEGedM4S8mhm", - "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "tip_eligible": false, - "title": "Manager" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-terminal-action-response.md b/doc/models/get-terminal-action-response.md deleted file mode 100644 index a0c4a3f1..00000000 --- a/doc/models/get-terminal-action-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Get Terminal Action Response - -## Structure - -`GetTerminalActionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void | - -## Example (as JSON) - -```json -{ - "action": { - "app_id": "APP_ID", - "created_at": "2021-07-28T23:22:07.476Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:jveJIAkkAjILHkdCE", - "location_id": "LOCATION_ID", - "save_card_options": { - "customer_id": "CUSTOMER_ID", - "reference_id": "user-id-1" - }, - "status": "IN_PROGRESS", - "type": "SAVE_CARD", - "updated_at": "2021-07-28T23:22:08.301Z", - "cancel_reason": "TIMED_OUT" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-terminal-checkout-response.md b/doc/models/get-terminal-checkout-response.md deleted file mode 100644 index ac7078dc..00000000 --- a/doc/models/get-terminal-checkout-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Get Terminal Checkout Response - -## Structure - -`GetTerminalCheckoutResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `checkout` | [`?TerminalCheckout`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | getCheckout(): ?TerminalCheckout | setCheckout(?TerminalCheckout checkout): void | - -## Example (as JSON) - -```json -{ - "checkout": { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "app_id": "APP_ID", - "created_at": "2020-04-06T16:39:32.545Z", - "deadline_duration": "PT5M", - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "collect_signature": false, - "show_itemized_cart": false - }, - "id": "08YceKh7B3ZqO", - "location_id": "LOCATION_ID", - "note": "A brief note", - "reference_id": "id11572", - "status": "IN_PROGRESS", - "updated_at": "2020-04-06T16:39:323.001Z", - "order_id": "order_id6", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/get-terminal-refund-response.md b/doc/models/get-terminal-refund-response.md deleted file mode 100644 index cd1a9410..00000000 --- a/doc/models/get-terminal-refund-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Get Terminal Refund Response - -## Structure - -`GetTerminalRefundResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?TerminalRefund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | getRefund(): ?TerminalRefund | setRefund(?TerminalRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 111, - "currency": "CAD" - }, - "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", - "card": { - "bin": "411111", - "card_brand": "INTERAC", - "card_type": "CREDIT", - "exp_month": 1, - "exp_year": 2022, - "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", - "last_4": "1111" - }, - "created_at": "2020-09-29T15:21:46.771Z", - "deadline_duration": "PT5M", - "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "location_id": "76C9W6K8CNNQ5", - "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", - "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "reason": "Returning item", - "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", - "status": "COMPLETED", - "updated_at": "2020-09-29T15:21:48.675Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/gift-card-activity-activate.md b/doc/models/gift-card-activity-activate.md deleted file mode 100644 index 6ed8d9fd..00000000 --- a/doc/models/gift-card-activity-activate.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Gift Card Activity Activate - -Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityActivate` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `orderId` | `?string` | Optional | The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.

Applications that use the Square Orders API to process orders must specify the order ID
[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `lineItemUid` | `?string` | Optional | The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase.

Applications that use the Square Orders API to process orders must specify the line item UID
in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | getLineItemUid(): ?string | setLineItemUid(?string lineItemUid): void | -| `referenceId` | `?string` | Optional | A client-specified ID that associates the gift card activity with an entity in another system.

Applications that use a custom order processing system can use this field to track information
related to an order or payment. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `buyerPaymentInstrumentIds` | `?(string[])` | Optional | The payment instrument IDs used to process the gift card purchase, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks.

Each buyer payment instrument ID can contain a maximum of 255 characters. | getBuyerPaymentInstrumentIds(): ?array | setBuyerPaymentInstrumentIds(?array buyerPaymentInstrumentIds): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "order_id": "order_id2", - "line_item_uid": "line_item_uid4", - "reference_id": "reference_id8", - "buyer_payment_instrument_ids": [ - "buyer_payment_instrument_ids0" - ] -} -``` - diff --git a/doc/models/gift-card-activity-adjust-decrement-reason.md b/doc/models/gift-card-activity-adjust-decrement-reason.md deleted file mode 100644 index 6af17603..00000000 --- a/doc/models/gift-card-activity-adjust-decrement-reason.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Gift Card Activity Adjust Decrement Reason - -Indicates the reason for deducting money from a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityAdjustDecrementReason` - -## Fields - -| Name | Description | -| --- | --- | -| `SUSPICIOUS_ACTIVITY` | The balance was decreased because the seller detected suspicious or fraudulent activity
on the gift card. | -| `BALANCE_ACCIDENTALLY_INCREASED` | The balance was decreased to reverse an unintentional balance increase. | -| `SUPPORT_ISSUE` | The balance was decreased to accommodate support issues. | -| `PURCHASE_WAS_REFUNDED` | The balance was decreased because the order used to purchase or reload the
gift card was refunded. | - diff --git a/doc/models/gift-card-activity-adjust-decrement.md b/doc/models/gift-card-activity-adjust-decrement.md deleted file mode 100644 index 84616259..00000000 --- a/doc/models/gift-card-activity-adjust-decrement.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Adjust Decrement - -Represents details about an `ADJUST_DECREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityAdjustDecrement` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `reason` | [`string(GiftCardActivityAdjustDecrementReason)`](../../doc/models/gift-card-activity-adjust-decrement-reason.md) | Required | Indicates the reason for deducting money from a [gift card](../../doc/models/gift-card.md). | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reason": "SUPPORT_ISSUE" -} -``` - diff --git a/doc/models/gift-card-activity-adjust-increment-reason.md b/doc/models/gift-card-activity-adjust-increment-reason.md deleted file mode 100644 index c7bebb4d..00000000 --- a/doc/models/gift-card-activity-adjust-increment-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Adjust Increment Reason - -Indicates the reason for adding money to a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityAdjustIncrementReason` - -## Fields - -| Name | Description | -| --- | --- | -| `COMPLIMENTARY` | The seller gifted a complimentary gift card balance increase. | -| `SUPPORT_ISSUE` | The seller increased the gift card balance
to accommodate support issues. | -| `TRANSACTION_VOIDED` | The transaction is voided. | - diff --git a/doc/models/gift-card-activity-adjust-increment.md b/doc/models/gift-card-activity-adjust-increment.md deleted file mode 100644 index e65146c7..00000000 --- a/doc/models/gift-card-activity-adjust-increment.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Adjust Increment - -Represents details about an `ADJUST_INCREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityAdjustIncrement` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `reason` | [`string(GiftCardActivityAdjustIncrementReason)`](../../doc/models/gift-card-activity-adjust-increment-reason.md) | Required | Indicates the reason for adding money to a [gift card](../../doc/models/gift-card.md). | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reason": "COMPLIMENTARY" -} -``` - diff --git a/doc/models/gift-card-activity-block-reason.md b/doc/models/gift-card-activity-block-reason.md deleted file mode 100644 index 6bf54c74..00000000 --- a/doc/models/gift-card-activity-block-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Gift Card Activity Block Reason - -Indicates the reason for blocking a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityBlockReason` - -## Fields - -| Name | Description | -| --- | --- | -| `CHARGEBACK_BLOCK` | The gift card is blocked because the buyer initiated a chargeback on the gift card purchase. | - diff --git a/doc/models/gift-card-activity-block.md b/doc/models/gift-card-activity-block.md deleted file mode 100644 index 8745983c..00000000 --- a/doc/models/gift-card-activity-block.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Block - -Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityBlock` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `reason` | `string` | Required, Constant | Indicates the reason for blocking a [gift card](../../doc/models/gift-card.md).
**Default**: `'CHARGEBACK_BLOCK'` | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "reason": "CHARGEBACK_BLOCK" -} -``` - diff --git a/doc/models/gift-card-activity-clear-balance-reason.md b/doc/models/gift-card-activity-clear-balance-reason.md deleted file mode 100644 index 64a28491..00000000 --- a/doc/models/gift-card-activity-clear-balance-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Clear Balance Reason - -Indicates the reason for clearing the balance of a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityClearBalanceReason` - -## Fields - -| Name | Description | -| --- | --- | -| `SUSPICIOUS_ACTIVITY` | The seller suspects suspicious activity. | -| `REUSE_GIFTCARD` | The seller cleared the balance to reuse the gift card. | -| `UNKNOWN_REASON` | The gift card balance was cleared for an unknown reason.

This reason is read-only and cannot be used to create a `CLEAR_BALANCE` activity using the Gift Card Activities API. | - diff --git a/doc/models/gift-card-activity-clear-balance.md b/doc/models/gift-card-activity-clear-balance.md deleted file mode 100644 index c2896cb8..00000000 --- a/doc/models/gift-card-activity-clear-balance.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Clear Balance - -Represents details about a `CLEAR_BALANCE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityClearBalance` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `reason` | [`string(GiftCardActivityClearBalanceReason)`](../../doc/models/gift-card-activity-clear-balance-reason.md) | Required | Indicates the reason for clearing the balance of a [gift card](../../doc/models/gift-card.md). | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "reason": "SUSPICIOUS_ACTIVITY" -} -``` - diff --git a/doc/models/gift-card-activity-deactivate-reason.md b/doc/models/gift-card-activity-deactivate-reason.md deleted file mode 100644 index 9cc8fd8d..00000000 --- a/doc/models/gift-card-activity-deactivate-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Deactivate Reason - -Indicates the reason for deactivating a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityDeactivateReason` - -## Fields - -| Name | Description | -| --- | --- | -| `SUSPICIOUS_ACTIVITY` | The seller suspects suspicious activity. | -| `UNKNOWN_REASON` | The gift card was deactivated for an unknown reason.

This reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API. | -| `CHARGEBACK_DEACTIVATE` | A chargeback on the gift card purchase (or the gift card load) was ruled in favor of the buyer.

This reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API. | - diff --git a/doc/models/gift-card-activity-deactivate.md b/doc/models/gift-card-activity-deactivate.md deleted file mode 100644 index 62512b11..00000000 --- a/doc/models/gift-card-activity-deactivate.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Deactivate - -Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityDeactivate` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `reason` | [`string(GiftCardActivityDeactivateReason)`](../../doc/models/gift-card-activity-deactivate-reason.md) | Required | Indicates the reason for deactivating a [gift card](../../doc/models/gift-card.md). | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "reason": "CHARGEBACK_DEACTIVATE" -} -``` - diff --git a/doc/models/gift-card-activity-import-reversal.md b/doc/models/gift-card-activity-import-reversal.md deleted file mode 100644 index d4d1366c..00000000 --- a/doc/models/gift-card-activity-import-reversal.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Gift Card Activity Import Reversal - -Represents details about an `IMPORT_REVERSAL` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityImportReversal` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/gift-card-activity-import.md b/doc/models/gift-card-activity-import.md deleted file mode 100644 index 07f8a5f6..00000000 --- a/doc/models/gift-card-activity-import.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Import - -Represents details about an `IMPORT` [gift card activity type](../../doc/models/gift-card-activity-type.md). -This activity type is used when Square imports a third-party gift card, in which case the -`gan_source` of the gift card is set to `OTHER`. - -## Structure - -`GiftCardActivityImport` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/gift-card-activity-load.md b/doc/models/gift-card-activity-load.md deleted file mode 100644 index a010ef31..00000000 --- a/doc/models/gift-card-activity-load.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Gift Card Activity Load - -Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityLoad` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `orderId` | `?string` | Optional | The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.

Applications that use the Square Orders API to process orders must specify the order ID in the
[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `lineItemUid` | `?string` | Optional | The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift card.

Applications that use the Square Orders API to process orders must specify the line item UID
in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | getLineItemUid(): ?string | setLineItemUid(?string lineItemUid): void | -| `referenceId` | `?string` | Optional | A client-specified ID that associates the gift card activity with an entity in another system.

Applications that use a custom order processing system can use this field to track information related to
an order or payment. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `buyerPaymentInstrumentIds` | `?(string[])` | Optional | The payment instrument IDs used to process the order for the additional funds, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks.

Each buyer payment instrument ID can contain a maximum of 255 characters. | getBuyerPaymentInstrumentIds(): ?array | setBuyerPaymentInstrumentIds(?array buyerPaymentInstrumentIds): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "order_id": "order_id2", - "line_item_uid": "line_item_uid8", - "reference_id": "reference_id6", - "buyer_payment_instrument_ids": [ - "buyer_payment_instrument_ids4", - "buyer_payment_instrument_ids5" - ] -} -``` - diff --git a/doc/models/gift-card-activity-redeem-status.md b/doc/models/gift-card-activity-redeem-status.md deleted file mode 100644 index ea411fbe..00000000 --- a/doc/models/gift-card-activity-redeem-status.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Gift Card Activity Redeem Status - -Indicates the status of a [gift card](../../doc/models/gift-card.md) redemption. This status is relevant only for -redemptions made from Square products (such as Square Point of Sale) because Square products use a -two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status. - -## Enumeration - -`GiftCardActivityRedeemStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The gift card redemption is pending. `PENDING` is a temporary status that applies when a
gift card is redeemed from Square Point of Sale or another Square product. A `PENDING` status is updated to
`COMPLETED` if the payment is captured or `CANCELED` if the authorization is voided. | -| `COMPLETED` | The gift card redemption is completed. | -| `CANCELED` | The gift card redemption is canceled. A redemption is canceled if the authorization
on the gift card is voided. | - diff --git a/doc/models/gift-card-activity-redeem.md b/doc/models/gift-card-activity-redeem.md deleted file mode 100644 index f7fe5997..00000000 --- a/doc/models/gift-card-activity-redeem.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Gift Card Activity Redeem - -Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityRedeem` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `paymentId` | `?string` | Optional | The ID of the payment that represents the gift card redemption. Square populates this field
if the payment was processed by Square. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `referenceId` | `?string` | Optional | A client-specified ID that associates the gift card activity with an entity in another system.

Applications that use a custom payment processing system can use this field to track information
related to an order or payment. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `status` | [`?string(GiftCardActivityRedeemStatus)`](../../doc/models/gift-card-activity-redeem-status.md) | Optional | Indicates the status of a [gift card](../../doc/models/gift-card.md) redemption. This status is relevant only for
redemptions made from Square products (such as Square Point of Sale) because Square products use a
two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "payment_id": "payment_id4", - "reference_id": "reference_id2", - "status": "COMPLETED" -} -``` - diff --git a/doc/models/gift-card-activity-refund.md b/doc/models/gift-card-activity-refund.md deleted file mode 100644 index 6eb9ed00..00000000 --- a/doc/models/gift-card-activity-refund.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Gift Card Activity Refund - -Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityRefund` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `redeemActivityId` | `?string` | Optional | The ID of the refunded `REDEEM` gift card activity. Square populates this field if the
`payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request
represents a gift card redemption.

For applications that use a custom payment processing system, this field is required when creating
a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card. | getRedeemActivityId(): ?string | setRedeemActivityId(?string redeemActivityId): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `referenceId` | `?string` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `paymentId` | `?string` | Optional | The ID of the refunded payment. Square populates this field if the refund is for a
payment processed by Square. This field matches the `payment_id` in the corresponding
[RefundPayment](api-endpoint:Refunds-RefundPayment) request. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "redeem_activity_id": "redeem_activity_id4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reference_id": "reference_id8", - "payment_id": "payment_id4" -} -``` - diff --git a/doc/models/gift-card-activity-transfer-balance-from.md b/doc/models/gift-card-activity-transfer-balance-from.md deleted file mode 100644 index 3f8f4163..00000000 --- a/doc/models/gift-card-activity-transfer-balance-from.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Transfer Balance From - -Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityTransferBalanceFrom` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `transferToGiftCardId` | `string` | Required | The ID of the gift card to which the specified amount was transferred. | getTransferToGiftCardId(): string | setTransferToGiftCardId(string transferToGiftCardId): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "transfer_to_gift_card_id": "transfer_to_gift_card_id0", - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/gift-card-activity-transfer-balance-to.md b/doc/models/gift-card-activity-transfer-balance-to.md deleted file mode 100644 index e7b47992..00000000 --- a/doc/models/gift-card-activity-transfer-balance-to.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Transfer Balance To - -Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityTransferBalanceTo` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `transferFromGiftCardId` | `string` | Required | The ID of the gift card from which the specified amount was transferred. | getTransferFromGiftCardId(): string | setTransferFromGiftCardId(string transferFromGiftCardId): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "transfer_from_gift_card_id": "transfer_from_gift_card_id6", - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/gift-card-activity-type.md b/doc/models/gift-card-activity-type.md deleted file mode 100644 index 53df15bc..00000000 --- a/doc/models/gift-card-activity-type.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Gift Card Activity Type - -Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). - -## Enumeration - -`GiftCardActivityType` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVATE` | Activated a gift card with a balance. When a gift card is activated, Square changes
the gift card state from `PENDING` to `ACTIVE`. A gift card must be in the `ACTIVE` state
to be used for other balance-changing activities. | -| `LOAD` | Loaded a gift card with additional funds. | -| `REDEEM` | Redeemed a gift card for a purchase. | -| `CLEAR_BALANCE` | Set the balance of a gift card to zero. | -| `DEACTIVATE` | Permanently blocked a gift card from balance-changing activities. | -| `ADJUST_INCREMENT` | Added money to a gift card outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. | -| `ADJUST_DECREMENT` | Deducted money from a gift card outside of a typical `REDEEM` activity flow. | -| `REFUND` | Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to
a Square payment, depending on how the payment and refund are processed. For example:

- A payment processed by Square can be refunded to a `PENDING` or `ACTIVE` gift card using the Square
Seller Dashboard, Square Point of Sale, or Refunds API.
- A payment processed using a custom processing system can be refunded to the same gift card. | -| `UNLINKED_ACTIVITY_REFUND` | Added money to a gift card from a refunded transaction that was processed using a custom payment
processing system and not linked to the gift card. | -| `IMPORT` | Imported a third-party gift card with a balance. `IMPORT` activities are managed
by Square and cannot be created using the Gift Card Activities API. | -| `BLOCK` | Temporarily blocked a gift card from balance-changing activities. `BLOCK` activities
are managed by Square and cannot be created using the Gift Card Activities API. | -| `UNBLOCK` | Unblocked a gift card, which enables it to resume balance-changing activities. `UNBLOCK`
activities are managed by Square and cannot be created using the Gift Card Activities API. | -| `IMPORT_REVERSAL` | Reversed the import of a third-party gift card, which sets the gift card state to
`PENDING` and clears the balance. `IMPORT_REVERSAL` activities are managed by Square and
cannot be created using the Gift Card Activities API. | -| `TRANSFER_BALANCE_FROM` | Deducted money from a gift card as the result of a transfer to the balance of another gift card.
`TRANSFER_BALANCE_FROM` activities are managed by Square and cannot be created using the Gift Card Activities API. | -| `TRANSFER_BALANCE_TO` | Added money to a gift card as the result of a transfer from the balance of another gift card.
`TRANSFER_BALANCE_TO` activities are managed by Square and cannot be created using the Gift Card Activities API. | - diff --git a/doc/models/gift-card-activity-unblock-reason.md b/doc/models/gift-card-activity-unblock-reason.md deleted file mode 100644 index 11ccbda8..00000000 --- a/doc/models/gift-card-activity-unblock-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Gift Card Activity Unblock Reason - -Indicates the reason for unblocking a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`GiftCardActivityUnblockReason` - -## Fields - -| Name | Description | -| --- | --- | -| `CHARGEBACK_UNBLOCK` | The gift card is unblocked because a chargeback was ruled in favor of the seller. | - diff --git a/doc/models/gift-card-activity-unblock.md b/doc/models/gift-card-activity-unblock.md deleted file mode 100644 index dd6dfa73..00000000 --- a/doc/models/gift-card-activity-unblock.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Unblock - -Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityUnblock` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `reason` | `string` | Required, Constant | Indicates the reason for unblocking a [gift card](../../doc/models/gift-card.md).
**Default**: `'CHARGEBACK_UNBLOCK'` | getReason(): string | setReason(string reason): void | - -## Example (as JSON) - -```json -{ - "reason": "CHARGEBACK_UNBLOCK" -} -``` - diff --git a/doc/models/gift-card-activity-unlinked-activity-refund.md b/doc/models/gift-card-activity-unlinked-activity-refund.md deleted file mode 100644 index 5cc8afaa..00000000 --- a/doc/models/gift-card-activity-unlinked-activity-refund.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Gift Card Activity Unlinked Activity Refund - -Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`GiftCardActivityUnlinkedActivityRefund` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `referenceId` | `?string` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `paymentId` | `?string` | Optional | The ID of the refunded payment. This field is not used starting in Square version 2022-06-16. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reference_id": "reference_id8", - "payment_id": "payment_id0" -} -``` - diff --git a/doc/models/gift-card-activity.md b/doc/models/gift-card-activity.md deleted file mode 100644 index 02e0b0c8..00000000 --- a/doc/models/gift-card-activity.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Gift Card Activity - -Represents an action performed on a [gift card](../../doc/models/gift-card.md) that affects its state or balance. -A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity -includes a `redeem_activity_details` field that contains information about the redemption. - -## Structure - -`GiftCardActivity` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the gift card activity. | getId(): ?string | setId(?string id): void | -| `type` | [`string(GiftCardActivityType)`](../../doc/models/gift-card-activity-type.md) | Required | Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). | getType(): string | setType(string type): void | -| `locationId` | `string` | Required | The ID of the [business location](entity:Location) where the activity occurred. | getLocationId(): string | setLocationId(string locationId): void | -| `createdAt` | `?string` | Optional | The timestamp when the gift card activity was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `giftCardId` | `?string` | Optional | The gift card ID. When creating a gift card activity, `gift_card_id` is not required if
`gift_card_gan` is specified. | getGiftCardId(): ?string | setGiftCardId(?string giftCardId): void | -| `giftCardGan` | `?string` | Optional | The gift card account number (GAN). When creating a gift card activity, `gift_card_gan`
is not required if `gift_card_id` is specified. | getGiftCardGan(): ?string | setGiftCardGan(?string giftCardGan): void | -| `giftCardBalanceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getGiftCardBalanceMoney(): ?Money | setGiftCardBalanceMoney(?Money giftCardBalanceMoney): void | -| `loadActivityDetails` | [`?GiftCardActivityLoad`](../../doc/models/gift-card-activity-load.md) | Optional | Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getLoadActivityDetails(): ?GiftCardActivityLoad | setLoadActivityDetails(?GiftCardActivityLoad loadActivityDetails): void | -| `activateActivityDetails` | [`?GiftCardActivityActivate`](../../doc/models/gift-card-activity-activate.md) | Optional | Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getActivateActivityDetails(): ?GiftCardActivityActivate | setActivateActivityDetails(?GiftCardActivityActivate activateActivityDetails): void | -| `redeemActivityDetails` | [`?GiftCardActivityRedeem`](../../doc/models/gift-card-activity-redeem.md) | Optional | Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getRedeemActivityDetails(): ?GiftCardActivityRedeem | setRedeemActivityDetails(?GiftCardActivityRedeem redeemActivityDetails): void | -| `clearBalanceActivityDetails` | [`?GiftCardActivityClearBalance`](../../doc/models/gift-card-activity-clear-balance.md) | Optional | Represents details about a `CLEAR_BALANCE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getClearBalanceActivityDetails(): ?GiftCardActivityClearBalance | setClearBalanceActivityDetails(?GiftCardActivityClearBalance clearBalanceActivityDetails): void | -| `deactivateActivityDetails` | [`?GiftCardActivityDeactivate`](../../doc/models/gift-card-activity-deactivate.md) | Optional | Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getDeactivateActivityDetails(): ?GiftCardActivityDeactivate | setDeactivateActivityDetails(?GiftCardActivityDeactivate deactivateActivityDetails): void | -| `adjustIncrementActivityDetails` | [`?GiftCardActivityAdjustIncrement`](../../doc/models/gift-card-activity-adjust-increment.md) | Optional | Represents details about an `ADJUST_INCREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getAdjustIncrementActivityDetails(): ?GiftCardActivityAdjustIncrement | setAdjustIncrementActivityDetails(?GiftCardActivityAdjustIncrement adjustIncrementActivityDetails): void | -| `adjustDecrementActivityDetails` | [`?GiftCardActivityAdjustDecrement`](../../doc/models/gift-card-activity-adjust-decrement.md) | Optional | Represents details about an `ADJUST_DECREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getAdjustDecrementActivityDetails(): ?GiftCardActivityAdjustDecrement | setAdjustDecrementActivityDetails(?GiftCardActivityAdjustDecrement adjustDecrementActivityDetails): void | -| `refundActivityDetails` | [`?GiftCardActivityRefund`](../../doc/models/gift-card-activity-refund.md) | Optional | Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getRefundActivityDetails(): ?GiftCardActivityRefund | setRefundActivityDetails(?GiftCardActivityRefund refundActivityDetails): void | -| `unlinkedActivityRefundActivityDetails` | [`?GiftCardActivityUnlinkedActivityRefund`](../../doc/models/gift-card-activity-unlinked-activity-refund.md) | Optional | Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getUnlinkedActivityRefundActivityDetails(): ?GiftCardActivityUnlinkedActivityRefund | setUnlinkedActivityRefundActivityDetails(?GiftCardActivityUnlinkedActivityRefund unlinkedActivityRefundActivityDetails): void | -| `importActivityDetails` | [`?GiftCardActivityImport`](../../doc/models/gift-card-activity-import.md) | Optional | Represents details about an `IMPORT` [gift card activity type](../../doc/models/gift-card-activity-type.md).
This activity type is used when Square imports a third-party gift card, in which case the
`gan_source` of the gift card is set to `OTHER`. | getImportActivityDetails(): ?GiftCardActivityImport | setImportActivityDetails(?GiftCardActivityImport importActivityDetails): void | -| `blockActivityDetails` | [`?GiftCardActivityBlock`](../../doc/models/gift-card-activity-block.md) | Optional | Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getBlockActivityDetails(): ?GiftCardActivityBlock | setBlockActivityDetails(?GiftCardActivityBlock blockActivityDetails): void | -| `unblockActivityDetails` | [`?GiftCardActivityUnblock`](../../doc/models/gift-card-activity-unblock.md) | Optional | Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getUnblockActivityDetails(): ?GiftCardActivityUnblock | setUnblockActivityDetails(?GiftCardActivityUnblock unblockActivityDetails): void | -| `importReversalActivityDetails` | [`?GiftCardActivityImportReversal`](../../doc/models/gift-card-activity-import-reversal.md) | Optional | Represents details about an `IMPORT_REVERSAL` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getImportReversalActivityDetails(): ?GiftCardActivityImportReversal | setImportReversalActivityDetails(?GiftCardActivityImportReversal importReversalActivityDetails): void | -| `transferBalanceToActivityDetails` | [`?GiftCardActivityTransferBalanceTo`](../../doc/models/gift-card-activity-transfer-balance-to.md) | Optional | Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getTransferBalanceToActivityDetails(): ?GiftCardActivityTransferBalanceTo | setTransferBalanceToActivityDetails(?GiftCardActivityTransferBalanceTo transferBalanceToActivityDetails): void | -| `transferBalanceFromActivityDetails` | [`?GiftCardActivityTransferBalanceFrom`](../../doc/models/gift-card-activity-transfer-balance-from.md) | Optional | Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](../../doc/models/gift-card-activity-type.md). | getTransferBalanceFromActivityDetails(): ?GiftCardActivityTransferBalanceFrom | setTransferBalanceFromActivityDetails(?GiftCardActivityTransferBalanceFrom transferBalanceFromActivityDetails): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "type": "REDEEM", - "location_id": "location_id2", - "created_at": "created_at6", - "gift_card_id": "gift_card_id6", - "gift_card_gan": "gift_card_gan4", - "gift_card_balance_money": { - "amount": 82, - "currency": "IRR" - } -} -``` - diff --git a/doc/models/gift-card-gan-source.md b/doc/models/gift-card-gan-source.md deleted file mode 100644 index f58aa093..00000000 --- a/doc/models/gift-card-gan-source.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card GAN Source - -Indicates the source that generated the gift card -account number (GAN). - -## Enumeration - -`GiftCardGANSource` - -## Fields - -| Name | Description | -| --- | --- | -| `SQUARE` | The GAN is generated by Square. | -| `OTHER` | The GAN is provided by a non-Square system. For more information, see
[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans) or
[Third-party gift cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#third-party-gift-cards). | - diff --git a/doc/models/gift-card-status.md b/doc/models/gift-card-status.md deleted file mode 100644 index 29540465..00000000 --- a/doc/models/gift-card-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Gift Card Status - -Indicates the gift card state. - -## Enumeration - -`GiftCardStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | The gift card is active and can be used as a payment source. | -| `DEACTIVATED` | Any activity that changes the gift card balance is permanently forbidden. | -| `BLOCKED` | Any activity that changes the gift card balance is temporarily forbidden. | -| `PENDING` | The gift card is pending activation.
This is the initial state when a gift card is created. Typically, you'll call
[CreateGiftCardActivity](../../doc/apis/gift-card-activities.md#create-gift-card-activity) to create an
`ACTIVATE` activity that activates the gift card with an initial balance before first use. | - diff --git a/doc/models/gift-card-type.md b/doc/models/gift-card-type.md deleted file mode 100644 index fff0b7b8..00000000 --- a/doc/models/gift-card-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Gift Card Type - -Indicates the gift card type. - -## Enumeration - -`GiftCardType` - -## Fields - -| Name | Description | -| --- | --- | -| `PHYSICAL` | A plastic gift card. | -| `DIGITAL` | A digital gift card. | - diff --git a/doc/models/gift-card.md b/doc/models/gift-card.md deleted file mode 100644 index cd118ac4..00000000 --- a/doc/models/gift-card.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Gift Card - -Represents a Square gift card. - -## Structure - -`GiftCard` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the gift card. | getId(): ?string | setId(?string id): void | -| `type` | [`string(GiftCardType)`](../../doc/models/gift-card-type.md) | Required | Indicates the gift card type. | getType(): string | setType(string type): void | -| `ganSource` | [`?string(GiftCardGANSource)`](../../doc/models/gift-card-gan-source.md) | Optional | Indicates the source that generated the gift card
account number (GAN). | getGanSource(): ?string | setGanSource(?string ganSource): void | -| `state` | [`?string(GiftCardStatus)`](../../doc/models/gift-card-status.md) | Optional | Indicates the gift card state. | getState(): ?string | setState(?string state): void | -| `balanceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBalanceMoney(): ?Money | setBalanceMoney(?Money balanceMoney): void | -| `gan` | `?string` | Optional | The gift card account number (GAN). Buyers can use the GAN to make purchases or check
the gift card balance. | getGan(): ?string | setGan(?string gan): void | -| `createdAt` | `?string` | Optional | The timestamp when the gift card was created, in RFC 3339 format.
In the case of a digital gift card, it is the time when you create a card
(using the Square Point of Sale application, Seller Dashboard, or Gift Cards API).
In the case of a plastic gift card, it is the time when Square associates the card with the
seller at the time of activation. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `customerIds` | `?(string[])` | Optional | The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "type": "PHYSICAL", - "gan_source": "SQUARE", - "state": "ACTIVE", - "balance_money": { - "amount": 146, - "currency": "BBD" - }, - "gan": "gan6" -} -``` - diff --git a/doc/models/inventory-adjustment-group.md b/doc/models/inventory-adjustment-group.md deleted file mode 100644 index 03d70ca0..00000000 --- a/doc/models/inventory-adjustment-group.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Inventory Adjustment Group - -## Structure - -`InventoryAdjustmentGroup` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID generated by Square for the
`InventoryAdjustmentGroup`.
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `rootAdjustmentId` | `?string` | Optional | The inventory adjustment of the composed variation.
**Constraints**: *Maximum Length*: `100` | getRootAdjustmentId(): ?string | setRootAdjustmentId(?string rootAdjustmentId): void | -| `fromState` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getFromState(): ?string | setFromState(?string fromState): void | -| `toState` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getToState(): ?string | setToState(?string toState): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "root_adjustment_id": "root_adjustment_id4", - "from_state": "WASTE", - "to_state": "RESERVED_FOR_SALE" -} -``` - diff --git a/doc/models/inventory-adjustment.md b/doc/models/inventory-adjustment.md deleted file mode 100644 index c6e02edd..00000000 --- a/doc/models/inventory-adjustment.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Inventory Adjustment - -Represents a change in state or quantity of product inventory at a -particular time and location. - -## Structure - -`InventoryAdjustment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID generated by Square for the
`InventoryAdjustment`.
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
`InventoryAdjustment` to an external
system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `fromState` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getFromState(): ?string | setFromState(?string fromState): void | -| `toState` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getToState(): ?string | setToState(?string toState): void | -| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogObjectType` | `?string` | Optional | The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked.

The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value.
In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | -| `quantity` | `?string` | Optional | The number of items affected by the adjustment as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | -| `totalPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalPriceMoney(): ?Money | setTotalPriceMoney(?Money totalPriceMoney): void | -| `occurredAt` | `?string` | Optional | A client-generated RFC 3339-formatted timestamp that indicates when
the inventory adjustment took place. For inventory adjustment updates, the `occurred_at`
timestamp cannot be older than 24 hours or in the future relative to the
time of the request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | -| `createdAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `source` | [`?SourceApplication`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `teamMemberId` | `?string` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `transactionId` | `?string` | Optional | The Square-generated ID of the [Transaction](entity:Transaction) that
caused the adjustment. Only relevant for payment-related state
transitions.
**Constraints**: *Maximum Length*: `255` | getTransactionId(): ?string | setTransactionId(?string transactionId): void | -| `refundId` | `?string` | Optional | The Square-generated ID of the [Refund](entity:Refund) that
caused the adjustment. Only relevant for refund-related state
transitions.
**Constraints**: *Maximum Length*: `255` | getRefundId(): ?string | setRefundId(?string refundId): void | -| `purchaseOrderId` | `?string` | Optional | The Square-generated ID of the purchase order that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | getPurchaseOrderId(): ?string | setPurchaseOrderId(?string purchaseOrderId): void | -| `goodsReceiptId` | `?string` | Optional | The Square-generated ID of the goods receipt that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | getGoodsReceiptId(): ?string | setGoodsReceiptId(?string goodsReceiptId): void | -| `adjustmentGroup` | [`?InventoryAdjustmentGroup`](../../doc/models/inventory-adjustment-group.md) | Optional | - | getAdjustmentGroup(): ?InventoryAdjustmentGroup | setAdjustmentGroup(?InventoryAdjustmentGroup adjustmentGroup): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "reference_id": "reference_id6", - "from_state": "WASTE", - "to_state": "RESERVED_FOR_SALE", - "location_id": "location_id0" -} -``` - diff --git a/doc/models/inventory-alert-type.md b/doc/models/inventory-alert-type.md deleted file mode 100644 index 0d9e9d47..00000000 --- a/doc/models/inventory-alert-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Inventory Alert Type - -Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. - -## Enumeration - -`InventoryAlertType` - -## Fields - -| Name | Description | -| --- | --- | -| `NONE` | The variation does not display an alert. | -| `LOW_QUANTITY` | The variation generates an alert when its quantity is low. | - diff --git a/doc/models/inventory-change-type.md b/doc/models/inventory-change-type.md deleted file mode 100644 index bc4f17b5..00000000 --- a/doc/models/inventory-change-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Inventory Change Type - -Indicates how the inventory change was applied to a tracked product quantity. - -## Enumeration - -`InventoryChangeType` - -## Fields - -| Name | Description | -| --- | --- | -| `PHYSICAL_COUNT` | The change occurred as part of a physical count update. | -| `ADJUSTMENT` | The change occurred as part of the normal lifecycle of goods
(e.g., as an inventory adjustment). | -| `TRANSFER` | The change occurred as part of an inventory transfer. | - diff --git a/doc/models/inventory-change.md b/doc/models/inventory-change.md deleted file mode 100644 index b9ed2822..00000000 --- a/doc/models/inventory-change.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Inventory Change - -Represents a single physical count, inventory, adjustment, or transfer -that is part of the history of inventory changes for a particular -[CatalogObject](../../doc/models/catalog-object.md) instance. - -## Structure - -`InventoryChange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`?string(InventoryChangeType)`](../../doc/models/inventory-change-type.md) | Optional | Indicates how the inventory change was applied to a tracked product quantity. | getType(): ?string | setType(?string type): void | -| `physicalCount` | [`?InventoryPhysicalCount`](../../doc/models/inventory-physical-count.md) | Optional | Represents the quantity of an item variation that is physically present
at a specific location, verified by a seller or a seller's employee. For example,
a physical count might come from an employee counting the item variations on
hand or from syncing with an external system. | getPhysicalCount(): ?InventoryPhysicalCount | setPhysicalCount(?InventoryPhysicalCount physicalCount): void | -| `adjustment` | [`?InventoryAdjustment`](../../doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | getAdjustment(): ?InventoryAdjustment | setAdjustment(?InventoryAdjustment adjustment): void | -| `transfer` | [`?InventoryTransfer`](../../doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | getTransfer(): ?InventoryTransfer | setTransfer(?InventoryTransfer transfer): void | -| `measurementUnit` | [`?CatalogMeasurementUnit`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | getMeasurementUnit(): ?CatalogMeasurementUnit | setMeasurementUnit(?CatalogMeasurementUnit measurementUnit): void | -| `measurementUnitId` | `?string` | Optional | The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change. | getMeasurementUnitId(): ?string | setMeasurementUnitId(?string measurementUnitId): void | - -## Example (as JSON) - -```json -{ - "type": "ADJUSTMENT", - "physical_count": { - "id": "id2", - "reference_id": "reference_id0", - "catalog_object_id": "catalog_object_id6", - "catalog_object_type": "catalog_object_type6", - "state": "SUPPORTED_BY_NEWER_VERSION" - }, - "adjustment": { - "id": "id4", - "reference_id": "reference_id2", - "from_state": "IN_TRANSIT_TO", - "to_state": "SOLD", - "location_id": "location_id8" - }, - "transfer": { - "id": "id8", - "reference_id": "reference_id6", - "state": "RESERVED_FOR_SALE", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" - }, - "measurement_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 184 - } -} -``` - diff --git a/doc/models/inventory-count.md b/doc/models/inventory-count.md deleted file mode 100644 index e93994f3..00000000 --- a/doc/models/inventory-count.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Inventory Count - -Represents Square-estimated quantity of items in a particular state at a -particular seller location based on the known history of physical counts and -inventory adjustments. - -## Structure - -`InventoryCount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogObjectType` | `?string` | Optional | The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked.

The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value.
In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | -| `state` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `quantity` | `?string` | Optional | The number of items affected by the estimated count as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | -| `calculatedAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting
the estimated count is received.
**Constraints**: *Maximum Length*: `34` | getCalculatedAt(): ?string | setCalculatedAt(?string calculatedAt): void | -| `isEstimated` | `?bool` | Optional | Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory count will not be present in the response of
any of these endpoints: [BatchChangeInventory](../../doc/apis/inventory.md#batch-change-inventory),
[BatchRetrieveInventoryChanges](../../doc/apis/inventory.md#batch-retrieve-inventory-changes),
[BatchRetrieveInventoryCounts](../../doc/apis/inventory.md#batch-retrieve-inventory-counts), and
[RetrieveInventoryChanges](../../doc/apis/inventory.md#retrieve-inventory-changes). | getIsEstimated(): ?bool | setIsEstimated(?bool isEstimated): void | - -## Example (as JSON) - -```json -{ - "catalog_object_id": "catalog_object_id4", - "catalog_object_type": "catalog_object_type4", - "state": "SOLD", - "location_id": "location_id6", - "quantity": "quantity8" -} -``` - diff --git a/doc/models/inventory-physical-count.md b/doc/models/inventory-physical-count.md deleted file mode 100644 index 006729c3..00000000 --- a/doc/models/inventory-physical-count.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Inventory Physical Count - -Represents the quantity of an item variation that is physically present -at a specific location, verified by a seller or a seller's employee. For example, -a physical count might come from an employee counting the item variations on -hand or from syncing with an external system. - -## Structure - -`InventoryPhysicalCount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-generated ID for the
[InventoryPhysicalCount](entity:InventoryPhysicalCount).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external
system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogObjectType` | `?string` | Optional | The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked.

The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value.
In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | -| `state` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `quantity` | `?string` | Optional | The number of items affected by the physical count as a decimal string.
The number can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | -| `source` | [`?SourceApplication`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `teamMemberId` | `?string` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `occurredAt` | `?string` | Optional | A client-generated RFC 3339-formatted timestamp that indicates when
the physical count was examined. For physical count updates, the `occurred_at`
timestamp cannot be older than 24 hours or in the future relative to the
time of the request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | -| `createdAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the physical count is received.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "reference_id": "reference_id8", - "catalog_object_id": "catalog_object_id4", - "catalog_object_type": "catalog_object_type4", - "state": "COMPOSED" -} -``` - diff --git a/doc/models/inventory-state.md b/doc/models/inventory-state.md deleted file mode 100644 index a50a2208..00000000 --- a/doc/models/inventory-state.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Inventory State - -Indicates the state of a tracked item quantity in the lifecycle of goods. - -## Enumeration - -`InventoryState` - -## Fields - -| Name | Description | -| --- | --- | -| `CUSTOM` | The related quantity of items are in a custom state. **READ-ONLY**:
the Inventory API cannot move quantities to or from this state. | -| `IN_STOCK` | The related quantity of items are on hand and available for sale. | -| `SOLD` | The related quantity of items were sold as part of an itemized
transaction. Quantities in the `SOLD` state are no longer tracked. | -| `RETURNED_BY_CUSTOMER` | The related quantity of items were returned through the Square Point
of Sale application, but are not yet available for sale. **READ-ONLY**:
the Inventory API cannot move quantities to or from this state. | -| `RESERVED_FOR_SALE` | The related quantity of items are on hand, but not currently
available for sale. **READ-ONLY**: the Inventory API cannot move
quantities to or from this state. | -| `SOLD_ONLINE` | The related quantity of items were sold online. **READ-ONLY**: the
Inventory API cannot move quantities to or from this state. | -| `ORDERED_FROM_VENDOR` | The related quantity of items were ordered from a vendor but not yet
received. **READ-ONLY**: the Inventory API cannot move quantities to or
from this state. | -| `RECEIVED_FROM_VENDOR` | The related quantity of items were received from a vendor but are
not yet available for sale. **READ-ONLY**: the Inventory API cannot move
quantities to or from this state. | -| `IN_TRANSIT_TO` | Replaced by `IN_TRANSIT` to represent quantities
of items that are in transit between locations. | -| `NONE` | A placeholder indicating that the related quantity of items are not
currently tracked in Square. Transferring quantities from the `NONE` state
to a tracked state (e.g., `IN_STOCK`) introduces stock into the system. | -| `WASTE` | The related quantity of items are lost or damaged and cannot be
sold. | -| `UNLINKED_RETURN` | The related quantity of items were returned but not linked to a
previous transaction. Unlinked returns are not tracked in Square.
Transferring a quantity from `UNLINKED_RETURN` to a tracked state (e.g.,
`IN_STOCK`) introduces new stock into the system. | -| `COMPOSED` | The related quantity of items that are part of a composition consisting one or more components. | -| `DECOMPOSED` | The related quantity of items that are part of a component. | -| `SUPPORTED_BY_NEWER_VERSION` | This state is not supported by this version of the Square API. We recommend that you upgrade the client to use the appropriate version of the Square API supporting this state. | -| `IN_TRANSIT` | The related quantity of items are in transit between locations. **READ-ONLY:** the Inventory API cannot currently be used to move quantities to or from this inventory state. | - diff --git a/doc/models/inventory-transfer.md b/doc/models/inventory-transfer.md deleted file mode 100644 index 4e3f7f18..00000000 --- a/doc/models/inventory-transfer.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Inventory Transfer - -Represents the transfer of a quantity of product inventory at a -particular time from one location to another. - -## Structure - -`InventoryTransfer` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID generated by Square for the
`InventoryTransfer`.
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
`InventoryTransfer` to an external system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `state` | [`?string(InventoryState)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `fromLocationId` | `?string` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items was tracked before the transfer.
**Constraints**: *Maximum Length*: `100` | getFromLocationId(): ?string | setFromLocationId(?string fromLocationId): void | -| `toLocationId` | `?string` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items was tracked after the transfer.
**Constraints**: *Maximum Length*: `100` | getToLocationId(): ?string | setToLocationId(?string toLocationId): void | -| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogObjectType` | `?string` | Optional | The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked.

The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value.
In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | -| `quantity` | `?string` | Optional | The number of items affected by the transfer as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | -| `occurredAt` | `?string` | Optional | A client-generated RFC 3339-formatted timestamp that indicates when
the transfer took place. For write actions, the `occurred_at` timestamp
cannot be older than 24 hours or in the future relative to the time of the
request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | -| `createdAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when Square
received the transfer request.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `source` | [`?SourceApplication`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `teamMemberId` | `?string` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "reference_id": "reference_id4", - "state": "ORDERED_FROM_VENDOR", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" -} -``` - diff --git a/doc/models/invoice-accepted-payment-methods.md b/doc/models/invoice-accepted-payment-methods.md deleted file mode 100644 index af0b3a0e..00000000 --- a/doc/models/invoice-accepted-payment-methods.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Invoice Accepted Payment Methods - -The payment methods that customers can use to pay an [invoice](../../doc/models/invoice.md) on the Square-hosted invoice payment page. - -## Structure - -`InvoiceAcceptedPaymentMethods` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `card` | `?bool` | Optional | Indicates whether credit card or debit card payments are accepted. The default value is `false`. | getCard(): ?bool | setCard(?bool card): void | -| `squareGiftCard` | `?bool` | Optional | Indicates whether Square gift card payments are accepted. The default value is `false`. | getSquareGiftCard(): ?bool | setSquareGiftCard(?bool squareGiftCard): void | -| `bankAccount` | `?bool` | Optional | Indicates whether ACH bank transfer payments are accepted. The default value is `false`. | getBankAccount(): ?bool | setBankAccount(?bool bankAccount): void | -| `buyNowPayLater` | `?bool` | Optional | Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is `false`.

This option is allowed only for invoices that have a single payment request of the `BALANCE` type. This payment method is
supported if the seller account accepts Afterpay payments and the seller location is in a country where Afterpay
invoice payments are supported. As a best practice, consider enabling an additional payment method when allowing
`buy_now_pay_later` payments. For more information, including detailed requirements and processing limits, see
[Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later). | getBuyNowPayLater(): ?bool | setBuyNowPayLater(?bool buyNowPayLater): void | -| `cashAppPay` | `?bool` | Optional | Indicates whether Cash App payments are accepted. The default value is `false`.

This payment method is supported only for seller [locations](entity:Location) in the United States. | getCashAppPay(): ?bool | setCashAppPay(?bool cashAppPay): void | - -## Example (as JSON) - -```json -{ - "card": false, - "square_gift_card": false, - "bank_account": false, - "buy_now_pay_later": false, - "cash_app_pay": false -} -``` - diff --git a/doc/models/invoice-attachment.md b/doc/models/invoice-attachment.md deleted file mode 100644 index 054cffd6..00000000 --- a/doc/models/invoice-attachment.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Invoice Attachment - -Represents a file attached to an [invoice](../../doc/models/invoice.md). - -## Structure - -`InvoiceAttachment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the attachment. | getId(): ?string | setId(?string id): void | -| `filename` | `?string` | Optional | The file name of the attachment, which is displayed on the invoice. | getFilename(): ?string | setFilename(?string filename): void | -| `description` | `?string` | Optional | The description of the attachment, which is displayed on the invoice.
This field maps to the seller-defined **Message** field. | getDescription(): ?string | setDescription(?string description): void | -| `filesize` | `?int` | Optional | The file size of the attachment in bytes. | getFilesize(): ?int | setFilesize(?int filesize): void | -| `hash` | `?string` | Optional | The MD5 hash that was generated from the file contents. | getHash(): ?string | setHash(?string hash): void | -| `mimeType` | `?string` | Optional | The mime type of the attachment.
The following mime types are supported:
image/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf. | getMimeType(): ?string | setMimeType(?string mimeType): void | -| `uploadedAt` | `?string` | Optional | The timestamp when the attachment was uploaded, in RFC 3339 format. | getUploadedAt(): ?string | setUploadedAt(?string uploadedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "filename": "filename6", - "description": "description6", - "filesize": 164, - "hash": "hash0" -} -``` - diff --git a/doc/models/invoice-automatic-payment-source.md b/doc/models/invoice-automatic-payment-source.md deleted file mode 100644 index 5f6f256d..00000000 --- a/doc/models/invoice-automatic-payment-source.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Automatic Payment Source - -Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). - -## Enumeration - -`InvoiceAutomaticPaymentSource` - -## Fields - -| Name | Description | -| --- | --- | -| `NONE` | An automatic payment is not configured for the payment request. | -| `CARD_ON_FILE` | Use a card on file as the automatic payment method. On the due date, Square charges the card
for the amount of the payment request.

For `CARD_ON_FILE` payments, the invoice delivery method must be `EMAIL` and `card_id` must be
specified for the payment request before the invoice can be published. | -| `BANK_ON_FILE` | Use a bank account on file as the automatic payment method. On the due date, Square charges the bank
account for the amount of the payment request if the buyer has approved the payment. The buyer receives a
request to approve the payment when the invoice is sent or the invoice is updated.

This payment method applies only to invoices that sellers create in the Seller Dashboard or other
Square product. The bank account is provided by the customer during the payment flow.

You cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`
payment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`. | - diff --git a/doc/models/invoice-custom-field-placement.md b/doc/models/invoice-custom-field-placement.md deleted file mode 100644 index 4d4ceb92..00000000 --- a/doc/models/invoice-custom-field-placement.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Custom Field Placement - -Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF -copies of the invoice. - -## Enumeration - -`InvoiceCustomFieldPlacement` - -## Fields - -| Name | Description | -| --- | --- | -| `ABOVE_LINE_ITEMS` | Render the custom field above the invoice line items. | -| `BELOW_LINE_ITEMS` | Render the custom field below the invoice line items. | - diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md deleted file mode 100644 index ec43068b..00000000 --- a/doc/models/invoice-custom-field.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Invoice Custom Field - -An additional seller-defined and customer-facing field to include on the invoice. For more information, -see [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). - -Adding custom fields to an invoice requires an -[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). - -## Structure - -`InvoiceCustomField` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `label` | `?string` | Optional | The label or title of the custom field. This field is required for a custom field.
**Constraints**: *Maximum Length*: `30` | getLabel(): ?string | setLabel(?string label): void | -| `value` | `?string` | Optional | The text of the custom field. If omitted, only the label is rendered.
**Constraints**: *Maximum Length*: `2000` | getValue(): ?string | setValue(?string value): void | -| `placement` | [`?string(InvoiceCustomFieldPlacement)`](../../doc/models/invoice-custom-field-placement.md) | Optional | Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF
copies of the invoice. | getPlacement(): ?string | setPlacement(?string placement): void | - -## Example (as JSON) - -```json -{ - "label": "label6", - "value": "value8", - "placement": "ABOVE_LINE_ITEMS" -} -``` - diff --git a/doc/models/invoice-delivery-method.md b/doc/models/invoice-delivery-method.md deleted file mode 100644 index 80ade49a..00000000 --- a/doc/models/invoice-delivery-method.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Delivery Method - -Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. - -## Enumeration - -`InvoiceDeliveryMethod` - -## Fields - -| Name | Description | -| --- | --- | -| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email. | -| `SHARE_MANUALLY` | Directs Square to take no action on the invoice. In this case, the seller
or application developer follows up with the customer for payment. For example,
a seller might collect a payment in the Seller Dashboard or Point of Sale (POS) application.
The seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer to request payment. | -| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message).

You cannot set `SMS` as a delivery method using the Invoices API, but you can change an `SMS` delivery method to `EMAIL` or `SHARE_MANUALLY`. | - diff --git a/doc/models/invoice-filter.md b/doc/models/invoice-filter.md deleted file mode 100644 index 0d40ebe0..00000000 --- a/doc/models/invoice-filter.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Invoice Filter - -Describes query filters to apply. - -## Structure - -`InvoiceFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `string[]` | Required | Limits the search to the specified locations. A location is required.
In the current implementation, only one location can be specified. | getLocationIds(): array | setLocationIds(array locationIds): void | -| `customerIds` | `?(string[])` | Optional | Limits the search to the specified customers, within the specified locations.
Specifying a customer is optional. In the current implementation,
a maximum of one customer can be specified. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | - -## Example (as JSON) - -```json -{ - "location_ids": [ - "location_ids0", - "location_ids1", - "location_ids2" - ], - "customer_ids": [ - "customer_ids3", - "customer_ids2" - ] -} -``` - diff --git a/doc/models/invoice-payment-reminder-status.md b/doc/models/invoice-payment-reminder-status.md deleted file mode 100644 index cc78753c..00000000 --- a/doc/models/invoice-payment-reminder-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Payment Reminder Status - -The status of a payment request reminder. - -## Enumeration - -`InvoicePaymentReminderStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The reminder will be sent on the `relative_scheduled_date` (if the invoice is published). | -| `NOT_APPLICABLE` | The reminder is not applicable and is not sent. The following are examples
of when reminders are not applicable and are not sent:

- You schedule a reminder to be sent before the invoice is published.
- The invoice is configured with multiple payment requests and a payment request reminder
is configured to be sent after the next payment request `due_date`.
- Two reminders (for different payment requests) are configured to be sent on the
same date. Therefore, only one reminder is sent.
- You configure a reminder to be sent on the date that the invoice is scheduled to be sent.
- The payment request is already paid.
- The invoice status is `CANCELED` or `FAILED`. | -| `SENT` | The reminder is sent. | - diff --git a/doc/models/invoice-payment-reminder.md b/doc/models/invoice-payment-reminder.md deleted file mode 100644 index 22e9b97e..00000000 --- a/doc/models/invoice-payment-reminder.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Invoice Payment Reminder - -Describes a payment request reminder (automatic notification) that Square sends -to the customer. You configure a reminder relative to the payment request -`due_date`. - -## Structure - -`InvoicePaymentReminder` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A Square-assigned ID that uniquely identifies the reminder within the
`InvoicePaymentRequest`. | getUid(): ?string | setUid(?string uid): void | -| `relativeScheduledDays` | `?int` | Optional | The number of days before (a negative number) or after (a positive number)
the payment request `due_date` when the reminder is sent. For example, -3 indicates that
the reminder should be sent 3 days before the payment request `due_date`.
**Constraints**: `>= -32767`, `<= 32767` | getRelativeScheduledDays(): ?int | setRelativeScheduledDays(?int relativeScheduledDays): void | -| `message` | `?string` | Optional | The reminder message.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | getMessage(): ?string | setMessage(?string message): void | -| `status` | [`?string(InvoicePaymentReminderStatus)`](../../doc/models/invoice-payment-reminder-status.md) | Optional | The status of a payment request reminder. | getStatus(): ?string | setStatus(?string status): void | -| `sentAt` | `?string` | Optional | If sent, the timestamp when the reminder was sent, in RFC 3339 format. | getSentAt(): ?string | setSentAt(?string sentAt): void | - -## Example (as JSON) - -```json -{ - "uid": "uid6", - "relative_scheduled_days": 198, - "message": "message4", - "status": "SENT", - "sent_at": "sent_at6" -} -``` - diff --git a/doc/models/invoice-payment-request.md b/doc/models/invoice-payment-request.md deleted file mode 100644 index 7c8a13d1..00000000 --- a/doc/models/invoice-payment-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Invoice Payment Request - -Represents a payment request for an [invoice](../../doc/models/invoice.md). Invoices can specify a maximum -of 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, -see [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). - -Adding `INSTALLMENT` payment requests to an invoice requires an -[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). - -## Structure - -`InvoicePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | The Square-generated ID of the payment request in an [invoice](entity:Invoice).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getUid(): ?string | setUid(?string uid): void | -| `requestMethod` | [`?string(InvoiceRequestMethod)`](../../doc/models/invoice-request-method.md) | Optional | Specifies the action for Square to take for processing the invoice. For example,
email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at
version 2021-01-21. The corresponding `request_method` field is replaced by the
`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. | getRequestMethod(): ?string | setRequestMethod(?string requestMethod): void | -| `requestType` | [`?string(InvoiceRequestType)`](../../doc/models/invoice-request-type.md) | Optional | Indicates the type of the payment request. For more information, see
[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). | getRequestType(): ?string | setRequestType(?string requestType): void | -| `dueDate` | `?string` | Optional | The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field
is required to create a payment request. If an `automatic_payment_source` is defined for the request, Square
charges the payment source on this date.

After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone`
of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC
timestamp of 2021-03-10T08:00:00Z). | getDueDate(): ?string | setDueDate(?string dueDate): void | -| `fixedAmountRequestedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getFixedAmountRequestedMoney(): ?Money | setFixedAmountRequestedMoney(?Money fixedAmountRequestedMoney): void | -| `percentageRequested` | `?string` | Optional | Specifies the amount for the payment request in percentage:

- When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount.
- When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less
the deposit, if requested. The sum of the `percentage_requested` in all installment
payment requests must be equal to 100.

You cannot specify this when the payment `request_type` is `BALANCE` or when the
payment request specifies the `fixed_amount_requested_money` field. | getPercentageRequested(): ?string | setPercentageRequested(?string percentageRequested): void | -| `tippingEnabled` | `?bool` | Optional | If set to true, the Square-hosted invoice page (the `public_url` field of the invoice)
provides a place for the customer to pay a tip.

This field is allowed only on the final payment request
and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. | getTippingEnabled(): ?bool | setTippingEnabled(?bool tippingEnabled): void | -| `automaticPaymentSource` | [`?string(InvoiceAutomaticPaymentSource)`](../../doc/models/invoice-automatic-payment-source.md) | Optional | Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). | getAutomaticPaymentSource(): ?string | setAutomaticPaymentSource(?string automaticPaymentSource): void | -| `cardId` | `?string` | Optional | The ID of the credit or debit card on file to charge for the payment request. To get the cards on file for a customer,
call [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice recipient.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getCardId(): ?string | setCardId(?string cardId): void | -| `reminders` | [`?(InvoicePaymentReminder[])`](../../doc/models/invoice-payment-reminder.md) | Optional | A list of one or more reminders to send for the payment request. | getReminders(): ?array | setReminders(?array reminders): void | -| `computedAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getComputedAmountMoney(): ?Money | setComputedAmountMoney(?Money computedAmountMoney): void | -| `totalCompletedAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalCompletedAmountMoney(): ?Money | setTotalCompletedAmountMoney(?Money totalCompletedAmountMoney): void | -| `roundingAdjustmentIncludedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getRoundingAdjustmentIncludedMoney(): ?Money | setRoundingAdjustmentIncludedMoney(?Money roundingAdjustmentIncludedMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "request_method": "SHARE_MANUALLY", - "request_type": "DEPOSIT", - "due_date": "due_date8", - "fixed_amount_requested_money": { - "amount": 162, - "currency": "JOD" - } -} -``` - diff --git a/doc/models/invoice-query.md b/doc/models/invoice-query.md deleted file mode 100644 index fc460cf7..00000000 --- a/doc/models/invoice-query.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Invoice Query - -Describes query criteria for searching invoices. - -## Structure - -`InvoiceQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`InvoiceFilter`](../../doc/models/invoice-filter.md) | Required | Describes query filters to apply. | getFilter(): InvoiceFilter | setFilter(InvoiceFilter filter): void | -| `sort` | [`?InvoiceSort`](../../doc/models/invoice-sort.md) | Optional | Identifies the sort field and sort order. | getSort(): ?InvoiceSort | setSort(?InvoiceSort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "location_ids": [ - "location_ids4" - ], - "customer_ids": [ - "customer_ids3", - "customer_ids2" - ] - }, - "sort": { - "field": "field2", - "order": "DESC" - } -} -``` - diff --git a/doc/models/invoice-recipient-tax-ids.md b/doc/models/invoice-recipient-tax-ids.md deleted file mode 100644 index 3349a78a..00000000 --- a/doc/models/invoice-recipient-tax-ids.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Invoice Recipient Tax Ids - -Represents the tax IDs for an invoice recipient. The country of the seller account determines -whether the corresponding `tax_ids` field is available for the customer. For more information, -see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). - -## Structure - -`InvoiceRecipientTaxIds` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `euVat` | `?string` | Optional | The EU VAT identification number for the invoice recipient. For example, `IE3426675K`. | getEuVat(): ?string | setEuVat(?string euVat): void | - -## Example (as JSON) - -```json -{ - "eu_vat": "eu_vat8" -} -``` - diff --git a/doc/models/invoice-recipient.md b/doc/models/invoice-recipient.md deleted file mode 100644 index 75cf6382..00000000 --- a/doc/models/invoice-recipient.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Invoice Recipient - -Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice -and that Square uses to deliver the invoice. - -When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates -the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published. -Square updates the customer ID in response to a merge operation, but does not update other fields. - -## Structure - -`InvoiceRecipient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `?string` | Optional | The ID of the customer. This is the customer profile ID that
you provide when creating a draft invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `givenName` | `?string` | Optional | The recipient's given (that is, first) name. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The recipient's family (that is, last) name. | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `emailAddress` | `?string` | Optional | The recipient's email address. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The recipient's phone number. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `companyName` | `?string` | Optional | The name of the recipient's company. | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `taxIds` | [`?InvoiceRecipientTaxIds`](../../doc/models/invoice-recipient-tax-ids.md) | Optional | Represents the tax IDs for an invoice recipient. The country of the seller account determines
whether the corresponding `tax_ids` field is available for the customer. For more information,
see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). | getTaxIds(): ?InvoiceRecipientTaxIds | setTaxIds(?InvoiceRecipientTaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id8", - "given_name": "given_name2", - "family_name": "family_name4", - "email_address": "email_address8", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } -} -``` - diff --git a/doc/models/invoice-request-method.md b/doc/models/invoice-request-method.md deleted file mode 100644 index 412d716b..00000000 --- a/doc/models/invoice-request-method.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Invoice Request Method - -Specifies the action for Square to take for processing the invoice. For example, -email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at -version 2021-01-21. The corresponding `request_method` field is replaced by the -`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. - -## Enumeration - -`InvoiceRequestMethod` - -## Fields - -| Name | Description | -| --- | --- | -| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email.
Square sends the invoice after it is published (either immediately or at the `scheduled_at`
time, if specified in the [invoice](entity:Invoice)). | -| `CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request
and to use email to send invoices, reminders, and receipts. | -| `SHARE_MANUALLY` | Directs Square to take no specific action on the invoice. In this case, the seller
(or the application developer) follows up with the customer for payment. For example,
a seller might collect a payment in the Seller Dashboard or use the Point of Sale (POS) application.
The seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer requesting payment. | -| `CHARGE_BANK_ON_FILE` | Directs Square to charge the customer's bank account on file and to use email to send invoices, reminders, and receipts.
The customer must approve the payment.

The bank on file payment method applies only to invoices that sellers create in the Seller Dashboard or other
Square product. The bank account is provided by the customer during the payment flow. You
cannot set `CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | -| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice
after it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](entity:Invoice)).

You cannot set `SMS` as a request method using the Invoices API. | -| `SMS_CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request and to
use SMS (text message) to send invoices and receipts.

You cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API. | -| `SMS_CHARGE_BANK_ON_FILE` | Directs Square to charge the customer's bank account on file and to use SMS (text message) to send invoices and receipts.
The customer must approve the payment.

The bank on file payment method applies only to invoices that sellers create in the Seller Dashboard
or other Square product. The bank account is provided by the customer during the payment flow.
You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | - diff --git a/doc/models/invoice-request-type.md b/doc/models/invoice-request-type.md deleted file mode 100644 index 2f9a9e88..00000000 --- a/doc/models/invoice-request-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Invoice Request Type - -Indicates the type of the payment request. For more information, see -[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). - -## Enumeration - -`InvoiceRequestType` - -## Fields - -| Name | Description | -| --- | --- | -| `BALANCE` | A request for a balance payment. The balance amount is computed as follows:

- If the invoice specifies only a balance payment request, the balance amount is the
total amount of the associated order.
- If the invoice also specifies a deposit request, the balance amount is the amount
remaining after the deposit.

`INSTALLMENT` and `BALANCE` payment requests are not allowed in the same invoice. | -| `DEPOSIT` | A request for a deposit payment. You have the option of specifying
an exact amount or a percentage of the total order amount. If you request a deposit,
it must be due before any other payment requests. | -| `INSTALLMENT` | A request for an installment payment. Installments allow buyers to pay the invoice over time. Installments can optionally be combined with a deposit.

Adding `INSTALLMENT` payment requests to an invoice requires an
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). | - diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md deleted file mode 100644 index 6e3bbf54..00000000 --- a/doc/models/invoice-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Invoice Sort Field - -The field to use for sorting. - -## Enumeration - -`InvoiceSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `INVOICE_SORT_DATE` | The field works as follows:

- If the invoice is a draft, it uses the invoice `created_at` date.
- If the invoice is scheduled for publication, it uses the `scheduled_at` date.
- If the invoice is published, it uses the invoice publication date. | - diff --git a/doc/models/invoice-sort.md b/doc/models/invoice-sort.md deleted file mode 100644 index a29ba9aa..00000000 --- a/doc/models/invoice-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Invoice Sort - -Identifies the sort field and sort order. - -## Structure - -`InvoiceSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `field` | `string` | Required, Constant | The field to use for sorting.
**Default**: `'INVOICE_SORT_DATE'` | getField(): string | setField(string field): void | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | - -## Example (as JSON) - -```json -{ - "field": "INVOICE_SORT_DATE", - "order": "DESC" -} -``` - diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md deleted file mode 100644 index ec13bb97..00000000 --- a/doc/models/invoice-status.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Invoice Status - -Indicates the status of an invoice. - -## Enumeration - -`InvoiceStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `DRAFT` | The invoice is a draft. You must publish a draft invoice before Square can process it.
A draft invoice has no `public_url`, so it is not available to customers. | -| `UNPAID` | The invoice is published but not yet paid. | -| `SCHEDULED` | The invoice is scheduled to be processed. On the scheduled date,
Square sends the invoice, initiates an automatic payment, or takes no action, depending on
the delivery method and payment request settings. Square also sets the invoice status to the
appropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. | -| `PARTIALLY_PAID` | A partial payment is received for the invoice. | -| `PAID` | The customer paid the invoice in full. | -| `PARTIALLY_REFUNDED` | The invoice is paid (or partially paid) and some but not all the amount paid is
refunded. | -| `REFUNDED` | The full amount that the customer paid for the invoice is refunded. | -| `CANCELED` | The invoice is canceled. Square no longer requests payments from the customer.
The `public_url` page remains and is accessible, but it displays the invoice
as canceled and does not accept payment. | -| `FAILED` | Square canceled the invoice due to suspicious activity. | -| `PAYMENT_PENDING` | A payment on the invoice was initiated but has not yet been processed.

When in this state, invoices cannot be updated and other payments cannot be initiated. | - diff --git a/doc/models/invoice.md b/doc/models/invoice.md deleted file mode 100644 index e2844f7c..00000000 --- a/doc/models/invoice.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Invoice - -Stores information about an invoice. You use the Invoices API to create and manage -invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). - -## Structure - -`Invoice` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the invoice. | getId(): ?string | setId(?string id): void | -| `version` | `?int` | Optional | The Square-assigned version number, which is incremented each time an update is committed to the invoice. | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The ID of the location that this invoice is associated with.

If specified in a `CreateInvoice` request, the value must match the `location_id` of the associated order.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `orderId` | `?string` | Optional | The ID of the [order](entity:Order) for which the invoice is created.
This field is required when creating an invoice, and the order must be in the `OPEN` state.

To view the line items and other information for the associated order, call the
[RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getOrderId(): ?string | setOrderId(?string orderId): void | -| `primaryRecipient` | [`?InvoiceRecipient`](../../doc/models/invoice-recipient.md) | Optional | Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice
and that Square uses to deliver the invoice.

When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates
the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published.
Square updates the customer ID in response to a merge operation, but does not update other fields. | getPrimaryRecipient(): ?InvoiceRecipient | setPrimaryRecipient(?InvoiceRecipient primaryRecipient): void | -| `paymentRequests` | [`?(InvoicePaymentRequest[])`](../../doc/models/invoice-payment-request.md) | Optional | The payment schedule for the invoice, represented by one or more payment requests that
define payment settings, such as amount due and due date. An invoice supports the following payment request combinations:

- One balance
- One deposit with one balance
- 2–12 installments
- One deposit with 2–12 installments

This field is required when creating an invoice. It must contain at least one payment request.
All payment requests for the invoice must equal the total order amount. For more information, see
[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).

Adding `INSTALLMENT` payment requests to an invoice requires an
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). | getPaymentRequests(): ?array | setPaymentRequests(?array paymentRequests): void | -| `deliveryMethod` | [`?string(InvoiceDeliveryMethod)`](../../doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. | getDeliveryMethod(): ?string | setDeliveryMethod(?string deliveryMethod): void | -| `invoiceNumber` | `?string` | Optional | A user-friendly invoice number that is displayed on the invoice. The value is unique within a location.
If not provided when creating an invoice, Square assigns a value.
It increments from 1 and is padded with zeros making it 7 characters long
(for example, 0000001 and 0000002).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getInvoiceNumber(): ?string | setInvoiceNumber(?string invoiceNumber): void | -| `title` | `?string` | Optional | The title of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getTitle(): ?string | setTitle(?string title): void | -| `description` | `?string` | Optional | The description of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65536` | getDescription(): ?string | setDescription(?string description): void | -| `scheduledAt` | `?string` | Optional | The timestamp when the invoice is scheduled for processing, in RFC 3339 format.
After the invoice is published, Square processes the invoice on the specified date,
according to the delivery method and payment request settings.

If the field is not set, Square processes the invoice immediately after it is published. | getScheduledAt(): ?string | setScheduledAt(?string scheduledAt): void | -| `publicUrl` | `?string` | Optional | The URL of the Square-hosted invoice page.
After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice
page and returns the page URL in the response. | getPublicUrl(): ?string | setPublicUrl(?string publicUrl): void | -| `nextPaymentAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getNextPaymentAmountMoney(): ?Money | setNextPaymentAmountMoney(?Money nextPaymentAmountMoney): void | -| `status` | [`?string(InvoiceStatus)`](../../doc/models/invoice-status.md) | Optional | Indicates the status of an invoice. | getStatus(): ?string | setStatus(?string status): void | -| `timezone` | `?string` | Optional | The time zone used to interpret calendar dates on the invoice, such as `due_date`.
When an invoice is created, this field is set to the `timezone` specified for the seller
location. The value cannot be changed.

For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles
becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp
of 2021-03-10T08:00:00Z). | getTimezone(): ?string | setTimezone(?string timezone): void | -| `createdAt` | `?string` | Optional | The timestamp when the invoice was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the invoice was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `acceptedPaymentMethods` | [`?InvoiceAcceptedPaymentMethods`](../../doc/models/invoice-accepted-payment-methods.md) | Optional | The payment methods that customers can use to pay an [invoice](../../doc/models/invoice.md) on the Square-hosted invoice payment page. | getAcceptedPaymentMethods(): ?InvoiceAcceptedPaymentMethods | setAcceptedPaymentMethods(?InvoiceAcceptedPaymentMethods acceptedPaymentMethods): void | -| `customFields` | [`?(InvoiceCustomField[])`](../../doc/models/invoice-custom-field.md) | Optional | Additional seller-defined fields that are displayed on the invoice. For more information, see
[Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).

Adding custom fields to an invoice requires an
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).

Max: 2 custom fields | getCustomFields(): ?array | setCustomFields(?array customFields): void | -| `subscriptionId` | `?string` | Optional | The ID of the [subscription](entity:Subscription) associated with the invoice.
This field is present only on subscription billing invoices. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void | -| `saleOrServiceDate` | `?string` | Optional | The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format.
This field can be used to specify a past or future date which is displayed on the invoice. | getSaleOrServiceDate(): ?string | setSaleOrServiceDate(?string saleOrServiceDate): void | -| `paymentConditions` | `?string` | Optional | **France only.** The payment terms and conditions that are displayed on the invoice. For more information,
see [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions).

For countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and
"Payment conditions are not supported for this location's country" detail if this field is included in `CreateInvoice` or `UpdateInvoice` requests.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | getPaymentConditions(): ?string | setPaymentConditions(?string paymentConditions): void | -| `storePaymentMethodEnabled` | `?bool` | Optional | Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank transfer as a
bank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on file__ checkbox on the
invoice payment page. Stored payment information can be used for future automatic payments. The default value is `false`. | getStorePaymentMethodEnabled(): ?bool | setStorePaymentMethodEnabled(?bool storePaymentMethodEnabled): void | -| `attachments` | [`?(InvoiceAttachment[])`](../../doc/models/invoice-attachment.md) | Optional | Metadata about the attachments on the invoice. Invoice attachments are managed using the
[CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints. | getAttachments(): ?array | setAttachments(?array attachments): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "version": 224, - "location_id": "location_id4", - "order_id": "order_id4", - "primary_recipient": { - "customer_id": "customer_id2", - "given_name": "given_name6", - "family_name": "family_name8", - "email_address": "email_address2", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } -} -``` - diff --git a/doc/models/item-variation-location-overrides.md b/doc/models/item-variation-location-overrides.md deleted file mode 100644 index f2342b6d..00000000 --- a/doc/models/item-variation-location-overrides.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Item Variation Location Overrides - -Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. - -## Structure - -`ItemVariationLocationOverrides` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the `Location`. This can include locations that are deactivated. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `priceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | -| `pricingType` | [`?string(CatalogPricingType)`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | getPricingType(): ?string | setPricingType(?string pricingType): void | -| `trackInventory` | `?bool` | Optional | If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. | getTrackInventory(): ?bool | setTrackInventory(?bool trackInventory): void | -| `inventoryAlertType` | [`?string(InventoryAlertType)`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | getInventoryAlertType(): ?string | setInventoryAlertType(?string inventoryAlertType): void | -| `inventoryAlertThreshold` | `?int` | Optional | If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`
is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.

This value is always an integer. | getInventoryAlertThreshold(): ?int | setInventoryAlertThreshold(?int inventoryAlertThreshold): void | -| `soldOut` | `?bool` | Optional | Indicates whether the overridden item variation is sold out at the specified location.

When inventory tracking is enabled on the item variation either globally or at the specified location,
the item variation is automatically marked as sold out when its inventory count reaches zero. The seller
can manually set the item variation as sold out even when the inventory count is greater than zero.
Attempts by an application to set this attribute are ignored. Regardless how the sold-out status is set,
applications should treat its inventory count as zero when this attribute value is `true`. | getSoldOut(): ?bool | setSoldOut(?bool soldOut): void | -| `soldOutValidUntil` | `?string` | Optional | The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation
becomes available again at the specified location. Attempts by an application to set this attribute are ignored.
When the current time is later than this attribute value, the affected item variation is no longer sold out. | getSoldOutValidUntil(): ?string | setSoldOutValidUntil(?string soldOutValidUntil): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id6", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "pricing_type": "FIXED_PRICING", - "track_inventory": false, - "inventory_alert_type": "NONE" -} -``` - diff --git a/doc/models/job-assignment-pay-type.md b/doc/models/job-assignment-pay-type.md deleted file mode 100644 index f093e47e..00000000 --- a/doc/models/job-assignment-pay-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Job Assignment Pay Type - -Enumerates the possible pay types that a job can be assigned. - -## Enumeration - -`JobAssignmentPayType` - -## Fields - -| Name | Description | -| --- | --- | -| `NONE` | The job does not have a defined pay type. | -| `HOURLY` | The job pays an hourly rate. | -| `SALARY` | The job pays an annual salary. | - diff --git a/doc/models/job-assignment.md b/doc/models/job-assignment.md deleted file mode 100644 index 00672aab..00000000 --- a/doc/models/job-assignment.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Job Assignment - -Represents a job assigned to a [team member](../../doc/models/team-member.md), including the compensation the team -member earns for the job. Job assignments are listed in the team member's [wage setting](../../doc/models/wage-setting.md). - -## Structure - -`JobAssignment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `jobTitle` | `?string` | Optional | The title of the job. | getJobTitle(): ?string | setJobTitle(?string jobTitle): void | -| `payType` | [`string(JobAssignmentPayType)`](../../doc/models/job-assignment-pay-type.md) | Required | Enumerates the possible pay types that a job can be assigned. | getPayType(): string | setPayType(string payType): void | -| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | -| `annualRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAnnualRate(): ?Money | setAnnualRate(?Money annualRate): void | -| `weeklyHours` | `?int` | Optional | The planned hours per week for the job. Set if the job `PayType` is `SALARY`. | getWeeklyHours(): ?int | setWeeklyHours(?int weeklyHours): void | -| `jobId` | `?string` | Optional | The ID of the [job](../../doc/models/job.md). | getJobId(): ?string | setJobId(?string jobId): void | - -## Example (as JSON) - -```json -{ - "job_title": "job_title6", - "pay_type": "NONE", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 120, - "job_id": "job_id8" -} -``` - diff --git a/doc/models/job.md b/doc/models/job.md deleted file mode 100644 index 06f712f5..00000000 --- a/doc/models/job.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Job - -Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the -job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md) -in a team member's wage setting. - -## Structure - -`Job` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | **Read only** The unique Square-assigned ID of the job. If you need a job ID for an API request,
call [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned when you created the job.
You can also get job IDs from a team member's wage setting. | getId(): ?string | setId(?string id): void | -| `title` | `?string` | Optional | The title of the job.
**Constraints**: *Maximum Length*: `150` | getTitle(): ?string | setTitle(?string title): void | -| `isTipEligible` | `?bool` | Optional | Indicates whether team members can earn tips for the job. | getIsTipEligible(): ?bool | setIsTipEligible(?bool isTipEligible): void | -| `createdAt` | `?string` | Optional | The timestamp when the job was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the job was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `version` | `?int` | Optional | **Read only** The current version of the job. Include this field in `UpdateJob` requests to enable
[optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)
control and avoid overwrites from concurrent requests. Requests fail if the provided version doesn't
match the server version at the time of the request. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "title": "title2", - "is_tip_eligible": false, - "created_at": "created_at4", - "updated_at": "updated_at2" -} -``` - diff --git a/doc/models/link-customer-to-gift-card-request.md b/doc/models/link-customer-to-gift-card-request.md deleted file mode 100644 index 4d5e9619..00000000 --- a/doc/models/link-customer-to-gift-card-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Link Customer to Gift Card Request - -A request to link a customer to a gift card. - -## Structure - -`LinkCustomerToGiftCardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `string` | Required | The ID of the customer to link to the gift card.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getCustomerId(): string | setCustomerId(string customerId): void | - -## Example (as JSON) - -```json -{ - "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" -} -``` - diff --git a/doc/models/link-customer-to-gift-card-response.md b/doc/models/link-customer-to-gift-card-response.md deleted file mode 100644 index c9f1da05..00000000 --- a/doc/models/link-customer-to-gift-card-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Link Customer to Gift Card Response - -A response that contains the linked `GiftCard` object. If the request resulted in errors, -the response contains a set of `Error` objects. - -## Structure - -`LinkCustomerToGiftCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 2500, - "currency": "USD" - }, - "created_at": "2021-03-25T05:13:01Z", - "customer_ids": [ - "GKY0FZ3V717AH8Q2D821PNT2ZW" - ], - "gan": "7783320005440920", - "gan_source": "SQUARE", - "id": "gftc:71ea002277a34f8a945e284b04822edb", - "state": "ACTIVE", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-bank-accounts-request.md b/doc/models/list-bank-accounts-request.md deleted file mode 100644 index 1bb6338e..00000000 --- a/doc/models/list-bank-accounts-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# List Bank Accounts Request - -Request object for fetching all `BankAccount` -objects linked to a account. - -## Structure - -`ListBankAccountsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | The pagination cursor returned by a previous call to this endpoint.
Use it in the next `ListBankAccounts` request to retrieve the next set
of results.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | Upper limit on the number of bank accounts to return in the response.
Currently, 1000 is the largest supported limit. You can specify a limit
of up to 1000 bank accounts. This is also the default limit. | getLimit(): ?int | setLimit(?int limit): void | -| `locationId` | `?string` | Optional | Location ID. You can specify this optional filter
to retrieve only the linked bank accounts belonging to a specific location. | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor8", - "limit": 182, - "location_id": "location_id2" -} -``` - diff --git a/doc/models/list-bank-accounts-response.md b/doc/models/list-bank-accounts-response.md deleted file mode 100644 index 4e851330..00000000 --- a/doc/models/list-bank-accounts-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# List Bank Accounts Response - -Response object returned by ListBankAccounts. - -## Structure - -`ListBankAccountsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `bankAccounts` | [`?(BankAccount[])`](../../doc/models/bank-account.md) | Optional | List of BankAccounts associated with this account. | getBankAccounts(): ?array | setBankAccounts(?array bankAccounts): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can
use in a subsequent request to fetch next set of bank accounts.
If empty, this is the final response.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "bank_accounts": [ - { - "account_number_suffix": "971", - "account_type": "CHECKING", - "bank_name": "Bank Name", - "country": "US", - "creditable": false, - "currency": "USD", - "debitable": false, - "holder_name": "Jane Doe", - "id": "ao6iaQ9vhDiaQD7n3GB", - "location_id": "S8GWD5example", - "primary_bank_identification_number": "112200303", - "status": "VERIFICATION_IN_PROGRESS", - "version": 5, - "secondary_bank_identification_number": "secondary_bank_identification_number0", - "debit_mandate_reference_id": "debit_mandate_reference_id4", - "reference_id": "reference_id8", - "fingerprint": "fingerprint6" - }, - { - "account_number_suffix": "972", - "account_type": "CHECKING", - "bank_name": "Bank Name", - "country": "US", - "creditable": false, - "currency": "USD", - "debitable": false, - "holder_name": "Jane Doe", - "id": "4x7WXuaxrkQkVlka3GB", - "location_id": "S8GWD5example", - "primary_bank_identification_number": "112200303", - "status": "VERIFICATION_IN_PROGRESS", - "version": 5, - "secondary_bank_identification_number": "secondary_bank_identification_number0", - "debit_mandate_reference_id": "debit_mandate_reference_id4", - "reference_id": "reference_id8", - "fingerprint": "fingerprint6" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/list-booking-custom-attribute-definitions-request.md b/doc/models/list-booking-custom-attribute-definitions-request.md deleted file mode 100644 index 8ff58be5..00000000 --- a/doc/models/list-booking-custom-attribute-definitions-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Booking Custom Attribute Definitions Request - -Represents a [ListBookingCustomAttributeDefinitions](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attribute-definitions) request. - -## Structure - -`ListBookingCustomAttributeDefinitionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 98, - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-booking-custom-attribute-definitions-response.md b/doc/models/list-booking-custom-attribute-definitions-response.md deleted file mode 100644 index a87e3628..00000000 --- a/doc/models/list-booking-custom-attribute-definitions-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# List Booking Custom Attribute Definitions Response - -Represents a [ListBookingCustomAttributeDefinitions](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attribute-definitions) response. -Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. -If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. - -## Structure - -`ListBookingCustomAttributeDefinitionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitions` | [`?(CustomAttributeDefinition[])`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | getCustomAttributeDefinitions(): ?array | setCustomAttributeDefinitions(?array customAttributeDefinitions): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of
results for your original request. This field is present only if the request succeeded and
additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - "custom_attribute_definitions": [ - { - "created_at": "2022-11-16T15:27:30Z", - "description": "Update the description as desired.", - "key": "favoriteShampoo", - "name": "Favorite shampoo", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T15:39:38Z", - "version": 3, - "visibility": "VISIBILITY_READ_ONLY" - }, - { - "created_at": "2022-11-16T15:49:05Z", - "description": "Number of people in the party for dine-in", - "key": "partySize", - "name": "Party size", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T15:49:05Z", - "version": 1, - "visibility": "VISIBILITY_HIDDEN" - } - ], - "errors": [] -} -``` - diff --git a/doc/models/list-booking-custom-attributes-request.md b/doc/models/list-booking-custom-attributes-request.md deleted file mode 100644 index 168db910..00000000 --- a/doc/models/list-booking-custom-attributes-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Booking Custom Attributes Request - -Represents a [ListBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attributes) request. - -## Structure - -`ListBookingCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `withDefinitions` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinitions(): ?bool | setWithDefinitions(?bool withDefinitions): void | - -## Example (as JSON) - -```json -{ - "limit": 254, - "cursor": "cursor8", - "with_definitions": false -} -``` - diff --git a/doc/models/list-booking-custom-attributes-response.md b/doc/models/list-booking-custom-attributes-response.md deleted file mode 100644 index 97c942df..00000000 --- a/doc/models/list-booking-custom-attributes-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# List Booking Custom Attributes Response - -Represents a [ListBookingCustomAttributes](../../doc/apis/booking-custom-attributes.md#list-booking-custom-attributes) response. -Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional -results are available, the `cursor` field is also present along with `custom_attributes`. - -## Structure - -`ListBookingCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributes` | [`?(CustomAttribute[])`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If `with_definitions` was set to `true` in the request,
the custom attribute definition is returned in the `definition` field of each custom attribute.

If no custom attributes are found, Square returns an empty object (`{}`). | getCustomAttributes(): ?array | setCustomAttributes(?array customAttributes): void | -| `cursor` | `?string` | Optional | The cursor to use in your next call to this endpoint to retrieve the next page of results
for your original request. This field is present only if the request succeeded and additional
results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attributes": [ - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - } - ], - "cursor": "cursor0", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-bookings-request.md b/doc/models/list-bookings-request.md deleted file mode 100644 index 3be09a71..00000000 --- a/doc/models/list-bookings-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Bookings Request - -## Structure - -`ListBookingsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results per page to return in a paged response.
**Constraints**: `>= 1`, `<= 10000` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.
**Constraints**: *Maximum Length*: `65536` | getCursor(): ?string | setCursor(?string cursor): void | -| `customerId` | `?string` | Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved.
**Constraints**: *Maximum Length*: `192` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `teamMemberId` | `?string` | Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved.
**Constraints**: *Maximum Length*: `32` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `locationId` | `?string` | Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved.
**Constraints**: *Maximum Length*: `32` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `startAtMin` | `?string` | Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | getStartAtMin(): ?string | setStartAtMin(?string startAtMin): void | -| `startAtMax` | `?string` | Optional | The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. | getStartAtMax(): ?string | setStartAtMax(?string startAtMax): void | - -## Example (as JSON) - -```json -{ - "limit": 34, - "cursor": "cursor4", - "customer_id": "customer_id0", - "team_member_id": "team_member_id2", - "location_id": "location_id6" -} -``` - diff --git a/doc/models/list-bookings-response.md b/doc/models/list-bookings-response.md deleted file mode 100644 index 72f9f711..00000000 --- a/doc/models/list-bookings-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Bookings Response - -## Structure - -`ListBookingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookings` | [`?(Booking[])`](../../doc/models/booking.md) | Optional | The list of targeted bookings. | getBookings(): ?array | setBookings(?array bookings): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.
**Constraints**: *Maximum Length*: `65536` | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "bookings": [ - { - "id": "id4", - "version": 218, - "status": "ACCEPTED", - "created_at": "created_at2", - "updated_at": "updated_at0" - } - ], - "cursor": "cursor6", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-break-types-request.md b/doc/models/list-break-types-request.md deleted file mode 100644 index bc0e3534..00000000 --- a/doc/models/list-break-types-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Break Types Request - -A request for a filtered set of `BreakType` objects. - -## Structure - -`ListBreakTypesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `limit` | `?int` | Optional | The maximum number of `BreakType` results to return per page. The number can range between 1
and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pointer to the next page of `BreakType` results to fetch. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id6", - "limit": 244, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/list-break-types-response.md b/doc/models/list-break-types-response.md deleted file mode 100644 index cf61221b..00000000 --- a/doc/models/list-break-types-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# List Break Types Response - -The response to a request for a set of `BreakType` objects. The response contains -the requested `BreakType` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`ListBreakTypesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `breakTypes` | [`?(BreakType[])`](../../doc/models/break-type.md) | Optional | A page of `BreakType` results. | getBreakTypes(): ?array | setBreakTypes(?array breakTypes): void | -| `cursor` | `?string` | Optional | The value supplied in the subsequent request to fetch the next page
of `BreakType` results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "break_types": [ - { - "break_name": "Coffee Break", - "created_at": "2019-01-22T20:47:37Z", - "expected_duration": "PT5M", - "id": "REGS1EQR1TPZ5", - "is_paid": false, - "location_id": "PAA1RJZZKXBFG", - "updated_at": "2019-01-22T20:47:37Z", - "version": 1 - }, - { - "break_name": "Lunch Break", - "created_at": "2019-01-25T19:26:30Z", - "expected_duration": "PT1H", - "id": "92EPDRQKJ5088", - "is_paid": true, - "location_id": "PAA1RJZZKXBFG", - "updated_at": "2019-01-25T19:26:30Z", - "version": 3 - } - ], - "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-cards-request.md b/doc/models/list-cards-request.md deleted file mode 100644 index 1a858185..00000000 --- a/doc/models/list-cards-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Cards Request - -Retrieves details for a specific Card. Accessible via -HTTP requests at GET https://connect.squareup.com/v2/cards - -## Structure - -`ListCardsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.
**Constraints**: *Maximum Length*: `256` | getCursor(): ?string | setCursor(?string cursor): void | -| `customerId` | `?string` | Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `includeDisabled` | `?bool` | Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned. | getIncludeDisabled(): ?bool | setIncludeDisabled(?bool includeDisabled): void | -| `referenceId` | `?string` | Optional | Limit results to cards associated with the reference_id supplied. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor6", - "customer_id": "customer_id8", - "include_disabled": false, - "reference_id": "reference_id8", - "sort_order": "DESC" -} -``` - diff --git a/doc/models/list-cards-response.md b/doc/models/list-cards-response.md deleted file mode 100644 index 09e32e2c..00000000 --- a/doc/models/list-cards-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# List Cards Response - -Defines the fields that are included in the response body of -a request to the [ListCards](../../doc/apis/cards.md#list-cards) endpoint. - -Note: if there are errors processing the request, the card field will not be -present. - -## Structure - -`ListCardsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cards` | [`?(Card[])`](../../doc/models/card.md) | Optional | The requested list of `Card`s. | getCards(): ?array | setCards(?array cards): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cards": [ - { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "bin": "411111", - "card_brand": "VISA", - "card_type": "CREDIT", - "cardholder_name": "Amelia Earhart", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", - "enabled": true, - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - "id": "ccof:uIbfJXhXETSP197M3GB", - "last_4": "1111", - "merchant_id": "6SSW7HV8K2ST5", - "prepaid_type": "NOT_PREPAID", - "reference_id": "user-id-1", - "version": 1 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-cash-drawer-shift-events-request.md b/doc/models/list-cash-drawer-shift-events-request.md deleted file mode 100644 index e8121d2c..00000000 --- a/doc/models/list-cash-drawer-shift-events-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Cash Drawer Shift Events Request - -## Structure - -`ListCashDrawerShiftEventsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The ID of the location to list cash drawer shifts for.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `limit` | `?int` | Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | Opaque cursor for fetching the next page of results. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id8", - "limit": 24, - "cursor": "cursor2" -} -``` - diff --git a/doc/models/list-cash-drawer-shift-events-response.md b/doc/models/list-cash-drawer-shift-events-response.md deleted file mode 100644 index c3ed1c98..00000000 --- a/doc/models/list-cash-drawer-shift-events-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# List Cash Drawer Shift Events Response - -## Structure - -`ListCashDrawerShiftEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | Opaque cursor for fetching the next page. Cursor is not present in
the last page of results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cashDrawerShiftEvents` | [`?(CashDrawerShiftEvent[])`](../../doc/models/cash-drawer-shift-event.md) | Optional | All of the events (payments, refunds, etc.) for a cash drawer during
the shift. | getCashDrawerShiftEvents(): ?array | setCashDrawerShiftEvents(?array cashDrawerShiftEvents): void | - -## Example (as JSON) - -```json -{ - "cash_drawer_shift_events": [ - { - "created_at": "2019-11-22T00:43:02.000Z", - "description": "", - "event_money": { - "amount": 100, - "currency": "USD" - }, - "event_type": "CASH_TENDER_PAYMENT", - "id": "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", - "team_member_id": "" - }, - { - "created_at": "2019-11-22T00:43:12.000Z", - "description": "", - "event_money": { - "amount": 250, - "currency": "USD" - }, - "event_type": "CASH_TENDER_PAYMENT", - "id": "B2854CEA-A781-49B3-8F31-C64558231F48", - "team_member_id": "" - }, - { - "created_at": "2019-11-22T00:43:23.000Z", - "description": "", - "event_money": { - "amount": 250, - "currency": "USD" - }, - "event_type": "CASH_TENDER_CANCELLED_PAYMENT", - "id": "B5FB7F72-95CD-44A3-974D-26C41064D042", - "team_member_id": "" - }, - { - "created_at": "2019-11-22T00:43:46.000Z", - "description": "", - "event_money": { - "amount": 100, - "currency": "USD" - }, - "event_type": "CASH_TENDER_REFUND", - "id": "0B425480-8504-40B4-A867-37B23543931B", - "team_member_id": "" - }, - { - "created_at": "2019-11-22T00:44:18.000Z", - "description": "Transfer from another drawer", - "event_money": { - "amount": 10000, - "currency": "USD" - }, - "event_type": "PAID_IN", - "id": "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", - "team_member_id": "" - }, - { - "created_at": "2019-11-22T00:44:29.000Z", - "description": "Transfer out to another drawer", - "event_money": { - "amount": 10000, - "currency": "USD" - }, - "event_type": "PAID_OUT", - "id": "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", - "team_member_id": "" - } - ], - "cursor": "cursor8", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-cash-drawer-shifts-request.md b/doc/models/list-cash-drawer-shifts-request.md deleted file mode 100644 index aa256bd7..00000000 --- a/doc/models/list-cash-drawer-shifts-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Cash Drawer Shifts Request - -## Structure - -`ListCashDrawerShiftsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The ID of the location to query for a list of cash drawer shifts.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `beginTime` | `?string` | Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `limit` | `?int` | Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | Opaque cursor for fetching the next page of results. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id6", - "sort_order": "DESC", - "begin_time": "begin_time0", - "end_time": "end_time4", - "limit": 154, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/list-cash-drawer-shifts-response.md b/doc/models/list-cash-drawer-shifts-response.md deleted file mode 100644 index 9df939fb..00000000 --- a/doc/models/list-cash-drawer-shifts-response.md +++ /dev/null @@ -1,59 +0,0 @@ - -# List Cash Drawer Shifts Response - -## Structure - -`ListCashDrawerShiftsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | Opaque cursor for fetching the next page of results. Cursor is not
present in the last page of results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cashDrawerShifts` | [`?(CashDrawerShiftSummary[])`](../../doc/models/cash-drawer-shift-summary.md) | Optional | A collection of CashDrawerShiftSummary objects for shifts that match
the query. | getCashDrawerShifts(): ?array | setCashDrawerShifts(?array cashDrawerShifts): void | - -## Example (as JSON) - -```json -{ - "cash_drawer_shifts": [ - { - "closed_at": "2019-11-22T00:44:49.000Z", - "closed_cash_money": { - "amount": 9970, - "currency": "USD" - }, - "description": "Misplaced some change", - "ended_at": "2019-11-22T00:44:49.000Z", - "expected_cash_money": { - "amount": 10000, - "currency": "USD" - }, - "id": "DCC99978-09A6-4926-849F-300BE9C5793A", - "opened_at": "2019-11-22T00:42:54.000Z", - "opened_cash_money": { - "amount": 10000, - "currency": "USD" - }, - "state": "CLOSED" - } - ], - "cursor": "cursor6", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-catalog-request.md b/doc/models/list-catalog-request.md deleted file mode 100644 index 2e6ad722..00000000 --- a/doc/models/list-catalog-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Catalog Request - -## Structure - -`ListCatalogRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
The page size is currently set to be 100.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `types` | `?string` | Optional | An optional case-insensitive, comma-separated list of object types to retrieve.

The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example,
`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,
`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.

If this is unspecified, the operation returns objects of all the top level types at the version
of the Square API used to make the request. Object types that are nested onto other object types
are not included in the defaults.

At the current API version the default object types are:
ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,
PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,
SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. | getTypes(): ?string | setTypes(?string types): void | -| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will be from the
current version of the catalog. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor2", - "types": "types0", - "catalog_version": 254 -} -``` - diff --git a/doc/models/list-catalog-response.md b/doc/models/list-catalog-response.md deleted file mode 100644 index ac44f452..00000000 --- a/doc/models/list-catalog-response.md +++ /dev/null @@ -1,119 +0,0 @@ - -# List Catalog Response - -## Structure - -`ListCatalogResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset, this is the final response.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `objects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The CatalogObjects returned. | getObjects(): ?array | setObjects(?array objects): void | - -## Example (as JSON) - -```json -{ - "objects": [ - { - "category_data": { - "name": "Beverages" - }, - "id": "5ZYQZZ2IECPVJ2IJ5KQPRDC3", - "is_deleted": false, - "present_at_all_locations": true, - "type": "CATEGORY", - "updated_at": "2017-02-21T14:50:26.495Z", - "version": 1487688626495, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "L5R47DGBZOOVKCAFIXC56AEN", - "is_deleted": false, - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX", - "updated_at": "2017-02-21T14:50:26.495Z", - "version": 1487688626495, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-customer-custom-attribute-definitions-request.md b/doc/models/list-customer-custom-attribute-definitions-request.md deleted file mode 100644 index 1a57ea9a..00000000 --- a/doc/models/list-customer-custom-attribute-definitions-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Customer Custom Attribute Definitions Request - -Represents a [ListCustomerCustomAttributeDefinitions](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attribute-definitions) request. - -## Structure - -`ListCustomerCustomAttributeDefinitionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 198, - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-customer-custom-attribute-definitions-response.md b/doc/models/list-customer-custom-attribute-definitions-response.md deleted file mode 100644 index 16ba2730..00000000 --- a/doc/models/list-customer-custom-attribute-definitions-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# List Customer Custom Attribute Definitions Response - -Represents a [ListCustomerCustomAttributeDefinitions](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attribute-definitions) response. -Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. -If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. - -## Structure - -`ListCustomerCustomAttributeDefinitionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitions` | [`?(CustomAttributeDefinition[])`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | getCustomAttributeDefinitions(): ?array | setCustomAttributeDefinitions(?array customAttributeDefinitions): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of
results for your original request. This field is present only if the request succeeded and
additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - "custom_attribute_definitions": [ - { - "created_at": "2022-04-26T15:27:30Z", - "description": "Update the description as desired.", - "key": "favoritemovie", - "name": "Favorite Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-04-26T15:39:38Z", - "version": 3, - "visibility": "VISIBILITY_READ_ONLY" - }, - { - "created_at": "2022-04-26T15:49:05Z", - "description": "Customer owns movie.", - "key": "ownsmovie", - "name": "Owns Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-04-26T15:49:05Z", - "version": 1, - "visibility": "VISIBILITY_HIDDEN" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-customer-custom-attributes-request.md b/doc/models/list-customer-custom-attributes-request.md deleted file mode 100644 index 1c4fdab6..00000000 --- a/doc/models/list-customer-custom-attributes-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Customer Custom Attributes Request - -Represents a [ListCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attributes) request. - -## Structure - -`ListCustomerCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `withDefinitions` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinitions(): ?bool | setWithDefinitions(?bool withDefinitions): void | - -## Example (as JSON) - -```json -{ - "limit": 224, - "cursor": "cursor6", - "with_definitions": false -} -``` - diff --git a/doc/models/list-customer-custom-attributes-response.md b/doc/models/list-customer-custom-attributes-response.md deleted file mode 100644 index 7cb4267d..00000000 --- a/doc/models/list-customer-custom-attributes-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# List Customer Custom Attributes Response - -Represents a [ListCustomerCustomAttributes](../../doc/apis/customer-custom-attributes.md#list-customer-custom-attributes) response. -Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional -results are available, the `cursor` field is also present along with `custom_attributes`. - -## Structure - -`ListCustomerCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributes` | [`?(CustomAttribute[])`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If `with_definitions` was set to `true` in the request,
the custom attribute definition is returned in the `definition` field of each custom attribute.

If no custom attributes are found, Square returns an empty object (`{}`). | getCustomAttributes(): ?array | setCustomAttributes(?array customAttributes): void | -| `cursor` | `?string` | Optional | The cursor to use in your next call to this endpoint to retrieve the next page of results
for your original request. This field is present only if the request succeeded and additional
results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attributes": [ - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - } - ], - "cursor": "cursor4", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-customer-groups-request.md b/doc/models/list-customer-groups-request.md deleted file mode 100644 index 10b87622..00000000 --- a/doc/models/list-customer-groups-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# List Customer Groups Request - -Defines the query parameters that can be included in a request to the -[ListCustomerGroups](../../doc/apis/customer-groups.md#list-customer-groups) endpoint. - -## Structure - -`ListCustomerGroupsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 50` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor4", - "limit": 104 -} -``` - diff --git a/doc/models/list-customer-groups-response.md b/doc/models/list-customer-groups-response.md deleted file mode 100644 index da566093..00000000 --- a/doc/models/list-customer-groups-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# List Customer Groups Response - -Defines the fields that are included in the response body of -a request to the [ListCustomerGroups](../../doc/apis/customer-groups.md#list-customer-groups) endpoint. - -Either `errors` or `groups` is present in a given response (never both). - -## Structure - -`ListCustomerGroupsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `groups` | [`?(CustomerGroup[])`](../../doc/models/customer-group.md) | Optional | A list of customer groups belonging to the current seller. | getGroups(): ?array | setGroups(?array groups): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "groups": [ - { - "created_at": "2020-04-13T21:54:57.863Z", - "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", - "name": "Loyal Customers", - "updated_at": "2020-04-13T21:54:58Z" - }, - { - "created_at": "2020-04-13T21:55:18.795Z", - "id": "4XMEHESXJBNE9S9JAKZD2FGB14", - "name": "Super Loyal Customers", - "updated_at": "2020-04-13T21:55:19Z" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor0" -} -``` - diff --git a/doc/models/list-customer-segments-request.md b/doc/models/list-customer-segments-request.md deleted file mode 100644 index 904b8b9e..00000000 --- a/doc/models/list-customer-segments-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Customer Segments Request - -Defines the valid parameters for requests to the `ListCustomerSegments` endpoint. - -## Structure - -`ListCustomerSegmentsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by previous calls to `ListCustomerSegments`.
This cursor is used to retrieve the next set of query results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 50` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor4", - "limit": 4 -} -``` - diff --git a/doc/models/list-customer-segments-response.md b/doc/models/list-customer-segments-response.md deleted file mode 100644 index bd1429d0..00000000 --- a/doc/models/list-customer-segments-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# List Customer Segments Response - -Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint. - -Either `errors` or `segments` is present in a given response (never both). - -## Structure - -`ListCustomerSegmentsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `segments` | [`?(CustomerSegment[])`](../../doc/models/customer-segment.md) | Optional | The list of customer segments belonging to the associated Square account. | getSegments(): ?array | setSegments(?array segments): void | -| `cursor` | `?string` | Optional | A pagination cursor to be used in subsequent calls to `ListCustomerSegments`
to retrieve the next set of query results. The cursor is only present if the request succeeded and
additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "segments": [ - { - "created_at": "2020-01-09T19:33:24.469Z", - "id": "GMNXRZVEXNQDF.CHURN_RISK", - "name": "Lapsed", - "updated_at": "2020-04-13T21:47:04Z" - }, - { - "created_at": "2020-01-09T19:33:24.486Z", - "id": "GMNXRZVEXNQDF.LOYAL", - "name": "Regulars", - "updated_at": "2020-04-13T21:47:04Z" - }, - { - "created_at": "2020-01-09T19:33:21.813Z", - "id": "GMNXRZVEXNQDF.REACHABLE", - "name": "Reachable", - "updated_at": "2020-04-13T21:47:04Z" - }, - { - "created_at": "2020-01-09T19:33:25Z", - "id": "gv2:KF92J19VXN5FK30GX2E8HSGQ20", - "name": "Instant Profile", - "updated_at": "2020-04-13T23:01:03Z" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/list-customers-request.md b/doc/models/list-customers-request.md deleted file mode 100644 index 805936f4..00000000 --- a/doc/models/list-customers-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Customers Request - -Defines the query parameters that can be included in a request to the -`ListCustomers` endpoint. - -## Structure - -`ListCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `sortField` | [`?string(CustomerSortField)`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | getSortField(): ?string | setSortField(?string sortField): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `count` | `?bool` | Optional | Indicates whether to return the total count of customers in the `count` field of the response.

The default value is `false`. | getCount(): ?bool | setCount(?bool count): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor6", - "limit": 96, - "sort_field": "DEFAULT", - "sort_order": "DESC", - "count": false -} -``` - diff --git a/doc/models/list-customers-response.md b/doc/models/list-customers-response.md deleted file mode 100644 index dd0b26bf..00000000 --- a/doc/models/list-customers-response.md +++ /dev/null @@ -1,98 +0,0 @@ - -# List Customers Response - -Defines the fields that are included in the response body of -a request to the `ListCustomers` endpoint. - -Either `errors` or `customers` is present in a given response (never both). - -## Structure - -`ListCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `customers` | [`?(Customer[])`](../../doc/models/customer.md) | Optional | The customer profiles associated with the Square account or an empty object (`{}`) if none are found.
Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or
`phone_number`) are included in the response. | getCustomers(): ?array | setCustomers(?array customers): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for the
original query. A cursor is only present if the request succeeded and additional results
are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `count` | `?int` | Optional | The total count of customers associated with the Square account. Only customer profiles with public information
(`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present
only if `count` is set to `true` in the request. | getCount(): ?int | setCount(?int count): void | - -## Example (as JSON) - -```json -{ - "customers": [ - { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2016-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "group_ids": [ - "545AXB44B4XXWMVQ4W8SBT3HHF" - ], - "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "segment_ids": [ - "1KB9JE5EGJXCW.REACHABLE" - ], - "updated_at": "2016-03-23T20:21:55Z", - "version": 1, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - }, - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6", - "count": 184 -} -``` - diff --git a/doc/models/list-device-codes-request.md b/doc/models/list-device-codes-request.md deleted file mode 100644 index afbbbe23..00000000 --- a/doc/models/list-device-codes-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Device Codes Request - -## Structure - -`ListDeviceCodesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `locationId` | `?string` | Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `productType` | [`?string(ProductType)`](../../doc/models/product-type.md) | Optional | - | getProductType(): ?string | setProductType(?string productType): void | -| `status` | [`?(string(DeviceCodeStatus)[])`](../../doc/models/device-code-status.md) | Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.
See [DeviceCodeStatus](#type-devicecodestatus) for possible values | getStatus(): ?array | setStatus(?array status): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor6", - "location_id": "location_id4", - "product_type": "TERMINAL_API", - "status": [ - "UNKNOWN", - "UNPAIRED", - "PAIRED" - ] -} -``` - diff --git a/doc/models/list-device-codes-response.md b/doc/models/list-device-codes-response.md deleted file mode 100644 index cb3afe5a..00000000 --- a/doc/models/list-device-codes-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# List Device Codes Response - -## Structure - -`ListDeviceCodesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `deviceCodes` | [`?(DeviceCode[])`](../../doc/models/device-code.md) | Optional | The queried DeviceCode. | getDeviceCodes(): ?array | setDeviceCodes(?array deviceCodes): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "device_codes": [ - { - "code": "EBCARJ", - "created_at": "2020-02-06T18:44:33.000Z", - "device_id": "907CS13101300122", - "id": "B3Z6NAMYQSMTM", - "location_id": "B5E4484SHHNYH", - "name": "Counter 1", - "pair_by": "2020-02-06T18:49:33.000Z", - "product_type": "TERMINAL_API", - "status": "PAIRED", - "status_changed_at": "2020-02-06T18:47:28.000Z" - }, - { - "code": "GVXNYN", - "created_at": "2020-02-07T19:55:04.000Z", - "id": "YKGMJMYK8H4PQ", - "location_id": "A6SYFRSV4WAFW", - "name": "Unused device code", - "pair_by": "2020-02-07T20:00:04.000Z", - "product_type": "TERMINAL_API", - "status": "UNPAIRED", - "status_changed_at": "2020-02-07T19:55:04.000Z", - "device_id": "device_id4" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-devices-request.md b/doc/models/list-devices-request.md deleted file mode 100644 index 8582e6cf..00000000 --- a/doc/models/list-devices-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Devices Request - -## Structure - -`ListDevicesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `limit` | `?int` | Optional | The number of results to return in a single page.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `locationId` | `?string` | Optional | If present, only returns devices at the target location. | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor0", - "sort_order": "DESC", - "limit": 164, - "location_id": "location_id0" -} -``` - diff --git a/doc/models/list-devices-response.md b/doc/models/list-devices-response.md deleted file mode 100644 index 0b4fdd7a..00000000 --- a/doc/models/list-devices-response.md +++ /dev/null @@ -1,368 +0,0 @@ - -# List Devices Response - -## Structure - -`ListDevicesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `devices` | [`?(Device[])`](../../doc/models/device.md) | Optional | The requested list of `Device` objects. | getDevices(): ?array | setDevices(?array devices): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", - "devices": [ - { - "attributes": { - "manufacturer": "Square", - "manufacturers_id": "995CS397A6475287", - "merchant_token": "MLCHNZCBWFDZB", - "model": "T2", - "name": "Square Terminal 995", - "type": "TERMINAL", - "updated_at": "2023-09-29T13:04:56.335762883Z", - "version": "5.41.0085" - }, - "components": [ - { - "application_details": { - "application_type": "TERMINAL_API", - "session_location": "LMN2K7S3RTOU3", - "version": "6.25", - "device_code_id": "device_code_id2" - }, - "type": "APPLICATION", - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "card_reader_details": { - "version": "3.53.70" - }, - "type": "CARD_READER", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "battery_details": { - "external_power": "AVAILABLE_CHARGING", - "visible_percent": 5 - }, - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "type": "WIFI", - "wifi_details": { - "active": true, - "ip_address_v4": "10.0.0.7", - "secure_connection": "WPA/WPA2 PSK", - "signal_strength": { - "value": 2 - }, - "ssid": "Staff Network" - }, - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "ethernet_details": { - "active": false - }, - "type": "ETHERNET", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - } - } - ], - "id": "device:995CS397A6475287", - "status": { - "category": "AVAILABLE" - } - }, - { - "attributes": { - "manufacturer": "Square", - "manufacturers_id": "995CS234B5493559", - "merchant_token": "MLCHXZCBWFGDW", - "model": "T2", - "name": "Square Terminal 995", - "type": "TERMINAL", - "updated_at": "2023-09-29T12:39:56.335742073Z", - "version": "5.41.0085" - }, - "components": [ - { - "application_details": { - "application_type": "TERMINAL_API", - "session_location": "LMN2K7S3RTOU3", - "version": "6.25" - }, - "type": "APPLICATION", - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "card_reader_details": { - "version": "3.53.70" - }, - "type": "CARD_READER", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "battery_details": { - "external_power": "AVAILABLE_CHARGING", - "visible_percent": 24 - }, - "type": "BATTERY", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "type": "WIFI", - "wifi_details": { - "active": true, - "ip_address_v4": "10.0.0.7", - "secure_connection": "WPA/WPA2 PSK", - "signal_strength": { - "value": 2 - }, - "ssid": "Staff Network" - }, - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "ethernet_details": { - "active": false, - "ip_address_v4": "ip_address_v42" - } - }, - { - "ethernet_details": { - "active": false - }, - "type": "ETHERNET", - "application_details": { - "application_type": "TERMINAL_API", - "version": "version4", - "session_location": "session_location0", - "device_code_id": "device_code_id2" - }, - "card_reader_details": { - "version": "version0" - }, - "battery_details": { - "visible_percent": 108, - "external_power": "AVAILABLE_CHARGING" - }, - "wifi_details": { - "active": false, - "ssid": "ssid8", - "ip_address_v4": "ip_address_v42", - "secure_connection": "secure_connection8", - "signal_strength": { - "value": 222 - } - } - } - ], - "id": "device:995CS234B5493559", - "status": { - "category": "NEEDS_ATTENTION" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-dispute-evidence-request.md b/doc/models/list-dispute-evidence-request.md deleted file mode 100644 index c28b5b62..00000000 --- a/doc/models/list-dispute-evidence-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Dispute Evidence Request - -Defines the parameters for a `ListDisputeEvidence` request. - -## Structure - -`ListDisputeEvidenceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-dispute-evidence-response.md b/doc/models/list-dispute-evidence-response.md deleted file mode 100644 index bf96775a..00000000 --- a/doc/models/list-dispute-evidence-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# List Dispute Evidence Response - -Defines the fields in a `ListDisputeEvidence` response. - -## Structure - -`ListDisputeEvidenceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `evidence` | [`?(DisputeEvidence[])`](../../doc/models/dispute-evidence.md) | Optional | The list of evidence previously uploaded to the specified dispute. | getEvidence(): ?array | setEvidence(?array evidence): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request.
If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "evidence": [ - { - "evidence_id": "evidence_id0", - "id": "id2", - "dispute_id": "dispute_id4", - "evidence_file": { - "filename": "filename8", - "filetype": "filetype8" - }, - "evidence_text": "evidence_text6" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-disputes-request.md b/doc/models/list-disputes-request.md deleted file mode 100644 index 103742e3..00000000 --- a/doc/models/list-disputes-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Disputes Request - -Defines the request parameters for the `ListDisputes` endpoint. - -## Structure - -`ListDisputesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `states` | [`?(string(DisputeState)[])`](../../doc/models/dispute-state.md) | Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes.
See [DisputeState](#type-disputestate) for possible values | getStates(): ?array | setStates(?array states): void | -| `locationId` | `?string` | Optional | The ID of the location for which to return a list of disputes.
If not specified, the endpoint returns disputes associated with all locations.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor2", - "states": [ - "INQUIRY_EVIDENCE_REQUIRED", - "INQUIRY_PROCESSING", - "INQUIRY_CLOSED" - ], - "location_id": "location_id8" -} -``` - diff --git a/doc/models/list-disputes-response.md b/doc/models/list-disputes-response.md deleted file mode 100644 index 35b4d4fe..00000000 --- a/doc/models/list-disputes-response.md +++ /dev/null @@ -1,77 +0,0 @@ - -# List Disputes Response - -Defines fields in a `ListDisputes` response. - -## Structure - -`ListDisputesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `disputes` | [`?(Dispute[])`](../../doc/models/dispute.md) | Optional | The list of disputes. | getDisputes(): ?array | setDisputes(?array disputes): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request.
If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", - "disputes": [ - { - "amount_money": { - "amount": 2500, - "currency": "USD" - }, - "brand_dispute_id": "100000809947", - "card_brand": "VISA", - "created_at": "2022-06-29T18:45:22.265Z", - "disputed_payment": { - "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" - }, - "due_at": "2022-07-13T00:00:00.000Z", - "id": "XDgyFu7yo1E2S5lQGGpYn", - "location_id": "L1HN3ZMQK64X9", - "reason": "NO_KNOWLEDGE", - "reported_at": "2022-06-29T00:00:00.000Z", - "state": "ACCEPTED", - "updated_at": "2022-07-07T19:14:42.650Z", - "version": 2, - "dispute_id": "dispute_id4" - }, - { - "amount_money": { - "amount": 2209, - "currency": "USD" - }, - "brand_dispute_id": "r5Of6YaGT7AdeRaVoAGCJw", - "card_brand": "VISA", - "created_at": "2022-04-29T18:45:22.265Z", - "disputed_payment": { - "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" - }, - "due_at": "2022-05-13T00:00:00.000Z", - "id": "jLGg7aXC7lvKPr9PISt0T", - "location_id": "18YC4JDH91E1H", - "reason": "NOT_AS_DESCRIBED", - "reported_at": "2022-04-29T00:00:00.000Z", - "state": "EVIDENCE_REQUIRED", - "updated_at": "2022-04-29T18:45:22.265Z", - "version": 1, - "dispute_id": "dispute_id4" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-employee-wages-request.md b/doc/models/list-employee-wages-request.md deleted file mode 100644 index 3b7bd868..00000000 --- a/doc/models/list-employee-wages-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Employee Wages Request - -A request for a set of `EmployeeWage` objects. - -## Structure - -`ListEmployeeWagesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `employeeId` | `?string` | Optional | Filter the returned wages to only those that are associated with the specified employee. | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `limit` | `?int` | Optional | The maximum number of `EmployeeWage` results to return per page. The number can range between
1 and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pointer to the next page of `EmployeeWage` results to fetch. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "employee_id": "employee_id2", - "limit": 58, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/list-employee-wages-response.md b/doc/models/list-employee-wages-response.md deleted file mode 100644 index e3b6b367..00000000 --- a/doc/models/list-employee-wages-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# List Employee Wages Response - -The response to a request for a set of `EmployeeWage` objects. The response contains -a set of `EmployeeWage` objects. - -## Structure - -`ListEmployeeWagesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `employeeWages` | [`?(EmployeeWage[])`](../../doc/models/employee-wage.md) | Optional | A page of `EmployeeWage` results. | getEmployeeWages(): ?array | setEmployeeWages(?array employeeWages): void | -| `cursor` | `?string` | Optional | The value supplied in the subsequent request to fetch the next page
of `EmployeeWage` results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - "employee_wages": [ - { - "employee_id": "33fJchumvVdJwxV0H6L9", - "hourly_rate": { - "amount": 3250, - "currency": "USD" - }, - "id": "pXS3qCv7BERPnEGedM4S8mhm", - "title": "Manager" - }, - { - "employee_id": "33fJchumvVdJwxV0H6L9", - "hourly_rate": { - "amount": 2600, - "currency": "USD" - }, - "id": "rZduCkzYDUVL3ovh1sQgbue6", - "title": "Cook" - }, - { - "employee_id": "33fJchumvVdJwxV0H6L9", - "hourly_rate": { - "amount": 1600, - "currency": "USD" - }, - "id": "FxLbs5KpPUHa8wyt5ctjubDX", - "title": "Barista" - }, - { - "employee_id": "33fJchumvVdJwxV0H6L9", - "hourly_rate": { - "amount": 1700, - "currency": "USD" - }, - "id": "vD1wCgijMDR3cX5TPnu7VXto", - "title": "Cashier" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-employees-request.md b/doc/models/list-employees-request.md deleted file mode 100644 index c46b97ac..00000000 --- a/doc/models/list-employees-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Employees Request - -## Structure - -`ListEmployeesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | - | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | [`?string(EmployeeStatus)`](../../doc/models/employee-status.md) | Optional | The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). | getStatus(): ?string | setStatus(?string status): void | -| `limit` | `?int` | Optional | The number of employees to be returned on each page. | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The token required to retrieve the specified page of results. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id4", - "status": "ACTIVE", - "limit": 18, - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-employees-response.md b/doc/models/list-employees-response.md deleted file mode 100644 index 4c131cc4..00000000 --- a/doc/models/list-employees-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Employees Response - -## Structure - -`ListEmployeesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `employees` | [`?(Employee[])`](../../doc/models/employee.md) | Optional | - | getEmployees(): ?array | setEmployees(?array employees): void | -| `cursor` | `?string` | Optional | The token to be used to retrieve the next page of results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "employees": [ - { - "id": "id4", - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "phone_number": "phone_number8" - } - ], - "cursor": "cursor8", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-event-types-request.md b/doc/models/list-event-types-request.md deleted file mode 100644 index ba29874b..00000000 --- a/doc/models/list-event-types-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Event Types Request - -Lists all event types that can be subscribed to. - -## Structure - -`ListEventTypesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `apiVersion` | `?string` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | - -## Example (as JSON) - -```json -{ - "api_version": "api_version0" -} -``` - diff --git a/doc/models/list-event-types-response.md b/doc/models/list-event-types-response.md deleted file mode 100644 index e336f6dd..00000000 --- a/doc/models/list-event-types-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Event Types Response - -Defines the fields that are included in the response body of -a request to the [ListEventTypes](../../doc/apis/events.md#list-event-types) endpoint. - -Note: if there are errors processing the request, the event types field will not be -present. - -## Structure - -`ListEventTypesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `eventTypes` | `?(string[])` | Optional | The list of event types. | getEventTypes(): ?array | setEventTypes(?array eventTypes): void | -| `metadata` | [`?(EventTypeMetadata[])`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | getMetadata(): ?array | setMetadata(?array metadata): void | - -## Example (as JSON) - -```json -{ - "event_types": [ - "inventory.count.updated" - ], - "metadata": [ - { - "api_version_introduced": "2018-07-12", - "event_type": "inventory.count.updated", - "release_status": "PUBLIC" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-gift-card-activities-request.md b/doc/models/list-gift-card-activities-request.md deleted file mode 100644 index 10706e3b..00000000 --- a/doc/models/list-gift-card-activities-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# List Gift Card Activities Request - -Returns a list of gift card activities. You can optionally specify a filter to retrieve a -subset of activites. - -## Structure - -`ListGiftCardActivitiesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `giftCardId` | `?string` | Optional | If a gift card ID is provided, the endpoint returns activities related
to the specified gift card. Otherwise, the endpoint returns all gift card activities for
the seller.
**Constraints**: *Maximum Length*: `50` | getGiftCardId(): ?string | setGiftCardId(?string giftCardId): void | -| `type` | `?string` | Optional | If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type.
Otherwise, the endpoint returns all types of gift card activities. | getType(): ?string | setType(?string type): void | -| `locationId` | `?string` | Optional | If a location ID is provided, the endpoint returns gift card activities for the specified location.
Otherwise, the endpoint returns gift card activities for all locations. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `beginTime` | `?string` | Optional | The timestamp for the beginning of the reporting period, in RFC 3339 format.
This start time is inclusive. The default value is the current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The timestamp for the end of the reporting period, in RFC 3339 format.
This end time is inclusive. The default value is the current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `limit` | `?int` | Optional | If a limit is provided, the endpoint returns the specified number
of results (or fewer) per page. The maximum value is 100. The default value is 50.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `sortOrder` | `?string` | Optional | The order in which the endpoint returns the activities, based on `created_at`.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "gift_card_id": "gift_card_id6", - "type": "type8", - "location_id": "location_id2", - "begin_time": "begin_time6", - "end_time": "end_time0" -} -``` - diff --git a/doc/models/list-gift-card-activities-response.md b/doc/models/list-gift-card-activities-response.md deleted file mode 100644 index 3ff2080f..00000000 --- a/doc/models/list-gift-card-activities-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# List Gift Card Activities Response - -A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, -the response contains a set of `Error` objects. - -## Structure - -`ListGiftCardActivitiesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCardActivities` | [`?(GiftCardActivity[])`](../../doc/models/gift-card-activity.md) | Optional | The requested gift card activities or an empty object if none are found. | getGiftCardActivities(): ?array | setGiftCardActivities(?array giftCardActivities): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to retrieve the next set of activities. If a cursor is not present, this is
the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "gift_card_activities": [ - { - "created_at": "2021-06-02T22:26:38.000Z", - "gift_card_balance_money": { - "amount": 700, - "currency": "USD" - }, - "gift_card_gan": "7783320002929081", - "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - "id": "gcact_897698f894b44b3db46c6147e26a0e19", - "location_id": "81FN9BNFZTKS4", - "payment_id": "dEv2eksNPy6GqdYiLe4ZBNk6HqXZY", - "redeem_activity_details": { - "amount_money": { - "amount": 300, - "currency": "USD" - } - }, - "status": "COMPLETED", - "type": "REDEEM" - }, - { - "activate_activity_details": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", - "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gift_card_balance_money": { - "amount": 1000, - "currency": "USD" - }, - "gift_card_gan": "7783320002929081", - "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - "id": "gcact_b968ebfc7d46437b945be7b9e09123b4", - "location_id": "81FN9BNFZTKS4", - "type": "ACTIVATE" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/list-gift-cards-request.md b/doc/models/list-gift-cards-request.md deleted file mode 100644 index 3145fb74..00000000 --- a/doc/models/list-gift-cards-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Gift Cards Request - -A request to list gift cards. You can optionally specify a filter to retrieve a subset of -gift cards. - -## Structure - -`ListGiftCardsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `?string` | Optional | If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.
Otherwise, the endpoint returns gift cards of all types. | getType(): ?string | setType(?string type): void | -| `state` | `?string` | Optional | If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.
Otherwise, the endpoint returns the gift cards of all states. | getState(): ?string | setState(?string state): void | -| `limit` | `?int` | Optional | If a limit is provided, the endpoint returns only the specified number of results per page.
The maximum value is 200. The default value is 30.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `customerId` | `?string` | Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | - -## Example (as JSON) - -```json -{ - "type": "type0", - "state": "state6", - "limit": 162, - "cursor": "cursor4", - "customer_id": "customer_id8" -} -``` - diff --git a/doc/models/list-gift-cards-response.md b/doc/models/list-gift-cards-response.md deleted file mode 100644 index e79c0b3e..00000000 --- a/doc/models/list-gift-cards-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# List Gift Cards Response - -A response that contains a list of `GiftCard` objects. If the request resulted in errors, -the response contains a set of `Error` objects. - -## Structure - -`ListGiftCardsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCards` | [`?(GiftCard[])`](../../doc/models/gift-card.md) | Optional | The requested gift cards or an empty object if none are found. | getGiftCards(): ?array | setGiftCards(?array giftCards): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to retrieve the next set of gift cards. If a cursor is not present, this is
the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", - "gift_cards": [ - { - "balance_money": { - "amount": 3900, - "currency": "USD" - }, - "created_at": "2021-06-09T22:26:54.000Z", - "gan": "7783320008524605", - "gan_source": "SQUARE", - "id": "gftc:00113070ba5745f0b2377c1b9570cb03", - "state": "ACTIVE", - "type": "DIGITAL" - }, - { - "balance_money": { - "amount": 2000, - "currency": "USD" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gan": "7783320002692465", - "gan_source": "SQUARE", - "id": "gftc:00128a12725b41e58e0de1d20497a9dd", - "state": "ACTIVE", - "type": "DIGITAL" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-invoices-request.md b/doc/models/list-invoices-request.md deleted file mode 100644 index 9790bdc9..00000000 --- a/doc/models/list-invoices-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Invoices Request - -Describes a `ListInvoice` request. - -## Structure - -`ListInvoicesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The ID of the location for which to list invoices.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getLocationId(): string | setLocationId(string locationId): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id2", - "cursor": "cursor8", - "limit": 152 -} -``` - diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md deleted file mode 100644 index f2dca9b4..00000000 --- a/doc/models/list-invoices-response.md +++ /dev/null @@ -1,196 +0,0 @@ - -# List Invoices Response - -Describes a `ListInvoice` response. - -## Structure - -`ListInvoicesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoices` | [`?(Invoice[])`](../../doc/models/invoice.md) | Optional | The invoices retrieved. | getInvoices(): ?array | setInvoices(?array invoices): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to retrieve the next set of invoices. If empty, this is the final
response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", - "invoices": [ - { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "attachments": [ - { - "description": "Service contract", - "filename": "file.jpg", - "filesize": 102705, - "hash": "273ee02cb6f5f8a3a8ca23604930dd53", - "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", - "mime_type": "image/jpeg", - "uploaded_at": "2030-01-13T21:24:10Z" - } - ], - "created_at": "2030-01-13T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2030-01-13T21:24:10Z", - "version": 1 - }, - { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": true - }, - "created_at": "2021-01-23T15:29:12Z", - "delivery_method": "EMAIL", - "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", - "invoice_number": "inv-455", - "location_id": "ES0RJRZYEC39A", - "next_payment_amount_money": { - "amount": 3000, - "currency": "USD" - }, - "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", - "payment_requests": [ - { - "automatic_payment_source": "CARD_ON_FILE", - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "computed_amount_money": { - "amount": 1000, - "currency": "USD" - }, - "due_date": "2021-01-23", - "percentage_requested": "25", - "request_type": "DEPOSIT", - "tipping_enabled": false, - "total_completed_amount_money": { - "amount": 1000, - "currency": "USD" - }, - "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" - }, - { - "automatic_payment_source": "CARD_ON_FILE", - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "computed_amount_money": { - "amount": 3000, - "currency": "USD" - }, - "due_date": "2021-06-15", - "request_type": "BALANCE", - "tipping_enabled": false, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", - "sale_or_service_date": "2030-01-24", - "status": "PARTIALLY_PAID", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "updated_at": "2021-01-23T15:29:56Z", - "version": 3 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-jobs-request.md b/doc/models/list-jobs-request.md deleted file mode 100644 index cdca11a5..00000000 --- a/doc/models/list-jobs-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Jobs Request - -Represents a [ListJobs](../../doc/apis/team.md#list-jobs) request. - -## Structure - -`ListJobsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | The pagination cursor returned by the previous call to this endpoint. Provide this
cursor to retrieve the next page of results for your original request. For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor4" -} -``` - diff --git a/doc/models/list-jobs-response.md b/doc/models/list-jobs-response.md deleted file mode 100644 index 82bdcb46..00000000 --- a/doc/models/list-jobs-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Jobs Response - -Represents a [ListJobs](../../doc/apis/team.md#list-jobs) response. Either `jobs` or `errors` -is present in the response. If additional results are available, the `cursor` field is also present. - -## Structure - -`ListJobsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `jobs` | [`?(Job[])`](../../doc/models/job.md) | Optional | The retrieved jobs. A single paged response contains up to 100 jobs. | getJobs(): ?array | setJobs(?array jobs): void | -| `cursor` | `?string` | Optional | An opaque cursor used to retrieve the next page of results. This field is present only
if the request succeeded and additional results are available. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "jobs": [ - { - "created_at": "2021-06-11T22:55:45Z", - "id": "VDNpRv8da51NU8qZFC5zDWpF", - "is_tip_eligible": true, - "title": "Cashier", - "updated_at": "2021-06-11T22:55:45Z", - "version": 2 - }, - { - "created_at": "2021-06-11T22:55:45Z", - "id": "FjS8x95cqHiMenw4f1NAUH4P", - "is_tip_eligible": false, - "title": "Chef", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - } - ], - "cursor": "cursor6", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-location-booking-profiles-request.md b/doc/models/list-location-booking-profiles-request.md deleted file mode 100644 index de573209..00000000 --- a/doc/models/list-location-booking-profiles-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Location Booking Profiles Request - -## Structure - -`ListLocationBookingProfilesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.
**Constraints**: *Maximum Length*: `65536` | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 134, - "cursor": "cursor2" -} -``` - diff --git a/doc/models/list-location-booking-profiles-response.md b/doc/models/list-location-booking-profiles-response.md deleted file mode 100644 index 13eb61c4..00000000 --- a/doc/models/list-location-booking-profiles-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# List Location Booking Profiles Response - -## Structure - -`ListLocationBookingProfilesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationBookingProfiles` | [`?(LocationBookingProfile[])`](../../doc/models/location-booking-profile.md) | Optional | The list of a seller's location booking profiles. | getLocationBookingProfiles(): ?array | setLocationBookingProfiles(?array locationBookingProfiles): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "location_booking_profiles": [ - { - "booking_site_url": "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", - "location_id": "LY6WNBPVM6VGV", - "online_booking_enabled": true - }, - { - "location_id": "PYTRNBPVMJUPV", - "online_booking_enabled": false, - "booking_site_url": "booking_site_url2" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-location-custom-attribute-definitions-request.md b/doc/models/list-location-custom-attribute-definitions-request.md deleted file mode 100644 index fb2baa40..00000000 --- a/doc/models/list-location-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Location Custom Attribute Definitions Request - -Represents a [ListLocationCustomAttributeDefinitions](../../doc/apis/location-custom-attributes.md#list-location-custom-attribute-definitions) request. - -## Structure - -`ListLocationCustomAttributeDefinitionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "ALL", - "limit": 242, - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-location-custom-attribute-definitions-response.md b/doc/models/list-location-custom-attribute-definitions-response.md deleted file mode 100644 index f3f1d9a9..00000000 --- a/doc/models/list-location-custom-attribute-definitions-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# List Location Custom Attribute Definitions Response - -Represents a [ListLocationCustomAttributeDefinitions](../../doc/apis/location-custom-attributes.md#list-location-custom-attribute-definitions) response. -Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. -If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. - -## Structure - -`ListLocationCustomAttributeDefinitionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitions` | [`?(CustomAttributeDefinition[])`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | getCustomAttributeDefinitions(): ?array | setCustomAttributeDefinitions(?array customAttributeDefinitions): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of
results for your original request. This field is present only if the request succeeded and
additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - "custom_attribute_definitions": [ - { - "created_at": "2022-12-02T19:50:21.832Z", - "description": "Location's phone number", - "key": "phone-number", - "name": "phone number", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-12-02T19:50:21.832Z", - "version": 1, - "visibility": "VISIBILITY_READ_ONLY" - }, - { - "created_at": "2022-12-02T19:06:36.559Z", - "description": "Bestselling item at location", - "key": "bestseller", - "name": "Bestseller", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-12-03T10:17:52.341Z", - "version": 4, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-location-custom-attributes-request.md b/doc/models/list-location-custom-attributes-request.md deleted file mode 100644 index 7da49e1d..00000000 --- a/doc/models/list-location-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Location Custom Attributes Request - -Represents a [ListLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#list-location-custom-attributes) request. - -## Structure - -`ListLocationCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `withDefinitions` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinitions(): ?bool | setWithDefinitions(?bool withDefinitions): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "ALL", - "limit": 172, - "cursor": "cursor6", - "with_definitions": false -} -``` - diff --git a/doc/models/list-location-custom-attributes-response.md b/doc/models/list-location-custom-attributes-response.md deleted file mode 100644 index 106bad9d..00000000 --- a/doc/models/list-location-custom-attributes-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# List Location Custom Attributes Response - -Represents a [ListLocationCustomAttributes](../../doc/apis/location-custom-attributes.md#list-location-custom-attributes) response. -Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional -results are available, the `cursor` field is also present along with `custom_attributes`. - -## Structure - -`ListLocationCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributes` | [`?(CustomAttribute[])`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If `with_definitions` was set to `true` in the request,
the custom attribute definition is returned in the `definition` field of each custom attribute.
If no custom attributes are found, Square returns an empty object (`{}`). | getCustomAttributes(): ?array | setCustomAttributes(?array customAttributes): void | -| `cursor` | `?string` | Optional | The cursor to use in your next call to this endpoint to retrieve the next page of results
for your original request. This field is present only if the request succeeded and additional
results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attributes": [ - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - } - ], - "cursor": "cursor0", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-locations-response.md b/doc/models/list-locations-response.md deleted file mode 100644 index 0cad7d2f..00000000 --- a/doc/models/list-locations-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# List Locations Response - -Defines the fields that are included in the response body of a request -to the [ListLocations](../../doc/apis/locations.md#list-locations) endpoint. - -Either `errors` or `locations` is present in a given response (never both). - -## Structure - -`ListLocationsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `locations` | [`?(Location[])`](../../doc/models/location.md) | Optional | The business locations. | getLocations(): ?array | setLocations(?array locations): void | - -## Example (as JSON) - -```json -{ - "locations": [ - { - "address": { - "address_line_1": "123 Main St", - "administrative_district_level_1": "CA", - "country": "US", - "locality": "San Francisco", - "postal_code": "94114", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "business_name": "Jet Fuel Coffee", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ], - "country": "US", - "created_at": "2016-09-19T17:33:12Z", - "currency": "USD", - "id": "18YC4JDH91E1H", - "language_code": "en-US", - "merchant_id": "3MYCJG5GVYQ8Q", - "name": "Grant Park", - "phone_number": "+1 650-354-7217", - "status": "ACTIVE", - "timezone": "America/Los_Angeles" - }, - { - "address": { - "address_line_1": "1234 Peachtree St. NE", - "administrative_district_level_1": "GA", - "locality": "Atlanta", - "postal_code": "30309", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "business_name": "Jet Fuel Coffee", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ], - "coordinates": { - "latitude": 33.7889, - "longitude": -84.3841 - }, - "country": "US", - "created_at": "2022-02-19T17:58:25Z", - "currency": "USD", - "description": "Midtown Atlanta store", - "id": "3Z4V4WHQK64X9", - "language_code": "en-US", - "mcc": "7299", - "merchant_id": "3MYCJG5GVYQ8Q", - "name": "Midtown", - "status": "ACTIVE", - "timezone": "America/New_York", - "type": "PHYSICAL" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-loyalty-programs-response.md b/doc/models/list-loyalty-programs-response.md deleted file mode 100644 index fb1e1616..00000000 --- a/doc/models/list-loyalty-programs-response.md +++ /dev/null @@ -1,110 +0,0 @@ - -# List Loyalty Programs Response - -A response that contains all loyalty programs. - -## Structure - -`ListLoyaltyProgramsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `programs` | [`?(LoyaltyProgram[])`](../../doc/models/loyalty-program.md) | Optional | A list of `LoyaltyProgram` for the merchant. | getPrograms(): ?array | setPrograms(?array programs): void | - -## Example (as JSON) - -```json -{ - "programs": [ - { - "accrual_rules": [ - { - "accrual_type": "SPEND", - "points": 1, - "spend_data": { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "excluded_category_ids": [ - "7ZERJKO5PVYXCVUHV2JCZ2UG", - "FQKAOJE5C4FIMF5A2URMLW6V" - ], - "excluded_item_variation_ids": [ - "CBZXBUVVTYUBZGQO44RHMR6B", - "EDILT24Z2NISEXDKGY6HP7XV" - ], - "tax_mode": "BEFORE_TAX" - } - } - ], - "created_at": "2020-04-20T16:55:11Z", - "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "location_ids": [ - "P034NEENMD09F" - ], - "reward_tiers": [ - { - "created_at": "2020-04-20T16:55:11Z", - "definition": { - "discount_type": "FIXED_PERCENTAGE", - "percentage_discount": "10", - "scope": "ORDER", - "catalog_object_ids": [ - "catalog_object_ids6" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } - }, - "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "name": "10% off entire sale", - "points": 10, - "pricing_rule_reference": { - "catalog_version": 1605486402527, - "object_id": "74C4JSHESNLTB2A7ITO5HO6F" - } - } - ], - "status": "ACTIVE", - "terminology": { - "one": "Point", - "other": "Points" - }, - "updated_at": "2020-05-01T02:00:02Z", - "expiration_policy": { - "expiration_duration": "expiration_duration0" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-loyalty-promotions-request.md b/doc/models/list-loyalty-promotions-request.md deleted file mode 100644 index 06b5aa3e..00000000 --- a/doc/models/list-loyalty-promotions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Loyalty Promotions Request - -Represents a [ListLoyaltyPromotions](../../doc/apis/loyalty.md#list-loyalty-promotions) request. - -## Structure - -`ListLoyaltyPromotionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | [`?string(LoyaltyPromotionStatus)`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | getStatus(): ?string | setStatus(?string status): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response.
The minimum value is 1 and the maximum value is 30. The default value is 30.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 30` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "status": "CANCELED", - "cursor": "cursor2", - "limit": 58 -} -``` - diff --git a/doc/models/list-loyalty-promotions-response.md b/doc/models/list-loyalty-promotions-response.md deleted file mode 100644 index 35ba66a5..00000000 --- a/doc/models/list-loyalty-promotions-response.md +++ /dev/null @@ -1,124 +0,0 @@ - -# List Loyalty Promotions Response - -Represents a [ListLoyaltyPromotions](../../doc/apis/loyalty.md#list-loyalty-promotions) response. -One of `loyalty_promotions`, an empty object, or `errors` is present in the response. -If additional results are available, the `cursor` field is also present along with `loyalty_promotions`. - -## Structure - -`ListLoyaltyPromotionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyPromotions` | [`?(LoyaltyPromotion[])`](../../doc/models/loyalty-promotion.md) | Optional | The retrieved loyalty promotions. | getLoyaltyPromotions(): ?array | setLoyaltyPromotions(?array loyaltyPromotions): void | -| `cursor` | `?string` | Optional | The cursor to use in your next call to this endpoint to retrieve the next page of results
for your original request. This field is present only if the request succeeded and additional
results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "loyalty_promotions": [ - { - "available_time": { - "start_date": "2022-08-16", - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" - ], - "end_date": "end_date8" - }, - "created_at": "2022-08-16T08:38:54Z", - "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - "incentive": { - "points_multiplier_data": { - "multiplier": "3.000", - "points_multiplier": 3 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "name": "Tuesday Happy Hour Promo", - "qualifying_item_variation_ids": [ - "CJ3RYL56ITAKMD4VRCM7XERS", - "AT3RYLR3TUA9C34VRCB7X5RR" - ], - "status": "ACTIVE", - "trigger_limit": { - "interval": "DAY", - "times": 1 - }, - "updated_at": "2022-08-16T08:38:54Z", - "canceled_at": "canceled_at0" - }, - { - "available_time": { - "end_date": "2022-08-01", - "start_date": "2022-07-01", - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT" - ] - }, - "created_at": "2022-06-27T15:37:38Z", - "id": "loypromo_e696f057-2286-35ff-8108-132241328106", - "incentive": { - "points_multiplier_data": { - "multiplier": "2.000", - "points_multiplier": 2 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "minimum_spend_amount_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "July Special", - "qualifying_category_ids": [ - "XTQPYLR3IIU9C44VRCB3XD12" - ], - "status": "ENDED", - "trigger_limit": { - "interval": "ALL_TIME", - "times": 5 - }, - "updated_at": "2022-06-27T15:37:38Z", - "canceled_at": "canceled_at0" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-merchant-custom-attribute-definitions-request.md b/doc/models/list-merchant-custom-attribute-definitions-request.md deleted file mode 100644 index 819036e6..00000000 --- a/doc/models/list-merchant-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Merchant Custom Attribute Definitions Request - -Represents a [ListMerchantCustomAttributeDefinitions](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) request. - -## Structure - -`ListMerchantCustomAttributeDefinitionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "ALL", - "limit": 48, - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-merchant-custom-attribute-definitions-response.md b/doc/models/list-merchant-custom-attribute-definitions-response.md deleted file mode 100644 index 8a480c89..00000000 --- a/doc/models/list-merchant-custom-attribute-definitions-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# List Merchant Custom Attribute Definitions Response - -Represents a [ListMerchantCustomAttributeDefinitions](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) response. -Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. -If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. - -## Structure - -`ListMerchantCustomAttributeDefinitionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitions` | [`?(CustomAttributeDefinition[])`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | getCustomAttributeDefinitions(): ?array | setCustomAttributeDefinitions(?array customAttributeDefinitions): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of
results for your original request. This field is present only if the request succeeded and
additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - "custom_attribute_definitions": [ - { - "created_at": "2023-05-05T16:50:21.832Z", - "description": "Whether the merchant has seen the tutorial screen for using the app.", - "key": "has_seen_tutorial", - "name": "NAME", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2023-05-05T16:50:21.832Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - { - "created_at": "2023-05-05T19:06:36.559Z", - "description": "This is the other name this merchant goes by.", - "key": "alternative_seller_name", - "name": "Alternative Merchant Name", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2023-05-05T10:17:52.341Z", - "version": 4, - "visibility": "VISIBILITY_READ_ONLY" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-merchant-custom-attributes-request.md b/doc/models/list-merchant-custom-attributes-request.md deleted file mode 100644 index 6b37cbf9..00000000 --- a/doc/models/list-merchant-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Merchant Custom Attributes Request - -Represents a [ListMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attributes) request. - -## Structure - -`ListMerchantCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request. For more
information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `withDefinitions` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinitions(): ?bool | setWithDefinitions(?bool withDefinitions): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "READ_WRITE", - "limit": 132, - "cursor": "cursor6", - "with_definitions": false -} -``` - diff --git a/doc/models/list-merchant-custom-attributes-response.md b/doc/models/list-merchant-custom-attributes-response.md deleted file mode 100644 index 0714760f..00000000 --- a/doc/models/list-merchant-custom-attributes-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# List Merchant Custom Attributes Response - -Represents a [ListMerchantCustomAttributes](../../doc/apis/merchant-custom-attributes.md#list-merchant-custom-attributes) response. -Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional -results are available, the `cursor` field is also present along with `custom_attributes`. - -## Structure - -`ListMerchantCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributes` | [`?(CustomAttribute[])`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If `with_definitions` was set to `true` in the request,
the custom attribute definition is returned in the `definition` field of each custom attribute.
If no custom attributes are found, Square returns an empty object (`{}`). | getCustomAttributes(): ?array | setCustomAttributes(?array customAttributes): void | -| `cursor` | `?string` | Optional | The cursor to use in your next call to this endpoint to retrieve the next page of results
for your original request. This field is present only if the request succeeded and additional
results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attributes": [ - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - } - ], - "cursor": "cursor6", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-merchants-request.md b/doc/models/list-merchants-request.md deleted file mode 100644 index 76ec77ce..00000000 --- a/doc/models/list-merchants-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Merchants Request - -Request object for the [ListMerchant](../../doc/apis/merchants.md#list-merchants) endpoint. - -## Structure - -`ListMerchantsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?int` | Optional | The cursor generated by the previous response. | getCursor(): ?int | setCursor(?int cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": 106 -} -``` - diff --git a/doc/models/list-merchants-response.md b/doc/models/list-merchants-response.md deleted file mode 100644 index 34ed2c4a..00000000 --- a/doc/models/list-merchants-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# List Merchants Response - -The response object returned by the [ListMerchant](../../doc/apis/merchants.md#list-merchants) endpoint. - -## Structure - -`ListMerchantsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `merchant` | [`?(Merchant[])`](../../doc/models/merchant.md) | Optional | The requested `Merchant` entities. | getMerchant(): ?array | setMerchant(?array merchant): void | -| `cursor` | `?int` | Optional | If the response is truncated, the cursor to use in next request to fetch next set of objects. | getCursor(): ?int | setCursor(?int cursor): void | - -## Example (as JSON) - -```json -{ - "merchant": [ - { - "business_name": "Apple A Day", - "country": "US", - "created_at": "2021-12-10T19:25:52.484Z", - "currency": "USD", - "id": "DM7VKY8Q63GNP", - "language_code": "en-US", - "main_location_id": "9A65CGC72ZQG1", - "status": "ACTIVE" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": 124 -} -``` - diff --git a/doc/models/list-order-custom-attribute-definitions-request.md b/doc/models/list-order-custom-attribute-definitions-request.md deleted file mode 100644 index a1d49c9c..00000000 --- a/doc/models/list-order-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Order Custom Attribute Definitions Request - -Represents a list request for order custom attribute definitions. - -## Structure - -`ListOrderCustomAttributeDefinitionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: *Minimum Length*: `1` | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "READ_WRITE", - "cursor": "cursor2", - "limit": 6 -} -``` - diff --git a/doc/models/list-order-custom-attribute-definitions-response.md b/doc/models/list-order-custom-attribute-definitions-response.md deleted file mode 100644 index 030752c4..00000000 --- a/doc/models/list-order-custom-attribute-definitions-response.md +++ /dev/null @@ -1,80 +0,0 @@ - -# List Order Custom Attribute Definitions Response - -Represents a response from listing order custom attribute definitions. - -## Structure - -`ListOrderCustomAttributeDefinitionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinitions` | [`CustomAttributeDefinition[]`](../../doc/models/custom-attribute-definition.md) | Required | The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`). | getCustomAttributeDefinitions(): array | setCustomAttributeDefinitions(array customAttributeDefinitions): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request.
This field is present only if the request succeeded and additional results are available.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: *Minimum Length*: `1` | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definitions": [ - { - "created_at": "2022-11-16T18:03:44.051Z", - "description": "The number of people seated at a table", - "key": "cover-count", - "name": "Cover count", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T18:03:44.051Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - { - "created_at": "2022-11-16T18:04:32.059Z", - "description": "The identifier for a particular seat", - "key": "seat-number", - "name": "Seat number", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T18:04:32.059Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - { - "created_at": "2022-11-16T18:04:21.912Z", - "description": "The identifier for a particular table", - "key": "table-number", - "name": "Table number", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T18:04:21.912Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - } - ], - "cursor": "cursor4", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-order-custom-attributes-request.md b/doc/models/list-order-custom-attributes-request.md deleted file mode 100644 index a035b7d9..00000000 --- a/doc/models/list-order-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Order Custom Attributes Request - -Represents a list request for order custom attributes. - -## Structure - -`ListOrderCustomAttributesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `visibilityFilter` | [`?string(VisibilityFilter)`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | getVisibilityFilter(): ?string | setVisibilityFilter(?string visibilityFilter): void | -| `cursor` | `?string` | Optional | The cursor returned in the paged response from the previous call to this endpoint.
Provide this cursor to retrieve the next page of results for your original request.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: *Minimum Length*: `1` | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single paged response. This limit is advisory.
The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
The default value is 20.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `withDefinitions` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom attribute,
information about the data type, or other definition details. The default value is `false`. | getWithDefinitions(): ?bool | setWithDefinitions(?bool withDefinitions): void | - -## Example (as JSON) - -```json -{ - "visibility_filter": "READ", - "cursor": "cursor2", - "limit": 158, - "with_definitions": false -} -``` - diff --git a/doc/models/list-order-custom-attributes-response.md b/doc/models/list-order-custom-attributes-response.md deleted file mode 100644 index 1d846037..00000000 --- a/doc/models/list-order-custom-attributes-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# List Order Custom Attributes Response - -Represents a response from listing order custom attributes. - -## Structure - -`ListOrderCustomAttributesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributes` | [`?(CustomAttribute[])`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`). | getCustomAttributes(): ?array | setCustomAttributes(?array customAttributes): void | -| `cursor` | `?string` | Optional | The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request.
This field is present only if the request succeeded and additional results are available.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
**Constraints**: *Minimum Length*: `1` | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attributes": [ - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - { - "key": "key8", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 180, - "visibility": "VISIBILITY_HIDDEN", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - } - ], - "cursor": "cursor4", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-payment-links-request.md b/doc/models/list-payment-links-request.md deleted file mode 100644 index f78cfc3a..00000000 --- a/doc/models/list-payment-links-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Payment Links Request - -## Structure - -`ListPaymentLinksRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
If a cursor is not provided, the endpoint returns the first page of the results.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | A limit on the number of results to return per page. The limit is advisory and
the implementation might return more or less results. If the supplied limit is negative, zero, or
greater than the maximum limit of 1000, it is ignored.

Default value: `100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor6", - "limit": 182 -} -``` - diff --git a/doc/models/list-payment-links-response.md b/doc/models/list-payment-links-response.md deleted file mode 100644 index 299cfea3..00000000 --- a/doc/models/list-payment-links-response.md +++ /dev/null @@ -1,102 +0,0 @@ - -# List Payment Links Response - -## Structure - -`ListPaymentLinksResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `paymentLinks` | [`?(PaymentLink[])`](../../doc/models/payment-link.md) | Optional | The list of payment links. | getPaymentLinks(): ?array | setPaymentLinks(?array paymentLinks): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a subsequent request
to retrieve the next set of gift cards. If a cursor is not present, this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "MTY1NQ==", - "payment_links": [ - { - "checkout_options": { - "ask_for_shipping_address": true, - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "created_at": "2022-04-26T00:15:15Z", - "id": "TN4BWEDJ9AI5MBIV", - "order_id": "Qqc6yppGvxVwc46Cch4zHTaJqc4F", - "payment_note": "test", - "updated_at": "2022-04-26T00:18:24Z", - "url": "https://square.link/u/EXAMPLE", - "version": 2, - "description": "description2", - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - }, - { - "created_at": "2022-04-11T23:14:59Z", - "description": "", - "id": "RY5UNCUMPJN5XKCT", - "order_id": "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", - "url": "https://square.link/u/EXAMPLE", - "version": 1, - "checkout_options": { - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-payment-refunds-request.md b/doc/models/list-payment-refunds-request.md deleted file mode 100644 index ac06ef98..00000000 --- a/doc/models/list-payment-refunds-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# List Payment Refunds Request - -Describes a request to list refunds using -[ListPaymentRefunds](../../doc/apis/refunds.md#list-payment-refunds). - -The maximum results per page is 100. - -## Structure - -`ListPaymentRefundsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `created_at` field for each `PaymentRefund`.

Default: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `created_at` field for each `PaymentRefund`.

Default: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `sortOrder` | `?string` | Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `locationId` | `?string` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | `?string` | Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](entity:PaymentRefund).

Default: If omitted, refunds are returned regardless of their status. | getStatus(): ?string | setStatus(?string status): void | -| `sourceType` | `?string` | Optional | If provided, only returns refunds whose payments have the indicated source type.
Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.
For information about these payment source types, see
[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).

Default: If omitted, refunds are returned regardless of the source type. | getSourceType(): ?string | setSourceType(?string sourceType): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.

It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, no more than 100 results are returned.

Default: 100 | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "begin_time": "begin_time8", - "end_time": "end_time2", - "sort_order": "sort_order0", - "cursor": "cursor4", - "location_id": "location_id4" -} -``` - diff --git a/doc/models/list-payment-refunds-response.md b/doc/models/list-payment-refunds-response.md deleted file mode 100644 index a7577892..00000000 --- a/doc/models/list-payment-refunds-response.md +++ /dev/null @@ -1,97 +0,0 @@ - -# List Payment Refunds Response - -Defines the response returned by [ListPaymentRefunds](../../doc/apis/refunds.md#list-payment-refunds). - -Either `errors` or `refunds` is present in a given response (never both). - -## Structure - -`ListPaymentRefundsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refunds` | [`?(PaymentRefund[])`](../../doc/models/payment-refund.md) | Optional | The list of requested refunds. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", - "refunds": [ - { - "amount_money": { - "amount": 555, - "currency": "USD" - }, - "created_at": "2021-10-13T19:59:05.342Z", - "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", - "location_id": "L88917AVBK2S5", - "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", - "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "processing_fee": [ - { - "amount_money": { - "amount": -34, - "currency": "USD" - }, - "effective_at": "2021-10-13T21:34:35.000Z", - "type": "INITIAL" - } - ], - "reason": "Example Refund", - "status": "COMPLETED", - "updated_at": "2021-10-13T20:00:03.497Z", - "unlinked": false, - "destination_type": "destination_type2", - "destination_details": { - "card_details": { - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "auth_result_code": "auth_result_code0" - }, - "cash_details": { - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } - }, - "external_details": { - "type": "type6", - "source": "source0", - "source_id": "source_id8" - } - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-payments-request.md b/doc/models/list-payments-request.md deleted file mode 100644 index c2f637d4..00000000 --- a/doc/models/list-payments-request.md +++ /dev/null @@ -1,44 +0,0 @@ - -# List Payments Request - -Describes a request to list payments using -[ListPayments](../../doc/apis/payments.md#list-payments). - -The maximum results per page is 100. - -## Structure - -`ListPaymentsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format.
The range is determined using the `created_at` field for each Payment.
Inclusive. Default: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `created_at` field for each Payment.

Default: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `sortOrder` | `?string` | Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `locationId` | `?string` | Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `total` | `?int` | Optional | The exact amount in the `total_money` for a payment. | getTotal(): ?int | setTotal(?int total): void | -| `last4` | `?string` | Optional | The last four digits of a payment card. | getLast4(): ?string | setLast4(?string last4): void | -| `cardBrand` | `?string` | Optional | The brand of the payment card (for example, VISA). | getCardBrand(): ?string | setCardBrand(?string cardBrand): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.

Default: `100` | getLimit(): ?int | setLimit(?int limit): void | -| `isOfflinePayment` | `?bool` | Optional | Whether the payment was taken offline or not. | getIsOfflinePayment(): ?bool | setIsOfflinePayment(?bool isOfflinePayment): void | -| `offlineBeginTime` | `?string` | Optional | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | getOfflineBeginTime(): ?string | setOfflineBeginTime(?string offlineBeginTime): void | -| `offlineEndTime` | `?string` | Optional | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | getOfflineEndTime(): ?string | setOfflineEndTime(?string offlineEndTime): void | -| `updatedAtBeginTime` | `?string` | Optional | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `updated_at` field for each Payment. | getUpdatedAtBeginTime(): ?string | setUpdatedAtBeginTime(?string updatedAtBeginTime): void | -| `updatedAtEndTime` | `?string` | Optional | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The
range is determined using the `updated_at` field for each Payment. | getUpdatedAtEndTime(): ?string | setUpdatedAtEndTime(?string updatedAtEndTime): void | -| `sortField` | [`?string(PaymentSortField)`](../../doc/models/payment-sort-field.md) | Optional | - | getSortField(): ?string | setSortField(?string sortField): void | - -## Example (as JSON) - -```json -{ - "begin_time": "begin_time0", - "end_time": "end_time4", - "sort_order": "sort_order2", - "cursor": "cursor4", - "location_id": "location_id6" -} -``` - diff --git a/doc/models/list-payments-response.md b/doc/models/list-payments-response.md deleted file mode 100644 index 5d8560da..00000000 --- a/doc/models/list-payments-response.md +++ /dev/null @@ -1,105 +0,0 @@ - -# List Payments Response - -Defines the response returned by [ListPayments](../../doc/apis/payments.md#list-payments). - -## Structure - -`ListPaymentsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payments` | [`?(Payment[])`](../../doc/models/payment.md) | Optional | The requested list of payments. | getPayments(): ?array | setPayments(?array payments): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "payments": [ - { - "amount_money": { - "amount": 555, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", - "square_product": "VIRTUAL_TERMINAL" - }, - "approved_money": { - "amount": 555, - "currency": "USD" - }, - "card_details": { - "auth_result_code": "2Nkw7q", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T19:34:33.680Z", - "captured_at": "2021-10-13T19:34:34.340Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "KEYED", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "CAPTURED" - }, - "created_at": "2021-10-13T19:34:33.524Z", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T19:34:33.524Z", - "employee_id": "TMoK_ogh6rH1o4dV", - "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "location_id": "L88917AVBK2S5", - "note": "Test Note", - "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", - "processing_fee": [ - { - "amount_money": { - "amount": 34, - "currency": "USD" - }, - "effective_at": "2021-10-13T21:34:35.000Z", - "type": "INITIAL" - } - ], - "receipt_number": "bP9m", - "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - "source_type": "CARD", - "status": "COMPLETED", - "team_member_id": "TMoK_ogh6rH1o4dV", - "total_money": { - "amount": 555, - "currency": "USD" - }, - "updated_at": "2021-10-13T19:34:37.261Z", - "version_token": "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o", - "tip_money": { - "amount": 190, - "currency": "TWD" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor0" -} -``` - diff --git a/doc/models/list-payout-entries-request.md b/doc/models/list-payout-entries-request.md deleted file mode 100644 index aaa69edd..00000000 --- a/doc/models/list-payout-entries-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Payout Entries Request - -## Structure - -`ListPayoutEntriesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
If request parameters change between requests, subsequent results may contain duplicates or missing records. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: `100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "sort_order": "DESC", - "cursor": "cursor2", - "limit": 194 -} -``` - diff --git a/doc/models/list-payout-entries-response.md b/doc/models/list-payout-entries-response.md deleted file mode 100644 index a33c380f..00000000 --- a/doc/models/list-payout-entries-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# List Payout Entries Response - -The response to retrieve payout records entries. - -## Structure - -`ListPayoutEntriesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payoutEntries` | [`?(PayoutEntry[])`](../../doc/models/payout-entry.md) | Optional | The requested list of payout entries, ordered with the given or default sort order. | getPayoutEntries(): ?array | setPayoutEntries(?array payoutEntries): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty, this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", - "payout_entries": [ - { - "effective_at": "2021-12-14T23:31:49Z", - "fee_amount_money": { - "amount": -2, - "currency_code": "USD", - "currency": "CHF" - }, - "gross_amount_money": { - "amount": -50, - "currency_code": "USD", - "currency": "MNT" - }, - "id": "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", - "net_amount_money": { - "amount": -48, - "currency_code": "USD", - "currency": "XPT" - }, - "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - "type": "REFUND", - "type_refund_details": { - "payment_id": "HVdG62HeMlti8YYf94oxrN", - "refund_id": "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY" - } - }, - { - "effective_at": "2021-12-14T23:31:49Z", - "fee_amount_money": { - "amount": 19, - "currency_code": "USD", - "currency": "CHF" - }, - "gross_amount_money": { - "amount": 100, - "currency_code": "USD", - "currency": "MNT" - }, - "id": "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", - "net_amount_money": { - "amount": 81, - "currency_code": "USD", - "currency": "XPT" - }, - "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - "type": "CHARGE", - "type_charge_details": { - "payment_id": "HVdG62H5K3291d0SGJS6IWd4cSi8YY" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-payouts-request.md b/doc/models/list-payouts-request.md deleted file mode 100644 index 92ef08f3..00000000 --- a/doc/models/list-payouts-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# List Payouts Request - -A request to retrieve payout records. - -## Structure - -`ListPayoutsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the location for which to list the payouts.
By default, payouts are returned for the default (main) location associated with the seller.
**Constraints**: *Maximum Length*: `255` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | [`?string(PayoutStatus)`](../../doc/models/payout-status.md) | Optional | Payout status types | getStatus(): ?string | setStatus(?string status): void | -| `beginTime` | `?string` | Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
If request parameters change between requests, subsequent results may contain duplicates or missing records. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.
Default: `100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id4", - "status": "SENT", - "begin_time": "begin_time2", - "end_time": "end_time2", - "sort_order": "DESC" -} -``` - diff --git a/doc/models/list-payouts-response.md b/doc/models/list-payouts-response.md deleted file mode 100644 index e033bce7..00000000 --- a/doc/models/list-payouts-response.md +++ /dev/null @@ -1,97 +0,0 @@ - -# List Payouts Response - -The response to retrieve payout records entries. - -## Structure - -`ListPayoutsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payouts` | [`?(Payout[])`](../../doc/models/payout.md) | Optional | The requested list of payouts. | getPayouts(): ?array | setPayouts(?array payouts): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty, this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", - "payouts": [ - { - "amount_money": { - "amount": 6259, - "currency_code": "USD", - "currency": "AUD" - }, - "arrival_date": "2022-03-29", - "created_at": "2022-03-29T16:12:31Z", - "destination": { - "id": "ccof:ZPp3oedR3AeEUNd3z7", - "type": "CARD" - }, - "end_to_end_id": "L2100000005", - "id": "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", - "location_id": "L88917AVBK2S5", - "payout_fee": [ - { - "amount_money": { - "amount": 95, - "currency_code": "USD" - }, - "effective_at": "2022-03-29T16:12:31Z", - "type": "TRANSFER_FEE" - } - ], - "status": "PAID", - "type": "BATCH", - "updated_at": "2022-03-30T01:07:22.875Z", - "version": 2 - }, - { - "amount_money": { - "amount": -103, - "currency_code": "USD", - "currency": "AUD" - }, - "arrival_date": "2022-03-24", - "created_at": "2022-03-24T03:07:09Z", - "destination": { - "id": "bact:ZPp3oedR3AeEUNd3z7", - "type": "BANK_ACCOUNT" - }, - "end_to_end_id": "L2100000006", - "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", - "location_id": "L88917AVBK2S5", - "status": "PAID", - "type": "BATCH", - "updated_at": "2022-03-24T03:07:09Z", - "version": 1 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-refunds-request.md b/doc/models/list-refunds-request.md deleted file mode 100644 index b96d2abb..00000000 --- a/doc/models/list-refunds-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Refunds Request - -Defines the query parameters that can be included in -a request to the [ListRefunds](api-endpoint:Transactions-ListRefunds) endpoint. - -Deprecated - recommend using [SearchOrders](api-endpoint:Orders-SearchOrders) - -## Structure - -`ListRefundsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "begin_time": "begin_time6", - "end_time": "end_time0", - "sort_order": "DESC", - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-refunds-response.md b/doc/models/list-refunds-response.md deleted file mode 100644 index 0577762a..00000000 --- a/doc/models/list-refunds-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# List Refunds Response - -Defines the fields that are included in the response body of -a request to the [ListRefunds](api-endpoint:Transactions-ListRefunds) endpoint. - -One of `errors` or `refunds` is present in a given response (never both). - -## Structure - -`ListRefundsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refunds` | [`?(Refund[])`](../../doc/models/refund.md) | Optional | An array of refunds that match your query. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "refunds": [ - { - "additional_recipients": [ - { - "amount_money": { - "amount": 10, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1", - "receivable_id": "receivable_id6" - } - ], - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "created_at": "2016-01-20T00:28:18Z", - "id": "b27436d1-7f8e-5610-45c6-417ef71434b4-SW", - "location_id": "18YC4JDH91E1H", - "reason": "some reason", - "status": "APPROVED", - "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-sites-response.md b/doc/models/list-sites-response.md deleted file mode 100644 index 4791b2e7..00000000 --- a/doc/models/list-sites-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# List Sites Response - -Represents a `ListSites` response. The response can include either `sites` or `errors`. - -## Structure - -`ListSitesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `sites` | [`?(Site[])`](../../doc/models/site.md) | Optional | The sites that belong to the seller. | getSites(): ?array | setSites(?array sites): void | - -## Example (as JSON) - -```json -{ - "sites": [ - { - "created_at": "2020-10-28T13:22:51.000000Z", - "domain": "mysite2.square.site", - "id": "site_278075276488921835", - "is_published": false, - "site_title": "My Second Site", - "updated_at": "2020-10-28T13:22:51.000000Z" - }, - { - "created_at": "2020-06-18T17:45:13.000000Z", - "domain": "mysite1.square.site", - "id": "site_102725345836253849", - "is_published": true, - "site_title": "My First Site", - "updated_at": "2020-11-23T02:19:10.000000Z" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-subscription-events-request.md b/doc/models/list-subscription-events-request.md deleted file mode 100644 index 9e5f213e..00000000 --- a/doc/models/list-subscription-events-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Subscription Events Request - -Defines input parameters in a request to the -[ListSubscriptionEvents](../../doc/apis/subscriptions.md#list-subscription-events) -endpoint. - -## Structure - -`ListSubscriptionEventsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The upper limit on the number of subscription events to return
in a paged response.
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor8", - "limit": 182 -} -``` - diff --git a/doc/models/list-subscription-events-response.md b/doc/models/list-subscription-events-response.md deleted file mode 100644 index a569522c..00000000 --- a/doc/models/list-subscription-events-response.md +++ /dev/null @@ -1,169 +0,0 @@ - -# List Subscription Events Response - -Defines output parameters in a response from the -[ListSubscriptionEvents](../../doc/apis/subscriptions.md#list-subscription-events). - -## Structure - -`ListSubscriptionEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscriptionEvents` | [`?(SubscriptionEvent[])`](../../doc/models/subscription-event.md) | Optional | The retrieved subscription events. | getSubscriptionEvents(): ?array | setSubscriptionEvents(?array subscriptionEvents): void | -| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of events.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "subscription_events": [ - { - "effective_date": "2020-04-24", - "id": "06809161-3867-4598-8269-8aea5be4f9de", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "START_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2020-05-01", - "id": "f2736603-cd2e-47ec-8675-f815fff54f88", - "info": { - "code": "CUSTOMER_NO_NAME", - "detail": "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record." - }, - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "DEACTIVATE_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2022-05-01", - "id": "b426fc85-6859-450b-b0d0-fe3a5d1b565f", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "RESUME_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2022-09-01", - "id": "09f14de1-2f53-4dae-9091-49aa53f83d01", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "PAUSE_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2022-12-01", - "id": "f28a73ac-1a1b-4b0f-8eeb-709a72945776", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "RESUME_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2023-04-01", - "id": "1eee8790-472d-4efe-8c69-8ad84e9cefe0", - "plan_variation_id": "02CD53CFA4d1498AFAD42", - "subscription_event_type": "PLAN_CHANGE", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - }, - { - "effective_date": "2023-06-21", - "id": "a0c08083-5db0-4800-85c7-d398de4fbb6e", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "STOP_SUBSCRIPTION", - "monthly_billing_anchor_date": 16, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor4" -} -``` - diff --git a/doc/models/list-team-member-booking-profiles-request.md b/doc/models/list-team-member-booking-profiles-request.md deleted file mode 100644 index bcfc58ef..00000000 --- a/doc/models/list-team-member-booking-profiles-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Team Member Booking Profiles Request - -## Structure - -`ListTeamMemberBookingProfilesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bookableOnly` | `?bool` | Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). | getBookableOnly(): ?bool | setBookableOnly(?bool bookableOnly): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.
**Constraints**: *Maximum Length*: `65536` | getCursor(): ?string | setCursor(?string cursor): void | -| `locationId` | `?string` | Optional | Indicates whether to include only team members enabled at the given location in the returned result.
**Constraints**: *Maximum Length*: `32` | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "bookable_only": false, - "limit": 112, - "cursor": "cursor2", - "location_id": "location_id8" -} -``` - diff --git a/doc/models/list-team-member-booking-profiles-response.md b/doc/models/list-team-member-booking-profiles-response.md deleted file mode 100644 index 56690f5e..00000000 --- a/doc/models/list-team-member-booking-profiles-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# List Team Member Booking Profiles Response - -## Structure - -`ListTeamMemberBookingProfilesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberBookingProfiles` | [`?(TeamMemberBookingProfile[])`](../../doc/models/team-member-booking-profile.md) | Optional | The list of team member booking profiles. The results are returned in the ascending order of the time
when the team member booking profiles were last updated. Multiple booking profiles updated at the same time
are further sorted in the ascending order of their IDs. | getTeamMemberBookingProfiles(): ?array | setTeamMemberBookingProfiles(?array teamMemberBookingProfiles): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.
**Constraints**: *Maximum Length*: `65536` | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "team_member_booking_profiles": [ - { - "display_name": "Sandbox Seller", - "is_bookable": true, - "team_member_id": "TMXUrsBWWcHTt79t", - "description": "description4", - "profile_image_url": "profile_image_url2" - }, - { - "display_name": "Sandbox Staff", - "is_bookable": true, - "team_member_id": "TMaJcbiRqPIGZuS9", - "description": "description4", - "profile_image_url": "profile_image_url2" - } - ], - "cursor": "cursor0" -} -``` - diff --git a/doc/models/list-team-member-wages-request.md b/doc/models/list-team-member-wages-request.md deleted file mode 100644 index 263f1242..00000000 --- a/doc/models/list-team-member-wages-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Team Member Wages Request - -A request for a set of `TeamMemberWage` objects. - -## Structure - -`ListTeamMemberWagesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberId` | `?string` | Optional | Filter the returned wages to only those that are associated with the
specified team member. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `limit` | `?int` | Optional | The maximum number of `TeamMemberWage` results to return per page. The number can range between
1 and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pointer to the next page of `EmployeeWage` results to fetch. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "team_member_id": "team_member_id2", - "limit": 210, - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-team-member-wages-response.md b/doc/models/list-team-member-wages-response.md deleted file mode 100644 index ea1ec500..00000000 --- a/doc/models/list-team-member-wages-response.md +++ /dev/null @@ -1,86 +0,0 @@ - -# List Team Member Wages Response - -The response to a request for a set of `TeamMemberWage` objects. The response contains -a set of `TeamMemberWage` objects. - -## Structure - -`ListTeamMemberWagesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberWages` | [`?(TeamMemberWage[])`](../../doc/models/team-member-wage.md) | Optional | A page of `TeamMemberWage` results. | getTeamMemberWages(): ?array | setTeamMemberWages(?array teamMemberWages): void | -| `cursor` | `?string` | Optional | The value supplied in the subsequent request to fetch the next page
of `TeamMemberWage` results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - "team_member_wages": [ - { - "hourly_rate": { - "amount": 3250, - "currency": "USD" - }, - "id": "pXS3qCv7BERPnEGedM4S8mhm", - "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "tip_eligible": false, - "title": "Manager" - }, - { - "hourly_rate": { - "amount": 2600, - "currency": "USD" - }, - "id": "rZduCkzYDUVL3ovh1sQgbue6", - "job_id": "gcbz15vKGnMKmaWJJ152kjim", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "tip_eligible": true, - "title": "Cook" - }, - { - "hourly_rate": { - "amount": 1600, - "currency": "USD" - }, - "id": "FxLbs5KpPUHa8wyt5ctjubDX", - "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "tip_eligible": true, - "title": "Barista" - }, - { - "hourly_rate": { - "amount": 1700, - "currency": "USD" - }, - "id": "vD1wCgijMDR3cX5TPnu7VXto", - "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "tip_eligible": true, - "title": "Cashier" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-transactions-request.md b/doc/models/list-transactions-request.md deleted file mode 100644 index 9c70901a..00000000 --- a/doc/models/list-transactions-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Transactions Request - -Defines the query parameters that can be included in -a request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint. - -Deprecated - recommend using [SearchOrders](api-endpoint:Orders-SearchOrders) - -## Structure - -`ListTransactionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "begin_time": "begin_time6", - "end_time": "end_time0", - "sort_order": "DESC", - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-transactions-response.md b/doc/models/list-transactions-response.md deleted file mode 100644 index c8986e18..00000000 --- a/doc/models/list-transactions-response.md +++ /dev/null @@ -1,111 +0,0 @@ - -# List Transactions Response - -Defines the fields that are included in the response body of -a request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint. - -One of `errors` or `transactions` is present in a given response (never both). - -## Structure - -`ListTransactionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `transactions` | [`?(Transaction[])`](../../doc/models/transaction.md) | Optional | An array of transactions that match your query. | getTransactions(): ?array | setTransactions(?array transactions): void | -| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "transactions": [ - { - "created_at": "2016-01-20T22:57:56Z", - "id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "location_id": "18YC4JDH91E1H", - "product": "EXTERNAL_API", - "reference_id": "some optional reference id", - "refunds": [ - { - "additional_recipients": [ - { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1", - "receivable_id": "receivable_id6" - } - ], - "amount_money": { - "amount": 5000, - "currency": "USD" - }, - "created_at": "2016-01-20T22:59:20Z", - "id": "7a5RcVI0CxbOcJ2wMOkE", - "location_id": "18YC4JDH91E1H", - "processing_fee_money": { - "amount": 138, - "currency": "USD" - }, - "reason": "some reason why", - "status": "APPROVED", - "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF" - } - ], - "tenders": [ - { - "additional_recipients": [ - { - "amount_money": { - "amount": 20, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1" - } - ], - "amount_money": { - "amount": 5000, - "currency": "USD" - }, - "card_details": { - "card": { - "card_brand": "VISA", - "last_4": "1111" - }, - "entry_method": "KEYED", - "status": "CAPTURED" - }, - "created_at": "2016-01-20T22:57:56Z", - "id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "location_id": "18YC4JDH91E1H", - "note": "some optional note", - "processing_fee_money": { - "amount": 138, - "currency": "USD" - }, - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "type": "CARD" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/list-webhook-event-types-request.md b/doc/models/list-webhook-event-types-request.md deleted file mode 100644 index 6b747cad..00000000 --- a/doc/models/list-webhook-event-types-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Webhook Event Types Request - -Lists all webhook event types that can be subscribed to. - -## Structure - -`ListWebhookEventTypesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `apiVersion` | `?string` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | - -## Example (as JSON) - -```json -{ - "api_version": "api_version0" -} -``` - diff --git a/doc/models/list-webhook-event-types-response.md b/doc/models/list-webhook-event-types-response.md deleted file mode 100644 index 90f6953f..00000000 --- a/doc/models/list-webhook-event-types-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# List Webhook Event Types Response - -Defines the fields that are included in the response body of -a request to the [ListWebhookEventTypes](../../doc/apis/webhook-subscriptions.md#list-webhook-event-types) endpoint. - -Note: if there are errors processing the request, the event types field will not be -present. - -## Structure - -`ListWebhookEventTypesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `eventTypes` | `?(string[])` | Optional | The list of event types. | getEventTypes(): ?array | setEventTypes(?array eventTypes): void | -| `metadata` | [`?(EventTypeMetadata[])`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | getMetadata(): ?array | setMetadata(?array metadata): void | - -## Example (as JSON) - -```json -{ - "event_types": [ - "inventory.count.updated" - ], - "metadata": [ - { - "api_version_introduced": "2018-07-12", - "event_type": "inventory.count.updated", - "release_status": "PUBLIC" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/list-webhook-subscriptions-request.md b/doc/models/list-webhook-subscriptions-request.md deleted file mode 100644 index 485769d1..00000000 --- a/doc/models/list-webhook-subscriptions-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Webhook Subscriptions Request - -Lists all [Subscription](../../doc/models/webhook-subscription.md)s owned by your application. - -## Structure - -`ListWebhookSubscriptionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: *Maximum Length*: `256` | getCursor(): ?string | setCursor(?string cursor): void | -| `includeDisabled` | `?bool` | Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. | getIncludeDisabled(): ?bool | setIncludeDisabled(?bool includeDisabled): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.
The default value of 100 is also the maximum allowed value.

Default: 100
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor2", - "include_disabled": false, - "sort_order": "DESC", - "limit": 190 -} -``` - diff --git a/doc/models/list-webhook-subscriptions-response.md b/doc/models/list-webhook-subscriptions-response.md deleted file mode 100644 index cd48f513..00000000 --- a/doc/models/list-webhook-subscriptions-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Webhook Subscriptions Response - -Defines the fields that are included in the response body of -a request to the [ListWebhookSubscriptions](../../doc/apis/webhook-subscriptions.md#list-webhook-subscriptions) endpoint. - -Note: if there are errors processing the request, the subscriptions field will not be -present. - -## Structure - -`ListWebhookSubscriptionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscriptions` | [`?(WebhookSubscription[])`](../../doc/models/webhook-subscription.md) | Optional | The requested list of [Subscription](entity:WebhookSubscription)s. | getSubscriptions(): ?array | setSubscriptions(?array subscriptions): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "api_version": "2021-12-15", - "created_at": "2022-01-10 23:29:48 +0000 UTC", - "enabled": true, - "event_types": [ - "payment.created", - "payment.updated" - ], - "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", - "name": "Example Webhook Subscription", - "notification_url": "https://example-webhook-url.com", - "updated_at": "2022-01-10 23:29:48 +0000 UTC" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6" -} -``` - diff --git a/doc/models/list-workweek-configs-request.md b/doc/models/list-workweek-configs-request.md deleted file mode 100644 index 9ba90c48..00000000 --- a/doc/models/list-workweek-configs-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Workweek Configs Request - -A request for a set of `WorkweekConfig` objects. - -## Structure - -`ListWorkweekConfigsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `limit` | `?int` | Optional | The maximum number of `WorkweekConfigs` results to return per page. | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 98, - "cursor": "cursor0" -} -``` - diff --git a/doc/models/list-workweek-configs-response.md b/doc/models/list-workweek-configs-response.md deleted file mode 100644 index f727acc8..00000000 --- a/doc/models/list-workweek-configs-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# List Workweek Configs Response - -The response to a request for a set of `WorkweekConfig` objects. The response contains -the requested `WorkweekConfig` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`ListWorkweekConfigsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `workweekConfigs` | [`?(WorkweekConfig[])`](../../doc/models/workweek-config.md) | Optional | A page of `WorkweekConfig` results. | getWorkweekConfigs(): ?array | setWorkweekConfigs(?array workweekConfigs): void | -| `cursor` | `?string` | Optional | The value supplied in the subsequent request to fetch the next page of
`WorkweekConfig` results. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - "workweek_configs": [ - { - "created_at": "2016-02-04T00:58:24Z", - "id": "FY4VCAQN700GM", - "start_of_day_local_time": "10:00", - "start_of_week": "MON", - "updated_at": "2019-02-28T01:04:35Z", - "version": 11 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/location-booking-profile.md b/doc/models/location-booking-profile.md deleted file mode 100644 index cddbb9af..00000000 --- a/doc/models/location-booking-profile.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Location Booking Profile - -The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. - -## Structure - -`LocationBookingProfile` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the [location](entity:Location). | getLocationId(): ?string | setLocationId(?string locationId): void | -| `bookingSiteUrl` | `?string` | Optional | Url for the online booking site for this location. | getBookingSiteUrl(): ?string | setBookingSiteUrl(?string bookingSiteUrl): void | -| `onlineBookingEnabled` | `?bool` | Optional | Indicates whether the location is enabled for online booking. | getOnlineBookingEnabled(): ?bool | setOnlineBookingEnabled(?bool onlineBookingEnabled): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id8", - "booking_site_url": "booking_site_url4", - "online_booking_enabled": false -} -``` - diff --git a/doc/models/location-capability.md b/doc/models/location-capability.md deleted file mode 100644 index bed5e30e..00000000 --- a/doc/models/location-capability.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Location Capability - -The capabilities a location might have. - -## Enumeration - -`LocationCapability` - -## Fields - -| Name | Description | -| --- | --- | -| `CREDIT_CARD_PROCESSING` | The capability to process credit card transactions with Square. | -| `AUTOMATIC_TRANSFERS` | The capability to receive automatic transfers from Square. | -| `UNLINKED_REFUNDS` | The capability to process unlinked refunds with Square. | - diff --git a/doc/models/location-status.md b/doc/models/location-status.md deleted file mode 100644 index 3edf1db7..00000000 --- a/doc/models/location-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Location Status - -A location's status. - -## Enumeration - -`LocationStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | A location that is active for business. | -| `INACTIVE` | A location that is not active for business. Inactive locations provide historical
information. Hide inactive locations unless the user has requested to see them. | - diff --git a/doc/models/location-type.md b/doc/models/location-type.md deleted file mode 100644 index 5aaf34af..00000000 --- a/doc/models/location-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Location Type - -A location's type. - -## Enumeration - -`LocationType` - -## Fields - -| Name | Description | -| --- | --- | -| `PHYSICAL` | A place of business with a physical location. | -| `MOBILE` | A place of business that is mobile, such as a food truck or online store. | - diff --git a/doc/models/location.md b/doc/models/location.md deleted file mode 100644 index e640f193..00000000 --- a/doc/models/location.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Location - -Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - -## Structure - -`Location` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A short generated string of letters and numbers that uniquely identifies this location instance.
**Constraints**: *Maximum Length*: `32` | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | The name of the location.
This information appears in the Seller Dashboard as the nickname.
A location name must be unique within a seller account.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `timezone` | `?string` | Optional | The [IANA time zone](https://www.iana.org/time-zones) identifier for
the time zone of the location. For example, `America/Los_Angeles`.
**Constraints**: *Maximum Length*: `30` | getTimezone(): ?string | setTimezone(?string timezone): void | -| `capabilities` | [`?(string(LocationCapability)[])`](../../doc/models/location-capability.md) | Optional | The Square features that are enabled for the location.
See [LocationCapability](entity:LocationCapability) for possible values.
See [LocationCapability](#type-locationcapability) for possible values | getCapabilities(): ?array | setCapabilities(?array capabilities): void | -| `status` | [`?string(LocationStatus)`](../../doc/models/location-status.md) | Optional | A location's status. | getStatus(): ?string | setStatus(?string status): void | -| `createdAt` | `?string` | Optional | The time when the location was created, in RFC 3339 format.
For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `25` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `merchantId` | `?string` | Optional | The ID of the merchant that owns the location.
**Constraints**: *Maximum Length*: `32` | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `country` | [`?string(Country)`](../../doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | getCountry(): ?string | setCountry(?string country): void | -| `languageCode` | `?string` | Optional | The language associated with the location, in
[BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).
For more information, see [Language Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `5` | getLanguageCode(): ?string | setLanguageCode(?string languageCode): void | -| `currency` | [`?string(Currency)`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | getCurrency(): ?string | setCurrency(?string currency): void | -| `phoneNumber` | `?string` | Optional | The phone number of the location. For example, `+1 855-700-6000`.
**Constraints**: *Maximum Length*: `17` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `businessName` | `?string` | Optional | The name of the location's overall business. This name is present on receipts and other customer-facing branding, and can be changed no more than three times in a twelve-month period.
**Constraints**: *Maximum Length*: `255` | getBusinessName(): ?string | setBusinessName(?string businessName): void | -| `type` | [`?string(LocationType)`](../../doc/models/location-type.md) | Optional | A location's type. | getType(): ?string | setType(?string type): void | -| `websiteUrl` | `?string` | Optional | The website URL of the location. For example, `https://squareup.com`.
**Constraints**: *Maximum Length*: `255` | getWebsiteUrl(): ?string | setWebsiteUrl(?string websiteUrl): void | -| `businessHours` | [`?BusinessHours`](../../doc/models/business-hours.md) | Optional | The hours of operation for a location. | getBusinessHours(): ?BusinessHours | setBusinessHours(?BusinessHours businessHours): void | -| `businessEmail` | `?string` | Optional | The email address of the location. This can be unique to the location and is not always the email address for the business owner or administrator.
**Constraints**: *Maximum Length*: `255` | getBusinessEmail(): ?string | setBusinessEmail(?string businessEmail): void | -| `description` | `?string` | Optional | The description of the location. For example, `Main Street location`.
**Constraints**: *Maximum Length*: `1024` | getDescription(): ?string | setDescription(?string description): void | -| `twitterUsername` | `?string` | Optional | The Twitter username of the location without the '@' symbol. For example, `Square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `15` | getTwitterUsername(): ?string | setTwitterUsername(?string twitterUsername): void | -| `instagramUsername` | `?string` | Optional | The Instagram username of the location without the '@' symbol. For example, `square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | getInstagramUsername(): ?string | setInstagramUsername(?string instagramUsername): void | -| `facebookUrl` | `?string` | Optional | The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, `https://www.facebook.com/square`.
**Constraints**: *Maximum Length*: `255` | getFacebookUrl(): ?string | setFacebookUrl(?string facebookUrl): void | -| `coordinates` | [`?Coordinates`](../../doc/models/coordinates.md) | Optional | Latitude and longitude coordinates. | getCoordinates(): ?Coordinates | setCoordinates(?Coordinates coordinates): void | -| `logoUrl` | `?string` | Optional | The URL of the logo image for the location. When configured in the Seller
Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.
This image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels.
**Constraints**: *Maximum Length*: `255` | getLogoUrl(): ?string | setLogoUrl(?string logoUrl): void | -| `posBackgroundUrl` | `?string` | Optional | The URL of the Point of Sale background image for the location.
**Constraints**: *Maximum Length*: `255` | getPosBackgroundUrl(): ?string | setPosBackgroundUrl(?string posBackgroundUrl): void | -| `mcc` | `?string` | Optional | A four-digit number that describes the kind of goods or services sold at the location.
The [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) of the location as standardized by ISO 18245.
For example, `5045`, for a location that sells computer goods and software.
**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4` | getMcc(): ?string | setMcc(?string mcc): void | -| `fullFormatLogoUrl` | `?string` | Optional | The URL of a full-format logo image for the location. When configured in the Seller
Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.
This image can be wider than it is tall and should be at least 1280x648 pixels. | getFullFormatLogoUrl(): ?string | setFullFormatLogoUrl(?string fullFormatLogoUrl): void | -| `taxIds` | [`?TaxIds`](../../doc/models/tax-ids.md) | Optional | Identifiers for the location used by various governments for tax purposes. | getTaxIds(): ?TaxIds | setTaxIds(?TaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "name": "name4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - }, - "timezone": "timezone4", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ] -} -``` - diff --git a/doc/models/loyalty-account-expiring-point-deadline.md b/doc/models/loyalty-account-expiring-point-deadline.md deleted file mode 100644 index 4c686246..00000000 --- a/doc/models/loyalty-account-expiring-point-deadline.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Account Expiring Point Deadline - -Represents a set of points for a loyalty account that are scheduled to expire on a specific date. - -## Structure - -`LoyaltyAccountExpiringPointDeadline` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `points` | `int` | Required | The number of points scheduled to expire at the `expires_at` timestamp. | getPoints(): int | setPoints(int points): void | -| `expiresAt` | `string` | Required | The timestamp of when the points are scheduled to expire, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | getExpiresAt(): string | setExpiresAt(string expiresAt): void | - -## Example (as JSON) - -```json -{ - "points": 104, - "expires_at": "expires_at6" -} -``` - diff --git a/doc/models/loyalty-account-mapping-type.md b/doc/models/loyalty-account-mapping-type.md deleted file mode 100644 index 1367bd91..00000000 --- a/doc/models/loyalty-account-mapping-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Loyalty Account Mapping Type - -The type of mapping. - -## Enumeration - -`LoyaltyAccountMappingType` - -## Fields - -| Name | Description | -| --- | --- | -| `PHONE` | The loyalty account is mapped by phone. | - diff --git a/doc/models/loyalty-account-mapping.md b/doc/models/loyalty-account-mapping.md deleted file mode 100644 index 9eb5c9c1..00000000 --- a/doc/models/loyalty-account-mapping.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Loyalty Account Mapping - -Represents the mapping that associates a loyalty account with a buyer. - -Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see -[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). - -## Structure - -`LoyaltyAccountMapping` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the mapping.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `createdAt` | `?string` | Optional | The timestamp when the mapping was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `phoneNumber` | `?string` | Optional | The phone number of the buyer, in E.164 format. For example, "+14155551111". | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "created_at": "created_at0", - "phone_number": "phone_number0" -} -``` - diff --git a/doc/models/loyalty-account.md b/doc/models/loyalty-account.md deleted file mode 100644 index 6e627071..00000000 --- a/doc/models/loyalty-account.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Loyalty Account - -Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see -[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). - -## Structure - -`LoyaltyAccount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the loyalty account.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `programId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getProgramId(): string | setProgramId(string programId): void | -| `balance` | `?int` | Optional | The available point balance in the loyalty account. If points are scheduled to expire, they are listed in the `expiring_point_deadlines` field.

Your application should be able to handle loyalty accounts that have a negative point balance (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of a refund or exchange. | getBalance(): ?int | setBalance(?int balance): void | -| `lifetimePoints` | `?int` | Optional | The total points accrued during the lifetime of the account. | getLifetimePoints(): ?int | setLifetimePoints(?int lifetimePoints): void | -| `customerId` | `?string` | Optional | The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `enrolledAt` | `?string` | Optional | The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products.

If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account
(when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account.
For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future. | getEnrolledAt(): ?string | setEnrolledAt(?string enrolledAt): void | -| `createdAt` | `?string` | Optional | The timestamp when the loyalty account was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the loyalty account was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `mapping` | [`?LoyaltyAccountMapping`](../../doc/models/loyalty-account-mapping.md) | Optional | Represents the mapping that associates a loyalty account with a buyer.

Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). | getMapping(): ?LoyaltyAccountMapping | setMapping(?LoyaltyAccountMapping mapping): void | -| `expiringPointDeadlines` | [`?(LoyaltyAccountExpiringPointDeadline[])`](../../doc/models/loyalty-account-expiring-point-deadline.md) | Optional | The schedule for when points expire in the loyalty account balance. This field is present only if the account has points that are scheduled to expire.

The total number of points in this field equals the number of points in the `balance` field. | getExpiringPointDeadlines(): ?array | setExpiringPointDeadlines(?array expiringPointDeadlines): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "program_id": "program_id6", - "balance": 52, - "lifetime_points": 76, - "customer_id": "customer_id2", - "enrolled_at": "enrolled_at4" -} -``` - diff --git a/doc/models/loyalty-event-accumulate-points.md b/doc/models/loyalty-event-accumulate-points.md deleted file mode 100644 index d2f03ac0..00000000 --- a/doc/models/loyalty-event-accumulate-points.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Accumulate Points - -Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - -## Structure - -`LoyaltyEventAccumulatePoints` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `?string` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | -| `points` | `?int` | Optional | The number of points accumulated by the event.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | -| `orderId` | `?string` | Optional | The ID of the [order](entity:Order) for which the buyer accumulated the points.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id0", - "points": 104, - "order_id": "order_id4" -} -``` - diff --git a/doc/models/loyalty-event-accumulate-promotion-points.md b/doc/models/loyalty-event-accumulate-promotion-points.md deleted file mode 100644 index 7a91034c..00000000 --- a/doc/models/loyalty-event-accumulate-promotion-points.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Loyalty Event Accumulate Promotion Points - -Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. - -## Structure - -`LoyaltyEventAccumulatePromotionPoints` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `?string` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | -| `loyaltyPromotionId` | `?string` | Optional | The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getLoyaltyPromotionId(): ?string | setLoyaltyPromotionId(?string loyaltyPromotionId): void | -| `points` | `int` | Required | The number of points earned by the event. | getPoints(): int | setPoints(int points): void | -| `orderId` | `string` | Required | The ID of the [order](entity:Order) for which the buyer earned the promotion points.
Only applications that use the Orders API to process orders can trigger this event.
**Constraints**: *Minimum Length*: `1` | getOrderId(): string | setOrderId(string orderId): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id0", - "loyalty_promotion_id": "loyalty_promotion_id8", - "points": 98, - "order_id": "order_id4" -} -``` - diff --git a/doc/models/loyalty-event-adjust-points.md b/doc/models/loyalty-event-adjust-points.md deleted file mode 100644 index 863081e0..00000000 --- a/doc/models/loyalty-event-adjust-points.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Adjust Points - -Provides metadata when the event `type` is `ADJUST_POINTS`. - -## Structure - -`LoyaltyEventAdjustPoints` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `?string` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | -| `points` | `int` | Required | The number of points added or removed. | getPoints(): int | setPoints(int points): void | -| `reason` | `?string` | Optional | The reason for the adjustment of points. | getReason(): ?string | setReason(?string reason): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id4", - "points": 98, - "reason": "reason0" -} -``` - diff --git a/doc/models/loyalty-event-create-reward.md b/doc/models/loyalty-event-create-reward.md deleted file mode 100644 index 7c0817e9..00000000 --- a/doc/models/loyalty-event-create-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Create Reward - -Provides metadata when the event `type` is `CREATE_REWARD`. - -## Structure - -`LoyaltyEventCreateReward` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | -| `points` | `int` | Required | The loyalty points used to create the reward. | getPoints(): int | setPoints(int points): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 198 -} -``` - diff --git a/doc/models/loyalty-event-date-time-filter.md b/doc/models/loyalty-event-date-time-filter.md deleted file mode 100644 index 97e80e5e..00000000 --- a/doc/models/loyalty-event-date-time-filter.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Loyalty Event Date Time Filter - -Filter events by date time range. - -## Structure - -`LoyaltyEventDateTimeFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `createdAt` | [`TimeRange`](../../doc/models/time-range.md) | Required | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): TimeRange | setCreatedAt(TimeRange createdAt): void | - -## Example (as JSON) - -```json -{ - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } -} -``` - diff --git a/doc/models/loyalty-event-delete-reward.md b/doc/models/loyalty-event-delete-reward.md deleted file mode 100644 index 110a5cd2..00000000 --- a/doc/models/loyalty-event-delete-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Delete Reward - -Provides metadata when the event `type` is `DELETE_REWARD`. - -## Structure - -`LoyaltyEventDeleteReward` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The ID of the deleted [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | -| `points` | `int` | Required | The number of points returned to the loyalty account. | getPoints(): int | setPoints(int points): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 84 -} -``` - diff --git a/doc/models/loyalty-event-expire-points.md b/doc/models/loyalty-event-expire-points.md deleted file mode 100644 index 3967a7b8..00000000 --- a/doc/models/loyalty-event-expire-points.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Event Expire Points - -Provides metadata when the event `type` is `EXPIRE_POINTS`. - -## Structure - -`LoyaltyEventExpirePoints` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `points` | `int` | Required | The number of points expired. | getPoints(): int | setPoints(int points): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id8", - "points": 84 -} -``` - diff --git a/doc/models/loyalty-event-filter.md b/doc/models/loyalty-event-filter.md deleted file mode 100644 index 569402ed..00000000 --- a/doc/models/loyalty-event-filter.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Loyalty Event Filter - -The filtering criteria. If the request specifies multiple filters, -the endpoint uses a logical AND to evaluate them. - -## Structure - -`LoyaltyEventFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyAccountFilter` | [`?LoyaltyEventLoyaltyAccountFilter`](../../doc/models/loyalty-event-loyalty-account-filter.md) | Optional | Filter events by loyalty account. | getLoyaltyAccountFilter(): ?LoyaltyEventLoyaltyAccountFilter | setLoyaltyAccountFilter(?LoyaltyEventLoyaltyAccountFilter loyaltyAccountFilter): void | -| `typeFilter` | [`?LoyaltyEventTypeFilter`](../../doc/models/loyalty-event-type-filter.md) | Optional | Filter events by event type. | getTypeFilter(): ?LoyaltyEventTypeFilter | setTypeFilter(?LoyaltyEventTypeFilter typeFilter): void | -| `dateTimeFilter` | [`?LoyaltyEventDateTimeFilter`](../../doc/models/loyalty-event-date-time-filter.md) | Optional | Filter events by date time range. | getDateTimeFilter(): ?LoyaltyEventDateTimeFilter | setDateTimeFilter(?LoyaltyEventDateTimeFilter dateTimeFilter): void | -| `locationFilter` | [`?LoyaltyEventLocationFilter`](../../doc/models/loyalty-event-location-filter.md) | Optional | Filter events by location. | getLocationFilter(): ?LoyaltyEventLocationFilter | setLocationFilter(?LoyaltyEventLocationFilter locationFilter): void | -| `orderFilter` | [`?LoyaltyEventOrderFilter`](../../doc/models/loyalty-event-order-filter.md) | Optional | Filter events by the order associated with the event. | getOrderFilter(): ?LoyaltyEventOrderFilter | setOrderFilter(?LoyaltyEventOrderFilter orderFilter): void | - -## Example (as JSON) - -```json -{ - "loyalty_account_filter": { - "loyalty_account_id": "loyalty_account_id8" - }, - "type_filter": { - "types": [ - "ACCUMULATE_PROMOTION_POINTS", - "ACCUMULATE_POINTS", - "CREATE_REWARD" - ] - }, - "date_time_filter": { - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "location_filter": { - "location_ids": [ - "location_ids0", - "location_ids1", - "location_ids2" - ] - }, - "order_filter": { - "order_id": "order_id2" - } -} -``` - diff --git a/doc/models/loyalty-event-location-filter.md b/doc/models/loyalty-event-location-filter.md deleted file mode 100644 index a7a343db..00000000 --- a/doc/models/loyalty-event-location-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Location Filter - -Filter events by location. - -## Structure - -`LoyaltyEventLocationFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `string[]` | Required | The [location](entity:Location) IDs for loyalty events to query.
If multiple values are specified, the endpoint uses
a logical OR to combine them. | getLocationIds(): array | setLocationIds(array locationIds): void | - -## Example (as JSON) - -```json -{ - "location_ids": [ - "location_ids6", - "location_ids7", - "location_ids8" - ] -} -``` - diff --git a/doc/models/loyalty-event-loyalty-account-filter.md b/doc/models/loyalty-event-loyalty-account-filter.md deleted file mode 100644 index ecba9010..00000000 --- a/doc/models/loyalty-event-loyalty-account-filter.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Event Loyalty Account Filter - -Filter events by loyalty account. - -## Structure - -`LoyaltyEventLoyaltyAccountFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events.
**Constraints**: *Minimum Length*: `1` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | - -## Example (as JSON) - -```json -{ - "loyalty_account_id": "loyalty_account_id2" -} -``` - diff --git a/doc/models/loyalty-event-order-filter.md b/doc/models/loyalty-event-order-filter.md deleted file mode 100644 index 05fd21b2..00000000 --- a/doc/models/loyalty-event-order-filter.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Event Order Filter - -Filter events by the order associated with the event. - -## Structure - -`LoyaltyEventOrderFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `string` | Required | The ID of the [order](entity:Order) associated with the event.
**Constraints**: *Minimum Length*: `1` | getOrderId(): string | setOrderId(string orderId): void | - -## Example (as JSON) - -```json -{ - "order_id": "order_id4" -} -``` - diff --git a/doc/models/loyalty-event-other.md b/doc/models/loyalty-event-other.md deleted file mode 100644 index 9950ea8a..00000000 --- a/doc/models/loyalty-event-other.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Event Other - -Provides metadata when the event `type` is `OTHER`. - -## Structure - -`LoyaltyEventOther` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `points` | `int` | Required | The number of points added or removed. | getPoints(): int | setPoints(int points): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id4", - "points": 94 -} -``` - diff --git a/doc/models/loyalty-event-query.md b/doc/models/loyalty-event-query.md deleted file mode 100644 index 9a666ab6..00000000 --- a/doc/models/loyalty-event-query.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Loyalty Event Query - -Represents a query used to search for loyalty events. - -## Structure - -`LoyaltyEventQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?LoyaltyEventFilter`](../../doc/models/loyalty-event-filter.md) | Optional | The filtering criteria. If the request specifies multiple filters,
the endpoint uses a logical AND to evaluate them. | getFilter(): ?LoyaltyEventFilter | setFilter(?LoyaltyEventFilter filter): void | - -## Example (as JSON) - -```json -{ - "filter": { - "loyalty_account_filter": { - "loyalty_account_id": "loyalty_account_id8" - }, - "type_filter": { - "types": [ - "ACCUMULATE_PROMOTION_POINTS", - "ACCUMULATE_POINTS", - "CREATE_REWARD" - ] - }, - "date_time_filter": { - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "location_filter": { - "location_ids": [ - "location_ids0", - "location_ids1", - "location_ids2" - ] - }, - "order_filter": { - "order_id": "order_id2" - } - } -} -``` - diff --git a/doc/models/loyalty-event-redeem-reward.md b/doc/models/loyalty-event-redeem-reward.md deleted file mode 100644 index 0bc0c76c..00000000 --- a/doc/models/loyalty-event-redeem-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Redeem Reward - -Provides metadata when the event `type` is `REDEEM_REWARD`. - -## Structure - -`LoyaltyEventRedeemReward` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The ID of the redeemed [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | -| `orderId` | `?string` | Optional | The ID of the [order](entity:Order) that redeemed the reward.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "order_id": "order_id8" -} -``` - diff --git a/doc/models/loyalty-event-source.md b/doc/models/loyalty-event-source.md deleted file mode 100644 index 4cfa3d59..00000000 --- a/doc/models/loyalty-event-source.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Loyalty Event Source - -Defines whether the event was generated by the Square Point of Sale. - -## Enumeration - -`LoyaltyEventSource` - -## Fields - -| Name | Description | -| --- | --- | -| `SQUARE` | The event is generated by the Square Point of Sale (POS). | -| `LOYALTY_API` | The event is generated by something other than the Square Point of Sale that used the Loyalty API. | - diff --git a/doc/models/loyalty-event-type-filter.md b/doc/models/loyalty-event-type-filter.md deleted file mode 100644 index 45112310..00000000 --- a/doc/models/loyalty-event-type-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Type Filter - -Filter events by event type. - -## Structure - -`LoyaltyEventTypeFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `types` | [`string(LoyaltyEventType)[]`](../../doc/models/loyalty-event-type.md) | Required | The loyalty event types used to filter the result.
If multiple values are specified, the endpoint uses a
logical OR to combine them.
See [LoyaltyEventType](#type-loyaltyeventtype) for possible values | getTypes(): array | setTypes(array types): void | - -## Example (as JSON) - -```json -{ - "types": [ - "EXPIRE_POINTS", - "OTHER", - "ACCUMULATE_PROMOTION_POINTS" - ] -} -``` - diff --git a/doc/models/loyalty-event-type.md b/doc/models/loyalty-event-type.md deleted file mode 100644 index 71364f4f..00000000 --- a/doc/models/loyalty-event-type.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Loyalty Event Type - -The type of the loyalty event. - -## Enumeration - -`LoyaltyEventType` - -## Fields - -| Name | Description | -| --- | --- | -| `ACCUMULATE_POINTS` | Points are added to a loyalty account for a purchase that
qualified for points based on an [accrual rule](../../doc/models/loyalty-program-accrual-rule.md). | -| `CREATE_REWARD` | A [loyalty reward](../../doc/models/loyalty-reward.md) is created. | -| `REDEEM_REWARD` | A loyalty reward is redeemed. | -| `DELETE_REWARD` | A loyalty reward is deleted. | -| `ADJUST_POINTS` | Loyalty points are manually adjusted. | -| `EXPIRE_POINTS` | Loyalty points are expired according to the
expiration policy of the loyalty program. | -| `OTHER` | Some other loyalty event occurred. | -| `ACCUMULATE_PROMOTION_POINTS` | Points are added to a loyalty account for a purchase that
qualified for a [loyalty promotion](../../doc/models/loyalty-promotion.md). | - diff --git a/doc/models/loyalty-event.md b/doc/models/loyalty-event.md deleted file mode 100644 index 66e4cad0..00000000 --- a/doc/models/loyalty-event.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Loyalty Event - -Provides information about a loyalty event. -For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). - -## Structure - -`LoyaltyEvent` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The Square-assigned ID of the loyalty event.
**Constraints**: *Minimum Length*: `1` | getId(): string | setId(string id): void | -| `type` | [`string(LoyaltyEventType)`](../../doc/models/loyalty-event-type.md) | Required | The type of the loyalty event. | getType(): string | setType(string type): void | -| `createdAt` | `string` | Required | The timestamp when the event was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | getCreatedAt(): string | setCreatedAt(string createdAt): void | -| `accumulatePoints` | [`?LoyaltyEventAccumulatePoints`](../../doc/models/loyalty-event-accumulate-points.md) | Optional | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | getAccumulatePoints(): ?LoyaltyEventAccumulatePoints | setAccumulatePoints(?LoyaltyEventAccumulatePoints accumulatePoints): void | -| `createReward` | [`?LoyaltyEventCreateReward`](../../doc/models/loyalty-event-create-reward.md) | Optional | Provides metadata when the event `type` is `CREATE_REWARD`. | getCreateReward(): ?LoyaltyEventCreateReward | setCreateReward(?LoyaltyEventCreateReward createReward): void | -| `redeemReward` | [`?LoyaltyEventRedeemReward`](../../doc/models/loyalty-event-redeem-reward.md) | Optional | Provides metadata when the event `type` is `REDEEM_REWARD`. | getRedeemReward(): ?LoyaltyEventRedeemReward | setRedeemReward(?LoyaltyEventRedeemReward redeemReward): void | -| `deleteReward` | [`?LoyaltyEventDeleteReward`](../../doc/models/loyalty-event-delete-reward.md) | Optional | Provides metadata when the event `type` is `DELETE_REWARD`. | getDeleteReward(): ?LoyaltyEventDeleteReward | setDeleteReward(?LoyaltyEventDeleteReward deleteReward): void | -| `adjustPoints` | [`?LoyaltyEventAdjustPoints`](../../doc/models/loyalty-event-adjust-points.md) | Optional | Provides metadata when the event `type` is `ADJUST_POINTS`. | getAdjustPoints(): ?LoyaltyEventAdjustPoints | setAdjustPoints(?LoyaltyEventAdjustPoints adjustPoints): void | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | -| `locationId` | `?string` | Optional | The ID of the [location](entity:Location) where the event occurred. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `source` | [`string(LoyaltyEventSource)`](../../doc/models/loyalty-event-source.md) | Required | Defines whether the event was generated by the Square Point of Sale. | getSource(): string | setSource(string source): void | -| `expirePoints` | [`?LoyaltyEventExpirePoints`](../../doc/models/loyalty-event-expire-points.md) | Optional | Provides metadata when the event `type` is `EXPIRE_POINTS`. | getExpirePoints(): ?LoyaltyEventExpirePoints | setExpirePoints(?LoyaltyEventExpirePoints expirePoints): void | -| `otherEvent` | [`?LoyaltyEventOther`](../../doc/models/loyalty-event-other.md) | Optional | Provides metadata when the event `type` is `OTHER`. | getOtherEvent(): ?LoyaltyEventOther | setOtherEvent(?LoyaltyEventOther otherEvent): void | -| `accumulatePromotionPoints` | [`?LoyaltyEventAccumulatePromotionPoints`](../../doc/models/loyalty-event-accumulate-promotion-points.md) | Optional | Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. | getAccumulatePromotionPoints(): ?LoyaltyEventAccumulatePromotionPoints | setAccumulatePromotionPoints(?LoyaltyEventAccumulatePromotionPoints accumulatePromotionPoints): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "type": "ACCUMULATE_POINTS", - "created_at": "created_at2", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - }, - "loyalty_account_id": "loyalty_account_id0", - "source": "SQUARE" -} -``` - diff --git a/doc/models/loyalty-program-accrual-rule-category-data.md b/doc/models/loyalty-program-accrual-rule-category-data.md deleted file mode 100644 index 11e7dbc0..00000000 --- a/doc/models/loyalty-program-accrual-rule-category-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Accrual Rule Category Data - -Represents additional data for rules with the `CATEGORY` accrual type. - -## Structure - -`LoyaltyProgramAccrualRuleCategoryData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `categoryId` | `string` | Required | The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn
points.
**Constraints**: *Minimum Length*: `1` | getCategoryId(): string | setCategoryId(string categoryId): void | - -## Example (as JSON) - -```json -{ - "category_id": "category_id6" -} -``` - diff --git a/doc/models/loyalty-program-accrual-rule-item-variation-data.md b/doc/models/loyalty-program-accrual-rule-item-variation-data.md deleted file mode 100644 index 65fd2c9b..00000000 --- a/doc/models/loyalty-program-accrual-rule-item-variation-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Accrual Rule Item Variation Data - -Represents additional data for rules with the `ITEM_VARIATION` accrual type. - -## Structure - -`LoyaltyProgramAccrualRuleItemVariationData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemVariationId` | `string` | Required | The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to earn
points.
**Constraints**: *Minimum Length*: `1` | getItemVariationId(): string | setItemVariationId(string itemVariationId): void | - -## Example (as JSON) - -```json -{ - "item_variation_id": "item_variation_id6" -} -``` - diff --git a/doc/models/loyalty-program-accrual-rule-spend-data.md b/doc/models/loyalty-program-accrual-rule-spend-data.md deleted file mode 100644 index a284913d..00000000 --- a/doc/models/loyalty-program-accrual-rule-spend-data.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Loyalty Program Accrual Rule Spend Data - -Represents additional data for rules with the `SPEND` accrual type. - -## Structure - -`LoyaltyProgramAccrualRuleSpendData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `excludedCategoryIds` | `?(string[])` | Optional | The IDs of any `CATEGORY` catalog objects that are excluded from points accrual.

You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)
endpoint to retrieve information about the excluded categories. | getExcludedCategoryIds(): ?array | setExcludedCategoryIds(?array excludedCategoryIds): void | -| `excludedItemVariationIds` | `?(string[])` | Optional | The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual.

You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)
endpoint to retrieve information about the excluded item variations. | getExcludedItemVariationIds(): ?array | setExcludedItemVariationIds(?array excludedItemVariationIds): void | -| `taxMode` | [`string(LoyaltyProgramAccrualRuleTaxMode)`](../../doc/models/loyalty-program-accrual-rule-tax-mode.md) | Required | Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual.
This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. | getTaxMode(): string | setTaxMode(string taxMode): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "excluded_category_ids": [ - "excluded_category_ids4" - ], - "excluded_item_variation_ids": [ - "excluded_item_variation_ids7", - "excluded_item_variation_ids6" - ], - "tax_mode": "BEFORE_TAX" -} -``` - diff --git a/doc/models/loyalty-program-accrual-rule-tax-mode.md b/doc/models/loyalty-program-accrual-rule-tax-mode.md deleted file mode 100644 index 6a4d1016..00000000 --- a/doc/models/loyalty-program-accrual-rule-tax-mode.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Loyalty Program Accrual Rule Tax Mode - -Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. -This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. - -## Enumeration - -`LoyaltyProgramAccrualRuleTaxMode` - -## Fields - -| Name | Description | -| --- | --- | -| `BEFORE_TAX` | Exclude taxes from the purchase amount used for loyalty points accrual. | -| `AFTER_TAX` | Include taxes in the purchase amount used for loyalty points accrual. | - diff --git a/doc/models/loyalty-program-accrual-rule-type.md b/doc/models/loyalty-program-accrual-rule-type.md deleted file mode 100644 index cf8384ee..00000000 --- a/doc/models/loyalty-program-accrual-rule-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Loyalty Program Accrual Rule Type - -The type of the accrual rule that defines how buyers can earn points. - -## Enumeration - -`LoyaltyProgramAccrualRuleType` - -## Fields - -| Name | Description | -| --- | --- | -| `VISIT` | A visit-based accrual rule. A buyer earns points for each visit.
You can specify the minimum purchase required. | -| `SPEND` | A spend-based accrual rule. A buyer earns points based on the amount
spent. | -| `ITEM_VARIATION` | An accrual rule based on an item variation. For example, accrue
points for purchasing a coffee. | -| `CATEGORY` | An accrual rule based on an item category. For example, accrue points
for purchasing any item in the "hot drink" category: coffee, tea, or hot cocoa. | - diff --git a/doc/models/loyalty-program-accrual-rule-visit-data.md b/doc/models/loyalty-program-accrual-rule-visit-data.md deleted file mode 100644 index 72490a4f..00000000 --- a/doc/models/loyalty-program-accrual-rule-visit-data.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Loyalty Program Accrual Rule Visit Data - -Represents additional data for rules with the `VISIT` accrual type. - -## Structure - -`LoyaltyProgramAccrualRuleVisitData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `minimumAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMinimumAmountMoney(): ?Money | setMinimumAmountMoney(?Money minimumAmountMoney): void | -| `taxMode` | [`string(LoyaltyProgramAccrualRuleTaxMode)`](../../doc/models/loyalty-program-accrual-rule-tax-mode.md) | Required | Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual.
This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. | getTaxMode(): string | setTaxMode(string taxMode): void | - -## Example (as JSON) - -```json -{ - "minimum_amount_money": { - "amount": 146, - "currency": "GHS" - }, - "tax_mode": "BEFORE_TAX" -} -``` - diff --git a/doc/models/loyalty-program-accrual-rule.md b/doc/models/loyalty-program-accrual-rule.md deleted file mode 100644 index 04df1802..00000000 --- a/doc/models/loyalty-program-accrual-rule.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Loyalty Program Accrual Rule - -Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](../../doc/models/loyalty-program.md). - -## Structure - -`LoyaltyProgramAccrualRule` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `accrualType` | [`string(LoyaltyProgramAccrualRuleType)`](../../doc/models/loyalty-program-accrual-rule-type.md) | Required | The type of the accrual rule that defines how buyers can earn points. | getAccrualType(): string | setAccrualType(string accrualType): void | -| `points` | `?int` | Optional | The number of points that
buyers earn based on the `accrual_type`.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | -| `visitData` | [`?LoyaltyProgramAccrualRuleVisitData`](../../doc/models/loyalty-program-accrual-rule-visit-data.md) | Optional | Represents additional data for rules with the `VISIT` accrual type. | getVisitData(): ?LoyaltyProgramAccrualRuleVisitData | setVisitData(?LoyaltyProgramAccrualRuleVisitData visitData): void | -| `spendData` | [`?LoyaltyProgramAccrualRuleSpendData`](../../doc/models/loyalty-program-accrual-rule-spend-data.md) | Optional | Represents additional data for rules with the `SPEND` accrual type. | getSpendData(): ?LoyaltyProgramAccrualRuleSpendData | setSpendData(?LoyaltyProgramAccrualRuleSpendData spendData): void | -| `itemVariationData` | [`?LoyaltyProgramAccrualRuleItemVariationData`](../../doc/models/loyalty-program-accrual-rule-item-variation-data.md) | Optional | Represents additional data for rules with the `ITEM_VARIATION` accrual type. | getItemVariationData(): ?LoyaltyProgramAccrualRuleItemVariationData | setItemVariationData(?LoyaltyProgramAccrualRuleItemVariationData itemVariationData): void | -| `categoryData` | [`?LoyaltyProgramAccrualRuleCategoryData`](../../doc/models/loyalty-program-accrual-rule-category-data.md) | Optional | Represents additional data for rules with the `CATEGORY` accrual type. | getCategoryData(): ?LoyaltyProgramAccrualRuleCategoryData | setCategoryData(?LoyaltyProgramAccrualRuleCategoryData categoryData): void | - -## Example (as JSON) - -```json -{ - "accrual_type": "VISIT", - "points": 86, - "visit_data": { - "minimum_amount_money": { - "amount": 146, - "currency": "GHS" - }, - "tax_mode": "BEFORE_TAX" - }, - "spend_data": { - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "excluded_category_ids": [ - "excluded_category_ids4" - ], - "excluded_item_variation_ids": [ - "excluded_item_variation_ids3", - "excluded_item_variation_ids4" - ], - "tax_mode": "BEFORE_TAX" - }, - "item_variation_data": { - "item_variation_id": "item_variation_id0" - }, - "category_data": { - "category_id": "category_id4" - } -} -``` - diff --git a/doc/models/loyalty-program-expiration-policy.md b/doc/models/loyalty-program-expiration-policy.md deleted file mode 100644 index c135ad78..00000000 --- a/doc/models/loyalty-program-expiration-policy.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Expiration Policy - -Describes when the loyalty program expires. - -## Structure - -`LoyaltyProgramExpirationPolicy` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `expirationDuration` | `string` | Required | The number of months before points expire, in `P[n]M` RFC 3339 duration format. For example, a value of `P12M` represents a duration of 12 months.
Points are valid through the last day of the month in which they are scheduled to expire. For example, with a `P12M` duration, points earned on July 6, 2020 expire on August 1, 2021.
**Constraints**: *Minimum Length*: `1` | getExpirationDuration(): string | setExpirationDuration(string expirationDuration): void | - -## Example (as JSON) - -```json -{ - "expiration_duration": "expiration_duration2" -} -``` - diff --git a/doc/models/loyalty-program-reward-definition-scope.md b/doc/models/loyalty-program-reward-definition-scope.md deleted file mode 100644 index bb399709..00000000 --- a/doc/models/loyalty-program-reward-definition-scope.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Loyalty Program Reward Definition Scope - -Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details -are now defined using a catalog pricing rule and other catalog objects. For more information, see -[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). - -## Enumeration - -`LoyaltyProgramRewardDefinitionScope` - -## Fields - -| Name | Description | -| --- | --- | -| `ORDER` | The discount applies to the entire order. | -| `ITEM_VARIATION` | The discount applies only to specific item variations. | -| `CATEGORY` | The discount applies only to items in the given categories. | - diff --git a/doc/models/loyalty-program-reward-definition-type.md b/doc/models/loyalty-program-reward-definition-type.md deleted file mode 100644 index 03302579..00000000 --- a/doc/models/loyalty-program-reward-definition-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Loyalty Program Reward Definition Type - -The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details -are now defined using a catalog pricing rule and other catalog objects. For more information, see -[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). - -## Enumeration - -`LoyaltyProgramRewardDefinitionType` - -## Fields - -| Name | Description | -| --- | --- | -| `FIXED_AMOUNT` | The fixed amount discounted. | -| `FIXED_PERCENTAGE` | The fixed percentage discounted. | - diff --git a/doc/models/loyalty-program-reward-definition.md b/doc/models/loyalty-program-reward-definition.md deleted file mode 100644 index f7b4d189..00000000 --- a/doc/models/loyalty-program-reward-definition.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Loyalty Program Reward Definition - -Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details -are now defined using a catalog pricing rule and other catalog objects. For more information, see -[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). - -## Structure - -`LoyaltyProgramRewardDefinition` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `scope` | [`string(LoyaltyProgramRewardDefinitionScope)`](../../doc/models/loyalty-program-reward-definition-scope.md) | Required | Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | getScope(): string | setScope(string scope): void | -| `discountType` | [`string(LoyaltyProgramRewardDefinitionType)`](../../doc/models/loyalty-program-reward-definition-type.md) | Required | The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | getDiscountType(): string | setDiscountType(string discountType): void | -| `percentageDiscount` | `?string` | Optional | The fixed percentage of the discount. Present if `discount_type` is `FIXED_PERCENTAGE`.
For example, a 7.25% off discount will be represented as "7.25". DEPRECATED at version 2020-12-16. You can find this
information in the `discount_data.percentage` field of the `DISCOUNT` catalog object referenced by the pricing rule. | getPercentageDiscount(): ?string | setPercentageDiscount(?string percentageDiscount): void | -| `catalogObjectIds` | `?(string[])` | Optional | The list of catalog objects to which this reward can be applied. They are either all item-variation ids or category ids, depending on the `type` field.
DEPRECATED at version 2020-12-16. You can find this information in the `product_set_data.product_ids_any` field
of the `PRODUCT_SET` catalog object referenced by the pricing rule. | getCatalogObjectIds(): ?array | setCatalogObjectIds(?array catalogObjectIds): void | -| `fixedDiscountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getFixedDiscountMoney(): ?Money | setFixedDiscountMoney(?Money fixedDiscountMoney): void | -| `maxDiscountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMaxDiscountMoney(): ?Money | setMaxDiscountMoney(?Money maxDiscountMoney): void | - -## Example (as JSON) - -```json -{ - "scope": "ORDER", - "discount_type": "FIXED_AMOUNT", - "percentage_discount": "percentage_discount0", - "catalog_object_ids": [ - "catalog_object_ids8" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } -} -``` - diff --git a/doc/models/loyalty-program-reward-tier.md b/doc/models/loyalty-program-reward-tier.md deleted file mode 100644 index 6b65f4f4..00000000 --- a/doc/models/loyalty-program-reward-tier.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Loyalty Program Reward Tier - -Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers. - -## Structure - -`LoyaltyProgramRewardTier` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the reward tier.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `points` | `int` | Required | The points exchanged for the reward tier.
**Constraints**: `>= 1` | getPoints(): int | setPoints(int points): void | -| `name` | `?string` | Optional | The name of the reward tier. | getName(): ?string | setName(?string name): void | -| `definition` | [`?LoyaltyProgramRewardDefinition`](../../doc/models/loyalty-program-reward-definition.md) | Optional | Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | getDefinition(): ?LoyaltyProgramRewardDefinition | setDefinition(?LoyaltyProgramRewardDefinition definition): void | -| `createdAt` | `?string` | Optional | The timestamp when the reward tier was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `pricingRuleReference` | [`CatalogObjectReference`](../../doc/models/catalog-object-reference.md) | Required | A reference to a Catalog object at a specific version. In general this is
used as an entry point into a graph of catalog objects, where the objects exist
at a specific version. | getPricingRuleReference(): CatalogObjectReference | setPricingRuleReference(CatalogObjectReference pricingRuleReference): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "points": 94, - "name": "name2", - "definition": { - "scope": "ORDER", - "discount_type": "FIXED_AMOUNT", - "percentage_discount": "percentage_discount2", - "catalog_object_ids": [ - "catalog_object_ids6" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } - }, - "created_at": "created_at0", - "pricing_rule_reference": { - "object_id": "object_id0", - "catalog_version": 218 - } -} -``` - diff --git a/doc/models/loyalty-program-status.md b/doc/models/loyalty-program-status.md deleted file mode 100644 index ef1a3ed7..00000000 --- a/doc/models/loyalty-program-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Loyalty Program Status - -Indicates whether the program is currently active. - -## Enumeration - -`LoyaltyProgramStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `INACTIVE` | The loyalty program does not have an active subscription.
Loyalty API requests fail. | -| `ACTIVE` | The program is fully functional. The program has an active subscription. | - diff --git a/doc/models/loyalty-program-terminology.md b/doc/models/loyalty-program-terminology.md deleted file mode 100644 index 6e49b83b..00000000 --- a/doc/models/loyalty-program-terminology.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Program Terminology - -Represents the naming used for loyalty points. - -## Structure - -`LoyaltyProgramTerminology` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `one` | `string` | Required | A singular unit for a point (for example, 1 point is called 1 star).
**Constraints**: *Minimum Length*: `1` | getOne(): string | setOne(string one): void | -| `other` | `string` | Required | A plural unit for point (for example, 10 points is called 10 stars).
**Constraints**: *Minimum Length*: `1` | getOther(): string | setOther(string other): void | - -## Example (as JSON) - -```json -{ - "one": "one4", - "other": "other0" -} -``` - diff --git a/doc/models/loyalty-program.md b/doc/models/loyalty-program.md deleted file mode 100644 index c4eb69da..00000000 --- a/doc/models/loyalty-program.md +++ /dev/null @@ -1,95 +0,0 @@ - -# Loyalty Program - -Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. -Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. -For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - -## Structure - -`LoyaltyProgram` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the loyalty program. Updates to
the loyalty program do not modify the identifier.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `status` | [`?string(LoyaltyProgramStatus)`](../../doc/models/loyalty-program-status.md) | Optional | Indicates whether the program is currently active. | getStatus(): ?string | setStatus(?string status): void | -| `rewardTiers` | [`?(LoyaltyProgramRewardTier[])`](../../doc/models/loyalty-program-reward-tier.md) | Optional | The list of rewards for buyers, sorted by ascending points. | getRewardTiers(): ?array | setRewardTiers(?array rewardTiers): void | -| `expirationPolicy` | [`?LoyaltyProgramExpirationPolicy`](../../doc/models/loyalty-program-expiration-policy.md) | Optional | Describes when the loyalty program expires. | getExpirationPolicy(): ?LoyaltyProgramExpirationPolicy | setExpirationPolicy(?LoyaltyProgramExpirationPolicy expirationPolicy): void | -| `terminology` | [`?LoyaltyProgramTerminology`](../../doc/models/loyalty-program-terminology.md) | Optional | Represents the naming used for loyalty points. | getTerminology(): ?LoyaltyProgramTerminology | setTerminology(?LoyaltyProgramTerminology terminology): void | -| `locationIds` | `?(string[])` | Optional | The [locations](entity:Location) at which the program is active. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `createdAt` | `?string` | Optional | The timestamp when the program was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `accrualRules` | [`?(LoyaltyProgramAccrualRule[])`](../../doc/models/loyalty-program-accrual-rule.md) | Optional | Defines how buyers can earn loyalty points from the base loyalty program.
To check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable
buyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions). | getAccrualRules(): ?array | setAccrualRules(?array accrualRules): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "INACTIVE", - "reward_tiers": [ - { - "id": "id8", - "points": 250, - "name": "name8", - "definition": { - "scope": "ORDER", - "discount_type": "FIXED_AMOUNT", - "percentage_discount": "percentage_discount2", - "catalog_object_ids": [ - "catalog_object_ids6" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } - }, - "created_at": "created_at6", - "pricing_rule_reference": { - "object_id": "object_id0", - "catalog_version": 218 - } - }, - { - "id": "id8", - "points": 250, - "name": "name8", - "definition": { - "scope": "ORDER", - "discount_type": "FIXED_AMOUNT", - "percentage_discount": "percentage_discount2", - "catalog_object_ids": [ - "catalog_object_ids6" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } - }, - "created_at": "created_at6", - "pricing_rule_reference": { - "object_id": "object_id0", - "catalog_version": 218 - } - } - ], - "expiration_policy": { - "expiration_duration": "expiration_duration0" - }, - "terminology": { - "one": "one0", - "other": "other6" - } -} -``` - diff --git a/doc/models/loyalty-promotion-available-time-data.md b/doc/models/loyalty-promotion-available-time-data.md deleted file mode 100644 index daa7c15c..00000000 --- a/doc/models/loyalty-promotion-available-time-data.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Loyalty Promotion Available Time Data - -Represents scheduling information that determines when purchases can qualify to earn points -from a [loyalty promotion](../../doc/models/loyalty-promotion.md). - -## Structure - -`LoyaltyPromotionAvailableTimeData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startDate` | `?string` | Optional | The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field
based on the provided `time_periods`. | getStartDate(): ?string | setStartDate(?string startDate): void | -| `endDate` | `?string` | Optional | The date that the promotion ends, in `YYYY-MM-DD` format. Square populates this field
based on the provided `time_periods`. If an end date is not specified, an `ACTIVE` promotion
remains available until it is canceled. | getEndDate(): ?string | setEndDate(?string endDate): void | -| `timePeriods` | `string[]` | Required | A list of [iCalendar (RFC 5545) events](https://tools.ietf.org/html/rfc5545#section-3.6.1)
(`VEVENT`). Each event represents an available time period per day or days of the week.
A day can have a maximum of one available time period.

Only `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and `DURATION` are required and
timestamps must be in local (unzoned) time format. Include `RRULE` to specify recurring promotions,
an end date (using the `UNTIL` keyword), or both. For more information, see
[Available time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time).

Note that `BEGIN:VEVENT` and `END:VEVENT` are optional in a `CreateLoyaltyPromotion` request
but are always included in the response. | getTimePeriods(): array | setTimePeriods(array timePeriods): void | - -## Example (as JSON) - -```json -{ - "start_date": "start_date4", - "end_date": "end_date0", - "time_periods": [ - "time_periods7", - "time_periods8", - "time_periods9" - ] -} -``` - diff --git a/doc/models/loyalty-promotion-incentive-points-addition-data.md b/doc/models/loyalty-promotion-incentive-points-addition-data.md deleted file mode 100644 index 01c3854a..00000000 --- a/doc/models/loyalty-promotion-incentive-points-addition-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Promotion Incentive Points Addition Data - -Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). - -## Structure - -`LoyaltyPromotionIncentivePointsAdditionData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `pointsAddition` | `int` | Required | The number of additional points to earn each time the promotion is triggered. For example,
suppose a purchase qualifies for 5 points from the base loyalty program. If the purchase also
qualifies for a `POINTS_ADDITION` promotion incentive with a `points_addition` of 3, the buyer
earns a total of 8 points (5 program points + 3 promotion points = 8 points).
**Constraints**: `>= 1` | getPointsAddition(): int | setPointsAddition(int pointsAddition): void | - -## Example (as JSON) - -```json -{ - "points_addition": 88 -} -``` - diff --git a/doc/models/loyalty-promotion-incentive-points-multiplier-data.md b/doc/models/loyalty-promotion-incentive-points-multiplier-data.md deleted file mode 100644 index a3a9ad81..00000000 --- a/doc/models/loyalty-promotion-incentive-points-multiplier-data.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Promotion Incentive Points Multiplier Data - -Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). - -## Structure - -`LoyaltyPromotionIncentivePointsMultiplierData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `pointsMultiplier` | `?int` | Optional | The multiplier used to calculate the number of points earned each time the promotion
is triggered. For example, suppose a purchase qualifies for 5 points from the base loyalty program.
If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a `points_multiplier`
of 3, the buyer earns a total of 15 points (5 program points x 3 promotion multiplier = 15 points).

DEPRECATED at version 2023-08-16. Replaced by the `multiplier` field.

One of the following is required when specifying a points multiplier:

- (Recommended) The `multiplier` field.
- This deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`
with the equivalent value.
**Constraints**: `>= 2`, `<= 10` | getPointsMultiplier(): ?int | setPointsMultiplier(?int pointsMultiplier): void | -| `multiplier` | `?string` | Optional | The multiplier used to calculate the number of points earned each time the promotion is triggered,
specified as a string representation of a decimal. Square supports multipliers up to 10x, with three
point precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from the
base loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a
`multiplier` of "1.5", the buyer earns a total of 6 points (4 program points x 1.5 promotion multiplier = 6 points).
Fractional points are dropped.

One of the following is required when specifying a points multiplier:

- (Recommended) This `multiplier` field.
- The deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`
with the equivalent value.
**Constraints**: *Maximum Length*: `5` | getMultiplier(): ?string | setMultiplier(?string multiplier): void | - -## Example (as JSON) - -```json -{ - "points_multiplier": 116, - "multiplier": "multiplier2" -} -``` - diff --git a/doc/models/loyalty-promotion-incentive-type.md b/doc/models/loyalty-promotion-incentive-type.md deleted file mode 100644 index 4797dfee..00000000 --- a/doc/models/loyalty-promotion-incentive-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Loyalty Promotion Incentive Type - -Indicates the type of points incentive for a [loyalty promotion](../../doc/models/loyalty-promotion.md), -which is used to determine how buyers can earn points from the promotion. - -## Enumeration - -`LoyaltyPromotionIncentiveType` - -## Fields - -| Name | Description | -| --- | --- | -| `POINTS_MULTIPLIER` | Multiply the number of points earned from the base loyalty program.
For example, "Earn double points." | -| `POINTS_ADDITION` | Add a specified number of points to those earned from the base loyalty program.
For example, "Earn 10 additional points." | - diff --git a/doc/models/loyalty-promotion-incentive.md b/doc/models/loyalty-promotion-incentive.md deleted file mode 100644 index ab4c0c49..00000000 --- a/doc/models/loyalty-promotion-incentive.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Loyalty Promotion Incentive - -Represents how points for a [loyalty promotion](../../doc/models/loyalty-promotion.md) are calculated, -either by multiplying the points earned from the base program or by adding a specified number -of points to the points earned from the base program. - -## Structure - -`LoyaltyPromotionIncentive` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`string(LoyaltyPromotionIncentiveType)`](../../doc/models/loyalty-promotion-incentive-type.md) | Required | Indicates the type of points incentive for a [loyalty promotion](../../doc/models/loyalty-promotion.md),
which is used to determine how buyers can earn points from the promotion. | getType(): string | setType(string type): void | -| `pointsMultiplierData` | [`?LoyaltyPromotionIncentivePointsMultiplierData`](../../doc/models/loyalty-promotion-incentive-points-multiplier-data.md) | Optional | Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). | getPointsMultiplierData(): ?LoyaltyPromotionIncentivePointsMultiplierData | setPointsMultiplierData(?LoyaltyPromotionIncentivePointsMultiplierData pointsMultiplierData): void | -| `pointsAdditionData` | [`?LoyaltyPromotionIncentivePointsAdditionData`](../../doc/models/loyalty-promotion-incentive-points-addition-data.md) | Optional | Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). | getPointsAdditionData(): ?LoyaltyPromotionIncentivePointsAdditionData | setPointsAdditionData(?LoyaltyPromotionIncentivePointsAdditionData pointsAdditionData): void | - -## Example (as JSON) - -```json -{ - "type": "POINTS_MULTIPLIER", - "points_multiplier_data": { - "points_multiplier": 134, - "multiplier": "multiplier4" - }, - "points_addition_data": { - "points_addition": 218 - } -} -``` - diff --git a/doc/models/loyalty-promotion-status.md b/doc/models/loyalty-promotion-status.md deleted file mode 100644 index 393c90c7..00000000 --- a/doc/models/loyalty-promotion-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Loyalty Promotion Status - -Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). - -## Enumeration - -`LoyaltyPromotionStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | The loyalty promotion is currently active. Buyers can earn points for purchases
that meet the promotion conditions, such as the promotion's `available_time`. | -| `ENDED` | The loyalty promotion has ended because the specified `end_date` was reached.
`ENDED` is a terminal status. | -| `CANCELED` | The loyalty promotion was canceled. `CANCELED` is a terminal status. | -| `SCHEDULED` | The loyalty promotion is scheduled to start in the future. Square changes the
promotion status to `ACTIVE` when the `start_date` is reached. | - diff --git a/doc/models/loyalty-promotion-trigger-limit-interval.md b/doc/models/loyalty-promotion-trigger-limit-interval.md deleted file mode 100644 index 3be1d813..00000000 --- a/doc/models/loyalty-promotion-trigger-limit-interval.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Loyalty Promotion Trigger Limit Interval - -Indicates the time period that the [trigger limit](../../doc/models/loyalty-promotion-trigger-limit.md) applies to, -which is used to determine the number of times a buyer can earn points for a [loyalty promotion](../../doc/models/loyalty-promotion.md). - -## Enumeration - -`LoyaltyPromotionTriggerLimitInterval` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL_TIME` | The limit applies to the entire time that the promotion is active. For example, if `times`
is set to 1 and `time_period` is set to `ALL_TIME`, a buyer can earn promotion points a maximum
of one time during the promotion. | -| `DAY` | The limit applies per day, according to the `available_time` schedule specified for the promotion.
For example, if the `times` field of the trigger limit is set to 1, a buyer can trigger the promotion
a maximum of once per day. | - diff --git a/doc/models/loyalty-promotion-trigger-limit.md b/doc/models/loyalty-promotion-trigger-limit.md deleted file mode 100644 index 25a432f8..00000000 --- a/doc/models/loyalty-promotion-trigger-limit.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Loyalty Promotion Trigger Limit - -Represents the number of times a buyer can earn points during a [loyalty promotion](../../doc/models/loyalty-promotion.md). -If this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during -the time that the promotion is available. - -A purchase that is disqualified from earning points because of this limit might qualify for another active promotion. - -## Structure - -`LoyaltyPromotionTriggerLimit` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `times` | `int` | Required | The maximum number of times a buyer can trigger the promotion during the specified `interval`.
**Constraints**: `>= 1`, `<= 30` | getTimes(): int | setTimes(int times): void | -| `interval` | [`?string(LoyaltyPromotionTriggerLimitInterval)`](../../doc/models/loyalty-promotion-trigger-limit-interval.md) | Optional | Indicates the time period that the [trigger limit](../../doc/models/loyalty-promotion-trigger-limit.md) applies to,
which is used to determine the number of times a buyer can earn points for a [loyalty promotion](../../doc/models/loyalty-promotion.md). | getInterval(): ?string | setInterval(?string interval): void | - -## Example (as JSON) - -```json -{ - "times": 32, - "interval": "ALL_TIME" -} -``` - diff --git a/doc/models/loyalty-promotion.md b/doc/models/loyalty-promotion.md deleted file mode 100644 index f88372a9..00000000 --- a/doc/models/loyalty-promotion.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Loyalty Promotion - -Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). Loyalty promotions enable buyers -to earn extra points on top of those earned from the base program. - -A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - -## Structure - -`LoyaltyPromotion` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the promotion.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `name` | `string` | Required | The name of the promotion.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `70` | getName(): string | setName(string name): void | -| `incentive` | [`LoyaltyPromotionIncentive`](../../doc/models/loyalty-promotion-incentive.md) | Required | Represents how points for a [loyalty promotion](../../doc/models/loyalty-promotion.md) are calculated,
either by multiplying the points earned from the base program or by adding a specified number
of points to the points earned from the base program. | getIncentive(): LoyaltyPromotionIncentive | setIncentive(LoyaltyPromotionIncentive incentive): void | -| `availableTime` | [`LoyaltyPromotionAvailableTimeData`](../../doc/models/loyalty-promotion-available-time-data.md) | Required | Represents scheduling information that determines when purchases can qualify to earn points
from a [loyalty promotion](../../doc/models/loyalty-promotion.md). | getAvailableTime(): LoyaltyPromotionAvailableTimeData | setAvailableTime(LoyaltyPromotionAvailableTimeData availableTime): void | -| `triggerLimit` | [`?LoyaltyPromotionTriggerLimit`](../../doc/models/loyalty-promotion-trigger-limit.md) | Optional | Represents the number of times a buyer can earn points during a [loyalty promotion](../../doc/models/loyalty-promotion.md).
If this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during
the time that the promotion is available.

A purchase that is disqualified from earning points because of this limit might qualify for another active promotion. | getTriggerLimit(): ?LoyaltyPromotionTriggerLimit | setTriggerLimit(?LoyaltyPromotionTriggerLimit triggerLimit): void | -| `status` | [`?string(LoyaltyPromotionStatus)`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | getStatus(): ?string | setStatus(?string status): void | -| `createdAt` | `?string` | Optional | The timestamp of when the promotion was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `canceledAt` | `?string` | Optional | The timestamp of when the promotion was canceled, in RFC 3339 format. | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the promotion was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `loyaltyProgramId` | `?string` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | -| `minimumSpendAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getMinimumSpendAmountMoney(): ?Money | setMinimumSpendAmountMoney(?Money minimumSpendAmountMoney): void | -| `qualifyingItemVariationIds` | `?(string[])` | Optional | The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified,
the purchase must include at least one of these items to qualify for the promotion.

This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.
With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.

You can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, but not both. | getQualifyingItemVariationIds(): ?array | setQualifyingItemVariationIds(?array qualifyingItemVariationIds): void | -| `qualifyingCategoryIds` | `?(string[])` | Optional | The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified,
the purchase must include at least one item from one of these categories to qualify for the promotion.

This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.
With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.

You can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but not both. | getQualifyingCategoryIds(): ?array | setQualifyingCategoryIds(?array qualifyingCategoryIds): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "name": "name4", - "incentive": { - "type": "POINTS_MULTIPLIER", - "points_multiplier_data": { - "points_multiplier": 134, - "multiplier": "multiplier4" - }, - "points_addition_data": { - "points_addition": 218 - } - }, - "available_time": { - "start_date": "start_date4", - "end_date": "end_date8", - "time_periods": [ - "time_periods9" - ] - }, - "trigger_limit": { - "times": 26, - "interval": "ALL_TIME" - }, - "status": "ACTIVE", - "created_at": "created_at8", - "canceled_at": "canceled_at0" -} -``` - diff --git a/doc/models/loyalty-reward-status.md b/doc/models/loyalty-reward-status.md deleted file mode 100644 index 26be27d3..00000000 --- a/doc/models/loyalty-reward-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Loyalty Reward Status - -The status of the loyalty reward. - -## Enumeration - -`LoyaltyRewardStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ISSUED` | The reward is issued. | -| `REDEEMED` | The reward is redeemed. | -| `DELETED` | The reward is deleted. | - diff --git a/doc/models/loyalty-reward.md b/doc/models/loyalty-reward.md deleted file mode 100644 index 38382e30..00000000 --- a/doc/models/loyalty-reward.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Loyalty Reward - -Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. -For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). - -## Structure - -`LoyaltyReward` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the loyalty reward.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `status` | [`?string(LoyaltyRewardStatus)`](../../doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | getStatus(): ?string | setStatus(?string status): void | -| `loyaltyAccountId` | `string` | Required | The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | -| `rewardTierId` | `string` | Required | The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the reward.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getRewardTierId(): string | setRewardTierId(string rewardTierId): void | -| `points` | `?int` | Optional | The number of loyalty points used for the reward.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | -| `orderId` | `?string` | Optional | The Square-assigned ID of the [order](entity:Order) to which the reward is attached. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `createdAt` | `?string` | Optional | The timestamp when the reward was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `redeemedAt` | `?string` | Optional | The timestamp when the reward was redeemed, in RFC 3339 format. | getRedeemedAt(): ?string | setRedeemedAt(?string redeemedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "status": "DELETED", - "loyalty_account_id": "loyalty_account_id4", - "reward_tier_id": "reward_tier_id2", - "points": 114, - "order_id": "order_id0", - "created_at": "created_at4" -} -``` - diff --git a/doc/models/m-break.md b/doc/models/m-break.md deleted file mode 100644 index aab653da..00000000 --- a/doc/models/m-break.md +++ /dev/null @@ -1,35 +0,0 @@ - -# M Break - -A record of an employee's break during a shift. - -## Structure - -`MBreak` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object. | getId(): ?string | setId(?string id): void | -| `startAt` | `string` | Required | RFC 3339; follows the same timezone information as `Shift`. Precision up to
the minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | getStartAt(): string | setStartAt(string startAt): void | -| `endAt` | `?string` | Optional | RFC 3339; follows the same timezone information as `Shift`. Precision up to
the minute is respected; seconds are truncated. | getEndAt(): ?string | setEndAt(?string endAt): void | -| `breakTypeId` | `string` | Required | The `BreakType` that this `Break` was templated on.
**Constraints**: *Minimum Length*: `1` | getBreakTypeId(): string | setBreakTypeId(string breakTypeId): void | -| `name` | `string` | Required | A human-readable name.
**Constraints**: *Minimum Length*: `1` | getName(): string | setName(string name): void | -| `expectedDuration` | `string` | Required | Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of
the break.
**Constraints**: *Minimum Length*: `1` | getExpectedDuration(): string | setExpectedDuration(string expectedDuration): void | -| `isPaid` | `bool` | Required | Whether this break counts towards time worked for compensation
purposes. | getIsPaid(): bool | setIsPaid(bool isPaid): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "start_at": "start_at8", - "end_at": "end_at4", - "break_type_id": "break_type_id2", - "name": "name6", - "expected_duration": "expected_duration8", - "is_paid": false -} -``` - diff --git a/doc/models/measurement-unit-area.md b/doc/models/measurement-unit-area.md deleted file mode 100644 index c1148914..00000000 --- a/doc/models/measurement-unit-area.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Measurement Unit Area - -Unit of area used to measure a quantity. - -## Enumeration - -`MeasurementUnitArea` - -## Fields - -| Name | Description | -| --- | --- | -| `IMPERIAL_ACRE` | The area is measured in acres. | -| `IMPERIAL_SQUARE_INCH` | The area is measured in square inches. | -| `IMPERIAL_SQUARE_FOOT` | The area is measured in square feet. | -| `IMPERIAL_SQUARE_YARD` | The area is measured in square yards. | -| `IMPERIAL_SQUARE_MILE` | The area is measured in square miles. | -| `METRIC_SQUARE_CENTIMETER` | The area is measured in square centimeters. | -| `METRIC_SQUARE_METER` | The area is measured in square meters. | -| `METRIC_SQUARE_KILOMETER` | The area is measured in square kilometers. | - diff --git a/doc/models/measurement-unit-custom.md b/doc/models/measurement-unit-custom.md deleted file mode 100644 index f593cb57..00000000 --- a/doc/models/measurement-unit-custom.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Measurement Unit Custom - -The information needed to define a custom unit, provided by the seller. - -## Structure - -`MeasurementUnitCustom` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | The name of the custom unit, for example "bushel". | getName(): string | setName(string name): void | -| `abbreviation` | `string` | Required | The abbreviation of the custom unit, such as "bsh" (bushel). This appears
in the cart for the Point of Sale app, and in reports. | getAbbreviation(): string | setAbbreviation(string abbreviation): void | - -## Example (as JSON) - -```json -{ - "name": "name8", - "abbreviation": "abbreviation0" -} -``` - diff --git a/doc/models/measurement-unit-generic.md b/doc/models/measurement-unit-generic.md deleted file mode 100644 index 0206fe95..00000000 --- a/doc/models/measurement-unit-generic.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Measurement Unit Generic - -## Enumeration - -`MeasurementUnitGeneric` - -## Fields - -| Name | Description | -| --- | --- | -| `UNIT` | The generic unit. | - diff --git a/doc/models/measurement-unit-length.md b/doc/models/measurement-unit-length.md deleted file mode 100644 index 82dfc078..00000000 --- a/doc/models/measurement-unit-length.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Measurement Unit Length - -The unit of length used to measure a quantity. - -## Enumeration - -`MeasurementUnitLength` - -## Fields - -| Name | Description | -| --- | --- | -| `IMPERIAL_INCH` | The length is measured in inches. | -| `IMPERIAL_FOOT` | The length is measured in feet. | -| `IMPERIAL_YARD` | The length is measured in yards. | -| `IMPERIAL_MILE` | The length is measured in miles. | -| `METRIC_MILLIMETER` | The length is measured in millimeters. | -| `METRIC_CENTIMETER` | The length is measured in centimeters. | -| `METRIC_METER` | The length is measured in meters. | -| `METRIC_KILOMETER` | The length is measured in kilometers. | - diff --git a/doc/models/measurement-unit-time.md b/doc/models/measurement-unit-time.md deleted file mode 100644 index 43b8c4ce..00000000 --- a/doc/models/measurement-unit-time.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Measurement Unit Time - -Unit of time used to measure a quantity (a duration). - -## Enumeration - -`MeasurementUnitTime` - -## Fields - -| Name | Description | -| --- | --- | -| `GENERIC_MILLISECOND` | The time is measured in milliseconds. | -| `GENERIC_SECOND` | The time is measured in seconds. | -| `GENERIC_MINUTE` | The time is measured in minutes. | -| `GENERIC_HOUR` | The time is measured in hours. | -| `GENERIC_DAY` | The time is measured in days. | - diff --git a/doc/models/measurement-unit-unit-type.md b/doc/models/measurement-unit-unit-type.md deleted file mode 100644 index bcf03f39..00000000 --- a/doc/models/measurement-unit-unit-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Measurement Unit Unit Type - -Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. - -## Enumeration - -`MeasurementUnitUnitType` - -## Fields - -| Name | Description | -| --- | --- | -| `TYPE_CUSTOM` | The unit details are contained in the custom_unit field. | -| `TYPE_AREA` | The unit details are contained in the area_unit field. | -| `TYPE_LENGTH` | The unit details are contained in the length_unit field. | -| `TYPE_VOLUME` | The unit details are contained in the volume_unit field. | -| `TYPE_WEIGHT` | The unit details are contained in the weight_unit field. | -| `TYPE_GENERIC` | The unit details are contained in the generic_unit field. | - diff --git a/doc/models/measurement-unit-volume.md b/doc/models/measurement-unit-volume.md deleted file mode 100644 index 822a5216..00000000 --- a/doc/models/measurement-unit-volume.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Measurement Unit Volume - -The unit of volume used to measure a quantity. - -## Enumeration - -`MeasurementUnitVolume` - -## Fields - -| Name | Description | -| --- | --- | -| `GENERIC_FLUID_OUNCE` | The volume is measured in ounces. | -| `GENERIC_SHOT` | The volume is measured in shots. | -| `GENERIC_CUP` | The volume is measured in cups. | -| `GENERIC_PINT` | The volume is measured in pints. | -| `GENERIC_QUART` | The volume is measured in quarts. | -| `GENERIC_GALLON` | The volume is measured in gallons. | -| `IMPERIAL_CUBIC_INCH` | The volume is measured in cubic inches. | -| `IMPERIAL_CUBIC_FOOT` | The volume is measured in cubic feet. | -| `IMPERIAL_CUBIC_YARD` | The volume is measured in cubic yards. | -| `METRIC_MILLILITER` | The volume is measured in metric milliliters. | -| `METRIC_LITER` | The volume is measured in metric liters. | - diff --git a/doc/models/measurement-unit-weight.md b/doc/models/measurement-unit-weight.md deleted file mode 100644 index 1b81d26e..00000000 --- a/doc/models/measurement-unit-weight.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Measurement Unit Weight - -Unit of weight used to measure a quantity. - -## Enumeration - -`MeasurementUnitWeight` - -## Fields - -| Name | Description | -| --- | --- | -| `IMPERIAL_WEIGHT_OUNCE` | The weight is measured in ounces. | -| `IMPERIAL_POUND` | The weight is measured in pounds. | -| `IMPERIAL_STONE` | The weight is measured in stones. | -| `METRIC_MILLIGRAM` | The weight is measured in milligrams. | -| `METRIC_GRAM` | The weight is measured in grams. | -| `METRIC_KILOGRAM` | The weight is measured in kilograms. | - diff --git a/doc/models/measurement-unit.md b/doc/models/measurement-unit.md deleted file mode 100644 index 30bc1189..00000000 --- a/doc/models/measurement-unit.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Measurement Unit - -Represents a unit of measurement to use with a quantity, such as ounces -or inches. Exactly one of the following fields are required: `custom_unit`, -`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. - -## Structure - -`MeasurementUnit` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customUnit` | [`?MeasurementUnitCustom`](../../doc/models/measurement-unit-custom.md) | Optional | The information needed to define a custom unit, provided by the seller. | getCustomUnit(): ?MeasurementUnitCustom | setCustomUnit(?MeasurementUnitCustom customUnit): void | -| `areaUnit` | [`?string(MeasurementUnitArea)`](../../doc/models/measurement-unit-area.md) | Optional | Unit of area used to measure a quantity. | getAreaUnit(): ?string | setAreaUnit(?string areaUnit): void | -| `lengthUnit` | [`?string(MeasurementUnitLength)`](../../doc/models/measurement-unit-length.md) | Optional | The unit of length used to measure a quantity. | getLengthUnit(): ?string | setLengthUnit(?string lengthUnit): void | -| `volumeUnit` | [`?string(MeasurementUnitVolume)`](../../doc/models/measurement-unit-volume.md) | Optional | The unit of volume used to measure a quantity. | getVolumeUnit(): ?string | setVolumeUnit(?string volumeUnit): void | -| `weightUnit` | [`?string(MeasurementUnitWeight)`](../../doc/models/measurement-unit-weight.md) | Optional | Unit of weight used to measure a quantity. | getWeightUnit(): ?string | setWeightUnit(?string weightUnit): void | -| `genericUnit` | [`?string(MeasurementUnitGeneric)`](../../doc/models/measurement-unit-generic.md) | Optional | - | getGenericUnit(): ?string | setGenericUnit(?string genericUnit): void | -| `timeUnit` | [`?string(MeasurementUnitTime)`](../../doc/models/measurement-unit-time.md) | Optional | Unit of time used to measure a quantity (a duration). | getTimeUnit(): ?string | setTimeUnit(?string timeUnit): void | -| `type` | [`?string(MeasurementUnitUnitType)`](../../doc/models/measurement-unit-unit-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | getType(): ?string | setType(?string type): void | - -## Example (as JSON) - -```json -{ - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_SQUARE_MILE", - "length_unit": "METRIC_MILLIMETER", - "volume_unit": "IMPERIAL_CUBIC_INCH", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" -} -``` - diff --git a/doc/models/merchant-status.md b/doc/models/merchant-status.md deleted file mode 100644 index 9e3e199d..00000000 --- a/doc/models/merchant-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Merchant Status - -## Enumeration - -`MerchantStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | A fully operational merchant account. The merchant can interact with Square products and APIs. | -| `INACTIVE` | A functionally limited merchant account. The merchant can only have limited interaction
via Square APIs. The merchant cannot log in or access the seller dashboard. | - diff --git a/doc/models/merchant.md b/doc/models/merchant.md deleted file mode 100644 index 811660a7..00000000 --- a/doc/models/merchant.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Merchant - -Represents a business that sells with Square. - -## Structure - -`Merchant` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-issued ID of the merchant. | getId(): ?string | setId(?string id): void | -| `businessName` | `?string` | Optional | The name of the merchant's overall business. | getBusinessName(): ?string | setBusinessName(?string businessName): void | -| `country` | [`string(Country)`](../../doc/models/country.md) | Required | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | getCountry(): string | setCountry(string country): void | -| `languageCode` | `?string` | Optional | The code indicating the [language preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`. | getLanguageCode(): ?string | setLanguageCode(?string languageCode): void | -| `currency` | [`?string(Currency)`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | getCurrency(): ?string | setCurrency(?string currency): void | -| `status` | [`?string(MerchantStatus)`](../../doc/models/merchant-status.md) | Optional | - | getStatus(): ?string | setStatus(?string status): void | -| `mainLocationId` | `?string` | Optional | The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant. | getMainLocationId(): ?string | setMainLocationId(?string mainLocationId): void | -| `createdAt` | `?string` | Optional | The time when the merchant was created, in RFC 3339 format.
For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "business_name": "business_name6", - "country": "HM", - "language_code": "language_code0", - "currency": "BTC", - "status": "ACTIVE" -} -``` - diff --git a/doc/models/modifier-location-overrides.md b/doc/models/modifier-location-overrides.md deleted file mode 100644 index d1e6bebd..00000000 --- a/doc/models/modifier-location-overrides.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Modifier Location Overrides - -Location-specific overrides for specified properties of a `CatalogModifier` object. - -## Structure - -`ModifierLocationOverrides` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the `Location` object representing the location. This can include a deactivated location. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `priceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | -| `soldOut` | `?bool` | Optional | Indicates whether the modifier is sold out at the specified location or not. As an example, for cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, that is sold out.
The seller can manually set this sold out status. Attempts by an application to set this attribute are ignored. | getSoldOut(): ?bool | setSoldOut(?bool soldOut): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id2", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "sold_out": false -} -``` - diff --git a/doc/models/money.md b/doc/models/money.md deleted file mode 100644 index 3e7a795f..00000000 --- a/doc/models/money.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Money - -Represents an amount of money. `Money` fields can be signed or unsigned. -Fields that do not explicitly define whether they are signed or unsigned are -considered unsigned and can only hold positive amounts. For signed fields, the -sign of the value indicates the purpose of the money transfer. See -[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) -for more information. - -## Structure - -`Money` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amount` | `?int` | Optional | The amount of money, in the smallest denomination of the currency
indicated by `currency`. For example, when `currency` is `USD`, `amount` is
in cents. Monetary amounts can be positive or negative. See the specific
field description to determine the meaning of the sign in a particular case. | getAmount(): ?int | setAmount(?int amount): void | -| `currency` | [`?string(Currency)`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | getCurrency(): ?string | setCurrency(?string currency): void | - -## Example (as JSON) - -```json -{ - "amount": 36, - "currency": "AZN" -} -``` - diff --git a/doc/models/obtain-token-request.md b/doc/models/obtain-token-request.md deleted file mode 100644 index bb46eff5..00000000 --- a/doc/models/obtain-token-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Obtain Token Request - -## Structure - -`ObtainTokenRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `clientId` | `string` | Required | The Square-issued ID of your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): string | setClientId(string clientId): void | -| `clientSecret` | `?string` | Optional | The Square-issued application secret for your application, which is available on the **OAuth** page
in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required when
you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow).
The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to `authorization_code`.
If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE flow only requires `client_id`, 
`grant_type`, and `refresh_token`.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getClientSecret(): ?string | setClientSecret(?string clientSecret): void | -| `code` | `?string` | Optional | The authorization code to exchange.
This code is required if `grant_type` is set to `authorization_code` to indicate that
the application wants to exchange an authorization code for an OAuth access token.
**Constraints**: *Maximum Length*: `191` | getCode(): ?string | setCode(?string code): void | -| `redirectUri` | `?string` | Optional | The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `2048` | getRedirectUri(): ?string | setRedirectUri(?string redirectUri): void | -| `grantType` | `string` | Required | Specifies the method to request an OAuth access token.
Valid values are `authorization_code`, `refresh_token`, and `migration_token`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `20` | getGrantType(): string | setGrantType(string grantType): void | -| `refreshToken` | `?string` | Optional | A valid refresh token for generating a new OAuth access token.

A valid refresh token is required if `grant_type` is set to `refresh_token`
to indicate that the application wants a replacement for an expired OAuth access token.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | -| `migrationToken` | `?string` | Optional | A legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if `grant_type` is set to
`migration_token` to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getMigrationToken(): ?string | setMigrationToken(?string migrationToken): void | -| `scopes` | `?(string[])` | Optional | A JSON list of strings representing the permissions that the application is requesting.
For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`".

The access token returned in the response is granted the permissions
that comprise the intersection between the requested list of permissions and those
that belong to the provided refresh token. | getScopes(): ?array | setScopes(?array scopes): void | -| `shortLived` | `?bool` | Optional | A Boolean indicating a request for a short-lived access token.

The short-lived access token returned in the response expires in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void | -| `codeVerifier` | `?string` | Optional | Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the
`code_challenge` associated with the `authorization_code`. | getCodeVerifier(): ?string | setCodeVerifier(?string codeVerifier): void | - -## Example (as JSON) - -```json -{ - "client_id": "APPLICATION_ID", - "client_secret": "APPLICATION_SECRET", - "code": "CODE_FROM_AUTHORIZE", - "grant_type": "authorization_code", - "redirect_uri": "redirect_uri6", - "refresh_token": "refresh_token8", - "migration_token": "migration_token6" -} -``` - diff --git a/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md deleted file mode 100644 index 00a7a931..00000000 --- a/doc/models/obtain-token-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Obtain Token Response - -## Structure - -`ObtainTokenResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `accessToken` | `?string` | Optional | A valid OAuth access token.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void | -| `tokenType` | `?string` | Optional | This value is always _bearer_.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10` | getTokenType(): ?string | setTokenType(?string tokenType): void | -| `expiresAt` | `?string` | Optional | The date when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `subscriptionId` | `?string` | Optional | __LEGACY FIELD__. The ID of a subscription plan the merchant signed up
for. The ID is only present if the merchant signed up for a subscription plan during authorization. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void | -| `planId` | `?string` | Optional | __LEGACY FIELD__. The ID of the subscription plan the merchant signed
up for. The ID is only present if the merchant signed up for a subscription plan during
authorization. | getPlanId(): ?string | setPlanId(?string planId): void | -| `idToken` | `?string` | Optional | The OpenID token belonging to this person. This token is only present if the
OPENID scope is included in the authorization request. | getIdToken(): ?string | setIdToken(?string idToken): void | -| `refreshToken` | `?string` | Optional | A refresh token.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | -| `shortLived` | `?bool` | Optional | A Boolean indicating that the access token is a short-lived access token.
The short-lived access token returned in the response expires in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refreshTokenExpiresAt` | `?string` | Optional | The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getRefreshTokenExpiresAt(): ?string | setRefreshTokenExpiresAt(?string refreshTokenExpiresAt): void | - -## Example (as JSON) - -```json -{ - "access_token": "ACCESS_TOKEN", - "expires_at": "2006-01-02T15:04:05Z", - "merchant_id": "MERCHANT_ID", - "refresh_token": "REFRESH_TOKEN", - "token_type": "bearer", - "subscription_id": "subscription_id8" -} -``` - diff --git a/doc/models/offline-payment-details.md b/doc/models/offline-payment-details.md deleted file mode 100644 index 0a43a74c..00000000 --- a/doc/models/offline-payment-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Offline Payment Details - -Details specific to offline payments. - -## Structure - -`OfflinePaymentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `clientCreatedAt` | `?string` | Optional | The client-side timestamp of when the offline payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getClientCreatedAt(): ?string | setClientCreatedAt(?string clientCreatedAt): void | - -## Example (as JSON) - -```json -{ - "client_created_at": "client_created_at6" -} -``` - diff --git a/doc/models/order-created-object.md b/doc/models/order-created-object.md deleted file mode 100644 index c6160cd6..00000000 --- a/doc/models/order-created-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Created Object - -## Structure - -`OrderCreatedObject` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderCreated` | [`?OrderCreated`](../../doc/models/order-created.md) | Optional | - | getOrderCreated(): ?OrderCreated | setOrderCreated(?OrderCreated orderCreated): void | - -## Example (as JSON) - -```json -{ - "order_created": { - "order_id": "order_id8", - "version": 170, - "location_id": "location_id8", - "state": "CANCELED", - "created_at": "created_at2" - } -} -``` - diff --git a/doc/models/order-created.md b/doc/models/order-created.md deleted file mode 100644 index 715b4255..00000000 --- a/doc/models/order-created.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Order Created - -## Structure - -`OrderCreated` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore cannot be updated.

[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `state` | [`?string(OrderState)`](../../doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "order_id": "order_id8", - "version": 86, - "location_id": "location_id8", - "state": "CANCELED", - "created_at": "created_at2" -} -``` - diff --git a/doc/models/order-entry.md b/doc/models/order-entry.md deleted file mode 100644 index f19be1cd..00000000 --- a/doc/models/order-entry.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Order Entry - -A lightweight description of an [order](../../doc/models/order.md) that is returned when -`returned_entries` is `true` on a [SearchOrdersRequest](../../doc/apis/orders.md#search-orders). - -## Structure - -`OrderEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The ID of the order. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore cannot be updated.

[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The location ID the order belongs to. | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "order_id": "order_id0", - "version": 72, - "location_id": "location_id0" -} -``` - diff --git a/doc/models/order-fulfillment-delivery-details-schedule-type.md b/doc/models/order-fulfillment-delivery-details-schedule-type.md deleted file mode 100644 index 31e92720..00000000 --- a/doc/models/order-fulfillment-delivery-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Order Fulfillment Delivery Details Schedule Type - -The schedule type of the delivery fulfillment. - -## Enumeration - -`OrderFulfillmentDeliveryDetailsScheduleType` - -## Fields - -| Name | Description | -| --- | --- | -| `SCHEDULED` | Indicates the fulfillment to deliver at a scheduled deliver time. | -| `ASAP` | Indicates that the fulfillment to deliver as soon as possible and should be prepared
immediately. | - diff --git a/doc/models/order-fulfillment-delivery-details.md b/doc/models/order-fulfillment-delivery-details.md deleted file mode 100644 index 07aab339..00000000 --- a/doc/models/order-fulfillment-delivery-details.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Order Fulfillment Delivery Details - -Describes delivery details of an order fulfillment. - -## Structure - -`OrderFulfillmentDeliveryDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?OrderFulfillmentRecipient`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | -| `scheduleType` | [`?string(OrderFulfillmentDeliveryDetailsScheduleType)`](../../doc/models/order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | getScheduleType(): ?string | setScheduleType(?string scheduleType): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z").
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `deliverAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
that represents the start of the delivery period.
When the fulfillment `schedule_type` is `ASAP`, the field is automatically
set to the current time plus the `prep_time_duration`.
Otherwise, the application can set this field while the fulfillment `state` is
`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the
terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).

The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getDeliverAt(): ?string | setDeliverAt(?string deliverAt): void | -| `prepTimeDuration` | `?string` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getPrepTimeDuration(): ?string | setPrepTimeDuration(?string prepTimeDuration): void | -| `deliveryWindowDuration` | `?string` | Optional | The time period after `deliver_at` in which to deliver the order.
Applications can set this field when the fulfillment `state` is
`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state
such as `COMPLETED`, `CANCELED`, and `FAILED`).
The duration must be in RFC 3339 format (for example, "P1W3D"). | getDeliveryWindowDuration(): ?string | setDeliveryWindowDuration(?string deliveryWindowDuration): void | -| `note` | `?string` | Optional | Provides additional instructions about the delivery fulfillment.
It is displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `550` | getNote(): ?string | setNote(?string note): void | -| `completedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicates when the seller completed the fulfillment.
This field is automatically set when fulfillment `state` changes to `COMPLETED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCompletedAt(): ?string | setCompletedAt(?string completedAt): void | -| `inProgressAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicates when the seller started processing the fulfillment.
This field is automatically set when the fulfillment `state` changes to `RESERVED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | -| `rejectedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was rejected. This field is
automatically set when the fulfillment `state` changes to `FAILED`.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | -| `readyAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the seller marked the fulfillment as ready for
courier pickup. This field is automatically set when the fulfillment `state` changes
to PREPARED.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getReadyAt(): ?string | setReadyAt(?string readyAt): void | -| `deliveredAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was delivered to the recipient.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getDeliveredAt(): ?string | setDeliveredAt(?string deliveredAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was canceled. This field is automatically
set when the fulfillment `state` changes to `CANCELED`.

The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `courierPickupAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when an order can be picked up by the courier for delivery.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCourierPickupAt(): ?string | setCourierPickupAt(?string courierPickupAt): void | -| `courierPickupWindowDuration` | `?string` | Optional | The time period after `courier_pickup_at` in which the courier should pick up the order.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getCourierPickupWindowDuration(): ?string | setCourierPickupWindowDuration(?string courierPickupWindowDuration): void | -| `isNoContactDelivery` | `?bool` | Optional | Whether the delivery is preferred to be no contact. | getIsNoContactDelivery(): ?bool | setIsNoContactDelivery(?bool isNoContactDelivery): void | -| `dropoffNotes` | `?string` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | getDropoffNotes(): ?string | setDropoffNotes(?string dropoffNotes): void | -| `courierProviderName` | `?string` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | getCourierProviderName(): ?string | setCourierProviderName(?string courierProviderName): void | -| `courierSupportPhoneNumber` | `?string` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | getCourierSupportPhoneNumber(): ?string | setCourierSupportPhoneNumber(?string courierSupportPhoneNumber): void | -| `squareDeliveryId` | `?string` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | getSquareDeliveryId(): ?string | setSquareDeliveryId(?string squareDeliveryId): void | -| `externalDeliveryId` | `?string` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | getExternalDeliveryId(): ?string | setExternalDeliveryId(?string externalDeliveryId): void | -| `managedDelivery` | `?bool` | Optional | The flag to indicate the delivery is managed by a third party (ie DoorDash), which means
we may not receive all recipient information for PII purposes. | getManagedDelivery(): ?bool | setManagedDelivery(?bool managedDelivery): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "schedule_type": "SCHEDULED", - "placed_at": "placed_at6", - "deliver_at": "deliver_at2", - "prep_time_duration": "prep_time_duration6" -} -``` - diff --git a/doc/models/order-fulfillment-fulfillment-entry.md b/doc/models/order-fulfillment-fulfillment-entry.md deleted file mode 100644 index 421b7ce1..00000000 --- a/doc/models/order-fulfillment-fulfillment-entry.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Order Fulfillment Fulfillment Entry - -Links an order line item to a fulfillment. Each entry must reference -a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to -fulfill. - -## Structure - -`OrderFulfillmentFulfillmentEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `lineItemUid` | `string` | Required | The `uid` from the order line item.
**Constraints**: *Minimum Length*: `1` | getLineItemUid(): string | setLineItemUid(string lineItemUid): void | -| `quantity` | `string` | Required | The quantity of the line item being fulfilled, formatted as a decimal number.
For example, `"3"`.
Fulfillments for line items with a `quantity_unit` can have non-integer quantities.
For example, `"1.70000"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this fulfillment entry. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).
Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.
Values have a maximum length of 255 characters.
An application can have up to 10 entries per metadata field.
Entries written by applications are private and can only be read or modified by the same
application.
For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | - -## Example (as JSON) - -```json -{ - "uid": "uid6", - "line_item_uid": "line_item_uid6", - "quantity": "quantity2", - "metadata": { - "key0": "metadata7", - "key1": "metadata8", - "key2": "metadata9" - } -} -``` - diff --git a/doc/models/order-fulfillment-fulfillment-line-item-application.md b/doc/models/order-fulfillment-fulfillment-line-item-application.md deleted file mode 100644 index 41268cb5..00000000 --- a/doc/models/order-fulfillment-fulfillment-line-item-application.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Fulfillment Fulfillment Line Item Application - -The `line_item_application` describes what order line items this fulfillment applies -to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - -## Enumeration - -`OrderFulfillmentFulfillmentLineItemApplication` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL` | If `ALL`, `entries` must be unset. | -| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | - diff --git a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md b/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md deleted file mode 100644 index d68e74ba..00000000 --- a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Order Fulfillment Pickup Details Curbside Pickup Details - -Specific details for curbside pickup. - -## Structure - -`OrderFulfillmentPickupDetailsCurbsidePickupDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `curbsideDetails` | `?string` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | getCurbsideDetails(): ?string | setCurbsideDetails(?string curbsideDetails): void | -| `buyerArrivedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getBuyerArrivedAt(): ?string | setBuyerArrivedAt(?string buyerArrivedAt): void | - -## Example (as JSON) - -```json -{ - "curbside_details": "curbside_details8", - "buyer_arrived_at": "buyer_arrived_at4" -} -``` - diff --git a/doc/models/order-fulfillment-pickup-details-schedule-type.md b/doc/models/order-fulfillment-pickup-details-schedule-type.md deleted file mode 100644 index 6e774d4a..00000000 --- a/doc/models/order-fulfillment-pickup-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Order Fulfillment Pickup Details Schedule Type - -The schedule type of the pickup fulfillment. - -## Enumeration - -`OrderFulfillmentPickupDetailsScheduleType` - -## Fields - -| Name | Description | -| --- | --- | -| `SCHEDULED` | Indicates that the fulfillment will be picked up at a scheduled pickup time. | -| `ASAP` | Indicates that the fulfillment will be picked up as soon as possible and
should be prepared immediately. | - diff --git a/doc/models/order-fulfillment-pickup-details.md b/doc/models/order-fulfillment-pickup-details.md deleted file mode 100644 index 9dcc6db7..00000000 --- a/doc/models/order-fulfillment-pickup-details.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Order Fulfillment Pickup Details - -Contains details necessary to fulfill a pickup order. - -## Structure - -`OrderFulfillmentPickupDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?OrderFulfillmentRecipient`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | -| `expiresAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment expires if it is not marked in progress. The timestamp must be
in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set
up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order
are automatically completed. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `autoCompleteDuration` | `?string` | Optional | The duration of time after which an in progress pickup fulfillment is automatically moved
to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D").

If not set, this pickup fulfillment remains in progress until it is canceled or completed. | getAutoCompleteDuration(): ?string | setAutoCompleteDuration(?string autoCompleteDuration): void | -| `scheduleType` | [`?string(OrderFulfillmentPickupDetailsScheduleType)`](../../doc/models/order-fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | getScheduleType(): ?string | setScheduleType(?string scheduleType): void | -| `pickupAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z".
For fulfillments with the schedule type `ASAP`, this is automatically set
to the current time plus the expected duration to prepare the fulfillment. | getPickupAt(): ?string | setPickupAt(?string pickupAt): void | -| `pickupWindowDuration` | `?string` | Optional | The window of time in which the order should be picked up after the `pickup_at` timestamp.
Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an
informational guideline for merchants. | getPickupWindowDuration(): ?string | setPickupWindowDuration(?string pickupWindowDuration): void | -| `prepTimeDuration` | `?string` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | getPrepTimeDuration(): ?string | setPrepTimeDuration(?string prepTimeDuration): void | -| `note` | `?string` | Optional | A note to provide additional instructions about the pickup
fulfillment displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `acceptedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getAcceptedAt(): ?string | setAcceptedAt(?string acceptedAt): void | -| `rejectedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | -| `readyAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getReadyAt(): ?string | setReadyAt(?string readyAt): void | -| `expiredAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment expired. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getExpiredAt(): ?string | setExpiredAt(?string expiredAt): void | -| `pickedUpAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPickedUpAt(): ?string | setPickedUpAt(?string pickedUpAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `isCurbsidePickup` | `?bool` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | getIsCurbsidePickup(): ?bool | setIsCurbsidePickup(?bool isCurbsidePickup): void | -| `curbsidePickupDetails` | [`?OrderFulfillmentPickupDetailsCurbsidePickupDetails`](../../doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md) | Optional | Specific details for curbside pickup. | getCurbsidePickupDetails(): ?OrderFulfillmentPickupDetailsCurbsidePickupDetails | setCurbsidePickupDetails(?OrderFulfillmentPickupDetailsCurbsidePickupDetails curbsidePickupDetails): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "expires_at": "expires_at0", - "auto_complete_duration": "auto_complete_duration0", - "schedule_type": "SCHEDULED", - "pickup_at": "pickup_at8" -} -``` - diff --git a/doc/models/order-fulfillment-recipient.md b/doc/models/order-fulfillment-recipient.md deleted file mode 100644 index a627125c..00000000 --- a/doc/models/order-fulfillment-recipient.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Order Fulfillment Recipient - -Information about the fulfillment recipient. - -## Structure - -`OrderFulfillmentRecipient` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `?string` | Optional | The ID of the customer associated with the fulfillment.
If `customer_id` is provided, the fulfillment recipient's `display_name`,
`email_address`, and `phone_number` are automatically populated from the
targeted customer profile. If these fields are set in the request, the request
values override the information from the customer profile. If the
targeted customer profile does not contain the necessary information and
these fields are left unset, the request results in an error.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `displayName` | `?string` | Optional | The display name of the fulfillment recipient. This field is required.
If provided, the display name overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getDisplayName(): ?string | setDisplayName(?string displayName): void | -| `emailAddress` | `?string` | Optional | The email address of the fulfillment recipient.
If provided, the email address overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `phoneNumber` | `?string` | Optional | The phone number of the fulfillment recipient. This field is required.
If provided, the phone number overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `17` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id0", - "display_name": "display_name2", - "email_address": "email_address0", - "phone_number": "phone_number0", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } -} -``` - diff --git a/doc/models/order-fulfillment-shipment-details.md b/doc/models/order-fulfillment-shipment-details.md deleted file mode 100644 index 330b968f..00000000 --- a/doc/models/order-fulfillment-shipment-details.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Order Fulfillment Shipment Details - -Contains the details necessary to fulfill a shipment order. - -## Structure - -`OrderFulfillmentShipmentDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `recipient` | [`?OrderFulfillmentRecipient`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | -| `carrier` | `?string` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | getCarrier(): ?string | setCarrier(?string carrier): void | -| `shippingNote` | `?string` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | getShippingNote(): ?string | setShippingNote(?string shippingNote): void | -| `shippingType` | `?string` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | getShippingType(): ?string | setShippingType(?string shippingType): void | -| `trackingNumber` | `?string` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | getTrackingNumber(): ?string | setTrackingNumber(?string trackingNumber): void | -| `trackingUrl` | `?string` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | getTrackingUrl(): ?string | setTrackingUrl(?string trackingUrl): void | -| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment was requested. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `inProgressAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `RESERVED` state, which indicates that preparation
of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | -| `packagedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the
fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getPackagedAt(): ?string | setPackagedAt(?string packagedAt): void | -| `expectedShippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment is expected to be delivered to the shipping carrier.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getExpectedShippedAt(): ?string | setExpectedShippedAt(?string expectedShippedAt): void | -| `shippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that
the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getShippedAt(): ?string | setShippedAt(?string shippedAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating the shipment was canceled.
The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | -| `cancelReason` | `?string` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `failedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getFailedAt(): ?string | setFailedAt(?string failedAt): void | -| `failureReason` | `?string` | Optional | A description of why the shipment failed to be completed.
**Constraints**: *Maximum Length*: `100` | getFailureReason(): ?string | setFailureReason(?string failureReason): void | - -## Example (as JSON) - -```json -{ - "recipient": { - "customer_id": "customer_id6", - "display_name": "display_name8", - "email_address": "email_address4", - "phone_number": "phone_number4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "carrier": "carrier4", - "shipping_note": "shipping_note8", - "shipping_type": "shipping_type4", - "tracking_number": "tracking_number0" -} -``` - diff --git a/doc/models/order-fulfillment-state.md b/doc/models/order-fulfillment-state.md deleted file mode 100644 index 0885e821..00000000 --- a/doc/models/order-fulfillment-state.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Order Fulfillment State - -The current state of this fulfillment. - -## Enumeration - -`OrderFulfillmentState` - -## Fields - -| Name | Description | -| --- | --- | -| `PROPOSED` | Indicates that the fulfillment has been proposed. | -| `RESERVED` | Indicates that the fulfillment has been reserved. | -| `PREPARED` | Indicates that the fulfillment has been prepared. | -| `COMPLETED` | Indicates that the fulfillment was successfully completed. | -| `CANCELED` | Indicates that the fulfillment was canceled. | -| `FAILED` | Indicates that the fulfillment failed to be completed, but was not explicitly
canceled. | - diff --git a/doc/models/order-fulfillment-type.md b/doc/models/order-fulfillment-type.md deleted file mode 100644 index 7370fba8..00000000 --- a/doc/models/order-fulfillment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Fulfillment Type - -The type of fulfillment. - -## Enumeration - -`OrderFulfillmentType` - -## Fields - -| Name | Description | -| --- | --- | -| `PICKUP` | A recipient to pick up the fulfillment from a physical [location](../../doc/models/location.md). | -| `SHIPMENT` | A shipping carrier to ship the fulfillment. | -| `DELIVERY` | A courier to deliver the fulfillment. | - diff --git a/doc/models/order-fulfillment-updated-object.md b/doc/models/order-fulfillment-updated-object.md deleted file mode 100644 index 4762e7b1..00000000 --- a/doc/models/order-fulfillment-updated-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Fulfillment Updated Object - -## Structure - -`OrderFulfillmentUpdatedObject` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderFulfillmentUpdated` | [`?OrderFulfillmentUpdated`](../../doc/models/order-fulfillment-updated.md) | Optional | - | getOrderFulfillmentUpdated(): ?OrderFulfillmentUpdated | setOrderFulfillmentUpdated(?OrderFulfillmentUpdated orderFulfillmentUpdated): void | - -## Example (as JSON) - -```json -{ - "order_fulfillment_updated": { - "order_id": "order_id8", - "version": 174, - "location_id": "location_id8", - "state": "CANCELED", - "created_at": "created_at2" - } -} -``` - diff --git a/doc/models/order-fulfillment-updated-update.md b/doc/models/order-fulfillment-updated-update.md deleted file mode 100644 index 6ae5bae1..00000000 --- a/doc/models/order-fulfillment-updated-update.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Fulfillment Updated Update - -Information about fulfillment updates. - -## Structure - -`OrderFulfillmentUpdatedUpdate` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `fulfillmentUid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order. | getFulfillmentUid(): ?string | setFulfillmentUid(?string fulfillmentUid): void | -| `oldState` | [`?string(FulfillmentState)`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | getOldState(): ?string | setOldState(?string oldState): void | -| `newState` | [`?string(FulfillmentState)`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | getNewState(): ?string | setNewState(?string newState): void | - -## Example (as JSON) - -```json -{ - "fulfillment_uid": "fulfillment_uid6", - "old_state": "CANCELED", - "new_state": "PREPARED" -} -``` - diff --git a/doc/models/order-fulfillment-updated.md b/doc/models/order-fulfillment-updated.md deleted file mode 100644 index a5865703..00000000 --- a/doc/models/order-fulfillment-updated.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Order Fulfillment Updated - -## Structure - -`OrderFulfillmentUpdated` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore cannot be updated.

[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `state` | [`?string(OrderState)`](../../doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `fulfillmentUpdate` | [`?(OrderFulfillmentUpdatedUpdate[])`](../../doc/models/order-fulfillment-updated-update.md) | Optional | The fulfillments that were updated with this version change. | getFulfillmentUpdate(): ?array | setFulfillmentUpdate(?array fulfillmentUpdate): void | - -## Example (as JSON) - -```json -{ - "order_id": "order_id0", - "version": 8, - "location_id": "location_id0", - "state": "OPEN", - "created_at": "created_at4" -} -``` - diff --git a/doc/models/order-fulfillment.md b/doc/models/order-fulfillment.md deleted file mode 100644 index bc7ebfb1..00000000 --- a/doc/models/order-fulfillment.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Order Fulfillment - -Contains details about how to fulfill this order. -Orders can only be created with at most one fulfillment using the API. -However, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online. - -## Structure - -`OrderFulfillment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `type` | [`?string(OrderFulfillmentType)`](../../doc/models/order-fulfillment-type.md) | Optional | The type of fulfillment. | getType(): ?string | setType(?string type): void | -| `state` | [`?string(OrderFulfillmentState)`](../../doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | getState(): ?string | setState(?string state): void | -| `lineItemApplication` | [`?string(OrderFulfillmentFulfillmentLineItemApplication)`](../../doc/models/order-fulfillment-fulfillment-line-item-application.md) | Optional | The `line_item_application` describes what order line items this fulfillment applies
to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. | getLineItemApplication(): ?string | setLineItemApplication(?string lineItemApplication): void | -| `entries` | [`?(OrderFulfillmentFulfillmentEntry[])`](../../doc/models/order-fulfillment-fulfillment-entry.md) | Optional | A list of entries pertaining to the fulfillment of an order. Each entry must reference
a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to
fulfill.
Multiple entries can reference the same line item `uid`, as long as the total quantity among
all fulfillment entries referencing a single line item does not exceed the quantity of the
order's line item itself.
An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`,
`CANCELED`, or `FAILED`. Fulfillments can be created and completed independently
before order completion. | getEntries(): ?array | setEntries(?array entries): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this fulfillment. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).
Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.
Values have a maximum length of 255 characters.
An application can have up to 10 entries per metadata field.
Entries written by applications are private and can only be read or modified by the same
application.
For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `pickupDetails` | [`?OrderFulfillmentPickupDetails`](../../doc/models/order-fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | getPickupDetails(): ?OrderFulfillmentPickupDetails | setPickupDetails(?OrderFulfillmentPickupDetails pickupDetails): void | -| `shipmentDetails` | [`?OrderFulfillmentShipmentDetails`](../../doc/models/order-fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | getShipmentDetails(): ?OrderFulfillmentShipmentDetails | setShipmentDetails(?OrderFulfillmentShipmentDetails shipmentDetails): void | -| `deliveryDetails` | [`?OrderFulfillmentDeliveryDetails`](../../doc/models/order-fulfillment-delivery-details.md) | Optional | Describes delivery details of an order fulfillment. | getDeliveryDetails(): ?OrderFulfillmentDeliveryDetails | setDeliveryDetails(?OrderFulfillmentDeliveryDetails deliveryDetails): void | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "type": "PICKUP", - "state": "PROPOSED", - "line_item_application": "ALL", - "entries": [ - { - "uid": "uid0", - "line_item_uid": "line_item_uid0", - "quantity": "quantity6", - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } - }, - { - "uid": "uid0", - "line_item_uid": "line_item_uid0", - "quantity": "quantity6", - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } - }, - { - "uid": "uid0", - "line_item_uid": "line_item_uid0", - "quantity": "quantity6", - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } - } - ] -} -``` - diff --git a/doc/models/order-line-item-applied-discount.md b/doc/models/order-line-item-applied-discount.md deleted file mode 100644 index 0e2f8332..00000000 --- a/doc/models/order-line-item-applied-discount.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Order Line Item Applied Discount - -Represents an applied portion of a discount to a line item in an order. - -Order scoped discounts have automatically applied discounts present for each line item. -Line-item scoped discounts must have applied discounts added manually for any applicable line -items. The corresponding applied money is automatically computed based on participating -line items. - -## Structure - -`OrderLineItemAppliedDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the applied discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `discountUid` | `string` | Required | The `uid` of the discount that the applied discount represents. It must
reference a discount present in the `order.discounts` field.

This field is immutable. To change which discounts apply to a line item,
you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getDiscountUid(): string | setDiscountUid(string discountUid): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "discount_uid": "discount_uid2", - "applied_money": { - "amount": 196, - "currency": "AMD" - } -} -``` - diff --git a/doc/models/order-line-item-applied-service-charge.md b/doc/models/order-line-item-applied-service-charge.md deleted file mode 100644 index 32f25e10..00000000 --- a/doc/models/order-line-item-applied-service-charge.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Order Line Item Applied Service Charge - -## Structure - -`OrderLineItemAppliedServiceCharge` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the applied service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `serviceChargeUid` | `string` | Required | The `uid` of the service charge that the applied service charge represents. It must
reference a service charge present in the `order.service_charges` field.

This field is immutable. To change which service charges apply to a line item,
delete and add a new `OrderLineItemAppliedServiceCharge`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getServiceChargeUid(): string | setServiceChargeUid(string serviceChargeUid): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "service_charge_uid": "service_charge_uid8", - "applied_money": { - "amount": 196, - "currency": "AMD" - } -} -``` - diff --git a/doc/models/order-line-item-applied-tax.md b/doc/models/order-line-item-applied-tax.md deleted file mode 100644 index 7aa37e54..00000000 --- a/doc/models/order-line-item-applied-tax.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Order Line Item Applied Tax - -Represents an applied portion of a tax to a line item in an order. - -Order-scoped taxes automatically include the applied taxes in each line item. -Line item taxes must be referenced from any applicable line items. -The corresponding applied money is automatically computed, based on the -set of participating line items. - -## Structure - -`OrderLineItemAppliedTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the applied tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `taxUid` | `string` | Required | The `uid` of the tax for which this applied tax represents. It must reference
a tax present in the `order.taxes` field.

This field is immutable. To change which taxes apply to a line item, delete and add a new
`OrderLineItemAppliedTax`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getTaxUid(): string | setTaxUid(string taxUid): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "tax_uid": "tax_uid6", - "applied_money": { - "amount": 196, - "currency": "AMD" - } -} -``` - diff --git a/doc/models/order-line-item-discount-scope.md b/doc/models/order-line-item-discount-scope.md deleted file mode 100644 index ccb5bb8a..00000000 --- a/doc/models/order-line-item-discount-scope.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Discount Scope - -Indicates whether this is a line-item or order-level discount. - -## Enumeration - -`OrderLineItemDiscountScope` - -## Fields - -| Name | Description | -| --- | --- | -| `OTHER_DISCOUNT_SCOPE` | Used for reporting only.
The original transaction discount scope is currently not supported by the API. | -| `LINE_ITEM` | The discount should be applied to only line items specified by
`OrderLineItemAppliedDiscount` reference records. | -| `ORDER` | The discount should be applied to the entire order. | - diff --git a/doc/models/order-line-item-discount-type.md b/doc/models/order-line-item-discount-type.md deleted file mode 100644 index 99dc297f..00000000 --- a/doc/models/order-line-item-discount-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Order Line Item Discount Type - -Indicates how the discount is applied to the associated line item or order. - -## Enumeration - -`OrderLineItemDiscountType` - -## Fields - -| Name | Description | -| --- | --- | -| `UNKNOWN_DISCOUNT` | Used for reporting only.
The original transaction discount type is currently not supported by the API. | -| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (such as 5%) off the item price. | -| `FIXED_AMOUNT` | Apply the discount as a fixed monetary value (such as $1.00) off the item price. | -| `VARIABLE_PERCENTAGE` | Apply the discount as a variable percentage based on the item
price.

The specific discount percentage of a `VARIABLE_PERCENTAGE` discount
is assigned at the time of the purchase. | -| `VARIABLE_AMOUNT` | Apply the discount as a variable amount based on the item price.

The specific discount amount of a `VARIABLE_AMOUNT` discount
is assigned at the time of the purchase. | - diff --git a/doc/models/order-line-item-discount.md b/doc/models/order-line-item-discount.md deleted file mode 100644 index dc6ff224..00000000 --- a/doc/models/order-line-item-discount.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Order Line Item Discount - -Represents a discount that applies to one or more line items in an -order. - -Fixed-amount, order-scoped discounts are distributed across all non-zero line item totals. -The amount distributed to each line item is relative to the -amount contributed by the item to the order subtotal. - -## Structure - -`OrderLineItemDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this discount references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `type` | [`?string(OrderLineItemDiscountType)`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | -| `percentage` | `?string` | Optional | The percentage of the discount, as a string representation of a decimal number.
A value of `7.25` corresponds to a percentage of 7.25%.

`percentage` is not set for amount-based discounts.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this discount. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `scope` | [`?string(OrderLineItemDiscountScope)`](../../doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line-item or order-level discount. | getScope(): ?string | setScope(?string scope): void | -| `rewardIds` | `?(string[])` | Optional | The reward IDs corresponding to this discount. The application and
specification of discounts that have `reward_ids` are completely controlled by the backing
criteria corresponding to the reward tiers of the rewards that are added to the order
through the Loyalty API. To manually unapply discounts that are the result of added rewards,
the rewards must be removed from the order through the Loyalty API. | getRewardIds(): ?array | setRewardIds(?array rewardIds): void | -| `pricingRuleId` | `?string` | Optional | The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied
automatically to this discount. The specification and application of the discounts, to
which a `pricing_rule_id` is assigned, are completely controlled by the corresponding
pricing rule. | getPricingRuleId(): ?string | setPricingRuleId(?string pricingRuleId): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "catalog_object_id": "catalog_object_id8", - "catalog_version": 54, - "name": "name4", - "type": "FIXED_PERCENTAGE" -} -``` - diff --git a/doc/models/order-line-item-item-type.md b/doc/models/order-line-item-item-type.md deleted file mode 100644 index 70c09fb0..00000000 --- a/doc/models/order-line-item-item-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Item Type - -Represents the line item type. - -## Enumeration - -`OrderLineItemItemType` - -## Fields - -| Name | Description | -| --- | --- | -| `ITEM` | Indicates that the line item is an itemized sale. | -| `CUSTOM_AMOUNT` | Indicates that the line item is a non-itemized sale. | -| `GIFT_CARD` | Indicates that the line item is a gift card sale. Gift cards sold through
the Orders API are sold in an unactivated state and can be activated through the
Gift Cards API using the line item `uid`. | - diff --git a/doc/models/order-line-item-modifier.md b/doc/models/order-line-item-modifier.md deleted file mode 100644 index fabf6a15..00000000 --- a/doc/models/order-line-item-modifier.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Order Line Item Modifier - -A [CatalogModifier](../../doc/models/catalog-modifier.md). - -## Structure - -`OrderLineItemModifier` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the modifier only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this modifier references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `quantity` | `?string` | Optional | The quantity of the line item modifier. The modifier quantity can be 0 or more.
For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders
this item, the restaurant records the purchase by creating an `Order` object with a line item
for a burger. The line item includes a line item modifier: the name is cheese and the quantity
is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses
the extra cheese option, the modifier quantity increases to 2. If the buyer does not want
any cheese, the modifier quantity is set to 0. | getQuantity(): ?string | setQuantity(?string quantity): void | -| `basePriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | -| `totalPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalPriceMoney(): ?Money | setTotalPriceMoney(?Money totalPriceMoney): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this order. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "catalog_object_id": "catalog_object_id6", - "catalog_version": 134, - "name": "name2", - "quantity": "quantity8" -} -``` - diff --git a/doc/models/order-line-item-pricing-blocklists-blocked-discount.md b/doc/models/order-line-item-pricing-blocklists-blocked-discount.md deleted file mode 100644 index 0bfd5e8a..00000000 --- a/doc/models/order-line-item-pricing-blocklists-blocked-discount.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Order Line Item Pricing Blocklists Blocked Discount - -A discount to block from applying to a line item. The discount must be -identified by either `discount_uid` or `discount_catalog_object_id`, but not both. - -## Structure - -`OrderLineItemPricingBlocklistsBlockedDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID of the `BlockedDiscount` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `discountUid` | `?string` | Optional | The `uid` of the discount that should be blocked. Use this field to block
ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getDiscountUid(): ?string | setDiscountUid(?string discountUid): void | -| `discountCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the discount that should be blocked.
Use this field to block catalog discounts. For ad hoc discounts, use the
`discount_uid` field.
**Constraints**: *Maximum Length*: `192` | getDiscountCatalogObjectId(): ?string | setDiscountCatalogObjectId(?string discountCatalogObjectId): void | - -## Example (as JSON) - -```json -{ - "uid": "uid6", - "discount_uid": "discount_uid8", - "discount_catalog_object_id": "discount_catalog_object_id8" -} -``` - diff --git a/doc/models/order-line-item-pricing-blocklists-blocked-tax.md b/doc/models/order-line-item-pricing-blocklists-blocked-tax.md deleted file mode 100644 index 4c39884c..00000000 --- a/doc/models/order-line-item-pricing-blocklists-blocked-tax.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Order Line Item Pricing Blocklists Blocked Tax - -A tax to block from applying to a line item. The tax must be -identified by either `tax_uid` or `tax_catalog_object_id`, but not both. - -## Structure - -`OrderLineItemPricingBlocklistsBlockedTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID of the `BlockedTax` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `taxUid` | `?string` | Optional | The `uid` of the tax that should be blocked. Use this field to block
ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getTaxUid(): ?string | setTaxUid(?string taxUid): void | -| `taxCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the tax that should be blocked.
Use this field to block catalog taxes. For ad hoc taxes, use the
`tax_uid` field.
**Constraints**: *Maximum Length*: `192` | getTaxCatalogObjectId(): ?string | setTaxCatalogObjectId(?string taxCatalogObjectId): void | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "tax_uid": "tax_uid4", - "tax_catalog_object_id": "tax_catalog_object_id2" -} -``` - diff --git a/doc/models/order-line-item-pricing-blocklists.md b/doc/models/order-line-item-pricing-blocklists.md deleted file mode 100644 index 607e69db..00000000 --- a/doc/models/order-line-item-pricing-blocklists.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Order Line Item Pricing Blocklists - -Describes pricing adjustments that are blocked from automatic -application to a line item. For more information, see -[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). - -## Structure - -`OrderLineItemPricingBlocklists` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `blockedDiscounts` | [`?(OrderLineItemPricingBlocklistsBlockedDiscount[])`](../../doc/models/order-line-item-pricing-blocklists-blocked-discount.md) | Optional | A list of discounts blocked from applying to the line item.
Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or
the `discount_catalog_object_id` (for catalog discounts). | getBlockedDiscounts(): ?array | setBlockedDiscounts(?array blockedDiscounts): void | -| `blockedTaxes` | [`?(OrderLineItemPricingBlocklistsBlockedTax[])`](../../doc/models/order-line-item-pricing-blocklists-blocked-tax.md) | Optional | A list of taxes blocked from applying to the line item.
Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or
the `tax_catalog_object_id` (for catalog taxes). | getBlockedTaxes(): ?array | setBlockedTaxes(?array blockedTaxes): void | - -## Example (as JSON) - -```json -{ - "blocked_discounts": [ - { - "uid": "uid0", - "discount_uid": "discount_uid6", - "discount_catalog_object_id": "discount_catalog_object_id2" - }, - { - "uid": "uid0", - "discount_uid": "discount_uid6", - "discount_catalog_object_id": "discount_catalog_object_id2" - }, - { - "uid": "uid0", - "discount_uid": "discount_uid6", - "discount_catalog_object_id": "discount_catalog_object_id2" - } - ], - "blocked_taxes": [ - { - "uid": "uid4", - "tax_uid": "tax_uid0", - "tax_catalog_object_id": "tax_catalog_object_id8" - }, - { - "uid": "uid4", - "tax_uid": "tax_uid0", - "tax_catalog_object_id": "tax_catalog_object_id8" - } - ] -} -``` - diff --git a/doc/models/order-line-item-tax-scope.md b/doc/models/order-line-item-tax-scope.md deleted file mode 100644 index 3a27c8fd..00000000 --- a/doc/models/order-line-item-tax-scope.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Tax Scope - -Indicates whether this is a line-item or order-level tax. - -## Enumeration - -`OrderLineItemTaxScope` - -## Fields - -| Name | Description | -| --- | --- | -| `OTHER_TAX_SCOPE` | Used for reporting only.
The original transaction tax scope is currently not supported by the API. | -| `LINE_ITEM` | The tax should be applied only to line items specified by
the `OrderLineItemAppliedTax` reference records. | -| `ORDER` | The tax should be applied to the entire order. | - diff --git a/doc/models/order-line-item-tax-type.md b/doc/models/order-line-item-tax-type.md deleted file mode 100644 index 780dfa36..00000000 --- a/doc/models/order-line-item-tax-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Tax Type - -Indicates how the tax is applied to the associated line item or order. - -## Enumeration - -`OrderLineItemTaxType` - -## Fields - -| Name | Description | -| --- | --- | -| `UNKNOWN_TAX` | Used for reporting only.
The original transaction tax type is currently not supported by the API. | -| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the price.
For example, an item with a cost of 1.00 USD and a 10% additive tax has a total
cost to the buyer of 1.10 USD. | -| `INCLUSIVE` | The tax is an inclusive tax. Inclusive taxes are already included
in the line item price or order total. For example, an item with a cost of
1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD
(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to
the buyer. | - diff --git a/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md deleted file mode 100644 index b446d2f4..00000000 --- a/doc/models/order-line-item-tax.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Order Line Item Tax - -Represents a tax that applies to one or more line item in the order. - -Fixed-amount, order-scoped taxes are distributed across all non-zero line item totals. -The amount distributed to each line item is relative to the amount the item -contributes to the order subtotal. - -## Structure - -`OrderLineItemTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this tax references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `type` | [`?string(OrderLineItemTaxType)`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | -| `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal
number. For example, a value of `"7.25"` corresponds to a percentage of
7.25%.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this tax. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `scope` | [`?string(OrderLineItemTaxScope)`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | getScope(): ?string | setScope(?string scope): void | -| `autoApplied` | `?bool` | Optional | Determines whether the tax was automatically applied to the order based on
the catalog configuration. For an example, see
[Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes). | getAutoApplied(): ?bool | setAutoApplied(?bool autoApplied): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "catalog_object_id": "catalog_object_id2", - "catalog_version": 190, - "name": "name4", - "type": "ADDITIVE" -} -``` - diff --git a/doc/models/order-line-item.md b/doc/models/order-line-item.md deleted file mode 100644 index 22d74059..00000000 --- a/doc/models/order-line-item.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Order Line Item - -Represents a line item in an order. Each line item describes a different -product to purchase, with its own quantity and price details. - -## Structure - -`OrderLineItem` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the line item only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `name` | `?string` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `quantity` | `string` | Required | The count, or measurement, of a line item being purchased:

If `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an item count. For example: `3` apples.

If `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` denotes a measurement. For example: `2.25` pounds of broccoli.

For more information, see [Specify item quantity and measurement unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit).

Line items with a quantity of `0` are automatically removed
when paying for or otherwise completing the order.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | -| `quantityUnit` | [`?OrderQuantityUnit`](../../doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision that
specifies the number of digits after the decimal point for decimal quantities. | getQuantityUnit(): ?OrderQuantityUnit | setQuantityUnit(?OrderQuantityUnit quantityUnit): void | -| `note` | `?string` | Optional | An optional note associated with the line item.
**Constraints**: *Maximum Length*: `2000` | getNote(): ?string | setNote(?string note): void | -| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this line item references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `variationName` | `?string` | Optional | The name of the variation applied to this line item.
**Constraints**: *Maximum Length*: `400` | getVariationName(): ?string | setVariationName(?string variationName): void | -| `itemType` | [`?string(OrderLineItemItemType)`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | getItemType(): ?string | setItemType(?string itemType): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this line item. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `modifiers` | [`?(OrderLineItemModifier[])`](../../doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | getModifiers(): ?array | setModifiers(?array modifiers): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](../../doc/models/order-line-item-applied-tax.md) | Optional | The list of references to taxes applied to this line item. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a
top-level `OrderLineItemTax` applied to the line item. On reads, the
amount applied is populated.

An `OrderLineItemAppliedTax` is automatically created on every line
item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax`
records for `LINE_ITEM` scoped taxes must be added in requests for the tax
to apply to any line items.

To change the amount of a tax, modify the referenced top-level tax. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | -| `appliedDiscounts` | [`?(OrderLineItemAppliedDiscount[])`](../../doc/models/order-line-item-applied-discount.md) | Optional | The list of references to discounts applied to this line item. Each
`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level
`OrderLineItemDiscounts` applied to the line item. On reads, the amount
applied is populated.

An `OrderLineItemAppliedDiscount` is automatically created on every line item for all
`ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records
for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any
line items.

To change the amount of a discount, modify the referenced top-level discount. | getAppliedDiscounts(): ?array | setAppliedDiscounts(?array appliedDiscounts): void | -| `appliedServiceCharges` | [`?(OrderLineItemAppliedServiceCharge[])`](../../doc/models/order-line-item-applied-service-charge.md) | Optional | The list of references to service charges applied to this line item. Each
`OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a
top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is
populated.

To change the amount of a service charge, modify the referenced top-level service charge. | getAppliedServiceCharges(): ?array | setAppliedServiceCharges(?array appliedServiceCharges): void | -| `basePriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | -| `variationTotalPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getVariationTotalPriceMoney(): ?Money | setVariationTotalPriceMoney(?Money variationTotalPriceMoney): void | -| `grossSalesMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getGrossSalesMoney(): ?Money | setGrossSalesMoney(?Money grossSalesMoney): void | -| `totalTaxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `totalDiscountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalDiscountMoney(): ?Money | setTotalDiscountMoney(?Money totalDiscountMoney): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `pricingBlocklists` | [`?OrderLineItemPricingBlocklists`](../../doc/models/order-line-item-pricing-blocklists.md) | Optional | Describes pricing adjustments that are blocked from automatic
application to a line item. For more information, see
[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). | getPricingBlocklists(): ?OrderLineItemPricingBlocklists | setPricingBlocklists(?OrderLineItemPricingBlocklists pricingBlocklists): void | -| `totalServiceChargeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalServiceChargeMoney(): ?Money | setTotalServiceChargeMoney(?Money totalServiceChargeMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "name": "name4", - "quantity": "quantity0", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note0", - "catalog_object_id": "catalog_object_id8" -} -``` - diff --git a/doc/models/order-money-amounts.md b/doc/models/order-money-amounts.md deleted file mode 100644 index 24e95b16..00000000 --- a/doc/models/order-money-amounts.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Order Money Amounts - -A collection of various money amounts. - -## Structure - -`OrderMoneyAmounts` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `taxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTaxMoney(): ?Money | setTaxMoney(?Money taxMoney): void | -| `discountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getDiscountMoney(): ?Money | setDiscountMoney(?Money discountMoney): void | -| `tipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | -| `serviceChargeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getServiceChargeMoney(): ?Money | setServiceChargeMoney(?Money serviceChargeMoney): void | - -## Example (as JSON) - -```json -{ - "total_money": { - "amount": 250, - "currency": "UAH" - }, - "tax_money": { - "amount": 58, - "currency": "IRR" - }, - "discount_money": { - "amount": 92, - "currency": "PAB" - }, - "tip_money": { - "amount": 190, - "currency": "TWD" - }, - "service_charge_money": { - "amount": 160, - "currency": "XCD" - } -} -``` - diff --git a/doc/models/order-pricing-options.md b/doc/models/order-pricing-options.md deleted file mode 100644 index 3e8c7fd3..00000000 --- a/doc/models/order-pricing-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Pricing Options - -Pricing options for an order. The options affect how the order's price is calculated. -They can be used, for example, to apply automatic price adjustments that are based on preconfigured -[pricing rules](../../doc/models/catalog-pricing-rule.md). - -## Structure - -`OrderPricingOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `autoApplyDiscounts` | `?bool` | Optional | The option to determine whether pricing rule-based
discounts are automatically applied to an order. | getAutoApplyDiscounts(): ?bool | setAutoApplyDiscounts(?bool autoApplyDiscounts): void | -| `autoApplyTaxes` | `?bool` | Optional | The option to determine whether rule-based taxes are automatically
applied to an order when the criteria of the corresponding rules are met. | getAutoApplyTaxes(): ?bool | setAutoApplyTaxes(?bool autoApplyTaxes): void | - -## Example (as JSON) - -```json -{ - "auto_apply_discounts": false, - "auto_apply_taxes": false -} -``` - diff --git a/doc/models/order-quantity-unit.md b/doc/models/order-quantity-unit.md deleted file mode 100644 index ebdcf416..00000000 --- a/doc/models/order-quantity-unit.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Order Quantity Unit - -Contains the measurement unit for a quantity and a precision that -specifies the number of digits after the decimal point for decimal quantities. - -## Structure - -`OrderQuantityUnit` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `measurementUnit` | [`?MeasurementUnit`](../../doc/models/measurement-unit.md) | Optional | Represents a unit of measurement to use with a quantity, such as ounces
or inches. Exactly one of the following fields are required: `custom_unit`,
`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. | getMeasurementUnit(): ?MeasurementUnit | setMeasurementUnit(?MeasurementUnit measurementUnit): void | -| `precision` | `?int` | Optional | For non-integer quantities, represents the number of digits after the decimal point that are
recorded for this quantity.

For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`.

Min: 0. Max: 5. | getPrecision(): ?int | setPrecision(?int precision): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing the
[CatalogMeasurementUnit](entity:CatalogMeasurementUnit).

This field is set when this is a catalog-backed measurement unit. | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this measurement unit references.

This field is set when this is a catalog-backed measurement unit. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | - -## Example (as JSON) - -```json -{ - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 144, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 78 -} -``` - diff --git a/doc/models/order-return-discount.md b/doc/models/order-return-discount.md deleted file mode 100644 index fbba050b..00000000 --- a/doc/models/order-return-discount.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Order Return Discount - -Represents a discount being returned that applies to one or more return line items in an -order. - -Fixed-amount, order-scoped discounts are distributed across all non-zero return line item totals. -The amount distributed to each return line item is relative to that item’s contribution to the -order subtotal. - -## Structure - -`OrderReturnDiscount` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the returned discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceDiscountUid` | `?string` | Optional | The discount `uid` from the order that contains the original application of this discount.
**Constraints**: *Maximum Length*: `60` | getSourceDiscountUid(): ?string | setSourceDiscountUid(?string sourceDiscountUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this discount references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `type` | [`?string(OrderLineItemDiscountType)`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | -| `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal number.
A value of `"7.25"` corresponds to a percentage of 7.25%.

`percentage` is not set for amount-based discounts.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `scope` | [`?string(OrderLineItemDiscountScope)`](../../doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line-item or order-level discount. | getScope(): ?string | setScope(?string scope): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "source_discount_uid": "source_discount_uid2", - "catalog_object_id": "catalog_object_id4", - "catalog_version": 188, - "name": "name2" -} -``` - diff --git a/doc/models/order-return-line-item-modifier.md b/doc/models/order-return-line-item-modifier.md deleted file mode 100644 index 0cd8bf42..00000000 --- a/doc/models/order-return-line-item-modifier.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Order Return Line Item Modifier - -A line item modifier being returned. - -## Structure - -`OrderReturnLineItemModifier` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceModifierUid` | `?string` | Optional | The modifier `uid` from the order's line item that contains the
original sale of this line item modifier.
**Constraints**: *Maximum Length*: `60` | getSourceModifierUid(): ?string | setSourceModifierUid(?string sourceModifierUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this line item modifier references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `basePriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | -| `totalPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalPriceMoney(): ?Money | setTotalPriceMoney(?Money totalPriceMoney): void | -| `quantity` | `?string` | Optional | The quantity of the line item modifier. The modifier quantity can be 0 or more.
For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders
this item, the restaurant records the purchase by creating an `Order` object with a line item
for a burger. The line item includes a line item modifier: the name is cheese and the quantity
is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses
the extra cheese option, the modifier quantity increases to 2. If the buyer does not want
any cheese, the modifier quantity is set to 0. | getQuantity(): ?string | setQuantity(?string quantity): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "source_modifier_uid": "source_modifier_uid8", - "catalog_object_id": "catalog_object_id8", - "catalog_version": 46, - "name": "name4" -} -``` - diff --git a/doc/models/order-return-line-item.md b/doc/models/order-return-line-item.md deleted file mode 100644 index 0b38499e..00000000 --- a/doc/models/order-return-line-item.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Order Return Line Item - -The line item being returned in an order. - -## Structure - -`OrderReturnLineItem` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID for this return line-item entry.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceLineItemUid` | `?string` | Optional | The `uid` of the line item in the original sale order.
**Constraints**: *Maximum Length*: `60` | getSourceLineItemUid(): ?string | setSourceLineItemUid(?string sourceLineItemUid): void | -| `name` | `?string` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `quantity` | `string` | Required | The quantity returned, formatted as a decimal number.
For example, `"3"`.

Line items with a `quantity_unit` can have non-integer quantities.
For example, `"1.70000"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | -| `quantityUnit` | [`?OrderQuantityUnit`](../../doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision that
specifies the number of digits after the decimal point for decimal quantities. | getQuantityUnit(): ?OrderQuantityUnit | setQuantityUnit(?OrderQuantityUnit quantityUnit): void | -| `note` | `?string` | Optional | The note of the return line item.
**Constraints**: *Maximum Length*: `2000` | getNote(): ?string | setNote(?string note): void | -| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this line item references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `variationName` | `?string` | Optional | The name of the variation applied to this return line item.
**Constraints**: *Maximum Length*: `400` | getVariationName(): ?string | setVariationName(?string variationName): void | -| `itemType` | [`?string(OrderLineItemItemType)`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | getItemType(): ?string | setItemType(?string itemType): void | -| `returnModifiers` | [`?(OrderReturnLineItemModifier[])`](../../doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | getReturnModifiers(): ?array | setReturnModifiers(?array returnModifiers): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](../../doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the return line item. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderReturnTax` applied to the return line item. On reads, the applied amount
is populated. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | -| `appliedDiscounts` | [`?(OrderLineItemAppliedDiscount[])`](../../doc/models/order-line-item-applied-discount.md) | Optional | The list of references to `OrderReturnDiscount` entities applied to the return line item. Each
`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level
`OrderReturnDiscount` applied to the return line item. On reads, the applied amount
is populated. | getAppliedDiscounts(): ?array | setAppliedDiscounts(?array appliedDiscounts): void | -| `basePriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | -| `variationTotalPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getVariationTotalPriceMoney(): ?Money | setVariationTotalPriceMoney(?Money variationTotalPriceMoney): void | -| `grossReturnMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getGrossReturnMoney(): ?Money | setGrossReturnMoney(?Money grossReturnMoney): void | -| `totalTaxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `totalDiscountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalDiscountMoney(): ?Money | setTotalDiscountMoney(?Money totalDiscountMoney): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `appliedServiceCharges` | [`?(OrderLineItemAppliedServiceCharge[])`](../../doc/models/order-line-item-applied-service-charge.md) | Optional | The list of references to `OrderReturnServiceCharge` entities applied to the return
line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that
references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line
item. On reads, the applied amount is populated. | getAppliedServiceCharges(): ?array | setAppliedServiceCharges(?array appliedServiceCharges): void | -| `totalServiceChargeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalServiceChargeMoney(): ?Money | setTotalServiceChargeMoney(?Money totalServiceChargeMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "source_line_item_uid": "source_line_item_uid0", - "name": "name2", - "quantity": "quantity8", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note8" -} -``` - diff --git a/doc/models/order-return-service-charge.md b/doc/models/order-return-service-charge.md deleted file mode 100644 index 13ca452a..00000000 --- a/doc/models/order-return-service-charge.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Order Return Service Charge - -Represents the service charge applied to the original order. - -## Structure - -`OrderReturnServiceCharge` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the return service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceServiceChargeUid` | `?string` | Optional | The service charge `uid` from the order containing the original
service charge. `source_service_charge_uid` is `null` for
unlinked returns.
**Constraints**: *Maximum Length*: `60` | getSourceServiceChargeUid(): ?string | setSourceServiceChargeUid(?string sourceServiceChargeUid): void | -| `name` | `?string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this service charge references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `percentage` | `?string` | Optional | The percentage of the service charge, as a string representation of
a decimal number. For example, a value of `"7.25"` corresponds to a
percentage of 7.25%.

Either `percentage` or `amount_money` should be set, but not both.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `totalTaxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `calculationPhase` | [`?string(OrderServiceChargeCalculationPhase)`](../../doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied after the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | -| `taxable` | `?bool` | Optional | Indicates whether the surcharge can be taxed. Service charges
calculated in the `TOTAL_PHASE` cannot be marked as taxable. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](../../doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the
`OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid`
that references the `uid` of a top-level `OrderReturnTax` that is being
applied to the `OrderReturnServiceCharge`. On reads, the applied amount is
populated. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | -| `treatmentType` | [`?string(OrderServiceChargeTreatmentType)`](../../doc/models/order-service-charge-treatment-type.md) | Optional | Indicates whether the service charge will be treated as a value-holding line item or
apportioned toward a line item. | getTreatmentType(): ?string | setTreatmentType(?string treatmentType): void | -| `scope` | [`?string(OrderServiceChargeScope)`](../../doc/models/order-service-charge-scope.md) | Optional | Indicates whether this is a line-item or order-level apportioned
service charge. | getScope(): ?string | setScope(?string scope): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "source_service_charge_uid": "source_service_charge_uid6", - "name": "name0", - "catalog_object_id": "catalog_object_id4", - "catalog_version": 18 -} -``` - diff --git a/doc/models/order-return-tax.md b/doc/models/order-return-tax.md deleted file mode 100644 index 96259f6e..00000000 --- a/doc/models/order-return-tax.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Order Return Tax - -Represents a tax being returned that applies to one or more return line items in an order. - -Fixed-amount, order-scoped taxes are distributed across all non-zero return line item totals. -The amount distributed to each return line item is relative to that item’s contribution to the -order subtotal. - -## Structure - -`OrderReturnTax` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the returned tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceTaxUid` | `?string` | Optional | The tax `uid` from the order that contains the original tax charge.
**Constraints**: *Maximum Length*: `60` | getSourceTaxUid(): ?string | setSourceTaxUid(?string sourceTaxUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this tax references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `name` | `?string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `type` | [`?string(OrderLineItemTaxType)`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | -| `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal number.
For example, a value of `"7.25"` corresponds to a percentage of 7.25%.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `scope` | [`?string(OrderLineItemTaxScope)`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | getScope(): ?string | setScope(?string scope): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "source_tax_uid": "source_tax_uid2", - "catalog_object_id": "catalog_object_id8", - "catalog_version": 124, - "name": "name4" -} -``` - diff --git a/doc/models/order-return-tip.md b/doc/models/order-return-tip.md deleted file mode 100644 index 9f0dce14..00000000 --- a/doc/models/order-return-tip.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Order Return Tip - -A tip being returned. - -## Structure - -`OrderReturnTip` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the tip only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `sourceTenderUid` | `?string` | Optional | The tender `uid` from the order that contains the original application of this tip.
**Constraints**: *Maximum Length*: `192` | getSourceTenderUid(): ?string | setSourceTenderUid(?string sourceTenderUid): void | -| `sourceTenderId` | `?string` | Optional | The tender `id` from the order that contains the original application of this tip.
**Constraints**: *Maximum Length*: `192` | getSourceTenderId(): ?string | setSourceTenderId(?string sourceTenderId): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "applied_money": { - "amount": 196, - "currency": "AMD" - }, - "source_tender_uid": "source_tender_uid6", - "source_tender_id": "source_tender_id0" -} -``` - diff --git a/doc/models/order-return.md b/doc/models/order-return.md deleted file mode 100644 index 73455eda..00000000 --- a/doc/models/order-return.md +++ /dev/null @@ -1,95 +0,0 @@ - -# Order Return - -The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. - -## Structure - -`OrderReturn` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the return only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceOrderId` | `?string` | Optional | An order that contains the original sale of these return line items. This is unset
for unlinked returns. | getSourceOrderId(): ?string | setSourceOrderId(?string sourceOrderId): void | -| `returnLineItems` | [`?(OrderReturnLineItem[])`](../../doc/models/order-return-line-item.md) | Optional | A collection of line items that are being returned. | getReturnLineItems(): ?array | setReturnLineItems(?array returnLineItems): void | -| `returnServiceCharges` | [`?(OrderReturnServiceCharge[])`](../../doc/models/order-return-service-charge.md) | Optional | A collection of service charges that are being returned. | getReturnServiceCharges(): ?array | setReturnServiceCharges(?array returnServiceCharges): void | -| `returnTaxes` | [`?(OrderReturnTax[])`](../../doc/models/order-return-tax.md) | Optional | A collection of references to taxes being returned for an order, including the total
applied tax amount to be returned. The taxes must reference a top-level tax ID from the source
order. | getReturnTaxes(): ?array | setReturnTaxes(?array returnTaxes): void | -| `returnDiscounts` | [`?(OrderReturnDiscount[])`](../../doc/models/order-return-discount.md) | Optional | A collection of references to discounts being returned for an order, including the total
applied discount amount to be returned. The discounts must reference a top-level discount ID
from the source order. | getReturnDiscounts(): ?array | setReturnDiscounts(?array returnDiscounts): void | -| `returnTips` | [`?(OrderReturnTip[])`](../../doc/models/order-return-tip.md) | Optional | A collection of references to tips being returned for an order. | getReturnTips(): ?array | setReturnTips(?array returnTips): void | -| `roundingAdjustment` | [`?OrderRoundingAdjustment`](../../doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply cash rounding
when the minimum unit of the account is smaller than the lowest physical denomination of the currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | -| `returnAmounts` | [`?OrderMoneyAmounts`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getReturnAmounts(): ?OrderMoneyAmounts | setReturnAmounts(?OrderMoneyAmounts returnAmounts): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "source_order_id": "source_order_id0", - "return_line_items": [ - { - "uid": "uid0", - "source_line_item_uid": "source_line_item_uid2", - "name": "name0", - "quantity": "quantity6", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4" - } - ], - "return_service_charges": [ - { - "uid": "uid6", - "source_service_charge_uid": "source_service_charge_uid0", - "name": "name6", - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - { - "uid": "uid6", - "source_service_charge_uid": "source_service_charge_uid0", - "name": "name6", - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - } - ], - "return_taxes": [ - { - "uid": "uid2", - "source_tax_uid": "source_tax_uid0", - "catalog_object_id": "catalog_object_id4", - "catalog_version": 106, - "name": "name2" - }, - { - "uid": "uid2", - "source_tax_uid": "source_tax_uid0", - "catalog_object_id": "catalog_object_id4", - "catalog_version": 106, - "name": "name2" - }, - { - "uid": "uid2", - "source_tax_uid": "source_tax_uid0", - "catalog_object_id": "catalog_object_id4", - "catalog_version": 106, - "name": "name2" - } - ] -} -``` - diff --git a/doc/models/order-reward.md b/doc/models/order-reward.md deleted file mode 100644 index 81e6b124..00000000 --- a/doc/models/order-reward.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Order Reward - -Represents a reward that can be applied to an order if the necessary -reward tier criteria are met. Rewards are created through the Loyalty API. - -## Structure - -`OrderReward` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The identifier of the reward.
**Constraints**: *Minimum Length*: `1` | getId(): string | setId(string id): void | -| `rewardTierId` | `string` | Required | The identifier of the reward tier corresponding to this reward.
**Constraints**: *Minimum Length*: `1` | getRewardTierId(): string | setRewardTierId(string rewardTierId): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "reward_tier_id": "reward_tier_id6" -} -``` - diff --git a/doc/models/order-rounding-adjustment.md b/doc/models/order-rounding-adjustment.md deleted file mode 100644 index 6ed42c78..00000000 --- a/doc/models/order-rounding-adjustment.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Order Rounding Adjustment - -A rounding adjustment of the money being returned. Commonly used to apply cash rounding -when the minimum unit of the account is smaller than the lowest physical denomination of the currency. - -## Structure - -`OrderRoundingAdjustment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the rounding adjustment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `name` | `?string` | Optional | The name of the rounding adjustment from the original sale order. | getName(): ?string | setName(?string name): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "name": "name0", - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/order-service-charge-calculation-phase.md b/doc/models/order-service-charge-calculation-phase.md deleted file mode 100644 index f1a054a9..00000000 --- a/doc/models/order-service-charge-calculation-phase.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Order Service Charge Calculation Phase - -Represents a phase in the process of calculating order totals. -Service charges are applied after the indicated phase. - -[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) - -## Enumeration - -`OrderServiceChargeCalculationPhase` - -## Fields - -| Name | Description | -| --- | --- | -| `SUBTOTAL_PHASE` | The service charge is applied after discounts, but before
taxes. | -| `TOTAL_PHASE` | The service charge is applied after all discounts and taxes
are applied. | -| `APPORTIONED_PERCENTAGE_PHASE` | The service charge is calculated as a compounding adjustment
after any discounts, but before amount based apportioned service charges
and any tax considerations. | -| `APPORTIONED_AMOUNT_PHASE` | The service charge is calculated as a compounding adjustment
after any discounts and percentage based apportioned service charges,
but before any tax considerations. | - diff --git a/doc/models/order-service-charge-scope.md b/doc/models/order-service-charge-scope.md deleted file mode 100644 index 646680f4..00000000 --- a/doc/models/order-service-charge-scope.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Order Service Charge Scope - -Indicates whether this is a line-item or order-level apportioned -service charge. - -## Enumeration - -`OrderServiceChargeScope` - -## Fields - -| Name | Description | -| --- | --- | -| `OTHER_SERVICE_CHARGE_SCOPE` | Used for reporting only.
The original transaction service charge scope is currently not supported by the API. | -| `LINE_ITEM` | The service charge should be applied to only line items specified by
`OrderLineItemAppliedServiceCharge` reference records. | -| `ORDER` | The service charge should be applied to the entire order. | - diff --git a/doc/models/order-service-charge-treatment-type.md b/doc/models/order-service-charge-treatment-type.md deleted file mode 100644 index f54d58b5..00000000 --- a/doc/models/order-service-charge-treatment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Service Charge Treatment Type - -Indicates whether the service charge will be treated as a value-holding line item or -apportioned toward a line item. - -## Enumeration - -`OrderServiceChargeTreatmentType` - -## Fields - -| Name | -| --- | -| `LINE_ITEM_TREATMENT` | -| `APPORTIONED_TREATMENT` | - diff --git a/doc/models/order-service-charge-type.md b/doc/models/order-service-charge-type.md deleted file mode 100644 index 5c9f9159..00000000 --- a/doc/models/order-service-charge-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Order Service Charge Type - -## Enumeration - -`OrderServiceChargeType` - -## Fields - -| Name | -| --- | -| `AUTO_GRATUITY` | -| `CUSTOM` | - diff --git a/doc/models/order-service-charge.md b/doc/models/order-service-charge.md deleted file mode 100644 index df4b3561..00000000 --- a/doc/models/order-service-charge.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Order Service Charge - -Represents a service charge applied to an order. - -## Structure - -`OrderServiceCharge` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | A unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `name` | `?string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | -| `catalogVersion` | `?int` | Optional | The version of the catalog object that this service charge references. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `percentage` | `?string` | Optional | The service charge percentage as a string representation of a
decimal number. For example, `"7.25"` indicates a service charge of 7.25%.

Exactly 1 of `percentage` or `amount_money` should be set.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `appliedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `totalTaxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `calculationPhase` | [`?string(OrderServiceChargeCalculationPhase)`](../../doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied after the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | -| `taxable` | `?bool` | Optional | Indicates whether the service charge can be taxed. If set to `true`,
order-level taxes automatically apply to the service charge. Note that
service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](../../doc/models/order-line-item-applied-tax.md) | Optional | The list of references to the taxes applied to this service charge. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied
is populated.

An `OrderLineItemAppliedTax` is automatically created on every taxable service charge
for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records
for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable
service charge. Taxable service charges have the `taxable` field set to `true` and calculated
in the `SUBTOTAL_PHASE`.

To change the amount of a tax, modify the referenced top-level tax. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this service charge. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `type` | [`?string(OrderServiceChargeType)`](../../doc/models/order-service-charge-type.md) | Optional | - | getType(): ?string | setType(?string type): void | -| `treatmentType` | [`?string(OrderServiceChargeTreatmentType)`](../../doc/models/order-service-charge-treatment-type.md) | Optional | Indicates whether the service charge will be treated as a value-holding line item or
apportioned toward a line item. | getTreatmentType(): ?string | setTreatmentType(?string treatmentType): void | -| `scope` | [`?string(OrderServiceChargeScope)`](../../doc/models/order-service-charge-scope.md) | Optional | Indicates whether this is a line-item or order-level apportioned
service charge. | getScope(): ?string | setScope(?string scope): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "name": "name2", - "catalog_object_id": "catalog_object_id6", - "catalog_version": 104, - "percentage": "percentage0" -} -``` - diff --git a/doc/models/order-source.md b/doc/models/order-source.md deleted file mode 100644 index 94402ff9..00000000 --- a/doc/models/order-source.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Order Source - -Represents the origination details of an order. - -## Structure - -`OrderSource` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The name used to identify the place (physical or digital) that an order originates.
If unset, the name defaults to the name of the application that created the order. | getName(): ?string | setName(?string name): void | - -## Example (as JSON) - -```json -{ - "name": "name2" -} -``` - diff --git a/doc/models/order-state.md b/doc/models/order-state.md deleted file mode 100644 index 9cc35bf0..00000000 --- a/doc/models/order-state.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Order State - -The state of the order. - -## Enumeration - -`OrderState` - -## Fields - -| Name | Description | -| --- | --- | -| `OPEN` | Indicates that the order is open. Open orders can be updated. | -| `COMPLETED` | Indicates that the order is completed. Completed orders are fully paid. This is a terminal state. | -| `CANCELED` | Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state. | -| `DRAFT` | Indicates that the order is in a draft state. Draft orders can be updated,
but cannot be paid or fulfilled.
For more information, see [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders). | - diff --git a/doc/models/order-updated-object.md b/doc/models/order-updated-object.md deleted file mode 100644 index 5de0c4b6..00000000 --- a/doc/models/order-updated-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Updated Object - -## Structure - -`OrderUpdatedObject` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderUpdated` | [`?OrderUpdated`](../../doc/models/order-updated.md) | Optional | - | getOrderUpdated(): ?OrderUpdated | setOrderUpdated(?OrderUpdated orderUpdated): void | - -## Example (as JSON) - -```json -{ - "order_updated": { - "order_id": "order_id6", - "version": 176, - "location_id": "location_id4", - "state": "OPEN", - "created_at": "created_at2" - } -} -``` - diff --git a/doc/models/order-updated.md b/doc/models/order-updated.md deleted file mode 100644 index 590324b7..00000000 --- a/doc/models/order-updated.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Order Updated - -## Structure - -`OrderUpdated` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore cannot be updated.

[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) | getVersion(): ?int | setVersion(?int version): void | -| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `state` | [`?string(OrderState)`](../../doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "order_id": "order_id2", - "version": 162, - "location_id": "location_id2", - "state": "CANCELED", - "created_at": "created_at6" -} -``` - diff --git a/doc/models/order.md b/doc/models/order.md deleted file mode 100644 index f38d9861..00000000 --- a/doc/models/order.md +++ /dev/null @@ -1,88 +0,0 @@ - -# Order - -Contains all information related to a single order to process with Square, -including line items that specify the products to purchase. `Order` objects also -include information about any associated tenders, refunds, and returns. - -All Connect V2 Transactions have all been converted to Orders including all associated -itemization data. - -## Structure - -`Order` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The order's unique ID. | getId(): ?string | setId(?string id): void | -| `locationId` | `string` | Required | The ID of the seller location that this order is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `referenceId` | `?string` | Optional | A client-specified ID to associate an entity in another system
with this order.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `source` | [`?OrderSource`](../../doc/models/order-source.md) | Optional | Represents the origination details of an order. | getSource(): ?OrderSource | setSource(?OrderSource source): void | -| `customerId` | `?string` | Optional | The ID of the [customer](../../doc/models/customer.md) associated with the order.

You should specify a `customer_id` on the order (or the payment) to ensure that transactions
are reliably linked to customers. Omitting this field might result in the creation of new
[instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `lineItems` | [`?(OrderLineItem[])`](../../doc/models/order-line-item.md) | Optional | The line items included in the order. | getLineItems(): ?array | setLineItems(?array lineItems): void | -| `taxes` | [`?(OrderLineItemTax[])`](../../doc/models/order-line-item-tax.md) | Optional | The list of all taxes associated with the order.

Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an
`OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes
with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item.

On reads, each tax in the list includes the total amount of that tax applied to the order.

__IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated
`line_items.taxes` field results in an error. Use `line_items.applied_taxes`
instead. | getTaxes(): ?array | setTaxes(?array taxes): void | -| `discounts` | [`?(OrderLineItemDiscount[])`](../../doc/models/order-line-item-discount.md) | Optional | The list of all discounts associated with the order.

Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`,
an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to.
For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount`
for every line item.

__IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated
`line_items.discounts` field results in an error. Use `line_items.applied_discounts`
instead. | getDiscounts(): ?array | setDiscounts(?array discounts): void | -| `serviceCharges` | [`?(OrderServiceCharge[])`](../../doc/models/order-service-charge.md) | Optional | A list of service charges applied to the order. | getServiceCharges(): ?array | setServiceCharges(?array serviceCharges): void | -| `fulfillments` | [`?(Fulfillment[])`](../../doc/models/fulfillment.md) | Optional | Details about order fulfillment.

Orders can only be created with at most one fulfillment. However, orders returned
by the API might contain multiple fulfillments. | getFulfillments(): ?array | setFulfillments(?array fulfillments): void | -| `returns` | [`?(OrderReturn[])`](../../doc/models/order-return.md) | Optional | A collection of items from sale orders being returned in this one. Normally part of an
itemized return or exchange. There is exactly one `Return` object per sale `Order` being
referenced. | getReturns(): ?array | setReturns(?array returns): void | -| `returnAmounts` | [`?OrderMoneyAmounts`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getReturnAmounts(): ?OrderMoneyAmounts | setReturnAmounts(?OrderMoneyAmounts returnAmounts): void | -| `netAmounts` | [`?OrderMoneyAmounts`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getNetAmounts(): ?OrderMoneyAmounts | setNetAmounts(?OrderMoneyAmounts netAmounts): void | -| `roundingAdjustment` | [`?OrderRoundingAdjustment`](../../doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply cash rounding
when the minimum unit of the account is smaller than the lowest physical denomination of the currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | -| `tenders` | [`?(Tender[])`](../../doc/models/tender.md) | Optional | The tenders that were used to pay for the order. | getTenders(): ?array | setTenders(?array tenders): void | -| `refunds` | [`?(Refund[])`](../../doc/models/refund.md) | Optional | The refunds that are part of this order. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this order. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (such as personally
identifiable information or card details).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a maximum length of 255 characters.

An application can have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `createdAt` | `?string` | Optional | The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `closedAt` | `?string` | Optional | The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example "2016-09-04T23:59:33.123Z"). | getClosedAt(): ?string | setClosedAt(?string closedAt): void | -| `state` | [`?string(OrderState)`](../../doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders not created through the API do not include a version number and
therefore cannot be updated.

[Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders). | getVersion(): ?int | setVersion(?int version): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `totalTaxMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `totalDiscountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalDiscountMoney(): ?Money | setTotalDiscountMoney(?Money totalDiscountMoney): void | -| `totalTipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalTipMoney(): ?Money | setTotalTipMoney(?Money totalTipMoney): void | -| `totalServiceChargeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalServiceChargeMoney(): ?Money | setTotalServiceChargeMoney(?Money totalServiceChargeMoney): void | -| `ticketName` | `?string` | Optional | A short-term identifier for the order (such as a customer first name,
table number, or auto-generated order number that resets daily).
**Constraints**: *Maximum Length*: `30` | getTicketName(): ?string | setTicketName(?string ticketName): void | -| `pricingOptions` | [`?OrderPricingOptions`](../../doc/models/order-pricing-options.md) | Optional | Pricing options for an order. The options affect how the order's price is calculated.
They can be used, for example, to apply automatic price adjustments that are based on preconfigured
[pricing rules](../../doc/models/catalog-pricing-rule.md). | getPricingOptions(): ?OrderPricingOptions | setPricingOptions(?OrderPricingOptions pricingOptions): void | -| `rewards` | [`?(OrderReward[])`](../../doc/models/order-reward.md) | Optional | A set-like list of Rewards that have been added to the Order. | getRewards(): ?array | setRewards(?array rewards): void | -| `netAmountDueMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getNetAmountDueMoney(): ?Money | setNetAmountDueMoney(?Money netAmountDueMoney): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] -} -``` - diff --git a/doc/models/pagination-cursor.md b/doc/models/pagination-cursor.md deleted file mode 100644 index 2ae83ee3..00000000 --- a/doc/models/pagination-cursor.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Pagination Cursor - -Used *internally* to encapsulate pagination details. The resulting proto will be base62 encoded -in order to produce a cursor that can be used externally. - -## Structure - -`PaginationCursor` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderValue` | `?string` | Optional | The ID of the last resource in the current page. The page can be in an ascending or
descending order | getOrderValue(): ?string | setOrderValue(?string orderValue): void | - -## Example (as JSON) - -```json -{ - "order_value": "order_value4" -} -``` - diff --git a/doc/models/pause-subscription-request.md b/doc/models/pause-subscription-request.md deleted file mode 100644 index 4d4bbaaf..00000000 --- a/doc/models/pause-subscription-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Pause Subscription Request - -Defines input parameters in a request to the -[PauseSubscription](../../doc/apis/subscriptions.md#pause-subscription) endpoint. - -## Structure - -`PauseSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `pauseEffectiveDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription.

When this date is unspecified or falls within the current billing cycle, the subscription is paused
on the starting date of the next billing cycle. | getPauseEffectiveDate(): ?string | setPauseEffectiveDate(?string pauseEffectiveDate): void | -| `pauseCycleDuration` | `?int` | Optional | The number of billing cycles the subscription will be paused before it is reactivated.

When this is set, a `RESUME` action is also scheduled to take place on the subscription at
the end of the specified pause cycle duration. In this case, neither `resume_effective_date`
nor `resume_change_timing` may be specified. | getPauseCycleDuration(): ?int | setPauseCycleDuration(?int pauseCycleDuration): void | -| `resumeEffectiveDate` | `?string` | Optional | The date when the subscription is reactivated by a scheduled `RESUME` action.
This date must be at least one billing cycle ahead of `pause_effective_date`. | getResumeEffectiveDate(): ?string | setResumeEffectiveDate(?string resumeEffectiveDate): void | -| `resumeChangeTiming` | [`?string(ChangeTiming)`](../../doc/models/change-timing.md) | Optional | Supported timings when a pending change, as an action, takes place to a subscription. | getResumeChangeTiming(): ?string | setResumeChangeTiming(?string resumeChangeTiming): void | -| `pauseReason` | `?string` | Optional | The user-provided reason to pause the subscription.
**Constraints**: *Maximum Length*: `255` | getPauseReason(): ?string | setPauseReason(?string pauseReason): void | - -## Example (as JSON) - -```json -{ - "pause_effective_date": "pause_effective_date2", - "pause_cycle_duration": 98, - "resume_effective_date": "resume_effective_date0", - "resume_change_timing": "IMMEDIATE", - "pause_reason": "pause_reason6" -} -``` - diff --git a/doc/models/pause-subscription-response.md b/doc/models/pause-subscription-response.md deleted file mode 100644 index 35d3522f..00000000 --- a/doc/models/pause-subscription-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# Pause Subscription Response - -Defines output parameters in a response from the -[PauseSubscription](../../doc/apis/subscriptions.md#pause-subscription) endpoint. - -## Structure - -`PauseSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | The list of a `PAUSE` action and a possible `RESUME` action created by the request. | getActions(): ?array | setActions(?array actions): void | - -## Example (as JSON) - -```json -{ - "actions": [ - { - "effective_date": "2023-11-17", - "id": "99b2439e-63f7-3ad5-95f7-ab2447a80673", - "type": "PAUSE", - "monthly_billing_anchor_date": 186, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - } - ], - "subscription": { - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - "ordinal": 0, - "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", - "uid": "873451e0-745b-4e87-ab0b-c574933fe616" - } - ], - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2023-06-20", - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/pay-order-request.md b/doc/models/pay-order-request.md deleted file mode 100644 index cf42d485..00000000 --- a/doc/models/pay-order-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Pay Order Request - -Defines the fields that are included in requests to the -[PayOrder](../../doc/apis/orders.md#pay-order) endpoint. - -## Structure - -`PayOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this request among requests you have sent. If
you are unsure whether a particular payment request was completed successfully, you can reattempt
it with the same idempotency key without worrying about duplicate payments.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `orderVersion` | `?int` | Optional | The version of the order being paid. If not supplied, the latest version will be paid. | getOrderVersion(): ?int | setOrderVersion(?int orderVersion): void | -| `paymentIds` | `?(string[])` | Optional | The IDs of the [payments](entity:Payment) to collect.
The payment total must match the order total. | getPaymentIds(): ?array | setPaymentIds(?array paymentIds): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "c043a359-7ad9-4136-82a9-c3f1d66dcbff", - "payment_ids": [ - "EnZdNAlWCmfh6Mt5FMNST1o7taB", - "0LRiVlbXVwe8ozu4KbZxd12mvaB" - ], - "order_version": 102 -} -``` - diff --git a/doc/models/pay-order-response.md b/doc/models/pay-order-response.md deleted file mode 100644 index 72418c6f..00000000 --- a/doc/models/pay-order-response.md +++ /dev/null @@ -1,226 +0,0 @@ - -# Pay Order Response - -Defines the fields that are included in the response body of a request to the -[PayOrder](../../doc/apis/orders.md#pay-order) endpoint. - -## Structure - -`PayOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | - -## Example (as JSON) - -```json -{ - "order": { - "closed_at": "2019-08-06T02:47:37.140Z", - "created_at": "2019-08-06T02:47:35.693Z", - "id": "lgwOlEityYPJtcuvKTVKT1pA986YY", - "line_items": [ - { - "base_price_money": { - "amount": 500, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 500, - "currency": "USD" - }, - "name": "Item 1", - "quantity": "1", - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 500, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "QW6kofLHJK7JEKMjlSVP5C", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 750, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 1500, - "currency": "USD" - }, - "name": "Item 2", - "quantity": "2", - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 1500, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "zhw8MNfRGdFQMI2WE1UBJD", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "P3CCK6HSNDAS7", - "net_amounts": { - "discount_money": { - "amount": 0, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 0, - "currency": "USD" - }, - "tip_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 2000, - "currency": "USD" - } - }, - "source": { - "name": "Source Name" - }, - "state": "COMPLETED", - "tenders": [ - { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "card_details": { - "card": { - "card_brand": "VISA", - "exp_month": 2, - "exp_year": 2022, - "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", - "last_4": "1111" - }, - "entry_method": "KEYED", - "status": "CAPTURED" - }, - "created_at": "2019-08-06T02:47:36.293Z", - "id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", - "location_id": "P3CCK6HSNDAS7", - "payment_id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", - "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", - "type": "CARD" - }, - { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "card_details": { - "card": { - "card_brand": "VISA", - "exp_month": 2, - "exp_year": 2022, - "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", - "last_4": "1111" - }, - "entry_method": "KEYED", - "status": "CAPTURED" - }, - "created_at": "2019-08-06T02:47:36.809Z", - "id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", - "location_id": "P3CCK6HSNDAS7", - "payment_id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", - "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", - "type": "CARD" - } - ], - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 2000, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2019-08-06T02:47:37.140Z", - "version": 4, - "reference_id": "reference_id4", - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/payment-balance-activity-app-fee-refund-detail.md b/doc/models/payment-balance-activity-app-fee-refund-detail.md deleted file mode 100644 index f55d899f..00000000 --- a/doc/models/payment-balance-activity-app-fee-refund-detail.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Payment Balance Activity App Fee Refund Detail - -## Structure - -`PaymentBalanceActivityAppFeeRefundDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `refundId` | `?string` | Optional | The ID of the refund associated with this activity. | getRefundId(): ?string | setRefundId(?string refundId): void | -| `locationId` | `?string` | Optional | The ID of the location of the merchant associated with the payment refund activity | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4", - "refund_id": "refund_id8", - "location_id": "location_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-app-fee-revenue-detail.md b/doc/models/payment-balance-activity-app-fee-revenue-detail.md deleted file mode 100644 index 9688954a..00000000 --- a/doc/models/payment-balance-activity-app-fee-revenue-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity App Fee Revenue Detail - -## Structure - -`PaymentBalanceActivityAppFeeRevenueDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `locationId` | `?string` | Optional | The ID of the location of the merchant associated with the payment activity | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0", - "location_id": "location_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-automatic-savings-detail.md b/doc/models/payment-balance-activity-automatic-savings-detail.md deleted file mode 100644 index e60a9396..00000000 --- a/doc/models/payment-balance-activity-automatic-savings-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Automatic Savings Detail - -## Structure - -`PaymentBalanceActivityAutomaticSavingsDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `payoutId` | `?string` | Optional | The ID of the payout associated with this activity. | getPayoutId(): ?string | setPayoutId(?string payoutId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4", - "payout_id": "payout_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md b/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md deleted file mode 100644 index b102da23..00000000 --- a/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Automatic Savings Reversed Detail - -## Structure - -`PaymentBalanceActivityAutomaticSavingsReversedDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `payoutId` | `?string` | Optional | The ID of the payout associated with this activity. | getPayoutId(): ?string | setPayoutId(?string payoutId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "payout_id": "payout_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-charge-detail.md b/doc/models/payment-balance-activity-charge-detail.md deleted file mode 100644 index 5243ab7c..00000000 --- a/doc/models/payment-balance-activity-charge-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Charge Detail - -## Structure - -`PaymentBalanceActivityChargeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-deposit-fee-detail.md b/doc/models/payment-balance-activity-deposit-fee-detail.md deleted file mode 100644 index 4b123844..00000000 --- a/doc/models/payment-balance-activity-deposit-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Deposit Fee Detail - -## Structure - -`PaymentBalanceActivityDepositFeeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payoutId` | `?string` | Optional | The ID of the payout that triggered this deposit fee activity. | getPayoutId(): ?string | setPayoutId(?string payoutId): void | - -## Example (as JSON) - -```json -{ - "payout_id": "payout_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md b/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md deleted file mode 100644 index 928237b0..00000000 --- a/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Deposit Fee Reversed Detail - -## Structure - -`PaymentBalanceActivityDepositFeeReversedDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payoutId` | `?string` | Optional | The ID of the payout that triggered this deposit fee activity. | getPayoutId(): ?string | setPayoutId(?string payoutId): void | - -## Example (as JSON) - -```json -{ - "payout_id": "payout_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-dispute-detail.md b/doc/models/payment-balance-activity-dispute-detail.md deleted file mode 100644 index 43851703..00000000 --- a/doc/models/payment-balance-activity-dispute-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Dispute Detail - -## Structure - -`PaymentBalanceActivityDisputeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `disputeId` | `?string` | Optional | The ID of the dispute associated with this activity. | getDisputeId(): ?string | setDisputeId(?string disputeId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2", - "dispute_id": "dispute_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-fee-detail.md b/doc/models/payment-balance-activity-fee-detail.md deleted file mode 100644 index f8f01f34..00000000 --- a/doc/models/payment-balance-activity-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Fee Detail - -## Structure - -`PaymentBalanceActivityFeeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity
This will only be populated when a principal LedgerEntryToken is also populated.
If the fee is independent (there is no principal LedgerEntryToken) then this will likely not
be populated. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-free-processing-detail.md b/doc/models/payment-balance-activity-free-processing-detail.md deleted file mode 100644 index 9fb7d830..00000000 --- a/doc/models/payment-balance-activity-free-processing-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Free Processing Detail - -## Structure - -`PaymentBalanceActivityFreeProcessingDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-hold-adjustment-detail.md b/doc/models/payment-balance-activity-hold-adjustment-detail.md deleted file mode 100644 index 6099d08d..00000000 --- a/doc/models/payment-balance-activity-hold-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Hold Adjustment Detail - -## Structure - -`PaymentBalanceActivityHoldAdjustmentDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-open-dispute-detail.md b/doc/models/payment-balance-activity-open-dispute-detail.md deleted file mode 100644 index 5adf39a1..00000000 --- a/doc/models/payment-balance-activity-open-dispute-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Open Dispute Detail - -## Structure - -`PaymentBalanceActivityOpenDisputeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `disputeId` | `?string` | Optional | The ID of the dispute associated with this activity. | getDisputeId(): ?string | setDisputeId(?string disputeId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "dispute_id": "dispute_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-other-adjustment-detail.md b/doc/models/payment-balance-activity-other-adjustment-detail.md deleted file mode 100644 index 80fe5f6c..00000000 --- a/doc/models/payment-balance-activity-other-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Other Adjustment Detail - -## Structure - -`PaymentBalanceActivityOtherAdjustmentDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-other-detail.md b/doc/models/payment-balance-activity-other-detail.md deleted file mode 100644 index 1d86d416..00000000 --- a/doc/models/payment-balance-activity-other-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Other Detail - -## Structure - -`PaymentBalanceActivityOtherDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-refund-detail.md b/doc/models/payment-balance-activity-refund-detail.md deleted file mode 100644 index b4716d5f..00000000 --- a/doc/models/payment-balance-activity-refund-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Refund Detail - -## Structure - -`PaymentBalanceActivityRefundDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `refundId` | `?string` | Optional | The ID of the refund associated with this activity. | getRefundId(): ?string | setRefundId(?string refundId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "refund_id": "refund_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-release-adjustment-detail.md b/doc/models/payment-balance-activity-release-adjustment-detail.md deleted file mode 100644 index 7c8d31d2..00000000 --- a/doc/models/payment-balance-activity-release-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Release Adjustment Detail - -## Structure - -`PaymentBalanceActivityReleaseAdjustmentDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-reserve-hold-detail.md b/doc/models/payment-balance-activity-reserve-hold-detail.md deleted file mode 100644 index bd119266..00000000 --- a/doc/models/payment-balance-activity-reserve-hold-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Reserve Hold Detail - -## Structure - -`PaymentBalanceActivityReserveHoldDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-reserve-release-detail.md b/doc/models/payment-balance-activity-reserve-release-detail.md deleted file mode 100644 index 01d9b961..00000000 --- a/doc/models/payment-balance-activity-reserve-release-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Reserve Release Detail - -## Structure - -`PaymentBalanceActivityReserveReleaseDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-square-capital-payment-detail.md b/doc/models/payment-balance-activity-square-capital-payment-detail.md deleted file mode 100644 index 5d3e069b..00000000 --- a/doc/models/payment-balance-activity-square-capital-payment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Capital Payment Detail - -## Structure - -`PaymentBalanceActivitySquareCapitalPaymentDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md b/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md deleted file mode 100644 index 1e40f55b..00000000 --- a/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Capital Reversed Payment Detail - -## Structure - -`PaymentBalanceActivitySquareCapitalReversedPaymentDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-square-payroll-transfer-detail.md b/doc/models/payment-balance-activity-square-payroll-transfer-detail.md deleted file mode 100644 index c4d55c6f..00000000 --- a/doc/models/payment-balance-activity-square-payroll-transfer-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Payroll Transfer Detail - -## Structure - -`PaymentBalanceActivitySquarePayrollTransferDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md b/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md deleted file mode 100644 index 52f46119..00000000 --- a/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Payroll Transfer Reversed Detail - -## Structure - -`PaymentBalanceActivitySquarePayrollTransferReversedDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-tax-on-fee-detail.md b/doc/models/payment-balance-activity-tax-on-fee-detail.md deleted file mode 100644 index 5c2e2d6e..00000000 --- a/doc/models/payment-balance-activity-tax-on-fee-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Tax on Fee Detail - -## Structure - -`PaymentBalanceActivityTaxOnFeeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `taxRateDescription` | `?string` | Optional | The description of the tax rate being applied. For example: "GST", "HST". | getTaxRateDescription(): ?string | setTaxRateDescription(?string taxRateDescription): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0", - "tax_rate_description": "tax_rate_description8" -} -``` - diff --git a/doc/models/payment-balance-activity-third-party-fee-detail.md b/doc/models/payment-balance-activity-third-party-fee-detail.md deleted file mode 100644 index e737f813..00000000 --- a/doc/models/payment-balance-activity-third-party-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Third Party Fee Detail - -## Structure - -`PaymentBalanceActivityThirdPartyFeeDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-third-party-fee-refund-detail.md b/doc/models/payment-balance-activity-third-party-fee-refund-detail.md deleted file mode 100644 index 776313fc..00000000 --- a/doc/models/payment-balance-activity-third-party-fee-refund-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Third Party Fee Refund Detail - -## Structure - -`PaymentBalanceActivityThirdPartyFeeRefundDetail` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this activity. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `refundId` | `?string` | Optional | The public refund id associated with this activity. | getRefundId(): ?string | setRefundId(?string refundId): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "refund_id": "refund_id0" -} -``` - diff --git a/doc/models/payment-link-related-resources.md b/doc/models/payment-link-related-resources.md deleted file mode 100644 index 92be9a97..00000000 --- a/doc/models/payment-link-related-resources.md +++ /dev/null @@ -1,223 +0,0 @@ - -# Payment Link Related Resources - -## Structure - -`PaymentLinkRelatedResources` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orders` | [`?(Order[])`](../../doc/models/order.md) | Optional | The order associated with the payment link. | getOrders(): ?array | setOrders(?array orders): void | -| `subscriptionPlans` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The subscription plan associated with the payment link. | getSubscriptionPlans(): ?array | setSubscriptionPlans(?array subscriptionPlans): void | - -## Example (as JSON) - -```json -{ - "orders": [ - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - }, - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - } - ], - "subscription_plans": [ - { - "type": "ITEM_OPTION", - "id": "id4", - "updated_at": "updated_at0", - "version": 112, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "type": "ITEM_OPTION", - "id": "id4", - "updated_at": "updated_at0", - "version": 112, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ] -} -``` - diff --git a/doc/models/payment-link.md b/doc/models/payment-link.md deleted file mode 100644 index f831c68c..00000000 --- a/doc/models/payment-link.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Payment Link - -## Structure - -`PaymentLink` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the payment link. | getId(): ?string | setId(?string id): void | -| `version` | `int` | Required | The Square-assigned version number, which is incremented each time an update is committed to the payment link.
**Constraints**: `<= 65535` | getVersion(): int | setVersion(int version): void | -| `description` | `?string` | Optional | The optional description of the `payment_link` object.
It is primarily for use by your application and is not used anywhere.
**Constraints**: *Maximum Length*: `4096` | getDescription(): ?string | setDescription(?string description): void | -| `orderId` | `?string` | Optional | The ID of the order associated with the payment link.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | -| `checkoutOptions` | [`?CheckoutOptions`](../../doc/models/checkout-options.md) | Optional | - | getCheckoutOptions(): ?CheckoutOptions | setCheckoutOptions(?CheckoutOptions checkoutOptions): void | -| `prePopulatedData` | [`?PrePopulatedData`](../../doc/models/pre-populated-data.md) | Optional | Describes buyer data to prepopulate in the payment form.
For more information,
see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). | getPrePopulatedData(): ?PrePopulatedData | setPrePopulatedData(?PrePopulatedData prePopulatedData): void | -| `url` | `?string` | Optional | The shortened URL of the payment link.
**Constraints**: *Maximum Length*: `255` | getUrl(): ?string | setUrl(?string url): void | -| `longUrl` | `?string` | Optional | The long URL of the payment link.
**Constraints**: *Maximum Length*: `255` | getLongUrl(): ?string | setLongUrl(?string longUrl): void | -| `createdAt` | `?string` | Optional | The timestamp when the payment link was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the payment link was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `paymentNote` | `?string` | Optional | An optional note. After Square processes the payment, this note is added to the
resulting `Payment`.
**Constraints**: *Maximum Length*: `500` | getPaymentNote(): ?string | setPaymentNote(?string paymentNote): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "version": 64, - "description": "description8", - "order_id": "order_id4", - "checkout_options": { - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } -} -``` - diff --git a/doc/models/payment-options-delay-action.md b/doc/models/payment-options-delay-action.md deleted file mode 100644 index 447fa0c1..00000000 --- a/doc/models/payment-options-delay-action.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Payment Options Delay Action - -Describes the action to be applied to a delayed capture payment when the delay_duration -has elapsed. - -## Enumeration - -`PaymentOptionsDelayAction` - -## Fields - -| Name | Description | -| --- | --- | -| `CANCEL` | Indicates that the payment should be automatically canceled when the delay duration
elapses. | -| `COMPLETE` | Indicates that the payment should be automatically completed when the delay duration
elapses. | - diff --git a/doc/models/payment-options.md b/doc/models/payment-options.md deleted file mode 100644 index 3822a7da..00000000 --- a/doc/models/payment-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Payment Options - -## Structure - -`PaymentOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `autocomplete` | `?bool` | Optional | Indicates whether the `Payment` objects created from this `TerminalCheckout` are automatically
`COMPLETED` or left in an `APPROVED` state for later modification. | getAutocomplete(): ?bool | setAutocomplete(?bool autocomplete): void | -| `delayDuration` | `?string` | Optional | The duration of time after the payment's creation when Square automatically cancels the
payment. This automatic cancellation applies only to payments that do not reach a terminal state
(COMPLETED or CANCELED) before the `delay_duration` time period.

This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value
of 1 minute.

Note: This feature is only supported for card payments. This parameter can only be set for a delayed
capture payment (`autocomplete=false`).
Default:

- Card-present payments: "PT36H" (36 hours) from the creation time.
- Card-not-present payments: "P7D" (7 days) from the creation time. | getDelayDuration(): ?string | setDelayDuration(?string delayDuration): void | -| `acceptPartialAuthorization` | `?bool` | Optional | If set to `true` and charging a Square Gift Card, a payment might be returned with
`amount_money` equal to less than what was requested. For example, a request for $20 when charging
a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose
to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card
payment.

This field cannot be `true` when `autocomplete = true`.
This field cannot be `true` when an `order_id` isn't specified.

For more information, see
[Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/partial-payments-with-gift-cards).

Default: false | getAcceptPartialAuthorization(): ?bool | setAcceptPartialAuthorization(?bool acceptPartialAuthorization): void | -| `delayAction` | [`?string(PaymentOptionsDelayAction)`](../../doc/models/payment-options-delay-action.md) | Optional | Describes the action to be applied to a delayed capture payment when the delay_duration
has elapsed. | getDelayAction(): ?string | setDelayAction(?string delayAction): void | - -## Example (as JSON) - -```json -{ - "autocomplete": false, - "delay_duration": "delay_duration8", - "accept_partial_authorization": false, - "delay_action": "CANCEL" -} -``` - diff --git a/doc/models/payment-refund.md b/doc/models/payment-refund.md deleted file mode 100644 index 62757910..00000000 --- a/doc/models/payment-refund.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Payment Refund - -Represents a refund of a payment made using Square. Contains information about -the original payment and the amount of money refunded. - -## Structure - -`PaymentRefund` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The unique ID for this refund, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getId(): string | setId(string id): void | -| `status` | `?string` | Optional | The refund's status:

- `PENDING` - Awaiting approval.
- `COMPLETED` - Successfully completed.
- `REJECTED` - The refund was rejected.
- `FAILED` - An error occurred.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | -| `locationId` | `?string` | Optional | The location ID associated with the payment this refund is attached to.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `unlinked` | `?bool` | Optional | Flag indicating whether or not the refund is linked to an existing payment in Square. | getUnlinked(): ?bool | setUnlinked(?bool unlinked): void | -| `destinationType` | `?string` | Optional | The destination type for this refund.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,
`EXTERNAL`, and `SQUARE_ACCOUNT`.
**Constraints**: *Maximum Length*: `50` | getDestinationType(): ?string | setDestinationType(?string destinationType): void | -| `destinationDetails` | [`?DestinationDetails`](../../doc/models/destination-details.md) | Optional | Details about a refund's destination. | getDestinationDetails(): ?DestinationDetails | setDestinationDetails(?DestinationDetails destinationDetails): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `processingFee` | [`?(ProcessingFee[])`](../../doc/models/processing-fee.md) | Optional | Processing fees and fee adjustments assessed by Square for this refund. | getProcessingFee(): ?array | setProcessingFee(?array processingFee): void | -| `paymentId` | `?string` | Optional | The ID of the payment associated with this refund.
**Constraints**: *Maximum Length*: `192` | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `orderId` | `?string` | Optional | The ID of the order associated with the refund.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | -| `reason` | `?string` | Optional | The reason for the refund.
**Constraints**: *Maximum Length*: `192` | getReason(): ?string | setReason(?string reason): void | -| `createdAt` | `?string` | Optional | The timestamp of when the refund was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the refund was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `teamMemberId` | `?string` | Optional | An optional ID of the team member associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `terminalRefundId` | `?string` | Optional | An optional ID for a Terminal refund. | getTerminalRefundId(): ?string | setTerminalRefundId(?string terminalRefundId): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "status": "status6", - "location_id": "location_id8", - "unlinked": false, - "destination_type": "destination_type8", - "destination_details": { - "card_details": { - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "auth_result_code": "auth_result_code0" - }, - "cash_details": { - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } - }, - "external_details": { - "type": "type6", - "source": "source0", - "source_id": "source_id8" - } - }, - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/payment-sort-field.md b/doc/models/payment-sort-field.md deleted file mode 100644 index 4fe5d19e..00000000 --- a/doc/models/payment-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Payment Sort Field - -## Enumeration - -`PaymentSortField` - -## Fields - -| Name | -| --- | -| `CREATED_AT` | -| `OFFLINE_CREATED_AT` | -| `UPDATED_AT` | - diff --git a/doc/models/payment.md b/doc/models/payment.md deleted file mode 100644 index 1f6d9905..00000000 --- a/doc/models/payment.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Payment - -Represents a payment processed by the Square API. - -## Structure - -`Payment` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID for the payment.
**Constraints**: *Maximum Length*: `192` | getId(): ?string | setId(?string id): void | -| `createdAt` | `?string` | Optional | The timestamp of when the payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the payment was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `tipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | -| `totalMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `approvedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getApprovedMoney(): ?Money | setApprovedMoney(?Money approvedMoney): void | -| `processingFee` | [`?(ProcessingFee[])`](../../doc/models/processing-fee.md) | Optional | The processing fees and fee adjustments assessed by Square for this payment. | getProcessingFee(): ?array | setProcessingFee(?array processingFee): void | -| `refundedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getRefundedMoney(): ?Money | setRefundedMoney(?Money refundedMoney): void | -| `status` | `?string` | Optional | Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | -| `delayDuration` | `?string` | Optional | The duration of time after the payment's creation when Square automatically applies the
`delay_action` to the payment. This automatic `delay_action` applies only to payments that
do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration`
time period.

This field is specified as a time duration, in RFC 3339 format.

Notes:
This feature is only supported for card payments.

Default:

- Card-present payments: "PT36H" (36 hours) from the creation time.
- Card-not-present payments: "P7D" (7 days) from the creation time. | getDelayDuration(): ?string | setDelayDuration(?string delayDuration): void | -| `delayAction` | `?string` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed.

Current values include `CANCEL` and `COMPLETE`. | getDelayAction(): ?string | setDelayAction(?string delayAction): void | -| `delayedUntil` | `?string` | Optional | The read-only timestamp of when the `delay_action` is automatically applied,
in RFC 3339 format.

Note that this field is calculated by summing the payment's `delay_duration` and `created_at`
fields. The `created_at` field is generated by Square and might not exactly match the
time on your local machine. | getDelayedUntil(): ?string | setDelayedUntil(?string delayedUntil): void | -| `sourceType` | `?string` | Optional | The source type for this payment.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`,
`CASH` and `EXTERNAL`. For information about these payment source types,
see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).
**Constraints**: *Maximum Length*: `50` | getSourceType(): ?string | setSourceType(?string sourceType): void | -| `cardDetails` | [`?CardPaymentDetails`](../../doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. Contains only non-confidential information. | getCardDetails(): ?CardPaymentDetails | setCardDetails(?CardPaymentDetails cardDetails): void | -| `cashDetails` | [`?CashPaymentDetails`](../../doc/models/cash-payment-details.md) | Optional | Stores details about a cash payment. Contains only non-confidential information. For more information, see
[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). | getCashDetails(): ?CashPaymentDetails | setCashDetails(?CashPaymentDetails cashDetails): void | -| `bankAccountDetails` | [`?BankAccountPaymentDetails`](../../doc/models/bank-account-payment-details.md) | Optional | Additional details about BANK_ACCOUNT type payments. | getBankAccountDetails(): ?BankAccountPaymentDetails | setBankAccountDetails(?BankAccountPaymentDetails bankAccountDetails): void | -| `externalDetails` | [`?ExternalPaymentDetails`](../../doc/models/external-payment-details.md) | Optional | Stores details about an external payment. Contains only non-confidential information.
For more information, see
[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). | getExternalDetails(): ?ExternalPaymentDetails | setExternalDetails(?ExternalPaymentDetails externalDetails): void | -| `walletDetails` | [`?DigitalWalletDetails`](../../doc/models/digital-wallet-details.md) | Optional | Additional details about `WALLET` type payments. Contains only non-confidential information. | getWalletDetails(): ?DigitalWalletDetails | setWalletDetails(?DigitalWalletDetails walletDetails): void | -| `buyNowPayLaterDetails` | [`?BuyNowPayLaterDetails`](../../doc/models/buy-now-pay-later-details.md) | Optional | Additional details about a Buy Now Pay Later payment type. | getBuyNowPayLaterDetails(): ?BuyNowPayLaterDetails | setBuyNowPayLaterDetails(?BuyNowPayLaterDetails buyNowPayLaterDetails): void | -| `squareAccountDetails` | [`?SquareAccountDetails`](../../doc/models/square-account-details.md) | Optional | Additional details about Square Account payments. | getSquareAccountDetails(): ?SquareAccountDetails | setSquareAccountDetails(?SquareAccountDetails squareAccountDetails): void | -| `locationId` | `?string` | Optional | The ID of the location associated with the payment.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `orderId` | `?string` | Optional | The ID of the order associated with the payment.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | -| `referenceId` | `?string` | Optional | An optional ID that associates the payment with an entity in
another system.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `customerId` | `?string` | Optional | The ID of the customer associated with the payment. If the ID is
not provided in the `CreatePayment` request that was used to create the `Payment`,
Square may use information in the request
(such as the billing and shipping address, email address, and payment source)
to identify a matching customer profile in the Customer Directory.
If found, the profile ID is used. If a profile is not found, the
API attempts to create an
[instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).
If the API cannot create an
instant profile (either because the seller has disabled it or the
seller's region prevents creating it), this field remains unset. Note that
this process is asynchronous and it may take some time before a
customer ID is added to the payment.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `employeeId` | `?string` | Optional | __Deprecated__: Use `Payment.team_member_id` instead.

An optional ID of the employee associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `teamMemberId` | `?string` | Optional | An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `refundIds` | `?(string[])` | Optional | A list of `refund_id`s identifying refunds for the payment. | getRefundIds(): ?array | setRefundIds(?array refundIds): void | -| `riskEvaluation` | [`?RiskEvaluation`](../../doc/models/risk-evaluation.md) | Optional | Represents fraud risk information for the associated payment.

When you take a payment through Square's Payments API (using the `CreatePayment`
endpoint), Square evaluates it and assigns a risk level to the payment. Sellers
can use this information to determine the course of action (for example,
provide the goods/services or refund the payment). | getRiskEvaluation(): ?RiskEvaluation | setRiskEvaluation(?RiskEvaluation riskEvaluation): void | -| `terminalCheckoutId` | `?string` | Optional | An optional ID for a Terminal checkout that is associated with the payment. | getTerminalCheckoutId(): ?string | setTerminalCheckoutId(?string terminalCheckoutId): void | -| `buyerEmailAddress` | `?string` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | getBuyerEmailAddress(): ?string | setBuyerEmailAddress(?string buyerEmailAddress): void | -| `billingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | -| `shippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | -| `note` | `?string` | Optional | An optional note to include when creating a payment.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `statementDescriptionIdentifier` | `?string` | Optional | Additional payment information that gets added to the customer's card statement
as part of the statement description.

Note that the `statement_description_identifier` might get truncated on the statement description
to fit the required information including the Square identifier (SQ *) and the name of the
seller taking the payment. | getStatementDescriptionIdentifier(): ?string | setStatementDescriptionIdentifier(?string statementDescriptionIdentifier): void | -| `capabilities` | `?(string[])` | Optional | Actions that can be performed on this payment:

- `EDIT_AMOUNT_UP` - The payment amount can be edited up.
- `EDIT_AMOUNT_DOWN` - The payment amount can be edited down.
- `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up.
- `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down.
- `EDIT_DELAY_ACTION` - The delay_action can be edited. | getCapabilities(): ?array | setCapabilities(?array capabilities): void | -| `receiptNumber` | `?string` | Optional | The payment's receipt number.
The field is missing if a payment is canceled.
**Constraints**: *Maximum Length*: `4` | getReceiptNumber(): ?string | setReceiptNumber(?string receiptNumber): void | -| `receiptUrl` | `?string` | Optional | The URL for the payment's receipt.
The field is only populated for COMPLETED payments.
**Constraints**: *Maximum Length*: `255` | getReceiptUrl(): ?string | setReceiptUrl(?string receiptUrl): void | -| `deviceDetails` | [`?DeviceDetails`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | getDeviceDetails(): ?DeviceDetails | setDeviceDetails(?DeviceDetails deviceDetails): void | -| `applicationDetails` | [`?ApplicationDetails`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | getApplicationDetails(): ?ApplicationDetails | setApplicationDetails(?ApplicationDetails applicationDetails): void | -| `isOfflinePayment` | `?bool` | Optional | Whether or not this payment was taken offline. | getIsOfflinePayment(): ?bool | setIsOfflinePayment(?bool isOfflinePayment): void | -| `offlinePaymentDetails` | [`?OfflinePaymentDetails`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | getOfflinePaymentDetails(): ?OfflinePaymentDetails | setOfflinePaymentDetails(?OfflinePaymentDetails offlinePaymentDetails): void | -| `versionToken` | `?string` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | getVersionToken(): ?string | setVersionToken(?string versionToken): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "tip_money": { - "amount": 190, - "currency": "TWD" - } -} -``` - diff --git a/doc/models/payout-entry.md b/doc/models/payout-entry.md deleted file mode 100644 index 807bafc7..00000000 --- a/doc/models/payout-entry.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Payout Entry - -One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity. -The total amount of the payout will equal the sum of the payout entries for a batch payout - -## Structure - -`PayoutEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | A unique ID for the payout entry.
**Constraints**: *Minimum Length*: `1` | getId(): string | setId(string id): void | -| `payoutId` | `string` | Required | The ID of the payout entries’ associated payout.
**Constraints**: *Minimum Length*: `1` | getPayoutId(): string | setPayoutId(string payoutId): void | -| `effectiveAt` | `?string` | Optional | The timestamp of when the payout entry affected the balance, in RFC 3339 format. | getEffectiveAt(): ?string | setEffectiveAt(?string effectiveAt): void | -| `type` | [`?string(ActivityType)`](../../doc/models/activity-type.md) | Optional | - | getType(): ?string | setType(?string type): void | -| `grossAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getGrossAmountMoney(): ?Money | setGrossAmountMoney(?Money grossAmountMoney): void | -| `feeAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getFeeAmountMoney(): ?Money | setFeeAmountMoney(?Money feeAmountMoney): void | -| `netAmountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getNetAmountMoney(): ?Money | setNetAmountMoney(?Money netAmountMoney): void | -| `typeAppFeeRevenueDetails` | [`?PaymentBalanceActivityAppFeeRevenueDetail`](../../doc/models/payment-balance-activity-app-fee-revenue-detail.md) | Optional | - | getTypeAppFeeRevenueDetails(): ?PaymentBalanceActivityAppFeeRevenueDetail | setTypeAppFeeRevenueDetails(?PaymentBalanceActivityAppFeeRevenueDetail typeAppFeeRevenueDetails): void | -| `typeAppFeeRefundDetails` | [`?PaymentBalanceActivityAppFeeRefundDetail`](../../doc/models/payment-balance-activity-app-fee-refund-detail.md) | Optional | - | getTypeAppFeeRefundDetails(): ?PaymentBalanceActivityAppFeeRefundDetail | setTypeAppFeeRefundDetails(?PaymentBalanceActivityAppFeeRefundDetail typeAppFeeRefundDetails): void | -| `typeAutomaticSavingsDetails` | [`?PaymentBalanceActivityAutomaticSavingsDetail`](../../doc/models/payment-balance-activity-automatic-savings-detail.md) | Optional | - | getTypeAutomaticSavingsDetails(): ?PaymentBalanceActivityAutomaticSavingsDetail | setTypeAutomaticSavingsDetails(?PaymentBalanceActivityAutomaticSavingsDetail typeAutomaticSavingsDetails): void | -| `typeAutomaticSavingsReversedDetails` | [`?PaymentBalanceActivityAutomaticSavingsReversedDetail`](../../doc/models/payment-balance-activity-automatic-savings-reversed-detail.md) | Optional | - | getTypeAutomaticSavingsReversedDetails(): ?PaymentBalanceActivityAutomaticSavingsReversedDetail | setTypeAutomaticSavingsReversedDetails(?PaymentBalanceActivityAutomaticSavingsReversedDetail typeAutomaticSavingsReversedDetails): void | -| `typeChargeDetails` | [`?PaymentBalanceActivityChargeDetail`](../../doc/models/payment-balance-activity-charge-detail.md) | Optional | - | getTypeChargeDetails(): ?PaymentBalanceActivityChargeDetail | setTypeChargeDetails(?PaymentBalanceActivityChargeDetail typeChargeDetails): void | -| `typeDepositFeeDetails` | [`?PaymentBalanceActivityDepositFeeDetail`](../../doc/models/payment-balance-activity-deposit-fee-detail.md) | Optional | - | getTypeDepositFeeDetails(): ?PaymentBalanceActivityDepositFeeDetail | setTypeDepositFeeDetails(?PaymentBalanceActivityDepositFeeDetail typeDepositFeeDetails): void | -| `typeDepositFeeReversedDetails` | [`?PaymentBalanceActivityDepositFeeReversedDetail`](../../doc/models/payment-balance-activity-deposit-fee-reversed-detail.md) | Optional | - | getTypeDepositFeeReversedDetails(): ?PaymentBalanceActivityDepositFeeReversedDetail | setTypeDepositFeeReversedDetails(?PaymentBalanceActivityDepositFeeReversedDetail typeDepositFeeReversedDetails): void | -| `typeDisputeDetails` | [`?PaymentBalanceActivityDisputeDetail`](../../doc/models/payment-balance-activity-dispute-detail.md) | Optional | - | getTypeDisputeDetails(): ?PaymentBalanceActivityDisputeDetail | setTypeDisputeDetails(?PaymentBalanceActivityDisputeDetail typeDisputeDetails): void | -| `typeFeeDetails` | [`?PaymentBalanceActivityFeeDetail`](../../doc/models/payment-balance-activity-fee-detail.md) | Optional | - | getTypeFeeDetails(): ?PaymentBalanceActivityFeeDetail | setTypeFeeDetails(?PaymentBalanceActivityFeeDetail typeFeeDetails): void | -| `typeFreeProcessingDetails` | [`?PaymentBalanceActivityFreeProcessingDetail`](../../doc/models/payment-balance-activity-free-processing-detail.md) | Optional | - | getTypeFreeProcessingDetails(): ?PaymentBalanceActivityFreeProcessingDetail | setTypeFreeProcessingDetails(?PaymentBalanceActivityFreeProcessingDetail typeFreeProcessingDetails): void | -| `typeHoldAdjustmentDetails` | [`?PaymentBalanceActivityHoldAdjustmentDetail`](../../doc/models/payment-balance-activity-hold-adjustment-detail.md) | Optional | - | getTypeHoldAdjustmentDetails(): ?PaymentBalanceActivityHoldAdjustmentDetail | setTypeHoldAdjustmentDetails(?PaymentBalanceActivityHoldAdjustmentDetail typeHoldAdjustmentDetails): void | -| `typeOpenDisputeDetails` | [`?PaymentBalanceActivityOpenDisputeDetail`](../../doc/models/payment-balance-activity-open-dispute-detail.md) | Optional | - | getTypeOpenDisputeDetails(): ?PaymentBalanceActivityOpenDisputeDetail | setTypeOpenDisputeDetails(?PaymentBalanceActivityOpenDisputeDetail typeOpenDisputeDetails): void | -| `typeOtherDetails` | [`?PaymentBalanceActivityOtherDetail`](../../doc/models/payment-balance-activity-other-detail.md) | Optional | - | getTypeOtherDetails(): ?PaymentBalanceActivityOtherDetail | setTypeOtherDetails(?PaymentBalanceActivityOtherDetail typeOtherDetails): void | -| `typeOtherAdjustmentDetails` | [`?PaymentBalanceActivityOtherAdjustmentDetail`](../../doc/models/payment-balance-activity-other-adjustment-detail.md) | Optional | - | getTypeOtherAdjustmentDetails(): ?PaymentBalanceActivityOtherAdjustmentDetail | setTypeOtherAdjustmentDetails(?PaymentBalanceActivityOtherAdjustmentDetail typeOtherAdjustmentDetails): void | -| `typeRefundDetails` | [`?PaymentBalanceActivityRefundDetail`](../../doc/models/payment-balance-activity-refund-detail.md) | Optional | - | getTypeRefundDetails(): ?PaymentBalanceActivityRefundDetail | setTypeRefundDetails(?PaymentBalanceActivityRefundDetail typeRefundDetails): void | -| `typeReleaseAdjustmentDetails` | [`?PaymentBalanceActivityReleaseAdjustmentDetail`](../../doc/models/payment-balance-activity-release-adjustment-detail.md) | Optional | - | getTypeReleaseAdjustmentDetails(): ?PaymentBalanceActivityReleaseAdjustmentDetail | setTypeReleaseAdjustmentDetails(?PaymentBalanceActivityReleaseAdjustmentDetail typeReleaseAdjustmentDetails): void | -| `typeReserveHoldDetails` | [`?PaymentBalanceActivityReserveHoldDetail`](../../doc/models/payment-balance-activity-reserve-hold-detail.md) | Optional | - | getTypeReserveHoldDetails(): ?PaymentBalanceActivityReserveHoldDetail | setTypeReserveHoldDetails(?PaymentBalanceActivityReserveHoldDetail typeReserveHoldDetails): void | -| `typeReserveReleaseDetails` | [`?PaymentBalanceActivityReserveReleaseDetail`](../../doc/models/payment-balance-activity-reserve-release-detail.md) | Optional | - | getTypeReserveReleaseDetails(): ?PaymentBalanceActivityReserveReleaseDetail | setTypeReserveReleaseDetails(?PaymentBalanceActivityReserveReleaseDetail typeReserveReleaseDetails): void | -| `typeSquareCapitalPaymentDetails` | [`?PaymentBalanceActivitySquareCapitalPaymentDetail`](../../doc/models/payment-balance-activity-square-capital-payment-detail.md) | Optional | - | getTypeSquareCapitalPaymentDetails(): ?PaymentBalanceActivitySquareCapitalPaymentDetail | setTypeSquareCapitalPaymentDetails(?PaymentBalanceActivitySquareCapitalPaymentDetail typeSquareCapitalPaymentDetails): void | -| `typeSquareCapitalReversedPaymentDetails` | [`?PaymentBalanceActivitySquareCapitalReversedPaymentDetail`](../../doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md) | Optional | - | getTypeSquareCapitalReversedPaymentDetails(): ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail | setTypeSquareCapitalReversedPaymentDetails(?PaymentBalanceActivitySquareCapitalReversedPaymentDetail typeSquareCapitalReversedPaymentDetails): void | -| `typeTaxOnFeeDetails` | [`?PaymentBalanceActivityTaxOnFeeDetail`](../../doc/models/payment-balance-activity-tax-on-fee-detail.md) | Optional | - | getTypeTaxOnFeeDetails(): ?PaymentBalanceActivityTaxOnFeeDetail | setTypeTaxOnFeeDetails(?PaymentBalanceActivityTaxOnFeeDetail typeTaxOnFeeDetails): void | -| `typeThirdPartyFeeDetails` | [`?PaymentBalanceActivityThirdPartyFeeDetail`](../../doc/models/payment-balance-activity-third-party-fee-detail.md) | Optional | - | getTypeThirdPartyFeeDetails(): ?PaymentBalanceActivityThirdPartyFeeDetail | setTypeThirdPartyFeeDetails(?PaymentBalanceActivityThirdPartyFeeDetail typeThirdPartyFeeDetails): void | -| `typeThirdPartyFeeRefundDetails` | [`?PaymentBalanceActivityThirdPartyFeeRefundDetail`](../../doc/models/payment-balance-activity-third-party-fee-refund-detail.md) | Optional | - | getTypeThirdPartyFeeRefundDetails(): ?PaymentBalanceActivityThirdPartyFeeRefundDetail | setTypeThirdPartyFeeRefundDetails(?PaymentBalanceActivityThirdPartyFeeRefundDetail typeThirdPartyFeeRefundDetails): void | -| `typeSquarePayrollTransferDetails` | [`?PaymentBalanceActivitySquarePayrollTransferDetail`](../../doc/models/payment-balance-activity-square-payroll-transfer-detail.md) | Optional | - | getTypeSquarePayrollTransferDetails(): ?PaymentBalanceActivitySquarePayrollTransferDetail | setTypeSquarePayrollTransferDetails(?PaymentBalanceActivitySquarePayrollTransferDetail typeSquarePayrollTransferDetails): void | -| `typeSquarePayrollTransferReversedDetails` | [`?PaymentBalanceActivitySquarePayrollTransferReversedDetail`](../../doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md) | Optional | - | getTypeSquarePayrollTransferReversedDetails(): ?PaymentBalanceActivitySquarePayrollTransferReversedDetail | setTypeSquarePayrollTransferReversedDetails(?PaymentBalanceActivitySquarePayrollTransferReversedDetail typeSquarePayrollTransferReversedDetails): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "payout_id": "payout_id4", - "effective_at": "effective_at8", - "type": "AUTOMATIC_SAVINGS_REVERSED", - "gross_amount_money": { - "amount": 186, - "currency": "MNT" - }, - "fee_amount_money": { - "amount": 126, - "currency": "CHF" - }, - "net_amount_money": { - "amount": 6, - "currency": "XPT" - } -} -``` - diff --git a/doc/models/payout-fee-type.md b/doc/models/payout-fee-type.md deleted file mode 100644 index afc863d6..00000000 --- a/doc/models/payout-fee-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Payout Fee Type - -Represents the type of payout fee that can incur as part of a payout. - -## Enumeration - -`PayoutFeeType` - -## Fields - -| Name | Description | -| --- | --- | -| `TRANSFER_FEE` | Fee type associated with transfers. | -| `TAX_ON_TRANSFER_FEE` | Taxes associated with the transfer fee. | - diff --git a/doc/models/payout-fee.md b/doc/models/payout-fee.md deleted file mode 100644 index 74ee3074..00000000 --- a/doc/models/payout-fee.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Payout Fee - -Represents a payout fee that can incur as part of a payout. - -## Structure - -`PayoutFee` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `effectiveAt` | `?string` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | getEffectiveAt(): ?string | setEffectiveAt(?string effectiveAt): void | -| `type` | [`?string(PayoutFeeType)`](../../doc/models/payout-fee-type.md) | Optional | Represents the type of payout fee that can incur as part of a payout. | getType(): ?string | setType(?string type): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "effective_at": "effective_at0", - "type": "TRANSFER_FEE" -} -``` - diff --git a/doc/models/payout-status.md b/doc/models/payout-status.md deleted file mode 100644 index c46bf5af..00000000 --- a/doc/models/payout-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Payout Status - -Payout status types - -## Enumeration - -`PayoutStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `SENT` | Indicates that the payout was successfully sent to the banking destination. | -| `FAILED` | Indicates that the payout was rejected by the banking destination. | -| `PAID` | Indicates that the payout has successfully completed. | - diff --git a/doc/models/payout-type.md b/doc/models/payout-type.md deleted file mode 100644 index 88d9aff0..00000000 --- a/doc/models/payout-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Payout Type - -The type of payout: “BATCH” or “SIMPLE”. -BATCH payouts include a list of payout entries that can be considered settled. -SIMPLE payouts do not have any payout entries associated with them -and will show up as one of the payout entries in a future BATCH payout. - -## Enumeration - -`PayoutType` - -## Fields - -| Name | Description | -| --- | --- | -| `BATCH` | Payouts that include a list of payout entries that can be considered settled. | -| `SIMPLE` | Payouts that do not have any payout entries associated with them and will
show up as one of the payout entries in a future BATCH payout. | - diff --git a/doc/models/payout.md b/doc/models/payout.md deleted file mode 100644 index e4dda144..00000000 --- a/doc/models/payout.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Payout - -An accounting of the amount owed the seller and record of the actual transfer to their -external bank account or to the Square balance. - -## Structure - -`Payout` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | A unique ID for the payout.
**Constraints**: *Minimum Length*: `1` | getId(): string | setId(string id): void | -| `status` | [`?string(PayoutStatus)`](../../doc/models/payout-status.md) | Optional | Payout status types | getStatus(): ?string | setStatus(?string status): void | -| `locationId` | `string` | Required | The ID of the location associated with the payout.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `createdAt` | `?string` | Optional | The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the payout was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `destination` | [`?Destination`](../../doc/models/destination.md) | Optional | Information about the destination against which the payout was made. | getDestination(): ?Destination | setDestination(?Destination destination): void | -| `version` | `?int` | Optional | The version number, which is incremented each time an update is made to this payout record.
The version number helps developers receive event notifications or feeds out of order. | getVersion(): ?int | setVersion(?int version): void | -| `type` | [`?string(PayoutType)`](../../doc/models/payout-type.md) | Optional | The type of payout: “BATCH” or “SIMPLE”.
BATCH payouts include a list of payout entries that can be considered settled.
SIMPLE payouts do not have any payout entries associated with them
and will show up as one of the payout entries in a future BATCH payout. | getType(): ?string | setType(?string type): void | -| `payoutFee` | [`?(PayoutFee[])`](../../doc/models/payout-fee.md) | Optional | A list of transfer fees and any taxes on the fees assessed by Square for this payout. | getPayoutFee(): ?array | setPayoutFee(?array payoutFee): void | -| `arrivalDate` | `?string` | Optional | The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. | getArrivalDate(): ?string | setArrivalDate(?string arrivalDate): void | -| `endToEndId` | `?string` | Optional | A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can use this ID to automate the process of reconciling each payout with the corresponding line item on the bank statement. | getEndToEndId(): ?string | setEndToEndId(?string endToEndId): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "status": "SENT", - "location_id": "location_id8", - "created_at": "created_at2", - "updated_at": "updated_at0", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "destination": { - "type": "BANK_ACCOUNT", - "id": "id4" - } -} -``` - diff --git a/doc/models/phase-input.md b/doc/models/phase-input.md deleted file mode 100644 index 8d7a4b62..00000000 --- a/doc/models/phase-input.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Phase Input - -Represents the arguments used to construct a new phase. - -## Structure - -`PhaseInput` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `ordinal` | `int` | Required | index of phase in total subscription plan | getOrdinal(): int | setOrdinal(int ordinal): void | -| `orderTemplateId` | `?string` | Optional | id of order to be used in billing | getOrderTemplateId(): ?string | setOrderTemplateId(?string orderTemplateId): void | - -## Example (as JSON) - -```json -{ - "ordinal": 234, - "order_template_id": "order_template_id4" -} -``` - diff --git a/doc/models/phase.md b/doc/models/phase.md deleted file mode 100644 index 493940fa..00000000 --- a/doc/models/phase.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Phase - -Represents a phase, which can override subscription phases as defined by plan_id - -## Structure - -`Phase` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | id of subscription phase | getUid(): ?string | setUid(?string uid): void | -| `ordinal` | `?int` | Optional | index of phase in total subscription plan | getOrdinal(): ?int | setOrdinal(?int ordinal): void | -| `orderTemplateId` | `?string` | Optional | id of order to be used in billing | getOrderTemplateId(): ?string | setOrderTemplateId(?string orderTemplateId): void | -| `planPhaseUid` | `?string` | Optional | the uid from the plan's phase in catalog | getPlanPhaseUid(): ?string | setPlanPhaseUid(?string planPhaseUid): void | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "ordinal": 12, - "order_template_id": "order_template_id6", - "plan_phase_uid": "plan_phase_uid0" -} -``` - diff --git a/doc/models/pre-populated-data.md b/doc/models/pre-populated-data.md deleted file mode 100644 index 9873726e..00000000 --- a/doc/models/pre-populated-data.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Pre Populated Data - -Describes buyer data to prepopulate in the payment form. -For more information, -see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). - -## Structure - -`PrePopulatedData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `buyerEmail` | `?string` | Optional | The buyer email to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `256` | getBuyerEmail(): ?string | setBuyerEmail(?string buyerEmail): void | -| `buyerPhoneNumber` | `?string` | Optional | The buyer phone number to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `17` | getBuyerPhoneNumber(): ?string | setBuyerPhoneNumber(?string buyerPhoneNumber): void | -| `buyerAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getBuyerAddress(): ?Address | setBuyerAddress(?Address buyerAddress): void | - -## Example (as JSON) - -```json -{ - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } -} -``` - diff --git a/doc/models/processing-fee.md b/doc/models/processing-fee.md deleted file mode 100644 index c9330e5a..00000000 --- a/doc/models/processing-fee.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Processing Fee - -Represents the Square processing fee. - -## Structure - -`ProcessingFee` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `effectiveAt` | `?string` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | getEffectiveAt(): ?string | setEffectiveAt(?string effectiveAt): void | -| `type` | `?string` | Optional | The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. | getType(): ?string | setType(?string type): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | - -## Example (as JSON) - -```json -{ - "effective_at": "effective_at2", - "type": "type8", - "amount_money": { - "amount": 186, - "currency": "AUD" - } -} -``` - diff --git a/doc/models/product-type.md b/doc/models/product-type.md deleted file mode 100644 index 650994b2..00000000 --- a/doc/models/product-type.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Product Type - -## Enumeration - -`ProductType` - -## Fields - -| Name | -| --- | -| `TERMINAL_API` | - diff --git a/doc/models/product.md b/doc/models/product.md deleted file mode 100644 index 699d85d8..00000000 --- a/doc/models/product.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Product - -Indicates the Square product used to generate a change. - -## Enumeration - -`Product` - -## Fields - -| Name | Description | -| --- | --- | -| `SQUARE_POS` | Square Point of Sale application. | -| `EXTERNAL_API` | Square Connect APIs (for example, Orders API or Checkout API). | -| `BILLING` | A Square subscription (various products). | -| `APPOINTMENTS` | Square Appointments. | -| `INVOICES` | Square Invoices. | -| `ONLINE_STORE` | Square Online Store. | -| `PAYROLL` | Square Payroll. | -| `DASHBOARD` | Square Dashboard. | -| `ITEM_LIBRARY_IMPORT` | Item Library Import. | -| `OTHER` | A Square product that does not match any other value. | - diff --git a/doc/models/publish-invoice-request.md b/doc/models/publish-invoice-request.md deleted file mode 100644 index 60f185ba..00000000 --- a/doc/models/publish-invoice-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Publish Invoice Request - -Describes a `PublishInvoice` request. - -## Structure - -`PublishInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `int` | Required | The version of the [invoice](entity:Invoice) to publish.
This must match the current version of the invoice; otherwise, the request is rejected. | getVersion(): int | setVersion(int version): void | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the `PublishInvoice` request. If you do not
provide `idempotency_key` (or provide an empty string as the value), the endpoint
treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "32da42d0-1997-41b0-826b-f09464fc2c2e", - "version": 1 -} -``` - diff --git a/doc/models/publish-invoice-response.md b/doc/models/publish-invoice-response.md deleted file mode 100644 index 37bb27fa..00000000 --- a/doc/models/publish-invoice-response.md +++ /dev/null @@ -1,107 +0,0 @@ - -# Publish Invoice Response - -Describes a `PublishInvoice` response. - -## Structure - -`PublishInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`?Invoice`](../../doc/models/invoice.md) | Optional | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): ?Invoice | setInvoice(?Invoice invoice): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "public_url": "https://squareup.com/pay-invoice/inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "SCHEDULED", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T18:23:11Z", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/qr-code-options.md b/doc/models/qr-code-options.md deleted file mode 100644 index 1629b40c..00000000 --- a/doc/models/qr-code-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Qr Code Options - -Fields to describe the action that displays QR-Codes. - -## Structure - -`QrCodeOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | -| `body` | `string` | Required | The body text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | -| `barcodeContents` | `string` | Required | The text representation of the data to show in the QR code
as UTF8-encoded data.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1024` | getBarcodeContents(): string | setBarcodeContents(string barcodeContents): void | - -## Example (as JSON) - -```json -{ - "title": "title8", - "body": "body8", - "barcode_contents": "barcode_contents4" -} -``` - diff --git a/doc/models/quantity-ratio.md b/doc/models/quantity-ratio.md deleted file mode 100644 index 02443bf3..00000000 --- a/doc/models/quantity-ratio.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Quantity Ratio - -A whole number or unreduced fractional ratio. - -## Structure - -`QuantityRatio` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `quantity` | `?int` | Optional | The whole or fractional quantity as the numerator. | getQuantity(): ?int | setQuantity(?int quantity): void | -| `quantityDenominator` | `?int` | Optional | The whole or fractional quantity as the denominator.
With fractional quantity this field is the denominator and quantity is the numerator.
The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified,
the quantity ratio is `3` or `3/1`. | getQuantityDenominator(): ?int | setQuantityDenominator(?int quantityDenominator): void | - -## Example (as JSON) - -```json -{ - "quantity": 86, - "quantity_denominator": 18 -} -``` - diff --git a/doc/models/quick-pay.md b/doc/models/quick-pay.md deleted file mode 100644 index 6f5a64b5..00000000 --- a/doc/models/quick-pay.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Quick Pay - -Describes an ad hoc item and price to generate a quick pay checkout link. -For more information, -see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). - -## Structure - -`QuickPay` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | The ad hoc item name. In the resulting `Order`, this name appears as the line item name.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getName(): string | setName(string name): void | -| `priceMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): Money | setPriceMoney(Money priceMoney): void | -| `locationId` | `string` | Required | The ID of the business location the checkout is associated with. | getLocationId(): string | setLocationId(string locationId): void | - -## Example (as JSON) - -```json -{ - "name": "name8", - "price_money": { - "amount": 202, - "currency": "GTQ" - }, - "location_id": "location_id2" -} -``` - diff --git a/doc/models/range.md b/doc/models/range.md deleted file mode 100644 index f96bd5a0..00000000 --- a/doc/models/range.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Range - -The range of a number value between the specified lower and upper bounds. - -## Structure - -`Range` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `min` | `?string` | Optional | The lower bound of the number range. At least one of `min` or `max` must be specified.
If unspecified, the results will have no minimum value. | getMin(): ?string | setMin(?string min): void | -| `max` | `?string` | Optional | The upper bound of the number range. At least one of `min` or `max` must be specified.
If unspecified, the results will have no maximum value. | getMax(): ?string | setMax(?string max): void | - -## Example (as JSON) - -```json -{ - "min": "min8", - "max": "max0" -} -``` - diff --git a/doc/models/receipt-options.md b/doc/models/receipt-options.md deleted file mode 100644 index 32cd3294..00000000 --- a/doc/models/receipt-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Receipt Options - -Describes receipt action fields. - -## Structure - -`ReceiptOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentId` | `string` | Required | The reference to the Square payment ID for the receipt. | getPaymentId(): string | setPaymentId(string paymentId): void | -| `printOnly` | `?bool` | Optional | Instructs the device to print the receipt without displaying the receipt selection screen.
Requires `printer_enabled` set to true.
Defaults to false. | getPrintOnly(): ?bool | setPrintOnly(?bool printOnly): void | -| `isDuplicate` | `?bool` | Optional | Identify the receipt as a reprint rather than an original receipt.
Defaults to false. | getIsDuplicate(): ?bool | setIsDuplicate(?bool isDuplicate): void | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "print_only": false, - "is_duplicate": false -} -``` - diff --git a/doc/models/redeem-loyalty-reward-request.md b/doc/models/redeem-loyalty-reward-request.md deleted file mode 100644 index 4bd64655..00000000 --- a/doc/models/redeem-loyalty-reward-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Redeem Loyalty Reward Request - -A request to redeem a loyalty reward. - -## Structure - -`RedeemLoyaltyRewardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `RedeemLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `locationId` | `string` | Required | The ID of the [location](entity:Location) where the reward is redeemed.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "98adc7f7-6963-473b-b29c-f3c9cdd7d994", - "location_id": "P034NEENMD09F" -} -``` - diff --git a/doc/models/redeem-loyalty-reward-response.md b/doc/models/redeem-loyalty-reward-response.md deleted file mode 100644 index 0487c53c..00000000 --- a/doc/models/redeem-loyalty-reward-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Redeem Loyalty Reward Response - -A response that includes the `LoyaltyEvent` published for redeeming the reward. - -## Structure - -`RedeemLoyaltyRewardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `event` | [`?LoyaltyEvent`](../../doc/models/loyalty-event.md) | Optional | Provides information about a loyalty event.
For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). | getEvent(): ?LoyaltyEvent | setEvent(?LoyaltyEvent event): void | - -## Example (as JSON) - -```json -{ - "event": { - "created_at": "2020-05-08T21:56:00Z", - "id": "67377a6e-dbdc-369d-aa16-2e7ed422e71f", - "location_id": "P034NEENMD09F", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "redeem_reward": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "reward_id": "9f18ac21-233a-31c3-be77-b45840f5a810", - "order_id": "order_id8" - }, - "source": "LOYALTY_API", - "type": "REDEEM_REWARD", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/refund-payment-request.md b/doc/models/refund-payment-request.md deleted file mode 100644 index b7d97d82..00000000 --- a/doc/models/refund-payment-request.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Refund Payment Request - -Describes a request to refund a payment using [RefundPayment](../../doc/apis/refunds.md#refund-payment). - -## Structure - -`RefundPaymentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `RefundPayment` request. The key can be any valid string
but must be unique for every `RefundPayment` request.

Keys are limited to a max of 45 characters - however, the number of allowed characters might be
less than 45, if multi-byte characters are used.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `paymentId` | `?string` | Optional | The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `destinationId` | `?string` | Optional | The ID indicating where funds will be refunded to. Required for unlinked refunds. For more
information, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds).

For refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds
will be returned to the original payment source. The field may be specified in order to request
a cross-method refund to a gift card. For more information,
see [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards). | getDestinationId(): ?string | setDestinationId(?string destinationId): void | -| `unlinked` | `?bool` | Optional | Indicates that the refund is not linked to a Square payment.
If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not
be provided. | getUnlinked(): ?bool | setUnlinked(?bool unlinked): void | -| `locationId` | `?string` | Optional | The location ID associated with the unlinked refund.
Required for requests specifying `unlinked=true`.
Otherwise, if included when `unlinked=false`, will throw an error.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `customerId` | `?string` | Optional | The [Customer](entity:Customer) ID of the customer associated with the refund.
This is required if the `destination_id` refers to a card on file created using the Cards
API. Only allowed when `unlinked=true`. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `reason` | `?string` | Optional | A description of the reason for the refund.
**Constraints**: *Maximum Length*: `192` | getReason(): ?string | setReason(?string reason): void | -| `paymentVersionToken` | `?string` | Optional | Used for optimistic concurrency. This opaque token identifies the current `Payment`
version that the caller expects. If the server has a different version of the Payment,
the update fails and a response with a VERSION_MISMATCH error is returned.
If the versions match, or the field is not provided, the refund proceeds as normal. | getPaymentVersionToken(): ?string | setPaymentVersionToken(?string paymentVersionToken): void | -| `teamMemberId` | `?string` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with this refund.
**Constraints**: *Maximum Length*: `192` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `cashDetails` | [`?DestinationDetailsCashRefundDetails`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | getCashDetails(): ?DestinationDetailsCashRefundDetails | setCashDetails(?DestinationDetailsCashRefundDetails cashDetails): void | -| `externalDetails` | [`?DestinationDetailsExternalRefundDetails`](../../doc/models/destination-details-external-refund-details.md) | Optional | Stores details about an external refund. Contains only non-confidential information. | getExternalDetails(): ?DestinationDetailsExternalRefundDetails | setExternalDetails(?DestinationDetailsExternalRefundDetails externalDetails): void | - -## Example (as JSON) - -```json -{ - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "app_fee_money": { - "amount": 10, - "currency": "USD" - }, - "idempotency_key": "9b7f2dcf-49da-4411-b23e-a2d6af21333a", - "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", - "reason": "Example", - "destination_id": "destination_id6", - "unlinked": false, - "location_id": "location_id8" -} -``` - diff --git a/doc/models/refund-payment-response.md b/doc/models/refund-payment-response.md deleted file mode 100644 index 42c10e67..00000000 --- a/doc/models/refund-payment-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Refund Payment Response - -Defines the response returned by -[RefundPayment](../../doc/apis/refunds.md#refund-payment). - -If there are errors processing the request, the `refund` field might not be -present, or it might be present with a status of `FAILED`. - -## Structure - -`RefundPaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refund` | [`?PaymentRefund`](../../doc/models/payment-refund.md) | Optional | Represents a refund of a payment made using Square. Contains information about
the original payment and the amount of money refunded. | getRefund(): ?PaymentRefund | setRefund(?PaymentRefund refund): void | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "app_fee_money": { - "amount": 10, - "currency": "USD" - }, - "created_at": "2021-10-13T21:23:19.116Z", - "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY_KlWP8IC1557ddwc9QWTKrCVU6m0JXDz15R2Qym5eQfR", - "location_id": "L88917AVBK2S5", - "order_id": "1JLEUZeEooAIX8HMqm9kvWd69aQZY", - "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", - "reason": "Example", - "status": "PENDING", - "updated_at": "2021-10-13T21:23:19.508Z", - "unlinked": false, - "destination_type": "destination_type2", - "destination_details": { - "card_details": { - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "entry_method8", - "auth_result_code": "auth_result_code0" - }, - "cash_details": { - "seller_supplied_money": { - "amount": 36, - "currency": "MKD" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } - }, - "external_details": { - "type": "type6", - "source": "source0", - "source_id": "source_id8" - } - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/refund-status.md b/doc/models/refund-status.md deleted file mode 100644 index c2ac2027..00000000 --- a/doc/models/refund-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Refund Status - -Indicates a refund's current status. - -## Enumeration - -`RefundStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The refund is pending. | -| `APPROVED` | The refund has been approved by Square. | -| `REJECTED` | The refund has been rejected by Square. | -| `FAILED` | The refund failed. | - diff --git a/doc/models/refund.md b/doc/models/refund.md deleted file mode 100644 index 2667ae3a..00000000 --- a/doc/models/refund.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Refund - -Represents a refund processed for a Square transaction. - -## Structure - -`Refund` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The refund's unique ID.
**Constraints**: *Maximum Length*: `255` | getId(): string | setId(string id): void | -| `locationId` | `string` | Required | The ID of the refund's associated location.
**Constraints**: *Maximum Length*: `50` | getLocationId(): string | setLocationId(string locationId): void | -| `transactionId` | `?string` | Optional | The ID of the transaction that the refunded tender is part of.
**Constraints**: *Maximum Length*: `192` | getTransactionId(): ?string | setTransactionId(?string transactionId): void | -| `tenderId` | `string` | Required | The ID of the refunded tender.
**Constraints**: *Maximum Length*: `192` | getTenderId(): string | setTenderId(string tenderId): void | -| `createdAt` | `?string` | Optional | The timestamp for when the refund was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `reason` | `string` | Required | The reason for the refund being issued.
**Constraints**: *Maximum Length*: `192` | getReason(): string | setReason(string reason): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `status` | [`string(RefundStatus)`](../../doc/models/refund-status.md) | Required | Indicates a refund's current status. | getStatus(): string | setStatus(string status): void | -| `processingFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getProcessingFeeMoney(): ?Money | setProcessingFeeMoney(?Money processingFeeMoney): void | -| `additionalRecipients` | [`?(AdditionalRecipient[])`](../../doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this refund.
For example, fees assessed on a refund of a purchase by a third party integration. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "location_id": "location_id0", - "transaction_id": "transaction_id4", - "tender_id": "tender_id4", - "created_at": "created_at6", - "reason": "reason8", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] -} -``` - diff --git a/doc/models/register-domain-request.md b/doc/models/register-domain-request.md deleted file mode 100644 index d8b699dd..00000000 --- a/doc/models/register-domain-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Register Domain Request - -Defines the parameters that can be included in the body of -a request to the [RegisterDomain](../../doc/apis/apple-pay.md#register-domain) endpoint. - -## Structure - -`RegisterDomainRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `domainName` | `string` | Required | A domain name as described in RFC-1034 that will be registered with ApplePay.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getDomainName(): string | setDomainName(string domainName): void | - -## Example (as JSON) - -```json -{ - "domain_name": "example.com" -} -``` - diff --git a/doc/models/register-domain-response-status.md b/doc/models/register-domain-response-status.md deleted file mode 100644 index ea00a86e..00000000 --- a/doc/models/register-domain-response-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Register Domain Response Status - -The status of the domain registration. - -## Enumeration - -`RegisterDomainResponseStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The domain is added, but not verified. | -| `VERIFIED` | The domain is added and verified. It can be used to accept Apple Pay transactions. | - diff --git a/doc/models/register-domain-response.md b/doc/models/register-domain-response.md deleted file mode 100644 index 4112e8c3..00000000 --- a/doc/models/register-domain-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Register Domain Response - -Defines the fields that are included in the response body of -a request to the [RegisterDomain](../../doc/apis/apple-pay.md#register-domain) endpoint. - -Either `errors` or `status` are present in a given response (never both). - -## Structure - -`RegisterDomainResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `status` | [`?string(RegisterDomainResponseStatus)`](../../doc/models/register-domain-response-status.md) | Optional | The status of the domain registration. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "status": "VERIFIED", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/remove-group-from-customer-response.md b/doc/models/remove-group-from-customer-response.md deleted file mode 100644 index 416da462..00000000 --- a/doc/models/remove-group-from-customer-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Remove Group From Customer Response - -Defines the fields that are included in the response body of -a request to the [RemoveGroupFromCustomer](../../doc/apis/customers.md#remove-group-from-customer) -endpoint. - -## Structure - -`RemoveGroupFromCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/resume-subscription-request.md b/doc/models/resume-subscription-request.md deleted file mode 100644 index 905cca50..00000000 --- a/doc/models/resume-subscription-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Resume Subscription Request - -Defines input parameters in a request to the -[ResumeSubscription](../../doc/apis/subscriptions.md#resume-subscription) endpoint. - -## Structure - -`ResumeSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `resumeEffectiveDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the subscription reactivated. | getResumeEffectiveDate(): ?string | setResumeEffectiveDate(?string resumeEffectiveDate): void | -| `resumeChangeTiming` | [`?string(ChangeTiming)`](../../doc/models/change-timing.md) | Optional | Supported timings when a pending change, as an action, takes place to a subscription. | getResumeChangeTiming(): ?string | setResumeChangeTiming(?string resumeChangeTiming): void | - -## Example (as JSON) - -```json -{ - "resume_effective_date": "resume_effective_date8", - "resume_change_timing": "IMMEDIATE" -} -``` - diff --git a/doc/models/resume-subscription-response.md b/doc/models/resume-subscription-response.md deleted file mode 100644 index 3e54f2cd..00000000 --- a/doc/models/resume-subscription-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# Resume Subscription Response - -Defines output parameters in a response from the -[ResumeSubscription](../../doc/apis/subscriptions.md#resume-subscription) endpoint. - -## Structure - -`ResumeSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of `RESUME` actions created by the request and scheduled for the subscription. | getActions(): ?array | setActions(?array actions): void | - -## Example (as JSON) - -```json -{ - "actions": [ - { - "effective_date": "2023-09-01", - "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", - "type": "RESUME", - "monthly_billing_anchor_date": 186, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] - } - ], - "subscription": { - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - "ordinal": 0, - "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", - "uid": "873451e0-745b-4e87-ab0b-c574933fe616" - } - ], - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2023-06-20", - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-booking-custom-attribute-definition-request.md b/doc/models/retrieve-booking-custom-attribute-definition-request.md deleted file mode 100644 index b58f7f5a..00000000 --- a/doc/models/retrieve-booking-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Booking Custom Attribute Definition Request - -Represents a [RetrieveBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) request. - -## Structure - -`RetrieveBookingCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 70 -} -``` - diff --git a/doc/models/retrieve-booking-custom-attribute-definition-response.md b/doc/models/retrieve-booking-custom-attribute-definition-response.md deleted file mode 100644 index 6e0f14f9..00000000 --- a/doc/models/retrieve-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Retrieve Booking Custom Attribute Definition Response - -Represents a [RetrieveBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveBookingCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-11-16T15:27:30Z", - "description": "The favorite shampoo of the customer.", - "key": "favoriteShampoo", - "name": "Favorite shampoo", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T15:27:30Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [] -} -``` - diff --git a/doc/models/retrieve-booking-custom-attribute-request.md b/doc/models/retrieve-booking-custom-attribute-request.md deleted file mode 100644 index 89b68c09..00000000 --- a/doc/models/retrieve-booking-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Booking Custom Attribute Request - -Represents a [RetrieveBookingCustomAttribute](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute) request. - -## Structure - -`RetrieveBookingCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `withDefinition` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinition(): ?bool | setWithDefinition(?bool withDefinition): void | -| `version` | `?int` | Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "with_definition": false, - "version": 186 -} -``` - diff --git a/doc/models/retrieve-booking-custom-attribute-response.md b/doc/models/retrieve-booking-custom-attribute-response.md deleted file mode 100644 index 72971c8f..00000000 --- a/doc/models/retrieve-booking-custom-attribute-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Retrieve Booking Custom Attribute Response - -Represents a [RetrieveBookingCustomAttribute](../../doc/apis/booking-custom-attributes.md#retrieve-booking-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveBookingCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-booking-response.md b/doc/models/retrieve-booking-response.md deleted file mode 100644 index ad67917f..00000000 --- a/doc/models/retrieve-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Retrieve Booking Response - -## Structure - -`RetrieveBookingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `booking` | [`?Booking`](../../doc/models/booking.md) | Optional | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): ?Booking | setBooking(?Booking booking): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking": { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t" - } - ], - "created_at": "2020-10-28T15:47:41Z", - "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - "customer_note": "", - "id": "zkras0xv0xwswx", - "location_id": "LEQHH0YY8B42M", - "seller_note": "", - "start_at": "2020-11-26T13:00:00Z", - "status": "ACCEPTED", - "updated_at": "2020-10-28T15:49:25Z", - "version": 1 - }, - "errors": [] -} -``` - diff --git a/doc/models/retrieve-business-booking-profile-response.md b/doc/models/retrieve-business-booking-profile-response.md deleted file mode 100644 index 6afae13d..00000000 --- a/doc/models/retrieve-business-booking-profile-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Retrieve Business Booking Profile Response - -## Structure - -`RetrieveBusinessBookingProfileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `businessBookingProfile` | [`?BusinessBookingProfile`](../../doc/models/business-booking-profile.md) | Optional | A seller's business booking profile, including booking policy, appointment settings, etc. | getBusinessBookingProfile(): ?BusinessBookingProfile | setBusinessBookingProfile(?BusinessBookingProfile businessBookingProfile): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "business_booking_profile": { - "allow_user_cancel": true, - "booking_enabled": true, - "booking_policy": "ACCEPT_ALL", - "business_appointment_settings": { - "alignment_time": "HALF_HOURLY", - "any_team_member_booking_enabled": true, - "cancellation_fee_money": { - "currency": "USD" - }, - "cancellation_policy": "CUSTOM_POLICY", - "location_types": [ - "BUSINESS_LOCATION" - ], - "max_booking_lead_time_seconds": 31536000, - "min_booking_lead_time_seconds": 0, - "multiple_service_booking_enabled": true, - "skip_booking_flow_staff_selection": false - }, - "created_at": "2020-09-10T21:40:38Z", - "customer_timezone_choice": "CUSTOMER_CHOICE", - "seller_id": "MLJQYZZRM0D3Y" - }, - "errors": [] -} -``` - diff --git a/doc/models/retrieve-card-response.md b/doc/models/retrieve-card-response.md deleted file mode 100644 index f40237ef..00000000 --- a/doc/models/retrieve-card-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Retrieve Card Response - -Defines the fields that are included in the response body of -a request to the [RetrieveCard](../../doc/apis/cards.md#retrieve-card) endpoint. - -Note: if there are errors processing the request, the card field will not be -present. - -## Structure - -`RetrieveCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | - -## Example (as JSON) - -```json -{ - "card": { - "billing_address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "bin": "411111", - "card_brand": "VISA", - "card_type": "CREDIT", - "cardholder_name": "Amelia Earhart", - "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", - "enabled": true, - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - "id": "ccof:uIbfJXhXETSP197M3GB", - "last_4": "1111", - "merchant_id": "6SSW7HV8K2ST5", - "prepaid_type": "NOT_PREPAID", - "reference_id": "user-id-1", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-cash-drawer-shift-request.md b/doc/models/retrieve-cash-drawer-shift-request.md deleted file mode 100644 index 466a44d8..00000000 --- a/doc/models/retrieve-cash-drawer-shift-request.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Retrieve Cash Drawer Shift Request - -## Structure - -`RetrieveCashDrawerShiftRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationId` | `string` | Required | The ID of the location to retrieve cash drawer shifts from.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | - -## Example (as JSON) - -```json -{ - "location_id": "location_id6" -} -``` - diff --git a/doc/models/retrieve-cash-drawer-shift-response.md b/doc/models/retrieve-cash-drawer-shift-response.md deleted file mode 100644 index 2083b8c3..00000000 --- a/doc/models/retrieve-cash-drawer-shift-response.md +++ /dev/null @@ -1,77 +0,0 @@ - -# Retrieve Cash Drawer Shift Response - -## Structure - -`RetrieveCashDrawerShiftResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cashDrawerShift` | [`?CashDrawerShift`](../../doc/models/cash-drawer-shift.md) | Optional | This model gives the details of a cash drawer shift.
The cash_payment_money, cash_refund_money, cash_paid_in_money,
and cash_paid_out_money fields are all computed by summing their respective
event types. | getCashDrawerShift(): ?CashDrawerShift | setCashDrawerShift(?CashDrawerShift cashDrawerShift): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cash_drawer_shift": { - "cash_paid_in_money": { - "amount": 10000, - "currency": "USD" - }, - "cash_paid_out_money": { - "amount": -10000, - "currency": "USD" - }, - "cash_payment_money": { - "amount": 100, - "currency": "USD" - }, - "cash_refunds_money": { - "amount": -100, - "currency": "USD" - }, - "closed_at": "2019-11-22T00:44:49.000Z", - "closed_cash_money": { - "amount": 9970, - "currency": "USD" - }, - "closing_team_member_id": "", - "description": "Misplaced some change", - "device": { - "name": "My iPad" - }, - "ended_at": "2019-11-22T00:44:49.000Z", - "ending_team_member_id": "", - "expected_cash_money": { - "amount": 10000, - "currency": "USD" - }, - "id": "DCC99978-09A6-4926-849F-300BE9C5793A", - "opened_at": "2019-11-22T00:42:54.000Z", - "opened_cash_money": { - "amount": 10000, - "currency": "USD" - }, - "opening_team_member_id": "", - "state": "CLOSED" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-catalog-object-request.md b/doc/models/retrieve-catalog-object-request.md deleted file mode 100644 index 1271a5bb..00000000 --- a/doc/models/retrieve-catalog-object-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Catalog Object Request - -## Structure - -`RetrieveCatalogObjectRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | -| `catalogVersion` | `?int` | Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | -| `includeCategoryPathToRoot` | `?bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | getIncludeCategoryPathToRoot(): ?bool | setIncludeCategoryPathToRoot(?bool includeCategoryPathToRoot): void | - -## Example (as JSON) - -```json -{ - "include_related_objects": false, - "catalog_version": 224, - "include_category_path_to_root": false -} -``` - diff --git a/doc/models/retrieve-catalog-object-response.md b/doc/models/retrieve-catalog-object-response.md deleted file mode 100644 index 3adb206f..00000000 --- a/doc/models/retrieve-catalog-object-response.md +++ /dev/null @@ -1,171 +0,0 @@ - -# Retrieve Catalog Object Response - -## Structure - -`RetrieveCatalogObjectResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `object` | [`?CatalogObject`](../../doc/models/catalog-object.md) | Optional | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getObject(): ?CatalogObject | setObject(?CatalogObject object): void | -| `relatedObjects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of `CatalogObject`s referenced by the object in the `object` field. | getRelatedObjects(): ?array | setRelatedObjects(?array relatedObjects): void | - -## Example (as JSON) - -```json -{ - "object": { - "id": "W62UWFY35CWMYGVWK6TWJDNI", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "BJNQCF2FJ6S6UIDT65ABHLRX", - "ordinal": 0 - } - ], - "description": "Hot Leaf Juice", - "name": "Tea", - "tax_ids": [ - "HURXQOOAIC4IZSI2BEXQRYFY" - ], - "variations": [ - { - "id": "2TZFAOHWGG7PAK2QEXWYPZSP", - "is_deleted": false, - "item_variation_data": { - "item_id": "W62UWFY35CWMYGVWK6TWJDNI", - "name": "Mug", - "ordinal": 0, - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - "related_objects": [ - { - "category_data": { - "name": "Beverages" - }, - "id": "BJNQCF2FJ6S6UIDT65ABHLRX", - "is_deleted": false, - "present_at_all_locations": true, - "type": "CATEGORY", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "HURXQOOAIC4IZSI2BEXQRYFY", - "is_deleted": false, - "present_at_all_locations": true, - "tax_data": { - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "enabled": true, - "inclusion_type": "ADDITIVE", - "name": "Sales Tax", - "percentage": "5.0" - }, - "type": "TAX", - "updated_at": "2016-11-16T22:25:24.878Z", - "version": 1479335124878, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-customer-custom-attribute-definition-request.md b/doc/models/retrieve-customer-custom-attribute-definition-request.md deleted file mode 100644 index 78ee5c95..00000000 --- a/doc/models/retrieve-customer-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Customer Custom Attribute Definition Request - -Represents a [RetrieveCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) request. - -## Structure - -`RetrieveCustomerCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 38 -} -``` - diff --git a/doc/models/retrieve-customer-custom-attribute-definition-response.md b/doc/models/retrieve-customer-custom-attribute-definition-response.md deleted file mode 100644 index 2d997952..00000000 --- a/doc/models/retrieve-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Retrieve Customer Custom Attribute Definition Response - -Represents a [RetrieveCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveCustomerCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-04-26T15:27:30Z", - "description": "The favorite movie of the customer.", - "key": "favoritemovie", - "name": "Favorite Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-04-26T15:27:30Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-customer-custom-attribute-request.md b/doc/models/retrieve-customer-custom-attribute-request.md deleted file mode 100644 index 6e77eccb..00000000 --- a/doc/models/retrieve-customer-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Customer Custom Attribute Request - -Represents a [RetrieveCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute) request. - -## Structure - -`RetrieveCustomerCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `withDefinition` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinition(): ?bool | setWithDefinition(?bool withDefinition): void | -| `version` | `?int` | Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "with_definition": false, - "version": 232 -} -``` - diff --git a/doc/models/retrieve-customer-custom-attribute-response.md b/doc/models/retrieve-customer-custom-attribute-response.md deleted file mode 100644 index 8783d509..00000000 --- a/doc/models/retrieve-customer-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Retrieve Customer Custom Attribute Response - -Represents a [RetrieveCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#retrieve-customer-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveCustomerCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-customer-group-response.md b/doc/models/retrieve-customer-group-response.md deleted file mode 100644 index fdb88026..00000000 --- a/doc/models/retrieve-customer-group-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Retrieve Customer Group Response - -Defines the fields that are included in the response body of -a request to the [RetrieveCustomerGroup](../../doc/apis/customer-groups.md#retrieve-customer-group) endpoint. - -Either `errors` or `group` is present in a given response (never both). - -## Structure - -`RetrieveCustomerGroupResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](../../doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | - -## Example (as JSON) - -```json -{ - "group": { - "created_at": "2020-04-13T21:54:57.863Z", - "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", - "name": "Loyal Customers", - "updated_at": "2020-04-13T21:54:58Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-customer-response.md b/doc/models/retrieve-customer-response.md deleted file mode 100644 index 7525d6d0..00000000 --- a/doc/models/retrieve-customer-response.md +++ /dev/null @@ -1,85 +0,0 @@ - -# Retrieve Customer Response - -Defines the fields that are included in the response body of -a request to the `RetrieveCustomer` endpoint. - -Either `errors` or `customer` is present in a given response (never both). - -## Structure - -`RetrieveCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `customer` | [`?Customer`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | getCustomer(): ?Customer | setCustomer(?Customer customer): void | - -## Example (as JSON) - -```json -{ - "customer": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2016-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "group_ids": [ - "545AXB44B4XXWMVQ4W8SBT3HHF" - ], - "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "note": "a customer", - "phone_number": "+1-212-555-4240", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "segment_ids": [ - "1KB9JE5EGJXCW.REACHABLE" - ], - "updated_at": "2016-03-23T20:21:54.859Z", - "version": 1, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-customer-segment-response.md b/doc/models/retrieve-customer-segment-response.md deleted file mode 100644 index 998f6948..00000000 --- a/doc/models/retrieve-customer-segment-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Retrieve Customer Segment Response - -Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint. - -Either `errors` or `segment` is present in a given response (never both). - -## Structure - -`RetrieveCustomerSegmentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `segment` | [`?CustomerSegment`](../../doc/models/customer-segment.md) | Optional | Represents a group of customer profiles that match one or more predefined filter criteria.

Segments (also known as Smart Groups) are defined and created within the Customer Directory in the
Square Seller Dashboard or Point of Sale. | getSegment(): ?CustomerSegment | setSegment(?CustomerSegment segment): void | - -## Example (as JSON) - -```json -{ - "segment": { - "created_at": "2020-01-09T19:33:24.469Z", - "id": "GMNXRZVEXNQDF.CHURN_RISK", - "name": "Lapsed", - "updated_at": "2020-04-13T23:01:13Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-dispute-evidence-response.md b/doc/models/retrieve-dispute-evidence-response.md deleted file mode 100644 index 6d00662f..00000000 --- a/doc/models/retrieve-dispute-evidence-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Retrieve Dispute Evidence Response - -Defines the fields in a `RetrieveDisputeEvidence` response. - -## Structure - -`RetrieveDisputeEvidenceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `evidence` | [`?DisputeEvidence`](../../doc/models/dispute-evidence.md) | Optional | - | getEvidence(): ?DisputeEvidence | setEvidence(?DisputeEvidence evidence): void | - -## Example (as JSON) - -```json -{ - "evidence": { - "dispute_id": "bVTprrwk0gygTLZ96VX1oB", - "evidence_file": { - "filename": "customer-interaction.jpg", - "filetype": "image/jpeg" - }, - "evidence_type": "CARDHOLDER_COMMUNICATION", - "id": "TOomLInj6iWmP3N8qfCXrB", - "uploaded_at": "2022-05-18T16:01:10.000Z", - "evidence_id": "evidence_id0", - "evidence_text": "evidence_text6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-dispute-response.md b/doc/models/retrieve-dispute-response.md deleted file mode 100644 index a48e7f8a..00000000 --- a/doc/models/retrieve-dispute-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Retrieve Dispute Response - -Defines fields in a `RetrieveDispute` response. - -## Structure - -`RetrieveDisputeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `dispute` | [`?Dispute`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | getDispute(): ?Dispute | setDispute(?Dispute dispute): void | - -## Example (as JSON) - -```json -{ - "dispute": { - "amount_money": { - "amount": 2500, - "currency": "USD" - }, - "brand_dispute_id": "100000809947", - "card_brand": "VISA", - "created_at": "2022-06-29T18:45:22.265Z", - "disputed_payment": { - "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" - }, - "due_at": "2022-07-13T00:00:00.000Z", - "id": "XDgyFu7yo1E2S5lQGGpYn", - "location_id": "L1HN3ZMQK64X9", - "reason": "NO_KNOWLEDGE", - "reported_at": "2022-06-29T00:00:00.000Z", - "state": "ACCEPTED", - "updated_at": "2022-07-07T19:14:42.650Z", - "version": 2, - "dispute_id": "dispute_id8" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-employee-response.md b/doc/models/retrieve-employee-response.md deleted file mode 100644 index 55742fd3..00000000 --- a/doc/models/retrieve-employee-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Retrieve Employee Response - -## Structure - -`RetrieveEmployeeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `employee` | [`?Employee`](../../doc/models/employee.md) | Optional | An employee object that is used by the external API.

DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). | getEmployee(): ?Employee | setEmployee(?Employee employee): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "employee": { - "id": "id8", - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "phone_number": "phone_number6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-gift-card-from-gan-request.md b/doc/models/retrieve-gift-card-from-gan-request.md deleted file mode 100644 index aa1505a2..00000000 --- a/doc/models/retrieve-gift-card-from-gan-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Gift Card From GAN Request - -A request to retrieve gift cards by their GANs. - -## Structure - -`RetrieveGiftCardFromGANRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `gan` | `string` | Required | The gift card account number (GAN) of the gift card to retrieve.
The maximum length of a GAN is 255 digits to account for third-party GANs that have been imported.
Square-issued gift cards have 16-digit GANs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getGan(): string | setGan(string gan): void | - -## Example (as JSON) - -```json -{ - "gan": "7783320001001635" -} -``` - diff --git a/doc/models/retrieve-gift-card-from-gan-response.md b/doc/models/retrieve-gift-card-from-gan-response.md deleted file mode 100644 index d521ed5a..00000000 --- a/doc/models/retrieve-gift-card-from-gan-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Gift Card From GAN Response - -A response that contains a `GiftCard`. This response might contain a set of `Error` objects -if the request resulted in errors. - -## Structure - -`RetrieveGiftCardFromGANResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 5000, - "currency": "USD" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gan": "7783320001001635", - "gan_source": "SQUARE", - "id": "gftc:6944163553804e439d89adb47caf806a", - "state": "ACTIVE", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-gift-card-from-nonce-request.md b/doc/models/retrieve-gift-card-from-nonce-request.md deleted file mode 100644 index 9eaa1b36..00000000 --- a/doc/models/retrieve-gift-card-from-nonce-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Gift Card From Nonce Request - -A request to retrieve a gift card by using a payment token. - -## Structure - -`RetrieveGiftCardFromNonceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `nonce` | `string` | Required | The payment token of the gift card to retrieve. Payment tokens are generated by the
Web Payments SDK or In-App Payments SDK.
**Constraints**: *Minimum Length*: `1` | getNonce(): string | setNonce(string nonce): void | - -## Example (as JSON) - -```json -{ - "nonce": "cnon:7783322135245171" -} -``` - diff --git a/doc/models/retrieve-gift-card-from-nonce-response.md b/doc/models/retrieve-gift-card-from-nonce-response.md deleted file mode 100644 index 35ca90c4..00000000 --- a/doc/models/retrieve-gift-card-from-nonce-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Retrieve Gift Card From Nonce Response - -A response that contains a `GiftCard` object. If the request resulted in errors, -the response contains a set of `Error` objects. - -## Structure - -`RetrieveGiftCardFromNonceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 5000, - "currency": "USD" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gan": "7783320001001635", - "gan_source": "SQUARE", - "id": "gftc:6944163553804e439d89adb47caf806a", - "state": "ACTIVE", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-gift-card-response.md b/doc/models/retrieve-gift-card-response.md deleted file mode 100644 index df804752..00000000 --- a/doc/models/retrieve-gift-card-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Retrieve Gift Card Response - -A response that contains a `GiftCard`. The response might contain a set of `Error` objects -if the request resulted in errors. - -## Structure - -`RetrieveGiftCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 1000, - "currency": "USD" - }, - "created_at": "2021-05-20T22:26:54.000Z", - "gan": "7783320001001635", - "gan_source": "SQUARE", - "id": "gftc:00113070ba5745f0b2377c1b9570cb03", - "state": "ACTIVE", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-inventory-adjustment-response.md b/doc/models/retrieve-inventory-adjustment-response.md deleted file mode 100644 index 530f9de8..00000000 --- a/doc/models/retrieve-inventory-adjustment-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Inventory Adjustment Response - -## Structure - -`RetrieveInventoryAdjustmentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `adjustment` | [`?InventoryAdjustment`](../../doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | getAdjustment(): ?InventoryAdjustment | setAdjustment(?InventoryAdjustment adjustment): void | - -## Example (as JSON) - -```json -{ - "adjustment": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "created_at": "2016-11-17T13:02:15.142Z", - "from_state": "IN_STOCK", - "id": "UDMOEO78BG6GYWA2XDRYX3KB", - "location_id": "C6W5YS5QM06F5", - "occurred_at": "2016-11-16T25:44:22.837Z", - "quantity": "7", - "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", - "source": { - "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - "name": "Square Point of Sale 4.37", - "product": "SQUARE_POS" - }, - "team_member_id": "LRK57NSQ5X7PUD05", - "to_state": "SOLD", - "total_price_money": { - "amount": 4550, - "currency": "USD" - } - }, - "errors": [] -} -``` - diff --git a/doc/models/retrieve-inventory-changes-request.md b/doc/models/retrieve-inventory-changes-request.md deleted file mode 100644 index ee390e35..00000000 --- a/doc/models/retrieve-inventory-changes-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Inventory Changes Request - -## Structure - -`RetrieveInventoryChangesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `?string` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_ids": "location_ids2", - "cursor": "cursor4" -} -``` - diff --git a/doc/models/retrieve-inventory-changes-response.md b/doc/models/retrieve-inventory-changes-response.md deleted file mode 100644 index 13b961af..00000000 --- a/doc/models/retrieve-inventory-changes-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# Retrieve Inventory Changes Response - -## Structure - -`RetrieveInventoryChangesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `changes` | [`?(InventoryChange[])`](../../doc/models/inventory-change.md) | Optional | The set of inventory changes for the requested object and locations. | getChanges(): ?array | setChanges(?array changes): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "changes": [ - { - "adjustment": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "created_at": "2016-11-16T22:25:24.878Z", - "from_state": "IN_STOCK", - "id": "OJKJIUANKLMLQANZADNPLKAD", - "location_id": "C6W5YS5QM06F5", - "occurred_at": "2016-11-16T22:25:24.878Z", - "quantity": "3", - "reference_id": "d8207693-168f-4b44-a2fd-a7ff533ddd26", - "source": { - "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - "name": "Square Point of Sale 4.37", - "product": "SQUARE_POS" - }, - "team_member_id": "AV7YRCGI2H1J5NQ8E1XIZCNA", - "to_state": "SOLD", - "total_price_money": { - "amount": 5000, - "currency": "USD" - }, - "transaction_id": "5APV6JYK1SNCZD11AND2RX1Z" - }, - "type": "ADJUSTMENT", - "physical_count": { - "id": "id2", - "reference_id": "reference_id0", - "catalog_object_id": "catalog_object_id6", - "catalog_object_type": "catalog_object_type6", - "state": "SUPPORTED_BY_NEWER_VERSION" - }, - "transfer": { - "id": "id8", - "reference_id": "reference_id6", - "state": "RESERVED_FOR_SALE", - "from_location_id": "from_location_id0", - "to_location_id": "to_location_id0" - }, - "measurement_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 184 - } - } - ], - "errors": [], - "cursor": "cursor0" -} -``` - diff --git a/doc/models/retrieve-inventory-count-request.md b/doc/models/retrieve-inventory-count-request.md deleted file mode 100644 index fc4bc0da..00000000 --- a/doc/models/retrieve-inventory-count-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Inventory Count Request - -## Structure - -`RetrieveInventoryCountRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `?string` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "location_ids": "location_ids4", - "cursor": "cursor8" -} -``` - diff --git a/doc/models/retrieve-inventory-count-response.md b/doc/models/retrieve-inventory-count-response.md deleted file mode 100644 index 5301f525..00000000 --- a/doc/models/retrieve-inventory-count-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Retrieve Inventory Count Response - -## Structure - -`RetrieveInventoryCountResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `counts` | [`?(InventoryCount[])`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested object and
locations. | getCounts(): ?array | setCounts(?array counts): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "counts": [ - { - "calculated_at": "2016-11-16T22:28:01.223Z", - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "location_id": "C6W5YS5QM06F5", - "quantity": "22", - "state": "IN_STOCK" - } - ], - "errors": [], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/retrieve-inventory-physical-count-response.md b/doc/models/retrieve-inventory-physical-count-response.md deleted file mode 100644 index a17381c1..00000000 --- a/doc/models/retrieve-inventory-physical-count-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Retrieve Inventory Physical Count Response - -## Structure - -`RetrieveInventoryPhysicalCountResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `count` | [`?InventoryPhysicalCount`](../../doc/models/inventory-physical-count.md) | Optional | Represents the quantity of an item variation that is physically present
at a specific location, verified by a seller or a seller's employee. For example,
a physical count might come from an employee counting the item variations on
hand or from syncing with an external system. | getCount(): ?InventoryPhysicalCount | setCount(?InventoryPhysicalCount count): void | - -## Example (as JSON) - -```json -{ - "count": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "created_at": "2016-11-16T22:25:24.878Z", - "id": "ANZADNPLKADOJKJIUANKLMLQ", - "location_id": "C6W5YS5QM06F5", - "occurred_at": "2016-11-16T22:25:24.878Z", - "quantity": "15", - "reference_id": "f857ec37-f9a0-4458-8e23-5b5e0bea4e53", - "source": { - "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - "name": "Square Point of Sale 4.37", - "product": "SQUARE_POS" - }, - "state": "IN_STOCK", - "team_member_id": "LRK57NSQ5X7PUD05" - }, - "errors": [] -} -``` - diff --git a/doc/models/retrieve-inventory-transfer-response.md b/doc/models/retrieve-inventory-transfer-response.md deleted file mode 100644 index 344e0d6a..00000000 --- a/doc/models/retrieve-inventory-transfer-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Retrieve Inventory Transfer Response - -## Structure - -`RetrieveInventoryTransferResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `transfer` | [`?InventoryTransfer`](../../doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | getTransfer(): ?InventoryTransfer | setTransfer(?InventoryTransfer transfer): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "transfer": { - "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", - "catalog_object_type": "ITEM_VARIATION", - "created_at": "2016-11-17T13:02:15.142Z", - "from_location_id": "C6W5YS5QM06F5", - "id": "UDMOEO78BG6GYWA2XDRYX3KB", - "occurred_at": "2016-11-16T25:44:22.837Z", - "quantity": "7", - "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", - "source": { - "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - "name": "Square Point of Sale 4.37", - "product": "SQUARE_POS" - }, - "state": "IN_STOCK", - "team_member_id": "LRK57NSQ5X7PUD05", - "to_location_id": "59TNP9SA8VGDA" - } -} -``` - diff --git a/doc/models/retrieve-job-response.md b/doc/models/retrieve-job-response.md deleted file mode 100644 index 05df5b30..00000000 --- a/doc/models/retrieve-job-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Retrieve Job Response - -Represents a [RetrieveJob](../../doc/apis/team.md#retrieve-job) response. Either `job` or `errors` -is present in the response. - -## Structure - -`RetrieveJobResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `job` | [`?Job`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | getJob(): ?Job | setJob(?Job job): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "job": { - "created_at": "2021-06-11T22:55:45Z", - "id": "1yJlHapkseYnNPETIU1B", - "is_tip_eligible": true, - "title": "Cashier 1", - "updated_at": "2021-06-11T22:55:45Z", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-location-booking-profile-response.md b/doc/models/retrieve-location-booking-profile-response.md deleted file mode 100644 index ba83d810..00000000 --- a/doc/models/retrieve-location-booking-profile-response.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Retrieve Location Booking Profile Response - -## Structure - -`RetrieveLocationBookingProfileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationBookingProfile` | [`?LocationBookingProfile`](../../doc/models/location-booking-profile.md) | Optional | The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. | getLocationBookingProfile(): ?LocationBookingProfile | setLocationBookingProfile(?LocationBookingProfile locationBookingProfile): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "location_booking_profile": { - "booking_enabled": true, - "booking_site_url": "https://square.site/book/L3HETDGYQ4A2C/prod-business", - "location_id": "L3HETDGYQ4A2C", - "online_booking_enabled": false - } -} -``` - diff --git a/doc/models/retrieve-location-custom-attribute-definition-request.md b/doc/models/retrieve-location-custom-attribute-definition-request.md deleted file mode 100644 index ccfde32c..00000000 --- a/doc/models/retrieve-location-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Location Custom Attribute Definition Request - -Represents a [RetrieveLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute-definition) request. - -## Structure - -`RetrieveLocationCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 50 -} -``` - diff --git a/doc/models/retrieve-location-custom-attribute-definition-response.md b/doc/models/retrieve-location-custom-attribute-definition-response.md deleted file mode 100644 index 0ac58449..00000000 --- a/doc/models/retrieve-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Retrieve Location Custom Attribute Definition Response - -Represents a [RetrieveLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveLocationCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-12-02T19:06:36.559Z", - "description": "Bestselling item at location", - "key": "bestseller", - "name": "Bestseller", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-12-02T19:06:36.559Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-location-custom-attribute-request.md b/doc/models/retrieve-location-custom-attribute-request.md deleted file mode 100644 index 1dc56e6c..00000000 --- a/doc/models/retrieve-location-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Location Custom Attribute Request - -Represents a [RetrieveLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute) request. - -## Structure - -`RetrieveLocationCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `withDefinition` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinition(): ?bool | setWithDefinition(?bool withDefinition): void | -| `version` | `?int` | Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "with_definition": false, - "version": 84 -} -``` - diff --git a/doc/models/retrieve-location-custom-attribute-response.md b/doc/models/retrieve-location-custom-attribute-response.md deleted file mode 100644 index af9a3764..00000000 --- a/doc/models/retrieve-location-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Retrieve Location Custom Attribute Response - -Represents a [RetrieveLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#retrieve-location-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveLocationCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-location-response.md b/doc/models/retrieve-location-response.md deleted file mode 100644 index 1985076e..00000000 --- a/doc/models/retrieve-location-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Retrieve Location Response - -Defines the fields that the [RetrieveLocation](../../doc/apis/locations.md#retrieve-location) -endpoint returns in a response. - -## Structure - -`RetrieveLocationResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `location` | [`?Location`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | getLocation(): ?Location | setLocation(?Location location): void | - -## Example (as JSON) - -```json -{ - "location": { - "address": { - "address_line_1": "123 Main St", - "administrative_district_level_1": "CA", - "country": "US", - "locality": "San Francisco", - "postal_code": "94114", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "business_name": "Jet Fuel Coffee", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ], - "country": "US", - "created_at": "2016-09-19T17:33:12Z", - "currency": "USD", - "id": "18YC4JDH91E1H", - "language_code": "en-US", - "merchant_id": "3MYCJG5GVYQ8Q", - "name": "Grant Park", - "phone_number": "+1 650-354-7217", - "status": "ACTIVE", - "timezone": "America/Los_Angeles" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-location-settings-response.md b/doc/models/retrieve-location-settings-response.md deleted file mode 100644 index d6a72c97..00000000 --- a/doc/models/retrieve-location-settings-response.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Retrieve Location Settings Response - -## Structure - -`RetrieveLocationSettingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `locationSettings` | [`?CheckoutLocationSettings`](../../doc/models/checkout-location-settings.md) | Optional | - | getLocationSettings(): ?CheckoutLocationSettings | setLocationSettings(?CheckoutLocationSettings locationSettings): void | - -## Example (as JSON) - -```json -{ - "location_settings": { - "branding": { - "button_color": "#ffffff", - "button_shape": "ROUNDED", - "header_type": "FRAMED_LOGO" - }, - "customer_notes_enabled": true, - "location_id": "LOCATION_ID_1", - "policies": [ - { - "description": "This is my Return Policy", - "title": "Return Policy", - "uid": "POLICY_ID_1" - } - ], - "tipping": { - "default_percent": 15, - "default_whole_amount_money": { - "amount": 100, - "currency": "USD" - }, - "percentages": [ - 10, - 15, - 20 - ], - "smart_tipping_enabled": true, - "whole_amounts": [ - { - "amount": 1000, - "currency": "USD" - }, - { - "amount": 1500, - "currency": "USD" - }, - { - "amount": 2000, - "currency": "USD" - } - ], - "smart_tips": [ - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - } - ], - "default_smart_tip": { - "amount": 58, - "currency": "KWD" - } - }, - "updated_at": "2022-06-16T22:25:35Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-loyalty-account-response.md b/doc/models/retrieve-loyalty-account-response.md deleted file mode 100644 index 27dfcac4..00000000 --- a/doc/models/retrieve-loyalty-account-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Retrieve Loyalty Account Response - -A response that includes the loyalty account. - -## Structure - -`RetrieveLoyaltyAccountResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyAccount` | [`?LoyaltyAccount`](../../doc/models/loyalty-account.md) | Optional | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | getLoyaltyAccount(): ?LoyaltyAccount | setLoyaltyAccount(?LoyaltyAccount loyaltyAccount): void | - -## Example (as JSON) - -```json -{ - "loyalty_account": { - "balance": 10, - "created_at": "2020-05-08T21:44:32Z", - "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", - "id": "79b807d2-d786-46a9-933b-918028d7a8c5", - "lifetime_points": 20, - "mapping": { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234" - }, - "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "updated_at": "2020-05-08T21:44:32Z", - "enrolled_at": "enrolled_at6" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-loyalty-program-response.md b/doc/models/retrieve-loyalty-program-response.md deleted file mode 100644 index b1dba5f0..00000000 --- a/doc/models/retrieve-loyalty-program-response.md +++ /dev/null @@ -1,96 +0,0 @@ - -# Retrieve Loyalty Program Response - -A response that contains the loyalty program. - -## Structure - -`RetrieveLoyaltyProgramResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `program` | [`?LoyaltyProgram`](../../doc/models/loyalty-program.md) | Optional | Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards.
Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard.
For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). | getProgram(): ?LoyaltyProgram | setProgram(?LoyaltyProgram program): void | - -## Example (as JSON) - -```json -{ - "program": { - "accrual_rules": [ - { - "accrual_type": "SPEND", - "points": 1, - "spend_data": { - "amount_money": { - "amount": 100, - "currency": "USD" - }, - "excluded_category_ids": [ - "7ZERJKO5PVYXCVUHV2JCZ2UG", - "FQKAOJE5C4FIMF5A2URMLW6V" - ], - "excluded_item_variation_ids": [ - "CBZXBUVVTYUBZGQO44RHMR6B", - "EDILT24Z2NISEXDKGY6HP7XV" - ], - "tax_mode": "BEFORE_TAX" - } - } - ], - "created_at": "2020-04-20T16:55:11Z", - "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "location_ids": [ - "P034NEENMD09F" - ], - "reward_tiers": [ - { - "created_at": "2020-04-20T16:55:11Z", - "definition": { - "discount_type": "FIXED_PERCENTAGE", - "percentage_discount": "10", - "scope": "ORDER", - "catalog_object_ids": [ - "catalog_object_ids6" - ], - "fixed_discount_money": { - "amount": 36, - "currency": "SLL" - }, - "max_discount_money": { - "amount": 84, - "currency": "BOB" - } - }, - "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "name": "10% off entire sale", - "points": 10, - "pricing_rule_reference": { - "catalog_version": 1605486402527, - "object_id": "74C4JSHESNLTB2A7ITO5HO6F" - } - } - ], - "status": "ACTIVE", - "terminology": { - "one": "Point", - "other": "Points" - }, - "updated_at": "2020-05-01T02:00:02Z", - "expiration_policy": { - "expiration_duration": "expiration_duration0" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-loyalty-promotion-response.md b/doc/models/retrieve-loyalty-promotion-response.md deleted file mode 100644 index 0e1d3e61..00000000 --- a/doc/models/retrieve-loyalty-promotion-response.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Retrieve Loyalty Promotion Response - -Represents a [RetrieveLoyaltyPromotionPromotions](../../doc/apis/loyalty.md#retrieve-loyalty-promotion) response. - -## Structure - -`RetrieveLoyaltyPromotionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyPromotion` | [`?LoyaltyPromotion`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). Loyalty promotions enable buyers
to earn extra points on top of those earned from the base program.

A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. | getLoyaltyPromotion(): ?LoyaltyPromotion | setLoyaltyPromotion(?LoyaltyPromotion loyaltyPromotion): void | - -## Example (as JSON) - -```json -{ - "loyalty_promotion": { - "available_time": { - "start_date": "2022-08-16", - "time_periods": [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" - ], - "end_date": "end_date8" - }, - "created_at": "2022-08-16T08:38:54Z", - "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - "incentive": { - "points_multiplier_data": { - "multiplier": "3.000", - "points_multiplier": 3 - }, - "type": "POINTS_MULTIPLIER", - "points_addition_data": { - "points_addition": 218 - } - }, - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "minimum_spend_amount_money": { - "amount": 2000, - "currency": "USD" - }, - "name": "Tuesday Happy Hour Promo", - "qualifying_item_variation_ids": [ - "CJ3RYL56ITAKMD4VRCM7XERS", - "AT3RYLR3TUA9C34VRCB7X5RR" - ], - "status": "ACTIVE", - "trigger_limit": { - "interval": "DAY", - "times": 1 - }, - "updated_at": "2022-08-16T08:38:54Z", - "canceled_at": "canceled_at0" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-loyalty-reward-response.md b/doc/models/retrieve-loyalty-reward-response.md deleted file mode 100644 index 0f24ca9c..00000000 --- a/doc/models/retrieve-loyalty-reward-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Retrieve Loyalty Reward Response - -A response that includes the loyalty reward. - -## Structure - -`RetrieveLoyaltyRewardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `reward` | [`?LoyaltyReward`](../../doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state.
For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | - -## Example (as JSON) - -```json -{ - "reward": { - "created_at": "2020-05-08T21:55:42Z", - "id": "9f18ac21-233a-31c3-be77-b45840f5a810", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "points": 10, - "redeemed_at": "2020-05-08T21:56:00Z", - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "REDEEMED", - "updated_at": "2020-05-08T21:56:00Z", - "order_id": "order_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-merchant-custom-attribute-definition-request.md b/doc/models/retrieve-merchant-custom-attribute-definition-request.md deleted file mode 100644 index c2dd9d8e..00000000 --- a/doc/models/retrieve-merchant-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Merchant Custom Attribute Definition Request - -Represents a [RetrieveMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) request. - -## Structure - -`RetrieveMerchantCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The current version of the custom attribute definition, which is used for strongly consistent
reads to guarantee that you receive the most up-to-date data. When included in the request,
Square returns the specified version or a higher version if one exists. If the specified version
is higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 162 -} -``` - diff --git a/doc/models/retrieve-merchant-custom-attribute-definition-response.md b/doc/models/retrieve-merchant-custom-attribute-definition-response.md deleted file mode 100644 index 1153a2d1..00000000 --- a/doc/models/retrieve-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Retrieve Merchant Custom Attribute Definition Response - -Represents a [RetrieveMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveMerchantCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2023-05-05T19:06:36.559Z", - "description": "This is the other name this merchant goes by.", - "key": "alternative_seller_name", - "name": "Alternative Merchant Name", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2023-05-05T19:06:36.559Z", - "version": 1, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-merchant-custom-attribute-request.md b/doc/models/retrieve-merchant-custom-attribute-request.md deleted file mode 100644 index 5dd967ad..00000000 --- a/doc/models/retrieve-merchant-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Merchant Custom Attribute Request - -Represents a [RetrieveMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) request. - -## Structure - -`RetrieveMerchantCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `withDefinition` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
the custom attribute. Set this parameter to `true` to get the name and description of the custom
attribute, information about the data type, or other definition details. The default value is `false`. | getWithDefinition(): ?bool | setWithDefinition(?bool withDefinition): void | -| `version` | `?int` | Optional | The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a `BAD_REQUEST` error. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "with_definition": false, - "version": 52 -} -``` - diff --git a/doc/models/retrieve-merchant-custom-attribute-response.md b/doc/models/retrieve-merchant-custom-attribute-response.md deleted file mode 100644 index acafecc1..00000000 --- a/doc/models/retrieve-merchant-custom-attribute-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Retrieve Merchant Custom Attribute Response - -Represents a [RetrieveMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`RetrieveMerchantCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-merchant-response.md b/doc/models/retrieve-merchant-response.md deleted file mode 100644 index fe9d149d..00000000 --- a/doc/models/retrieve-merchant-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Retrieve Merchant Response - -The response object returned by the [RetrieveMerchant](../../doc/apis/merchants.md#retrieve-merchant) endpoint. - -## Structure - -`RetrieveMerchantResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `merchant` | [`?Merchant`](../../doc/models/merchant.md) | Optional | Represents a business that sells with Square. | getMerchant(): ?Merchant | setMerchant(?Merchant merchant): void | - -## Example (as JSON) - -```json -{ - "merchant": { - "business_name": "Apple A Day", - "country": "US", - "created_at": "2021-12-10T19:25:52.484Z", - "currency": "USD", - "id": "DM7VKY8Q63GNP", - "language_code": "en-US", - "main_location_id": "9A65CGC72ZQG1", - "status": "ACTIVE" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-merchant-settings-response.md b/doc/models/retrieve-merchant-settings-response.md deleted file mode 100644 index 980288ef..00000000 --- a/doc/models/retrieve-merchant-settings-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Retrieve Merchant Settings Response - -## Structure - -`RetrieveMerchantSettingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `merchantSettings` | [`?CheckoutMerchantSettings`](../../doc/models/checkout-merchant-settings.md) | Optional | - | getMerchantSettings(): ?CheckoutMerchantSettings | setMerchantSettings(?CheckoutMerchantSettings merchantSettings): void | - -## Example (as JSON) - -```json -{ - "merchant_settings": { - "merchant_id": "MERCHANT_ID", - "payment_methods": { - "afterpay_clearpay": { - "enabled": true, - "item_eligibility_range": { - "max": { - "amount": 10000, - "currency": "USD" - }, - "min": { - "amount": 100, - "currency": "USD" - } - }, - "order_eligibility_range": { - "max": { - "amount": 10000, - "currency": "USD" - }, - "min": { - "amount": 100, - "currency": "USD" - } - } - }, - "apple_pay": { - "enabled": true - }, - "cash_app_pay": { - "enabled": true - }, - "google_pay": { - "enabled": true - }, - "cash_app": { - "enabled": false - } - }, - "updated_at": "2022-06-16T22:25:35Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-order-custom-attribute-definition-request.md b/doc/models/retrieve-order-custom-attribute-definition-request.md deleted file mode 100644 index 7bde12bc..00000000 --- a/doc/models/retrieve-order-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Order Custom Attribute Definition Request - -Represents a get request for an order custom attribute definition. - -## Structure - -`RetrieveOrderCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control, include this optional field and specify the current version of the custom attribute. | getVersion(): ?int | setVersion(?int version): void | - -## Example (as JSON) - -```json -{ - "version": 142 -} -``` - diff --git a/doc/models/retrieve-order-custom-attribute-definition-response.md b/doc/models/retrieve-order-custom-attribute-definition-response.md deleted file mode 100644 index d3344331..00000000 --- a/doc/models/retrieve-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Order Custom Attribute Definition Response - -Represents a response from getting an order custom attribute definition. - -## Structure - -`RetrieveOrderCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-10-06T16:53:23.141Z", - "description": "The number of people seated at a table", - "key": "cover-count", - "name": "Cover count", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-10-06T16:53:23.141Z", - "version": 1, - "visibility": "VISIBILITY_READ_WRITE_VALUES" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-order-custom-attribute-request.md b/doc/models/retrieve-order-custom-attribute-request.md deleted file mode 100644 index d7de6bb5..00000000 --- a/doc/models/retrieve-order-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Order Custom Attribute Request - -Represents a get request for an order custom attribute. - -## Structure - -`RetrieveOrderCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control, include this optional field and specify the current version of the custom attribute. | getVersion(): ?int | setVersion(?int version): void | -| `withDefinition` | `?bool` | Optional | Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
custom attribute. Set this parameter to `true` to get the name and description of each custom attribute,
information about the data type, or other definition details. The default value is `false`. | getWithDefinition(): ?bool | setWithDefinition(?bool withDefinition): void | - -## Example (as JSON) - -```json -{ - "version": 110, - "with_definition": false -} -``` - diff --git a/doc/models/retrieve-order-custom-attribute-response.md b/doc/models/retrieve-order-custom-attribute-response.md deleted file mode 100644 index 9fe83066..00000000 --- a/doc/models/retrieve-order-custom-attribute-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Retrieve Order Custom Attribute Response - -Represents a response from getting an order custom attribute. - -## Structure - -`RetrieveOrderCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-order-response.md b/doc/models/retrieve-order-response.md deleted file mode 100644 index 8be86e8f..00000000 --- a/doc/models/retrieve-order-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Retrieve Order Response - -## Structure - -`RetrieveOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "order": { - "created_at": "2020-05-18T16:30:49.614Z", - "discounts": [ - { - "applied_money": { - "amount": 550, - "currency": "USD" - }, - "name": "50% Off", - "percentage": "50", - "scope": "ORDER", - "type": "FIXED_PERCENTAGE", - "uid": "zGsRZP69aqSSR9lq9euSPB" - } - ], - "id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "line_items": [ - { - "applied_discounts": [ - { - "applied_money": { - "amount": 250, - "currency": "USD" - }, - "discount_uid": "zGsRZP69aqSSR9lq9euSPB", - "uid": "9zr9S4dxvPAixvn0lpa1VC" - } - ], - "base_price_money": { - "amount": 500, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 500, - "currency": "USD" - }, - "name": "Item 1", - "quantity": "1", - "total_discount_money": { - "amount": 250, - "currency": "USD" - }, - "total_money": { - "amount": 250, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "ULkg0tQTRK2bkU9fNv3IJD", - "variation_total_price_money": { - "amount": 500, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "applied_discounts": [ - { - "applied_money": { - "amount": 300, - "currency": "USD" - }, - "discount_uid": "zGsRZP69aqSSR9lq9euSPB", - "uid": "qa8LwwZK82FgSEkQc2HYVC" - } - ], - "base_price_money": { - "amount": 300, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 600, - "currency": "USD" - }, - "name": "Item 2", - "quantity": "2", - "total_discount_money": { - "amount": 300, - "currency": "USD" - }, - "total_money": { - "amount": 300, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "mumY8Nun4BC5aKe2yyx5a", - "variation_total_price_money": { - "amount": 600, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "D7AVYMEAPJ3A3", - "net_amounts": { - "discount_money": { - "amount": 550, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 0, - "currency": "USD" - }, - "tip_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 550, - "currency": "USD" - } - }, - "state": "OPEN", - "total_discount_money": { - "amount": 550, - "currency": "USD" - }, - "total_money": { - "amount": 550, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "total_tip_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2020-05-18T16:30:49.614Z", - "version": 1, - "reference_id": "reference_id4", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-payment-link-response.md b/doc/models/retrieve-payment-link-response.md deleted file mode 100644 index e8453d04..00000000 --- a/doc/models/retrieve-payment-link-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Retrieve Payment Link Response - -## Structure - -`RetrievePaymentLinkResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `paymentLink` | [`?PaymentLink`](../../doc/models/payment-link.md) | Optional | - | getPaymentLink(): ?PaymentLink | setPaymentLink(?PaymentLink paymentLink): void | - -## Example (as JSON) - -```json -{ - "payment_link": { - "created_at": "2022-04-26T00:10:29Z", - "id": "LLO5Q3FRCFICDB4B", - "long_url": "https://checkout.square.site/EXAMPLE", - "order_id": "4uKASDATqSd1QQ9jV86sPhMdVEbSJc4F", - "url": "https://square.link/u/EXAMPLE", - "version": 1, - "description": "description2", - "checkout_options": { - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-snippet-response.md b/doc/models/retrieve-snippet-response.md deleted file mode 100644 index 65c35698..00000000 --- a/doc/models/retrieve-snippet-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Retrieve Snippet Response - -Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. - -## Structure - -`RetrieveSnippetResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `snippet` | [`?Snippet`](../../doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | - -## Example (as JSON) - -```json -{ - "snippet": { - "content": "", - "created_at": "2021-03-11T25:40:09.000000Z", - "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", - "site_id": "site_278075276488921835", - "updated_at": "2021-03-11T25:40:09.000000Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-subscription-request.md b/doc/models/retrieve-subscription-request.md deleted file mode 100644 index da406cd4..00000000 --- a/doc/models/retrieve-subscription-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Retrieve Subscription Request - -Defines input parameters in a request to the -[RetrieveSubscription](../../doc/apis/subscriptions.md#retrieve-subscription) endpoint. - -## Structure - -`RetrieveSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `include` | `?string` | Optional | A query parameter to specify related information to be included in the response.

The supported query parameter values are:

- `actions`: to include scheduled actions on the targeted subscription. | getInclude(): ?string | setInclude(?string include): void | - -## Example (as JSON) - -```json -{ - "include": "include2" -} -``` - diff --git a/doc/models/retrieve-subscription-response.md b/doc/models/retrieve-subscription-response.md deleted file mode 100644 index 57db90ad..00000000 --- a/doc/models/retrieve-subscription-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Retrieve Subscription Response - -Defines output parameters in a response from the -[RetrieveSubscription](../../doc/apis/subscriptions.md#retrieve-subscription) endpoint. - -## Structure - -`RetrieveSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "charged_through_date": "2023-11-20", - "created_at": "2022-07-27T21:53:10Z", - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", - "invoice_ids": [ - "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" - ], - "location_id": "S8GWD5R9QB376", - "paid_until_date": "2024-08-01", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "price_override_money": { - "amount": 25000, - "currency": "USD" - }, - "source": { - "name": "My Application" - }, - "start_date": "2022-07-27", - "status": "ACTIVE", - "timezone": "America/Los_Angeles" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-team-member-booking-profile-response.md b/doc/models/retrieve-team-member-booking-profile-response.md deleted file mode 100644 index fd016650..00000000 --- a/doc/models/retrieve-team-member-booking-profile-response.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Retrieve Team Member Booking Profile Response - -## Structure - -`RetrieveTeamMemberBookingProfileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberBookingProfile` | [`?TeamMemberBookingProfile`](../../doc/models/team-member-booking-profile.md) | Optional | The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider. | getTeamMemberBookingProfile(): ?TeamMemberBookingProfile | setTeamMemberBookingProfile(?TeamMemberBookingProfile teamMemberBookingProfile): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [], - "team_member_booking_profile": { - "display_name": "Sandbox Staff", - "is_bookable": true, - "team_member_id": "TMaJcbiRqPIGZuS9", - "description": "description2", - "profile_image_url": "profile_image_url8" - } -} -``` - diff --git a/doc/models/retrieve-team-member-response.md b/doc/models/retrieve-team-member-response.md deleted file mode 100644 index c3cd1ebe..00000000 --- a/doc/models/retrieve-team-member-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Retrieve Team Member Response - -Represents a response from a retrieve request containing a `TeamMember` object or error messages. - -## Structure - -`RetrieveTeamMemberResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMember` | [`?TeamMember`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | getTeamMember(): ?TeamMember | setTeamMember(?TeamMember teamMember): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "GA2Y9HSJ8KRYT", - "YSGH2WBKG94QZ" - ] - }, - "created_at": "2021-06-11T22:55:45Z", - "email_address": "joe_doe@example.com", - "family_name": "Doe", - "given_name": "Joe", - "id": "1yJlHapkseYnNPETIU1B", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "updated_at": "2021-06-15T17:38:05Z", - "wage_setting": { - "created_at": "2021-06-11T22:55:45Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 1443, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "1yJlHapkseYnNPETIU1B", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-token-status-response.md b/doc/models/retrieve-token-status-response.md deleted file mode 100644 index f4bef6c2..00000000 --- a/doc/models/retrieve-token-status-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Retrieve Token Status Response - -Defines the fields that are included in the response body of -a request to the `RetrieveTokenStatus` endpoint. - -## Structure - -`RetrieveTokenStatusResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `scopes` | `?(string[])` | Optional | The list of scopes associated with an access token. | getScopes(): ?array | setScopes(?array scopes): void | -| `expiresAt` | `?string` | Optional | The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `clientId` | `?string` | Optional | The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | -| `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "client_id": "CLIENT_ID", - "expires_at": "2022-10-14T14:44:00Z", - "merchant_id": "MERCHANT_ID", - "scopes": [ - "PAYMENTS_READ", - "PAYMENTS_WRITE" - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-transaction-response.md b/doc/models/retrieve-transaction-response.md deleted file mode 100644 index 37b1b4ce..00000000 --- a/doc/models/retrieve-transaction-response.md +++ /dev/null @@ -1,190 +0,0 @@ - -# Retrieve Transaction Response - -Defines the fields that are included in the response body of -a request to the [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) endpoint. - -One of `errors` or `transaction` is present in a given response (never both). - -## Structure - -`RetrieveTransactionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `transaction` | [`?Transaction`](../../doc/models/transaction.md) | Optional | Represents a transaction processed with Square, either with the
Connect API or with Square Point of Sale.

The `tenders` field of this object lists all methods of payment used to pay in
the transaction. | getTransaction(): ?Transaction | setTransaction(?Transaction transaction): void | - -## Example (as JSON) - -```json -{ - "transaction": { - "created_at": "2016-03-10T22:57:56Z", - "id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "location_id": "18YC4JDH91E1H", - "product": "EXTERNAL_API", - "reference_id": "some optional reference id", - "tenders": [ - { - "additional_recipients": [ - { - "amount_money": { - "amount": 20, - "currency": "USD" - }, - "description": "Application fees", - "location_id": "057P5VYJ4A5X1" - } - ], - "amount_money": { - "amount": 5000, - "currency": "USD" - }, - "card_details": { - "card": { - "card_brand": "VISA", - "last_4": "1111" - }, - "entry_method": "KEYED", - "status": "CAPTURED" - }, - "created_at": "2016-03-10T22:57:56Z", - "id": "MtZRYYdDrYNQbOvV7nbuBvMF", - "location_id": "18YC4JDH91E1H", - "note": "some optional note", - "processing_fee_money": { - "amount": 138, - "currency": "USD" - }, - "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", - "type": "CARD" - } - ], - "refunds": [ - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-vendor-response.md b/doc/models/retrieve-vendor-response.md deleted file mode 100644 index 44ef8376..00000000 --- a/doc/models/retrieve-vendor-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Vendor Response - -Represents an output from a call to [RetrieveVendor](../../doc/apis/vendors.md#retrieve-vendor). - -## Structure - -`RetrieveVendorResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | getErrors(): ?array | setErrors(?array errors): void | -| `vendor` | [`?Vendor`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | getVendor(): ?Vendor | setVendor(?Vendor vendor): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendor": { - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2", - "name": "name6", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } -} -``` - diff --git a/doc/models/retrieve-wage-setting-response.md b/doc/models/retrieve-wage-setting-response.md deleted file mode 100644 index c95200f3..00000000 --- a/doc/models/retrieve-wage-setting-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Retrieve Wage Setting Response - -Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. - -## Structure - -`RetrieveWageSettingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `wageSetting` | [`?WageSetting`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | getWageSetting(): ?WageSetting | setWageSetting(?WageSetting wageSetting): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "wage_setting": { - "created_at": "2020-06-11T23:01:21+00:00", - "is_overtime_exempt": false, - "job_assignments": [ - { - "annual_rate": { - "amount": 4500000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 2164, - "currency": "USD" - }, - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40, - "job_id": "job_id2" - } - ], - "team_member_id": "1yJlHapkseYnNPETIU1B", - "updated_at": "2020-06-11T23:01:21+00:00", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/retrieve-webhook-subscription-response.md b/doc/models/retrieve-webhook-subscription-response.md deleted file mode 100644 index 4082ca37..00000000 --- a/doc/models/retrieve-webhook-subscription-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Retrieve Webhook Subscription Response - -Defines the fields that are included in the response body of -a request to the [RetrieveWebhookSubscription](../../doc/apis/webhook-subscriptions.md#retrieve-webhook-subscription) endpoint. - -Note: if there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) will not be -present. - -## Structure - -`RetrieveWebhookSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?WebhookSubscription`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscription(): ?WebhookSubscription | setSubscription(?WebhookSubscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "api_version": "2021-12-15", - "created_at": "2022-01-10 23:29:48 +0000 UTC", - "enabled": true, - "event_types": [ - "payment.created", - "payment.updated" - ], - "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", - "name": "Example Webhook Subscription", - "notification_url": "https://example-webhook-url.com", - "signature_key": "1k9bIJKCeTmSQwyagtNRLg", - "updated_at": "2022-01-10 23:29:48 +0000 UTC" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/revoke-token-request.md b/doc/models/revoke-token-request.md deleted file mode 100644 index fe35e80e..00000000 --- a/doc/models/revoke-token-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Revoke Token Request - -## Structure - -`RevokeTokenRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `clientId` | `?string` | Optional | The Square-issued ID for your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | -| `accessToken` | `?string` | Optional | The access token of the merchant whose token you want to revoke.
Do not provide a value for `merchant_id` if you provide this parameter.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void | -| `merchantId` | `?string` | Optional | The ID of the merchant whose token you want to revoke.
Do not provide a value for `access_token` if you provide this parameter. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | -| `revokeOnlyAccessToken` | `?bool` | Optional | If `true`, terminate the given single access token, but do not
terminate the entire authorization.
Default: `false` | getRevokeOnlyAccessToken(): ?bool | setRevokeOnlyAccessToken(?bool revokeOnlyAccessToken): void | - -## Example (as JSON) - -```json -{ - "access_token": "ACCESS_TOKEN", - "client_id": "CLIENT_ID", - "merchant_id": "merchant_id8", - "revoke_only_access_token": false -} -``` - diff --git a/doc/models/revoke-token-response.md b/doc/models/revoke-token-response.md deleted file mode 100644 index dc5c8b61..00000000 --- a/doc/models/revoke-token-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Revoke Token Response - -## Structure - -`RevokeTokenResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `success` | `?bool` | Optional | If the request is successful, this is `true`. | getSuccess(): ?bool | setSuccess(?bool success): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "success": true, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/risk-evaluation-risk-level.md b/doc/models/risk-evaluation-risk-level.md deleted file mode 100644 index 618df328..00000000 --- a/doc/models/risk-evaluation-risk-level.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Risk Evaluation Risk Level - -## Enumeration - -`RiskEvaluationRiskLevel` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | Indicates Square is still evaluating the payment. | -| `NORMAL` | Indicates payment risk is within the normal range. | -| `MODERATE` | Indicates elevated risk level associated with the payment. | -| `HIGH` | Indicates significantly elevated risk level with the payment. | - diff --git a/doc/models/risk-evaluation.md b/doc/models/risk-evaluation.md deleted file mode 100644 index 9536c8d7..00000000 --- a/doc/models/risk-evaluation.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Risk Evaluation - -Represents fraud risk information for the associated payment. - -When you take a payment through Square's Payments API (using the `CreatePayment` -endpoint), Square evaluates it and assigns a risk level to the payment. Sellers -can use this information to determine the course of action (for example, -provide the goods/services or refund the payment). - -## Structure - -`RiskEvaluation` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `createdAt` | `?string` | Optional | The timestamp when payment risk was evaluated, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `riskLevel` | [`?string(RiskEvaluationRiskLevel)`](../../doc/models/risk-evaluation-risk-level.md) | Optional | - | getRiskLevel(): ?string | setRiskLevel(?string riskLevel): void | - -## Example (as JSON) - -```json -{ - "created_at": "created_at0", - "risk_level": "MODERATE" -} -``` - diff --git a/doc/models/save-card-options.md b/doc/models/save-card-options.md deleted file mode 100644 index f08b2d33..00000000 --- a/doc/models/save-card-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Save Card Options - -Describes save-card action fields. - -## Structure - -`SaveCardOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `string` | Required | The square-assigned ID of the customer linked to the saved card. | getCustomerId(): string | setCustomerId(string customerId): void | -| `cardId` | `?string` | Optional | The id of the created card-on-file.
**Constraints**: *Maximum Length*: `64` | getCardId(): ?string | setCardId(?string cardId): void | -| `referenceId` | `?string` | Optional | An optional user-defined reference ID that can be used to associate
this `Card` to another entity in an external system. For example, a customer
ID generated by a third-party system.
**Constraints**: *Maximum Length*: `128` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | - -## Example (as JSON) - -```json -{ - "customer_id": "customer_id4", - "card_id": "card_id8", - "reference_id": "reference_id6" -} -``` - diff --git a/doc/models/search-availability-filter.md b/doc/models/search-availability-filter.md deleted file mode 100644 index c3e47966..00000000 --- a/doc/models/search-availability-filter.md +++ /dev/null @@ -1,71 +0,0 @@ - -# Search Availability Filter - -A query filter to search for buyer-accessible availabilities by. - -## Structure - -`SearchAvailabilityFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startAtRange` | [`TimeRange`](../../doc/models/time-range.md) | Required | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getStartAtRange(): TimeRange | setStartAtRange(TimeRange startAtRange): void | -| `locationId` | `?string` | Optional | The query expression to search for buyer-accessible availabilities with their location IDs matching the specified location ID.
This query expression cannot be set if `booking_id` is set.
**Constraints**: *Maximum Length*: `32` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `segmentFilters` | [`?(SegmentFilter[])`](../../doc/models/segment-filter.md) | Optional | The query expression to search for buyer-accessible availabilities matching the specified list of segment filters.
If the size of the `segment_filters` list is `n`, the search returns availabilities with `n` segments per availability.

This query expression cannot be set if `booking_id` is set. | getSegmentFilters(): ?array | setSegmentFilters(?array segmentFilters): void | -| `bookingId` | `?string` | Optional | The query expression to search for buyer-accessible availabilities for an existing booking by matching the specified `booking_id` value.
This is commonly used to reschedule an appointment.
If this expression is set, the `location_id` and `segment_filters` expressions cannot be set.
**Constraints**: *Maximum Length*: `36` | getBookingId(): ?string | setBookingId(?string bookingId): void | - -## Example (as JSON) - -```json -{ - "start_at_range": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "location_id": "location_id8", - "segment_filters": [ - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - }, - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - } - ], - "booking_id": "booking_id8" -} -``` - diff --git a/doc/models/search-availability-query.md b/doc/models/search-availability-query.md deleted file mode 100644 index db8f7381..00000000 --- a/doc/models/search-availability-query.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Availability Query - -The query used to search for buyer-accessible availabilities of bookings. - -## Structure - -`SearchAvailabilityQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`SearchAvailabilityFilter`](../../doc/models/search-availability-filter.md) | Required | A query filter to search for buyer-accessible availabilities by. | getFilter(): SearchAvailabilityFilter | setFilter(SearchAvailabilityFilter filter): void | - -## Example (as JSON) - -```json -{ - "filter": { - "start_at_range": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "location_id": "location_id8", - "segment_filters": [ - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - }, - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - }, - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - } - ], - "booking_id": "booking_id8" - } -} -``` - diff --git a/doc/models/search-availability-request.md b/doc/models/search-availability-request.md deleted file mode 100644 index 3ef5b4e9..00000000 --- a/doc/models/search-availability-request.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Availability Request - -## Structure - -`SearchAvailabilityRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`SearchAvailabilityQuery`](../../doc/models/search-availability-query.md) | Required | The query used to search for buyer-accessible availabilities of bookings. | getQuery(): SearchAvailabilityQuery | setQuery(SearchAvailabilityQuery query): void | - -## Example (as JSON) - -```json -{ - "query": { - "filter": { - "start_at_range": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "location_id": "location_id8", - "segment_filters": [ - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - }, - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - }, - { - "service_variation_id": "service_variation_id4", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } - } - ], - "booking_id": "booking_id8" - } - } -} -``` - diff --git a/doc/models/search-availability-response.md b/doc/models/search-availability-response.md deleted file mode 100644 index fcf8fc51..00000000 --- a/doc/models/search-availability-response.md +++ /dev/null @@ -1,276 +0,0 @@ - -# Search Availability Response - -## Structure - -`SearchAvailabilityResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `availabilities` | [`?(Availability[])`](../../doc/models/availability.md) | Optional | List of appointment slots available for booking. | getAvailabilities(): ?array | setAvailabilities(?array availabilities): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "availabilities": [ - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T13:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T13:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T14:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T14:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T15:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T15:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-26T16:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T09:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T09:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T10:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T10:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T11:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T11:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T12:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T12:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T13:00:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T13:30:00Z" - }, - { - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMaJcbiRqPIGZuS9", - "intermission_minutes": 54, - "any_team_member": false - } - ], - "location_id": "LEQHH0YY8B42M", - "start_at": "2020-11-27T14:00:00Z" - } - ], - "errors": [] -} -``` - diff --git a/doc/models/search-catalog-items-request-stock-level.md b/doc/models/search-catalog-items-request-stock-level.md deleted file mode 100644 index e0a17df8..00000000 --- a/doc/models/search-catalog-items-request-stock-level.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Search Catalog Items Request Stock Level - -Defines supported stock levels of the item inventory. - -## Enumeration - -`SearchCatalogItemsRequestStockLevel` - -## Fields - -| Name | Description | -| --- | --- | -| `OUT` | The item inventory is empty. | -| `LOW` | The item inventory is low. | - diff --git a/doc/models/search-catalog-items-request.md b/doc/models/search-catalog-items-request.md deleted file mode 100644 index 77519e36..00000000 --- a/doc/models/search-catalog-items-request.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Search Catalog Items Request - -Defines the request body for the [SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items) endpoint. - -## Structure - -`SearchCatalogItemsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `textFilter` | `?string` | Optional | The text filter expression to return items or item variations containing specified text in
the `name`, `description`, or `abbreviation` attribute value of an item, or in
the `name`, `sku`, or `upc` attribute value of an item variation. | getTextFilter(): ?string | setTextFilter(?string textFilter): void | -| `categoryIds` | `?(string[])` | Optional | The category id query expression to return items containing the specified category IDs. | getCategoryIds(): ?array | setCategoryIds(?array categoryIds): void | -| `stockLevels` | [`?(string(SearchCatalogItemsRequestStockLevel)[])`](../../doc/models/search-catalog-items-request-stock-level.md) | Optional | The stock-level query expression to return item variations with the specified stock levels.
See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values | getStockLevels(): ?array | setStockLevels(?array stockLevels): void | -| `enabledLocationIds` | `?(string[])` | Optional | The enabled-location query expression to return items and item variations having specified enabled locations. | getEnabledLocationIds(): ?array | setEnabledLocationIds(?array enabledLocationIds): void | -| `cursor` | `?string` | Optional | The pagination token, returned in the previous response, used to fetch the next batch of pending results. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return per page. The default value is 100.
**Constraints**: `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `productTypes` | [`?(string(CatalogItemProductType)[])`](../../doc/models/catalog-item-product-type.md) | Optional | The product types query expression to return items or item variations having the specified product types. | getProductTypes(): ?array | setProductTypes(?array productTypes): void | -| `customAttributeFilters` | [`?(CustomAttributeFilter[])`](../../doc/models/custom-attribute-filter.md) | Optional | The customer-attribute filter to return items or item variations matching the specified
custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in
a single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. | getCustomAttributeFilters(): ?array | setCustomAttributeFilters(?array customAttributeFilters): void | -| `archivedState` | [`?string(ArchivedState)`](../../doc/models/archived-state.md) | Optional | Defines the values for the `archived_state` query expression
used in [SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items)
to return the archived, not archived or either type of catalog items. | getArchivedState(): ?string | setArchivedState(?string archivedState): void | - -## Example (as JSON) - -```json -{ - "category_ids": [ - "WINE_CATEGORY_ID" - ], - "custom_attribute_filters": [ - { - "bool_filter": true, - "custom_attribute_definition_id": "VEGAN_DEFINITION_ID" - }, - { - "custom_attribute_definition_id": "BRAND_DEFINITION_ID", - "string_filter": "Dark Horse" - }, - { - "key": "VINTAGE", - "number_filter": { - "max": "2018", - "min": "2017" - } - }, - { - "custom_attribute_definition_id": "VARIETAL_DEFINITION_ID", - "selection_ids_filter": "MERLOT_SELECTION_ID" - } - ], - "enabled_location_ids": [ - "ATL_LOCATION_ID" - ], - "limit": 100, - "product_types": [ - "REGULAR" - ], - "sort_order": "ASC", - "stock_levels": [ - "OUT", - "LOW" - ], - "text_filter": "red", - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-catalog-items-response.md b/doc/models/search-catalog-items-response.md deleted file mode 100644 index b08e576c..00000000 --- a/doc/models/search-catalog-items-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Catalog Items Response - -Defines the response body returned from the [SearchCatalogItems](../../doc/apis/catalog.md#search-catalog-items) endpoint. - -## Structure - -`SearchCatalogItemsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `items` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | Returned items matching the specified query expressions. | getItems(): ?array | setItems(?array items): void | -| `cursor` | `?string` | Optional | Pagination token used in the next request to return more of the search result. | getCursor(): ?string | setCursor(?string cursor): void | -| `matchedVariationIds` | `?(string[])` | Optional | Ids of returned item variations matching the specified query expression. | getMatchedVariationIds(): ?array | setMatchedVariationIds(?array matchedVariationIds): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "items": [ - { - "type": "SUBSCRIPTION_PLAN", - "id": "id8", - "updated_at": "updated_at6", - "version": 38, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "cursor": "cursor2", - "matched_variation_ids": [ - "matched_variation_ids3" - ] -} -``` - diff --git a/doc/models/search-catalog-objects-request.md b/doc/models/search-catalog-objects-request.md deleted file mode 100644 index a7f70bc9..00000000 --- a/doc/models/search-catalog-objects-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Search Catalog Objects Request - -## Structure - -`SearchCatalogObjectsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `objectTypes` | [`?(string(CatalogObjectType)[])`](../../doc/models/catalog-object-type.md) | Optional | The desired set of object types to appear in the search results.

If this is unspecified, the operation returns objects of all the top level types at the version
of the Square API used to make the request. Object types that are nested onto other object types
are not included in the defaults.

At the current API version the default object types are:
ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,
PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,
SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.

Note that if you wish for the query to return objects belonging to nested types (i.e., COMPONENT, IMAGE,
ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of interest
in this field. | getObjectTypes(): ?array | setObjectTypes(?array objectTypes): void | -| `includeDeletedObjects` | `?bool` | Optional | If `true`, deleted objects will be included in the results. Deleted objects will have their
`is_deleted` field set to `true`. | getIncludeDeletedObjects(): ?bool | setIncludeDeletedObjects(?bool includeDeletedObjects): void | -| `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are objects that are referenced by object ID by the objects
in the response. This is helpful if the objects are being fetched for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included.
For example:

If the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | -| `beginTime` | `?string` | Optional | Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339
format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a
timestamp equal to `begin_time` will not be included in the response. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `query` | [`?CatalogQuery`](../../doc/models/catalog-query.md) | Optional | A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](../../doc/apis/catalog.md#search-catalog-objects).
Any combination of the following types may be used together:

- [exact_query](../../doc/models/catalog-query-exact.md)
- [prefix_query](../../doc/models/catalog-query-prefix.md)
- [range_query](../../doc/models/catalog-query-range.md)
- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md)
- [text_query](../../doc/models/catalog-query-text.md)

All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

Searchable attribute and objects queryable by searchable attributes:

- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](../../doc/models/catalog-item.md) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | getQuery(): ?CatalogQuery | setQuery(?CatalogQuery query): void | -| `limit` | `?int` | Optional | A limit on the number of results to be returned in a single page. The limit is advisory -
the implementation may return more or fewer results. If the supplied limit is negative, zero, or
is higher than the maximum limit of 1,000, it will be ignored. | getLimit(): ?int | setLimit(?int limit): void | -| `includeCategoryPathToRoot` | `?bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | getIncludeCategoryPathToRoot(): ?bool | setIncludeCategoryPathToRoot(?bool includeCategoryPathToRoot): void | - -## Example (as JSON) - -```json -{ - "limit": 100, - "object_types": [ - "ITEM" - ], - "query": { - "prefix_query": { - "attribute_name": "name", - "attribute_prefix": "tea" - } - }, - "cursor": "cursor2", - "include_deleted_objects": false, - "include_related_objects": false, - "begin_time": "begin_time2" -} -``` - diff --git a/doc/models/search-catalog-objects-response.md b/doc/models/search-catalog-objects-response.md deleted file mode 100644 index cbdf0ae5..00000000 --- a/doc/models/search-catalog-objects-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Search Catalog Objects Response - -## Structure - -`SearchCatalogObjectsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset, this is the final response.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `objects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The CatalogObjects returned. | getObjects(): ?array | setObjects(?array objects): void | -| `relatedObjects` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | A list of CatalogObjects referenced by the objects in the `objects` field. | getRelatedObjects(): ?array | setRelatedObjects(?array relatedObjects): void | -| `latestTime` | `?string` | Optional | When the associated product catalog was last updated. Will
match the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` request. | getLatestTime(): ?string | setLatestTime(?string latestTime): void | - -## Example (as JSON) - -```json -{ - "objects": [ - { - "id": "X5DZ5NWWAQ44CKBLKIFQGOWK", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "E7CLE5RZZ744BHWVQQEAHI2C", - "ordinal": 0 - } - ], - "description": "A delicious blend of black tea.", - "name": "Tea - Black", - "product_type": "REGULAR", - "tax_ids": [ - "ZXITPM6RWHZ7GZ7EIP3YKECM" - ], - "variations": [ - { - "id": "5GSZPX6EU7MM75S57OONG3V5", - "is_deleted": false, - "item_variation_data": { - "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", - "name": "Regular", - "ordinal": 1, - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2017-10-26T15:27:31.626Z", - "version": 1509031651626 - }, - { - "id": "XVLBN7DU6JTWHJTG5F265B43", - "is_deleted": false, - "item_variation_data": { - "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", - "name": "Large", - "ordinal": 2, - "price_money": { - "amount": 225, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2017-10-26T15:27:31.626Z", - "version": 1509031651626 - } - ], - "visibility": "PRIVATE" - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2017-10-26T15:41:32.337Z", - "version": 1509032492337, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - { - "id": "NNNEM3LA656Q46NXLWCNI7S5", - "is_deleted": false, - "item_data": { - "categories": [ - { - "id": "E7CLE5RZZ744BHWVQQEAHI2C", - "ordinal": 0 - } - ], - "description": "Relaxing green herbal tea.", - "name": "Tea - Green", - "product_type": "REGULAR", - "tax_ids": [ - "ZXITPM6RWHZ7GZ7EIP3YKECM" - ], - "variations": [ - { - "id": "FHYBVIA6NVBCSOVETA62WEA4", - "is_deleted": false, - "item_variation_data": { - "item_id": "NNNEM3LA656Q46NXLWCNI7S5", - "name": "Regular", - "ordinal": 1, - "price_money": { - "amount": 150, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2017-10-26T15:29:00.524Z", - "version": 1509031740524 - } - ], - "visibility": "PRIVATE" - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2017-10-26T15:41:23.232Z", - "version": 1509032483232, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor6", - "related_objects": [ - { - "type": "SUBSCRIPTION_PLAN_VARIATION", - "id": "id2", - "updated_at": "updated_at2", - "version": 0, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } - ], - "latest_time": "latest_time2" -} -``` - diff --git a/doc/models/search-customers-request.md b/doc/models/search-customers-request.md deleted file mode 100644 index c9fcc233..00000000 --- a/doc/models/search-customers-request.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Search Customers Request - -Defines the fields that are included in the request body of a request to the -`SearchCustomers` endpoint. - -## Structure - -`SearchCustomersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | Include the pagination cursor in subsequent calls to this endpoint to retrieve
the next set of results associated with the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `query` | [`?CustomerQuery`](../../doc/models/customer-query.md) | Optional | Represents filtering and sorting criteria for a [SearchCustomers](../../doc/apis/customers.md#search-customers) request. | getQuery(): ?CustomerQuery | setQuery(?CustomerQuery query): void | -| `count` | `?bool` | Optional | Indicates whether to return the total count of matching customers in the `count` field of the response.

The default value is `false`. | getCount(): ?bool | setCount(?bool count): void | - -## Example (as JSON) - -```json -{ - "limit": 2, - "query": { - "filter": { - "created_at": { - "end_at": "2018-02-01T00:00:00-00:00", - "start_at": "2018-01-01T00:00:00-00:00" - }, - "creation_source": { - "rule": "INCLUDE", - "values": [ - "THIRD_PARTY" - ] - }, - "email_address": { - "fuzzy": "example.com", - "exact": "exact2" - }, - "group_ids": { - "all": [ - "545AXB44B4XXWMVQ4W8SBT3HHF" - ] - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "phone_number": { - "exact": "exact2", - "fuzzy": "fuzzy8" - } - }, - "sort": { - "field": "CREATED_AT", - "order": "ASC" - } - }, - "cursor": "cursor0", - "count": false -} -``` - diff --git a/doc/models/search-customers-response.md b/doc/models/search-customers-response.md deleted file mode 100644 index 234cff7f..00000000 --- a/doc/models/search-customers-response.md +++ /dev/null @@ -1,131 +0,0 @@ - -# Search Customers Response - -Defines the fields that are included in the response body of -a request to the `SearchCustomers` endpoint. - -Either `errors` or `customers` is present in a given response (never both). - -## Structure - -`SearchCustomersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `customers` | [`?(Customer[])`](../../doc/models/customer.md) | Optional | The customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`).
Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`)
are included in the response. | getCustomers(): ?array | setCustomers(?array customers): void | -| `cursor` | `?string` | Optional | A pagination cursor that can be used during subsequent calls
to `SearchCustomers` to retrieve the next set of results associated
with the original query. Pagination cursors are only present when
a request succeeds and additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `count` | `?int` | Optional | The total count of customers associated with the Square account that match the search query. Only customer profiles with
public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is
present only if `count` is set to `true` in the request. | getCount(): ?int | setCount(?int count): void | - -## Example (as JSON) - -```json -{ - "cursor": "9dpS093Uy12AzeE", - "customers": [ - { - "address": { - "address_line_1": "505 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2018-01-23T20:21:54.859Z", - "creation_source": "DIRECTORY", - "email_address": "james.bond@example.com", - "family_name": "Bond", - "given_name": "James", - "group_ids": [ - "545AXB44B4XXWMVQ4W8SBT3HHF" - ], - "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "phone_number": "+1-212-555-4250", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID_2", - "segment_ids": [ - "1KB9JE5EGJXCW.REACHABLE" - ], - "updated_at": "2020-04-20T10:02:43.083Z", - "version": 7, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - }, - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2018-01-30T14:10:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "amelia.earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "group_ids": [ - "545AXB44B4XXWMVQ4W8SBT3HHF" - ], - "id": "A9641GZW2H7Z56YYSD41Q12HDW", - "note": "a customer", - "phone_number": "+1-212-555-9238", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID_1", - "segment_ids": [ - "1KB9JE5EGJXCW.REACHABLE" - ], - "updated_at": "2018-03-08T18:25:21.342Z", - "version": 1, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - }, - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "count": 90 -} -``` - diff --git a/doc/models/search-events-filter.md b/doc/models/search-events-filter.md deleted file mode 100644 index 014ce762..00000000 --- a/doc/models/search-events-filter.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Search Events Filter - -Criteria to filter events by. - -## Structure - -`SearchEventsFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `eventTypes` | `?(string[])` | Optional | Filter events by event types. | getEventTypes(): ?array | setEventTypes(?array eventTypes): void | -| `merchantIds` | `?(string[])` | Optional | Filter events by merchant. | getMerchantIds(): ?array | setMerchantIds(?array merchantIds): void | -| `locationIds` | `?(string[])` | Optional | Filter events by location. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | - -## Example (as JSON) - -```json -{ - "event_types": [ - "event_types6", - "event_types7", - "event_types8" - ], - "merchant_ids": [ - "merchant_ids5", - "merchant_ids6", - "merchant_ids7" - ], - "location_ids": [ - "location_ids8", - "location_ids9" - ], - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } -} -``` - diff --git a/doc/models/search-events-query.md b/doc/models/search-events-query.md deleted file mode 100644 index 0c02688f..00000000 --- a/doc/models/search-events-query.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Search Events Query - -Contains query criteria for the search. - -## Structure - -`SearchEventsQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchEventsFilter`](../../doc/models/search-events-filter.md) | Optional | Criteria to filter events by. | getFilter(): ?SearchEventsFilter | setFilter(?SearchEventsFilter filter): void | -| `sort` | [`?SearchEventsSort`](../../doc/models/search-events-sort.md) | Optional | Criteria to sort events by. | getSort(): ?SearchEventsSort | setSort(?SearchEventsSort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "event_types": [ - "event_types2", - "event_types3" - ], - "merchant_ids": [ - "merchant_ids1", - "merchant_ids2" - ], - "location_ids": [ - "location_ids4" - ], - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "sort": { - "field": "DEFAULT", - "order": "DESC" - } -} -``` - diff --git a/doc/models/search-events-request.md b/doc/models/search-events-request.md deleted file mode 100644 index 249b72db..00000000 --- a/doc/models/search-events-request.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Search Events Request - -Searches [Event](../../doc/models/event.md)s for your application. - -## Structure - -`SearchEventsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of events for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
**Constraints**: *Maximum Length*: `256` | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of events to return in a single page. The response might contain fewer events. The default value is 100, which is also the maximum allowed value.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).

Default: 100
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | -| `query` | [`?SearchEventsQuery`](../../doc/models/search-events-query.md) | Optional | Contains query criteria for the search. | getQuery(): ?SearchEventsQuery | setQuery(?SearchEventsQuery query): void | - -## Example (as JSON) - -```json -{ - "cursor": "cursor8", - "limit": 176, - "query": { - "filter": { - "event_types": [ - "event_types2", - "event_types3" - ], - "merchant_ids": [ - "merchant_ids1", - "merchant_ids2" - ], - "location_ids": [ - "location_ids4" - ], - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "sort": { - "field": "DEFAULT", - "order": "DESC" - } - } -} -``` - diff --git a/doc/models/search-events-response.md b/doc/models/search-events-response.md deleted file mode 100644 index cb70c0ed..00000000 --- a/doc/models/search-events-response.md +++ /dev/null @@ -1,85 +0,0 @@ - -# Search Events Response - -Defines the fields that are included in the response body of -a request to the [SearchEvents](../../doc/apis/events.md#search-events) endpoint. - -Note: if there are errors processing the request, the events field will not be -present. - -## Structure - -`SearchEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `events` | [`?(Event[])`](../../doc/models/event.md) | Optional | The list of [Event](entity:Event)s returned by the search. | getEvents(): ?array | setEvents(?array events): void | -| `metadata` | [`?(EventMetadata[])`](../../doc/models/event-metadata.md) | Optional | Contains the metadata of an event. For more information, see [Event](entity:Event). | getMetadata(): ?array | setMetadata(?array metadata): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. If empty, this is the final response.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "cursor": "6b571fc9773647f=", - "events": [ - { - "created_at": "2022-04-26T10:08:40.454726", - "data": { - "id": "ORSEVtZAJxb37RA1EiGw", - "object": { - "dispute": { - "amount_money": { - "amount": 8801, - "currency": "USD" - }, - "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", - "card_brand": "VISA", - "created_at": "2020-02-19T21:24:53.258Z", - "disputed_payment": { - "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" - }, - "due_at": "2020-03-04T00:00:00.000Z", - "id": "ORSEVtZAJxb37RA1EiGw", - "location_id": "VJDQQP3CG14EY", - "reason": "AMOUNT_DIFFERS", - "reported_at": "2020-02-19T00:00:00.000Z", - "state": "WON", - "updated_at": "2020-02-19T21:34:41.851Z", - "version": 6 - } - }, - "type": "dispute" - }, - "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8", - "location_id": "VJDQQP3CG14EY", - "merchant_id": "0HPGX5JYE6EE1", - "type": "dispute.state.updated" - } - ], - "metadata": [ - { - "api_version": "2022-12-13", - "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-events-sort-field.md b/doc/models/search-events-sort-field.md deleted file mode 100644 index a342344b..00000000 --- a/doc/models/search-events-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Search Events Sort Field - -Specifies the sort key for events returned from a search. - -## Enumeration - -`SearchEventsSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `DEFAULT` | Use the default sort key. The default behavior is to sort events by when they were created (`created_at`). | - diff --git a/doc/models/search-events-sort.md b/doc/models/search-events-sort.md deleted file mode 100644 index ea60bf8a..00000000 --- a/doc/models/search-events-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Events Sort - -Criteria to sort events by. - -## Structure - -`SearchEventsSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `field` | [`?string(SearchEventsSortField)`](../../doc/models/search-events-sort-field.md) | Optional | Specifies the sort key for events returned from a search. | getField(): ?string | setField(?string field): void | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | - -## Example (as JSON) - -```json -{ - "field": "DEFAULT", - "order": "DESC" -} -``` - diff --git a/doc/models/search-invoices-request.md b/doc/models/search-invoices-request.md deleted file mode 100644 index f558a16d..00000000 --- a/doc/models/search-invoices-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Search Invoices Request - -Describes a `SearchInvoices` request. - -## Structure - -`SearchInvoicesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`InvoiceQuery`](../../doc/models/invoice-query.md) | Required | Describes query criteria for searching invoices. | getQuery(): InvoiceQuery | setQuery(InvoiceQuery query): void | -| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "query": { - "filter": { - "customer_ids": [ - "JDKYHBWT1D4F8MFH63DBMEN8Y4" - ], - "location_ids": [ - "ES0RJRZYEC39A" - ] - }, - "limit": 100, - "sort": { - "field": "INVOICE_SORT_DATE", - "order": "DESC" - } - }, - "limit": 26, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-invoices-response.md b/doc/models/search-invoices-response.md deleted file mode 100644 index 9cf7224b..00000000 --- a/doc/models/search-invoices-response.md +++ /dev/null @@ -1,191 +0,0 @@ - -# Search Invoices Response - -Describes a `SearchInvoices` response. - -## Structure - -`SearchInvoicesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoices` | [`?(Invoice[])`](../../doc/models/invoice.md) | Optional | The list of invoices returned by the search. | getInvoices(): ?array | setInvoices(?array invoices): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to fetch the next set of invoices. If empty, this is the final
response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", - "invoices": [ - { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T17:45:13Z", - "version": 0 - }, - { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": true - }, - "created_at": "2021-01-23T15:29:12Z", - "delivery_method": "EMAIL", - "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", - "invoice_number": "inv-455", - "location_id": "ES0RJRZYEC39A", - "next_payment_amount_money": { - "amount": 3000, - "currency": "USD" - }, - "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", - "payment_requests": [ - { - "automatic_payment_source": "CARD_ON_FILE", - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "computed_amount_money": { - "amount": 1000, - "currency": "USD" - }, - "due_date": "2021-01-23", - "percentage_requested": "25", - "request_type": "DEPOSIT", - "tipping_enabled": false, - "total_completed_amount_money": { - "amount": 1000, - "currency": "USD" - }, - "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" - }, - { - "automatic_payment_source": "CARD_ON_FILE", - "card_id": "ccof:IkWfpLj4tNHMyFii3GB", - "computed_amount_money": { - "amount": 3000, - "currency": "USD" - }, - "due_date": "2021-06-15", - "request_type": "BALANCE", - "tipping_enabled": false, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", - "sale_or_service_date": "2030-01-24", - "status": "PARTIALLY_PAID", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "updated_at": "2021-01-23T15:29:56Z", - "version": 3 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md b/doc/models/search-loyalty-accounts-request-loyalty-account-query.md deleted file mode 100644 index bd0c98c5..00000000 --- a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Search Loyalty Accounts Request Loyalty Account Query - -The search criteria for the loyalty accounts. - -## Structure - -`SearchLoyaltyAccountsRequestLoyaltyAccountQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `mappings` | [`?(LoyaltyAccountMapping[])`](../../doc/models/loyalty-account-mapping.md) | Optional | The set of mappings to use in the loyalty account search.

This cannot be combined with `customer_ids`.

Max: 30 mappings | getMappings(): ?array | setMappings(?array mappings): void | -| `customerIds` | `?(string[])` | Optional | The set of customer IDs to use in the loyalty account search.

This cannot be combined with `mappings`.

Max: 30 customer IDs | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | - -## Example (as JSON) - -```json -{ - "mappings": [ - { - "id": "id8", - "created_at": "created_at6", - "phone_number": "phone_number4" - }, - { - "id": "id8", - "created_at": "created_at6", - "phone_number": "phone_number4" - }, - { - "id": "id8", - "created_at": "created_at6", - "phone_number": "phone_number4" - } - ], - "customer_ids": [ - "customer_ids5", - "customer_ids4", - "customer_ids3" - ] -} -``` - diff --git a/doc/models/search-loyalty-accounts-request.md b/doc/models/search-loyalty-accounts-request.md deleted file mode 100644 index f810e36c..00000000 --- a/doc/models/search-loyalty-accounts-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Search Loyalty Accounts Request - -A request to search for loyalty accounts. - -## Structure - -`SearchLoyaltyAccountsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?SearchLoyaltyAccountsRequestLoyaltyAccountQuery`](../../doc/models/search-loyalty-accounts-request-loyalty-account-query.md) | Optional | The search criteria for the loyalty accounts. | getQuery(): ?SearchLoyaltyAccountsRequestLoyaltyAccountQuery | setQuery(?SearchLoyaltyAccountsRequestLoyaltyAccountQuery query): void | -| `limit` | `?int` | Optional | The maximum number of results to include in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to
this endpoint. Provide this to retrieve the next set of
results for the original query.

For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 10, - "query": { - "mappings": [ - { - "phone_number": "+14155551234", - "id": "id8", - "created_at": "created_at6" - } - ], - "customer_ids": [ - "customer_ids1", - "customer_ids2", - "customer_ids3" - ] - }, - "cursor": "cursor0" -} -``` - diff --git a/doc/models/search-loyalty-accounts-response.md b/doc/models/search-loyalty-accounts-response.md deleted file mode 100644 index 2a4534f3..00000000 --- a/doc/models/search-loyalty-accounts-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Search Loyalty Accounts Response - -A response that includes loyalty accounts that satisfy the search criteria. - -## Structure - -`SearchLoyaltyAccountsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `loyaltyAccounts` | [`?(LoyaltyAccount[])`](../../doc/models/loyalty-account.md) | Optional | The loyalty accounts that met the search criteria,
in order of creation date. | getLoyaltyAccounts(): ?array | setLoyaltyAccounts(?array loyaltyAccounts): void | -| `cursor` | `?string` | Optional | The pagination cursor to use in a subsequent
request. If empty, this is the final response.
For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "loyalty_accounts": [ - { - "balance": 10, - "created_at": "2020-05-08T21:44:32Z", - "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", - "id": "79b807d2-d786-46a9-933b-918028d7a8c5", - "lifetime_points": 20, - "mapping": { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234" - }, - "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "updated_at": "2020-05-08T21:44:32Z", - "enrolled_at": "enrolled_at4" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/search-loyalty-events-request.md b/doc/models/search-loyalty-events-request.md deleted file mode 100644 index 0cc1fff5..00000000 --- a/doc/models/search-loyalty-events-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Search Loyalty Events Request - -A request to search for loyalty events. - -## Structure - -`SearchLoyaltyEventsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?LoyaltyEventQuery`](../../doc/models/loyalty-event-query.md) | Optional | Represents a query used to search for loyalty events. | getQuery(): ?LoyaltyEventQuery | setQuery(?LoyaltyEventQuery query): void | -| `limit` | `?int` | Optional | The maximum number of results to include in the response.
The last page might contain fewer events.
The default is 30 events.
**Constraints**: `>= 1`, `<= 30` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 30, - "query": { - "filter": { - "order_filter": { - "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY" - }, - "loyalty_account_filter": { - "loyalty_account_id": "loyalty_account_id8" - }, - "type_filter": { - "types": [ - "ACCUMULATE_PROMOTION_POINTS", - "ACCUMULATE_POINTS", - "CREATE_REWARD" - ] - }, - "date_time_filter": { - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "location_filter": { - "location_ids": [ - "location_ids0", - "location_ids1", - "location_ids2" - ] - } - } - }, - "cursor": "cursor8" -} -``` - diff --git a/doc/models/search-loyalty-events-response.md b/doc/models/search-loyalty-events-response.md deleted file mode 100644 index 3abf9e4e..00000000 --- a/doc/models/search-loyalty-events-response.md +++ /dev/null @@ -1,146 +0,0 @@ - -# Search Loyalty Events Response - -A response that contains loyalty events that satisfy the search -criteria, in order by the `created_at` date. - -## Structure - -`SearchLoyaltyEventsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `events` | [`?(LoyaltyEvent[])`](../../doc/models/loyalty-event.md) | Optional | The loyalty events that satisfy the search criteria. | getEvents(): ?array | setEvents(?array events): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent
request. If empty, this is the final response.
For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "events": [ - { - "accumulate_points": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", - "points": 5 - }, - "created_at": "2020-05-08T22:01:30Z", - "id": "c27c8465-806e-36f2-b4b3-71f5887b5ba8", - "location_id": "P034NEENMD09F", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "source": "LOYALTY_API", - "type": "ACCUMULATE_POINTS", - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } - }, - { - "created_at": "2020-05-08T22:01:15Z", - "id": "e4a5cbc3-a4d0-3779-98e9-e578885d9430", - "location_id": "P034NEENMD09F", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "redeem_reward": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", - "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" - }, - "source": "LOYALTY_API", - "type": "REDEEM_REWARD", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "create_reward": { - "loyalty_program_id": "loyalty_program_id2", - "reward_id": "reward_id6", - "points": 90 - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } - }, - { - "create_reward": { - "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", - "points": -10, - "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" - }, - "created_at": "2020-05-08T22:00:44Z", - "id": "5e127479-0b03-3671-ab1e-15faea8b7188", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "source": "LOYALTY_API", - "type": "CREATE_REWARD", - "accumulate_points": { - "loyalty_program_id": "loyalty_program_id8", - "points": 118, - "order_id": "order_id8" - }, - "redeem_reward": { - "loyalty_program_id": "loyalty_program_id8", - "reward_id": "reward_id2", - "order_id": "order_id8" - }, - "delete_reward": { - "loyalty_program_id": "loyalty_program_id4", - "reward_id": "reward_id8", - "points": 104 - }, - "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md b/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md deleted file mode 100644 index 8c3b5dc3..00000000 --- a/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Loyalty Rewards Request Loyalty Reward Query - -The set of search requirements. - -## Structure - -`SearchLoyaltyRewardsRequestLoyaltyRewardQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs.
**Constraints**: *Minimum Length*: `1` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | -| `status` | [`?string(LoyaltyRewardStatus)`](../../doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "loyalty_account_id": "loyalty_account_id2", - "status": "DELETED" -} -``` - diff --git a/doc/models/search-loyalty-rewards-request.md b/doc/models/search-loyalty-rewards-request.md deleted file mode 100644 index fed21e07..00000000 --- a/doc/models/search-loyalty-rewards-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Search Loyalty Rewards Request - -A request to search for loyalty rewards. - -## Structure - -`SearchLoyaltyRewardsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?SearchLoyaltyRewardsRequestLoyaltyRewardQuery`](../../doc/models/search-loyalty-rewards-request-loyalty-reward-query.md) | Optional | The set of search requirements. | getQuery(): ?SearchLoyaltyRewardsRequestLoyaltyRewardQuery | setQuery(?SearchLoyaltyRewardsRequestLoyaltyRewardQuery query): void | -| `limit` | `?int` | Optional | The maximum number of results to return in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 30` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to
this endpoint. Provide this to retrieve the next set of
results for the original query.
For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 10, - "query": { - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "status": "ISSUED" - }, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-loyalty-rewards-response.md b/doc/models/search-loyalty-rewards-response.md deleted file mode 100644 index bb80344b..00000000 --- a/doc/models/search-loyalty-rewards-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Loyalty Rewards Response - -A response that includes the loyalty rewards satisfying the search criteria. - -## Structure - -`SearchLoyaltyRewardsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `rewards` | [`?(LoyaltyReward[])`](../../doc/models/loyalty-reward.md) | Optional | The loyalty rewards that satisfy the search criteria.
These are returned in descending order by `updated_at`. | getRewards(): ?array | setRewards(?array rewards): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent
request. If empty, this is the final response. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "rewards": [ - { - "created_at": "2020-05-08T22:00:44Z", - "id": "d03f79f4-815f-3500-b851-cc1e68a457f9", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", - "points": 10, - "redeemed_at": "2020-05-08T22:01:17Z", - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "REDEEMED", - "updated_at": "2020-05-08T22:01:17Z" - }, - { - "created_at": "2020-05-08T21:55:42Z", - "id": "9f18ac21-233a-31c3-be77-b45840f5a810", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "points": 10, - "redeemed_at": "2020-05-08T21:56:00Z", - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "REDEEMED", - "updated_at": "2020-05-08T21:56:00Z", - "order_id": "order_id4" - }, - { - "created_at": "2020-05-01T21:49:54Z", - "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "order_id": "5NB69ZNh3FbsOs1ox43bh1xrli6YY", - "points": 10, - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "DELETED", - "updated_at": "2020-05-08T21:55:10Z" - }, - { - "created_at": "2020-05-01T20:20:37Z", - "id": "a051254c-f840-3b45-8cf1-50bcd38ff92a", - "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", - "order_id": "LQQ16znvi2VIUKPVhUfJefzr1eEZY", - "points": 10, - "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - "status": "ISSUED", - "updated_at": "2020-05-01T20:20:40Z" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-orders-customer-filter.md b/doc/models/search-orders-customer-filter.md deleted file mode 100644 index 19197c26..00000000 --- a/doc/models/search-orders-customer-filter.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Search Orders Customer Filter - -A filter based on the order `customer_id` and any tender `customer_id` -associated with the order. It does not filter based on the -[FulfillmentRecipient](../../doc/models/fulfillment-recipient.md) `customer_id`. - -## Structure - -`SearchOrdersCustomerFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerIds` | `?(string[])` | Optional | A list of customer IDs to filter by.

Max: 10 customer ids. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "customer_ids9", - "customer_ids0", - "customer_ids1" - ] -} -``` - diff --git a/doc/models/search-orders-date-time-filter.md b/doc/models/search-orders-date-time-filter.md deleted file mode 100644 index 23ab921a..00000000 --- a/doc/models/search-orders-date-time-filter.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Search Orders Date Time Filter - -Filter for `Order` objects based on whether their `CREATED_AT`, -`CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range. -You can specify the time range and which timestamp to filter for. You can filter -for only one time range at a time. - -For each time range, the start time and end time are inclusive. If the end time -is absent, it defaults to the time of the first request for the cursor. - -__Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, -you must set the `sort_field` in [OrdersSort](../../doc/models/search-orders-sort.md) -to the same field you filter for. For example, if you set the `CLOSED_AT` field -in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to -`CLOSED_AT`. Otherwise, `SearchOrders` throws an error. -[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) - -## Structure - -`SearchOrdersDateTimeFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | -| `updatedAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getUpdatedAt(): ?TimeRange | setUpdatedAt(?TimeRange updatedAt): void | -| `closedAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getClosedAt(): ?TimeRange | setClosedAt(?TimeRange closedAt): void | - -## Example (as JSON) - -```json -{ - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "closed_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } -} -``` - diff --git a/doc/models/search-orders-filter.md b/doc/models/search-orders-filter.md deleted file mode 100644 index 3ba48a89..00000000 --- a/doc/models/search-orders-filter.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Search Orders Filter - -Filtering criteria to use for a `SearchOrders` request. Multiple filters -are ANDed together. - -## Structure - -`SearchOrdersFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `stateFilter` | [`?SearchOrdersStateFilter`](../../doc/models/search-orders-state-filter.md) | Optional | Filter by the current order `state`. | getStateFilter(): ?SearchOrdersStateFilter | setStateFilter(?SearchOrdersStateFilter stateFilter): void | -| `dateTimeFilter` | [`?SearchOrdersDateTimeFilter`](../../doc/models/search-orders-date-time-filter.md) | Optional | Filter for `Order` objects based on whether their `CREATED_AT`,
`CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range.
You can specify the time range and which timestamp to filter for. You can filter
for only one time range at a time.

For each time range, the start time and end time are inclusive. If the end time
is absent, it defaults to the time of the first request for the cursor.

__Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query,
you must set the `sort_field` in [OrdersSort](../../doc/models/search-orders-sort.md)
to the same field you filter for. For example, if you set the `CLOSED_AT` field
in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to
`CLOSED_AT`. Otherwise, `SearchOrders` throws an error.
[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) | getDateTimeFilter(): ?SearchOrdersDateTimeFilter | setDateTimeFilter(?SearchOrdersDateTimeFilter dateTimeFilter): void | -| `fulfillmentFilter` | [`?SearchOrdersFulfillmentFilter`](../../doc/models/search-orders-fulfillment-filter.md) | Optional | Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. | getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter | setFulfillmentFilter(?SearchOrdersFulfillmentFilter fulfillmentFilter): void | -| `sourceFilter` | [`?SearchOrdersSourceFilter`](../../doc/models/search-orders-source-filter.md) | Optional | A filter based on order `source` information. | getSourceFilter(): ?SearchOrdersSourceFilter | setSourceFilter(?SearchOrdersSourceFilter sourceFilter): void | -| `customerFilter` | [`?SearchOrdersCustomerFilter`](../../doc/models/search-orders-customer-filter.md) | Optional | A filter based on the order `customer_id` and any tender `customer_id`
associated with the order. It does not filter based on the
[FulfillmentRecipient](../../doc/models/fulfillment-recipient.md) `customer_id`. | getCustomerFilter(): ?SearchOrdersCustomerFilter | setCustomerFilter(?SearchOrdersCustomerFilter customerFilter): void | - -## Example (as JSON) - -```json -{ - "state_filter": { - "states": [ - "CANCELED", - "DRAFT" - ] - }, - "date_time_filter": { - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "closed_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "fulfillment_filter": { - "fulfillment_types": [ - "DELIVERY" - ], - "fulfillment_states": [ - "CANCELED", - "FAILED" - ] - }, - "source_filter": { - "source_names": [ - "source_names6" - ] - }, - "customer_filter": { - "customer_ids": [ - "customer_ids3", - "customer_ids4" - ] - } -} -``` - diff --git a/doc/models/search-orders-fulfillment-filter.md b/doc/models/search-orders-fulfillment-filter.md deleted file mode 100644 index f9a078b2..00000000 --- a/doc/models/search-orders-fulfillment-filter.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Search Orders Fulfillment Filter - -Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. - -## Structure - -`SearchOrdersFulfillmentFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `fulfillmentTypes` | [`?(string(FulfillmentType)[])`](../../doc/models/fulfillment-type.md) | Optional | A list of [fulfillment types](entity:FulfillmentType) to filter
for. The list returns orders if any of its fulfillments match any of the fulfillment types
listed in this field.
See [FulfillmentType](#type-fulfillmenttype) for possible values | getFulfillmentTypes(): ?array | setFulfillmentTypes(?array fulfillmentTypes): void | -| `fulfillmentStates` | [`?(string(FulfillmentState)[])`](../../doc/models/fulfillment-state.md) | Optional | A list of [fulfillment states](entity:FulfillmentState) to filter
for. The list returns orders if any of its fulfillments match any of the
fulfillment states listed in this field.
See [FulfillmentState](#type-fulfillmentstate) for possible values | getFulfillmentStates(): ?array | setFulfillmentStates(?array fulfillmentStates): void | - -## Example (as JSON) - -```json -{ - "fulfillment_types": [ - "PICKUP", - "SHIPMENT" - ], - "fulfillment_states": [ - "PROPOSED" - ] -} -``` - diff --git a/doc/models/search-orders-query.md b/doc/models/search-orders-query.md deleted file mode 100644 index 84437f24..00000000 --- a/doc/models/search-orders-query.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Search Orders Query - -Contains query criteria for the search. - -## Structure - -`SearchOrdersQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchOrdersFilter`](../../doc/models/search-orders-filter.md) | Optional | Filtering criteria to use for a `SearchOrders` request. Multiple filters
are ANDed together. | getFilter(): ?SearchOrdersFilter | setFilter(?SearchOrdersFilter filter): void | -| `sort` | [`?SearchOrdersSort`](../../doc/models/search-orders-sort.md) | Optional | Sorting criteria for a `SearchOrders` request. Results can only be sorted
by a timestamp field. | getSort(): ?SearchOrdersSort | setSort(?SearchOrdersSort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "state_filter": { - "states": [ - "CANCELED", - "DRAFT" - ] - }, - "date_time_filter": { - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "closed_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "fulfillment_filter": { - "fulfillment_types": [ - "DELIVERY" - ], - "fulfillment_states": [ - "CANCELED", - "FAILED" - ] - }, - "source_filter": { - "source_names": [ - "source_names6" - ] - }, - "customer_filter": { - "customer_ids": [ - "customer_ids3", - "customer_ids4" - ] - } - }, - "sort": { - "sort_field": "UPDATED_AT", - "sort_order": "DESC" - } -} -``` - diff --git a/doc/models/search-orders-request.md b/doc/models/search-orders-request.md deleted file mode 100644 index dca014f7..00000000 --- a/doc/models/search-orders-request.md +++ /dev/null @@ -1,78 +0,0 @@ - -# Search Orders Request - -## Structure - -`SearchOrdersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `?(string[])` | Optional | The location IDs for the orders to query. All locations must belong to
the same merchant.

Max: 10 location IDs. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `query` | [`?SearchOrdersQuery`](../../doc/models/search-orders-query.md) | Optional | Contains query criteria for the search. | getQuery(): ?SearchOrdersQuery | setQuery(?SearchOrdersQuery query): void | -| `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.

Default: `500`
Max: `1000` | getLimit(): ?int | setLimit(?int limit): void | -| `returnEntries` | `?bool` | Optional | A Boolean that controls the format of the search results. If `true`,
`SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders`
returns complete order objects.

Default: `false`. | getReturnEntries(): ?bool | setReturnEntries(?bool returnEntries): void | - -## Example (as JSON) - -```json -{ - "limit": 3, - "location_ids": [ - "057P5VYJ4A5X1", - "18YC4JDH91E1H" - ], - "query": { - "filter": { - "date_time_filter": { - "closed_at": { - "end_at": "2019-03-04T21:54:45+00:00", - "start_at": "2018-03-03T20:00:00+00:00" - }, - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "updated_at": { - "start_at": "start_at6", - "end_at": "end_at6" - } - }, - "state_filter": { - "states": [ - "COMPLETED" - ] - }, - "fulfillment_filter": { - "fulfillment_types": [ - "DELIVERY" - ], - "fulfillment_states": [ - "CANCELED", - "FAILED" - ] - }, - "source_filter": { - "source_names": [ - "source_names6" - ] - }, - "customer_filter": { - "customer_ids": [ - "customer_ids3", - "customer_ids4" - ] - } - }, - "sort": { - "sort_field": "CLOSED_AT", - "sort_order": "DESC" - } - }, - "return_entries": true, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-orders-response.md b/doc/models/search-orders-response.md deleted file mode 100644 index 544af0bc..00000000 --- a/doc/models/search-orders-response.md +++ /dev/null @@ -1,225 +0,0 @@ - -# Search Orders Response - -Either the `order_entries` or `orders` field is set, depending on whether -`return_entries` is set on the [SearchOrdersRequest](../../doc/apis/orders.md#search-orders). - -## Structure - -`SearchOrdersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `orderEntries` | [`?(OrderEntry[])`](../../doc/models/order-entry.md) | Optional | A list of [OrderEntries](entity:OrderEntry) that fit the query
conditions. The list is populated only if `return_entries` is set to `true` in the request. | getOrderEntries(): ?array | setOrderEntries(?array orderEntries): void | -| `orders` | [`?(Order[])`](../../doc/models/order.md) | Optional | A list of
[Order](entity:Order) objects that match the query conditions. The list is populated only if
`return_entries` is set to `false` in the request. | getOrders(): ?array | setOrders(?array orders): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | [Errors](entity:Error) encountered during the search. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "123", - "order_entries": [ - { - "location_id": "057P5VYJ4A5X1", - "order_id": "CAISEM82RcpmcFBM0TfOyiHV3es", - "version": 1 - }, - { - "location_id": "18YC4JDH91E1H", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "version": 182 - }, - { - "location_id": "057P5VYJ4A5X1", - "order_id": "CAISEM52YcpmcWAzERDOyiWS3ty", - "version": 182 - } - ], - "orders": [ - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - }, - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - }, - { - "id": "id2", - "location_id": "location_id6", - "reference_id": "reference_id0", - "source": { - "name": "name4" - }, - "customer_id": "customer_id0", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-orders-sort-field.md b/doc/models/search-orders-sort-field.md deleted file mode 100644 index 6c556a9d..00000000 --- a/doc/models/search-orders-sort-field.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Search Orders Sort Field - -Specifies which timestamp to use to sort `SearchOrder` results. - -## Enumeration - -`SearchOrdersSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `CREATED_AT` | The time when the order was created, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `CREATED_AT`
field in your `DateTimeFilter`. | -| `UPDATED_AT` | The time when the order last updated, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `UPDATED_AT`
field in your `DateTimeFilter`. | -| `CLOSED_AT` | The time when the order was closed, in RFC-3339 format. If you use this
value, you must also set a `StateFilter` with closed states. If you are also
filtering for a time range in this query, you must set the `CLOSED_AT`
field in your `DateTimeFilter`. | - diff --git a/doc/models/search-orders-sort.md b/doc/models/search-orders-sort.md deleted file mode 100644 index 032ae776..00000000 --- a/doc/models/search-orders-sort.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Search Orders Sort - -Sorting criteria for a `SearchOrders` request. Results can only be sorted -by a timestamp field. - -## Structure - -`SearchOrdersSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortField` | [`string(SearchOrdersSortField)`](../../doc/models/search-orders-sort-field.md) | Required | Specifies which timestamp to use to sort `SearchOrder` results. | getSortField(): string | setSortField(string sortField): void | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "sort_field": "CREATED_AT", - "sort_order": "DESC" -} -``` - diff --git a/doc/models/search-orders-source-filter.md b/doc/models/search-orders-source-filter.md deleted file mode 100644 index d8717d2f..00000000 --- a/doc/models/search-orders-source-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Search Orders Source Filter - -A filter based on order `source` information. - -## Structure - -`SearchOrdersSourceFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sourceNames` | `?(string[])` | Optional | Filters by the [Source](entity:OrderSource) `name`. The filter returns any orders
with a `source.name` that matches any of the listed source names.

Max: 10 source names. | getSourceNames(): ?array | setSourceNames(?array sourceNames): void | - -## Example (as JSON) - -```json -{ - "source_names": [ - "source_names4", - "source_names5", - "source_names6" - ] -} -``` - diff --git a/doc/models/search-orders-state-filter.md b/doc/models/search-orders-state-filter.md deleted file mode 100644 index a3c3be67..00000000 --- a/doc/models/search-orders-state-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Search Orders State Filter - -Filter by the current order `state`. - -## Structure - -`SearchOrdersStateFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `states` | [`string(OrderState)[]`](../../doc/models/order-state.md) | Required | States to filter for.
See [OrderState](#type-orderstate) for possible values | getStates(): array | setStates(array states): void | - -## Example (as JSON) - -```json -{ - "states": [ - "CANCELED", - "DRAFT", - "OPEN" - ] -} -``` - diff --git a/doc/models/search-shifts-request.md b/doc/models/search-shifts-request.md deleted file mode 100644 index 459e6318..00000000 --- a/doc/models/search-shifts-request.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Search Shifts Request - -A request for a filtered and sorted set of `Shift` objects. - -## Structure - -`SearchShiftsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?ShiftQuery`](../../doc/models/shift-query.md) | Optional | The parameters of a `Shift` search query, which includes filter and sort options. | getQuery(): ?ShiftQuery | setQuery(?ShiftQuery query): void | -| `limit` | `?int` | Optional | The number of resources in a page (200 by default).
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | An opaque cursor for fetching the next page. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 100, - "query": { - "filter": { - "workday": { - "date_range": { - "end_date": "2019-02-03", - "start_date": "2019-01-20" - }, - "default_timezone": "America/Los_Angeles", - "match_shifts_by": "START_AT" - }, - "location_ids": [ - "location_ids4" - ], - "employee_ids": [ - "employee_ids9" - ], - "status": "OPEN", - "start": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "end": { - "start_at": "start_at0", - "end_at": "end_at2" - } - }, - "sort": { - "field": "START_AT", - "order": "DESC" - } - }, - "cursor": "cursor2" -} -``` - diff --git a/doc/models/search-shifts-response.md b/doc/models/search-shifts-response.md deleted file mode 100644 index 83fe72ac..00000000 --- a/doc/models/search-shifts-response.md +++ /dev/null @@ -1,120 +0,0 @@ - -# Search Shifts Response - -The response to a request for `Shift` objects. The response contains -the requested `Shift` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`SearchShiftsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `shifts` | [`?(Shift[])`](../../doc/models/shift.md) | Optional | Shifts. | getShifts(): ?array | setShifts(?array shifts): void | -| `cursor` | `?string` | Optional | An opaque cursor for fetching the next page. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "shifts": [ - { - "breaks": [ - { - "break_type_id": "REGS1EQR1TPZ5", - "end_at": "2019-01-21T06:11:00-05:00", - "expected_duration": "PT10M", - "id": "SJW7X6AKEJQ65", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-21T06:11:00-05:00" - } - ], - "created_at": "2019-01-24T01:12:03Z", - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "employee_id": "ormj0jJJZ5OZIzxrZYJI", - "end_at": "2019-01-21T13:11:00-05:00", - "id": "X714F3HA6D1PT", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-21T03:11:00-05:00", - "status": "CLOSED", - "team_member_id": "ormj0jJJZ5OZIzxrZYJI", - "timezone": "America/New_York", - "updated_at": "2019-02-07T22:21:08Z", - "version": 6, - "wage": { - "hourly_rate": { - "amount": 1100, - "currency": "USD" - }, - "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", - "tip_eligible": true, - "title": "Barista" - } - }, - { - "breaks": [ - { - "break_type_id": "WQX00VR99F53J", - "end_at": "2019-01-23T14:40:00-05:00", - "expected_duration": "PT10M", - "id": "BKS6VR7WR748A", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-23T14:30:00-05:00" - }, - { - "break_type_id": "P6Q468ZFRN1AC", - "end_at": "2019-01-22T12:44:00-05:00", - "expected_duration": "PT15M", - "id": "BQFEZSHFZSC51", - "is_paid": false, - "name": "Coffee Break", - "start_at": "2019-01-22T12:30:00-05:00" - } - ], - "created_at": "2019-01-23T23:32:45Z", - "declared_cash_tip_money": { - "amount": 0, - "currency": "USD" - }, - "employee_id": "33fJchumvVdJwxV0H6L9", - "end_at": "2019-01-22T13:02:00-05:00", - "id": "GDHYBZYWK0P2V", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-22T12:02:00-05:00", - "status": "CLOSED", - "team_member_id": "33fJchumvVdJwxV0H6L9", - "timezone": "America/New_York", - "updated_at": "2019-01-24T00:56:25Z", - "version": 16, - "wage": { - "hourly_rate": { - "amount": 1600, - "currency": "USD" - }, - "job_id": "gcbz15vKGnMKmaWJJ152kjim", - "tip_eligible": true, - "title": "Cook" - } - } - ], - "cursor": "cursor8", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-subscriptions-filter.md b/doc/models/search-subscriptions-filter.md deleted file mode 100644 index da2450c3..00000000 --- a/doc/models/search-subscriptions-filter.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Search Subscriptions Filter - -Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by -the [SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) endpoint. - -## Structure - -`SearchSubscriptionsFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerIds` | `?(string[])` | Optional | A filter to select subscriptions based on the subscribing customer IDs. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | -| `locationIds` | `?(string[])` | Optional | A filter to select subscriptions based on the location. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `sourceNames` | `?(string[])` | Optional | A filter to select subscriptions based on the source application. | getSourceNames(): ?array | setSourceNames(?array sourceNames): void | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "customer_ids1", - "customer_ids2" - ], - "location_ids": [ - "location_ids4", - "location_ids5", - "location_ids6" - ], - "source_names": [ - "source_names2", - "source_names3", - "source_names4" - ] -} -``` - diff --git a/doc/models/search-subscriptions-query.md b/doc/models/search-subscriptions-query.md deleted file mode 100644 index 1c636d5a..00000000 --- a/doc/models/search-subscriptions-query.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Search Subscriptions Query - -Represents a query, consisting of specified query expressions, used to search for subscriptions. - -## Structure - -`SearchSubscriptionsQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchSubscriptionsFilter`](../../doc/models/search-subscriptions-filter.md) | Optional | Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by
the [SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) endpoint. | getFilter(): ?SearchSubscriptionsFilter | setFilter(?SearchSubscriptionsFilter filter): void | - -## Example (as JSON) - -```json -{ - "filter": { - "customer_ids": [ - "customer_ids3", - "customer_ids2" - ], - "location_ids": [ - "location_ids4" - ], - "source_names": [ - "source_names2" - ] - } -} -``` - diff --git a/doc/models/search-subscriptions-request.md b/doc/models/search-subscriptions-request.md deleted file mode 100644 index c593cdcd..00000000 --- a/doc/models/search-subscriptions-request.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Search Subscriptions Request - -Defines input parameters in a request to the -[SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) endpoint. - -## Structure - -`SearchSubscriptionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | When the total number of resulting subscriptions exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The upper limit on the number of subscriptions to return
in a paged response.
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | -| `query` | [`?SearchSubscriptionsQuery`](../../doc/models/search-subscriptions-query.md) | Optional | Represents a query, consisting of specified query expressions, used to search for subscriptions. | getQuery(): ?SearchSubscriptionsQuery | setQuery(?SearchSubscriptionsQuery query): void | -| `include` | `?(string[])` | Optional | An option to include related information in the response.

The supported values are:

- `actions`: to include scheduled actions on the targeted subscriptions. | getInclude(): ?array | setInclude(?array include): void | - -## Example (as JSON) - -```json -{ - "query": { - "filter": { - "customer_ids": [ - "CHFGVKYY8RSV93M5KCYTG4PN0G" - ], - "location_ids": [ - "S8GWD5R9QB376" - ], - "source_names": [ - "My App" - ] - } - }, - "cursor": "cursor6", - "limit": 230, - "include": [ - "include8" - ] -} -``` - diff --git a/doc/models/search-subscriptions-response.md b/doc/models/search-subscriptions-response.md deleted file mode 100644 index 0633c734..00000000 --- a/doc/models/search-subscriptions-response.md +++ /dev/null @@ -1,100 +0,0 @@ - -# Search Subscriptions Response - -Defines output parameters in a response from the -[SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) endpoint. - -## Structure - -`SearchSubscriptionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscriptions` | [`?(Subscription[])`](../../doc/models/subscription.md) | Optional | The subscriptions matching the specified query expressions. | getSubscriptions(): ?array | setSubscriptions(?array subscriptions): void | -| `cursor` | `?string` | Optional | When the total number of resulting subscription exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "canceled_date": "2021-10-30", - "card_id": "ccof:mueUsvgajChmjEbp4GB", - "charged_through_date": "2021-11-20", - "created_at": "2021-10-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "de86fc96-8664-474b-af1a-abbe59cacf0e", - "location_id": "S8GWD5R9QB376", - "paid_until_date": "2021-11-20", - "plan_variation_id": "L3TJVDHVBEQEGQDEZL2JJM7R", - "source": { - "name": "My Application" - }, - "start_date": "2021-10-20", - "status": "CANCELED", - "timezone": "UTC" - }, - { - "charged_through_date": "2022-08-19", - "created_at": "2022-01-19T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", - "invoice_ids": [ - "grebK0Q_l8H4fqoMMVvt-Q", - "rcX_i3sNmHTGKhI4W2mceA" - ], - "location_id": "S8GWD5R9QB376", - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "price_override_money": { - "amount": 1000, - "currency": "USD" - }, - "source": { - "name": "My Application" - }, - "start_date": "2022-01-19", - "status": "PAUSED", - "tax_percentage": "5", - "timezone": "America/Los_Angeles", - "version": 2 - }, - { - "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - "ordinal": 0, - "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", - "uid": "873451e0-745b-4e87-ab0b-c574933fe616" - } - ], - "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", - "source": { - "name": "My Application" - }, - "start_date": "2023-06-20", - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 1 - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor2" -} -``` - diff --git a/doc/models/search-team-members-filter.md b/doc/models/search-team-members-filter.md deleted file mode 100644 index 5b193914..00000000 --- a/doc/models/search-team-members-filter.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Search Team Members Filter - -Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied -between the individual fields, and `OR` logic is applied within list-based fields. -For example, setting this filter value: - -``` -filter = (locations_ids = ["A", "B"], status = ACTIVE) -``` - -returns only active team members assigned to either location "A" or "B". - -## Structure - -`SearchTeamMembersFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `?(string[])` | Optional | When present, filters by team members assigned to the specified locations.
When empty, includes team members assigned to any location. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `status` | [`?string(TeamMemberStatus)`](../../doc/models/team-member-status.md) | Optional | Enumerates the possible statuses the team member can have within a business. | getStatus(): ?string | setStatus(?string status): void | -| `isOwner` | `?bool` | Optional | When present and set to true, returns the team member who is the owner of the Square account. | getIsOwner(): ?bool | setIsOwner(?bool isOwner): void | - -## Example (as JSON) - -```json -{ - "location_ids": [ - "location_ids6" - ], - "status": "ACTIVE", - "is_owner": false -} -``` - diff --git a/doc/models/search-team-members-query.md b/doc/models/search-team-members-query.md deleted file mode 100644 index 3ab75157..00000000 --- a/doc/models/search-team-members-query.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Search Team Members Query - -Represents the parameters in a search for `TeamMember` objects. - -## Structure - -`SearchTeamMembersQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchTeamMembersFilter`](../../doc/models/search-team-members-filter.md) | Optional | Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied
between the individual fields, and `OR` logic is applied within list-based fields.
For example, setting this filter value:

```
filter = (locations_ids = ["A", "B"], status = ACTIVE)
```

returns only active team members assigned to either location "A" or "B". | getFilter(): ?SearchTeamMembersFilter | setFilter(?SearchTeamMembersFilter filter): void | - -## Example (as JSON) - -```json -{ - "filter": { - "location_ids": [ - "location_ids4" - ], - "status": "ACTIVE", - "is_owner": false - } -} -``` - diff --git a/doc/models/search-team-members-request.md b/doc/models/search-team-members-request.md deleted file mode 100644 index c0f0ca65..00000000 --- a/doc/models/search-team-members-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Search Team Members Request - -Represents a search request for a filtered list of `TeamMember` objects. - -## Structure - -`SearchTeamMembersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?SearchTeamMembersQuery`](../../doc/models/search-team-members-query.md) | Optional | Represents the parameters in a search for `TeamMember` objects. | getQuery(): ?SearchTeamMembersQuery | setQuery(?SearchTeamMembersQuery query): void | -| `limit` | `?int` | Optional | The maximum number of `TeamMember` objects in a page (100 by default).
**Constraints**: `>= 1`, `<= 200` | getLimit(): ?int | setLimit(?int limit): void | -| `cursor` | `?string` | Optional | The opaque cursor for fetching the next page. For more information, see
[pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "limit": 10, - "query": { - "filter": { - "location_ids": [ - "0G5P3VGACMMQZ" - ], - "status": "ACTIVE", - "is_owner": false - } - }, - "cursor": "cursor8" -} -``` - diff --git a/doc/models/search-team-members-response.md b/doc/models/search-team-members-response.md deleted file mode 100644 index 8c5fa8be..00000000 --- a/doc/models/search-team-members-response.md +++ /dev/null @@ -1,284 +0,0 @@ - -# Search Team Members Response - -Represents a response from a search request containing a filtered list of `TeamMember` objects. - -## Structure - -`SearchTeamMembersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMembers` | [`?(TeamMember[])`](../../doc/models/team-member.md) | Optional | The filtered list of `TeamMember` objects. | getTeamMembers(): ?array | setTeamMembers(?array teamMembers): void | -| `cursor` | `?string` | Optional | The opaque cursor for fetching the next page. For more information, see
[pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "cursor": "N:9UglUjOXQ13-hMFypCft", - "team_members": [ - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2019-07-10T17:26:48Z", - "email_address": "johnny_cash@squareup.com", - "family_name": "Cash", - "given_name": "Johnny", - "id": "-3oZQKPKVk6gUXU_V5Qa", - "is_owner": false, - "reference_id": "12345678", - "status": "ACTIVE", - "updated_at": "2020-04-28T21:49:28Z", - "wage_setting": { - "created_at": "2021-06-11T22:55:45Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 1443, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - } - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:01Z", - "family_name": "Smith", - "given_name": "Lombard", - "id": "1AVJj0DjkzbmbJw5r4KK", - "is_owner": false, - "phone_number": "+14155552671", - "reference_id": "abcded", - "status": "ACTIVE", - "updated_at": "2020-06-09T17:38:05Z", - "wage_setting": { - "created_at": "2020-03-24T18:14:01Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "hourly_rate": { - "amount": 2400, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "1AVJj0DjkzbmbJw5r4KK", - "updated_at": "2020-06-09T17:38:05Z", - "version": 2 - } - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T01:09:25Z", - "family_name": "Sway", - "given_name": "Monica", - "id": "2JCmiJol_KKFs9z2Evim", - "is_owner": false, - "status": "ACTIVE", - "updated_at": "2020-03-24T01:11:25Z", - "wage_setting": { - "created_at": "2020-03-24T01:09:25Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "hourly_rate": { - "amount": 2400, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "2JCmiJol_KKFs9z2Evim", - "updated_at": "2020-03-24T01:09:25Z", - "version": 1 - }, - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T01:09:23Z", - "family_name": "Ipsum", - "given_name": "Elton", - "id": "4uXcJQSLtbk3F0UQHFNQ", - "is_owner": false, - "status": "ACTIVE", - "updated_at": "2020-03-24T01:15:23Z", - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T01:09:23Z", - "family_name": "Lo", - "given_name": "Steven", - "id": "5CoUpyrw1YwGWcRd-eDL", - "is_owner": false, - "status": "ACTIVE", - "updated_at": "2020-03-24T01:19:23Z", - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:03Z", - "family_name": "Steward", - "given_name": "Patrick", - "id": "5MRPTTp8MMBLVSmzrGha", - "is_owner": false, - "phone_number": "+14155552671", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:18:03Z", - "wage_setting": { - "created_at": "2020-03-24T18:14:03Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "5MRPTTp8MMBLVSmzrGha", - "updated_at": "2020-03-24T18:14:03Z", - "version": 1 - }, - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T01:09:25Z", - "family_name": "Manny", - "given_name": "Ivy", - "id": "7F5ZxsfRnkexhu1PTbfh", - "is_owner": false, - "status": "ACTIVE", - "updated_at": "2020-03-24T01:09:25Z", - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:02Z", - "email_address": "john_smith@example.com", - "family_name": "Smith", - "given_name": "John", - "id": "808X9HR72yKvVaigQXf4", - "is_owner": false, - "phone_number": "+14155552671", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:14:02Z", - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:00Z", - "email_address": "r_wen@example.com", - "family_name": "Wen", - "given_name": "Robert", - "id": "9MVDVoY4hazkWKGo_OuZ", - "is_owner": false, - "phone_number": "+14155552671", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:14:00Z", - "reference_id": "reference_id4" - }, - { - "assigned_locations": { - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" - }, - "created_at": "2020-03-24T18:14:00Z", - "email_address": "asimpson@example.com", - "family_name": "Simpson", - "given_name": "Ashley", - "id": "9UglUjOXQ13-hMFypCft", - "is_owner": false, - "phone_number": "+14155552671", - "status": "ACTIVE", - "updated_at": "2020-03-24T18:18:00Z", - "wage_setting": { - "created_at": "2020-03-24T18:14:00Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "9UglUjOXQ13-hMFypCft", - "updated_at": "2020-03-24T18:14:03Z", - "version": 1 - }, - "reference_id": "reference_id4" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-terminal-actions-request.md b/doc/models/search-terminal-actions-request.md deleted file mode 100644 index d265f16b..00000000 --- a/doc/models/search-terminal-actions-request.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Search Terminal Actions Request - -## Structure - -`SearchTerminalActionsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?TerminalActionQuery`](../../doc/models/terminal-action-query.md) | Optional | - | getQuery(): ?TerminalActionQuery | setQuery(?TerminalActionQuery query): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more
information. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | Limit the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "limit": 2, - "query": { - "filter": { - "created_at": { - "start_at": "2022-04-01T00:00:00.000Z", - "end_at": "end_at8" - }, - "device_id": "device_id0", - "status": "status6", - "type": "SAVE_CARD" - }, - "sort": { - "sort_order": "DESC" - } - }, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-terminal-actions-response.md b/doc/models/search-terminal-actions-response.md deleted file mode 100644 index 7347a9d0..00000000 --- a/doc/models/search-terminal-actions-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Search Terminal Actions Response - -## Structure - -`SearchTerminalActionsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `action` | [`?(TerminalAction[])`](../../doc/models/terminal-action.md) | Optional | The requested search result of `TerminalAction`s. | getAction(): ?array | setAction(?array action): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more
information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "action": [ - { - "app_id": "APP_ID", - "created_at": "2022-04-08T15:14:04.895Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:oBGWlAats8xWCiCE", - "location_id": "LOCATION_ID", - "save_card_options": { - "customer_id": "CUSTOMER_ID", - "reference_id": "user-id-1" - }, - "status": "IN_PROGRESS", - "type": "SAVE_CARD", - "updated_at": "2022-04-08T15:14:05.446Z", - "cancel_reason": "TIMED_OUT" - }, - { - "app_id": "APP_ID", - "created_at": "2022-04-08T15:14:01.210Z", - "deadline_duration": "PT5M", - "device_id": "DEVICE_ID", - "id": "termapia:K2NY2YSSml3lTiCE", - "location_id": "LOCATION_ID", - "save_card_options": { - "card_id": "ccof:CARD_ID", - "customer_id": "CUSTOMER_ID", - "reference_id": "user-id-1" - }, - "status": "COMPLETED", - "type": "SAVE_CARD", - "updated_at": "2022-04-08T15:14:09.861Z", - "cancel_reason": "TIMED_OUT" - } - ], - "cursor": "CURSOR", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-terminal-checkouts-request.md b/doc/models/search-terminal-checkouts-request.md deleted file mode 100644 index 2c83946b..00000000 --- a/doc/models/search-terminal-checkouts-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Search Terminal Checkouts Request - -## Structure - -`SearchTerminalCheckoutsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?TerminalCheckoutQuery`](../../doc/models/terminal-checkout-query.md) | Optional | - | getQuery(): ?TerminalCheckoutQuery | setQuery(?TerminalCheckoutQuery query): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.
See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | Limits the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "limit": 2, - "query": { - "filter": { - "status": "COMPLETED", - "device_id": "device_id0", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "sort": { - "sort_order": "DESC" - } - }, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-terminal-checkouts-response.md b/doc/models/search-terminal-checkouts-response.md deleted file mode 100644 index 0de4bf26..00000000 --- a/doc/models/search-terminal-checkouts-response.md +++ /dev/null @@ -1,123 +0,0 @@ - -# Search Terminal Checkouts Response - -## Structure - -`SearchTerminalCheckoutsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `checkouts` | [`?(TerminalCheckout[])`](../../doc/models/terminal-checkout.md) | Optional | The requested search result of `TerminalCheckout` objects. | getCheckouts(): ?array | setCheckouts(?array checkouts): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "checkouts": [ - { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "app_id": "APP_ID", - "created_at": "2020-03-31T18:13:15.921Z", - "deadline_duration": "PT5M", - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "collect_signature": false, - "show_itemized_cart": false - }, - "id": "tsQPvzwBpMqqO", - "note": "A brief note", - "payment_ids": [ - "rXnhZzywrEk4vR6pw76fPZfgvaB" - ], - "reference_id": "id14467", - "status": "COMPLETED", - "updated_at": "2020-03-31T18:13:52.725Z", - "order_id": "order_id2", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - }, - { - "amount_money": { - "amount": 2610, - "currency": "USD" - }, - "app_id": "APP_ID", - "created_at": "2020-03-31T18:08:31.882Z", - "deadline_duration": "PT5M", - "device_options": { - "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", - "skip_receipt_screen": true, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "collect_signature": false, - "show_itemized_cart": false - }, - "id": "XlOPTgcEhrbqO", - "note": "A brief note", - "payment_ids": [ - "VYBF861PaoKPP7Pih0TlbZiNvaB" - ], - "reference_id": "id41623", - "status": "COMPLETED", - "updated_at": "2020-03-31T18:08:41.635Z", - "order_id": "order_id2", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - } - } - ], - "cursor": "RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/search-terminal-refunds-request.md b/doc/models/search-terminal-refunds-request.md deleted file mode 100644 index ae4b69e4..00000000 --- a/doc/models/search-terminal-refunds-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Search Terminal Refunds Request - -## Structure - -`SearchTerminalRefundsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `query` | [`?TerminalRefundQuery`](../../doc/models/terminal-refund-query.md) | Optional | - | getQuery(): ?TerminalRefundQuery | setQuery(?TerminalRefundQuery query): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | Limits the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | - -## Example (as JSON) - -```json -{ - "limit": 1, - "query": { - "filter": { - "status": "COMPLETED", - "device_id": "device_id0", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - } - }, - "sort": { - "sort_order": "sort_order8" - } - }, - "cursor": "cursor4" -} -``` - diff --git a/doc/models/search-terminal-refunds-response.md b/doc/models/search-terminal-refunds-response.md deleted file mode 100644 index dbf0f17c..00000000 --- a/doc/models/search-terminal-refunds-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Search Terminal Refunds Response - -## Structure - -`SearchTerminalRefundsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `refunds` | [`?(TerminalRefund[])`](../../doc/models/terminal-refund.md) | Optional | The requested search result of `TerminalRefund` objects. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If empty,
this is the final response.

See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "refunds": [ - { - "amount_money": { - "amount": 111, - "currency": "CAD" - }, - "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", - "card": { - "bin": "411111", - "card_brand": "INTERAC", - "card_type": "CREDIT", - "exp_month": 1, - "exp_year": 2022, - "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", - "last_4": "1111" - }, - "created_at": "2020-09-29T15:21:46.771Z", - "deadline_duration": "PT5M", - "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "location_id": "76C9W6K8CNNQ5", - "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", - "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", - "reason": "Returning item", - "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", - "status": "COMPLETED", - "updated_at": "2020-09-29T15:21:48.675Z" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/search-vendors-request-filter.md b/doc/models/search-vendors-request-filter.md deleted file mode 100644 index 761af71c..00000000 --- a/doc/models/search-vendors-request-filter.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Search Vendors Request Filter - -Defines supported query expressions to search for vendors by. - -## Structure - -`SearchVendorsRequestFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?(string[])` | Optional | The names of the [Vendor](entity:Vendor) objects to retrieve. | getName(): ?array | setName(?array name): void | -| `status` | [`?(string(VendorStatus)[])`](../../doc/models/vendor-status.md) | Optional | The statuses of the [Vendor](entity:Vendor) objects to retrieve.
See [VendorStatus](#type-vendorstatus) for possible values | getStatus(): ?array | setStatus(?array status): void | - -## Example (as JSON) - -```json -{ - "name": [ - "name4", - "name5", - "name6" - ], - "status": [ - "ACTIVE", - "INACTIVE", - "ACTIVE" - ] -} -``` - diff --git a/doc/models/search-vendors-request-sort-field.md b/doc/models/search-vendors-request-sort-field.md deleted file mode 100644 index 11f90af3..00000000 --- a/doc/models/search-vendors-request-sort-field.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Search Vendors Request Sort Field - -The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. - -## Enumeration - -`SearchVendorsRequestSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `NAME` | To sort the result by the name of the [Vendor](../../doc/models/vendor.md) objects. | -| `CREATED_AT` | To sort the result by the creation time of the [Vendor](../../doc/models/vendor.md) objects. | - diff --git a/doc/models/search-vendors-request-sort.md b/doc/models/search-vendors-request-sort.md deleted file mode 100644 index 8a68dccc..00000000 --- a/doc/models/search-vendors-request-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Vendors Request Sort - -Defines a sorter used to sort results from [SearchVendors](../../doc/apis/vendors.md#search-vendors). - -## Structure - -`SearchVendorsRequestSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `field` | [`?string(SearchVendorsRequestSortField)`](../../doc/models/search-vendors-request-sort-field.md) | Optional | The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. | getField(): ?string | setField(?string field): void | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | - -## Example (as JSON) - -```json -{ - "field": "NAME", - "order": "DESC" -} -``` - diff --git a/doc/models/search-vendors-request.md b/doc/models/search-vendors-request.md deleted file mode 100644 index 23e983a7..00000000 --- a/doc/models/search-vendors-request.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Search Vendors Request - -Represents an input into a call to [SearchVendors](../../doc/apis/vendors.md#search-vendors). - -## Structure - -`SearchVendorsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchVendorsRequestFilter`](../../doc/models/search-vendors-request-filter.md) | Optional | Defines supported query expressions to search for vendors by. | getFilter(): ?SearchVendorsRequestFilter | setFilter(?SearchVendorsRequestFilter filter): void | -| `sort` | [`?SearchVendorsRequestSort`](../../doc/models/search-vendors-request-sort.md) | Optional | Defines a sorter used to sort results from [SearchVendors](../../doc/apis/vendors.md#search-vendors). | getSort(): ?SearchVendorsRequestSort | setSort(?SearchVendorsRequestSort sort): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "query": { - "filter": { - "name": [ - "Joe's Fresh Seafood", - "Hannah's Bakery" - ], - "status": [ - "ACTIVE" - ] - }, - "sort": { - "field": "CREATED_AT", - "order": "ASC" - } - }, - "filter": { - "name": [ - "name4", - "name5", - "name6" - ], - "status": [ - "ACTIVE", - "INACTIVE" - ] - }, - "sort": { - "field": "NAME", - "order": "DESC" - }, - "cursor": "cursor0" -} -``` - diff --git a/doc/models/search-vendors-response.md b/doc/models/search-vendors-response.md deleted file mode 100644 index 0c15d6d1..00000000 --- a/doc/models/search-vendors-response.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Search Vendors Response - -Represents an output from a call to [SearchVendors](../../doc/apis/vendors.md#search-vendors). - -## Structure - -`SearchVendorsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | getErrors(): ?array | setErrors(?array errors): void | -| `vendors` | [`?(Vendor[])`](../../doc/models/vendor.md) | Optional | The [Vendor](entity:Vendor) objects matching the specified search filter. | getVendors(): ?array | setVendors(?array vendors): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "vendors": [ - { - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4", - "name": "name8", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - { - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4", - "name": "name8", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - ], - "cursor": "cursor8" -} -``` - diff --git a/doc/models/segment-filter.md b/doc/models/segment-filter.md deleted file mode 100644 index dde141be..00000000 --- a/doc/models/segment-filter.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Segment Filter - -A query filter to search for buyer-accessible appointment segments by. - -## Structure - -`SegmentFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void | -| `teamMemberIdFilter` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getTeamMemberIdFilter(): ?FilterValue | setTeamMemberIdFilter(?FilterValue teamMemberIdFilter): void | - -## Example (as JSON) - -```json -{ - "service_variation_id": "service_variation_id0", - "team_member_id_filter": { - "all": [ - "all5", - "all6", - "all7" - ], - "any": [ - "any2", - "any3", - "any4" - ], - "none": [ - "none7", - "none8" - ] - } -} -``` - diff --git a/doc/models/select-option.md b/doc/models/select-option.md deleted file mode 100644 index 3c6b291b..00000000 --- a/doc/models/select-option.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Select Option - -## Structure - -`SelectOption` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `referenceId` | `string` | Required | The reference id for the option.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getReferenceId(): string | setReferenceId(string referenceId): void | -| `title` | `string` | Required | The title text that displays in the select option button.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | - -## Example (as JSON) - -```json -{ - "reference_id": "reference_id6", - "title": "title8" -} -``` - diff --git a/doc/models/select-options.md b/doc/models/select-options.md deleted file mode 100644 index ff8a67ee..00000000 --- a/doc/models/select-options.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Select Options - -## Structure - -`SelectOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | -| `body` | `string` | Required | The body text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | -| `options` | [`SelectOption[]`](../../doc/models/select-option.md) | Required | Represents the buttons/options that should be displayed in the select flow on the Terminal. | getOptions(): array | setOptions(array options): void | -| `selectedOption` | [`?SelectOption`](../../doc/models/select-option.md) | Optional | - | getSelectedOption(): ?SelectOption | setSelectedOption(?SelectOption selectedOption): void | - -## Example (as JSON) - -```json -{ - "title": "title0", - "body": "body0", - "options": [ - { - "reference_id": "reference_id0", - "title": "title2" - } - ], - "selected_option": { - "reference_id": "reference_id6", - "title": "title8" - } -} -``` - diff --git a/doc/models/shift-filter-status.md b/doc/models/shift-filter-status.md deleted file mode 100644 index 988934df..00000000 --- a/doc/models/shift-filter-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Shift Filter Status - -Specifies the `status` of `Shift` records to be returned. - -## Enumeration - -`ShiftFilterStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `OPEN` | Shifts that have been started and not ended. | -| `CLOSED` | Shifts that have been started and ended. | - diff --git a/doc/models/shift-filter.md b/doc/models/shift-filter.md deleted file mode 100644 index a31be986..00000000 --- a/doc/models/shift-filter.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Shift Filter - -Defines a filter used in a search for `Shift` records. `AND` logic is -used by Square's servers to apply each filter property specified. - -## Structure - -`ShiftFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationIds` | `?(string[])` | Optional | Fetch shifts for the specified location. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `employeeIds` | `?(string[])` | Optional | Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead. | getEmployeeIds(): ?array | setEmployeeIds(?array employeeIds): void | -| `status` | [`?string(ShiftFilterStatus)`](../../doc/models/shift-filter-status.md) | Optional | Specifies the `status` of `Shift` records to be returned. | getStatus(): ?string | setStatus(?string status): void | -| `start` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getStart(): ?TimeRange | setStart(?TimeRange start): void | -| `end` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getEnd(): ?TimeRange | setEnd(?TimeRange end): void | -| `workday` | [`?ShiftWorkday`](../../doc/models/shift-workday.md) | Optional | A `Shift` search query filter parameter that sets a range of days that
a `Shift` must start or end in before passing the filter condition. | getWorkday(): ?ShiftWorkday | setWorkday(?ShiftWorkday workday): void | -| `teamMemberIds` | `?(string[])` | Optional | Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". | getTeamMemberIds(): ?array | setTeamMemberIds(?array teamMemberIds): void | - -## Example (as JSON) - -```json -{ - "location_ids": [ - "location_ids8", - "location_ids9", - "location_ids0" - ], - "employee_ids": [ - "employee_ids3", - "employee_ids4", - "employee_ids5" - ], - "status": "OPEN", - "start": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "end": { - "start_at": "start_at0", - "end_at": "end_at2" - } -} -``` - diff --git a/doc/models/shift-query.md b/doc/models/shift-query.md deleted file mode 100644 index 11346f9c..00000000 --- a/doc/models/shift-query.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Shift Query - -The parameters of a `Shift` search query, which includes filter and sort options. - -## Structure - -`ShiftQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?ShiftFilter`](../../doc/models/shift-filter.md) | Optional | Defines a filter used in a search for `Shift` records. `AND` logic is
used by Square's servers to apply each filter property specified. | getFilter(): ?ShiftFilter | setFilter(?ShiftFilter filter): void | -| `sort` | [`?ShiftSort`](../../doc/models/shift-sort.md) | Optional | Sets the sort order of search results. | getSort(): ?ShiftSort | setSort(?ShiftSort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "location_ids": [ - "location_ids4" - ], - "employee_ids": [ - "employee_ids9" - ], - "status": "OPEN", - "start": { - "start_at": "start_at6", - "end_at": "end_at6" - }, - "end": { - "start_at": "start_at0", - "end_at": "end_at2" - } - }, - "sort": { - "field": "START_AT", - "order": "DESC" - } -} -``` - diff --git a/doc/models/shift-sort-field.md b/doc/models/shift-sort-field.md deleted file mode 100644 index eefd8b5c..00000000 --- a/doc/models/shift-sort-field.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Shift Sort Field - -Enumerates the `Shift` fields to sort on. - -## Enumeration - -`ShiftSortField` - -## Fields - -| Name | Description | -| --- | --- | -| `START_AT` | The start date/time of a `Shift` | -| `END_AT` | The end date/time of a `Shift` | -| `CREATED_AT` | The date/time that a `Shift` is created | -| `UPDATED_AT` | The most recent date/time that a `Shift` is updated | - diff --git a/doc/models/shift-sort.md b/doc/models/shift-sort.md deleted file mode 100644 index 54f21776..00000000 --- a/doc/models/shift-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Shift Sort - -Sets the sort order of search results. - -## Structure - -`ShiftSort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `field` | [`?string(ShiftSortField)`](../../doc/models/shift-sort-field.md) | Optional | Enumerates the `Shift` fields to sort on. | getField(): ?string | setField(?string field): void | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | - -## Example (as JSON) - -```json -{ - "field": "START_AT", - "order": "DESC" -} -``` - diff --git a/doc/models/shift-status.md b/doc/models/shift-status.md deleted file mode 100644 index dbeaf3c6..00000000 --- a/doc/models/shift-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Shift Status - -Enumerates the possible status of a `Shift`. - -## Enumeration - -`ShiftStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `OPEN` | Employee started a work shift and the shift is not complete | -| `CLOSED` | Employee started and ended a work shift. | - diff --git a/doc/models/shift-wage.md b/doc/models/shift-wage.md deleted file mode 100644 index cdd1e9f6..00000000 --- a/doc/models/shift-wage.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Shift Wage - -The hourly wage rate used to compensate an employee for this shift. - -## Structure - -`ShiftWage` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `?string` | Optional | The name of the job performed during this shift. | getTitle(): ?string | setTitle(?string title): void | -| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | -| `jobId` | `?string` | Optional | The id of the job performed during this shift. Square
labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void | -| `tipEligible` | `?bool` | Optional | Whether team members are eligible for tips when working this job. | getTipEligible(): ?bool | setTipEligible(?bool tipEligible): void | - -## Example (as JSON) - -```json -{ - "title": "title6", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "job_id": "job_id2", - "tip_eligible": false -} -``` - diff --git a/doc/models/shift-workday-matcher.md b/doc/models/shift-workday-matcher.md deleted file mode 100644 index 3d87afa5..00000000 --- a/doc/models/shift-workday-matcher.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Shift Workday Matcher - -Defines the logic used to apply a workday filter. - -## Enumeration - -`ShiftWorkdayMatcher` - -## Fields - -| Name | Description | -| --- | --- | -| `START_AT` | All shifts that start on or after the specified workday | -| `END_AT` | All shifts that end on or before the specified workday | -| `INTERSECTION` | All shifts that start between the start and end workdays (inclusive) | - diff --git a/doc/models/shift-workday.md b/doc/models/shift-workday.md deleted file mode 100644 index ab6e779e..00000000 --- a/doc/models/shift-workday.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Shift Workday - -A `Shift` search query filter parameter that sets a range of days that -a `Shift` must start or end in before passing the filter condition. - -## Structure - -`ShiftWorkday` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `dateRange` | [`?DateRange`](../../doc/models/date-range.md) | Optional | A range defined by two dates. Used for filtering a query for Connect v2
objects that have date properties. | getDateRange(): ?DateRange | setDateRange(?DateRange dateRange): void | -| `matchShiftsBy` | [`?string(ShiftWorkdayMatcher)`](../../doc/models/shift-workday-matcher.md) | Optional | Defines the logic used to apply a workday filter. | getMatchShiftsBy(): ?string | setMatchShiftsBy(?string matchShiftsBy): void | -| `defaultTimezone` | `?string` | Optional | Location-specific timezones convert workdays to datetime filters.
Every location included in the query must have a timezone or this field
must be provided as a fallback. Format: the IANA timezone database
identifier for the relevant timezone. | getDefaultTimezone(): ?string | setDefaultTimezone(?string defaultTimezone): void | - -## Example (as JSON) - -```json -{ - "date_range": { - "start_date": "start_date6", - "end_date": "end_date2" - }, - "match_shifts_by": "END_AT", - "default_timezone": "default_timezone2" -} -``` - diff --git a/doc/models/shift.md b/doc/models/shift.md deleted file mode 100644 index 3bca4b1a..00000000 --- a/doc/models/shift.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Shift - -A record of the hourly rate, start, and end times for a single work shift -for an employee. This might include a record of the start and end times for breaks -taken during the shift. - -## Structure - -`Shift` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `employeeId` | `?string` | Optional | The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead. | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `locationId` | `string` | Required | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `timezone` | `?string` | Optional | The read-only convenience value that is calculated from the location based
on the `location_id`. Format: the IANA timezone database identifier for the
location timezone. | getTimezone(): ?string | setTimezone(?string timezone): void | -| `startAt` | `string` | Required | RFC 3339; shifted to the location timezone + offset. Precision up to the
minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | getStartAt(): string | setStartAt(string startAt): void | -| `endAt` | `?string` | Optional | RFC 3339; shifted to the timezone + offset. Precision up to the minute is
respected; seconds are truncated. | getEndAt(): ?string | setEndAt(?string endAt): void | -| `wage` | [`?ShiftWage`](../../doc/models/shift-wage.md) | Optional | The hourly wage rate used to compensate an employee for this shift. | getWage(): ?ShiftWage | setWage(?ShiftWage wage): void | -| `breaks` | [`?(MBreak[])`](../../doc/models/m-break.md) | Optional | A list of all the paid or unpaid breaks that were taken during this shift. | getBreaks(): ?array | setBreaks(?array breaks): void | -| `status` | [`?string(ShiftStatus)`](../../doc/models/shift-status.md) | Optional | Enumerates the possible status of a `Shift`. | getStatus(): ?string | setStatus(?string status): void | -| `version` | `?int` | Optional | Used for resolving concurrency issues. The request fails if the version
provided does not match the server version at the time of the request. If not provided,
Square executes a blind write; potentially overwriting data from another
write. | getVersion(): ?int | setVersion(?int version): void | -| `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `teamMemberId` | `?string` | Optional | The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `declaredCashTipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getDeclaredCashTipMoney(): ?Money | setDeclaredCashTipMoney(?Money declaredCashTipMoney): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "employee_id": "employee_id0", - "location_id": "location_id4", - "timezone": "timezone0", - "start_at": "start_at2", - "end_at": "end_at0", - "wage": { - "title": "title8", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "job_id": "job_id0", - "tip_eligible": false - } -} -``` - diff --git a/doc/models/shipping-fee.md b/doc/models/shipping-fee.md deleted file mode 100644 index 81c5ed9d..00000000 --- a/doc/models/shipping-fee.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Shipping Fee - -## Structure - -`ShippingFee` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The name for the shipping fee. | getName(): ?string | setName(?string name): void | -| `charge` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getCharge(): Money | setCharge(Money charge): void | - -## Example (as JSON) - -```json -{ - "name": "name6", - "charge": { - "amount": 80, - "currency": "TTD" - } -} -``` - diff --git a/doc/models/signature-image.md b/doc/models/signature-image.md deleted file mode 100644 index ad87fdb9..00000000 --- a/doc/models/signature-image.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Signature Image - -## Structure - -`SignatureImage` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `imageType` | `?string` | Optional | The mime/type of the image data.
Use `image/png;base64` for png. | getImageType(): ?string | setImageType(?string imageType): void | -| `data` | `?string` | Optional | The base64 representation of the image. | getData(): ?string | setData(?string data): void | - -## Example (as JSON) - -```json -{ - "image_type": "image_type4", - "data": "data8" -} -``` - diff --git a/doc/models/signature-options.md b/doc/models/signature-options.md deleted file mode 100644 index a7df9ff3..00000000 --- a/doc/models/signature-options.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Signature Options - -## Structure - -`SignatureOptions` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `title` | `string` | Required | The title text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | -| `body` | `string` | Required | The body text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | -| `signature` | [`?(SignatureImage[])`](../../doc/models/signature-image.md) | Optional | An image representation of the collected signature. | getSignature(): ?array | setSignature(?array signature): void | - -## Example (as JSON) - -```json -{ - "title": "title2", - "body": "body8", - "signature": [ - { - "image_type": "image_type4", - "data": "data8" - }, - { - "image_type": "image_type4", - "data": "data8" - }, - { - "image_type": "image_type4", - "data": "data8" - } - ] -} -``` - diff --git a/doc/models/site.md b/doc/models/site.md deleted file mode 100644 index dde13cee..00000000 --- a/doc/models/site.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Site - -Represents a Square Online site, which is an online store for a Square seller. - -## Structure - -`Site` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the site.
**Constraints**: *Maximum Length*: `32` | getId(): ?string | setId(?string id): void | -| `siteTitle` | `?string` | Optional | The title of the site. | getSiteTitle(): ?string | setSiteTitle(?string siteTitle): void | -| `domain` | `?string` | Optional | The domain of the site (without the protocol). For example, `mysite1.square.site`. | getDomain(): ?string | setDomain(?string domain): void | -| `isPublished` | `?bool` | Optional | Indicates whether the site is published. | getIsPublished(): ?bool | setIsPublished(?bool isPublished): void | -| `createdAt` | `?string` | Optional | The timestamp of when the site was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the site was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "site_title": "site_title6", - "domain": "domain6", - "is_published": false, - "created_at": "created_at8" -} -``` - diff --git a/doc/models/snippet-response.md b/doc/models/snippet-response.md deleted file mode 100644 index c9b9ed12..00000000 --- a/doc/models/snippet-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Snippet Response - -## Structure - -`SnippetResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `snippet` | [`?Snippet`](../../doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "snippet": { - "id": "id0", - "site_id": "site_id6", - "content": "content4", - "created_at": "created_at8", - "updated_at": "updated_at4" - } -} -``` - diff --git a/doc/models/snippet.md b/doc/models/snippet.md deleted file mode 100644 index f81de782..00000000 --- a/doc/models/snippet.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Snippet - -Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. - -## Structure - -`Snippet` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID for the snippet.
**Constraints**: *Maximum Length*: `48` | getId(): ?string | setId(?string id): void | -| `siteId` | `?string` | Optional | The ID of the site that contains the snippet. | getSiteId(): ?string | setSiteId(?string siteId): void | -| `content` | `string` | Required | The snippet code, which can contain valid HTML, JavaScript, or both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65535` | getContent(): string | setContent(string content): void | -| `createdAt` | `?string` | Optional | The timestamp of when the snippet was initially added to the site, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the snippet was last updated on the site, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "site_id": "site_id8", - "content": "content6", - "created_at": "created_at0", - "updated_at": "updated_at8" -} -``` - diff --git a/doc/models/sort-order.md b/doc/models/sort-order.md deleted file mode 100644 index b9e77cba..00000000 --- a/doc/models/sort-order.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Sort Order - -The order (e.g., chronological or alphabetical) in which results from a request are returned. - -## Enumeration - -`SortOrder` - -## Fields - -| Name | Description | -| --- | --- | -| `DESC` | The results are returned in descending (e.g., newest-first or Z-A) order. | -| `ASC` | The results are returned in ascending (e.g., oldest-first or A-Z) order. | - diff --git a/doc/models/source-application.md b/doc/models/source-application.md deleted file mode 100644 index 7b69fea7..00000000 --- a/doc/models/source-application.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Source Application - -Represents information about the application used to generate a change. - -## Structure - -`SourceApplication` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `product` | [`?string(Product)`](../../doc/models/product.md) | Optional | Indicates the Square product used to generate a change. | getProduct(): ?string | setProduct(?string product): void | -| `applicationId` | `?string` | Optional | __Read only__ The Square-assigned ID of the application. This field is used only if the
[product](entity:Product) type is `EXTERNAL_API`. | getApplicationId(): ?string | setApplicationId(?string applicationId): void | -| `name` | `?string` | Optional | __Read only__ The display name of the application
(for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). | getName(): ?string | setName(?string name): void | - -## Example (as JSON) - -```json -{ - "product": "INVOICES", - "application_id": "application_id0", - "name": "name4" -} -``` - diff --git a/doc/models/square-account-details.md b/doc/models/square-account-details.md deleted file mode 100644 index 1c9dd1b8..00000000 --- a/doc/models/square-account-details.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Square Account Details - -Additional details about Square Account payments. - -## Structure - -`SquareAccountDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentSourceToken` | `?string` | Optional | Unique identifier for the payment source used for this payment.
**Constraints**: *Maximum Length*: `255` | getPaymentSourceToken(): ?string | setPaymentSourceToken(?string paymentSourceToken): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "payment_source_token": "payment_source_token8", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/standard-unit-description-group.md b/doc/models/standard-unit-description-group.md deleted file mode 100644 index 48a77f1d..00000000 --- a/doc/models/standard-unit-description-group.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Standard Unit Description Group - -Group of standard measurement units. - -## Structure - -`StandardUnitDescriptionGroup` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `standardUnitDescriptions` | [`?(StandardUnitDescription[])`](../../doc/models/standard-unit-description.md) | Optional | List of standard (non-custom) measurement units in this description group. | getStandardUnitDescriptions(): ?array | setStandardUnitDescriptions(?array standardUnitDescriptions): void | -| `languageCode` | `?string` | Optional | IETF language tag. | getLanguageCode(): ?string | setLanguageCode(?string languageCode): void | - -## Example (as JSON) - -```json -{ - "standard_unit_descriptions": [ - { - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" - }, - { - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" - }, - { - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" - } - ], - "language_code": "language_code4" -} -``` - diff --git a/doc/models/standard-unit-description.md b/doc/models/standard-unit-description.md deleted file mode 100644 index b624b1d8..00000000 --- a/doc/models/standard-unit-description.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Standard Unit Description - -Contains the name and abbreviation for standard measurement unit. - -## Structure - -`StandardUnitDescription` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `unit` | [`?MeasurementUnit`](../../doc/models/measurement-unit.md) | Optional | Represents a unit of measurement to use with a quantity, such as ounces
or inches. Exactly one of the following fields are required: `custom_unit`,
`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. | getUnit(): ?MeasurementUnit | setUnit(?MeasurementUnit unit): void | -| `name` | `?string` | Optional | UI display name of the measurement unit. For example, 'Pound'. | getName(): ?string | setName(?string name): void | -| `abbreviation` | `?string` | Optional | UI display abbreviation for the measurement unit. For example, 'lb'. | getAbbreviation(): ?string | setAbbreviation(?string abbreviation): void | - -## Example (as JSON) - -```json -{ - "unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_MILLILITER", - "weight_unit": "IMPERIAL_STONE" - }, - "name": "name4", - "abbreviation": "abbreviation6" -} -``` - diff --git a/doc/models/submit-evidence-response.md b/doc/models/submit-evidence-response.md deleted file mode 100644 index dfac8e55..00000000 --- a/doc/models/submit-evidence-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Submit Evidence Response - -Defines the fields in a `SubmitEvidence` response. - -## Structure - -`SubmitEvidenceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `dispute` | [`?Dispute`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | getDispute(): ?Dispute | setDispute(?Dispute dispute): void | - -## Example (as JSON) - -```json -{ - "dispute": { - "amount_money": { - "amount": 4350, - "currency": "USD" - }, - "brand_dispute_id": "100000399240", - "card_brand": "VISA", - "created_at": "2022-05-18T16:02:15.313Z", - "disputed_payment": { - "payment_id": "2yeBUWJzllJTpmnSqtMRAL19taB" - }, - "due_at": "2022-06-01T00:00:00.000Z", - "id": "EAZoK70gX3fyvibecLwIGB", - "location_id": "LSY8XKGSMMX94", - "reason": "CUSTOMER_REQUESTS_CREDIT", - "reported_at": "2022-05-18T00:00:00.000Z", - "state": "PROCESSING", - "updated_at": "2022-05-18T16:02:15.313Z", - "version": 4, - "dispute_id": "dispute_id8" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/subscription-action-type.md b/doc/models/subscription-action-type.md deleted file mode 100644 index bff9f231..00000000 --- a/doc/models/subscription-action-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Subscription Action Type - -Supported types of an action as a pending change to a subscription. - -## Enumeration - -`SubscriptionActionType` - -## Fields - -| Name | Description | -| --- | --- | -| `CANCEL` | The action to execute a scheduled cancellation of a subscription. | -| `PAUSE` | The action to execute a scheduled pause of a subscription. | -| `RESUME` | The action to execute a scheduled resumption of a subscription. | -| `SWAP_PLAN` | The action to execute a scheduled swap of a subscription plan in a subscription. | -| `CHANGE_BILLING_ANCHOR_DATE` | A billing anchor date change action. | - diff --git a/doc/models/subscription-action.md b/doc/models/subscription-action.md deleted file mode 100644 index 9fb4e066..00000000 --- a/doc/models/subscription-action.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Subscription Action - -Represents an action as a pending change to a subscription. - -## Structure - -`SubscriptionAction` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The ID of an action scoped to a subscription. | getId(): ?string | setId(?string id): void | -| `type` | [`?string(SubscriptionActionType)`](../../doc/models/subscription-action-type.md) | Optional | Supported types of an action as a pending change to a subscription. | getType(): ?string | setType(?string type): void | -| `effectiveDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. | getEffectiveDate(): ?string | setEffectiveDate(?string effectiveDate): void | -| `monthlyBillingAnchorDate` | `?int` | Optional | The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | -| `newPlanVariationId` | `?string` | Optional | The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. | getNewPlanVariationId(): ?string | setNewPlanVariationId(?string newPlanVariationId): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "type": "SWAP_PLAN", - "effective_date": "effective_date2", - "monthly_billing_anchor_date": 18, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ] -} -``` - diff --git a/doc/models/subscription-cadence.md b/doc/models/subscription-cadence.md deleted file mode 100644 index 0499ca72..00000000 --- a/doc/models/subscription-cadence.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Subscription Cadence - -Determines the billing cadence of a [Subscription](../../doc/models/subscription.md) - -## Enumeration - -`SubscriptionCadence` - -## Fields - -| Name | Description | -| --- | --- | -| `DAILY` | Once per day | -| `WEEKLY` | Once per week | -| `EVERY_TWO_WEEKS` | Every two weeks | -| `THIRTY_DAYS` | Once every 30 days | -| `SIXTY_DAYS` | Once every 60 days | -| `NINETY_DAYS` | Once every 90 days | -| `MONTHLY` | Once per month | -| `EVERY_TWO_MONTHS` | Once every two months | -| `QUARTERLY` | Once every three months | -| `EVERY_FOUR_MONTHS` | Once every four months | -| `EVERY_SIX_MONTHS` | Once every six months | -| `ANNUAL` | Once per year | -| `EVERY_TWO_YEARS` | Once every two years | - diff --git a/doc/models/subscription-event-info-code.md b/doc/models/subscription-event-info-code.md deleted file mode 100644 index de7baf13..00000000 --- a/doc/models/subscription-event-info-code.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Subscription Event Info Code - -Supported info codes of a subscription event. - -## Enumeration - -`SubscriptionEventInfoCode` - -## Fields - -| Name | Description | -| --- | --- | -| `LOCATION_NOT_ACTIVE` | The location is not active. | -| `LOCATION_CANNOT_ACCEPT_PAYMENT` | The location cannot accept payments. | -| `CUSTOMER_DELETED` | The subscribing customer profile has been deleted. | -| `CUSTOMER_NO_EMAIL` | The subscribing customer does not have an email. | -| `CUSTOMER_NO_NAME` | The subscribing customer does not have a name. | -| `USER_PROVIDED` | User-provided detail. | - diff --git a/doc/models/subscription-event-info.md b/doc/models/subscription-event-info.md deleted file mode 100644 index ef0b9027..00000000 --- a/doc/models/subscription-event-info.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Subscription Event Info - -Provides information about the subscription event. - -## Structure - -`SubscriptionEventInfo` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `detail` | `?string` | Optional | A human-readable explanation for the event. | getDetail(): ?string | setDetail(?string detail): void | -| `code` | [`?string(SubscriptionEventInfoCode)`](../../doc/models/subscription-event-info-code.md) | Optional | Supported info codes of a subscription event. | getCode(): ?string | setCode(?string code): void | - -## Example (as JSON) - -```json -{ - "detail": "detail8", - "code": "CUSTOMER_NO_NAME" -} -``` - diff --git a/doc/models/subscription-event-subscription-event-type.md b/doc/models/subscription-event-subscription-event-type.md deleted file mode 100644 index 8ca123a4..00000000 --- a/doc/models/subscription-event-subscription-event-type.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Subscription Event Subscription Event Type - -Supported types of an event occurred to a subscription. - -## Enumeration - -`SubscriptionEventSubscriptionEventType` - -## Fields - -| Name | Description | -| --- | --- | -| `START_SUBSCRIPTION` | The subscription was started. | -| `PLAN_CHANGE` | The subscription plan was changed. | -| `STOP_SUBSCRIPTION` | The subscription was stopped. | -| `DEACTIVATE_SUBSCRIPTION` | The subscription was deactivated | -| `RESUME_SUBSCRIPTION` | The subscription was resumed. | -| `PAUSE_SUBSCRIPTION` | The subscription was paused. | -| `BILLING_ANCHOR_DATE_CHANGED` | The billing anchor date was changed. | - diff --git a/doc/models/subscription-event.md b/doc/models/subscription-event.md deleted file mode 100644 index cb3dc9b5..00000000 --- a/doc/models/subscription-event.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Subscription Event - -Describes changes to a subscription and the subscription status. - -## Structure - -`SubscriptionEvent` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The ID of the subscription event. | getId(): string | setId(string id): void | -| `subscriptionEventType` | [`string(SubscriptionEventSubscriptionEventType)`](../../doc/models/subscription-event-subscription-event-type.md) | Required | Supported types of an event occurred to a subscription. | getSubscriptionEventType(): string | setSubscriptionEventType(string subscriptionEventType): void | -| `effectiveDate` | `string` | Required | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. | getEffectiveDate(): string | setEffectiveDate(string effectiveDate): void | -| `monthlyBillingAnchorDate` | `?int` | Optional | The day-of-the-month the billing anchor date was changed to, if applicable. | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `info` | [`?SubscriptionEventInfo`](../../doc/models/subscription-event-info.md) | Optional | Provides information about the subscription event. | getInfo(): ?SubscriptionEventInfo | setInfo(?SubscriptionEventInfo info): void | -| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | -| `planVariationId` | `string` | Required | The ID of the subscription plan variation associated with the subscription. | getPlanVariationId(): string | setPlanVariationId(string planVariationId): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "subscription_event_type": "RESUME_SUBSCRIPTION", - "effective_date": "effective_date4", - "monthly_billing_anchor_date": 54, - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - }, - "phases": [ - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - }, - { - "uid": "uid0", - "ordinal": 78, - "order_template_id": "order_template_id2", - "plan_phase_uid": "plan_phase_uid6" - } - ], - "plan_variation_id": "plan_variation_id0" -} -``` - diff --git a/doc/models/subscription-phase.md b/doc/models/subscription-phase.md deleted file mode 100644 index e0f214c9..00000000 --- a/doc/models/subscription-phase.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Subscription Phase - -Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). - -## Structure - -`SubscriptionPhase` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created. | getUid(): ?string | setUid(?string uid): void | -| `cadence` | [`string(SubscriptionCadence)`](../../doc/models/subscription-cadence.md) | Required | Determines the billing cadence of a [Subscription](../../doc/models/subscription.md) | getCadence(): string | setCadence(string cadence): void | -| `periods` | `?int` | Optional | The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. | getPeriods(): ?int | setPeriods(?int periods): void | -| `recurringPriceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getRecurringPriceMoney(): ?Money | setRecurringPriceMoney(?Money recurringPriceMoney): void | -| `ordinal` | `?int` | Optional | The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | -| `pricing` | [`?SubscriptionPricing`](../../doc/models/subscription-pricing.md) | Optional | Describes the pricing for the subscription. | getPricing(): ?SubscriptionPricing | setPricing(?SubscriptionPricing pricing): void | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "cadence": "EVERY_SIX_MONTHS", - "periods": 36, - "recurring_price_money": { - "amount": 66, - "currency": "ZMW" - }, - "ordinal": 2, - "pricing": { - "type": "STATIC", - "discount_ids": [ - "discount_ids5", - "discount_ids6" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } - } -} -``` - diff --git a/doc/models/subscription-pricing-type.md b/doc/models/subscription-pricing-type.md deleted file mode 100644 index 105aa699..00000000 --- a/doc/models/subscription-pricing-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Subscription Pricing Type - -Determines the pricing of a [Subscription](../../doc/models/subscription.md) - -## Enumeration - -`SubscriptionPricingType` - -## Fields - -| Name | Description | -| --- | --- | -| `STATIC` | Static pricing | -| `RELATIVE` | Relative pricing | - diff --git a/doc/models/subscription-pricing.md b/doc/models/subscription-pricing.md deleted file mode 100644 index d3c78640..00000000 --- a/doc/models/subscription-pricing.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Subscription Pricing - -Describes the pricing for the subscription. - -## Structure - -`SubscriptionPricing` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | [`?string(SubscriptionPricingType)`](../../doc/models/subscription-pricing-type.md) | Optional | Determines the pricing of a [Subscription](../../doc/models/subscription.md) | getType(): ?string | setType(?string type): void | -| `discountIds` | `?(string[])` | Optional | The ids of the discount catalog objects | getDiscountIds(): ?array | setDiscountIds(?array discountIds): void | -| `priceMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | - -## Example (as JSON) - -```json -{ - "type": "STATIC", - "discount_ids": [ - "discount_ids9", - "discount_ids0" - ], - "price_money": { - "amount": 202, - "currency": "GTQ" - } -} -``` - diff --git a/doc/models/subscription-source.md b/doc/models/subscription-source.md deleted file mode 100644 index 331ad387..00000000 --- a/doc/models/subscription-source.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Subscription Source - -The origination details of the subscription. - -## Structure - -`SubscriptionSource` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `?string` | Optional | The name used to identify the place (physical or digital) that
a subscription originates. If unset, the name defaults to the name
of the application that created the subscription.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | - -## Example (as JSON) - -```json -{ - "name": "name0" -} -``` - diff --git a/doc/models/subscription-status.md b/doc/models/subscription-status.md deleted file mode 100644 index 8693d786..00000000 --- a/doc/models/subscription-status.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Subscription Status - -Supported subscription statuses. - -## Enumeration - -`SubscriptionStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The subscription is pending to start in the future. | -| `ACTIVE` | The subscription is active. | -| `CANCELED` | The subscription is canceled. | -| `DEACTIVATED` | The subscription is deactivated. | -| `PAUSED` | The subscription is paused. | - diff --git a/doc/models/subscription-test-result.md b/doc/models/subscription-test-result.md deleted file mode 100644 index a2150633..00000000 --- a/doc/models/subscription-test-result.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Subscription Test Result - -Represents the details of a webhook subscription, including notification URL, -event types, and signature key. - -## Structure - -`SubscriptionTestResult` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A Square-generated unique ID for the subscription test result.
**Constraints**: *Maximum Length*: `64` | getId(): ?string | setId(?string id): void | -| `statusCode` | `?int` | Optional | The status code returned by the subscription notification URL. | getStatusCode(): ?int | setStatusCode(?int statusCode): void | -| `payload` | `?string` | Optional | An object containing the payload of the test event. For example, a `payment.created` event. | getPayload(): ?string | setPayload(?string payload): void | -| `createdAt` | `?string` | Optional | The timestamp of when the subscription was created, in RFC 3339 format.
For example, "2016-09-04T23:59:33.123Z". | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the subscription was updated, in RFC 3339 format. For example, "2016-09-04T23:59:33.123Z".
Because a subscription test result is unique, this field is the same as the `created_at` field. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "status_code": 208, - "payload": "payload6", - "created_at": "created_at8", - "updated_at": "updated_at4" -} -``` - diff --git a/doc/models/subscription.md b/doc/models/subscription.md deleted file mode 100644 index 75e12179..00000000 --- a/doc/models/subscription.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Subscription - -Represents a subscription purchased by a customer. - -For more information, see -[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - -## Structure - -`Subscription` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The Square-assigned ID of the subscription.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `locationId` | `?string` | Optional | The ID of the location associated with the subscription. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `planVariationId` | `?string` | Optional | The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). | getPlanVariationId(): ?string | setPlanVariationId(?string planVariationId): void | -| `customerId` | `?string` | Optional | The ID of the subscribing [customer](entity:Customer) profile. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `startDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. | getStartDate(): ?string | setStartDate(?string startDate): void | -| `canceledDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription,
when the subscription status changes to `CANCELED` and the subscription billing stops.

If this field is not set, the subscription ends according its subscription plan.

This field cannot be updated, other than being cleared. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | -| `chargedThroughDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the
subscription.

After the invoice is sent for a given billing period,
this date will be the last day of the billing period.
For example,
suppose for the month of May a subscriber gets an invoice
(or charged the card) on May 1. For the monthly billing scenario,
this date is then set to May 31. | getChargedThroughDate(): ?string | setChargedThroughDate(?string chargedThroughDate): void | -| `status` | [`?string(SubscriptionStatus)`](../../doc/models/subscription-status.md) | Optional | Supported subscription statuses. | getStatus(): ?string | setStatus(?string status): void | -| `taxPercentage` | `?string` | Optional | The tax amount applied when billing the subscription. The
percentage is expressed in decimal form, using a `'.'` as the decimal
separator and without a `'%'` sign. For example, a value of `7.5`
corresponds to 7.5%. | getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void | -| `invoiceIds` | `?(string[])` | Optional | The IDs of the [invoices](entity:Invoice) created for the
subscription, listed in order when the invoices were created
(newest invoices appear first). | getInvoiceIds(): ?array | setInvoiceIds(?array invoiceIds): void | -| `priceOverrideMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void | -| `version` | `?int` | Optional | The version of the object. When updating an object, the version
supplied must match the version in the database, otherwise the write will
be rejected as conflicting. | getVersion(): ?int | setVersion(?int version): void | -| `createdAt` | `?string` | Optional | The timestamp when the subscription was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `cardId` | `?string` | Optional | The ID of the [subscriber's](entity:Customer) [card](entity:Card)
used to charge for the subscription. | getCardId(): ?string | setCardId(?string cardId): void | -| `timezone` | `?string` | Optional | Timezone that will be used in date calculations for the subscription.
Defaults to the timezone of the location based on `location_id`.
Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). | getTimezone(): ?string | setTimezone(?string timezone): void | -| `source` | [`?SubscriptionSource`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | getSource(): ?SubscriptionSource | setSource(?SubscriptionSource source): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | The list of scheduled actions on this subscription. It is set only in the response from
[RetrieveSubscription](../../doc/apis/subscriptions.md#retrieve-subscription) with the query parameter
of `include=actions` or from
[SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) with the input parameter
of `include:["actions"]`. | getActions(): ?array | setActions(?array actions): void | -| `monthlyBillingAnchorDate` | `?int` | Optional | The day of the month on which the subscription will issue invoices and publish orders. | getMonthlyBillingAnchorDate(): ?int | setMonthlyBillingAnchorDate(?int monthlyBillingAnchorDate): void | -| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | array of phases for this subscription | getPhases(): ?array | setPhases(?array phases): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "location_id": "location_id8", - "plan_variation_id": "plan_variation_id8", - "customer_id": "customer_id2", - "start_date": "start_date8" -} -``` - diff --git a/doc/models/swap-plan-request.md b/doc/models/swap-plan-request.md deleted file mode 100644 index 696eb972..00000000 --- a/doc/models/swap-plan-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Swap Plan Request - -Defines input parameters in a call to the -[SwapPlan](../../doc/apis/subscriptions.md#swap-plan) endpoint. - -## Structure - -`SwapPlanRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `newPlanVariationId` | `?string` | Optional | The ID of the new subscription plan variation.

This field is required. | getNewPlanVariationId(): ?string | setNewPlanVariationId(?string newPlanVariationId): void | -| `phases` | [`?(PhaseInput[])`](../../doc/models/phase-input.md) | Optional | A list of PhaseInputs, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | - -## Example (as JSON) - -```json -{ - "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", - "phases": [ - { - "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", - "ordinal": 0 - } - ] -} -``` - diff --git a/doc/models/swap-plan-response.md b/doc/models/swap-plan-response.md deleted file mode 100644 index b644e5be..00000000 --- a/doc/models/swap-plan-response.md +++ /dev/null @@ -1,88 +0,0 @@ - -# Swap Plan Response - -Defines output parameters in a response of the -[SwapPlan](../../doc/apis/subscriptions.md#swap-plan) endpoint. - -## Structure - -`SwapPlanResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | -| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a `SWAP_PLAN` action created by the request. | getActions(): ?array | setActions(?array actions): void | - -## Example (as JSON) - -```json -{ - "actions": [ - { - "effective_date": "2023-11-17", - "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", - "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", - "phases": [ - { - "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", - "ordinal": 0, - "uid": "uid0", - "plan_phase_uid": "plan_phase_uid6" - } - ], - "type": "SWAP_PLAN", - "monthly_billing_anchor_date": 186 - } - ], - "subscription": { - "created_at": "2023-06-20T21:53:10Z", - "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", - "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", - "location_id": "S8GWD5R9QB376", - "phases": [ - { - "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", - "ordinal": 0, - "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", - "uid": "98d6f53b-40e1-4714-8827-032fd923be25" - } - ], - "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", - "price_override_money": { - "amount": 2000, - "currency": "USD" - }, - "source": { - "name": "My Application" - }, - "status": "ACTIVE", - "timezone": "America/Los_Angeles", - "version": 3, - "start_date": "start_date8" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/tax-calculation-phase.md b/doc/models/tax-calculation-phase.md deleted file mode 100644 index 314d812b..00000000 --- a/doc/models/tax-calculation-phase.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Tax Calculation Phase - -When to calculate the taxes due on a cart. - -## Enumeration - -`TaxCalculationPhase` - -## Fields - -| Name | Description | -| --- | --- | -| `TAX_SUBTOTAL_PHASE` | The fee is calculated based on the payment's subtotal. | -| `TAX_TOTAL_PHASE` | The fee is calculated based on the payment's total. | - diff --git a/doc/models/tax-ids.md b/doc/models/tax-ids.md deleted file mode 100644 index 2bf86782..00000000 --- a/doc/models/tax-ids.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Tax Ids - -Identifiers for the location used by various governments for tax purposes. - -## Structure - -`TaxIds` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `euVat` | `?string` | Optional | The EU VAT number for this location. For example, `IE3426675K`.
If the EU VAT number is present, it is well-formed and has been
validated with VIES, the VAT Information Exchange System. | getEuVat(): ?string | setEuVat(?string euVat): void | -| `frSiret` | `?string` | Optional | The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)
number is a 14-digit code issued by the French INSEE. For example, `39922799000021`. | getFrSiret(): ?string | setFrSiret(?string frSiret): void | -| `frNaf` | `?string` | Optional | The French government uses the NAF (Nomenclature des Activités Françaises) to display and
track economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) code.
For example, `6910Z`. | getFrNaf(): ?string | setFrNaf(?string frNaf): void | -| `esNif` | `?string` | Optional | The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain.
If it is present, it has been validated. For example, `73628495A`. | getEsNif(): ?string | setEsNif(?string esNif): void | -| `jpQii` | `?string` | Optional | The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.
For example, `T1234567890123`. | getJpQii(): ?string | setJpQii(?string jpQii): void | - -## Example (as JSON) - -```json -{ - "eu_vat": "eu_vat8", - "fr_siret": "fr_siret0", - "fr_naf": "fr_naf0", - "es_nif": "es_nif4", - "jp_qii": "jp_qii0" -} -``` - diff --git a/doc/models/tax-inclusion-type.md b/doc/models/tax-inclusion-type.md deleted file mode 100644 index d8f3c0d7..00000000 --- a/doc/models/tax-inclusion-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Tax Inclusion Type - -Whether to the tax amount should be additional to or included in the CatalogItem price. - -## Enumeration - -`TaxInclusionType` - -## Fields - -| Name | Description | -| --- | --- | -| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the
CatalogItemVariation price. For example, a $1.00 item with a 10% additive
tax would have a total cost to the buyer of $1.10. | -| `INCLUSIVE` | The tax is an inclusive tax. The tax amount is included in the
CatalogItemVariation price. For example, a $1.00 item with a 10% inclusive
tax would have a total cost to the buyer of $1.00, with $0.91 (91 cents) of
that total being the cost of the item and $0.09 (9 cents) being tax. | - diff --git a/doc/models/team-member-assigned-locations-assignment-type.md b/doc/models/team-member-assigned-locations-assignment-type.md deleted file mode 100644 index 6f582ec6..00000000 --- a/doc/models/team-member-assigned-locations-assignment-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Team Member Assigned Locations Assignment Type - -Enumerates the possible assignment types that the team member can have. - -## Enumeration - -`TeamMemberAssignedLocationsAssignmentType` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL_CURRENT_AND_FUTURE_LOCATIONS` | The team member is assigned to all current and future locations. The `location_ids` field
is empty if the team member has this assignment type. | -| `EXPLICIT_LOCATIONS` | The team member is assigned to an explicit subset of locations. The `location_ids` field
is the list of locations that the team member is assigned to. | - diff --git a/doc/models/team-member-assigned-locations.md b/doc/models/team-member-assigned-locations.md deleted file mode 100644 index 729d1118..00000000 --- a/doc/models/team-member-assigned-locations.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Team Member Assigned Locations - -An object that represents a team member's assignment to locations. - -## Structure - -`TeamMemberAssignedLocations` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `assignmentType` | [`?string(TeamMemberAssignedLocationsAssignmentType)`](../../doc/models/team-member-assigned-locations-assignment-type.md) | Optional | Enumerates the possible assignment types that the team member can have. | getAssignmentType(): ?string | setAssignmentType(?string assignmentType): void | -| `locationIds` | `?(string[])` | Optional | The explicit locations that the team member is assigned to. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | - -## Example (as JSON) - -```json -{ - "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS", - "location_ids": [ - "location_ids4", - "location_ids5" - ] -} -``` - diff --git a/doc/models/team-member-booking-profile.md b/doc/models/team-member-booking-profile.md deleted file mode 100644 index 395d82b2..00000000 --- a/doc/models/team-member-booking-profile.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Team Member Booking Profile - -The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider. - -## Structure - -`TeamMemberBookingProfile` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberId` | `?string` | Optional | The ID of the [TeamMember](entity:TeamMember) object for the team member associated with the booking profile.
**Constraints**: *Maximum Length*: `32` | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `description` | `?string` | Optional | The description of the team member.
**Constraints**: *Maximum Length*: `65536` | getDescription(): ?string | setDescription(?string description): void | -| `displayName` | `?string` | Optional | The display name of the team member.
**Constraints**: *Maximum Length*: `512` | getDisplayName(): ?string | setDisplayName(?string displayName): void | -| `isBookable` | `?bool` | Optional | Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true`) or not (`false`). | getIsBookable(): ?bool | setIsBookable(?bool isBookable): void | -| `profileImageUrl` | `?string` | Optional | The URL of the team member's image for the bookings profile.
**Constraints**: *Maximum Length*: `2048` | getProfileImageUrl(): ?string | setProfileImageUrl(?string profileImageUrl): void | - -## Example (as JSON) - -```json -{ - "team_member_id": "team_member_id0", - "description": "description0", - "display_name": "display_name0", - "is_bookable": false, - "profile_image_url": "profile_image_url6" -} -``` - diff --git a/doc/models/team-member-invitation-status.md b/doc/models/team-member-invitation-status.md deleted file mode 100644 index cd18b4cb..00000000 --- a/doc/models/team-member-invitation-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Team Member Invitation Status - -Enumerates the possible invitation statuses the team member can have within a business. - -## Enumeration - -`TeamMemberInvitationStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `UNINVITED` | The team member has not received an invitation. | -| `PENDING` | The team member has received an invitation, but had not accepted it. | -| `ACCEPTED` | The team member has both received and accepted an invitation. | - diff --git a/doc/models/team-member-status.md b/doc/models/team-member-status.md deleted file mode 100644 index 93dacc25..00000000 --- a/doc/models/team-member-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Team Member Status - -Enumerates the possible statuses the team member can have within a business. - -## Enumeration - -`TeamMemberStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | The team member can sign in to Point of Sale and the Seller Dashboard. | -| `INACTIVE` | The team member can no longer sign in to Point of Sale or the Seller Dashboard,
but the team member's sales reports remain available. | - diff --git a/doc/models/team-member-wage.md b/doc/models/team-member-wage.md deleted file mode 100644 index 724e6a43..00000000 --- a/doc/models/team-member-wage.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Team Member Wage - -The hourly wage rate that a team member earns on a `Shift` for doing the job -specified by the `title` property of this object. - -## Structure - -`TeamMemberWage` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object. | getId(): ?string | setId(?string id): void | -| `teamMemberId` | `?string` | Optional | The `TeamMember` that this wage is assigned to. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `title` | `?string` | Optional | The job title that this wage relates to. | getTitle(): ?string | setTitle(?string title): void | -| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | -| `jobId` | `?string` | Optional | An identifier for the job that this wage relates to. This cannot be
used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void | -| `tipEligible` | `?bool` | Optional | Whether team members are eligible for tips when working this job. | getTipEligible(): ?bool | setTipEligible(?bool tipEligible): void | - -## Example (as JSON) - -```json -{ - "id": "id2", - "team_member_id": "team_member_id2", - "title": "title8", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "job_id": "job_id0" -} -``` - diff --git a/doc/models/team-member.md b/doc/models/team-member.md deleted file mode 100644 index 9a9b2cb1..00000000 --- a/doc/models/team-member.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Team Member - -A record representing an individual team member for a business. - -## Structure - -`TeamMember` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The unique ID for the team member. | getId(): ?string | setId(?string id): void | -| `referenceId` | `?string` | Optional | A second ID used to associate the team member with an entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `isOwner` | `?bool` | Optional | Whether the team member is the owner of the Square account. | getIsOwner(): ?bool | setIsOwner(?bool isOwner): void | -| `status` | [`?string(TeamMemberStatus)`](../../doc/models/team-member-status.md) | Optional | Enumerates the possible statuses the team member can have within a business. | getStatus(): ?string | setStatus(?string status): void | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the team member. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the team member. | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `emailAddress` | `?string` | Optional | The email address associated with the team member. After accepting the invitation
from Square, only the team member can change this value. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `phoneNumber` | `?string` | Optional | The team member's phone number, in E.164 format. For example:
+14155552671 - the country code is 1 for US
+551155256325 - the country code is 55 for BR | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `createdAt` | `?string` | Optional | The timestamp when the team member was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the team member was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `assignedLocations` | [`?TeamMemberAssignedLocations`](../../doc/models/team-member-assigned-locations.md) | Optional | An object that represents a team member's assignment to locations. | getAssignedLocations(): ?TeamMemberAssignedLocations | setAssignedLocations(?TeamMemberAssignedLocations assignedLocations): void | -| `wageSetting` | [`?WageSetting`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | getWageSetting(): ?WageSetting | setWageSetting(?WageSetting wageSetting): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "reference_id": "reference_id8", - "is_owner": false, - "status": "ACTIVE", - "given_name": "given_name6" -} -``` - diff --git a/doc/models/tender-bank-account-details-status.md b/doc/models/tender-bank-account-details-status.md deleted file mode 100644 index 29b0c1f1..00000000 --- a/doc/models/tender-bank-account-details-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Tender Bank Account Details Status - -Indicates the bank account payment's current status. - -## Enumeration - -`TenderBankAccountDetailsStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `PENDING` | The bank account payment is in progress. | -| `COMPLETED` | The bank account payment has been completed. | -| `FAILED` | The bank account payment failed. | - diff --git a/doc/models/tender-bank-account-details.md b/doc/models/tender-bank-account-details.md deleted file mode 100644 index 6b0059cd..00000000 --- a/doc/models/tender-bank-account-details.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Tender Bank Account Details - -Represents the details of a tender with `type` `BANK_ACCOUNT`. - -See [BankAccountPaymentDetails](../../doc/models/bank-account-payment-details.md) -for more exposed details of a bank account payment. - -## Structure - -`TenderBankAccountDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | [`?string(TenderBankAccountDetailsStatus)`](../../doc/models/tender-bank-account-details-status.md) | Optional | Indicates the bank account payment's current status. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "status": "FAILED" -} -``` - diff --git a/doc/models/tender-buy-now-pay-later-details-brand.md b/doc/models/tender-buy-now-pay-later-details-brand.md deleted file mode 100644 index 49e6ff57..00000000 --- a/doc/models/tender-buy-now-pay-later-details-brand.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Tender Buy Now Pay Later Details Brand - -## Enumeration - -`TenderBuyNowPayLaterDetailsBrand` - -## Fields - -| Name | -| --- | -| `OTHER_BRAND` | -| `AFTERPAY` | - diff --git a/doc/models/tender-buy-now-pay-later-details-status.md b/doc/models/tender-buy-now-pay-later-details-status.md deleted file mode 100644 index 2dacca32..00000000 --- a/doc/models/tender-buy-now-pay-later-details-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Tender Buy Now Pay Later Details Status - -## Enumeration - -`TenderBuyNowPayLaterDetailsStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `AUTHORIZED` | The buy now pay later payment has been authorized but not yet captured. | -| `CAPTURED` | The buy now pay later payment was authorized and subsequently captured (i.e., completed). | -| `VOIDED` | The buy now pay later payment was authorized and subsequently voided (i.e., canceled). | -| `FAILED` | The buy now pay later payment failed. | - diff --git a/doc/models/tender-buy-now-pay-later-details.md b/doc/models/tender-buy-now-pay-later-details.md deleted file mode 100644 index d0d3e5ed..00000000 --- a/doc/models/tender-buy-now-pay-later-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Tender Buy Now Pay Later Details - -Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. - -## Structure - -`TenderBuyNowPayLaterDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `buyNowPayLaterBrand` | [`?string(TenderBuyNowPayLaterDetailsBrand)`](../../doc/models/tender-buy-now-pay-later-details-brand.md) | Optional | - | getBuyNowPayLaterBrand(): ?string | setBuyNowPayLaterBrand(?string buyNowPayLaterBrand): void | -| `status` | [`?string(TenderBuyNowPayLaterDetailsStatus)`](../../doc/models/tender-buy-now-pay-later-details-status.md) | Optional | - | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "buy_now_pay_later_brand": "OTHER_BRAND", - "status": "AUTHORIZED" -} -``` - diff --git a/doc/models/tender-card-details-entry-method.md b/doc/models/tender-card-details-entry-method.md deleted file mode 100644 index 24603553..00000000 --- a/doc/models/tender-card-details-entry-method.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Tender Card Details Entry Method - -Indicates the method used to enter the card's details. - -## Enumeration - -`TenderCardDetailsEntryMethod` - -## Fields - -| Name | Description | -| --- | --- | -| `SWIPED` | The card was swiped through a Square reader or Square stand. | -| `KEYED` | The card information was keyed manually into Square Point of Sale or a
Square-hosted web form. | -| `EMV` | The card was processed via EMV with a Square reader. | -| `ON_FILE` | The buyer's card details were already on file with Square. | -| `CONTACTLESS` | The card was processed via a contactless (i.e., NFC) transaction
with a Square reader. | - diff --git a/doc/models/tender-card-details-status.md b/doc/models/tender-card-details-status.md deleted file mode 100644 index fe05323a..00000000 --- a/doc/models/tender-card-details-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Tender Card Details Status - -Indicates the card transaction's current status. - -## Enumeration - -`TenderCardDetailsStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `AUTHORIZED` | The card transaction has been authorized but not yet captured. | -| `CAPTURED` | The card transaction was authorized and subsequently captured (i.e., completed). | -| `VOIDED` | The card transaction was authorized and subsequently voided (i.e., canceled). | -| `FAILED` | The card transaction failed. | - diff --git a/doc/models/tender-card-details.md b/doc/models/tender-card-details.md deleted file mode 100644 index bf80866b..00000000 --- a/doc/models/tender-card-details.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Tender Card Details - -Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` - -## Structure - -`TenderCardDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | [`?string(TenderCardDetailsStatus)`](../../doc/models/tender-card-details-status.md) | Optional | Indicates the card transaction's current status. | getStatus(): ?string | setStatus(?string status): void | -| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void | -| `entryMethod` | [`?string(TenderCardDetailsEntryMethod)`](../../doc/models/tender-card-details-entry-method.md) | Optional | Indicates the method used to enter the card's details. | getEntryMethod(): ?string | setEntryMethod(?string entryMethod): void | - -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "card": { - "id": "id6", - "card_brand": "OTHER_BRAND", - "last_4": "last_48", - "exp_month": 228, - "exp_year": 68 - }, - "entry_method": "CONTACTLESS" -} -``` - diff --git a/doc/models/tender-cash-details.md b/doc/models/tender-cash-details.md deleted file mode 100644 index 4be002c6..00000000 --- a/doc/models/tender-cash-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Tender Cash Details - -Represents the details of a tender with `type` `CASH`. - -## Structure - -`TenderCashDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `buyerTenderedMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getBuyerTenderedMoney(): ?Money | setBuyerTenderedMoney(?Money buyerTenderedMoney): void | -| `changeBackMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getChangeBackMoney(): ?Money | setChangeBackMoney(?Money changeBackMoney): void | - -## Example (as JSON) - -```json -{ - "buyer_tendered_money": { - "amount": 238, - "currency": "XOF" - }, - "change_back_money": { - "amount": 78, - "currency": "XBD" - } -} -``` - diff --git a/doc/models/tender-square-account-details-status.md b/doc/models/tender-square-account-details-status.md deleted file mode 100644 index 8c46abdf..00000000 --- a/doc/models/tender-square-account-details-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Tender Square Account Details Status - -## Enumeration - -`TenderSquareAccountDetailsStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `AUTHORIZED` | The Square Account payment has been authorized but not yet captured. | -| `CAPTURED` | The Square Account payment was authorized and subsequently captured (i.e., completed). | -| `VOIDED` | The Square Account payment was authorized and subsequently voided (i.e., canceled). | -| `FAILED` | The Square Account payment failed. | - diff --git a/doc/models/tender-square-account-details.md b/doc/models/tender-square-account-details.md deleted file mode 100644 index 83713689..00000000 --- a/doc/models/tender-square-account-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Tender Square Account Details - -Represents the details of a tender with `type` `SQUARE_ACCOUNT`. - -## Structure - -`TenderSquareAccountDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `status` | [`?string(TenderSquareAccountDetailsStatus)`](../../doc/models/tender-square-account-details-status.md) | Optional | - | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "status": "AUTHORIZED" -} -``` - diff --git a/doc/models/tender-type.md b/doc/models/tender-type.md deleted file mode 100644 index 6771990f..00000000 --- a/doc/models/tender-type.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Tender Type - -Indicates a tender's type. - -## Enumeration - -`TenderType` - -## Fields - -| Name | Description | -| --- | --- | -| `CARD` | A credit card. | -| `CASH` | Cash. | -| `THIRD_PARTY_CARD` | A credit card processed with a card processor other than Square.

This value applies only to merchants in countries where Square does not
yet provide card processing. | -| `SQUARE_GIFT_CARD` | A Square gift card. | -| `NO_SALE` | This tender represents the register being opened for a "no sale" event. | -| `BANK_ACCOUNT` | A bank account payment. | -| `WALLET` | A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,
Au Pay, D Barai, Merpay, Wechat Pay, Alipay.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | -| `BUY_NOW_PAY_LATER` | A Buy Now Pay Later payment. | -| `SQUARE_ACCOUNT` | A Square House Account payment. | -| `OTHER` | A form of tender that does not match any other value. | - diff --git a/doc/models/tender.md b/doc/models/tender.md deleted file mode 100644 index b4a493f2..00000000 --- a/doc/models/tender.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Tender - -Represents a tender (i.e., a method of payment) used in a Square transaction. - -## Structure - -`Tender` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The tender's unique ID. It is the associated payment ID.
**Constraints**: *Maximum Length*: `192` | getId(): ?string | setId(?string id): void | -| `locationId` | `?string` | Optional | The ID of the transaction's associated location.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `transactionId` | `?string` | Optional | The ID of the tender's associated transaction.
**Constraints**: *Maximum Length*: `192` | getTransactionId(): ?string | setTransactionId(?string transactionId): void | -| `createdAt` | `?string` | Optional | The timestamp for when the tender was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `note` | `?string` | Optional | An optional note associated with the tender at the time of payment.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `amountMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | -| `tipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | -| `processingFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getProcessingFeeMoney(): ?Money | setProcessingFeeMoney(?Money processingFeeMoney): void | -| `customerId` | `?string` | Optional | If the tender is associated with a customer or represents a customer's card on file,
this is the ID of the associated customer.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `type` | [`string(TenderType)`](../../doc/models/tender-type.md) | Required | Indicates a tender's type. | getType(): string | setType(string type): void | -| `cardDetails` | [`?TenderCardDetails`](../../doc/models/tender-card-details.md) | Optional | Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` | getCardDetails(): ?TenderCardDetails | setCardDetails(?TenderCardDetails cardDetails): void | -| `cashDetails` | [`?TenderCashDetails`](../../doc/models/tender-cash-details.md) | Optional | Represents the details of a tender with `type` `CASH`. | getCashDetails(): ?TenderCashDetails | setCashDetails(?TenderCashDetails cashDetails): void | -| `bankAccountDetails` | [`?TenderBankAccountDetails`](../../doc/models/tender-bank-account-details.md) | Optional | Represents the details of a tender with `type` `BANK_ACCOUNT`.

See [BankAccountPaymentDetails](../../doc/models/bank-account-payment-details.md)
for more exposed details of a bank account payment. | getBankAccountDetails(): ?TenderBankAccountDetails | setBankAccountDetails(?TenderBankAccountDetails bankAccountDetails): void | -| `buyNowPayLaterDetails` | [`?TenderBuyNowPayLaterDetails`](../../doc/models/tender-buy-now-pay-later-details.md) | Optional | Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. | getBuyNowPayLaterDetails(): ?TenderBuyNowPayLaterDetails | setBuyNowPayLaterDetails(?TenderBuyNowPayLaterDetails buyNowPayLaterDetails): void | -| `squareAccountDetails` | [`?TenderSquareAccountDetails`](../../doc/models/tender-square-account-details.md) | Optional | Represents the details of a tender with `type` `SQUARE_ACCOUNT`. | getSquareAccountDetails(): ?TenderSquareAccountDetails | setSquareAccountDetails(?TenderSquareAccountDetails squareAccountDetails): void | -| `additionalRecipients` | [`?(AdditionalRecipient[])`](../../doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this tender.
For example, fees assessed on the purchase by a third party integration. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | -| `paymentId` | `?string` | Optional | The ID of the [Payment](entity:Payment) that corresponds to this tender.
This value is only present for payments created with the v2 Payments API.
**Constraints**: *Maximum Length*: `192` | getPaymentId(): ?string | setPaymentId(?string paymentId): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "created_at": "created_at6", - "note": "note4", - "type": "SQUARE_ACCOUNT" -} -``` - diff --git a/doc/models/terminal-action-action-type.md b/doc/models/terminal-action-action-type.md deleted file mode 100644 index 09d26ffd..00000000 --- a/doc/models/terminal-action-action-type.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Terminal Action Action Type - -Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. - -## Enumeration - -`TerminalActionActionType` - -## Fields - -| Name | Description | -| --- | --- | -| `QR_CODE` | The action represents a request to display a QR code. Details are contained in
the `qr_code_options` object. | -| `PING` | The action represents a request to check if the specific device is
online or currently active with the merchant in question. Does not require an action options value. | -| `SAVE_CARD` | Represents a request to save a card for future card-on-file use. Details are contained
in the `save_card_options` object. | -| `SIGNATURE` | The action represents a request to capture a buyer's signature. Details are contained
in the `signature_options` object. | -| `CONFIRMATION` | The action represents a request to collect a buyer's confirmation decision to the
displayed terms. Details are contained in the `confirmation_options` object. | -| `RECEIPT` | The action represents a request to display the receipt screen options. Details are
contained in the `receipt_options` object. | -| `DATA_COLLECTION` | The action represents a request to collect a buyer's text data. Details
are contained in the `data_collection_options` object. | -| `SELECT` | The action represents a request to allow the buyer to select from provided options.
Details are contained in the `select_options` object. | - diff --git a/doc/models/terminal-action-query-filter.md b/doc/models/terminal-action-query-filter.md deleted file mode 100644 index 84f17d07..00000000 --- a/doc/models/terminal-action-query-filter.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Terminal Action Query Filter - -## Structure - -`TerminalActionQueryFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `deviceId` | `?string` | Optional | `TerminalAction`s associated with a specific device. If no device is specified then all
`TerminalAction`s for the merchant will be displayed. | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | -| `status` | `?string` | Optional | Filter results with the desired status of the `TerminalAction`
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | getStatus(): ?string | setStatus(?string status): void | -| `type` | [`?string(TerminalActionActionType)`](../../doc/models/terminal-action-action-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | getType(): ?string | setType(?string type): void | - -## Example (as JSON) - -```json -{ - "device_id": "device_id4", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status0", - "type": "DATA_COLLECTION" -} -``` - diff --git a/doc/models/terminal-action-query-sort.md b/doc/models/terminal-action-query-sort.md deleted file mode 100644 index ab6ebb6d..00000000 --- a/doc/models/terminal-action-query-sort.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Terminal Action Query Sort - -## Structure - -`TerminalActionQuerySort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "sort_order": "DESC" -} -``` - diff --git a/doc/models/terminal-action-query.md b/doc/models/terminal-action-query.md deleted file mode 100644 index 01daa11a..00000000 --- a/doc/models/terminal-action-query.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Terminal Action Query - -## Structure - -`TerminalActionQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?TerminalActionQueryFilter`](../../doc/models/terminal-action-query-filter.md) | Optional | - | getFilter(): ?TerminalActionQueryFilter | setFilter(?TerminalActionQueryFilter filter): void | -| `sort` | [`?TerminalActionQuerySort`](../../doc/models/terminal-action-query-sort.md) | Optional | - | getSort(): ?TerminalActionQuerySort | setSort(?TerminalActionQuerySort sort): void | - -## Example (as JSON) - -```json -{ - "include": [ - "CUSTOMER" - ], - "limit": 2, - "query": { - "filter": { - "status": "COMPLETED" - } - }, - "filter": { - "device_id": "device_id0", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status6", - "type": "SAVE_CARD" - }, - "sort": { - "sort_order": "DESC" - } -} -``` - diff --git a/doc/models/terminal-action.md b/doc/models/terminal-action.md deleted file mode 100644 index 40e5d289..00000000 --- a/doc/models/terminal-action.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Terminal Action - -Represents an action processed by the Square Terminal. - -## Structure - -`TerminalAction` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID for this `TerminalAction`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `deviceId` | `?string` | Optional | The unique Id of the device intended for this `TerminalAction`.
The Id can be retrieved from /v2/devices api. | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `deadlineDuration` | `?string` | Optional | The duration as an RFC 3339 duration, after which the action will be automatically canceled.
TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason
of `TIMED_OUT`

Default: 5 minutes from creation

Maximum: 5 minutes | getDeadlineDuration(): ?string | setDeadlineDuration(?string deadlineDuration): void | -| `status` | `?string` | Optional | The status of the `TerminalAction`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | getStatus(): ?string | setStatus(?string status): void | -| `cancelReason` | [`?string(ActionCancelReason)`](../../doc/models/action-cancel-reason.md) | Optional | - | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `createdAt` | `?string` | Optional | The time when the `TerminalAction` was created as an RFC 3339 timestamp. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `appId` | `?string` | Optional | The ID of the application that created the action. | getAppId(): ?string | setAppId(?string appId): void | -| `locationId` | `?string` | Optional | The location id the action is attached to, if a link can be made.
**Constraints**: *Maximum Length*: `64` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `type` | [`?string(TerminalActionActionType)`](../../doc/models/terminal-action-action-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | getType(): ?string | setType(?string type): void | -| `qrCodeOptions` | [`?QrCodeOptions`](../../doc/models/qr-code-options.md) | Optional | Fields to describe the action that displays QR-Codes. | getQrCodeOptions(): ?QrCodeOptions | setQrCodeOptions(?QrCodeOptions qrCodeOptions): void | -| `saveCardOptions` | [`?SaveCardOptions`](../../doc/models/save-card-options.md) | Optional | Describes save-card action fields. | getSaveCardOptions(): ?SaveCardOptions | setSaveCardOptions(?SaveCardOptions saveCardOptions): void | -| `signatureOptions` | [`?SignatureOptions`](../../doc/models/signature-options.md) | Optional | - | getSignatureOptions(): ?SignatureOptions | setSignatureOptions(?SignatureOptions signatureOptions): void | -| `confirmationOptions` | [`?ConfirmationOptions`](../../doc/models/confirmation-options.md) | Optional | - | getConfirmationOptions(): ?ConfirmationOptions | setConfirmationOptions(?ConfirmationOptions confirmationOptions): void | -| `receiptOptions` | [`?ReceiptOptions`](../../doc/models/receipt-options.md) | Optional | Describes receipt action fields. | getReceiptOptions(): ?ReceiptOptions | setReceiptOptions(?ReceiptOptions receiptOptions): void | -| `dataCollectionOptions` | [`?DataCollectionOptions`](../../doc/models/data-collection-options.md) | Optional | - | getDataCollectionOptions(): ?DataCollectionOptions | setDataCollectionOptions(?DataCollectionOptions dataCollectionOptions): void | -| `selectOptions` | [`?SelectOptions`](../../doc/models/select-options.md) | Optional | - | getSelectOptions(): ?SelectOptions | setSelectOptions(?SelectOptions selectOptions): void | -| `deviceMetadata` | [`?DeviceMetadata`](../../doc/models/device-metadata.md) | Optional | - | getDeviceMetadata(): ?DeviceMetadata | setDeviceMetadata(?DeviceMetadata deviceMetadata): void | -| `awaitNextAction` | `?bool` | Optional | Indicates the action will be linked to another action and requires a waiting dialog to be
displayed instead of returning to the idle screen on completion of the action.

Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. | getAwaitNextAction(): ?bool | setAwaitNextAction(?bool awaitNextAction): void | -| `awaitNextActionDuration` | `?string` | Optional | The timeout duration of the waiting dialog as an RFC 3339 duration, after which the
waiting dialog will no longer be displayed and the Terminal will return to the idle screen.

Default: 5 minutes from when the waiting dialog is displayed

Maximum: 5 minutes | getAwaitNextActionDuration(): ?string | setAwaitNextActionDuration(?string awaitNextActionDuration): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "device_id": "device_id4", - "deadline_duration": "deadline_duration0", - "status": "status0", - "cancel_reason": "TIMED_OUT" -} -``` - diff --git a/doc/models/terminal-checkout-query-filter.md b/doc/models/terminal-checkout-query-filter.md deleted file mode 100644 index f3afb769..00000000 --- a/doc/models/terminal-checkout-query-filter.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Terminal Checkout Query Filter - -## Structure - -`TerminalCheckoutQueryFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `deviceId` | `?string` | Optional | The `TerminalCheckout` objects associated with a specific device. If no device is specified, then all
`TerminalCheckout` objects for the merchant are displayed. | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | -| `status` | `?string` | Optional | Filtered results with the desired status of the `TerminalCheckout`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "device_id": "device_id4", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status0" -} -``` - diff --git a/doc/models/terminal-checkout-query-sort.md b/doc/models/terminal-checkout-query-sort.md deleted file mode 100644 index a0b38b0a..00000000 --- a/doc/models/terminal-checkout-query-sort.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Terminal Checkout Query Sort - -## Structure - -`TerminalCheckoutQuerySort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortOrder` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "sort_order": "DESC" -} -``` - diff --git a/doc/models/terminal-checkout-query.md b/doc/models/terminal-checkout-query.md deleted file mode 100644 index c3e44b70..00000000 --- a/doc/models/terminal-checkout-query.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Terminal Checkout Query - -## Structure - -`TerminalCheckoutQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?TerminalCheckoutQueryFilter`](../../doc/models/terminal-checkout-query-filter.md) | Optional | - | getFilter(): ?TerminalCheckoutQueryFilter | setFilter(?TerminalCheckoutQueryFilter filter): void | -| `sort` | [`?TerminalCheckoutQuerySort`](../../doc/models/terminal-checkout-query-sort.md) | Optional | - | getSort(): ?TerminalCheckoutQuerySort | setSort(?TerminalCheckoutQuerySort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "device_id": "device_id0", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status6" - }, - "sort": { - "sort_order": "DESC" - } -} -``` - diff --git a/doc/models/terminal-checkout.md b/doc/models/terminal-checkout.md deleted file mode 100644 index 07d685f4..00000000 --- a/doc/models/terminal-checkout.md +++ /dev/null @@ -1,71 +0,0 @@ - -# Terminal Checkout - -Represents a checkout processed by the Square Terminal. - -## Structure - -`TerminalCheckout` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID for this `TerminalCheckout`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `referenceId` | `?string` | Optional | An optional user-defined reference ID that can be used to associate
this `TerminalCheckout` to another entity in an external system. For example, an order
ID generated by a third-party shopping cart. The ID is also associated with any payments
used to complete the checkout.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | An optional note to associate with the checkout, as well as with any payments used to complete the checkout.
Note: maximum 500 characters
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `orderId` | `?string` | Optional | The reference to the Square order ID for the checkout request. Supported only in the US. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `paymentOptions` | [`?PaymentOptions`](../../doc/models/payment-options.md) | Optional | - | getPaymentOptions(): ?PaymentOptions | setPaymentOptions(?PaymentOptions paymentOptions): void | -| `deviceOptions` | [`DeviceCheckoutOptions`](../../doc/models/device-checkout-options.md) | Required | - | getDeviceOptions(): DeviceCheckoutOptions | setDeviceOptions(DeviceCheckoutOptions deviceOptions): void | -| `deadlineDuration` | `?string` | Optional | An RFC 3339 duration, after which the checkout is automatically canceled.
A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason
of `TIMED_OUT`.

Default: 5 minutes from creation

Maximum: 5 minutes | getDeadlineDuration(): ?string | setDeadlineDuration(?string deadlineDuration): void | -| `status` | `?string` | Optional | The status of the `TerminalCheckout`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | getStatus(): ?string | setStatus(?string status): void | -| `cancelReason` | [`?string(ActionCancelReason)`](../../doc/models/action-cancel-reason.md) | Optional | - | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `paymentIds` | `?(string[])` | Optional | A list of IDs for payments created by this `TerminalCheckout`. | getPaymentIds(): ?array | setPaymentIds(?array paymentIds): void | -| `createdAt` | `?string` | Optional | The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `appId` | `?string` | Optional | The ID of the application that created the checkout. | getAppId(): ?string | setAppId(?string appId): void | -| `locationId` | `?string` | Optional | The location of the device where the `TerminalCheckout` was directed.
**Constraints**: *Maximum Length*: `64` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `paymentType` | [`?string(CheckoutOptionsPaymentType)`](../../doc/models/checkout-options-payment-type.md) | Optional | - | getPaymentType(): ?string | setPaymentType(?string paymentType): void | -| `teamMemberId` | `?string` | Optional | An optional ID of the team member associated with creating the checkout. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `customerId` | `?string` | Optional | An optional ID of the customer associated with the checkout. | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `appFeeMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | -| `statementDescriptionIdentifier` | `?string` | Optional | Optional additional payment information to include on the customer's card statement as
part of the statement description. This can be, for example, an invoice number, ticket number,
or short description that uniquely identifies the purchase. Supported only in the US.
**Constraints**: *Maximum Length*: `20` | getStatementDescriptionIdentifier(): ?string | setStatementDescriptionIdentifier(?string statementDescriptionIdentifier): void | -| `tipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reference_id": "reference_id6", - "note": "note8", - "order_id": "order_id0", - "payment_options": { - "autocomplete": false, - "delay_duration": "delay_duration2", - "accept_partial_authorization": false, - "delay_action": "CANCEL" - }, - "device_options": { - "device_id": "device_id6", - "skip_receipt_screen": false, - "collect_signature": false, - "tip_settings": { - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 48 - ], - "smart_tipping": false - }, - "show_itemized_cart": false - } -} -``` - diff --git a/doc/models/terminal-refund-query-filter.md b/doc/models/terminal-refund-query-filter.md deleted file mode 100644 index fe64a3bf..00000000 --- a/doc/models/terminal-refund-query-filter.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Terminal Refund Query Filter - -## Structure - -`TerminalRefundQueryFilter` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `deviceId` | `?string` | Optional | `TerminalRefund` objects associated with a specific device. If no device is specified, then all
`TerminalRefund` objects for the signed-in account are displayed. | getDeviceId(): ?string | setDeviceId(?string deviceId): void | -| `createdAt` | [`?TimeRange`](../../doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | -| `status` | `?string` | Optional | Filtered results with the desired status of the `TerminalRefund`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "device_id": "device_id4", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status0" -} -``` - diff --git a/doc/models/terminal-refund-query-sort.md b/doc/models/terminal-refund-query-sort.md deleted file mode 100644 index ba3eab67..00000000 --- a/doc/models/terminal-refund-query-sort.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Terminal Refund Query Sort - -## Structure - -`TerminalRefundQuerySort` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `sortOrder` | `?string` | Optional | The order in which results are listed.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | - -## Example (as JSON) - -```json -{ - "sort_order": "sort_order0" -} -``` - diff --git a/doc/models/terminal-refund-query.md b/doc/models/terminal-refund-query.md deleted file mode 100644 index f021b06b..00000000 --- a/doc/models/terminal-refund-query.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Terminal Refund Query - -## Structure - -`TerminalRefundQuery` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `filter` | [`?TerminalRefundQueryFilter`](../../doc/models/terminal-refund-query-filter.md) | Optional | - | getFilter(): ?TerminalRefundQueryFilter | setFilter(?TerminalRefundQueryFilter filter): void | -| `sort` | [`?TerminalRefundQuerySort`](../../doc/models/terminal-refund-query-sort.md) | Optional | - | getSort(): ?TerminalRefundQuerySort | setSort(?TerminalRefundQuerySort sort): void | - -## Example (as JSON) - -```json -{ - "filter": { - "device_id": "device_id0", - "created_at": { - "start_at": "start_at4", - "end_at": "end_at8" - }, - "status": "status6" - }, - "sort": { - "sort_order": "sort_order8" - } -} -``` - diff --git a/doc/models/terminal-refund.md b/doc/models/terminal-refund.md deleted file mode 100644 index 8291bc87..00000000 --- a/doc/models/terminal-refund.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Terminal Refund - -Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. - -## Structure - -`TerminalRefund` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID for this `TerminalRefund`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `refundId` | `?string` | Optional | The reference to the payment refund created by completing this `TerminalRefund`. | getRefundId(): ?string | setRefundId(?string refundId): void | -| `paymentId` | `string` | Required | The unique ID of the payment being refunded.
**Constraints**: *Minimum Length*: `1` | getPaymentId(): string | setPaymentId(string paymentId): void | -| `orderId` | `?string` | Optional | The reference to the Square order ID for the payment identified by the `payment_id`. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `reason` | `string` | Required | A description of the reason for the refund.
**Constraints**: *Maximum Length*: `192` | getReason(): string | setReason(string reason): void | -| `deviceId` | `string` | Required | The unique ID of the device intended for this `TerminalRefund`.
The Id can be retrieved from /v2/devices api. | getDeviceId(): string | setDeviceId(string deviceId): void | -| `deadlineDuration` | `?string` | Optional | The RFC 3339 duration, after which the refund is automatically canceled.
A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason
of `TIMED_OUT`.

Default: 5 minutes from creation.

Maximum: 5 minutes | getDeadlineDuration(): ?string | setDeadlineDuration(?string deadlineDuration): void | -| `status` | `?string` | Optional | The status of the `TerminalRefund`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. | getStatus(): ?string | setStatus(?string status): void | -| `cancelReason` | [`?string(ActionCancelReason)`](../../doc/models/action-cancel-reason.md) | Optional | - | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `createdAt` | `?string` | Optional | The time when the `TerminalRefund` was created, as an RFC 3339 timestamp. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `appId` | `?string` | Optional | The ID of the application that created the refund. | getAppId(): ?string | setAppId(?string appId): void | -| `locationId` | `?string` | Optional | The location of the device where the `TerminalRefund` was directed.
**Constraints**: *Maximum Length*: `64` | getLocationId(): ?string | setLocationId(?string locationId): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "refund_id": "refund_id2", - "payment_id": "payment_id8", - "order_id": "order_id2", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "reason": "reason6", - "device_id": "device_id4", - "deadline_duration": "deadline_duration0", - "status": "status0" -} -``` - diff --git a/doc/models/test-webhook-subscription-request.md b/doc/models/test-webhook-subscription-request.md deleted file mode 100644 index 15830394..00000000 --- a/doc/models/test-webhook-subscription-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Test Webhook Subscription Request - -Tests a [Subscription](../../doc/models/webhook-subscription.md) by sending a test event to its notification URL. - -## Structure - -`TestWebhookSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `eventType` | `?string` | Optional | The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event type must be
contained in the list of event types in the [Subscription](entity:WebhookSubscription). | getEventType(): ?string | setEventType(?string eventType): void | - -## Example (as JSON) - -```json -{ - "event_type": "payment.created" -} -``` - diff --git a/doc/models/test-webhook-subscription-response.md b/doc/models/test-webhook-subscription-response.md deleted file mode 100644 index 0dae889d..00000000 --- a/doc/models/test-webhook-subscription-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Test Webhook Subscription Response - -Defines the fields that are included in the response body of -a request to the [TestWebhookSubscription](../../doc/apis/webhook-subscriptions.md#test-webhook-subscription) endpoint. - -Note: If there are errors processing the request, the [SubscriptionTestResult](../../doc/models/subscription-test-result.md) field is not -present. - -## Structure - -`TestWebhookSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscriptionTestResult` | [`?SubscriptionTestResult`](../../doc/models/subscription-test-result.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscriptionTestResult(): ?SubscriptionTestResult | setSubscriptionTestResult(?SubscriptionTestResult subscriptionTestResult): void | - -## Example (as JSON) - -```json -{ - "subscription_test_result": { - "created_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746", - "id": "23eed5a9-2b12-403e-b212-7e2889aea0f6", - "payload": "{\"merchant_id\":\"1ZYMKZY1YFGBW\",\"type\":\"payment.created\",\"event_id\":\"23eed5a9-2b12-403e-b212-7e2889aea0f6\",\"created_at\":\"2022-01-11T00:06:48.322945116Z\",\"data\":{\"type\":\"payment\",\"id\":\"KkAkhdMsgzn59SM8A89WgKwekxLZY\",\"object\":{\"payment\":{\"amount_money\":{\"amount\":100,\"currency\":\"USD\"},\"approved_money\":{\"amount\":100,\"currency\":\"USD\"},\"capabilities\":[\"EDIT_TIP_AMOUNT\",\"EDIT_TIP_AMOUNT_UP\",\"EDIT_TIP_AMOUNT_DOWN\"],\"card_details\":{\"avs_status\":\"AVS_ACCEPTED\",\"card\":{\"bin\":\"540988\",\"card_brand\":\"MASTERCARD\",\"card_type\":\"CREDIT\",\"exp_month\":11,\"exp_year\":2022,\"fingerprint\":\"sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg\",\"last_4\":\"9029\",\"prepaid_type\":\"NOT_PREPAID\"},\"card_payment_timeline\":{\"authorized_at\":\"2020-11-22T21:16:51.198Z\"},\"cvv_status\":\"CVV_ACCEPTED\",\"entry_method\":\"KEYED\",\"statement_description\":\"SQ *DEFAULT TEST ACCOUNT\",\"status\":\"AUTHORIZED\"},\"created_at\":\"2020-11-22T21:16:51.086Z\",\"delay_action\":\"CANCEL\",\"delay_duration\":\"PT168H\",\"delayed_until\":\"2020-11-29T21:16:51.086Z\",\"id\":\"hYy9pRFVxpDsO1FB05SunFWUe9JZY\",\"location_id\":\"S8GWD5R9QB376\",\"order_id\":\"03O3USaPaAaFnI6kkwB1JxGgBsUZY\",\"receipt_number\":\"hYy9\",\"risk_evaluation\":{\"created_at\":\"2020-11-22T21:16:51.198Z\",\"risk_level\":\"NORMAL\"},\"source_type\":\"CARD\",\"status\":\"APPROVED\",\"total_money\":{\"amount\":100,\"currency\":\"USD\"},\"updated_at\":\"2020-11-22T21:16:51.198Z\",\"version_token\":\"FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o\"}}}}", - "status_code": 404, - "updated_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/time-range.md b/doc/models/time-range.md deleted file mode 100644 index ea4fd3d8..00000000 --- a/doc/models/time-range.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Time Range - -Represents a generic time range. The start and end values are -represented in RFC 3339 format. Time ranges are customized to be -inclusive or exclusive based on the needs of a particular endpoint. -Refer to the relevant endpoint-specific documentation to determine -how time ranges are handled. - -## Structure - -`TimeRange` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `startAt` | `?string` | Optional | A datetime value in RFC 3339 format indicating when the time range
starts. | getStartAt(): ?string | setStartAt(?string startAt): void | -| `endAt` | `?string` | Optional | A datetime value in RFC 3339 format indicating when the time range
ends. | getEndAt(): ?string | setEndAt(?string endAt): void | - -## Example (as JSON) - -```json -{ - "start_at": "start_at2", - "end_at": "end_at0" -} -``` - diff --git a/doc/models/tip-settings.md b/doc/models/tip-settings.md deleted file mode 100644 index 0f1b340f..00000000 --- a/doc/models/tip-settings.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Tip Settings - -## Structure - -`TipSettings` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `allowTipping` | `?bool` | Optional | Indicates whether tipping is enabled for this checkout. Defaults to false. | getAllowTipping(): ?bool | setAllowTipping(?bool allowTipping): void | -| `separateTipScreen` | `?bool` | Optional | Indicates whether tip options should be presented on the screen before presenting
the signature screen during card payment. Defaults to false. | getSeparateTipScreen(): ?bool | setSeparateTipScreen(?bool separateTipScreen): void | -| `customTipField` | `?bool` | Optional | Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. | getCustomTipField(): ?bool | setCustomTipField(?bool customTipField): void | -| `tipPercentages` | `?(int[])` | Optional | A list of tip percentages that should be presented during the checkout flow, specified as
up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25. | getTipPercentages(): ?array | setTipPercentages(?array tipPercentages): void | -| `smartTipping` | `?bool` | Optional | Enables the "Smart Tip Amounts" behavior.
Exact tipping options depend on the region in which the Square seller is active.

For payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, tipping options are presented as no tip, .50, 1.00 or 2.00.

For payment amounts of 10.00 or greater, tipping options are presented as the following percentages: 0%, 5%, 10%, 15%.

If set to true, the `tip_percentages` settings is ignored.
Defaults to false.

To learn more about smart tipping, see [Accept Tips with the Square App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app). | getSmartTipping(): ?bool | setSmartTipping(?bool smartTipping): void | - -## Example (as JSON) - -```json -{ - "allow_tipping": false, - "separate_tip_screen": false, - "custom_tip_field": false, - "tip_percentages": [ - 66, - 67, - 68 - ], - "smart_tipping": false -} -``` - diff --git a/doc/models/transaction-product.md b/doc/models/transaction-product.md deleted file mode 100644 index d6237d9c..00000000 --- a/doc/models/transaction-product.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Transaction Product - -Indicates the Square product used to process a transaction. - -## Enumeration - -`TransactionProduct` - -## Fields - -| Name | Description | -| --- | --- | -| `REGISTER` | Square Point of Sale. | -| `EXTERNAL_API` | The Square Connect API. | -| `BILLING` | A Square subscription for one of multiple products. | -| `APPOINTMENTS` | Square Appointments. | -| `INVOICES` | Square Invoices. | -| `ONLINE_STORE` | Square Online Store. | -| `PAYROLL` | Square Payroll. | -| `OTHER` | A Square product that does not match any other value. | - diff --git a/doc/models/transaction-type.md b/doc/models/transaction-type.md deleted file mode 100644 index fdc3351a..00000000 --- a/doc/models/transaction-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Transaction Type - -The transaction type used in the disputed payment. - -## Enumeration - -`TransactionType` - -## Fields - -| Name | -| --- | -| `DEBIT` | -| `CREDIT` | - diff --git a/doc/models/transaction.md b/doc/models/transaction.md deleted file mode 100644 index 5472a223..00000000 --- a/doc/models/transaction.md +++ /dev/null @@ -1,177 +0,0 @@ - -# Transaction - -Represents a transaction processed with Square, either with the -Connect API or with Square Point of Sale. - -The `tenders` field of this object lists all methods of payment used to pay in -the transaction. - -## Structure - -`Transaction` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The transaction's unique ID, issued by Square payments servers.
**Constraints**: *Maximum Length*: `192` | getId(): ?string | setId(?string id): void | -| `locationId` | `?string` | Optional | The ID of the transaction's associated location.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `createdAt` | `?string` | Optional | The timestamp for when the transaction was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `tenders` | [`?(Tender[])`](../../doc/models/tender.md) | Optional | The tenders used to pay in the transaction. | getTenders(): ?array | setTenders(?array tenders): void | -| `refunds` | [`?(Refund[])`](../../doc/models/refund.md) | Optional | Refunds that have been applied to any tender in the transaction. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `referenceId` | `?string` | Optional | If the transaction was created with the [Charge](api-endpoint:Transactions-Charge)
endpoint, this value is the same as the value provided for the `reference_id`
parameter in the request to that endpoint. Otherwise, it is not set.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `product` | [`?string(TransactionProduct)`](../../doc/models/transaction-product.md) | Optional | Indicates the Square product used to process a transaction. | getProduct(): ?string | setProduct(?string product): void | -| `clientId` | `?string` | Optional | If the transaction was created in the Square Point of Sale app, this value
is the ID generated for the transaction by Square Point of Sale.

This ID has no relationship to the transaction's canonical `id`, which is
generated by Square's backend servers. This value is generated for bookkeeping
purposes, in case the transaction cannot immediately be completed (for example,
if the transaction is processed in offline mode).

It is not currently possible with the Connect API to perform a transaction
lookup by this value.
**Constraints**: *Maximum Length*: `192` | getClientId(): ?string | setClientId(?string clientId): void | -| `shippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | -| `orderId` | `?string` | Optional | The order_id is an identifier for the order associated with this transaction, if any.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "location_id": "location_id8", - "created_at": "created_at8", - "tenders": [ - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "created_at": "created_at6", - "note": "note4", - "type": "THIRD_PARTY_CARD" - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "created_at": "created_at6", - "note": "note4", - "type": "THIRD_PARTY_CARD" - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "created_at": "created_at6", - "note": "note4", - "type": "THIRD_PARTY_CARD" - } - ], - "refunds": [ - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - }, - { - "id": "id8", - "location_id": "location_id2", - "transaction_id": "transaction_id6", - "tender_id": "tender_id6", - "created_at": "created_at6", - "reason": "reason4", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "status": "PENDING", - "processing_fee_money": { - "amount": 112, - "currency": "DJF" - }, - "additional_recipients": [ - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - }, - { - "location_id": "location_id0", - "description": "description6", - "amount_money": { - "amount": 186, - "currency": "AUD" - }, - "receivable_id": "receivable_id6" - } - ] - } - ] -} -``` - diff --git a/doc/models/unlink-customer-from-gift-card-request.md b/doc/models/unlink-customer-from-gift-card-request.md deleted file mode 100644 index 0639ec6c..00000000 --- a/doc/models/unlink-customer-from-gift-card-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Unlink Customer From Gift Card Request - -A request to unlink a customer from a gift card. - -## Structure - -`UnlinkCustomerFromGiftCardRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customerId` | `string` | Required | The ID of the customer to unlink from the gift card.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getCustomerId(): string | setCustomerId(string customerId): void | - -## Example (as JSON) - -```json -{ - "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" -} -``` - diff --git a/doc/models/unlink-customer-from-gift-card-response.md b/doc/models/unlink-customer-from-gift-card-response.md deleted file mode 100644 index e569fb0e..00000000 --- a/doc/models/unlink-customer-from-gift-card-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Unlink Customer From Gift Card Response - -A response that contains the unlinked `GiftCard` object. If the request resulted in errors, -the response contains a set of `Error` objects. - -## Structure - -`UnlinkCustomerFromGiftCardResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `giftCard` | [`?GiftCard`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | getGiftCard(): ?GiftCard | setGiftCard(?GiftCard giftCard): void | - -## Example (as JSON) - -```json -{ - "gift_card": { - "balance_money": { - "amount": 2500, - "currency": "USD" - }, - "created_at": "2021-03-25T05:13:01Z", - "gan": "7783320005440920", - "gan_source": "SQUARE", - "id": "gftc:71ea002277a34f8a945e284b04822edb", - "state": "ACTIVE", - "type": "DIGITAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-booking-custom-attribute-definition-request.md b/doc/models/update-booking-custom-attribute-definition-request.md deleted file mode 100644 index bdf36f47..00000000 --- a/doc/models/update-booking-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Update Booking Custom Attribute Definition Request - -Represents an [UpdateBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#update-booking-custom-attribute-definition) request. - -## Structure - -`UpdateBookingCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "key": "key2", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2", - "description": "description8", - "visibility": "VISIBILITY_HIDDEN" - }, - "idempotency_key": "idempotency_key2" -} -``` - diff --git a/doc/models/update-booking-custom-attribute-definition-response.md b/doc/models/update-booking-custom-attribute-definition-response.md deleted file mode 100644 index 5c4414ce..00000000 --- a/doc/models/update-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Update Booking Custom Attribute Definition Response - -Represents an [UpdateBookingCustomAttributeDefinition](../../doc/apis/booking-custom-attributes.md#update-booking-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpdateBookingCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-11-16T15:27:30Z", - "description": "Update the description as desired.", - "key": "favoriteShampoo", - "name": "Favorite shampoo", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T15:39:38Z", - "version": 2, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [] -} -``` - diff --git a/doc/models/update-booking-request.md b/doc/models/update-booking-request.md deleted file mode 100644 index a8d0e059..00000000 --- a/doc/models/update-booking-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Update Booking Request - -## Structure - -`UpdateBookingRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `booking` | [`Booking`](../../doc/models/booking.md) | Required | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): Booking | setBooking(Booking booking): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "idempotency_key4", - "booking": { - "id": "id4", - "version": 156, - "status": "CANCELLED_BY_SELLER", - "created_at": "created_at2", - "updated_at": "updated_at0" - } -} -``` - diff --git a/doc/models/update-booking-response.md b/doc/models/update-booking-response.md deleted file mode 100644 index ac22b344..00000000 --- a/doc/models/update-booking-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Update Booking Response - -## Structure - -`UpdateBookingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `booking` | [`?Booking`](../../doc/models/booking.md) | Optional | Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. | getBooking(): ?Booking | setBooking(?Booking booking): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "booking": { - "address": { - "address_line_1": "1955 Broadway", - "address_line_2": "Suite 600", - "administrative_district_level_1": "CA", - "locality": "Oakland", - "postal_code": "94612" - }, - "appointment_segments": [ - { - "duration_minutes": 60, - "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", - "service_variation_version": 1599775456731, - "team_member_id": "TMXUrsBWWcHTt79t" - } - ], - "created_at": "2020-10-28T15:47:41Z", - "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - "customer_note": "I would like to sit near the window please", - "id": "zkras0xv0xwswx", - "location_id": "LEQHH0YY8B42M", - "location_type": "CUSTOMER_LOCATION", - "seller_note": "", - "start_at": "2020-11-26T13:00:00Z", - "status": "ACCEPTED", - "updated_at": "2020-10-28T15:49:25Z", - "version": 2 - }, - "errors": [] -} -``` - diff --git a/doc/models/update-break-type-request.md b/doc/models/update-break-type-request.md deleted file mode 100644 index 4b143ad5..00000000 --- a/doc/models/update-break-type-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Update Break Type Request - -A request to update a `BreakType`. - -## Structure - -`UpdateBreakTypeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `breakType` | [`BreakType`](../../doc/models/break-type.md) | Required | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | getBreakType(): BreakType | setBreakType(BreakType breakType): void | - -## Example (as JSON) - -```json -{ - "break_type": { - "break_name": "Lunch", - "expected_duration": "PT50M", - "is_paid": true, - "location_id": "26M7H24AZ9N6R", - "version": 1, - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4" - } -} -``` - diff --git a/doc/models/update-break-type-response.md b/doc/models/update-break-type-response.md deleted file mode 100644 index 07c10a19..00000000 --- a/doc/models/update-break-type-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Update Break Type Response - -A response to a request to update a `BreakType`. The response contains -the requested `BreakType` objects and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`UpdateBreakTypeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `breakType` | [`?BreakType`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | getBreakType(): ?BreakType | setBreakType(?BreakType breakType): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "break_type": { - "break_name": "Lunch", - "created_at": "2018-06-12T20:19:12Z", - "expected_duration": "PT50M", - "id": "Q6JSJS6D4DBCH", - "is_paid": true, - "location_id": "26M7H24AZ9N6R", - "updated_at": "2019-02-26T23:12:59Z", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-catalog-image-request.md b/doc/models/update-catalog-image-request.md deleted file mode 100644 index 2eeb903f..00000000 --- a/doc/models/update-catalog-image-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Update Catalog Image Request - -## Structure - -`UpdateCatalogImageRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A unique string that identifies this UpdateCatalogImage request.
Keys can be any valid string but must be unique for every UpdateCatalogImage request.

See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", - "image": { - "image_data": { - "caption": "A picture of a cup of coffee", - "name": "Coffee" - }, - "type": "IMAGE" - }, - "object_id": "ND6EA5AAJEO5WL3JNNIAQA32" -} -``` - diff --git a/doc/models/update-catalog-image-response.md b/doc/models/update-catalog-image-response.md deleted file mode 100644 index 7aeeb330..00000000 --- a/doc/models/update-catalog-image-response.md +++ /dev/null @@ -1,77 +0,0 @@ - -# Update Catalog Image Response - -## Structure - -`UpdateCatalogImageResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `image` | [`?CatalogObject`](../../doc/models/catalog-object.md) | Optional | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getImage(): ?CatalogObject | setImage(?CatalogObject image): void | - -## Example (as JSON) - -```json -{ - "image": { - "id": "L52QOQN2SW3M5QTF9JOCQKNB", - "image_data": { - "caption": "A picture of a cup of coffee", - "name": "Coffee", - "url": "https://..." - }, - "type": "IMAGE", - "updated_at": "updated_at2", - "version": 100, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-customer-custom-attribute-definition-request.md b/doc/models/update-customer-custom-attribute-definition-request.md deleted file mode 100644 index dbca16a0..00000000 --- a/doc/models/update-customer-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Update Customer Custom Attribute Definition Request - -Represents an [UpdateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#update-customer-custom-attribute-definition) request. - -## Structure - -`UpdateCustomerCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "Update the description as desired.", - "visibility": "VISIBILITY_READ_ONLY", - "key": "key2", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2" - }, - "idempotency_key": "idempotency_key2" -} -``` - diff --git a/doc/models/update-customer-custom-attribute-definition-response.md b/doc/models/update-customer-custom-attribute-definition-response.md deleted file mode 100644 index 2e20e805..00000000 --- a/doc/models/update-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Update Customer Custom Attribute Definition Response - -Represents an [UpdateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#update-customer-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpdateCustomerCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-04-26T15:27:30Z", - "description": "Update the description as desired.", - "key": "favoritemovie", - "name": "Favorite Movie", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-04-26T15:39:38Z", - "version": 2, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-customer-group-request.md b/doc/models/update-customer-group-request.md deleted file mode 100644 index b06ce652..00000000 --- a/doc/models/update-customer-group-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Update Customer Group Request - -Defines the body parameters that can be included in a request to the -[UpdateCustomerGroup](../../doc/apis/customer-groups.md#update-customer-group) endpoint. - -## Structure - -`UpdateCustomerGroupRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `group` | [`CustomerGroup`](../../doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | - -## Example (as JSON) - -```json -{ - "group": { - "name": "Loyal Customers", - "id": "id8", - "created_at": "created_at4", - "updated_at": "updated_at6" - } -} -``` - diff --git a/doc/models/update-customer-group-response.md b/doc/models/update-customer-group-response.md deleted file mode 100644 index 5cec467e..00000000 --- a/doc/models/update-customer-group-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Update Customer Group Response - -Defines the fields that are included in the response body of -a request to the [UpdateCustomerGroup](../../doc/apis/customer-groups.md#update-customer-group) endpoint. - -Either `errors` or `group` is present in a given response (never both). - -## Structure - -`UpdateCustomerGroupResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](../../doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | - -## Example (as JSON) - -```json -{ - "group": { - "created_at": "2020-04-13T21:54:57.863Z", - "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", - "name": "Loyal Customers", - "updated_at": "2020-04-13T21:54:58Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md deleted file mode 100644 index 366f22be..00000000 --- a/doc/models/update-customer-request.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Update Customer Request - -Defines the body parameters that can be included in a request to the -`UpdateCustomer` endpoint. - -## Structure - -`UpdateCustomerRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters. | getFamilyName(): ?string | setFamilyName(?string familyName): void | -| `companyName` | `?string` | Optional | A business name associated with the customer profile.

The maximum length for this value is 500 characters. | getCompanyName(): ?string | setCompanyName(?string companyName): void | -| `nickname` | `?string` | Optional | A nickname for the customer profile.

The maximum length for this value is 100 characters. | getNickname(): ?string | setNickname(?string nickname): void | -| `emailAddress` | `?string` | Optional | The email address associated with the customer profile.

The maximum length for this value is 254 characters. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `phoneNumber` | `?string` | Optional | The phone number associated with the customer profile. The phone number must be valid and can contain
9–16 digits, with an optional `+` prefix and country code. For more information, see
[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.

The maximum length for this value is 100 characters. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`
format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. | getBirthday(): ?string | setBirthday(?string birthday): void | -| `version` | `?int` | Optional | The current version of the customer profile.

As a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile). | getVersion(): ?int | setVersion(?int version): void | -| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void | - -## Example (as JSON) - -```json -{ - "email_address": "New.Amelia.Earhart@example.com", - "note": "updated customer note", - "phone_number": null, - "version": 2, - "given_name": "given_name0", - "family_name": "family_name8", - "company_name": "company_name4", - "nickname": "nickname4" -} -``` - diff --git a/doc/models/update-customer-response.md b/doc/models/update-customer-response.md deleted file mode 100644 index 71f17208..00000000 --- a/doc/models/update-customer-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# Update Customer Response - -Defines the fields that are included in the response body of -a request to the [UpdateCustomer](../../doc/apis/customers.md#update-customer) or -[BulkUpdateCustomers](../../doc/apis/customers.md#bulk-update-customers) endpoint. - -Either `errors` or `customer` is present in a given response (never both). - -## Structure - -`UpdateCustomerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `customer` | [`?Customer`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | getCustomer(): ?Customer | setCustomer(?Customer customer): void | - -## Example (as JSON) - -```json -{ - "customer": { - "address": { - "address_line_1": "500 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003" - }, - "created_at": "2016-03-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", - "email_address": "New.Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "note": "updated customer note", - "preferences": { - "email_unsubscribed": false - }, - "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2016-05-15T20:21:55Z", - "version": 3, - "cards": [ - { - "id": "id8", - "card_brand": "DISCOVER", - "last_4": "last_40", - "exp_month": 152, - "exp_year": 144 - } - ] - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md deleted file mode 100644 index ba6701cf..00000000 --- a/doc/models/update-invoice-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Update Invoice Request - -Describes a `UpdateInvoice` request. - -## Structure - -`UpdateInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): Invoice | setInvoice(Invoice invoice): void | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the `UpdateInvoice` request. If you do not
provide `idempotency_key` (or provide an empty string as the value), the endpoint
treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `fieldsToClear` | `?(string[])` | Optional | The list of fields to clear. Although this field is currently supported, we
recommend using null values or the `remove` field when possible. For examples, see
[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). | getFieldsToClear(): ?array | setFieldsToClear(?array fieldsToClear): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be", - "invoice": { - "payment_requests": [ - { - "reminders": null, - "tipping_enabled": false, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "version": 1, - "id": "id6", - "location_id": "location_id0", - "order_id": "order_id0", - "primary_recipient": { - "customer_id": "customer_id2", - "given_name": "given_name6", - "family_name": "family_name8", - "email_address": "email_address2", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } - }, - "fields_to_clear": [ - "fields_to_clear1", - "fields_to_clear2", - "fields_to_clear3" - ] -} -``` - diff --git a/doc/models/update-invoice-response.md b/doc/models/update-invoice-response.md deleted file mode 100644 index f7aa15bd..00000000 --- a/doc/models/update-invoice-response.md +++ /dev/null @@ -1,108 +0,0 @@ - -# Update Invoice Response - -Describes a `UpdateInvoice` response. - -## Structure - -`UpdateInvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `invoice` | [`?Invoice`](../../doc/models/invoice.md) | Optional | Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | getInvoice(): ?Invoice | setInvoice(?Invoice invoice): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "buy_now_pay_later": false, - "card": true, - "cash_app_pay": false, - "square_gift_card": false - }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" - }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "next_payment_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "request_type": "BALANCE", - "tipping_enabled": false, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - }, - "sale_or_service_date": "2030-01-24", - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "UNPAID", - "store_payment_method_enabled": false, - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T18:23:11Z", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-item-modifier-lists-request.md b/doc/models/update-item-modifier-lists-request.md deleted file mode 100644 index 6e7fec61..00000000 --- a/doc/models/update-item-modifier-lists-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Update Item Modifier Lists Request - -## Structure - -`UpdateItemModifierListsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemIds` | `string[]` | Required | The IDs of the catalog items associated with the CatalogModifierList objects being updated. | getItemIds(): array | setItemIds(array itemIds): void | -| `modifierListsToEnable` | `?(string[])` | Optional | The IDs of the CatalogModifierList objects to enable for the CatalogItem.
At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. | getModifierListsToEnable(): ?array | setModifierListsToEnable(?array modifierListsToEnable): void | -| `modifierListsToDisable` | `?(string[])` | Optional | The IDs of the CatalogModifierList objects to disable for the CatalogItem.
At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. | getModifierListsToDisable(): ?array | setModifierListsToDisable(?array modifierListsToDisable): void | - -## Example (as JSON) - -```json -{ - "item_ids": [ - "H42BRLUJ5KTZTTMPVSLFAACQ", - "2JXOBJIHCWBQ4NZ3RIXQGJA6" - ], - "modifier_lists_to_disable": [ - "7WRC16CJZDVLSNDQ35PP6YAD" - ], - "modifier_lists_to_enable": [ - "H42BRLUJ5KTZTTMPVSLFAACQ", - "2JXOBJIHCWBQ4NZ3RIXQGJA6" - ] -} -``` - diff --git a/doc/models/update-item-modifier-lists-response.md b/doc/models/update-item-modifier-lists-response.md deleted file mode 100644 index 20fcbc3c..00000000 --- a/doc/models/update-item-modifier-lists-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Update Item Modifier Lists Response - -## Structure - -`UpdateItemModifierListsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `updatedAt` | `?string` | Optional | The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "updated_at": "2016-11-16T22:25:24.878Z", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-item-taxes-request.md b/doc/models/update-item-taxes-request.md deleted file mode 100644 index a8755901..00000000 --- a/doc/models/update-item-taxes-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Update Item Taxes Request - -## Structure - -`UpdateItemTaxesRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `itemIds` | `string[]` | Required | IDs for the CatalogItems associated with the CatalogTax objects being updated.
No more than 1,000 IDs may be provided. | getItemIds(): array | setItemIds(array itemIds): void | -| `taxesToEnable` | `?(string[])` | Optional | IDs of the CatalogTax objects to enable.
At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. | getTaxesToEnable(): ?array | setTaxesToEnable(?array taxesToEnable): void | -| `taxesToDisable` | `?(string[])` | Optional | IDs of the CatalogTax objects to disable.
At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. | getTaxesToDisable(): ?array | setTaxesToDisable(?array taxesToDisable): void | - -## Example (as JSON) - -```json -{ - "item_ids": [ - "H42BRLUJ5KTZTTMPVSLFAACQ", - "2JXOBJIHCWBQ4NZ3RIXQGJA6" - ], - "taxes_to_disable": [ - "AQCEGCEBBQONINDOHRGZISEX" - ], - "taxes_to_enable": [ - "4WRCNHCJZDVLSNDQ35PP6YAD" - ] -} -``` - diff --git a/doc/models/update-item-taxes-response.md b/doc/models/update-item-taxes-response.md deleted file mode 100644 index dee8b924..00000000 --- a/doc/models/update-item-taxes-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Update Item Taxes Response - -## Structure - -`UpdateItemTaxesResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `updatedAt` | `?string` | Optional | The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "updated_at": "2016-11-16T22:25:24.878Z", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-job-request.md b/doc/models/update-job-request.md deleted file mode 100644 index 0a8429b6..00000000 --- a/doc/models/update-job-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Update Job Request - -Represents an [UpdateJob](../../doc/apis/team.md#update-job) request. - -## Structure - -`UpdateJobRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `job` | [`Job`](../../doc/models/job.md) | Required | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | getJob(): Job | setJob(Job job): void | - -## Example (as JSON) - -```json -{ - "job": { - "is_tip_eligible": true, - "title": "Cashier 1", - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at8" - } -} -``` - diff --git a/doc/models/update-job-response.md b/doc/models/update-job-response.md deleted file mode 100644 index cceca940..00000000 --- a/doc/models/update-job-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Update Job Response - -Represents an [UpdateJob](../../doc/apis/team.md#update-job) response. Either `job` or `errors` -is present in the response. - -## Structure - -`UpdateJobResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `job` | [`?Job`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | getJob(): ?Job | setJob(?Job job): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "job": { - "created_at": "2021-06-11T22:55:45Z", - "id": "1yJlHapkseYnNPETIU1B", - "is_tip_eligible": true, - "title": "Cashier 1", - "updated_at": "2021-06-13T12:55:45Z", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-location-custom-attribute-definition-request.md b/doc/models/update-location-custom-attribute-definition-request.md deleted file mode 100644 index 6128b863..00000000 --- a/doc/models/update-location-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Update Location Custom Attribute Definition Request - -Represents an [UpdateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#update-location-custom-attribute-definition) request. - -## Structure - -`UpdateLocationCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "Update the description as desired.", - "visibility": "VISIBILITY_READ_ONLY", - "key": "key2", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2" - }, - "idempotency_key": "idempotency_key2" -} -``` - diff --git a/doc/models/update-location-custom-attribute-definition-response.md b/doc/models/update-location-custom-attribute-definition-response.md deleted file mode 100644 index 6a812993..00000000 --- a/doc/models/update-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Update Location Custom Attribute Definition Response - -Represents an [UpdateLocationCustomAttributeDefinition](../../doc/apis/location-custom-attributes.md#update-location-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpdateLocationCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-12-02T19:06:36.559Z", - "description": "Update the description as desired.", - "key": "bestseller", - "name": "Bestseller", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-12-02T19:34:10.181Z", - "version": 2, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-location-request.md b/doc/models/update-location-request.md deleted file mode 100644 index bab66f98..00000000 --- a/doc/models/update-location-request.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Update Location Request - -The request object for the [UpdateLocation](../../doc/apis/locations.md#update-location) endpoint. - -## Structure - -`UpdateLocationRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `location` | [`?Location`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | getLocation(): ?Location | setLocation(?Location location): void | - -## Example (as JSON) - -```json -{ - "location": { - "business_hours": { - "periods": [ - { - "day_of_week": "FRI", - "end_local_time": "18:00", - "start_local_time": "07:00" - }, - { - "day_of_week": "SAT", - "end_local_time": "18:00", - "start_local_time": "07:00" - }, - { - "day_of_week": "SUN", - "end_local_time": "15:00", - "start_local_time": "09:00" - } - ] - }, - "description": "Midtown Atlanta store - Open weekends", - "id": "id4", - "name": "name4", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - }, - "timezone": "timezone6", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ] - } -} -``` - diff --git a/doc/models/update-location-response.md b/doc/models/update-location-response.md deleted file mode 100644 index 7561a003..00000000 --- a/doc/models/update-location-response.md +++ /dev/null @@ -1,87 +0,0 @@ - -# Update Location Response - -The response object returned by the [UpdateLocation](../../doc/apis/locations.md#update-location) endpoint. - -## Structure - -`UpdateLocationResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `location` | [`?Location`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | getLocation(): ?Location | setLocation(?Location location): void | - -## Example (as JSON) - -```json -{ - "location": { - "address": { - "address_line_1": "1234 Peachtree St. NE", - "administrative_district_level_1": "GA", - "locality": "Atlanta", - "postal_code": "30309", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "business_hours": { - "periods": [ - { - "day_of_week": "FRI", - "end_local_time": "18:00", - "start_local_time": "07:00" - }, - { - "day_of_week": "SAT", - "end_local_time": "18:00", - "start_local_time": "07:00" - }, - { - "day_of_week": "SUN", - "end_local_time": "15:00", - "start_local_time": "09:00" - } - ] - }, - "business_name": "Jet Fuel Coffee", - "capabilities": [ - "CREDIT_CARD_PROCESSING" - ], - "coordinates": { - "latitude": 33.7889, - "longitude": -84.3841 - }, - "country": "US", - "created_at": "2022-02-19T17:58:25Z", - "currency": "USD", - "description": "Midtown Atlanta store - Open weekends", - "id": "3Z4V4WHQK64X9", - "language_code": "en-US", - "mcc": "7299", - "merchant_id": "3MYCJG5GVYQ8Q", - "name": "Midtown", - "status": "ACTIVE", - "timezone": "America/New_York", - "type": "PHYSICAL" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-location-settings-request.md b/doc/models/update-location-settings-request.md deleted file mode 100644 index 135165dc..00000000 --- a/doc/models/update-location-settings-request.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Update Location Settings Request - -## Structure - -`UpdateLocationSettingsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `locationSettings` | [`CheckoutLocationSettings`](../../doc/models/checkout-location-settings.md) | Required | - | getLocationSettings(): CheckoutLocationSettings | setLocationSettings(CheckoutLocationSettings locationSettings): void | - -## Example (as JSON) - -```json -{ - "location_settings": { - "location_id": "location_id0", - "customer_notes_enabled": false, - "policies": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8" - }, - { - "uid": "uid8", - "title": "title4", - "description": "description8" - }, - { - "uid": "uid8", - "title": "title4", - "description": "description8" - } - ], - "branding": { - "header_type": "FULL_WIDTH_LOGO", - "button_color": "button_color2", - "button_shape": "PILL" - }, - "tipping": { - "percentages": [ - 246, - 247 - ], - "smart_tipping_enabled": false, - "default_percent": 46, - "smart_tips": [ - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - } - ], - "default_smart_tip": { - "amount": 58, - "currency": "KWD" - } - } - } -} -``` - diff --git a/doc/models/update-location-settings-response.md b/doc/models/update-location-settings-response.md deleted file mode 100644 index 89d4d6b8..00000000 --- a/doc/models/update-location-settings-response.md +++ /dev/null @@ -1,104 +0,0 @@ - -# Update Location Settings Response - -## Structure - -`UpdateLocationSettingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the location settings. | getErrors(): ?array | setErrors(?array errors): void | -| `locationSettings` | [`?CheckoutLocationSettings`](../../doc/models/checkout-location-settings.md) | Optional | - | getLocationSettings(): ?CheckoutLocationSettings | setLocationSettings(?CheckoutLocationSettings locationSettings): void | - -## Example (as JSON) - -```json -{ - "location_settings": { - "branding": { - "button_color": "#00b23b", - "button_shape": "ROUNDED", - "header_type": "FRAMED_LOGO" - }, - "customer_notes_enabled": false, - "location_id": "LOCATION_ID_1", - "policies": [ - { - "description": "This is my Return Policy", - "title": "Return Policy", - "uid": "POLICY_ID_1" - }, - { - "description": "Items may be returned within 30 days of purchase.", - "title": "Return Policy", - "uid": "POLICY_ID_2" - } - ], - "tipping": { - "default_percent": 20, - "default_whole_amount_money": { - "amount": 100, - "currency": "USD" - }, - "percentages": [ - 15, - 20, - 25 - ], - "smart_tipping_enabled": true, - "whole_amounts": [ - { - "amount": 1000, - "currency": "USD" - }, - { - "amount": 1500, - "currency": "USD" - }, - { - "amount": 2000, - "currency": "USD" - } - ], - "smart_tips": [ - { - "amount": 152, - "currency": "GEL" - }, - { - "amount": 152, - "currency": "GEL" - } - ], - "default_smart_tip": { - "amount": 58, - "currency": "KWD" - } - }, - "updated_at": "2022-06-16T22:25:35Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-merchant-custom-attribute-definition-request.md b/doc/models/update-merchant-custom-attribute-definition-request.md deleted file mode 100644 index add3b479..00000000 --- a/doc/models/update-merchant-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Update Merchant Custom Attribute Definition Request - -Represents an [UpdateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) request. - -## Structure - -`UpdateMerchantCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "description": "Update the description as desired.", - "visibility": "VISIBILITY_READ_ONLY", - "key": "key2", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2" - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/update-merchant-custom-attribute-definition-response.md b/doc/models/update-merchant-custom-attribute-definition-response.md deleted file mode 100644 index 0300b5c3..00000000 --- a/doc/models/update-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Update Merchant Custom Attribute Definition Response - -Represents an [UpdateMerchantCustomAttributeDefinition](../../doc/apis/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpdateMerchantCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2023-05-05T19:06:36.559Z", - "description": "Update the description as desired.", - "key": "alternative_seller_name", - "name": "Alternative Merchant Name", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2023-05-05T19:34:10.181Z", - "version": 2, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-merchant-settings-request.md b/doc/models/update-merchant-settings-request.md deleted file mode 100644 index eb887bad..00000000 --- a/doc/models/update-merchant-settings-request.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Update Merchant Settings Request - -## Structure - -`UpdateMerchantSettingsRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `merchantSettings` | [`CheckoutMerchantSettings`](../../doc/models/checkout-merchant-settings.md) | Required | - | getMerchantSettings(): CheckoutMerchantSettings | setMerchantSettings(CheckoutMerchantSettings merchantSettings): void | - -## Example (as JSON) - -```json -{ - "merchant_settings": { - "payment_methods": { - "apple_pay": { - "enabled": false - }, - "google_pay": { - "enabled": false - }, - "cash_app": { - "enabled": false - }, - "afterpay_clearpay": { - "order_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "item_eligibility_range": { - "min": { - "amount": 34, - "currency": "OMR" - }, - "max": { - "amount": 140, - "currency": "JPY" - } - }, - "enabled": false - } - }, - "updated_at": "updated_at6" - } -} -``` - diff --git a/doc/models/update-merchant-settings-response.md b/doc/models/update-merchant-settings-response.md deleted file mode 100644 index a48d6b2b..00000000 --- a/doc/models/update-merchant-settings-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Update Merchant Settings Response - -## Structure - -`UpdateMerchantSettingsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the merchant settings. | getErrors(): ?array | setErrors(?array errors): void | -| `merchantSettings` | [`?CheckoutMerchantSettings`](../../doc/models/checkout-merchant-settings.md) | Optional | - | getMerchantSettings(): ?CheckoutMerchantSettings | setMerchantSettings(?CheckoutMerchantSettings merchantSettings): void | - -## Example (as JSON) - -```json -{ - "merchant_settings": { - "merchant_id": "MERCHANT_ID", - "payment_methods": { - "afterpay_clearpay": { - "enabled": true, - "item_eligibility_range": { - "max": { - "amount": 10000, - "currency": "USD" - }, - "min": { - "amount": 100, - "currency": "USD" - } - }, - "order_eligibility_range": { - "max": { - "amount": 10000, - "currency": "USD" - }, - "min": { - "amount": 100, - "currency": "USD" - } - } - }, - "apple_pay": { - "enabled": false - }, - "cash_app_pay": { - "enabled": true - }, - "google_pay": { - "enabled": true - }, - "cash_app": { - "enabled": false - } - }, - "updated_at": "2022-06-16T22:25:35Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-order-custom-attribute-definition-request.md b/doc/models/update-order-custom-attribute-definition-request.md deleted file mode 100644 index f1d5bc99..00000000 --- a/doc/models/update-order-custom-attribute-definition-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Update Order Custom Attribute Definition Request - -Represents an update request for an order custom attribute definition. - -## Structure - -`UpdateOrderCustomAttributeDefinitionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): CustomAttributeDefinition | setCustomAttributeDefinition(CustomAttributeDefinition customAttributeDefinition): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "key": "cover-count", - "version": 1, - "visibility": "VISIBILITY_READ_ONLY", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name2", - "description": "description8" - }, - "idempotency_key": "IDEMPOTENCY_KEY" -} -``` - diff --git a/doc/models/update-order-custom-attribute-definition-response.md b/doc/models/update-order-custom-attribute-definition-response.md deleted file mode 100644 index 4aa67e6c..00000000 --- a/doc/models/update-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Update Order Custom Attribute Definition Response - -Represents a response from updating an order custom attribute definition. - -## Structure - -`UpdateOrderCustomAttributeDefinitionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttributeDefinition` | [`?CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | getCustomAttributeDefinition(): ?CustomAttributeDefinition | setCustomAttributeDefinition(?CustomAttributeDefinition customAttributeDefinition): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute_definition": { - "created_at": "2022-11-16T16:53:23.141Z", - "description": "The number of people seated at a table", - "key": "cover-count", - "name": "Cover count", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "updated_at": "2022-11-16T17:44:11.436Z", - "version": 2, - "visibility": "VISIBILITY_READ_ONLY" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-order-request.md b/doc/models/update-order-request.md deleted file mode 100644 index 57d00bf2..00000000 --- a/doc/models/update-order-request.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Update Order Request - -Defines the fields that are included in requests to the -[UpdateOrder](../../doc/apis/orders.md#update-order) endpoint. - -## Structure - -`UpdateOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `fieldsToClear` | `?(string[])` | Optional | The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete)
fields to clear. For example, `line_items[uid].note`.
For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields). | getFieldsToClear(): ?array | setFieldsToClear(?array fieldsToClear): void | -| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this update request.

If you are unsure whether a particular update was applied to an order successfully,
you can reattempt it with the same idempotency key without
worrying about creating duplicate updates to the order.
The latest order version is returned.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "order": { - "id": "id6", - "location_id": "location_id0", - "reference_id": "reference_id4", - "source": { - "name": "name4" - }, - "customer_id": "customer_id4", - "line_items": [ - { - "uid": "uid8", - "name": "name8", - "quantity": "quantity4", - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ] - }, - "fields_to_clear": [ - "fields_to_clear7", - "fields_to_clear8", - "fields_to_clear9" - ], - "idempotency_key": "idempotency_key2" -} -``` - diff --git a/doc/models/update-order-response.md b/doc/models/update-order-response.md deleted file mode 100644 index f9d9786e..00000000 --- a/doc/models/update-order-response.md +++ /dev/null @@ -1,187 +0,0 @@ - -# Update Order Response - -Defines the fields that are included in the response body of -a request to the [UpdateOrder](../../doc/apis/orders.md#update-order) endpoint. - -## Structure - -`UpdateOrderResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](../../doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "order": { - "created_at": "2019-08-23T18:26:18.243Z", - "id": "DREk7wJcyXNHqULq8JJ2iPAsluJZY", - "line_items": [ - { - "base_price_money": { - "amount": 500, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 500, - "currency": "USD" - }, - "name": "Small Coffee", - "quantity": "1", - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 500, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "EuYkakhmu3ksHIds5Hiot", - "variation_total_price_money": { - "amount": 500, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - }, - { - "base_price_money": { - "amount": 200, - "currency": "USD" - }, - "gross_sales_money": { - "amount": 400, - "currency": "USD" - }, - "name": "COOKIE", - "quantity": "2", - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 400, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "cookie_uid", - "variation_total_price_money": { - "amount": 400, - "currency": "USD" - }, - "quantity_unit": { - "measurement_unit": { - "custom_unit": { - "name": "name2", - "abbreviation": "abbreviation4" - }, - "area_unit": "IMPERIAL_ACRE", - "length_unit": "IMPERIAL_INCH", - "volume_unit": "METRIC_LITER", - "weight_unit": "IMPERIAL_WEIGHT_OUNCE" - }, - "precision": 54, - "catalog_object_id": "catalog_object_id0", - "catalog_version": 12 - }, - "note": "note4", - "catalog_object_id": "catalog_object_id2" - } - ], - "location_id": "MXVQSVNDGN3C8", - "net_amounts": { - "discount_money": { - "amount": 0, - "currency": "USD" - }, - "service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "tax_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 900, - "currency": "USD" - } - }, - "source": { - "name": "Cookies" - }, - "state": "OPEN", - "total_discount_money": { - "amount": 0, - "currency": "USD" - }, - "total_money": { - "amount": 900, - "currency": "USD" - }, - "total_service_charge_money": { - "amount": 0, - "currency": "USD" - }, - "total_tax_money": { - "amount": 0, - "currency": "USD" - }, - "updated_at": "2019-08-23T18:33:47.523Z", - "version": 2, - "reference_id": "reference_id4", - "customer_id": "customer_id4" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-payment-link-request.md b/doc/models/update-payment-link-request.md deleted file mode 100644 index 81b79215..00000000 --- a/doc/models/update-payment-link-request.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Update Payment Link Request - -## Structure - -`UpdatePaymentLinkRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `paymentLink` | [`PaymentLink`](../../doc/models/payment-link.md) | Required | - | getPaymentLink(): PaymentLink | setPaymentLink(PaymentLink paymentLink): void | - -## Example (as JSON) - -```json -{ - "payment_link": { - "checkout_options": { - "ask_for_shipping_address": true, - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "version": 1, - "id": "id2", - "description": "description2", - "order_id": "order_id6", - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - } -} -``` - diff --git a/doc/models/update-payment-link-response.md b/doc/models/update-payment-link-response.md deleted file mode 100644 index 5a0ea5db..00000000 --- a/doc/models/update-payment-link-response.md +++ /dev/null @@ -1,78 +0,0 @@ - -# Update Payment Link Response - -## Structure - -`UpdatePaymentLinkResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the payment link. | getErrors(): ?array | setErrors(?array errors): void | -| `paymentLink` | [`?PaymentLink`](../../doc/models/payment-link.md) | Optional | - | getPaymentLink(): ?PaymentLink | setPaymentLink(?PaymentLink paymentLink): void | - -## Example (as JSON) - -```json -{ - "payment_link": { - "checkout_options": { - "ask_for_shipping_address": true, - "allow_tipping": false, - "custom_fields": [ - { - "title": "title8" - }, - { - "title": "title8" - } - ], - "subscription_plan_id": "subscription_plan_id8", - "redirect_url": "redirect_url2", - "merchant_support_email": "merchant_support_email8" - }, - "created_at": "2022-04-26T00:15:15Z", - "id": "TY4BWEDJ6AI5MBIV", - "long_url": "https://checkout.square.site/EXAMPLE", - "order_id": "Qqc8ypQGvxVwc46Cch4zHTaJqc4F", - "payment_note": "test", - "updated_at": "2022-04-26T00:18:24Z", - "url": "https://square.link/u/EXAMPLE", - "version": 2, - "description": "description2", - "pre_populated_data": { - "buyer_email": "buyer_email8", - "buyer_phone_number": "buyer_phone_number0", - "buyer_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "address_line_3": "address_line_38", - "locality": "locality2", - "sublocality": "sublocality2" - } - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-payment-request.md b/doc/models/update-payment-request.md deleted file mode 100644 index 3f12741d..00000000 --- a/doc/models/update-payment-request.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Update Payment Request - -Describes a request to update a payment using -[UpdatePayment](../../doc/apis/payments.md#update-payment). - -## Structure - -`UpdatePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | -| `idempotencyKey` | `string` | Required | A unique string that identifies this `UpdatePayment` request. Keys can be any valid string
but must be unique for every `UpdatePayment` request.

For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", - "payment": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "tip_money": { - "amount": 100, - "currency": "USD" - }, - "version_token": "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o", - "id": "id6", - "created_at": "created_at4", - "updated_at": "updated_at2" - } -} -``` - diff --git a/doc/models/update-payment-response.md b/doc/models/update-payment-response.md deleted file mode 100644 index 4aead208..00000000 --- a/doc/models/update-payment-response.md +++ /dev/null @@ -1,111 +0,0 @@ - -# Update Payment Response - -Defines the response returned by -[UpdatePayment](../../doc/apis/payments.md#update-payment). - -## Structure - -`UpdatePaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `payment` | [`?Payment`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | getPayment(): ?Payment | setPayment(?Payment payment): void | - -## Example (as JSON) - -```json -{ - "payment": { - "amount_money": { - "amount": 1000, - "currency": "USD" - }, - "application_details": { - "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", - "square_product": "ECOMMERCE_API" - }, - "approved_money": { - "amount": 1000, - "currency": "USD" - }, - "capabilities": [ - "EDIT_AMOUNT_UP", - "EDIT_AMOUNT_DOWN", - "EDIT_TIP_AMOUNT_UP", - "EDIT_TIP_AMOUNT_DOWN" - ], - "card_details": { - "auth_result_code": "68aLBM", - "avs_status": "AVS_ACCEPTED", - "card": { - "bin": "411111", - "card_brand": "VISA", - "card_type": "DEBIT", - "exp_month": 11, - "exp_year": 2022, - "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - "last_4": "1111", - "prepaid_type": "NOT_PREPAID" - }, - "card_payment_timeline": { - "authorized_at": "2021-10-13T20:26:44.364Z" - }, - "cvv_status": "CVV_ACCEPTED", - "entry_method": "ON_FILE", - "statement_description": "SQ *EXAMPLE TEST GOSQ.C", - "status": "AUTHORIZED" - }, - "created_at": "2021-10-13T20:26:44.191Z", - "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", - "delay_action": "CANCEL", - "delay_duration": "PT168H", - "delayed_until": "2021-10-20T20:26:44.191Z", - "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", - "location_id": "L88917AVBK2S5", - "note": "Example Note", - "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", - "receipt_number": "1Qjq", - "risk_evaluation": { - "created_at": "2021-10-13T20:26:45.271Z", - "risk_level": "NORMAL" - }, - "source_type": "CARD", - "status": "APPROVED", - "tip_money": { - "amount": 100, - "currency": "USD" - }, - "total_money": { - "amount": 1100, - "currency": "USD" - }, - "updated_at": "2021-10-13T20:26:44.364Z", - "version_token": "rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-shift-request.md b/doc/models/update-shift-request.md deleted file mode 100644 index 9644e0c0..00000000 --- a/doc/models/update-shift-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Update Shift Request - -A request to update a `Shift` object. - -## Structure - -`UpdateShiftRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `shift` | [`Shift`](../../doc/models/shift.md) | Required | A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift. | getShift(): Shift | setShift(Shift shift): void | - -## Example (as JSON) - -```json -{ - "shift": { - "breaks": [ - { - "break_type_id": "REGS1EQR1TPZ5", - "end_at": "2019-01-25T06:16:00-05:00", - "expected_duration": "PT5M", - "id": "X7GAQYVVRRG6P", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-25T06:11:00-05:00" - } - ], - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "end_at": "2019-01-25T13:11:00-05:00", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-25T03:11:00-05:00", - "team_member_id": "ormj0jJJZ5OZIzxrZYJI", - "version": 1, - "wage": { - "hourly_rate": { - "amount": 1500, - "currency": "USD" - }, - "tip_eligible": true, - "title": "Bartender", - "job_id": "job_id0" - }, - "id": "id4", - "employee_id": "employee_id4", - "timezone": "timezone4" - } -} -``` - diff --git a/doc/models/update-shift-response.md b/doc/models/update-shift-response.md deleted file mode 100644 index ae1af642..00000000 --- a/doc/models/update-shift-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Update Shift Response - -The response to a request to update a `Shift`. The response contains -the updated `Shift` object and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`UpdateShiftResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `shift` | [`?Shift`](../../doc/models/shift.md) | Optional | A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift. | getShift(): ?Shift | setShift(?Shift shift): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "shift": { - "breaks": [ - { - "break_type_id": "REGS1EQR1TPZ5", - "end_at": "2019-01-25T06:16:00-05:00", - "expected_duration": "PT5M", - "id": "X7GAQYVVRRG6P", - "is_paid": true, - "name": "Tea Break", - "start_at": "2019-01-25T06:11:00-05:00" - } - ], - "created_at": "2019-02-28T00:39:02Z", - "declared_cash_tip_money": { - "amount": 500, - "currency": "USD" - }, - "employee_id": "ormj0jJJZ5OZIzxrZYJI", - "end_at": "2019-01-25T13:11:00-05:00", - "id": "K0YH4CV5462JB", - "location_id": "PAA1RJZZKXBFG", - "start_at": "2019-01-25T03:11:00-05:00", - "status": "CLOSED", - "team_member_id": "ormj0jJJZ5OZIzxrZYJI", - "timezone": "America/New_York", - "updated_at": "2019-02-28T00:42:41Z", - "version": 2, - "wage": { - "hourly_rate": { - "amount": 1500, - "currency": "USD" - }, - "job_id": "dZtrPh5GSDGugyXGByesVp51", - "tip_eligible": true, - "title": "Bartender" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md deleted file mode 100644 index 184207cc..00000000 --- a/doc/models/update-subscription-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Update Subscription Request - -Defines input parameters in a request to the -[UpdateSubscription](../../doc/apis/subscriptions.md#update-subscription) endpoint. - -## Structure - -`UpdateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "canceled_date": null, - "card_id": "{NEW CARD ID}", - "id": "id4", - "location_id": "location_id8", - "plan_variation_id": "plan_variation_id8", - "customer_id": "customer_id2", - "start_date": "start_date8" - } -} -``` - diff --git a/doc/models/update-subscription-response.md b/doc/models/update-subscription-response.md deleted file mode 100644 index 1f012a92..00000000 --- a/doc/models/update-subscription-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Update Subscription Response - -Defines output parameters in a response from the -[UpdateSubscription](../../doc/apis/subscriptions.md#update-subscription) endpoint. - -## Structure - -`UpdateSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "card_id": "{NEW CARD ID}", - "charged_through_date": "2023-03-13", - "created_at": "2023-01-30T19:27:32Z", - "customer_id": "AM69AB81FT4479YH9HGWS1HZY8", - "id": "7217d8ca-1fee-4446-a9e5-8540b5d8c9bb", - "invoice_ids": [ - "inv:0-ChAPSfVYvNewckgf3x4iigN_ENMM", - "inv:0-ChBQaCCLfjcm9WEUBGxvuydJENMM" - ], - "location_id": "LPJKHYR7WFDKN", - "plan_variation_id": "XOUNEKCE6NSXQW5NTSQ73MMX", - "source": { - "name": "My Application" - }, - "start_date": "2023-01-30", - "status": "ACTIVE", - "timezone": "UTC", - "version": 3 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-team-member-request.md b/doc/models/update-team-member-request.md deleted file mode 100644 index 8c24e190..00000000 --- a/doc/models/update-team-member-request.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Update Team Member Request - -Represents an update request for a `TeamMember` object. - -## Structure - -`UpdateTeamMemberRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMember` | [`?TeamMember`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | getTeamMember(): ?TeamMember | setTeamMember(?TeamMember teamMember): void | - -## Example (as JSON) - -```json -{ - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "YSGH2WBKG94QZ", - "GA2Y9HSJ8KRYT" - ], - "wage_setting": { - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 1200, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "pay_type": "HOURLY" - } - ] - } - }, - "email_address": "joe_doe@gmail.com", - "family_name": "Doe", - "given_name": "Joe", - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "id": "id6", - "is_owner": false - } -} -``` - diff --git a/doc/models/update-team-member-response.md b/doc/models/update-team-member-response.md deleted file mode 100644 index 538de70c..00000000 --- a/doc/models/update-team-member-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Update Team Member Response - -Represents a response from an update request containing the updated `TeamMember` object or error messages. - -## Structure - -`UpdateTeamMemberResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMember` | [`?TeamMember`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | getTeamMember(): ?TeamMember | setTeamMember(?TeamMember teamMember): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "team_member": { - "assigned_locations": { - "assignment_type": "EXPLICIT_LOCATIONS", - "location_ids": [ - "GA2Y9HSJ8KRYT", - "YSGH2WBKG94QZ" - ] - }, - "created_at": "2021-06-11T22:55:45Z", - "email_address": "joe_doe@example.com", - "family_name": "Doe", - "given_name": "Joe", - "id": "1yJlHapkseYnNPETIU1B", - "is_owner": false, - "phone_number": "+14159283333", - "reference_id": "reference_id_1", - "status": "ACTIVE", - "updated_at": "2021-06-15T17:38:05Z", - "wage_setting": { - "created_at": "2021-06-11T22:55:45Z", - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 1443, - "currency": "USD" - }, - "job_id": "FjS8x95cqHiMenw4f1NAUH4P", - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40 - }, - { - "hourly_rate": { - "amount": 1200, - "currency": "USD" - }, - "job_id": "VDNpRv8da51NU8qZFC5zDWpF", - "job_title": "Cashier", - "pay_type": "HOURLY" - } - ], - "team_member_id": "1yJlHapkseYnNPETIU1B", - "updated_at": "2021-06-11T22:55:45Z", - "version": 1 - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-vendor-request.md b/doc/models/update-vendor-request.md deleted file mode 100644 index daf12aad..00000000 --- a/doc/models/update-vendor-request.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Update Vendor Request - -Represents an input to a call to [UpdateVendor](../../doc/apis/vendors.md#update-vendor). - -## Structure - -`UpdateVendorRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A client-supplied, universally unique identifier (UUID) for the
request.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more
information.
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `vendor` | [`Vendor`](../../doc/models/vendor.md) | Required | Represents a supplier to a seller. | getVendor(): Vendor | setVendor(Vendor vendor): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - "vendor": { - "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", - "name": "Jack's Chicken Shack", - "status": "ACTIVE", - "version": 1, - "created_at": "created_at4", - "updated_at": "updated_at2", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } - } -} -``` - diff --git a/doc/models/update-vendor-response.md b/doc/models/update-vendor-response.md deleted file mode 100644 index b5157754..00000000 --- a/doc/models/update-vendor-response.md +++ /dev/null @@ -1,71 +0,0 @@ - -# Update Vendor Response - -Represents an output from a call to [UpdateVendor](../../doc/apis/vendors.md#update-vendor). - -## Structure - -`UpdateVendorResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors occurred when the request fails. | getErrors(): ?array | setErrors(?array errors): void | -| `vendor` | [`?Vendor`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | getVendor(): ?Vendor | setVendor(?Vendor vendor): void | - -## Example (as JSON) - -```json -{ - "vendor": { - "account_number": "4025391", - "address": { - "address_line_1": "505 Electric Ave", - "address_line_2": "Suite 600", - "administrative_district_level_1": "NY", - "country": "US", - "locality": "New York", - "postal_code": "10003", - "address_line_3": "address_line_32", - "sublocality": "sublocality6" - }, - "contacts": [ - { - "email_address": "joe@joesfreshseafood.com", - "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", - "name": "Joe Burrow", - "ordinal": 0, - "phone_number": "1-212-555-4250" - } - ], - "created_at": "2022-03-16T10:21:54.859Z", - "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", - "name": "Jack's Chicken Shack", - "status": "ACTIVE", - "updated_at": "2022-03-16T20:21:54.859Z", - "version": 2 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-wage-setting-request.md b/doc/models/update-wage-setting-request.md deleted file mode 100644 index 5af7a1de..00000000 --- a/doc/models/update-wage-setting-request.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Update Wage Setting Request - -Represents an update request for the `WageSetting` object describing a `TeamMember`. - -## Structure - -`UpdateWageSettingRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `wageSetting` | [`WageSetting`](../../doc/models/wage-setting.md) | Required | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | getWageSetting(): WageSetting | setWageSetting(WageSetting wageSetting): void | - -## Example (as JSON) - -```json -{ - "wage_setting": { - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40, - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "job_id": "job_id2" - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_title": "Cashier", - "pay_type": "HOURLY", - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 98, - "job_id": "job_id2" - } - ], - "team_member_id": "team_member_id8", - "version": 130, - "created_at": "created_at6" - } -} -``` - diff --git a/doc/models/update-wage-setting-response.md b/doc/models/update-wage-setting-response.md deleted file mode 100644 index 20e4097a..00000000 --- a/doc/models/update-wage-setting-response.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Update Wage Setting Response - -Represents a response from an update request containing the updated `WageSetting` object -or error messages. - -## Structure - -`UpdateWageSettingResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `wageSetting` | [`?WageSetting`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | getWageSetting(): ?WageSetting | setWageSetting(?WageSetting wageSetting): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "wage_setting": { - "created_at": "2019-07-10T17:26:48+00:00", - "is_overtime_exempt": true, - "job_assignments": [ - { - "annual_rate": { - "amount": 3000000, - "currency": "USD" - }, - "hourly_rate": { - "amount": 1443, - "currency": "USD" - }, - "job_title": "Manager", - "pay_type": "SALARY", - "weekly_hours": 40, - "job_id": "job_id2" - }, - { - "hourly_rate": { - "amount": 2000, - "currency": "USD" - }, - "job_title": "Cashier", - "pay_type": "HOURLY", - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 98, - "job_id": "job_id2" - } - ], - "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", - "updated_at": "2020-06-11T23:12:04+00:00", - "version": 1 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-webhook-subscription-request.md b/doc/models/update-webhook-subscription-request.md deleted file mode 100644 index faf40eb5..00000000 --- a/doc/models/update-webhook-subscription-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Update Webhook Subscription Request - -Updates a [Subscription](../../doc/models/webhook-subscription.md). - -## Structure - -`UpdateWebhookSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `subscription` | [`?WebhookSubscription`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscription(): ?WebhookSubscription | setSubscription(?WebhookSubscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "enabled": false, - "name": "Updated Example Webhook Subscription", - "id": "id4", - "event_types": [ - "event_types2", - "event_types3" - ], - "notification_url": "notification_url8" - } -} -``` - diff --git a/doc/models/update-webhook-subscription-response.md b/doc/models/update-webhook-subscription-response.md deleted file mode 100644 index c4bdbbb7..00000000 --- a/doc/models/update-webhook-subscription-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Update Webhook Subscription Response - -Defines the fields that are included in the response body of -a request to the [UpdateWebhookSubscription](../../doc/apis/webhook-subscriptions.md#update-webhook-subscription) endpoint. - -Note: If there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) is not -present. - -## Structure - -`UpdateWebhookSubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?WebhookSubscription`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | getSubscription(): ?WebhookSubscription | setSubscription(?WebhookSubscription subscription): void | - -## Example (as JSON) - -```json -{ - "subscription": { - "api_version": "2021-12-15", - "created_at": "2022-01-10 23:29:48 +0000 UTC", - "enabled": false, - "event_types": [ - "payment.created", - "payment.updated" - ], - "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", - "name": "Updated Example Webhook Subscription", - "notification_url": "https://example-webhook-url.com", - "updated_at": "2022-01-10 23:45:51 +0000 UTC" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-webhook-subscription-signature-key-request.md b/doc/models/update-webhook-subscription-signature-key-request.md deleted file mode 100644 index 7a3680d7..00000000 --- a/doc/models/update-webhook-subscription-signature-key-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Update Webhook Subscription Signature Key Request - -Updates a [Subscription](../../doc/models/webhook-subscription.md) by replacing the existing signature key with a new one. - -## Structure - -`UpdateWebhookSubscriptionSignatureKeyRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request.
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "ed80ae6b-0654-473b-bbab-a39aee89a60d" -} -``` - diff --git a/doc/models/update-webhook-subscription-signature-key-response.md b/doc/models/update-webhook-subscription-signature-key-response.md deleted file mode 100644 index 84cd4591..00000000 --- a/doc/models/update-webhook-subscription-signature-key-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Update Webhook Subscription Signature Key Response - -Defines the fields that are included in the response body of -a request to the [UpdateWebhookSubscriptionSignatureKey](../../doc/apis/webhook-subscriptions.md#update-webhook-subscription-signature-key) endpoint. - -Note: If there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) is not -present. - -## Structure - -`UpdateWebhookSubscriptionSignatureKeyResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `signatureKey` | `?string` | Optional | The new Square-generated signature key used to validate the origin of the webhook event. | getSignatureKey(): ?string | setSignatureKey(?string signatureKey): void | - -## Example (as JSON) - -```json -{ - "signature_key": "1k9bIJKCeTmSQwyagtNRLg", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/update-workweek-config-request.md b/doc/models/update-workweek-config-request.md deleted file mode 100644 index 9407d0be..00000000 --- a/doc/models/update-workweek-config-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Update Workweek Config Request - -A request to update a `WorkweekConfig` object. - -## Structure - -`UpdateWorkweekConfigRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `workweekConfig` | [`WorkweekConfig`](../../doc/models/workweek-config.md) | Required | Sets the day of the week and hour of the day that a business starts a
workweek. This is used to calculate overtime pay. | getWorkweekConfig(): WorkweekConfig | setWorkweekConfig(WorkweekConfig workweekConfig): void | - -## Example (as JSON) - -```json -{ - "workweek_config": { - "start_of_day_local_time": "10:00", - "start_of_week": "MON", - "version": 10, - "id": "id0", - "created_at": "created_at8", - "updated_at": "updated_at6" - } -} -``` - diff --git a/doc/models/update-workweek-config-response.md b/doc/models/update-workweek-config-response.md deleted file mode 100644 index 6fb97137..00000000 --- a/doc/models/update-workweek-config-response.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Update Workweek Config Response - -The response to a request to update a `WorkweekConfig` object. The response contains -the updated `WorkweekConfig` object and might contain a set of `Error` objects if -the request resulted in errors. - -## Structure - -`UpdateWorkweekConfigResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `workweekConfig` | [`?WorkweekConfig`](../../doc/models/workweek-config.md) | Optional | Sets the day of the week and hour of the day that a business starts a
workweek. This is used to calculate overtime pay. | getWorkweekConfig(): ?WorkweekConfig | setWorkweekConfig(?WorkweekConfig workweekConfig): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "workweek_config": { - "created_at": "2016-02-04T00:58:24Z", - "id": "FY4VCAQN700GM", - "start_of_day_local_time": "10:00", - "start_of_week": "MON", - "updated_at": "2019-02-28T01:04:35Z", - "version": 11 - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-booking-custom-attribute-request.md b/doc/models/upsert-booking-custom-attribute-request.md deleted file mode 100644 index 6c28dd38..00000000 --- a/doc/models/upsert-booking-custom-attribute-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Upsert Booking Custom Attribute Request - -Represents an [UpsertBookingCustomAttribute](../../doc/apis/booking-custom-attributes.md#upsert-booking-custom-attribute) request. - -## Structure - -`UpsertBookingCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/upsert-booking-custom-attribute-response.md b/doc/models/upsert-booking-custom-attribute-response.md deleted file mode 100644 index 32daedce..00000000 --- a/doc/models/upsert-booking-custom-attribute-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Upsert Booking Custom Attribute Response - -Represents an [UpsertBookingCustomAttribute](../../doc/apis/booking-custom-attributes.md#upsert-booking-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpsertBookingCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-catalog-object-request.md b/doc/models/upsert-catalog-object-request.md deleted file mode 100644 index 65627b27..00000000 --- a/doc/models/upsert-catalog-object-request.md +++ /dev/null @@ -1,80 +0,0 @@ - -# Upsert Catalog Object Request - -## Structure - -`UpsertCatalogObjectRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
request among all your requests. A common way to create
a valid idempotency key is to use a Universally unique
identifier (UUID).

If you're unsure whether a particular request was successful,
you can reattempt it with the same idempotency key without
worrying about creating duplicate objects.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `object` | [`CatalogObject`](../../doc/models/catalog-object.md) | Required | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getObject(): CatalogObject | setObject(CatalogObject object): void | - -## Example (as JSON) - -```json -{ - "idempotency_key": "af3d1afc-7212-4300-b463-0bfc5314a5ae", - "object": { - "id": "#Cocoa", - "item_data": { - "abbreviation": "Ch", - "description_html": "

Hot Chocolate

", - "name": "Cocoa", - "variations": [ - { - "id": "#Small", - "item_variation_data": { - "item_id": "#Cocoa", - "name": "Small", - "pricing_type": "VARIABLE_PRICING" - }, - "type": "ITEM_VARIATION" - }, - { - "id": "#Large", - "item_variation_data": { - "item_id": "#Cocoa", - "name": "Large", - "price_money": { - "amount": 400, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING" - }, - "type": "ITEM_VARIATION" - } - ] - }, - "type": "ITEM", - "updated_at": "updated_at8", - "version": 4, - "is_deleted": false, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - } -} -``` - diff --git a/doc/models/upsert-catalog-object-response.md b/doc/models/upsert-catalog-object-response.md deleted file mode 100644 index dce2efec..00000000 --- a/doc/models/upsert-catalog-object-response.md +++ /dev/null @@ -1,139 +0,0 @@ - -# Upsert Catalog Object Response - -## Structure - -`UpsertCatalogObjectResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `catalogObject` | [`?CatalogObject`](../../doc/models/catalog-object.md) | Optional | The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. | getCatalogObject(): ?CatalogObject | setCatalogObject(?CatalogObject catalogObject): void | -| `idMappings` | [`?(CatalogIdMapping[])`](../../doc/models/catalog-id-mapping.md) | Optional | The mapping between client and server IDs for this upsert. | getIdMappings(): ?array | setIdMappings(?array idMappings): void | - -## Example (as JSON) - -```json -{ - "catalog_object": { - "id": "R2TA2FOBUGCJZNIWJSOSNAI4", - "is_deleted": false, - "item_data": { - "abbreviation": "Ch", - "description": "Hot Chocolate", - "description_html": "

Hot Chocolate

", - "description_plaintext": "Hot Chocolate", - "name": "Cocoa", - "product_type": "REGULAR", - "variations": [ - { - "id": "QRT53UP4LITLWGOGBZCUWP63", - "is_deleted": false, - "item_variation_data": { - "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", - "name": "Small", - "ordinal": 0, - "pricing_type": "VARIABLE_PRICING", - "stockable": true - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2021-06-14T15:51:39.021Z", - "version": 1623685899021 - }, - { - "id": "NS77DKEIQ3AEQTCP727DSA7U", - "is_deleted": false, - "item_variation_data": { - "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", - "name": "Large", - "ordinal": 1, - "price_money": { - "amount": 400, - "currency": "USD" - }, - "pricing_type": "FIXED_PRICING", - "stockable": true - }, - "present_at_all_locations": true, - "type": "ITEM_VARIATION", - "updated_at": "2021-06-14T15:51:39.021Z", - "version": 1623685899021 - } - ] - }, - "present_at_all_locations": true, - "type": "ITEM", - "updated_at": "2021-06-14T15:51:39.021Z", - "version": 1623685899021, - "custom_attribute_values": { - "key0": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key1": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - }, - "key2": { - "name": "name8", - "string_value": "string_value2", - "custom_attribute_definition_id": "custom_attribute_definition_id4", - "type": "STRING", - "number_value": "number_value8" - } - }, - "catalog_v1_ids": [ - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - }, - { - "catalog_v1_id": "catalog_v1_id4", - "location_id": "location_id4" - } - ] - }, - "id_mappings": [ - { - "client_object_id": "#Cocoa", - "object_id": "R2TA2FOBUGCJZNIWJSOSNAI4" - }, - { - "client_object_id": "#Small", - "object_id": "QRT53UP4LITLWGOGBZCUWP63" - }, - { - "client_object_id": "#Large", - "object_id": "NS77DKEIQ3AEQTCP727DSA7U" - } - ], - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-customer-custom-attribute-request.md b/doc/models/upsert-customer-custom-attribute-request.md deleted file mode 100644 index f8203607..00000000 --- a/doc/models/upsert-customer-custom-attribute-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Upsert Customer Custom Attribute Request - -Represents an [UpsertCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#upsert-customer-custom-attribute) request. - -## Structure - -`UpsertCustomerCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" -} -``` - diff --git a/doc/models/upsert-customer-custom-attribute-response.md b/doc/models/upsert-customer-custom-attribute-response.md deleted file mode 100644 index b1d8c024..00000000 --- a/doc/models/upsert-customer-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Upsert Customer Custom Attribute Response - -Represents an [UpsertCustomerCustomAttribute](../../doc/apis/customer-custom-attributes.md#upsert-customer-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpsertCustomerCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-location-custom-attribute-request.md b/doc/models/upsert-location-custom-attribute-request.md deleted file mode 100644 index 0b94baca..00000000 --- a/doc/models/upsert-location-custom-attribute-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Upsert Location Custom Attribute Request - -Represents an [UpsertLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#upsert-location-custom-attribute) request. - -## Structure - -`UpsertLocationCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key8" -} -``` - diff --git a/doc/models/upsert-location-custom-attribute-response.md b/doc/models/upsert-location-custom-attribute-response.md deleted file mode 100644 index afada6ed..00000000 --- a/doc/models/upsert-location-custom-attribute-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Upsert Location Custom Attribute Response - -Represents an [UpsertLocationCustomAttribute](../../doc/apis/location-custom-attributes.md#upsert-location-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpsertLocationCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-merchant-custom-attribute-request.md b/doc/models/upsert-merchant-custom-attribute-request.md deleted file mode 100644 index 9a0a503c..00000000 --- a/doc/models/upsert-merchant-custom-attribute-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Upsert Merchant Custom Attribute Request - -Represents an [UpsertMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#upsert-merchant-custom-attribute) request. - -## Structure - -`UpsertMerchantCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key6" -} -``` - diff --git a/doc/models/upsert-merchant-custom-attribute-response.md b/doc/models/upsert-merchant-custom-attribute-response.md deleted file mode 100644 index 1c8bc27c..00000000 --- a/doc/models/upsert-merchant-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Upsert Merchant Custom Attribute Response - -Represents an [UpsertMerchantCustomAttribute](../../doc/apis/merchant-custom-attributes.md#upsert-merchant-custom-attribute) response. -Either `custom_attribute_definition` or `errors` is present in the response. - -## Structure - -`UpsertMerchantCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-order-custom-attribute-request.md b/doc/models/upsert-order-custom-attribute-request.md deleted file mode 100644 index 3f32476c..00000000 --- a/doc/models/upsert-order-custom-attribute-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Upsert Order Custom Attribute Request - -Represents an upsert request for an order custom attribute. - -## Structure - -`UpsertOrderCustomAttributeRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): CustomAttribute | setCustomAttribute(CustomAttribute customAttribute): void | -| `idempotencyKey` | `?string` | Optional | A unique identifier for this request, used to ensure idempotency.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "idempotency_key": "idempotency_key4" -} -``` - diff --git a/doc/models/upsert-order-custom-attribute-response.md b/doc/models/upsert-order-custom-attribute-response.md deleted file mode 100644 index c352736b..00000000 --- a/doc/models/upsert-order-custom-attribute-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Upsert Order Custom Attribute Response - -Represents a response from upserting order custom attribute definitions. - -## Structure - -`UpsertOrderCustomAttributeResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `customAttribute` | [`?CustomAttribute`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | getCustomAttribute(): ?CustomAttribute | setCustomAttribute(?CustomAttribute customAttribute): void | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "custom_attribute": { - "key": "key2", - "value": { - "key1": "val1", - "key2": "val2" - }, - "version": 102, - "visibility": "VISIBILITY_READ_ONLY", - "definition": { - "key": "key0", - "schema": { - "key1": "val1", - "key2": "val2" - }, - "name": "name0", - "description": "description0", - "visibility": "VISIBILITY_HIDDEN" - } - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/upsert-snippet-request.md b/doc/models/upsert-snippet-request.md deleted file mode 100644 index 61ce68b2..00000000 --- a/doc/models/upsert-snippet-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Upsert Snippet Request - -Represents an `UpsertSnippet` request. - -## Structure - -`UpsertSnippetRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `snippet` | [`Snippet`](../../doc/models/snippet.md) | Required | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): Snippet | setSnippet(Snippet snippet): void | - -## Example (as JSON) - -```json -{ - "snippet": { - "content": "", - "id": "id0", - "site_id": "site_id6", - "created_at": "created_at8", - "updated_at": "updated_at4" - } -} -``` - diff --git a/doc/models/upsert-snippet-response.md b/doc/models/upsert-snippet-response.md deleted file mode 100644 index 2f91eff5..00000000 --- a/doc/models/upsert-snippet-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Upsert Snippet Response - -Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. - -## Structure - -`UpsertSnippetResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `snippet` | [`?Snippet`](../../doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | - -## Example (as JSON) - -```json -{ - "snippet": { - "content": "", - "created_at": "2021-03-11T25:40:09.000000Z", - "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", - "site_id": "site_278075276488921835", - "updated_at": "2021-03-11T25:40:09.000000Z" - }, - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/v1-device.md b/doc/models/v1-device.md deleted file mode 100644 index 5040bbe0..00000000 --- a/doc/models/v1-device.md +++ /dev/null @@ -1,23 +0,0 @@ - -# V1 Device - -## Structure - -`V1Device` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The device's Square-issued ID. | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | The device's merchant-specified name. | getName(): ?string | setName(?string name): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "name": "name6" -} -``` - diff --git a/doc/models/v1-list-orders-request.md b/doc/models/v1-list-orders-request.md deleted file mode 100644 index 8e3b4ff2..00000000 --- a/doc/models/v1-list-orders-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# V1 List Orders Request - -## Structure - -`V1ListOrdersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `order` | [`?string(SortOrder)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | -| `limit` | `?int` | Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | getLimit(): ?int | setLimit(?int limit): void | -| `batchToken` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | getBatchToken(): ?string | setBatchToken(?string batchToken): void | - -## Example (as JSON) - -```json -{ - "order": "DESC", - "limit": 24, - "batch_token": "batch_token4" -} -``` - diff --git a/doc/models/v1-list-orders-response.md b/doc/models/v1-list-orders-response.md deleted file mode 100644 index 245a7a1c..00000000 --- a/doc/models/v1-list-orders-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# V1 List Orders Response - -## Structure - -`V1ListOrdersResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `items` | [`?(V1Order[])`](../../doc/models/v1-order.md) | Optional | - | getItems(): ?array | setItems(?array items): void | - -## Example (as JSON) - -```json -{ - "items": [ - { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "id": "id8", - "buyer_email": "buyer_email0", - "recipient_name": "recipient_name6", - "recipient_phone_number": "recipient_phone_number6" - }, - { - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "id": "id8", - "buyer_email": "buyer_email0", - "recipient_name": "recipient_name6", - "recipient_phone_number": "recipient_phone_number6" - } - ] -} -``` - diff --git a/doc/models/v1-money.md b/doc/models/v1-money.md deleted file mode 100644 index ab2426cd..00000000 --- a/doc/models/v1-money.md +++ /dev/null @@ -1,23 +0,0 @@ - -# V1 Money - -## Structure - -`V1Money` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `amount` | `?int` | Optional | Amount in the lowest denominated value of this Currency. E.g. in USD
these are cents, in JPY they are Yen (which do not have a 'cent' concept). | getAmount(): ?int | setAmount(?int amount): void | -| `currencyCode` | [`?string(Currency)`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | getCurrencyCode(): ?string | setCurrencyCode(?string currencyCode): void | - -## Example (as JSON) - -```json -{ - "amount": 24, - "currency_code": "XPT" -} -``` - diff --git a/doc/models/v1-order-history-entry-action.md b/doc/models/v1-order-history-entry-action.md deleted file mode 100644 index 1d9f6752..00000000 --- a/doc/models/v1-order-history-entry-action.md +++ /dev/null @@ -1,19 +0,0 @@ - -# V1 Order History Entry Action - -## Enumeration - -`V1OrderHistoryEntryAction` - -## Fields - -| Name | -| --- | -| `ORDER_PLACED` | -| `DECLINED` | -| `PAYMENT_RECEIVED` | -| `CANCELED` | -| `COMPLETED` | -| `REFUNDED` | -| `EXPIRED` | - diff --git a/doc/models/v1-order-history-entry.md b/doc/models/v1-order-history-entry.md deleted file mode 100644 index dc0f7707..00000000 --- a/doc/models/v1-order-history-entry.md +++ /dev/null @@ -1,25 +0,0 @@ - -# V1 Order History Entry - -V1OrderHistoryEntry - -## Structure - -`V1OrderHistoryEntry` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `action` | [`?string(V1OrderHistoryEntryAction)`](../../doc/models/v1-order-history-entry-action.md) | Optional | - | getAction(): ?string | setAction(?string action): void | -| `createdAt` | `?string` | Optional | The time when the action was performed, in ISO 8601 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | - -## Example (as JSON) - -```json -{ - "action": "EXPIRED", - "created_at": "created_at8" -} -``` - diff --git a/doc/models/v1-order-state.md b/doc/models/v1-order-state.md deleted file mode 100644 index ed04b532..00000000 --- a/doc/models/v1-order-state.md +++ /dev/null @@ -1,18 +0,0 @@ - -# V1 Order State - -## Enumeration - -`V1OrderState` - -## Fields - -| Name | -| --- | -| `PENDING` | -| `OPEN` | -| `COMPLETED` | -| `CANCELED` | -| `REFUNDED` | -| `REJECTED` | - diff --git a/doc/models/v1-order.md b/doc/models/v1-order.md deleted file mode 100644 index 677f5c31..00000000 --- a/doc/models/v1-order.md +++ /dev/null @@ -1,64 +0,0 @@ - -# V1 Order - -V1Order - -## Structure - -`V1Order` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `id` | `?string` | Optional | The order's unique identifier. | getId(): ?string | setId(?string id): void | -| `buyerEmail` | `?string` | Optional | The email address of the order's buyer. | getBuyerEmail(): ?string | setBuyerEmail(?string buyerEmail): void | -| `recipientName` | `?string` | Optional | The name of the order's buyer. | getRecipientName(): ?string | setRecipientName(?string recipientName): void | -| `recipientPhoneNumber` | `?string` | Optional | The phone number to use for the order's delivery. | getRecipientPhoneNumber(): ?string | setRecipientPhoneNumber(?string recipientPhoneNumber): void | -| `state` | [`?string(V1OrderState)`](../../doc/models/v1-order-state.md) | Optional | - | getState(): ?string | setState(?string state): void | -| `shippingAddress` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | -| `subtotalMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getSubtotalMoney(): ?V1Money | setSubtotalMoney(?V1Money subtotalMoney): void | -| `totalShippingMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTotalShippingMoney(): ?V1Money | setTotalShippingMoney(?V1Money totalShippingMoney): void | -| `totalTaxMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTotalTaxMoney(): ?V1Money | setTotalTaxMoney(?V1Money totalTaxMoney): void | -| `totalPriceMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTotalPriceMoney(): ?V1Money | setTotalPriceMoney(?V1Money totalPriceMoney): void | -| `totalDiscountMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTotalDiscountMoney(): ?V1Money | setTotalDiscountMoney(?V1Money totalDiscountMoney): void | -| `createdAt` | `?string` | Optional | The time when the order was created, in ISO 8601 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The time when the order was last modified, in ISO 8601 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `expiresAt` | `?string` | Optional | The time when the order expires if no action is taken, in ISO 8601 format. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `paymentId` | `?string` | Optional | The unique identifier of the payment associated with the order. | getPaymentId(): ?string | setPaymentId(?string paymentId): void | -| `buyerNote` | `?string` | Optional | A note provided by the buyer when the order was created, if any. | getBuyerNote(): ?string | setBuyerNote(?string buyerNote): void | -| `completedNote` | `?string` | Optional | A note provided by the merchant when the order's state was set to COMPLETED, if any | getCompletedNote(): ?string | setCompletedNote(?string completedNote): void | -| `refundedNote` | `?string` | Optional | A note provided by the merchant when the order's state was set to REFUNDED, if any. | getRefundedNote(): ?string | setRefundedNote(?string refundedNote): void | -| `canceledNote` | `?string` | Optional | A note provided by the merchant when the order's state was set to CANCELED, if any. | getCanceledNote(): ?string | setCanceledNote(?string canceledNote): void | -| `tender` | [`?V1Tender`](../../doc/models/v1-tender.md) | Optional | A tender represents a discrete monetary exchange. Square represents this
exchange as a money object with a specific currency and amount, where the
amount is given in the smallest denomination of the given currency.

Square POS can accept more than one form of tender for a single payment (such
as by splitting a bill between a credit card and a gift card). The `tender`
field of the Payment object lists all forms of tender used for the payment.

Split tender payments behave slightly differently from single tender payments:

The receipt_url for a split tender corresponds only to the first tender listed
in the tender field. To get the receipt URLs for the remaining tenders, use
the receipt_url fields of the corresponding Tender objects.

*A note on gift cards**: when a customer purchases a Square gift card from a
merchant, the merchant receives the full amount of the gift card in the
associated payment.

When that gift card is used as a tender, the balance of the gift card is
reduced and the merchant receives no funds. A `Tender` object with a type of
`SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the
associated payment. | getTender(): ?V1Tender | setTender(?V1Tender tender): void | -| `orderHistory` | [`?(V1OrderHistoryEntry[])`](../../doc/models/v1-order-history-entry.md) | Optional | The history of actions associated with the order. | getOrderHistory(): ?array | setOrderHistory(?array orderHistory): void | -| `promoCode` | `?string` | Optional | The promo code provided by the buyer, if any. | getPromoCode(): ?string | setPromoCode(?string promoCode): void | -| `btcReceiveAddress` | `?string` | Optional | For Bitcoin transactions, the address that the buyer sent Bitcoin to. | getBtcReceiveAddress(): ?string | setBtcReceiveAddress(?string btcReceiveAddress): void | -| `btcPriceSatoshi` | `?float` | Optional | For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC). | getBtcPriceSatoshi(): ?float | setBtcPriceSatoshi(?float btcPriceSatoshi): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ], - "id": "id0", - "buyer_email": "buyer_email8", - "recipient_name": "recipient_name8", - "recipient_phone_number": "recipient_phone_number4" -} -``` - diff --git a/doc/models/v1-phone-number.md b/doc/models/v1-phone-number.md deleted file mode 100644 index 0a9fb8f1..00000000 --- a/doc/models/v1-phone-number.md +++ /dev/null @@ -1,25 +0,0 @@ - -# V1 Phone Number - -Represents a phone number. - -## Structure - -`V1PhoneNumber` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `callingCode` | `string` | Required | The phone number's international calling code. For US phone numbers, this value is +1. | getCallingCode(): string | setCallingCode(string callingCode): void | -| `number` | `string` | Required | The phone number. | getNumber(): string | setNumber(string number): void | - -## Example (as JSON) - -```json -{ - "calling_code": "calling_code0", - "number": "number4" -} -``` - diff --git a/doc/models/v1-tender-card-brand.md b/doc/models/v1-tender-card-brand.md deleted file mode 100644 index cf0508a9..00000000 --- a/doc/models/v1-tender-card-brand.md +++ /dev/null @@ -1,23 +0,0 @@ - -# V1 Tender Card Brand - -The brand of a credit card. - -## Enumeration - -`V1TenderCardBrand` - -## Fields - -| Name | -| --- | -| `OTHER_BRAND` | -| `VISA` | -| `MASTER_CARD` | -| `AMERICAN_EXPRESS` | -| `DISCOVER` | -| `DISCOVER_DINERS` | -| `JCB` | -| `CHINA_UNIONPAY` | -| `SQUARE_GIFT_CARD` | - diff --git a/doc/models/v1-tender-entry-method.md b/doc/models/v1-tender-entry-method.md deleted file mode 100644 index 749c522f..00000000 --- a/doc/models/v1-tender-entry-method.md +++ /dev/null @@ -1,19 +0,0 @@ - -# V1 Tender Entry Method - -## Enumeration - -`V1TenderEntryMethod` - -## Fields - -| Name | -| --- | -| `MANUAL` | -| `SCANNED` | -| `SQUARE_CASH` | -| `SQUARE_WALLET` | -| `SWIPED` | -| `WEB_FORM` | -| `OTHER` | - diff --git a/doc/models/v1-tender-type.md b/doc/models/v1-tender-type.md deleted file mode 100644 index df7b569b..00000000 --- a/doc/models/v1-tender-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# V1 Tender Type - -## Enumeration - -`V1TenderType` - -## Fields - -| Name | -| --- | -| `CREDIT_CARD` | -| `CASH` | -| `THIRD_PARTY_CARD` | -| `NO_SALE` | -| `SQUARE_WALLET` | -| `SQUARE_GIFT_CARD` | -| `UNKNOWN` | -| `OTHER` | - diff --git a/doc/models/v1-tender.md b/doc/models/v1-tender.md deleted file mode 100644 index 36d707e0..00000000 --- a/doc/models/v1-tender.md +++ /dev/null @@ -1,63 +0,0 @@ - -# V1 Tender - -A tender represents a discrete monetary exchange. Square represents this -exchange as a money object with a specific currency and amount, where the -amount is given in the smallest denomination of the given currency. - -Square POS can accept more than one form of tender for a single payment (such -as by splitting a bill between a credit card and a gift card). The `tender` -field of the Payment object lists all forms of tender used for the payment. - -Split tender payments behave slightly differently from single tender payments: - -The receipt_url for a split tender corresponds only to the first tender listed -in the tender field. To get the receipt URLs for the remaining tenders, use -the receipt_url fields of the corresponding Tender objects. - -*A note on gift cards**: when a customer purchases a Square gift card from a -merchant, the merchant receives the full amount of the gift card in the -associated payment. - -When that gift card is used as a tender, the balance of the gift card is -reduced and the merchant receives no funds. A `Tender` object with a type of -`SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the -associated payment. - -## Structure - -`V1Tender` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The tender's unique ID. | getId(): ?string | setId(?string id): void | -| `type` | [`?string(V1TenderType)`](../../doc/models/v1-tender-type.md) | Optional | - | getType(): ?string | setType(?string type): void | -| `name` | `?string` | Optional | A human-readable description of the tender. | getName(): ?string | setName(?string name): void | -| `employeeId` | `?string` | Optional | The ID of the employee that processed the tender. | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | -| `receiptUrl` | `?string` | Optional | The URL of the receipt for the tender. | getReceiptUrl(): ?string | setReceiptUrl(?string receiptUrl): void | -| `cardBrand` | [`?string(V1TenderCardBrand)`](../../doc/models/v1-tender-card-brand.md) | Optional | The brand of a credit card. | getCardBrand(): ?string | setCardBrand(?string cardBrand): void | -| `panSuffix` | `?string` | Optional | The last four digits of the provided credit card's account number. | getPanSuffix(): ?string | setPanSuffix(?string panSuffix): void | -| `entryMethod` | [`?string(V1TenderEntryMethod)`](../../doc/models/v1-tender-entry-method.md) | Optional | - | getEntryMethod(): ?string | setEntryMethod(?string entryMethod): void | -| `paymentNote` | `?string` | Optional | Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER. | getPaymentNote(): ?string | setPaymentNote(?string paymentNote): void | -| `totalMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTotalMoney(): ?V1Money | setTotalMoney(?V1Money totalMoney): void | -| `tenderedMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getTenderedMoney(): ?V1Money | setTenderedMoney(?V1Money tenderedMoney): void | -| `tenderedAt` | `?string` | Optional | The time when the tender was created, in ISO 8601 format. | getTenderedAt(): ?string | setTenderedAt(?string tenderedAt): void | -| `settledAt` | `?string` | Optional | The time when the tender was settled, in ISO 8601 format. | getSettledAt(): ?string | setSettledAt(?string settledAt): void | -| `changeBackMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getChangeBackMoney(): ?V1Money | setChangeBackMoney(?V1Money changeBackMoney): void | -| `refundedMoney` | [`?V1Money`](../../doc/models/v1-money.md) | Optional | - | getRefundedMoney(): ?V1Money | setRefundedMoney(?V1Money refundedMoney): void | -| `isExchange` | `?bool` | Optional | Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange. | getIsExchange(): ?bool | setIsExchange(?bool isExchange): void | - -## Example (as JSON) - -```json -{ - "id": "id6", - "type": "SQUARE_WALLET", - "name": "name6", - "employee_id": "employee_id4", - "receipt_url": "receipt_url2" -} -``` - diff --git a/doc/models/v1-update-order-request-action.md b/doc/models/v1-update-order-request-action.md deleted file mode 100644 index 6fd004a5..00000000 --- a/doc/models/v1-update-order-request-action.md +++ /dev/null @@ -1,15 +0,0 @@ - -# V1 Update Order Request Action - -## Enumeration - -`V1UpdateOrderRequestAction` - -## Fields - -| Name | -| --- | -| `COMPLETE` | -| `CANCEL` | -| `REFUND` | - diff --git a/doc/models/v1-update-order-request.md b/doc/models/v1-update-order-request.md deleted file mode 100644 index b9f59623..00000000 --- a/doc/models/v1-update-order-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# V1 Update Order Request - -V1UpdateOrderRequest - -## Structure - -`V1UpdateOrderRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `action` | [`string(V1UpdateOrderRequestAction)`](../../doc/models/v1-update-order-request-action.md) | Required | - | getAction(): string | setAction(string action): void | -| `shippedTrackingNumber` | `?string` | Optional | The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. | getShippedTrackingNumber(): ?string | setShippedTrackingNumber(?string shippedTrackingNumber): void | -| `completedNote` | `?string` | Optional | A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. | getCompletedNote(): ?string | setCompletedNote(?string completedNote): void | -| `refundedNote` | `?string` | Optional | A merchant-specified note about the refunding of the order. Only valid if action is REFUND. | getRefundedNote(): ?string | setRefundedNote(?string refundedNote): void | -| `canceledNote` | `?string` | Optional | A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. | getCanceledNote(): ?string | setCanceledNote(?string canceledNote): void | - -## Example (as JSON) - -```json -{ - "action": "COMPLETE", - "shipped_tracking_number": "shipped_tracking_number4", - "completed_note": "completed_note4", - "refunded_note": "refunded_note8", - "canceled_note": "canceled_note6" -} -``` - diff --git a/doc/models/vendor-contact.md b/doc/models/vendor-contact.md deleted file mode 100644 index c5c4b171..00000000 --- a/doc/models/vendor-contact.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Vendor Contact - -Represents a contact of a [Vendor](../../doc/models/vendor.md). - -## Structure - -`VendorContact` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-generated ID for the [VendorContact](entity:VendorContact).
This field is required when attempting to update a [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | The name of the [VendorContact](entity:VendorContact).
This field is required when attempting to create a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `emailAddress` | `?string` | Optional | The email address of the [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `phoneNumber` | `?string` | Optional | The phone number of the [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `255` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `removed` | `?bool` | Optional | The state of the [VendorContact](entity:VendorContact). | getRemoved(): ?bool | setRemoved(?bool removed): void | -| `ordinal` | `int` | Required | The ordinal of the [VendorContact](entity:VendorContact). | getOrdinal(): int | setOrdinal(int ordinal): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": "phone_number8", - "removed": false, - "ordinal": 244 -} -``` - diff --git a/doc/models/vendor-status.md b/doc/models/vendor-status.md deleted file mode 100644 index 11bb2813..00000000 --- a/doc/models/vendor-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Vendor Status - -The status of the [Vendor](../../doc/models/vendor.md), -whether a [Vendor](../../doc/models/vendor.md) is active or inactive. - -## Enumeration - -`VendorStatus` - -## Fields - -| Name | Description | -| --- | --- | -| `ACTIVE` | Vendor is active and can receive purchase orders. | -| `INACTIVE` | Vendor is inactive and cannot receive purchase orders. | - diff --git a/doc/models/vendor.md b/doc/models/vendor.md deleted file mode 100644 index 048b4625..00000000 --- a/doc/models/vendor.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Vendor - -Represents a supplier to a seller. - -## Structure - -`Vendor` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique Square-generated ID for the [Vendor](entity:Vendor).
This field is required when attempting to update a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `createdAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the
[Vendor](entity:Vendor) was created.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the
[Vendor](entity:Vendor) was last updated.
**Constraints**: *Maximum Length*: `34` | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `name` | `?string` | Optional | The name of the [Vendor](entity:Vendor).
This field is required when attempting to create or update a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | getName(): ?string | setName(?string name): void | -| `address` | [`?Address`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | getAddress(): ?Address | setAddress(?Address address): void | -| `contacts` | [`?(VendorContact[])`](../../doc/models/vendor-contact.md) | Optional | The contacts of the [Vendor](entity:Vendor). | getContacts(): ?array | setContacts(?array contacts): void | -| `accountNumber` | `?string` | Optional | The account number of the [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | getAccountNumber(): ?string | setAccountNumber(?string accountNumber): void | -| `note` | `?string` | Optional | A note detailing information about the [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `4096` | getNote(): ?string | setNote(?string note): void | -| `version` | `?int` | Optional | The version of the [Vendor](entity:Vendor). | getVersion(): ?int | setVersion(?int version): void | -| `status` | [`?string(VendorStatus)`](../../doc/models/vendor-status.md) | Optional | The status of the [Vendor](../../doc/models/vendor.md),
whether a [Vendor](../../doc/models/vendor.md) is active or inactive. | getStatus(): ?string | setStatus(?string status): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "created_at": "created_at6", - "updated_at": "updated_at4", - "name": "name8", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "address_line_3": "address_line_32", - "locality": "locality6", - "sublocality": "sublocality6" - } -} -``` - diff --git a/doc/models/visibility-filter.md b/doc/models/visibility-filter.md deleted file mode 100644 index d39343bc..00000000 --- a/doc/models/visibility-filter.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Visibility Filter - -Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. - -## Enumeration - -`VisibilityFilter` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL` | All custom attributes or custom attribute definitions. | -| `READ` | All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. | -| `READ_WRITE` | All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_WRITE_VALUES`. | - diff --git a/doc/models/void-transaction-response.md b/doc/models/void-transaction-response.md deleted file mode 100644 index aa6ac83b..00000000 --- a/doc/models/void-transaction-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Void Transaction Response - -Defines the fields that are included in the response body of -a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. - -## Structure - -`VoidTransactionResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "INVALID_EXPIRATION", - "detail": "detail6", - "field": "field4" - } - ] -} -``` - diff --git a/doc/models/wage-setting.md b/doc/models/wage-setting.md deleted file mode 100644 index af6ae50b..00000000 --- a/doc/models/wage-setting.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Wage Setting - -Represents information about the overtime exemption status, job assignments, and compensation -for a [team member](../../doc/models/team-member.md). - -## Structure - -`WageSetting` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `teamMemberId` | `?string` | Optional | The ID of the team member associated with the wage setting. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | -| `jobAssignments` | [`?(JobAssignment[])`](../../doc/models/job-assignment.md) | Optional | **Required** The ordered list of jobs that the team member is assigned to.
The first job assignment is considered the team member's primary job. | getJobAssignments(): ?array | setJobAssignments(?array jobAssignments): void | -| `isOvertimeExempt` | `?bool` | Optional | Whether the team member is exempt from the overtime rules of the seller's country. | getIsOvertimeExempt(): ?bool | setIsOvertimeExempt(?bool isOvertimeExempt): void | -| `version` | `?int` | Optional | **Read only** Used for resolving concurrency issues. The request fails if the version
provided does not match the server version at the time of the request. If not provided,
Square executes a blind write, potentially overwriting data from another write. For more information,
see [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency). | getVersion(): ?int | setVersion(?int version): void | -| `createdAt` | `?string` | Optional | The timestamp when the wage setting was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp when the wage setting was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "team_member_id": "team_member_id2", - "job_assignments": [ - { - "job_title": "job_title6", - "pay_type": "SALARY", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 98, - "job_id": "job_id2" - }, - { - "job_title": "job_title6", - "pay_type": "SALARY", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 98, - "job_id": "job_id2" - }, - { - "job_title": "job_title6", - "pay_type": "SALARY", - "hourly_rate": { - "amount": 172, - "currency": "LAK" - }, - "annual_rate": { - "amount": 232, - "currency": "NIO" - }, - "weekly_hours": 98, - "job_id": "job_id2" - } - ], - "is_overtime_exempt": false, - "version": 140, - "created_at": "created_at0" -} -``` - diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md deleted file mode 100644 index f71b7dfa..00000000 --- a/doc/models/webhook-subscription.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Webhook Subscription - -Represents the details of a webhook subscription, including notification URL, -event types, and signature key. - -## Structure - -`WebhookSubscription` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A Square-generated unique ID for the subscription.
**Constraints**: *Maximum Length*: `64` | getId(): ?string | setId(?string id): void | -| `name` | `?string` | Optional | The name of this subscription.
**Constraints**: *Maximum Length*: `64` | getName(): ?string | setName(?string name): void | -| `enabled` | `?bool` | Optional | Indicates whether the subscription is enabled (`true`) or not (`false`). | getEnabled(): ?bool | setEnabled(?bool enabled): void | -| `eventTypes` | `?(string[])` | Optional | The event types associated with this subscription. | getEventTypes(): ?array | setEventTypes(?array eventTypes): void | -| `notificationUrl` | `?string` | Optional | The URL to which webhooks are sent. | getNotificationUrl(): ?string | setNotificationUrl(?string notificationUrl): void | -| `apiVersion` | `?string` | Optional | The API version of the subscription.
This field is optional for `CreateWebhookSubscription`.
The value defaults to the API version used by the application. | getApiVersion(): ?string | setApiVersion(?string apiVersion): void | -| `signatureKey` | `?string` | Optional | The Square-generated signature key used to validate the origin of the webhook event. | getSignatureKey(): ?string | setSignatureKey(?string signatureKey): void | -| `createdAt` | `?string` | Optional | The timestamp of when the subscription was created, in RFC 3339 format. For example, "2016-09-04T23:59:33.123Z". | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp of when the subscription was last updated, in RFC 3339 format.
For example, "2016-09-04T23:59:33.123Z". | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id8", - "name": "name8", - "enabled": false, - "event_types": [ - "event_types6" - ], - "notification_url": "notification_url2" -} -``` - diff --git a/doc/models/weekday.md b/doc/models/weekday.md deleted file mode 100644 index 308543ff..00000000 --- a/doc/models/weekday.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Weekday - -The days of the week. - -## Enumeration - -`Weekday` - -## Fields - -| Name | Description | -| --- | --- | -| `MON` | Monday | -| `TUE` | Tuesday | -| `WED` | Wednesday | -| `THU` | Thursday | -| `FRI` | Friday | -| `SAT` | Saturday | -| `SUN` | Sunday | - diff --git a/doc/models/workweek-config.md b/doc/models/workweek-config.md deleted file mode 100644 index aa949d8f..00000000 --- a/doc/models/workweek-config.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Workweek Config - -Sets the day of the week and hour of the day that a business starts a -workweek. This is used to calculate overtime pay. - -## Structure - -`WorkweekConfig` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | The UUID for this object. | getId(): ?string | setId(?string id): void | -| `startOfWeek` | [`string(Weekday)`](../../doc/models/weekday.md) | Required | The days of the week. | getStartOfWeek(): string | setStartOfWeek(string startOfWeek): void | -| `startOfDayLocalTime` | `string` | Required | The local time at which a business week starts. Represented as a
string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are
truncated).
**Constraints**: *Minimum Length*: `1` | getStartOfDayLocalTime(): string | setStartOfDayLocalTime(string startOfDayLocalTime): void | -| `version` | `?int` | Optional | Used for resolving concurrency issues. The request fails if the version
provided does not match the server version at the time of the request. If not provided,
Square executes a blind write; potentially overwriting data from another
write. | getVersion(): ?int | setVersion(?int version): void | -| `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id4", - "start_of_week": "SUN", - "start_of_day_local_time": "start_of_day_local_time0", - "version": 104, - "created_at": "created_at2", - "updated_at": "updated_at0" -} -``` - diff --git a/doc/utility-classes.md b/doc/utility-classes.md deleted file mode 100644 index b2554877..00000000 --- a/doc/utility-classes.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Utility Classes Documentation - -## FileWrapper - -Wraps file with mime-type and filename to be sent as part of an HTTP request. - -## Constructor Args - -| Name | Type | Description | -| --- | --- | --- | -| $realFilePath | string | The path of the file to wrap. | -| $mimeType | ?mimeType | The mime-type to be sent with the file. | -| $filename | ?string | The name to be used when sending the file. | - -## Methods - -| Name | Type | Description | -| --- | --- | --- | -| getFilename() | ?string | Get name of the file to be used in the upload data. | -| getMimeType() | ?string | Get the mime-type to be sent with the file. | - diff --git a/example-autoload.php b/example-autoload.php deleted file mode 100644 index 2ad06b19..00000000 --- a/example-autoload.php +++ /dev/null @@ -1,62 +0,0 @@ - "/square-php-sdk/src/", - "apimatic\\jsonmapper\\" => "/jsonmapper/src/", - "Unirest\\" => "/unirest-php/src/", - "Core\\" => "/core-lib-php/src/", - "CoreInterfaces\\" => "/core-interfaces-php/src/", - ]; - - $matchingPrefix; - foreach ($prefixToLocation as $prefix => $location) { - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) !== 0) { - // no, move to the next registered autoloader - continue; - } else { - $matchingPrefix = $prefix; - } - } - - if (!$matchingPrefix) return; // ClassPrefix was not found return - - // base directory for the namespace prefix - $base_dir = (__DIR__ . $prefixToLocation[$matchingPrefix]); - - // get the relative class name - $relative_class = substr($class, strlen($matchingPrefix)); - - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; - - // if the file exists, require it - if (file_exists($file)) { - require $file; - }else { - echo("Error loading: " . $file . "\r\n"); - } -}); diff --git a/phpcs-ruleset.xml b/phpcs-ruleset.xml deleted file mode 100644 index 6f78d30f..00000000 --- a/phpcs-ruleset.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..780706b8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: max + reportUnmatchedIgnoredErrors: false + paths: + - src + - tests \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 8a72c924..54630a51 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,25 +1,7 @@ - - + - - ./tests + + tests - - - src - - - + \ No newline at end of file diff --git a/src/ApiHelper.php b/src/ApiHelper.php deleted file mode 100644 index cf2b86be..00000000 --- a/src/ApiHelper.php +++ /dev/null @@ -1,174 +0,0 @@ - $val) { - $headerKeys[\strtolower($headerName)] = $headerName; - } - - // Override headers with new values - foreach ($newHeaders as $headerName => $headerValue) { - $lowerCasedName = \strtolower($headerName); - if (isset($headerKeys[$lowerCasedName])) { - unset($headers[$headerKeys[$lowerCasedName]]); - } - $headerKeys[$lowerCasedName] = $headerName; - $headers[$headerName] = $headerValue; - } - - return $headers; - } - - /** - * Assert if headers array is valid. - * - * @throws InvalidArgumentException - */ - public static function assertHeaders(array $headers): void - { - foreach ($headers as $header => $value) { - // Validate header name (must be string, must use allowed chars) - // Ref: https://tools.ietf.org/html/rfc7230#section-3.2 - if (!is_string($header)) { - throw new InvalidArgumentException(sprintf( - 'Header name must be a string but %s provided.', - is_object($header) ? get_class($header) : gettype($header) - )); - } - - if (preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header) !== 1) { - throw new InvalidArgumentException( - sprintf( - '"%s" is not a valid header name.', - $header - ) - ); - } - - // Validate value (must be scalar) - if (!is_scalar($value) || null === $value) { - throw new InvalidArgumentException(sprintf( - 'Header value must be scalar but %s provided for header "%s".', - is_object($value) ? get_class($value) : gettype($value), - $header - )); - } - } - } - - /** - * Decodes a valid json string into an array to send in Api calls. - * - * @param mixed $json Must be null or array or a valid string json to be translated into a php array. - * @param string $name Name of the argument whose value is being validated in $json parameter. - * @param bool $associative Should check for associative? Default: true. - * - * @return array|null Returns an array made up of key-value pairs in the provided json string - * or throws exception, if the provided json is not valid. - * @throws InvalidArgumentException - */ - public static function decodeJson($json, string $name, bool $associative = true): ?array - { - if (is_null($json) || (is_array($json) && (!$associative || CoreHelper::isAssociative($json)))) { - return $json; - } - if ($json instanceof stdClass) { - $json = json_encode($json); - } - if (is_string($json)) { - $decoded = json_decode($json, true); - if (is_array($decoded) && (!$associative || CoreHelper::isAssociative($decoded))) { - return $decoded; - } - } - throw new InvalidArgumentException("Invalid json value for argument: '$name'"); - } - - /** - * Decodes a valid jsonArray string into an array to send in Api calls. - * - * @param mixed $json Must be null or array or a valid string jsonArray to be translated into a php array. - * @param string $name Name of the argument whose value is being validated in $json parameter. - * @param bool $asMap Should decode as map? Default: false. - * - * @return array|null Returns an array made up of key-value pairs in the provided jsonArray string - * or throws exception, if the provided json is not valid. - * @throws InvalidArgumentException - */ - public static function decodeJsonArray($json, string $name, bool $asMap = false): ?array - { - $decoded = self::decodeJson($json, $name, false); - if (is_null($decoded)) { - return null; - } - $isAssociative = CoreHelper::isAssociative($decoded); - if (($asMap && $isAssociative) || (!$asMap && !$isAssociative)) { - return array_map(function ($v) use ($name) { - return self::decodeJson($v, $name); - }, $decoded); - } - $type = $asMap ? 'map' : 'array'; - throw new InvalidArgumentException("Invalid json $type value for argument: '$name'"); - } -} diff --git a/src/Apis/ApplePayApi.php b/src/Apis/ApplePayApi.php deleted file mode 100644 index 232fd833..00000000 --- a/src/Apis/ApplePayApi.php +++ /dev/null @@ -1,51 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/apple-pay/domains') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(RegisterDomainResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/BankAccountsApi.php b/src/Apis/BankAccountsApi.php deleted file mode 100644 index 837c1800..00000000 --- a/src/Apis/BankAccountsApi.php +++ /dev/null @@ -1,93 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/bank-accounts') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit), - QueryParam::init('location_id', $locationId) - ); - - $_resHandler = $this->responseHandler()->type(ListBankAccountsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns details of a [BankAccount]($m/BankAccount) identified by V1 bank account ID. - * - * @param string $v1BankAccountId Connect V1 ID of the desired `BankAccount`. For more - * information, see - * [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https: - * //developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an- - * id-issued-by-v1-bank-accounts-api). - * - * @return ApiResponse Response from the API call - */ - public function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bank-accounts/by-v1-id/{v1_bank_account_id}') - ->auth('global') - ->parameters(TemplateParam::init('v1_bank_account_id', $v1BankAccountId)); - - $_resHandler = $this->responseHandler()->type(GetBankAccountByV1IdResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns details of a [BankAccount]($m/BankAccount) - * linked to a Square account. - * - * @param string $bankAccountId Square-issued ID of the desired `BankAccount`. - * - * @return ApiResponse Response from the API call - */ - public function getBankAccount(string $bankAccountId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bank-accounts/{bank_account_id}') - ->auth('global') - ->parameters(TemplateParam::init('bank_account_id', $bankAccountId)); - - $_resHandler = $this->responseHandler()->type(GetBankAccountResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/BaseApi.php b/src/Apis/BaseApi.php deleted file mode 100644 index a39f912e..00000000 --- a/src/Apis/BaseApi.php +++ /dev/null @@ -1,46 +0,0 @@ -client = $client; - } - - protected function execute(RequestBuilder $requestBuilder, ?ResponseHandler $responseHandler = null) - { - return (new ApiCall($this->client)) - ->requestBuilder($requestBuilder) - ->responseHandler($responseHandler ?? $this->responseHandler()) - ->execute(); - } - - protected function requestBuilder(string $requestMethod, string $path): RequestBuilder - { - return new RequestBuilder($requestMethod, $path); - } - - protected function responseHandler(): ResponseHandler - { - return $this->client->getGlobalResponseHandler(); - } -} diff --git a/src/Apis/BookingCustomAttributesApi.php b/src/Apis/BookingCustomAttributesApi.php deleted file mode 100644 index 33ddddee..00000000 --- a/src/Apis/BookingCustomAttributesApi.php +++ /dev/null @@ -1,444 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/bookings/custom-attribute-definitions') - ->auth('global') - ->parameters(QueryParam::init('limit', $limit), QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler() - ->type(ListBookingCustomAttributeDefinitionsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a bookings custom attribute definition. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param CreateBookingCustomAttributeDefinitionRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createBookingCustomAttributeDefinition( - CreateBookingCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/custom-attribute-definitions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateBookingCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a bookings custom attribute definition. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $key The key of the custom attribute definition to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteBookingCustomAttributeDefinition(string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/bookings/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteBookingCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a bookings custom attribute definition. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param string $key The key of the custom attribute definition to retrieve. If the requesting - * application - * is not the definition owner, you must use the qualified key. - * @param int|null $version The current version of the custom attribute definition, which is - * used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the - * request, - * Square returns the specified version or a higher version if one exists. If the - * specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveBookingCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/custom-attribute-definitions/{key}') - ->auth('global') - ->parameters(TemplateParam::init('key', $key), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveBookingCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a bookings custom attribute definition. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $key The key of the custom attribute definition to update. - * @param UpdateBookingCustomAttributeDefinitionRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateBookingCustomAttributeDefinition( - string $key, - UpdateBookingCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/bookings/custom-attribute-definitions/{key}') - ->auth('global') - ->parameters( - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateBookingCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Bulk deletes bookings custom attributes. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param BulkDeleteBookingCustomAttributesRequest $body An object containing the fields to POST - * for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkDeleteBookingCustomAttributes(BulkDeleteBookingCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/custom-attributes/bulk-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkDeleteBookingCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Bulk upserts bookings custom attributes. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param BulkUpsertBookingCustomAttributesRequest $body An object containing the fields to POST - * for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpsertBookingCustomAttributes(BulkUpsertBookingCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/custom-attributes/bulk-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkUpsertBookingCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists a booking's custom attributes. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param string $bookingId The ID of the target [booking](entity:Booking). - * @param int|null $limit The maximum number of results to return in a single paged response. - * This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the - * maximum value is 100. - * The default value is 20. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more - * information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param bool|null $withDefinitions Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * - * @return ApiResponse Response from the API call - */ - public function listBookingCustomAttributes( - string $bookingId, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/{booking_id}/custom-attributes') - ->auth('global') - ->parameters( - TemplateParam::init('booking_id', $bookingId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('with_definitions', $withDefinitions) - ); - - $_resHandler = $this->responseHandler()->type(ListBookingCustomAttributesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a bookings custom attribute. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $bookingId The ID of the target [booking](entity:Booking). - * @param string $key The key of the custom attribute to delete. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * - * @return ApiResponse Response from the API call - */ - public function deleteBookingCustomAttribute(string $bookingId, string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/bookings/{booking_id}/custom-attributes/{key}' - )->auth('global')->parameters(TemplateParam::init('booking_id', $bookingId), TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteBookingCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a bookings custom attribute. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param string $bookingId The ID of the target [booking](entity:Booking). - * @param string $key The key of the custom attribute to retrieve. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * @param bool|null $withDefinition Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description - * of the custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * @param int|null $version The current version of the custom attribute, which is used for - * strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, - * Square - * returns the specified version or a higher version if one exists. If the specified - * version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveBookingCustomAttribute( - string $bookingId, - string $key, - ?bool $withDefinition = false, - ?int $version = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/bookings/{booking_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('booking_id', $bookingId), - TemplateParam::init('key', $key), - QueryParam::init('with_definition', $withDefinition), - QueryParam::init('version', $version) - ); - - $_resHandler = $this->responseHandler() - ->type(RetrieveBookingCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Upserts a bookings custom attribute. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $bookingId The ID of the target [booking](entity:Booking). - * @param string $key The key of the custom attribute to create or update. This key must match - * the `key` of a - * custom attribute definition in the Square seller account. If the requesting - * application is not - * the definition owner, you must use the qualified key. - * @param UpsertBookingCustomAttributeRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertBookingCustomAttribute( - string $bookingId, - string $key, - UpsertBookingCustomAttributeRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/v2/bookings/{booking_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('booking_id', $bookingId), - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpsertBookingCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/BookingsApi.php b/src/Apis/BookingsApi.php deleted file mode 100644 index 58a2c90a..00000000 --- a/src/Apis/BookingsApi.php +++ /dev/null @@ -1,398 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/bookings') - ->auth('global') - ->parameters( - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('customer_id', $customerId), - QueryParam::init('team_member_id', $teamMemberId), - QueryParam::init('location_id', $locationId), - QueryParam::init('start_at_min', $startAtMin), - QueryParam::init('start_at_max', $startAtMax) - ); - - $_resHandler = $this->responseHandler()->type(ListBookingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a booking. - * - * The required input must include the following: - * - `Booking.location_id` - * - `Booking.start_at` - * - `Booking.AppointmentSegment.team_member_id` - * - `Booking.AppointmentSegment.service_variation_id` - * - `Booking.AppointmentSegment.service_variation_version` - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param CreateBookingRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createBooking(CreateBookingRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateBookingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for availabilities for booking. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param SearchAvailabilityRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchAvailability(SearchAvailabilityRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/availability/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchAvailabilityResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Bulk-Retrieves a list of bookings by booking IDs. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param BulkRetrieveBookingsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkRetrieveBookings(BulkRetrieveBookingsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/bulk-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkRetrieveBookingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a seller's booking profile. - * - * @return ApiResponse Response from the API call - */ - public function retrieveBusinessBookingProfile(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/business-booking-profile') - ->auth('global'); - - $_resHandler = $this->responseHandler() - ->type(RetrieveBusinessBookingProfileResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists location booking profiles of a seller. - * - * @param int|null $limit The maximum number of results to return in a paged response. - * @param string|null $cursor The pagination cursor from the preceding response to return the - * next page of the results. Do not set this when retrieving the first page of the - * results. - * - * @return ApiResponse Response from the API call - */ - public function listLocationBookingProfiles(?int $limit = null, ?string $cursor = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/location-booking-profiles') - ->auth('global') - ->parameters(QueryParam::init('limit', $limit), QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler()->type(ListLocationBookingProfilesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a seller's location booking profile. - * - * @param string $locationId The ID of the location to retrieve the booking profile. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLocationBookingProfile(string $locationId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/bookings/location-booking-profiles/{location_id}' - )->auth('global')->parameters(TemplateParam::init('location_id', $locationId)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveLocationBookingProfileResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists booking profiles for team members. - * - * @param bool|null $bookableOnly Indicates whether to include only bookable team members in the - * returned result (`true`) or not (`false`). - * @param int|null $limit The maximum number of results to return in a paged response. - * @param string|null $cursor The pagination cursor from the preceding response to return the - * next page of the results. Do not set this when retrieving the first page of the - * results. - * @param string|null $locationId Indicates whether to include only team members enabled at the - * given location in the returned result. - * - * @return ApiResponse Response from the API call - */ - public function listTeamMemberBookingProfiles( - ?bool $bookableOnly = false, - ?int $limit = null, - ?string $cursor = null, - ?string $locationId = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/team-member-booking-profiles') - ->auth('global') - ->parameters( - QueryParam::init('bookable_only', $bookableOnly), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('location_id', $locationId) - ); - - $_resHandler = $this->responseHandler() - ->type(ListTeamMemberBookingProfilesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves one or more team members' booking profiles. - * - * @param BulkRetrieveTeamMemberBookingProfilesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkRetrieveTeamMemberBookingProfiles( - BulkRetrieveTeamMemberBookingProfilesRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/bookings/team-member-booking-profiles/bulk-retrieve' - )->auth('global')->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkRetrieveTeamMemberBookingProfilesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a team member's booking profile. - * - * @param string $teamMemberId The ID of the team member to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveTeamMemberBookingProfile(string $teamMemberId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/bookings/team-member-booking-profiles/{team_member_id}' - )->auth('global')->parameters(TemplateParam::init('team_member_id', $teamMemberId)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveTeamMemberBookingProfileResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a booking. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and - * `APPOINTMENTS_READ` for the OAuth scope. - * - * @param string $bookingId The ID of the [Booking](entity:Booking) object representing the - * to-be-retrieved booking. - * - * @return ApiResponse Response from the API call - */ - public function retrieveBooking(string $bookingId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/bookings/{booking_id}') - ->auth('global') - ->parameters(TemplateParam::init('booking_id', $bookingId)); - - $_resHandler = $this->responseHandler()->type(RetrieveBookingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a booking. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $bookingId The ID of the [Booking](entity:Booking) object representing the - * to-be-updated booking. - * @param UpdateBookingRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateBooking(string $bookingId, UpdateBookingRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/bookings/{booking_id}') - ->auth('global') - ->parameters( - TemplateParam::init('booking_id', $bookingId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateBookingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels an existing booking. - * - * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. - * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and - * `APPOINTMENTS_WRITE` for the OAuth scope. - * - * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed - * to *Appointments Plus* - * or *Appointments Premium*. - * - * @param string $bookingId The ID of the [Booking](entity:Booking) object representing the - * to-be-cancelled booking. - * @param CancelBookingRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function cancelBooking(string $bookingId, CancelBookingRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/bookings/{booking_id}/cancel') - ->auth('global') - ->parameters( - TemplateParam::init('booking_id', $bookingId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CancelBookingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CardsApi.php b/src/Apis/CardsApi.php deleted file mode 100644 index 9541c23c..00000000 --- a/src/Apis/CardsApi.php +++ /dev/null @@ -1,119 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/cards') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('customer_id', $customerId), - QueryParam::init('include_disabled', $includeDisabled), - QueryParam::init('reference_id', $referenceId), - QueryParam::init('sort_order', $sortOrder) - ); - - $_resHandler = $this->responseHandler()->type(ListCardsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds a card on file to an existing merchant. - * - * @param CreateCardRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createCard(CreateCardRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/cards') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves details for a specific Card. - * - * @param string $cardId Unique ID for the desired Card. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCard(string $cardId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/cards/{card_id}') - ->auth('global') - ->parameters(TemplateParam::init('card_id', $cardId)); - - $_resHandler = $this->responseHandler()->type(RetrieveCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Disables the card, preventing any further updates or charges. - * Disabling an already disabled card is allowed but has no effect. - * - * @param string $cardId Unique ID for the desired Card. - * - * @return ApiResponse Response from the API call - */ - public function disableCard(string $cardId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/cards/{card_id}/disable') - ->auth('global') - ->parameters(TemplateParam::init('card_id', $cardId)); - - $_resHandler = $this->responseHandler()->type(DisableCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CashDrawersApi.php b/src/Apis/CashDrawersApi.php deleted file mode 100644 index dca7f87b..00000000 --- a/src/Apis/CashDrawersApi.php +++ /dev/null @@ -1,110 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/cash-drawers/shifts') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListCashDrawerShiftsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Provides the summary details for a single cash drawer shift. See - * [ListCashDrawerShiftEvents]($e/CashDrawers/ListCashDrawerShiftEvents) for a list of cash drawer - * shift events. - * - * @param string $locationId The ID of the location to retrieve cash drawer shifts from. - * @param string $shiftId The shift ID. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCashDrawerShift(string $locationId, string $shiftId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/cash-drawers/shifts/{shift_id}') - ->auth('global') - ->parameters(QueryParam::init('location_id', $locationId), TemplateParam::init('shift_id', $shiftId)); - - $_resHandler = $this->responseHandler()->type(RetrieveCashDrawerShiftResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Provides a paginated list of events for a single cash drawer shift. - * - * @param string $locationId The ID of the location to list cash drawer shifts for. - * @param string $shiftId The shift ID. - * @param int|null $limit Number of resources to be returned in a page of results (200 by - * default, 1000 max). - * @param string|null $cursor Opaque cursor for fetching the next page of results. - * - * @return ApiResponse Response from the API call - */ - public function listCashDrawerShiftEvents( - string $locationId, - string $shiftId, - ?int $limit = null, - ?string $cursor = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/cash-drawers/shifts/{shift_id}/events') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - TemplateParam::init('shift_id', $shiftId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListCashDrawerShiftEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CatalogApi.php b/src/Apis/CatalogApi.php deleted file mode 100644 index acd80812..00000000 --- a/src/Apis/CatalogApi.php +++ /dev/null @@ -1,516 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/catalog/batch-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchDeleteCatalogObjectsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a set of objects based on the provided ID. - * Each [CatalogItem]($m/CatalogItem) returned in the set includes all of its - * child information including: all of its - * [CatalogItemVariation]($m/CatalogItemVariation) objects, references to - * its [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of - * any [CatalogTax]($m/CatalogTax) objects that apply to it. - * - * @param BatchRetrieveCatalogObjectsRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchRetrieveCatalogObjects(BatchRetrieveCatalogObjectsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/batch-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchRetrieveCatalogObjectsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates up to 10,000 target objects based on the provided - * list of objects. The target objects are grouped into batches and each batch is - * inserted/updated in an all-or-nothing manner. If an object within a batch is - * malformed in some way, or violates a database constraint, the entire batch - * containing that item will be disregarded. However, other batches in the same - * request may still succeed. Each batch may contain up to 1,000 objects, and - * batches will be processed in order as long as the total object count for the - * request (items, variations, modifier lists, discounts, and taxes) is no more - * than 10,000. - * - * To ensure consistency, only one update request is processed at a time per seller account. - * While one (batch or non-batch) update request is being processed, other (batched and non-batched) - * update requests are rejected with the `429` error code. - * - * @param BatchUpsertCatalogObjectsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchUpsertCatalogObjects(BatchUpsertCatalogObjectsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/batch-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchUpsertCatalogObjectsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Uploads an image file to be represented by a [CatalogImage]($m/CatalogImage) object that can be - * linked to an existing - * [CatalogObject]($m/CatalogObject) instance. The resulting `CatalogImage` is unattached to any - * `CatalogObject` if the `object_id` - * is not specified. - * - * This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an - * image file part in - * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. - * - * @param CreateCatalogImageRequest|null $request - * @param FileWrapper|null $imageFile - * - * @return ApiResponse Response from the API call - */ - public function createCatalogImage( - ?CreateCatalogImageRequest $request = null, - ?FileWrapper $imageFile = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/images') - ->auth('global') - ->parameters( - FormParam::init('request', $request) - ->encodingHeader('Content-Type', 'application/json; charset=utf-8'), - FormParam::init('image_file', $imageFile)->encodingHeader('Content-Type', 'image/jpeg') - ); - - $_resHandler = $this->responseHandler()->type(CreateCatalogImageResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Uploads a new image file to replace the existing one in the specified - * [CatalogImage]($m/CatalogImage) object. - * - * This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an - * image file part in - * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. - * - * @param string $imageId The ID of the `CatalogImage` object to update the encapsulated image - * file. - * @param UpdateCatalogImageRequest|null $request - * @param FileWrapper|null $imageFile - * - * @return ApiResponse Response from the API call - */ - public function updateCatalogImage( - string $imageId, - ?UpdateCatalogImageRequest $request = null, - ?FileWrapper $imageFile = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/catalog/images/{image_id}') - ->auth('global') - ->parameters( - TemplateParam::init('image_id', $imageId), - FormParam::init('request', $request) - ->encodingHeader('Content-Type', 'application/json; charset=utf-8'), - FormParam::init('image_file', $imageFile)->encodingHeader('Content-Type', 'image/jpeg') - ); - - $_resHandler = $this->responseHandler()->type(UpdateCatalogImageResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves information about the Square Catalog API, such as batch size - * limits that can be used by the `BatchUpsertCatalogObjects` endpoint. - * - * @return ApiResponse Response from the API call - */ - public function catalogInfo(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/catalog/info')->auth('global'); - - $_resHandler = $this->responseHandler()->type(CatalogInfoResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified types in the catalog. - * - * The `types` parameter is specified as a comma-separated list of the - * [CatalogObjectType]($m/CatalogObjectType) values, - * for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, - * `IMAGE`". - * - * __Important:__ ListCatalog does not return deleted catalog items. To retrieve - * deleted catalog items, use [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects) - * and set the `include_deleted_objects` attribute value to `true`. - * - * @param string|null $cursor The pagination cursor returned in the previous response. Leave - * unset for an initial request. - * The page size is currently set to be 100. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination) for more information. - * @param string|null $types An optional case-insensitive, comma-separated list of object types - * to retrieve. - * - * The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) - * enum, for example, - * `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - * `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - * - * If this is unspecified, the operation returns objects of all the top level types at - * the version - * of the Square API used to make the request. Object types that are nested onto other - * object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - * @param int|null $catalogVersion The specific version of the catalog objects to be included in - * the response. - * This allows you to retrieve historical versions of objects. The specified version - * value is matched against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, - * results will be from the - * current version of the catalog. - * - * @return ApiResponse Response from the API call - */ - public function listCatalog( - ?string $cursor = null, - ?string $types = null, - ?int $catalogVersion = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/catalog/list') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('types', $types), - QueryParam::init('catalog_version', $catalogVersion) - ); - - $_resHandler = $this->responseHandler()->type(ListCatalogResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new or updates the specified [CatalogObject]($m/CatalogObject). - * - * To ensure consistency, only one update request is processed at a time per seller account. - * While one (batch or non-batch) update request is being processed, other (batched and non-batched) - * update requests are rejected with the `429` error code. - * - * @param UpsertCatalogObjectRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertCatalogObject(UpsertCatalogObjectRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/object') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(UpsertCatalogObjectResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a single [CatalogObject]($m/CatalogObject) based on the - * provided ID and returns the set of successfully deleted IDs in the response. - * Deletion is a cascading event such that all children of the targeted object - * are also deleted. For example, deleting a [CatalogItem]($m/CatalogItem) - * will also delete all of its - * [CatalogItemVariation]($m/CatalogItemVariation) children. - * - * To ensure consistency, only one delete request is processed at a time per seller account. - * While one (batch or non-batch) delete request is being processed, other (batched and non-batched) - * delete requests are rejected with the `429` error code. - * - * @param string $objectId The ID of the catalog object to be deleted. When an object is - * deleted, other - * objects in the graph that depend on that object will be deleted as well (for example, - * deleting a - * catalog item will delete its catalog item variations). - * - * @return ApiResponse Response from the API call - */ - public function deleteCatalogObject(string $objectId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/catalog/object/{object_id}') - ->auth('global') - ->parameters(TemplateParam::init('object_id', $objectId)); - - $_resHandler = $this->responseHandler()->type(DeleteCatalogObjectResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a single [CatalogItem]($m/CatalogItem) as a - * [CatalogObject]($m/CatalogObject) based on the provided ID. The returned - * object includes all of the relevant [CatalogItem]($m/CatalogItem) - * information including: [CatalogItemVariation]($m/CatalogItemVariation) - * children, references to its - * [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of - * any [CatalogTax]($m/CatalogTax) objects that apply to it. - * - * @param string $objectId The object ID of any type of catalog objects to be retrieved. - * @param bool|null $includeRelatedObjects If `true`, the response will include additional - * objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by - * the results in the `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this - * to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects - * will not be included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - * @param int|null $catalogVersion Requests objects as of a specific version of the catalog. - * This allows you to retrieve historical - * versions of objects. The value to retrieve a specific version of an object can be - * found - * in the version field of [CatalogObject]($m/CatalogObject)s. If not included, results - * will - * be from the current version of the catalog. - * @param bool|null $includeCategoryPathToRoot Specifies whether or not to include the - * `path_to_root` list for each returned category instance. The `path_to_root` list - * consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the - * immediate parent category of the returned category - * and ends with its root category. If the returned category is a top-level category, - * the `path_to_root` list is empty and is not returned - * in the response payload. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCatalogObject( - string $objectId, - ?bool $includeRelatedObjects = false, - ?int $catalogVersion = null, - ?bool $includeCategoryPathToRoot = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/catalog/object/{object_id}') - ->auth('global') - ->parameters( - TemplateParam::init('object_id', $objectId), - QueryParam::init('include_related_objects', $includeRelatedObjects), - QueryParam::init('catalog_version', $catalogVersion), - QueryParam::init('include_category_path_to_root', $includeCategoryPathToRoot) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveCatalogObjectResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for [CatalogObject]($m/CatalogObject) of any type by matching supported search attribute - * values, - * excluding custom attribute values on items or item variations, against one or more of the specified - * query filters. - * - * This (`SearchCatalogObjects`) endpoint differs from the - * [SearchCatalogItems]($e/Catalog/SearchCatalogItems) - * endpoint in the following aspects: - * - * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` - * can search for any type of catalog objects. - * - `SearchCatalogItems` supports the custom attribute query filters to return items or item - * variations that contain custom attribute values, where `SearchCatalogObjects` does not. - * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted - * items or item variations, whereas `SearchCatalogObjects` does. - * - The both endpoints have different call conventions, including the query filter formats. - * - * @param SearchCatalogObjectsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchCatalogObjects(SearchCatalogObjectsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchCatalogObjectsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for catalog items or item variations by matching supported search attribute values, - * including - * custom attribute values, against one or more of the specified query filters. - * - * This (`SearchCatalogItems`) endpoint differs from the - * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects) - * endpoint in the following aspects: - * - * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` - * can search for any type of catalog objects. - * - `SearchCatalogItems` supports the custom attribute query filters to return items or item - * variations that contain custom attribute values, where `SearchCatalogObjects` does not. - * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted - * items or item variations, whereas `SearchCatalogObjects` does. - * - The both endpoints use different call conventions, including the query filter formats. - * - * @param SearchCatalogItemsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchCatalogItems(SearchCatalogItemsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/search-catalog-items') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchCatalogItemsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the [CatalogModifierList]($m/CatalogModifierList) objects - * that apply to the targeted [CatalogItem]($m/CatalogItem) without having - * to perform an upsert on the entire item. - * - * @param UpdateItemModifierListsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateItemModifierLists(UpdateItemModifierListsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/update-item-modifier-lists') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(UpdateItemModifierListsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the [CatalogTax]($m/CatalogTax) objects that apply to the - * targeted [CatalogItem]($m/CatalogItem) without having to perform an - * upsert on the entire item. - * - * @param UpdateItemTaxesRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateItemTaxes(UpdateItemTaxesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/catalog/update-item-taxes') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(UpdateItemTaxesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CheckoutApi.php b/src/Apis/CheckoutApi.php deleted file mode 100644 index 42cc2ab7..00000000 --- a/src/Apis/CheckoutApi.php +++ /dev/null @@ -1,264 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/locations/{location_id}/checkouts') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CreateCheckoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the location-level settings for a Square-hosted checkout page. - * - * @param string $locationId The ID of the location for which to retrieve settings. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLocationSettings(string $locationId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/online-checkout/location-settings/{location_id}' - )->auth('global')->parameters(TemplateParam::init('location_id', $locationId)); - - $_resHandler = $this->responseHandler()->type(RetrieveLocationSettingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the location-level settings for a Square-hosted checkout page. - * - * @param string $locationId The ID of the location for which to retrieve settings. - * @param UpdateLocationSettingsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateLocationSettings(string $locationId, UpdateLocationSettingsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/v2/online-checkout/location-settings/{location_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateLocationSettingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the merchant-level settings for a Square-hosted checkout page. - * - * @return ApiResponse Response from the API call - */ - public function retrieveMerchantSettings(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/online-checkout/merchant-settings') - ->auth('global'); - - $_resHandler = $this->responseHandler()->type(RetrieveMerchantSettingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the merchant-level settings for a Square-hosted checkout page. - * - * @param UpdateMerchantSettingsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateMerchantSettings(UpdateMerchantSettingsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/online-checkout/merchant-settings') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(UpdateMerchantSettingsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists all payment links. - * - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param int|null $limit A limit on the number of results to return per page. The limit is - * advisory and - * the implementation might return more or less results. If the supplied limit is - * negative, zero, or - * greater than the maximum limit of 1000, it is ignored. - * - * Default value: `100` - * - * @return ApiResponse Response from the API call - */ - public function listPaymentLinks(?string $cursor = null, ?int $limit = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/online-checkout/payment-links') - ->auth('global') - ->parameters(QueryParam::init('cursor', $cursor), QueryParam::init('limit', $limit)); - - $_resHandler = $this->responseHandler()->type(ListPaymentLinksResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a Square-hosted checkout page. Applications can share the resulting payment link with their - * buyer to pay for goods and services. - * - * @param CreatePaymentLinkRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createPaymentLink(CreatePaymentLinkRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/online-checkout/payment-links') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreatePaymentLinkResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a payment link. - * - * @param string $id The ID of the payment link to delete. - * - * @return ApiResponse Response from the API call - */ - public function deletePaymentLink(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/online-checkout/payment-links/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(DeletePaymentLinkResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a payment link. - * - * @param string $id The ID of link to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrievePaymentLink(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/online-checkout/payment-links/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(RetrievePaymentLinkResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a payment link. You can update the `payment_link` fields such as - * `description`, `checkout_options`, and `pre_populated_data`. - * You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. - * - * @param string $id The ID of the payment link to update. - * @param UpdatePaymentLinkRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updatePaymentLink(string $id, UpdatePaymentLinkRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/online-checkout/payment-links/{id}') - ->auth('global') - ->parameters( - TemplateParam::init('id', $id), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdatePaymentLinkResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CustomerCustomAttributesApi.php b/src/Apis/CustomerCustomAttributesApi.php deleted file mode 100644 index c6a60662..00000000 --- a/src/Apis/CustomerCustomAttributesApi.php +++ /dev/null @@ -1,437 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/customers/custom-attribute-definitions') - ->auth('global') - ->parameters(QueryParam::init('limit', $limit), QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler() - ->type(ListCustomerCustomAttributeDefinitionsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a customer-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * Use this endpoint to define a custom attribute that can be associated with customer profiles. - * - * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties - * for a custom attribute. After the definition is created, you can call - * [UpsertCustomerCustomAttribute]($e/CustomerCustomAttributes/UpsertCustomerCustomAttribute) or - * [BulkUpsertCustomerCustomAttributes]($e/CustomerCustomAttributes/BulkUpsertCustomerCustomAttributes) - * to set the custom attribute for customer profiles in the seller's Customer Directory. - * - * Sellers can view all custom attributes in exported customer data, including those set to - * `VISIBILITY_HIDDEN`. - * - * @param CreateCustomerCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createCustomerCustomAttributeDefinition( - CreateCustomerCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/custom-attribute-definitions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateCustomerCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a customer-related [custom attribute definition]($m/CustomAttributeDefinition) from a Square - * seller account. - * - * Deleting a custom attribute definition also deletes the corresponding custom attribute from - * all customer profiles in the seller's Customer Directory. - * - * Only the definition owner can delete a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteCustomerCustomAttributeDefinition(string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/customers/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteCustomerCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a customer-related [custom attribute definition]($m/CustomAttributeDefinition) from a - * Square seller account. - * - * To retrieve a custom attribute definition created by another application, the `visibility` - * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined - * custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $key The key of the custom attribute definition to retrieve. If the requesting - * application - * is not the definition owner, you must use the qualified key. - * @param int|null $version The current version of the custom attribute definition, which is - * used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the - * request, - * Square returns the specified version or a higher version if one exists. If the - * specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCustomerCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/customers/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveCustomerCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a customer-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * - * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the - * `schema` for a `Selection` data type. - * - * Only the definition owner can update a custom attribute definition. Note that sellers can view - * all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - * - * @param string $key The key of the custom attribute definition to update. - * @param UpdateCustomerCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateCustomerCustomAttributeDefinition( - string $key, - UpdateCustomerCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/v2/customers/custom-attribute-definitions/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateCustomerCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates [custom attributes]($m/CustomAttribute) for customer profiles as a bulk operation. - * - * Use this endpoint to set the value of one or more custom attributes for one or more customer - * profiles. - * A custom attribute is based on a custom attribute definition in a Square seller account, which is - * created using the - * [CreateCustomerCustomAttributeDefinition]($e/CustomerCustomAttributes/CreateCustomerCustomAttributeD - * efinition) endpoint. - * - * This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert - * requests and returns a map of individual upsert responses. Each upsert request has a unique ID - * and provides a customer ID and custom attribute. Each upsert response is returned with the ID - * of the corresponding request. - * - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkUpsertCustomerCustomAttributesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpsertCustomerCustomAttributes(BulkUpsertCustomerCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/custom-attributes/bulk-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkUpsertCustomerCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists the [custom attributes]($m/CustomAttribute) associated with a customer profile. - * - * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - * in the same call. - * - * When all response pages are retrieved, the results include all custom attributes that are - * visible to the requesting application, including those that are owned by other applications - * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $customerId The ID of the target [customer profile](entity:Customer). - * @param int|null $limit The maximum number of results to return in a single paged response. - * This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the - * maximum value is 100. - * The default value is 20. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more - * information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param bool|null $withDefinitions Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * - * @return ApiResponse Response from the API call - */ - public function listCustomerCustomAttributes( - string $customerId, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/customers/{customer_id}/custom-attributes') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('with_definitions', $withDefinitions) - ); - - $_resHandler = $this->responseHandler() - ->type(ListCustomerCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a [custom attribute]($m/CustomAttribute) associated with a customer profile. - * - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $customerId The ID of the target [customer profile](entity:Customer). - * @param string $key The key of the custom attribute to delete. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * - * @return ApiResponse Response from the API call - */ - public function deleteCustomerCustomAttribute(string $customerId, string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/customers/{customer_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId), TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteCustomerCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a [custom attribute]($m/CustomAttribute) associated with a customer profile. - * - * You can use the `with_definition` query parameter to also retrieve the custom attribute definition - * in the same call. - * - * To retrieve a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom - * attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $customerId The ID of the target [customer profile](entity:Customer). - * @param string $key The key of the custom attribute to retrieve. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * @param bool|null $withDefinition Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description - * of the custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * @param int|null $version The current version of the custom attribute, which is used for - * strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, - * Square - * returns the specified version or a higher version if one exists. If the specified - * version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCustomerCustomAttribute( - string $customerId, - string $key, - ?bool $withDefinition = false, - ?int $version = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/customers/{customer_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('key', $key), - QueryParam::init('with_definition', $withDefinition), - QueryParam::init('version', $version) - ); - - $_resHandler = $this->responseHandler() - ->type(RetrieveCustomerCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates a [custom attribute]($m/CustomAttribute) for a customer profile. - * - * Use this endpoint to set the value of a custom attribute for a specified customer profile. - * A custom attribute is based on a custom attribute definition in a Square seller account, which - * is created using the - * [CreateCustomerCustomAttributeDefinition]($e/CustomerCustomAttributes/CreateCustomerCustomAttributeD - * efinition) endpoint. - * - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $customerId The ID of the target [customer profile](entity:Customer). - * @param string $key The key of the custom attribute to create or update. This key must match - * the `key` of a - * custom attribute definition in the Square seller account. If the requesting - * application is not - * the definition owner, you must use the qualified key. - * @param UpsertCustomerCustomAttributeRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertCustomerCustomAttribute( - string $customerId, - string $key, - UpsertCustomerCustomAttributeRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/customers/{customer_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpsertCustomerCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CustomerGroupsApi.php b/src/Apis/CustomerGroupsApi.php deleted file mode 100644 index f100096d..00000000 --- a/src/Apis/CustomerGroupsApi.php +++ /dev/null @@ -1,136 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/customers/groups') - ->auth('global') - ->parameters(QueryParam::init('cursor', $cursor), QueryParam::init('limit', $limit)); - - $_resHandler = $this->responseHandler()->type(ListCustomerGroupsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new customer group for a business. - * - * The request must include the `name` value of the group. - * - * @param CreateCustomerGroupRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createCustomerGroup(CreateCustomerGroupRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/groups') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateCustomerGroupResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a customer group as identified by the `group_id` value. - * - * @param string $groupId The ID of the customer group to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteCustomerGroup(string $groupId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/customers/groups/{group_id}') - ->auth('global') - ->parameters(TemplateParam::init('group_id', $groupId)); - - $_resHandler = $this->responseHandler()->type(DeleteCustomerGroupResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a specific customer group as identified by the `group_id` value. - * - * @param string $groupId The ID of the customer group to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCustomerGroup(string $groupId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/customers/groups/{group_id}') - ->auth('global') - ->parameters(TemplateParam::init('group_id', $groupId)); - - $_resHandler = $this->responseHandler()->type(RetrieveCustomerGroupResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a customer group as identified by the `group_id` value. - * - * @param string $groupId The ID of the customer group to update. - * @param UpdateCustomerGroupRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateCustomerGroup(string $groupId, UpdateCustomerGroupRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/customers/groups/{group_id}') - ->auth('global') - ->parameters( - TemplateParam::init('group_id', $groupId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateCustomerGroupResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CustomerSegmentsApi.php b/src/Apis/CustomerSegmentsApi.php deleted file mode 100644 index 7670e969..00000000 --- a/src/Apis/CustomerSegmentsApi.php +++ /dev/null @@ -1,63 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/customers/segments') - ->auth('global') - ->parameters(QueryParam::init('cursor', $cursor), QueryParam::init('limit', $limit)); - - $_resHandler = $this->responseHandler()->type(ListCustomerSegmentsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a specific customer segment as identified by the `segment_id` value. - * - * @param string $segmentId The Square-issued ID of the customer segment. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCustomerSegment(string $segmentId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/customers/segments/{segment_id}') - ->auth('global') - ->parameters(TemplateParam::init('segment_id', $segmentId)); - - $_resHandler = $this->responseHandler()->type(RetrieveCustomerSegmentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/CustomersApi.php b/src/Apis/CustomersApi.php deleted file mode 100644 index c91549dd..00000000 --- a/src/Apis/CustomersApi.php +++ /dev/null @@ -1,437 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/customers') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit), - QueryParam::init('sort_field', $sortField), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('count', $count) - ); - - $_resHandler = $this->responseHandler()->type(ListCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new customer for a business. - * - * You must provide at least one of the following values in your request to this - * endpoint: - * - * - `given_name` - * - `family_name` - * - `company_name` - * - `email_address` - * - `phone_number` - * - * @param CreateCustomerRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createCustomer(CreateCustomerRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates multiple [customer profiles]($m/Customer) for a business. - * - * This endpoint takes a map of individual create requests and returns a map of responses. - * - * You must provide at least one of the following values in each create request: - * - * - `given_name` - * - `family_name` - * - `company_name` - * - `email_address` - * - `phone_number` - * - * @param BulkCreateCustomersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkCreateCustomers(BulkCreateCustomersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/bulk-create') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkCreateCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes multiple customer profiles. - * - * The endpoint takes a list of customer IDs and returns a map of responses. - * - * @param BulkDeleteCustomersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkDeleteCustomers(BulkDeleteCustomersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/bulk-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkDeleteCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves multiple customer profiles. - * - * This endpoint takes a list of customer IDs and returns a map of responses. - * - * @param BulkRetrieveCustomersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkRetrieveCustomers(BulkRetrieveCustomersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/bulk-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkRetrieveCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates multiple customer profiles. - * - * This endpoint takes a map of individual update requests and returns a map of responses. - * - * You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) - * or [Gift Cards API]($e/GiftCards). - * - * @param BulkUpdateCustomersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpdateCustomers(BulkUpdateCustomersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/bulk-update') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkUpdateCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches the customer profiles associated with a Square account using one or more supported query - * filters. - * - * Calling `SearchCustomers` without any explicit query filter returns all - * customer profiles ordered alphabetically based on `given_name` and - * `family_name`. - * - * Under normal operating conditions, newly created or updated customer profiles become available - * for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated - * profiles can take closer to one minute or longer, especially during network incidents and outages. - * - * @param SearchCustomersRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchCustomers(SearchCustomersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchCustomersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a customer profile from a business. This operation also unlinks any associated cards on file. - * - * To delete a customer profile that was created by merging existing profiles, you must use the ID of - * the newly created profile. - * - * @param string $customerId The ID of the customer to delete. - * @param int|null $version The current version of the customer profile. As a best practice, you - * should include this parameter to enable [optimistic concurrency](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. - * For more information, see [Delete a customer profile](https://developer.squareup. - * com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). - * - * @return ApiResponse Response from the API call - */ - public function deleteCustomer(string $customerId, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/customers/{customer_id}') - ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler()->type(DeleteCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns details for a single customer. - * - * @param string $customerId The ID of the customer to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveCustomer(string $customerId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/customers/{customer_id}') - ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId)); - - $_resHandler = $this->responseHandler()->type(RetrieveCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are - * required in the request. - * To add or update a field, specify the new value. To remove a field, specify `null`. - * - * To update a customer profile that was created by merging existing profiles, you must use the ID of - * the newly created profile. - * - * You cannot use this endpoint to change cards on file. To make changes, use the [Cards API]($e/Cards) - * or [Gift Cards API]($e/GiftCards). - * - * @param string $customerId The ID of the customer to update. - * @param UpdateCustomerRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateCustomer(string $customerId, UpdateCustomerRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/customers/{customer_id}') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds a card on file to an existing customer. - * - * As with charges, calls to `CreateCustomerCard` are idempotent. Multiple - * calls with the same card nonce return the same card record that was created - * with the provided nonce during the _first_ call. - * - * @deprecated - * - * @param string $customerId The Square ID of the customer profile the card is linked to. - * @param CreateCustomerCardRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createCustomerCard(string $customerId, CreateCustomerCardRequest $body): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/customers/{customer_id}/cards') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CreateCustomerCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Removes a card on file from a customer. - * - * @deprecated - * - * @param string $customerId The ID of the customer that the card on file belongs to. - * @param string $cardId The ID of the card on file to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteCustomerCard(string $customerId, string $cardId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/customers/{customer_id}/cards/{card_id}') - ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId), TemplateParam::init('card_id', $cardId)); - - $_resHandler = $this->responseHandler()->type(DeleteCustomerCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Removes a group membership from a customer. - * - * The customer is identified by the `customer_id` value - * and the customer group is identified by the `group_id` value. - * - * @param string $customerId The ID of the customer to remove from the group. - * @param string $groupId The ID of the customer group to remove the customer from. - * - * @return ApiResponse Response from the API call - */ - public function removeGroupFromCustomer(string $customerId, string $groupId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/customers/{customer_id}/groups/{group_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('group_id', $groupId) - ); - - $_resHandler = $this->responseHandler()->type(RemoveGroupFromCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds a group membership to a customer. - * - * The customer is identified by the `customer_id` value - * and the customer group is identified by the `group_id` value. - * - * @param string $customerId The ID of the customer to add to a group. - * @param string $groupId The ID of the customer group to add the customer to. - * - * @return ApiResponse Response from the API call - */ - public function addGroupToCustomer(string $customerId, string $groupId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/customers/{customer_id}/groups/{group_id}') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('group_id', $groupId) - ); - - $_resHandler = $this->responseHandler()->type(AddGroupToCustomerResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/DevicesApi.php b/src/Apis/DevicesApi.php deleted file mode 100644 index 69c81748..00000000 --- a/src/Apis/DevicesApi.php +++ /dev/null @@ -1,152 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/devices') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('limit', $limit), - QueryParam::init('location_id', $locationId) - ); - - $_resHandler = $this->responseHandler()->type(ListDevicesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists all DeviceCodes associated with the merchant. - * - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with- - * apis/pagination) for more information. - * @param string|null $locationId If specified, only returns DeviceCodes of the specified - * location. - * Returns DeviceCodes of all locations if empty. - * @param string|null $productType If specified, only returns DeviceCodes targeting the - * specified product type. - * Returns DeviceCodes of all product types if empty. - * @param string|null $status If specified, returns DeviceCodes with the specified statuses. - * Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - * - * @return ApiResponse Response from the API call - */ - public function listDeviceCodes( - ?string $cursor = null, - ?string $locationId = null, - ?string $productType = null, - ?string $status = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/devices/codes') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('location_id', $locationId), - QueryParam::init('product_type', $productType), - QueryParam::init('status', $status) - ); - - $_resHandler = $this->responseHandler()->type(ListDeviceCodesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected - * terminal mode. - * - * @param CreateDeviceCodeRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createDeviceCode(CreateDeviceCodeRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/devices/codes') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateDeviceCodeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves DeviceCode with the associated ID. - * - * @param string $id The unique identifier for the device code. - * - * @return ApiResponse Response from the API call - */ - public function getDeviceCode(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/devices/codes/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(GetDeviceCodeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves Device with the associated `device_id`. - * - * @param string $deviceId The unique ID for the desired `Device`. - * - * @return ApiResponse Response from the API call - */ - public function getDevice(string $deviceId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/devices/{device_id}') - ->auth('global') - ->parameters(TemplateParam::init('device_id', $deviceId)); - - $_resHandler = $this->responseHandler()->type(GetDeviceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/DisputesApi.php b/src/Apis/DisputesApi.php deleted file mode 100644 index 382c8c9c..00000000 --- a/src/Apis/DisputesApi.php +++ /dev/null @@ -1,257 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/disputes') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('states', $states), - QueryParam::init('location_id', $locationId) - ); - - $_resHandler = $this->responseHandler()->type(ListDisputesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns details about a specific dispute. - * - * @param string $disputeId The ID of the dispute you want more details about. - * - * @return ApiResponse Response from the API call - */ - public function retrieveDispute(string $disputeId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/disputes/{dispute_id}') - ->auth('global') - ->parameters(TemplateParam::init('dispute_id', $disputeId)); - - $_resHandler = $this->responseHandler()->type(RetrieveDisputeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and - * updates the dispute state to ACCEPTED. - * - * Square debits the disputed amount from the seller’s Square account. If the Square account - * does not have sufficient funds, Square debits the associated bank account. - * - * @param string $disputeId The ID of the dispute you want to accept. - * - * @return ApiResponse Response from the API call - */ - public function acceptDispute(string $disputeId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/disputes/{dispute_id}/accept') - ->auth('global') - ->parameters(TemplateParam::init('dispute_id', $disputeId)); - - $_resHandler = $this->responseHandler()->type(AcceptDisputeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a list of evidence associated with a dispute. - * - * @param string $disputeId The ID of the dispute. - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * - * @return ApiResponse Response from the API call - */ - public function listDisputeEvidence(string $disputeId, ?string $cursor = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/disputes/{dispute_id}/evidence') - ->auth('global') - ->parameters(TemplateParam::init('dispute_id', $disputeId), QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler()->type(ListDisputeEvidenceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP - * multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. - * - * @param string $disputeId The ID of the dispute for which you want to upload evidence. - * @param CreateDisputeEvidenceFileRequest|null $request Defines the parameters for a - * `CreateDisputeEvidenceFile` request. - * @param FileWrapper|null $imageFile - * - * @return ApiResponse Response from the API call - */ - public function createDisputeEvidenceFile( - string $disputeId, - ?CreateDisputeEvidenceFileRequest $request = null, - ?FileWrapper $imageFile = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/disputes/{dispute_id}/evidence-files') - ->auth('global') - ->parameters( - TemplateParam::init('dispute_id', $disputeId), - FormParam::init('request', $request) - ->encodingHeader('Content-Type', 'application/json; charset=utf-8'), - FormParam::init('image_file', $imageFile)->encodingHeader('Content-Type', 'image/jpeg') - ); - - $_resHandler = $this->responseHandler()->type(CreateDisputeEvidenceFileResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Uploads text to use as evidence for a dispute challenge. - * - * @param string $disputeId The ID of the dispute for which you want to upload evidence. - * @param CreateDisputeEvidenceTextRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createDisputeEvidenceText(string $disputeId, CreateDisputeEvidenceTextRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/disputes/{dispute_id}/evidence-text') - ->auth('global') - ->parameters( - TemplateParam::init('dispute_id', $disputeId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CreateDisputeEvidenceTextResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Removes specified evidence from a dispute. - * Square does not send the bank any evidence that is removed. - * - * @param string $disputeId The ID of the dispute from which you want to remove evidence. - * @param string $evidenceId The ID of the evidence you want to remove. - * - * @return ApiResponse Response from the API call - */ - public function deleteDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/disputes/{dispute_id}/evidence/{evidence_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('dispute_id', $disputeId), - TemplateParam::init('evidence_id', $evidenceId) - ); - - $_resHandler = $this->responseHandler()->type(DeleteDisputeEvidenceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns the metadata for the evidence specified in the request URL path. - * - * You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot - * be downloaded after you upload it. - * - * @param string $disputeId The ID of the dispute from which you want to retrieve evidence - * metadata. - * @param string $evidenceId The ID of the evidence to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/disputes/{dispute_id}/evidence/{evidence_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('dispute_id', $disputeId), - TemplateParam::init('evidence_id', $evidenceId) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveDisputeEvidenceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Submits evidence to the cardholder's bank. - * - * The evidence submitted by this endpoint includes evidence uploaded - * using the [CreateDisputeEvidenceFile]($e/Disputes/CreateDisputeEvidenceFile) and - * [CreateDisputeEvidenceText]($e/Disputes/CreateDisputeEvidenceText) endpoints and - * evidence automatically provided by Square, when available. Evidence cannot be removed from - * a dispute after submission. - * - * @param string $disputeId The ID of the dispute for which you want to submit evidence. - * - * @return ApiResponse Response from the API call - */ - public function submitEvidence(string $disputeId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/disputes/{dispute_id}/submit-evidence') - ->auth('global') - ->parameters(TemplateParam::init('dispute_id', $disputeId)); - - $_resHandler = $this->responseHandler()->type(SubmitEvidenceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/EmployeesApi.php b/src/Apis/EmployeesApi.php deleted file mode 100644 index a41602bf..00000000 --- a/src/Apis/EmployeesApi.php +++ /dev/null @@ -1,67 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/employees') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - QueryParam::init('status', $status), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListEmployeesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @deprecated - * - * @param string $id UUID for the employee that was requested. - * - * @return ApiResponse Response from the API call - */ - public function retrieveEmployee(string $id): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/employees/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(RetrieveEmployeeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/EventsApi.php b/src/Apis/EventsApi.php deleted file mode 100644 index eefb48a0..00000000 --- a/src/Apis/EventsApi.php +++ /dev/null @@ -1,89 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/events') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Disables events to prevent them from being searchable. - * All events are disabled by default. You must enable events to make them searchable. - * Disabling events for a specific time period prevents them from being searchable, even if you re- - * enable them later. - * - * @return ApiResponse Response from the API call - */ - public function disableEvents(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/events/disable')->auth('global'); - - $_resHandler = $this->responseHandler()->type(DisableEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Enables events to make them searchable. Only events that occur while in the enabled state are - * searchable. - * - * @return ApiResponse Response from the API call - */ - public function enableEvents(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/events/enable')->auth('global'); - - $_resHandler = $this->responseHandler()->type(EnableEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists all event types that you can subscribe to as webhooks or query using the Events API. - * - * @param string|null $apiVersion The API version for which to list event types. Setting this - * field overrides the default version used by the application. - * - * @return ApiResponse Response from the API call - */ - public function listEventTypes(?string $apiVersion = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/events/types') - ->auth('global') - ->parameters(QueryParam::init('api_version', $apiVersion)); - - $_resHandler = $this->responseHandler()->type(ListEventTypesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/GiftCardActivitiesApi.php b/src/Apis/GiftCardActivitiesApi.php deleted file mode 100644 index 718247e4..00000000 --- a/src/Apis/GiftCardActivitiesApi.php +++ /dev/null @@ -1,107 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/gift-cards/activities') - ->auth('global') - ->parameters( - QueryParam::init('gift_card_id', $giftCardId), - QueryParam::init('type', $type), - QueryParam::init('location_id', $locationId), - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('sort_order', $sortOrder) - ); - - $_resHandler = $this->responseHandler()->type(ListGiftCardActivitiesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a gift card activity to manage the balance or state of a [gift card]($m/GiftCard). - * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before - * first use. - * - * @param CreateGiftCardActivityRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createGiftCardActivity(CreateGiftCardActivityRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards/activities') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateGiftCardActivityResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/GiftCardsApi.php b/src/Apis/GiftCardsApi.php deleted file mode 100644 index c689a91e..00000000 --- a/src/Apis/GiftCardsApi.php +++ /dev/null @@ -1,212 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/gift-cards') - ->auth('global') - ->parameters( - QueryParam::init('type', $type), - QueryParam::init('state', $state), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('customer_id', $customerId) - ); - - $_resHandler = $this->responseHandler()->type(ListGiftCardsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card - * has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call - * [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and create an `ACTIVATE` - * activity with the initial balance. Alternatively, you can use - * [RefundPayment]($e/Refunds/RefundPayment) - * to refund a payment to the new gift card. - * - * @param CreateGiftCardRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createGiftCard(CreateGiftCardRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateGiftCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a gift card using the gift card account number (GAN). - * - * @param RetrieveGiftCardFromGANRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function retrieveGiftCardFromGAN(RetrieveGiftCardFromGANRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards/from-gan') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(RetrieveGiftCardFromGANResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a gift card using a secure payment token that represents the gift card. - * - * @param RetrieveGiftCardFromNonceRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function retrieveGiftCardFromNonce(RetrieveGiftCardFromNonceRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards/from-nonce') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(RetrieveGiftCardFromNonceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Links a customer to a gift card, which is also referred to as adding a card on file. - * - * @param string $giftCardId The ID of the gift card to be linked. - * @param LinkCustomerToGiftCardRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function linkCustomerToGiftCard(string $giftCardId, LinkCustomerToGiftCardRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards/{gift_card_id}/link-customer') - ->auth('global') - ->parameters( - TemplateParam::init('gift_card_id', $giftCardId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(LinkCustomerToGiftCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Unlinks a customer from a gift card, which is also referred to as removing a card on file. - * - * @param string $giftCardId The ID of the gift card to be unlinked. - * @param UnlinkCustomerFromGiftCardRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function unlinkCustomerFromGiftCard( - string $giftCardId, - UnlinkCustomerFromGiftCardRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/gift-cards/{gift_card_id}/unlink-customer') - ->auth('global') - ->parameters( - TemplateParam::init('gift_card_id', $giftCardId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UnlinkCustomerFromGiftCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a gift card using the gift card ID. - * - * @param string $id The ID of the gift card to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveGiftCard(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/gift-cards/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(RetrieveGiftCardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/InventoryApi.php b/src/Apis/InventoryApi.php deleted file mode 100644 index 38ec18b7..00000000 --- a/src/Apis/InventoryApi.php +++ /dev/null @@ -1,401 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/inventory/adjustment/{adjustment_id}') - ->auth('global') - ->parameters(TemplateParam::init('adjustment_id', $adjustmentId)); - - $_resHandler = $this->responseHandler()->type(RetrieveInventoryAdjustmentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns the [InventoryAdjustment]($m/InventoryAdjustment) object - * with the provided `adjustment_id`. - * - * @param string $adjustmentId ID of the [InventoryAdjustment](entity:InventoryAdjustment) to - * retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveInventoryAdjustment(string $adjustmentId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/inventory/adjustments/{adjustment_id}') - ->auth('global') - ->parameters(TemplateParam::init('adjustment_id', $adjustmentId)); - - $_resHandler = $this->responseHandler()->type(RetrieveInventoryAdjustmentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the - * endpoint URL - * is updated to conform to the standard convention. - * - * @deprecated - * - * @param BatchChangeInventoryRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function deprecatedBatchChangeInventory(BatchChangeInventoryRequest $body): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/batch-change') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchChangeInventoryResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory- - * BatchRetrieveInventoryChanges) after the endpoint URL - * is updated to conform to the standard convention. - * - * @deprecated - * - * @param BatchRetrieveInventoryChangesRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function deprecatedBatchRetrieveInventoryChanges(BatchRetrieveInventoryChangesRequest $body): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/batch-retrieve-changes') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BatchRetrieveInventoryChangesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory- - * BatchRetrieveInventoryCounts) after the endpoint URL - * is updated to conform to the standard convention. - * - * @deprecated - * - * @param BatchRetrieveInventoryCountsRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function deprecatedBatchRetrieveInventoryCounts(BatchRetrieveInventoryCountsRequest $body): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/batch-retrieve-counts') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BatchRetrieveInventoryCountsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Applies adjustments and counts to the provided item quantities. - * - * On success: returns the current calculated counts for all objects - * referenced in the request. - * On failure: returns a list of related errors. - * - * @param BatchChangeInventoryRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchChangeInventory(BatchChangeInventoryRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/changes/batch-create') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchChangeInventoryResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns historical physical counts and adjustments based on the - * provided filter criteria. - * - * Results are paginated and sorted in ascending order according their - * `occurred_at` timestamp (oldest first). - * - * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries - * that cannot be handled by other, simpler endpoints. - * - * @param BatchRetrieveInventoryChangesRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchRetrieveInventoryChanges(BatchRetrieveInventoryChangesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/changes/batch-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BatchRetrieveInventoryChangesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns current counts for the provided - * [CatalogObject]($m/CatalogObject)s at the requested - * [Location]($m/Location)s. - * - * Results are paginated and sorted in descending order according to their - * `calculated_at` timestamp (newest first). - * - * When `updated_after` is specified, only counts that have changed since that - * time (based on the server timestamp for the most recent change) are - * returned. This allows clients to perform a "sync" operation, for example - * in response to receiving a Webhook notification. - * - * @param BatchRetrieveInventoryCountsRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchRetrieveInventoryCounts(BatchRetrieveInventoryCountsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/inventory/counts/batch-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BatchRetrieveInventoryCountsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory- - * RetrieveInventoryPhysicalCount) after the endpoint URL - * is updated to conform to the standard convention. - * - * @deprecated - * - * @param string $physicalCountId ID of the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function deprecatedRetrieveInventoryPhysicalCount(string $physicalCountId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/inventory/physical-count/{physical_count_id}' - )->auth('global')->parameters(TemplateParam::init('physical_count_id', $physicalCountId)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveInventoryPhysicalCountResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns the [InventoryPhysicalCount]($m/InventoryPhysicalCount) - * object with the provided `physical_count_id`. - * - * @param string $physicalCountId ID of the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveInventoryPhysicalCount(string $physicalCountId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/inventory/physical-counts/{physical_count_id}' - )->auth('global')->parameters(TemplateParam::init('physical_count_id', $physicalCountId)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveInventoryPhysicalCountResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns the [InventoryTransfer]($m/InventoryTransfer) object - * with the provided `transfer_id`. - * - * @param string $transferId ID of the [InventoryTransfer](entity:InventoryTransfer) to - * retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveInventoryTransfer(string $transferId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/inventory/transfers/{transfer_id}') - ->auth('global') - ->parameters(TemplateParam::init('transfer_id', $transferId)); - - $_resHandler = $this->responseHandler()->type(RetrieveInventoryTransferResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the current calculated stock count for a given - * [CatalogObject]($m/CatalogObject) at a given set of - * [Location]($m/Location)s. Responses are paginated and unsorted. - * For more sophisticated queries, use a batch endpoint. - * - * @param string $catalogObjectId ID of the [CatalogObject](entity:CatalogObject) to retrieve. - * @param string|null $locationIds The [Location](entity:Location) IDs to look up as a - * comma-separated - * list. An empty list queries all locations. - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination) guide for more information. - * - * @return ApiResponse Response from the API call - */ - public function retrieveInventoryCount( - string $catalogObjectId, - ?string $locationIds = null, - ?string $cursor = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/inventory/{catalog_object_id}') - ->auth('global') - ->parameters( - TemplateParam::init('catalog_object_id', $catalogObjectId), - QueryParam::init('location_ids', $locationIds), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveInventoryCountResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a set of physical counts and inventory adjustments for the - * provided [CatalogObject](entity:CatalogObject) at the requested - * [Location](entity:Location)s. - * - * You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory- - * BatchRetrieveInventoryChanges) - * and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. - * - * Results are paginated and sorted in descending order according to their - * `occurred_at` timestamp (newest first). - * - * There are no limits on how far back the caller can page. This endpoint can be - * used to display recent changes for a specific item. For more - * sophisticated queries, use a batch endpoint. - * - * @deprecated - * - * @param string $catalogObjectId ID of the [CatalogObject](entity:CatalogObject) to retrieve. - * @param string|null $locationIds The [Location](entity:Location) IDs to look up as a - * comma-separated - * list. An empty list queries all locations. - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination) guide for more information. - * - * @return ApiResponse Response from the API call - */ - public function retrieveInventoryChanges( - string $catalogObjectId, - ?string $locationIds = null, - ?string $cursor = null - ): ApiResponse { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/inventory/{catalog_object_id}/changes') - ->auth('global') - ->parameters( - TemplateParam::init('catalog_object_id', $catalogObjectId), - QueryParam::init('location_ids', $locationIds), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveInventoryChangesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/InvoicesApi.php b/src/Apis/InvoicesApi.php deleted file mode 100644 index 085fc1e6..00000000 --- a/src/Apis/InvoicesApi.php +++ /dev/null @@ -1,311 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/invoices') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListInvoicesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a draft [invoice]($m/Invoice) - * for an order created using the Orders API. - * - * A draft invoice remains in your account and no action is taken. - * You must publish the invoice before Square can process it (send it to the customer's email address - * or charge the customer’s card on file). - * - * @param CreateInvoiceRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createInvoice(CreateInvoiceRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/invoices') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for invoices from a location specified in - * the filter. You can optionally specify customers in the filter for whom to - * retrieve invoices. In the current implementation, you can only specify one location and - * optionally one customer. - * - * The response is paginated. If truncated, the response includes a `cursor` - * that you use in a subsequent request to retrieve the next set of invoices. - * - * @param SearchInvoicesRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchInvoices(SearchInvoicesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/invoices/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchInvoicesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes the specified invoice. When an invoice is deleted, the - * associated order status changes to CANCELED. You can only delete a draft - * invoice (you cannot delete a published invoice, including one that is scheduled for processing). - * - * @param string $invoiceId The ID of the invoice to delete. - * @param int|null $version The version of the [invoice](entity:Invoice) to delete. If you do - * not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or - * [ListInvoices](api-endpoint:Invoices-ListInvoices). - * - * @return ApiResponse Response from the API call - */ - public function deleteInvoice(string $invoiceId, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/invoices/{invoice_id}') - ->auth('global') - ->parameters(TemplateParam::init('invoice_id', $invoiceId), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler()->type(DeleteInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves an invoice by invoice ID. - * - * @param string $invoiceId The ID of the invoice to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function getInvoice(string $invoiceId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/invoices/{invoice_id}') - ->auth('global') - ->parameters(TemplateParam::init('invoice_id', $invoiceId)); - - $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an invoice. This endpoint supports sparse updates, so you only need - * to specify the fields you want to change along with the required `version` field. - * Some restrictions apply to updating invoices. For example, you cannot change the - * `order_id` or `location_id` field. - * - * @param string $invoiceId The ID of the invoice to update. - * @param UpdateInvoiceRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateInvoice(string $invoiceId, UpdateInvoiceRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/invoices/{invoice_id}') - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file - * uploads - * with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that - * contains a file - * in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. - * - * Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added - * only to invoices - * in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. - * - * @param string $invoiceId The ID of the [invoice](entity:Invoice) to attach the file to. - * @param CreateInvoiceAttachmentRequest|null $request Represents a - * [CreateInvoiceAttachment]($e/Invoices/CreateInvoiceAttachment) request. - * @param FileWrapper|null $imageFile - * - * @return ApiResponse Response from the API call - */ - public function createInvoiceAttachment( - string $invoiceId, - ?CreateInvoiceAttachmentRequest $request = null, - ?FileWrapper $imageFile = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/invoices/{invoice_id}/attachments') - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - FormParam::init('request', $request) - ->encodingHeader('Content-Type', 'application/json; charset=utf-8'), - FormParam::init('image_file', $imageFile)->encodingHeader('Content-Type', 'image/jpeg') - ); - - $_resHandler = $this->responseHandler()->type(CreateInvoiceAttachmentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed - * only - * from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. - * - * @param string $invoiceId The ID of the [invoice](entity:Invoice) to delete the attachment - * from. - * @param string $attachmentId The ID of the [attachment](entity:InvoiceAttachment) to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteInvoiceAttachment(string $invoiceId, string $attachmentId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/invoices/{invoice_id}/attachments/{attachment_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - TemplateParam::init('attachment_id', $attachmentId) - ); - - $_resHandler = $this->responseHandler()->type(DeleteInvoiceAttachmentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels an invoice. The seller cannot collect payments for - * the canceled invoice. - * - * You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, - * `CANCELED`, or `FAILED`. - * - * @param string $invoiceId The ID of the [invoice](entity:Invoice) to cancel. - * @param CancelInvoiceRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function cancelInvoice(string $invoiceId, CancelInvoiceRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/invoices/{invoice_id}/cancel') - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CancelInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Publishes the specified draft invoice. - * - * After an invoice is published, Square - * follows up based on the invoice configuration. For example, Square - * sends the invoice to the customer's email address, charges the customer's card on file, or does - * nothing. Square also makes the invoice available on a Square-hosted invoice page. - * - * The invoice `status` also changes from `DRAFT` to a status - * based on the invoice configuration. For example, the status changes to `UNPAID` if - * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the - * invoice amount. - * - * In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` - * and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. - * - * @param string $invoiceId The ID of the invoice to publish. - * @param PublishInvoiceRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function publishInvoice(string $invoiceId, PublishInvoiceRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/invoices/{invoice_id}/publish') - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(PublishInvoiceResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/LaborApi.php b/src/Apis/LaborApi.php deleted file mode 100644 index 05e232e8..00000000 --- a/src/Apis/LaborApi.php +++ /dev/null @@ -1,443 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/labor/break-types') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListBreakTypesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new `BreakType`. - * - * A `BreakType` is a template for creating `Break` objects. - * You must provide the following values in your request to this - * endpoint: - * - * - `location_id` - * - `break_name` - * - `expected_duration` - * - `is_paid` - * - * You can only have three `BreakType` instances per location. If you attempt to add a fourth - * `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." - * is returned. - * - * @param CreateBreakTypeRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createBreakType(CreateBreakTypeRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/labor/break-types') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateBreakTypeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes an existing `BreakType`. - * - * A `BreakType` can be deleted even if it is referenced from a `Shift`. - * - * @param string $id The UUID for the `BreakType` being deleted. - * - * @return ApiResponse Response from the API call - */ - public function deleteBreakType(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/labor/break-types/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(DeleteBreakTypeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a single `BreakType` specified by `id`. - * - * @param string $id The UUID for the `BreakType` being retrieved. - * - * @return ApiResponse Response from the API call - */ - public function getBreakType(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/break-types/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(GetBreakTypeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an existing `BreakType`. - * - * @param string $id The UUID for the `BreakType` being updated. - * @param UpdateBreakTypeRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateBreakType(string $id, UpdateBreakTypeRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/labor/break-types/{id}') - ->auth('global') - ->parameters( - TemplateParam::init('id', $id), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateBreakTypeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a paginated list of `EmployeeWage` instances for a business. - * - * @deprecated - * - * @param string|null $employeeId Filter the returned wages to only those that are associated - * with the specified employee. - * @param int|null $limit The maximum number of `EmployeeWage` results to return per page. The - * number can range between - * 1 and 200. The default is 200. - * @param string|null $cursor A pointer to the next page of `EmployeeWage` results to fetch. - * - * @return ApiResponse Response from the API call - */ - public function listEmployeeWages( - ?string $employeeId = null, - ?int $limit = null, - ?string $cursor = null - ): ApiResponse { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/employee-wages') - ->auth('global') - ->parameters( - QueryParam::init('employee_id', $employeeId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListEmployeeWagesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a single `EmployeeWage` specified by `id`. - * - * @deprecated - * - * @param string $id The UUID for the `EmployeeWage` being retrieved. - * - * @return ApiResponse Response from the API call - */ - public function getEmployeeWage(string $id): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/employee-wages/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(GetEmployeeWageResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new `Shift`. - * - * A `Shift` represents a complete workday for a single team member. - * You must provide the following values in your request to this - * endpoint: - * - * - `location_id` - * - `team_member_id` - * - `start_at` - * - * An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - * - The `status` of the new `Shift` is `OPEN` and the team member has another - * shift with an `OPEN` status. - * - The `start_at` date is in the future. - * - The `start_at` or `end_at` date overlaps another shift for the same team member. - * - The `Break` instances are set in the request and a break `start_at` - * is before the `Shift.start_at`, a break `end_at` is after - * the `Shift.end_at`, or both. - * - * @param CreateShiftRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createShift(CreateShiftRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/labor/shifts') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateShiftResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a paginated list of `Shift` records for a business. - * The list to be returned can be filtered by: - * - Location IDs - * - Team member IDs - * - Shift status (`OPEN` or `CLOSED`) - * - Shift start - * - Shift end - * - Workday details - * - * The list can be sorted by: - * - `START_AT` - * - `END_AT` - * - `CREATED_AT` - * - `UPDATED_AT` - * - * @param SearchShiftsRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchShifts(SearchShiftsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/labor/shifts/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchShiftsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a `Shift`. - * - * @param string $id The UUID for the `Shift` being deleted. - * - * @return ApiResponse Response from the API call - */ - public function deleteShift(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/labor/shifts/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(DeleteShiftResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a single `Shift` specified by `id`. - * - * @param string $id The UUID for the `Shift` being retrieved. - * - * @return ApiResponse Response from the API call - */ - public function getShift(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/shifts/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(GetShiftResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an existing `Shift`. - * - * When adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have - * the `end_at` property set to a valid RFC-3339 datetime string. - * - * When closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at` - * set on each `Break`. - * - * @param string $id The ID of the object being updated. - * @param UpdateShiftRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateShift(string $id, UpdateShiftRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/labor/shifts/{id}') - ->auth('global') - ->parameters( - TemplateParam::init('id', $id), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateShiftResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a paginated list of `TeamMemberWage` instances for a business. - * - * @param string|null $teamMemberId Filter the returned wages to only those that are associated - * with the - * specified team member. - * @param int|null $limit The maximum number of `TeamMemberWage` results to return per page. The - * number can range between - * 1 and 200. The default is 200. - * @param string|null $cursor A pointer to the next page of `EmployeeWage` results to fetch. - * - * @return ApiResponse Response from the API call - */ - public function listTeamMemberWages( - ?string $teamMemberId = null, - ?int $limit = null, - ?string $cursor = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/team-member-wages') - ->auth('global') - ->parameters( - QueryParam::init('team_member_id', $teamMemberId), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListTeamMemberWagesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a single `TeamMemberWage` specified by `id`. - * - * @param string $id The UUID for the `TeamMemberWage` being retrieved. - * - * @return ApiResponse Response from the API call - */ - public function getTeamMemberWage(string $id): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/team-member-wages/{id}') - ->auth('global') - ->parameters(TemplateParam::init('id', $id)); - - $_resHandler = $this->responseHandler()->type(GetTeamMemberWageResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a list of `WorkweekConfig` instances for a business. - * - * @param int|null $limit The maximum number of `WorkweekConfigs` results to return per page. - * @param string|null $cursor A pointer to the next page of `WorkweekConfig` results to fetch. - * - * @return ApiResponse Response from the API call - */ - public function listWorkweekConfigs(?int $limit = null, ?string $cursor = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/labor/workweek-configs') - ->auth('global') - ->parameters(QueryParam::init('limit', $limit), QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler()->type(ListWorkweekConfigsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a `WorkweekConfig`. - * - * @param string $id The UUID for the `WorkweekConfig` object being updated. - * @param UpdateWorkweekConfigRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateWorkweekConfig(string $id, UpdateWorkweekConfigRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/labor/workweek-configs/{id}') - ->auth('global') - ->parameters( - TemplateParam::init('id', $id), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateWorkweekConfigResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/LocationCustomAttributesApi.php b/src/Apis/LocationCustomAttributesApi.php deleted file mode 100644 index c1d6d4a6..00000000 --- a/src/Apis/LocationCustomAttributesApi.php +++ /dev/null @@ -1,446 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/locations/custom-attribute-definitions') - ->auth('global') - ->parameters( - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler() - ->type(ListLocationCustomAttributeDefinitionsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a location-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * Use this endpoint to define a custom attribute that can be associated with locations. - * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties - * for a custom attribute. After the definition is created, you can call - * [UpsertLocationCustomAttribute]($e/LocationCustomAttributes/UpsertLocationCustomAttribute) or - * [BulkUpsertLocationCustomAttributes]($e/LocationCustomAttributes/BulkUpsertLocationCustomAttributes) - * to set the custom attribute for locations. - * - * @param CreateLocationCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createLocationCustomAttributeDefinition( - CreateLocationCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations/custom-attribute-definitions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateLocationCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a location-related [custom attribute definition]($m/CustomAttributeDefinition) from a Square - * seller account. - * Deleting a custom attribute definition also deletes the corresponding custom attribute from - * all locations. - * Only the definition owner can delete a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteLocationCustomAttributeDefinition(string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/locations/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteLocationCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a location-related [custom attribute definition]($m/CustomAttributeDefinition) from a - * Square seller account. - * To retrieve a custom attribute definition created by another application, the `visibility` - * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $key The key of the custom attribute definition to retrieve. If the requesting - * application - * is not the definition owner, you must use the qualified key. - * @param int|null $version The current version of the custom attribute definition, which is - * used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the - * request, - * Square returns the specified version or a higher version if one exists. If the - * specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLocationCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/locations/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveLocationCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a location-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the - * `schema` for a `Selection` data type. - * Only the definition owner can update a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to update. - * @param UpdateLocationCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateLocationCustomAttributeDefinition( - string $key, - UpdateLocationCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/v2/locations/custom-attribute-definitions/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateLocationCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes [custom attributes]($m/CustomAttribute) for locations as a bulk operation. - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkDeleteLocationCustomAttributesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkDeleteLocationCustomAttributes(BulkDeleteLocationCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations/custom-attributes/bulk-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkDeleteLocationCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates [custom attributes]($m/CustomAttribute) for locations as a bulk operation. - * Use this endpoint to set the value of one or more custom attributes for one or more locations. - * A custom attribute is based on a custom attribute definition in a Square seller account, which is - * created using the - * [CreateLocationCustomAttributeDefinition]($e/LocationCustomAttributes/CreateLocationCustomAttributeD - * efinition) endpoint. - * This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert - * requests and returns a map of individual upsert responses. Each upsert request has a unique ID - * and provides a location ID and custom attribute. Each upsert response is returned with the ID - * of the corresponding request. - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkUpsertLocationCustomAttributesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpsertLocationCustomAttributes(BulkUpsertLocationCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations/custom-attributes/bulk-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkUpsertLocationCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists the [custom attributes]($m/CustomAttribute) associated with a location. - * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - * in the same call. - * When all response pages are retrieved, the results include all custom attributes that are - * visible to the requesting application, including those that are owned by other applications - * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $locationId The ID of the target [location](entity:Location). - * @param string|null $visibilityFilter Filters the `CustomAttributeDefinition` results by their - * `visibility` values. - * @param int|null $limit The maximum number of results to return in a single paged response. - * This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the - * maximum value is 100. - * The default value is 20. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more - * information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param bool|null $withDefinitions Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * - * @return ApiResponse Response from the API call - */ - public function listLocationCustomAttributes( - string $locationId, - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/locations/{location_id}/custom-attributes') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('with_definitions', $withDefinitions) - ); - - $_resHandler = $this->responseHandler() - ->type(ListLocationCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a [custom attribute]($m/CustomAttribute) associated with a location. - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $locationId The ID of the target [location](entity:Location). - * @param string $key The key of the custom attribute to delete. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * - * @return ApiResponse Response from the API call - */ - public function deleteLocationCustomAttribute(string $locationId, string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/locations/{location_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters(TemplateParam::init('location_id', $locationId), TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteLocationCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a [custom attribute]($m/CustomAttribute) associated with a location. - * You can use the `with_definition` query parameter to also retrieve the custom attribute definition - * in the same call. - * To retrieve a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $locationId The ID of the target [location](entity:Location). - * @param string $key The key of the custom attribute to retrieve. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * @param bool|null $withDefinition Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description - * of the custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * @param int|null $version The current version of the custom attribute, which is used for - * strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, - * Square - * returns the specified version or a higher version if one exists. If the specified - * version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLocationCustomAttribute( - string $locationId, - string $key, - ?bool $withDefinition = false, - ?int $version = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/locations/{location_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('key', $key), - QueryParam::init('with_definition', $withDefinition), - QueryParam::init('version', $version) - ); - - $_resHandler = $this->responseHandler() - ->type(RetrieveLocationCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates a [custom attribute]($m/CustomAttribute) for a location. - * Use this endpoint to set the value of a custom attribute for a specified location. - * A custom attribute is based on a custom attribute definition in a Square seller account, which - * is created using the - * [CreateLocationCustomAttributeDefinition]($e/LocationCustomAttributes/CreateLocationCustomAttributeD - * efinition) endpoint. - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $locationId The ID of the target [location](entity:Location). - * @param string $key The key of the custom attribute to create or update. This key must match - * the `key` of a - * custom attribute definition in the Square seller account. If the requesting - * application is not - * the definition owner, you must use the qualified key. - * @param UpsertLocationCustomAttributeRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertLocationCustomAttribute( - string $locationId, - string $key, - UpsertLocationCustomAttributeRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/locations/{location_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpsertLocationCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/LocationsApi.php b/src/Apis/LocationsApi.php deleted file mode 100644 index f87dda87..00000000 --- a/src/Apis/LocationsApi.php +++ /dev/null @@ -1,106 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/locations')->auth('global'); - - $_resHandler = $this->responseHandler()->type(ListLocationsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a [location](https://developer.squareup.com/docs/locations-api). - * Creating new locations allows for separate configuration of receipt layouts, item prices, - * and sales reports. Developers can use locations to separate sales activity through applications - * that integrate with Square from sales activity elsewhere in a seller's account. - * Locations created programmatically with the Locations API last forever and - * are visible to the seller for their own management. Therefore, ensure that - * each location has a sensible and unique name. - * - * @param CreateLocationRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createLocation(CreateLocationRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateLocationResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves details of a single location. Specify "main" - * as the location ID to retrieve details of the [main location](https://developer.squareup. - * com/docs/locations-api#about-the-main-location). - * - * @param string $locationId The ID of the location to retrieve. Specify the string "main" to - * return the main location. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLocation(string $locationId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/locations/{location_id}') - ->auth('global') - ->parameters(TemplateParam::init('location_id', $locationId)); - - $_resHandler = $this->responseHandler()->type(RetrieveLocationResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a [location](https://developer.squareup.com/docs/locations-api). - * - * @param string $locationId The ID of the location to update. - * @param UpdateLocationRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateLocation(string $locationId, UpdateLocationRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/locations/{location_id}') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateLocationResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/LoyaltyApi.php b/src/Apis/LoyaltyApi.php deleted file mode 100644 index 4cd75cae..00000000 --- a/src/Apis/LoyaltyApi.php +++ /dev/null @@ -1,586 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/loyalty/accounts') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateLoyaltyAccountResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for loyalty accounts in a loyalty program. - * - * You can search for a loyalty account using the phone number or customer ID associated with the - * account. To return all loyalty accounts, specify an empty `query` object or omit it entirely. - * - * Search results are sorted by `created_at` in ascending order. - * - * @param SearchLoyaltyAccountsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchLoyaltyAccounts(SearchLoyaltyAccountsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/accounts/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchLoyaltyAccountsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a loyalty account. - * - * @param string $accountId The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLoyaltyAccount(string $accountId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/loyalty/accounts/{account_id}') - ->auth('global') - ->parameters(TemplateParam::init('account_id', $accountId)); - - $_resHandler = $this->responseHandler()->type(RetrieveLoyaltyAccountResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds points earned from a purchase to a [loyalty account]($m/LoyaltyAccount). - * - * - If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order - * to compute the points earned from both the base loyalty program and an associated - * [loyalty promotion]($m/LoyaltyPromotion). For purchases that qualify for multiple accrual - * rules, Square computes points based on the accrual rule that grants the most points. - * For purchases that qualify for multiple promotions, Square computes points based on the most - * recently created promotion. A purchase must first qualify for program points to be eligible for - * promotion points. - * - * - If you are not using the Orders API to manage orders, provide `points` with the number of points - * to add. - * You must first perform a client-side computation of the points earned from the loyalty program and - * loyalty promotion. For spend-based and visit-based programs, you can call - * [CalculateLoyaltyPoints]($e/Loyalty/CalculateLoyaltyPoints) - * to compute the points earned from the base loyalty program. For information about computing points - * earned from a loyalty promotion, see - * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty- - * promotions#calculate-promotion-points). - * - * @param string $accountId The ID of the target [loyalty account](entity:LoyaltyAccount). - * @param AccumulateLoyaltyPointsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function accumulateLoyaltyPoints(string $accountId, AccumulateLoyaltyPointsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/accounts/{account_id}/accumulate') - ->auth('global') - ->parameters( - TemplateParam::init('account_id', $accountId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(AccumulateLoyaltyPointsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds points to or subtracts points from a buyer's account. - * - * Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, - * you call - * [AccumulateLoyaltyPoints]($e/Loyalty/AccumulateLoyaltyPoints) - * to add points when a buyer pays for the purchase. - * - * @param string $accountId The ID of the target [loyalty account](entity:LoyaltyAccount). - * @param AdjustLoyaltyPointsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function adjustLoyaltyPoints(string $accountId, AdjustLoyaltyPointsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/accounts/{account_id}/adjust') - ->auth('global') - ->parameters( - TemplateParam::init('account_id', $accountId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(AdjustLoyaltyPointsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for loyalty events. - * - * A Square loyalty program maintains a ledger of events that occur during the lifetime of a - * buyer's loyalty account. Each change in the point balance - * (for example, points earned, points redeemed, and points expired) is - * recorded in the ledger. Using this endpoint, you can search the ledger for events. - * - * Search results are sorted by `created_at` in descending order. - * - * @param SearchLoyaltyEventsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchLoyaltyEvents(SearchLoyaltyEventsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/events/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchLoyaltyEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a list of loyalty programs in the seller's account. - * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can - * have only one loyalty program, which is created and managed from the Seller Dashboard. For more - * information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - * - * - * Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with - * the keyword `main`. - * - * @deprecated - * - * @return ApiResponse Response from the API call - */ - public function listLoyaltyPrograms(): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/loyalty/programs')->auth('global'); - - $_resHandler = $this->responseHandler()->type(ListLoyaltyProgramsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword - * `main`. - * - * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can - * have only one loyalty program, which is created and managed from the Seller Dashboard. For more - * information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - * - * @param string $programId The ID of the loyalty program or the keyword `main`. Either value - * can be used to retrieve the single loyalty program that belongs to the seller. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLoyaltyProgram(string $programId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/loyalty/programs/{program_id}') - ->auth('global') - ->parameters(TemplateParam::init('program_id', $programId)); - - $_resHandler = $this->responseHandler()->type(RetrieveLoyaltyProgramResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Calculates the number of points a buyer can earn from a purchase. Applications might call this - * endpoint - * to display the points to the buyer. - * - * - If you are using the Orders API to manage orders, provide the `order_id` and (optional) - * `loyalty_account_id`. - * Square reads the order to compute the points earned from the base loyalty program and an associated - * [loyalty promotion]($m/LoyaltyPromotion). - * - * - If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the - * purchase amount. Square uses this amount to calculate the points earned from the base loyalty - * program, - * but not points earned from a loyalty promotion. For spend-based and visit-based programs, the - * `tax_mode` - * setting of the accrual rule indicates how taxes should be treated for loyalty points accrual. - * If the purchase qualifies for program points, call - * [ListLoyaltyPromotions]($e/Loyalty/ListLoyaltyPromotions) and perform a client-side computation - * to calculate whether the purchase also qualifies for promotion points. For more information, see - * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty- - * promotions#calculate-promotion-points). - * - * @param string $programId The ID of the [loyalty program](entity:LoyaltyProgram), which - * defines the rules for accruing points. - * @param CalculateLoyaltyPointsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function calculateLoyaltyPoints(string $programId, CalculateLoyaltyPointsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/programs/{program_id}/calculate') - ->auth('global') - ->parameters( - TemplateParam::init('program_id', $programId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CalculateLoyaltyPointsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists the loyalty promotions associated with a [loyalty program]($m/LoyaltyProgram). - * Results are sorted by the `created_at` date in descending order (newest to oldest). - * - * @param string $programId The ID of the base [loyalty program](entity:LoyaltyProgram). To get - * the program ID, - * call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the - * `main` keyword. - * @param string|null $status The status to filter the results by. If a status is provided, only - * loyalty promotions - * with the specified status are returned. Otherwise, all loyalty promotions associated - * with - * the loyalty program are returned. - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param int|null $limit The maximum number of results to return in a single paged response. - * The minimum value is 1 and the maximum value is 30. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * - * @return ApiResponse Response from the API call - */ - public function listLoyaltyPromotions( - string $programId, - ?string $status = null, - ?string $cursor = null, - ?int $limit = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/loyalty/programs/{program_id}/promotions') - ->auth('global') - ->parameters( - TemplateParam::init('program_id', $programId), - QueryParam::init('status', $status), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListLoyaltyPromotionsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a loyalty promotion for a [loyalty program]($m/LoyaltyProgram). A loyalty promotion - * enables buyers to earn points in addition to those earned from the base loyalty program. - * - * This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the - * `available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an - * `ACTIVE` or `SCHEDULED` status. - * - * @param string $programId The ID of the [loyalty program](entity:LoyaltyProgram) to associate - * with the promotion. - * To get the program ID, call [RetrieveLoyaltyProgram](api-endpoint:Loyalty- - * RetrieveLoyaltyProgram) - * using the `main` keyword. - * @param CreateLoyaltyPromotionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createLoyaltyPromotion(string $programId, CreateLoyaltyPromotionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/programs/{program_id}/promotions') - ->auth('global') - ->parameters( - TemplateParam::init('program_id', $programId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CreateLoyaltyPromotionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a loyalty promotion. - * - * @param string $promotionId The ID of the [loyalty promotion](entity:LoyaltyPromotion) to - * retrieve. - * @param string $programId The ID of the base [loyalty program](entity:LoyaltyProgram). To get - * the program ID, - * call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the - * `main` keyword. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLoyaltyPromotion(string $promotionId, string $programId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/loyalty/programs/{program_id}/promotions/{promotion_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('promotion_id', $promotionId), - TemplateParam::init('program_id', $programId) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveLoyaltyPromotionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` promotion earlier than the - * end date, cancel an `ACTIVE` promotion when an end date is not specified, or cancel a `SCHEDULED` - * promotion. - * Because updating a promotion is not supported, you can also use this endpoint to cancel a promotion - * before - * you create a new one. - * - * This endpoint sets the loyalty promotion to the `CANCELED` state - * - * @param string $promotionId The ID of the [loyalty promotion](entity:LoyaltyPromotion) to - * cancel. You can cancel a - * promotion that has an `ACTIVE` or `SCHEDULED` status. - * @param string $programId The ID of the base [loyalty program](entity:LoyaltyProgram). - * - * @return ApiResponse Response from the API call - */ - public function cancelLoyaltyPromotion(string $promotionId, string $programId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/loyalty/programs/{program_id}/promotions/{promotion_id}/cancel' - ) - ->auth('global') - ->parameters( - TemplateParam::init('promotion_id', $promotionId), - TemplateParam::init('program_id', $programId) - ); - - $_resHandler = $this->responseHandler()->type(CancelLoyaltyPromotionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a loyalty reward. In the process, the endpoint does following: - * - * - Uses the `reward_tier_id` in the request to determine the number of points - * to lock for this reward. - * - If the request includes `order_id`, it adds the reward and related discount to the order. - * - * After a reward is created, the points are locked and - * not available for the buyer to redeem another reward. - * - * @param CreateLoyaltyRewardRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createLoyaltyReward(CreateLoyaltyRewardRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/rewards') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateLoyaltyRewardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns - * results for all loyalty accounts. - * If you include a `query` object, `loyalty_account_id` is required and `status` is optional. - * - * If you know a reward ID, use the - * [RetrieveLoyaltyReward]($e/Loyalty/RetrieveLoyaltyReward) endpoint. - * - * Search results are sorted by `updated_at` in descending order. - * - * @param SearchLoyaltyRewardsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchLoyaltyRewards(SearchLoyaltyRewardsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/rewards/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchLoyaltyRewardsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a loyalty reward by doing the following: - * - * - Returns the loyalty points back to the loyalty account. - * - If an order ID was specified when the reward was created - * (see [CreateLoyaltyReward]($e/Loyalty/CreateLoyaltyReward)), - * it updates the order by removing the reward and related - * discounts. - * - * You cannot delete a reward that has reached the terminal state (REDEEMED). - * - * @param string $rewardId The ID of the [loyalty reward](entity:LoyaltyReward) to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteLoyaltyReward(string $rewardId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/loyalty/rewards/{reward_id}') - ->auth('global') - ->parameters(TemplateParam::init('reward_id', $rewardId)); - - $_resHandler = $this->responseHandler()->type(DeleteLoyaltyRewardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a loyalty reward. - * - * @param string $rewardId The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveLoyaltyReward(string $rewardId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/loyalty/rewards/{reward_id}') - ->auth('global') - ->parameters(TemplateParam::init('reward_id', $rewardId)); - - $_resHandler = $this->responseHandler()->type(RetrieveLoyaltyRewardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Redeems a loyalty reward. - * - * The endpoint sets the reward to the `REDEEMED` terminal state. - * - * If you are using your own order processing system (not using the - * Orders API), you call this endpoint after the buyer paid for the - * purchase. - * - * After the reward reaches the terminal state, it cannot be deleted. - * In other words, points used for the reward cannot be returned - * to the account. - * - * @param string $rewardId The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. - * @param RedeemLoyaltyRewardRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function redeemLoyaltyReward(string $rewardId, RedeemLoyaltyRewardRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/loyalty/rewards/{reward_id}/redeem') - ->auth('global') - ->parameters( - TemplateParam::init('reward_id', $rewardId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(RedeemLoyaltyRewardResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/MerchantCustomAttributesApi.php b/src/Apis/MerchantCustomAttributesApi.php deleted file mode 100644 index 2bd4474f..00000000 --- a/src/Apis/MerchantCustomAttributesApi.php +++ /dev/null @@ -1,447 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/merchants/custom-attribute-definitions') - ->auth('global') - ->parameters( - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler() - ->type(ListMerchantCustomAttributeDefinitionsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a merchant-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * Use this endpoint to define a custom attribute that can be associated with a merchant connecting to - * your application. - * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties - * for a custom attribute. After the definition is created, you can call - * [UpsertMerchantCustomAttribute]($e/MerchantCustomAttributes/UpsertMerchantCustomAttribute) or - * [BulkUpsertMerchantCustomAttributes]($e/MerchantCustomAttributes/BulkUpsertMerchantCustomAttributes) - * to set the custom attribute for a merchant. - * - * @param CreateMerchantCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createMerchantCustomAttributeDefinition( - CreateMerchantCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/merchants/custom-attribute-definitions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateMerchantCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a merchant-related [custom attribute definition]($m/CustomAttributeDefinition) from a Square - * seller account. - * Deleting a custom attribute definition also deletes the corresponding custom attribute from - * the merchant. - * Only the definition owner can delete a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteMerchantCustomAttributeDefinition(string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/merchants/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteMerchantCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a merchant-related [custom attribute definition]($m/CustomAttributeDefinition) from a - * Square seller account. - * To retrieve a custom attribute definition created by another application, the `visibility` - * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $key The key of the custom attribute definition to retrieve. If the requesting - * application - * is not the definition owner, you must use the qualified key. - * @param int|null $version The current version of the custom attribute definition, which is - * used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the - * request, - * Square returns the specified version or a higher version if one exists. If the - * specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveMerchantCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/merchants/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveMerchantCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a merchant-related [custom attribute definition]($m/CustomAttributeDefinition) for a Square - * seller account. - * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the - * `schema` for a `Selection` data type. - * Only the definition owner can update a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to update. - * @param UpdateMerchantCustomAttributeDefinitionRequest $body An object containing the fields - * to POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateMerchantCustomAttributeDefinition( - string $key, - UpdateMerchantCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/v2/merchants/custom-attribute-definitions/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateMerchantCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes [custom attributes]($m/CustomAttribute) for a merchant as a bulk operation. - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkDeleteMerchantCustomAttributesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkDeleteMerchantCustomAttributes(BulkDeleteMerchantCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/merchants/custom-attributes/bulk-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkDeleteMerchantCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates [custom attributes]($m/CustomAttribute) for a merchant as a bulk operation. - * Use this endpoint to set the value of one or more custom attributes for a merchant. - * A custom attribute is based on a custom attribute definition in a Square seller account, which is - * created using the - * [CreateMerchantCustomAttributeDefinition]($e/MerchantCustomAttributes/CreateMerchantCustomAttributeD - * efinition) endpoint. - * This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert - * requests and returns a map of individual upsert responses. Each upsert request has a unique ID - * and provides a merchant ID and custom attribute. Each upsert response is returned with the ID - * of the corresponding request. - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkUpsertMerchantCustomAttributesRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpsertMerchantCustomAttributes(BulkUpsertMerchantCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/merchants/custom-attributes/bulk-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkUpsertMerchantCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists the [custom attributes]($m/CustomAttribute) associated with a merchant. - * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - * in the same call. - * When all response pages are retrieved, the results include all custom attributes that are - * visible to the requesting application, including those that are owned by other applications - * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $merchantId The ID of the target [merchant](entity:Merchant). - * @param string|null $visibilityFilter Filters the `CustomAttributeDefinition` results by their - * `visibility` values. - * @param int|null $limit The maximum number of results to return in a single paged response. - * This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the - * maximum value is 100. - * The default value is 20. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more - * information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param bool|null $withDefinitions Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * - * @return ApiResponse Response from the API call - */ - public function listMerchantCustomAttributes( - string $merchantId, - ?string $visibilityFilter = null, - ?int $limit = null, - ?string $cursor = null, - ?bool $withDefinitions = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/merchants/{merchant_id}/custom-attributes') - ->auth('global') - ->parameters( - TemplateParam::init('merchant_id', $merchantId), - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('limit', $limit), - QueryParam::init('cursor', $cursor), - QueryParam::init('with_definitions', $withDefinitions) - ); - - $_resHandler = $this->responseHandler() - ->type(ListMerchantCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a [custom attribute]($m/CustomAttribute) associated with a merchant. - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $merchantId The ID of the target [merchant](entity:Merchant). - * @param string $key The key of the custom attribute to delete. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * - * @return ApiResponse Response from the API call - */ - public function deleteMerchantCustomAttribute(string $merchantId, string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/merchants/{merchant_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters(TemplateParam::init('merchant_id', $merchantId), TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteMerchantCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a [custom attribute]($m/CustomAttribute) associated with a merchant. - * You can use the `with_definition` query parameter to also retrieve the custom attribute definition - * in the same call. - * To retrieve a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $merchantId The ID of the target [merchant](entity:Merchant). - * @param string $key The key of the custom attribute to retrieve. This key must match the `key` - * of a custom - * attribute definition in the Square seller account. If the requesting application is - * not the - * definition owner, you must use the qualified key. - * @param bool|null $withDefinition Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description - * of the custom - * attribute, information about the data type, or other definition details. The default - * value is `false`. - * @param int|null $version The current version of the custom attribute, which is used for - * strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, - * Square - * returns the specified version or a higher version if one exists. If the specified - * version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveMerchantCustomAttribute( - string $merchantId, - string $key, - ?bool $withDefinition = false, - ?int $version = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/merchants/{merchant_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('merchant_id', $merchantId), - TemplateParam::init('key', $key), - QueryParam::init('with_definition', $withDefinition), - QueryParam::init('version', $version) - ); - - $_resHandler = $this->responseHandler() - ->type(RetrieveMerchantCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates a [custom attribute]($m/CustomAttribute) for a merchant. - * Use this endpoint to set the value of a custom attribute for a specified merchant. - * A custom attribute is based on a custom attribute definition in a Square seller account, which - * is created using the - * [CreateMerchantCustomAttributeDefinition]($e/MerchantCustomAttributes/CreateMerchantCustomAttributeD - * efinition) endpoint. - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $merchantId The ID of the target [merchant](entity:Merchant). - * @param string $key The key of the custom attribute to create or update. This key must match - * the `key` of a - * custom attribute definition in the Square seller account. If the requesting - * application is not - * the definition owner, you must use the qualified key. - * @param UpsertMerchantCustomAttributeRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertMerchantCustomAttribute( - string $merchantId, - string $key, - UpsertMerchantCustomAttributeRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/merchants/{merchant_id}/custom-attributes/{key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('merchant_id', $merchantId), - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpsertMerchantCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/MerchantsApi.php b/src/Apis/MerchantsApi.php deleted file mode 100644 index 584d586d..00000000 --- a/src/Apis/MerchantsApi.php +++ /dev/null @@ -1,62 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/merchants') - ->auth('global') - ->parameters(QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler()->type(ListMerchantsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the `Merchant` object for the given `merchant_id`. - * - * @param string $merchantId The ID of the merchant to retrieve. If the string "me" is supplied - * as the ID, - * then retrieve the merchant that is currently accessible to this call. - * - * @return ApiResponse Response from the API call - */ - public function retrieveMerchant(string $merchantId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/merchants/{merchant_id}') - ->auth('global') - ->parameters(TemplateParam::init('merchant_id', $merchantId)); - - $_resHandler = $this->responseHandler()->type(RetrieveMerchantResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/MobileAuthorizationApi.php b/src/Apis/MobileAuthorizationApi.php deleted file mode 100644 index 76539c99..00000000 --- a/src/Apis/MobileAuthorizationApi.php +++ /dev/null @@ -1,51 +0,0 @@ -requestBuilder(RequestMethod::POST, '/mobile/authorization-code') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateMobileAuthorizationCodeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/OAuthApi.php b/src/Apis/OAuthApi.php deleted file mode 100644 index d32d3658..00000000 --- a/src/Apis/OAuthApi.php +++ /dev/null @@ -1,120 +0,0 @@ -requestBuilder(RequestMethod::POST, '/oauth2/revoke') - ->parameters( - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body), - HeaderParam::init('Authorization', $authorization) - ); - - $_resHandler = $this->responseHandler()->type(RevokeTokenResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns an OAuth access token and a refresh token unless the - * `short_lived` parameter is set to `true`, in which case the endpoint - * returns only an access token. - * - * The `grant_type` parameter specifies the type of OAuth request. If - * `grant_type` is `authorization_code`, you must include the authorization - * code you received when a seller granted you authorization. If `grant_type` - * is `refresh_token`, you must provide a valid refresh token. If you're using - * an old version of the Square APIs (prior to March 13, 2019), `grant_type` - * can be `migration_token` and you must provide a valid migration token. - * - * You can use the `scopes` parameter to limit the set of permissions granted - * to the access token and refresh token. You can use the `short_lived` parameter - * to create an access token that expires in 24 hours. - * - * __Note:__ OAuth tokens should be encrypted and stored on a secure server. - * Application clients should never interact directly with OAuth tokens. - * - * @param ObtainTokenRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function obtainToken(ObtainTokenRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/oauth2/token') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(ObtainTokenResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns information about an [OAuth access token](https://developer.squareup.com/docs/build- - * basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https: - * //developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token). - * - * Add the access token to the Authorization header of the request. - * - * __Important:__ The `Authorization` header you provide to this endpoint must have the following - * format: - * - * ``` - * Authorization: Bearer ACCESS_TOKEN - * ``` - * - * where `ACCESS_TOKEN` is a - * [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access- - * tokens). - * - * If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` - * error. - * - * @return ApiResponse Response from the API call - */ - public function retrieveTokenStatus(): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/oauth2/token/status')->auth('global'); - - $_resHandler = $this->responseHandler()->type(RetrieveTokenStatusResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/OrderCustomAttributesApi.php b/src/Apis/OrderCustomAttributesApi.php deleted file mode 100644 index 45ffb534..00000000 --- a/src/Apis/OrderCustomAttributesApi.php +++ /dev/null @@ -1,460 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/orders/custom-attribute-definitions') - ->auth('global') - ->parameters( - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler() - ->type(ListOrderCustomAttributeDefinitionsResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates an order-related custom attribute definition. Use this endpoint to - * define a custom attribute that can be associated with orders. - * - * After creating a custom attribute definition, you can set the custom attribute for orders - * in the Square seller account. - * - * @param CreateOrderCustomAttributeDefinitionRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createOrderCustomAttributeDefinition( - CreateOrderCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/custom-attribute-definitions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CreateOrderCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes an order-related [custom attribute definition]($m/CustomAttributeDefinition) from a Square - * seller account. - * - * Only the definition owner can delete a custom attribute definition. - * - * @param string $key The key of the custom attribute definition to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteOrderCustomAttributeDefinition(string $key): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/orders/custom-attribute-definitions/{key}' - )->auth('global')->parameters(TemplateParam::init('key', $key)); - - $_resHandler = $this->responseHandler() - ->type(DeleteOrderCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves an order-related [custom attribute definition]($m/CustomAttributeDefinition) from a Square - * seller account. - * - * To retrieve a custom attribute definition created by another application, the `visibility` - * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined - * custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $key The key of the custom attribute definition to retrieve. - * @param int|null $version To enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control, include this optional field and specify the current version of the custom - * attribute. - * - * @return ApiResponse Response from the API call - */ - public function retrieveOrderCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/orders/custom-attribute-definitions/{key}') - ->auth('global') - ->parameters(TemplateParam::init('key', $key), QueryParam::init('version', $version)); - - $_resHandler = $this->responseHandler() - ->type(RetrieveOrderCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an order-related custom attribute definition for a Square seller account. - * - * Only the definition owner can update a custom attribute definition. Note that sellers can view all - * custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - * - * @param string $key The key of the custom attribute definition to update. - * @param UpdateOrderCustomAttributeDefinitionRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateOrderCustomAttributeDefinition( - string $key, - UpdateOrderCustomAttributeDefinitionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/orders/custom-attribute-definitions/{key}') - ->auth('global') - ->parameters( - TemplateParam::init('key', $key), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateOrderCustomAttributeDefinitionResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes order [custom attributes]($m/CustomAttribute) as a bulk operation. - * - * Use this endpoint to delete one or more custom attributes from one or more orders. - * A custom attribute is based on a custom attribute definition in a Square seller account. (To create - * a - * custom attribute definition, use the - * [CreateOrderCustomAttributeDefinition]($e/OrderCustomAttributes/CreateOrderCustomAttributeDefinition - * ) endpoint.) - * - * This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete - * requests and returns a map of individual delete responses. Each delete request has a unique ID - * and provides an order ID and custom attribute. Each delete response is returned with the ID - * of the corresponding request. - * - * To delete a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkDeleteOrderCustomAttributesRequest $body An object containing the fields to POST - * for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkDeleteOrderCustomAttributes(BulkDeleteOrderCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/custom-attributes/bulk-delete') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkDeleteOrderCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates order [custom attributes]($m/CustomAttribute) as a bulk operation. - * - * Use this endpoint to delete one or more custom attributes from one or more orders. - * A custom attribute is based on a custom attribute definition in a Square seller account. (To create - * a - * custom attribute definition, use the - * [CreateOrderCustomAttributeDefinition]($e/OrderCustomAttributes/CreateOrderCustomAttributeDefinition - * ) endpoint.) - * - * This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert - * requests and returns a map of individual upsert responses. Each upsert request has a unique ID - * and provides an order ID and custom attribute. Each upsert response is returned with the ID - * of the corresponding request. - * - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param BulkUpsertOrderCustomAttributesRequest $body An object containing the fields to POST - * for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpsertOrderCustomAttributes(BulkUpsertOrderCustomAttributesRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/custom-attributes/bulk-upsert') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(BulkUpsertOrderCustomAttributesResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists the [custom attributes]($m/CustomAttribute) associated with an order. - * - * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - * in the same call. - * - * When all response pages are retrieved, the results include all custom attributes that are - * visible to the requesting application, including those that are owned by other applications - * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $orderId The ID of the target [order](entity:Order). - * @param string|null $visibilityFilter Requests that all of the custom attributes be returned, - * or only those that are read-only or read-write. - * @param string|null $cursor The cursor returned in the paged response from the previous call - * to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working- - * with-apis/pagination). - * @param int|null $limit The maximum number of results to return in a single paged response. - * This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the - * maximum value is 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working- - * with-apis/pagination). - * @param bool|null $withDefinitions Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom attribute, - * information about the data type, or other definition details. The default value is - * `false`. - * - * @return ApiResponse Response from the API call - */ - public function listOrderCustomAttributes( - string $orderId, - ?string $visibilityFilter = null, - ?string $cursor = null, - ?int $limit = null, - ?bool $withDefinitions = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/orders/{order_id}/custom-attributes') - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - QueryParam::init('visibility_filter', $visibilityFilter), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit), - QueryParam::init('with_definitions', $withDefinitions) - ); - - $_resHandler = $this->responseHandler()->type(ListOrderCustomAttributesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a [custom attribute]($m/CustomAttribute) associated with a customer profile. - * - * To delete a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $orderId The ID of the target [order](entity:Order). - * @param string $customAttributeKey The key of the custom attribute to delete. This key must - * match the key of an - * existing custom attribute definition. - * - * @return ApiResponse Response from the API call - */ - public function deleteOrderCustomAttribute(string $orderId, string $customAttributeKey): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - TemplateParam::init('custom_attribute_key', $customAttributeKey) - ); - - $_resHandler = $this->responseHandler()->type(DeleteOrderCustomAttributeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a [custom attribute]($m/CustomAttribute) associated with an order. - * - * You can use the `with_definition` query parameter to also retrieve the custom attribute definition - * in the same call. - * - * To retrieve a custom attribute owned by another application, the `visibility` setting must be - * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom - * attributes - * also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $orderId The ID of the target [order](entity:Order). - * @param string $customAttributeKey The key of the custom attribute to retrieve. This key must - * match the key of an - * existing custom attribute definition. - * @param int|null $version To enable [optimistic - * concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control, include this optional field and specify the current version of the custom - * attribute. - * @param bool|null $withDefinition Indicates whether to return the [custom attribute - * definition](entity:CustomAttributeDefinition) in the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of - * each custom attribute, - * information about the data type, or other definition details. The default value is - * `false`. - * - * @return ApiResponse Response from the API call - */ - public function retrieveOrderCustomAttribute( - string $orderId, - string $customAttributeKey, - ?int $version = null, - ?bool $withDefinition = false - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - TemplateParam::init('custom_attribute_key', $customAttributeKey), - QueryParam::init('version', $version), - QueryParam::init('with_definition', $withDefinition) - ); - - $_resHandler = $this->responseHandler() - ->type(RetrieveOrderCustomAttributeResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates a [custom attribute]($m/CustomAttribute) for an order. - * - * Use this endpoint to set the value of a custom attribute for a specific order. - * A custom attribute is based on a custom attribute definition in a Square seller account. (To create - * a - * custom attribute definition, use the - * [CreateOrderCustomAttributeDefinition]($e/OrderCustomAttributes/CreateOrderCustomAttributeDefinition - * ) endpoint.) - * - * To create or update a custom attribute owned by another application, the `visibility` setting - * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes - * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - * - * @param string $orderId The ID of the target [order](entity:Order). - * @param string $customAttributeKey The key of the custom attribute to create or update. This - * key must match the key - * of an existing custom attribute definition. - * @param UpsertOrderCustomAttributeRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertOrderCustomAttribute( - string $orderId, - string $customAttributeKey, - UpsertOrderCustomAttributeRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - TemplateParam::init('custom_attribute_key', $customAttributeKey), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpsertOrderCustomAttributeResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/OrdersApi.php b/src/Apis/OrdersApi.php deleted file mode 100644 index d7b28b64..00000000 --- a/src/Apis/OrdersApi.php +++ /dev/null @@ -1,249 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/orders') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a set of [orders]($m/Order) by their IDs. - * - * If a given order ID does not exist, the ID is ignored instead of generating an error. - * - * @param BatchRetrieveOrdersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function batchRetrieveOrders(BatchRetrieveOrdersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/batch-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BatchRetrieveOrdersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Enables applications to preview order pricing without creating an order. - * - * @param CalculateOrderRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function calculateOrder(CalculateOrderRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/calculate') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CalculateOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order - * has - * only the core fields (such as line items, taxes, and discounts) copied from the original order. - * - * @param CloneOrderRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function cloneOrder(CloneOrderRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/clone') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CloneOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Search all orders for one or more locations. Orders include all sales, - * returns, and exchanges regardless of how or when they entered the Square - * ecosystem (such as Point of Sale, Invoices, and Connect APIs). - * - * `SearchOrders` requests need to specify which locations to search and define a - * [SearchOrdersQuery]($m/SearchOrdersQuery) object that controls - * how to sort or filter the results. Your `SearchOrdersQuery` can: - * - * Set filter criteria. - * Set the sort order. - * Determine whether to return results as complete `Order` objects or as - * [OrderEntry]($m/OrderEntry) objects. - * - * Note that details for orders processed with Square Point of Sale while in - * offline mode might not be transmitted to Square for up to 72 hours. Offline - * orders have a `created_at` value that reflects the time the order was created, - * not the time it was subsequently transmitted to Square. - * - * @param SearchOrdersRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchOrders(SearchOrdersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchOrdersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves an [Order]($m/Order) by ID. - * - * @param string $orderId The ID of the order to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveOrder(string $orderId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/orders/{order_id}') - ->auth('global') - ->parameters(TemplateParam::init('order_id', $orderId)); - - $_resHandler = $this->responseHandler()->type(RetrieveOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an open [order]($m/Order) by adding, replacing, or deleting - * fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. - * - * An `UpdateOrder` request requires the following: - * - * - The `order_id` in the endpoint path, identifying the order to update. - * - The latest `version` of the order to update. - * - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update- - * orders#sparse-order-objects) - * containing only the fields to update and the version to which the update is - * being applied. - * - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders#identifying-fields-to-delete) - * identifying the fields to clear. - * - * To pay for an order, see - * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). - * - * @param string $orderId The ID of the order to update. - * @param UpdateOrderRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateOrder(string $orderId, UpdateOrderRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/orders/{order_id}') - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Pay for an [order]($m/Order) using one or more approved [payments]($m/Payment) - * or settle an order with a total of `0`. - * - * The total of the `payment_ids` listed in the request must be equal to the order - * total. Orders with a total amount of `0` can be marked as paid by specifying an empty - * array of `payment_ids` in the request. - * - * To be used with `PayOrder`, a payment must: - * - * - Reference the order by specifying the `order_id` when [creating the - * payment]($e/Payments/CreatePayment). - * Any approved payments that reference the same `order_id` not specified in the - * `payment_ids` is canceled. - * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take- - * payments/card-payments/delayed-capture). - * Using a delayed capture payment with `PayOrder` completes the approved payment. - * - * @param string $orderId The ID of the order being paid. - * @param PayOrderRequest $body An object containing the fields to POST for the request. See the - * corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function payOrder(string $orderId, PayOrderRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/orders/{order_id}/pay') - ->auth('global') - ->parameters( - TemplateParam::init('order_id', $orderId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(PayOrderResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/PaymentsApi.php b/src/Apis/PaymentsApi.php deleted file mode 100644 index 51bfa4fe..00000000 --- a/src/Apis/PaymentsApi.php +++ /dev/null @@ -1,285 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/payments') - ->auth('global') - ->parameters( - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('cursor', $cursor), - QueryParam::init('location_id', $locationId), - QueryParam::init('total', $total), - QueryParam::init('last_4', $last4), - QueryParam::init('card_brand', $cardBrand), - QueryParam::init('limit', $limit), - QueryParam::init('is_offline_payment', $isOfflinePayment), - QueryParam::init('offline_begin_time', $offlineBeginTime), - QueryParam::init('offline_end_time', $offlineEndTime), - QueryParam::init('updated_at_begin_time', $updatedAtBeginTime), - QueryParam::init('updated_at_end_time', $updatedAtEndTime), - QueryParam::init('sort_field', $sortField) - ); - - $_resHandler = $this->responseHandler()->type(ListPaymentsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a payment using the provided source. You can use this endpoint - * to charge a card (credit/debit card or - * Square gift card) or record a payment that the seller received outside of Square - * (cash payment from a buyer or a payment that an external entity - * processed on behalf of the seller). - * - * The endpoint creates a - * `Payment` object and returns it in the response. - * - * @param CreatePaymentRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createPayment(CreatePaymentRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/payments') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreatePaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels (voids) a payment identified by the idempotency key that is specified in the - * request. - * - * Use this method when the status of a `CreatePayment` request is unknown (for example, after you send - * a - * `CreatePayment` request, a network error occurs and you do not get a response). In this case, you - * can - * direct Square to cancel the payment using this endpoint. In the request, you provide the same - * idempotency key that you provided in your `CreatePayment` request that you want to cancel. After - * canceling the payment, you can submit your `CreatePayment` request again. - * - * Note that if no payment with the specified idempotency key is found, no action is taken and the - * endpoint - * returns successfully. - * - * @param CancelPaymentByIdempotencyKeyRequest $body An object containing the fields to POST for - * the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function cancelPaymentByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/payments/cancel') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler() - ->type(CancelPaymentByIdempotencyKeyResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves details for a specific payment. - * - * @param string $paymentId A unique ID for the desired payment. - * - * @return ApiResponse Response from the API call - */ - public function getPayment(string $paymentId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/{payment_id}') - ->auth('global') - ->parameters(TemplateParam::init('payment_id', $paymentId)); - - $_resHandler = $this->responseHandler()->type(GetPaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a payment with the APPROVED status. - * You can update the `amount_money` and `tip_money` using this endpoint. - * - * @param string $paymentId The ID of the payment to update. - * @param UpdatePaymentRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updatePayment(string $paymentId, UpdatePaymentRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/payments/{payment_id}') - ->auth('global') - ->parameters( - TemplateParam::init('payment_id', $paymentId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdatePaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels (voids) a payment. You can use this endpoint to cancel a payment with - * the APPROVED `status`. - * - * @param string $paymentId The ID of the payment to cancel. - * - * @return ApiResponse Response from the API call - */ - public function cancelPayment(string $paymentId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/payments/{payment_id}/cancel') - ->auth('global') - ->parameters(TemplateParam::init('payment_id', $paymentId)); - - $_resHandler = $this->responseHandler()->type(CancelPaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Completes (captures) a payment. - * By default, payments are set to complete immediately after they are created. - * - * You can use this endpoint to complete a payment with the APPROVED `status`. - * - * @param string $paymentId The unique ID identifying the payment to be completed. - * @param CompletePaymentRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function completePayment(string $paymentId, CompletePaymentRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/payments/{payment_id}/complete') - ->auth('global') - ->parameters( - TemplateParam::init('payment_id', $paymentId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(CompletePaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/PayoutsApi.php b/src/Apis/PayoutsApi.php deleted file mode 100644 index 3c5ba11e..00000000 --- a/src/Apis/PayoutsApi.php +++ /dev/null @@ -1,134 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/payouts') - ->auth('global') - ->parameters( - QueryParam::init('location_id', $locationId), - QueryParam::init('status', $status), - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListPayoutsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves details of a specific payout identified by a payout ID. - * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - * - * @param string $payoutId The ID of the payout to retrieve the information for. - * - * @return ApiResponse Response from the API call - */ - public function getPayout(string $payoutId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payouts/{payout_id}') - ->auth('global') - ->parameters(TemplateParam::init('payout_id', $payoutId)); - - $_resHandler = $this->responseHandler()->type(GetPayoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a list of all payout entries for a specific payout. - * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - * - * @param string $payoutId The ID of the payout to retrieve the information for. - * @param string|null $sortOrder The order in which payout entries are listed. - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * If request parameters change between requests, subsequent results may contain - * duplicates or missing records. - * @param int|null $limit The maximum number of results to be returned in a single page. It is - * possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value - * is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - * - * @return ApiResponse Response from the API call - */ - public function listPayoutEntries( - string $payoutId, - ?string $sortOrder = null, - ?string $cursor = null, - ?int $limit = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payouts/{payout_id}/payout-entries') - ->auth('global') - ->parameters( - TemplateParam::init('payout_id', $payoutId), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListPayoutEntriesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/RefundsApi.php b/src/Apis/RefundsApi.php deleted file mode 100644 index 32a2b851..00000000 --- a/src/Apis/RefundsApi.php +++ /dev/null @@ -1,139 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/refunds') - ->auth('global') - ->parameters( - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('cursor', $cursor), - QueryParam::init('location_id', $locationId), - QueryParam::init('status', $status), - QueryParam::init('source_type', $sourceType), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListPaymentRefundsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Refunds a payment. You can refund the entire payment amount or a - * portion of it. You can use this endpoint to refund a card payment or record a - * refund of a cash or external payment. For more information, see - * [Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). - * - * @param RefundPaymentRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function refundPayment(RefundPaymentRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/refunds') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(RefundPaymentResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a specific refund using the `refund_id`. - * - * @param string $refundId The unique ID for the desired `PaymentRefund`. - * - * @return ApiResponse Response from the API call - */ - public function getPaymentRefund(string $refundId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/refunds/{refund_id}') - ->auth('global') - ->parameters(TemplateParam::init('refund_id', $refundId)); - - $_resHandler = $this->responseHandler()->type(GetPaymentRefundResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/SitesApi.php b/src/Apis/SitesApi.php deleted file mode 100644 index 29487c1f..00000000 --- a/src/Apis/SitesApi.php +++ /dev/null @@ -1,32 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/sites')->auth('global'); - - $_resHandler = $this->responseHandler()->type(ListSitesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/SnippetsApi.php b/src/Apis/SnippetsApi.php deleted file mode 100644 index 3dd87866..00000000 --- a/src/Apis/SnippetsApi.php +++ /dev/null @@ -1,102 +0,0 @@ -requestBuilder(RequestMethod::DELETE, '/v2/sites/{site_id}/snippet') - ->auth('global') - ->parameters(TemplateParam::init('site_id', $siteId)); - - $_resHandler = $this->responseHandler()->type(DeleteSnippetResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet - * applications, but you can retrieve only the snippet that was added by your application. - * - * You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites that belong to a seller. - * - * - * __Note:__ Square Online APIs are publicly available as part of an early access program. For more - * information, see [Early access program for Square Online APIs](https://developer.squareup. - * com/docs/online-api#early-access-program-for-square-online-apis). - * - * @param string $siteId The ID of the site that contains the snippet. - * - * @return ApiResponse Response from the API call - */ - public function retrieveSnippet(string $siteId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/sites/{site_id}/snippet') - ->auth('global') - ->parameters(TemplateParam::init('site_id', $siteId)); - - $_resHandler = $this->responseHandler()->type(RetrieveSnippetResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Adds a snippet to a Square Online site or updates the existing snippet on the site. - * The snippet code is appended to the end of the `head` element on every page of the site, except - * checkout pages. A snippet application can add one snippet to a given site. - * - * You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites that belong to a seller. - * - * - * __Note:__ Square Online APIs are publicly available as part of an early access program. For more - * information, see [Early access program for Square Online APIs](https://developer.squareup. - * com/docs/online-api#early-access-program-for-square-online-apis). - * - * @param string $siteId The ID of the site where you want to add or update the snippet. - * @param UpsertSnippetRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function upsertSnippet(string $siteId, UpsertSnippetRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/sites/{site_id}/snippet') - ->auth('global') - ->parameters( - TemplateParam::init('site_id', $siteId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpsertSnippetResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/SubscriptionsApi.php b/src/Apis/SubscriptionsApi.php deleted file mode 100644 index 04507e74..00000000 --- a/src/Apis/SubscriptionsApi.php +++ /dev/null @@ -1,363 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/subscriptions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Schedules a plan variation change for all active subscriptions under a given plan - * variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup. - * com/docs/subscriptions-api/swap-plan-variations). - * - * @param BulkSwapPlanRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkSwapPlan(BulkSwapPlanRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/bulk-swap-plan') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkSwapPlanResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for subscriptions. - * - * Results are ordered chronologically by subscription creation date. If - * the request specifies more than one location ID, - * the endpoint orders the result - * by location ID, and then by creation date within each location. If no locations are given - * in the query, all locations are searched. - * - * You can also optionally specify `customer_ids` to search by customer. - * If left unset, all customers - * associated with the specified locations are returned. - * If the request specifies customer IDs, the endpoint orders results - * first by location, within location by customer ID, and within - * customer by subscription creation date. - * - * @param SearchSubscriptionsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchSubscriptions(SearchSubscriptionsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchSubscriptionsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a specific subscription. - * - * @param string $subscriptionId The ID of the subscription to retrieve. - * @param string|null $mInclude A query parameter to specify related information to be included - * in the response. - * - * The supported query parameter values are: - * - * - `actions`: to include scheduled actions on the targeted subscription. - * - * @return ApiResponse Response from the API call - */ - public function retrieveSubscription(string $subscriptionId, ?string $mInclude = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/subscriptions/{subscription_id}') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - QueryParam::init('include', $mInclude) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a subscription by modifying or clearing `subscription` field values. - * To clear a field, set its value to `null`. - * - * @param string $subscriptionId The ID of the subscription to update. - * @param UpdateSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateSubscription(string $subscriptionId, UpdateSubscriptionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/subscriptions/{subscription_id}') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a scheduled action for a subscription. - * - * @param string $subscriptionId The ID of the subscription the targeted action is to act upon. - * @param string $actionId The ID of the targeted action to be deleted. - * - * @return ApiResponse Response from the API call - */ - public function deleteSubscriptionAction(string $subscriptionId, string $actionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/v2/subscriptions/{subscription_id}/actions/{action_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('action_id', $actionId) - ); - - $_resHandler = $this->responseHandler()->type(DeleteSubscriptionActionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription- - * billing#billing-dates) - * for a subscription. - * - * @param string $subscriptionId The ID of the subscription to update the billing anchor date. - * @param ChangeBillingAnchorDateRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function changeBillingAnchorDate(string $subscriptionId, ChangeBillingAnchorDateRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/subscriptions/{subscription_id}/billing-anchor' - ) - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(ChangeBillingAnchorDateResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Schedules a `CANCEL` action to cancel an active subscription. This - * sets the `canceled_date` field to the end of the active billing period. After this date, - * the subscription status changes from ACTIVE to CANCELED. - * - * @param string $subscriptionId The ID of the subscription to cancel. - * - * @return ApiResponse Response from the API call - */ - public function cancelSubscription(string $subscriptionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/{subscription_id}/cancel') - ->auth('global') - ->parameters(TemplateParam::init('subscription_id', $subscriptionId)); - - $_resHandler = $this->responseHandler()->type(CancelSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a - * specific subscription. - * - * @param string $subscriptionId The ID of the subscription to retrieve the events for. - * @param string|null $cursor When the total number of resulting subscription events exceeds the - * limit of a paged response, - * specify the cursor returned from a preceding response here to fetch the next set of - * results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param int|null $limit The upper limit on the number of subscription events to return in a - * paged response. - * - * @return ApiResponse Response from the API call - */ - public function listSubscriptionEvents( - string $subscriptionId, - ?string $cursor = null, - ?int $limit = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/subscriptions/{subscription_id}/events') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - QueryParam::init('cursor', $cursor), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListSubscriptionEventsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Schedules a `PAUSE` action to pause an active subscription. - * - * @param string $subscriptionId The ID of the subscription to pause. - * @param PauseSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function pauseSubscription(string $subscriptionId, PauseSubscriptionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/{subscription_id}/pause') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(PauseSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Schedules a `RESUME` action to resume a paused or a deactivated subscription. - * - * @param string $subscriptionId The ID of the subscription to resume. - * @param ResumeSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function resumeSubscription(string $subscriptionId, ResumeSubscriptionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/{subscription_id}/resume') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(ResumeSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. - * For more information, see [Swap Subscription Plan Variations](https://developer.squareup. - * com/docs/subscriptions-api/swap-plan-variations). - * - * @param string $subscriptionId The ID of the subscription to swap the subscription plan for. - * @param SwapPlanRequest $body An object containing the fields to POST for the request. See the - * corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function swapPlan(string $subscriptionId, SwapPlanRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/subscriptions/{subscription_id}/swap-plan') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(SwapPlanResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/TeamApi.php b/src/Apis/TeamApi.php deleted file mode 100644 index 50c9893a..00000000 --- a/src/Apis/TeamApi.php +++ /dev/null @@ -1,336 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/team-members') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateTeamMemberResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful - * creates. - * This process is non-transactional and processes as much of the request as possible. If one of the - * creates in - * the request cannot be successfully processed, the request is not marked as failed, but the body of - * the response - * contains explicit error information for the failed create. - * - * Learn about [Troubleshooting the Team API](https://developer.squareup. - * com/docs/team/troubleshooting#bulk-create-team-members). - * - * @param BulkCreateTeamMembersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkCreateTeamMembers(BulkCreateTeamMembersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/team-members/bulk-create') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkCreateTeamMembersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful - * updates. - * This process is non-transactional and processes as much of the request as possible. If one of the - * updates in - * the request cannot be successfully processed, the request is not marked as failed, but the body of - * the response - * contains explicit error information for the failed update. - * Learn about [Troubleshooting the Team API](https://developer.squareup. - * com/docs/team/troubleshooting#bulk-update-team-members). - * - * @param BulkUpdateTeamMembersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpdateTeamMembers(BulkUpdateTeamMembersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/team-members/bulk-update') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkUpdateTeamMembersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists jobs in a seller account. Results are sorted by title in ascending order. - * - * @param string|null $cursor The pagination cursor returned by the previous call to this - * endpoint. Provide this - * cursor to retrieve the next page of results for your original request. For more - * information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @return ApiResponse Response from the API call - */ - public function listJobs(?string $cursor = null): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/team-members/jobs') - ->auth('global') - ->parameters(QueryParam::init('cursor', $cursor)); - - $_resHandler = $this->responseHandler()->type(ListJobsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a job in a seller account. A job defines a title and tip eligibility. Note that - * compensation is defined in a [job assignment]($m/JobAssignment) in a team member's wage setting. - * - * @param CreateJobRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createJob(CreateJobRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/team-members/jobs') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateJobResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a specified job. - * - * @param string $jobId The ID of the job to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveJob(string $jobId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/team-members/jobs/{job_id}') - ->auth('global') - ->parameters(TemplateParam::init('job_id', $jobId)); - - $_resHandler = $this->responseHandler()->type(RetrieveJobResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the title or tip eligibility of a job. Changes to the title propagate to all - * `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to - * tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. - * - * @param string $jobId The ID of the job to update. - * @param UpdateJobRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateJob(string $jobId, UpdateJobRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/team-members/jobs/{job_id}') - ->auth('global') - ->parameters( - TemplateParam::init('job_id', $jobId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateJobResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a paginated list of `TeamMember` objects for a business. - * The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether - * the team member is the Square account owner. - * - * @param SearchTeamMembersRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchTeamMembers(SearchTeamMembersRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/team-members/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchTeamMembersResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a `TeamMember` object for the given `TeamMember.id`. - * Learn about [Troubleshooting the Team API](https://developer.squareup. - * com/docs/team/troubleshooting#retrieve-a-team-member). - * - * @param string $teamMemberId The ID of the team member to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveTeamMember(string $teamMemberId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/team-members/{team_member_id}') - ->auth('global') - ->parameters(TemplateParam::init('team_member_id', $teamMemberId)); - - $_resHandler = $this->responseHandler()->type(RetrieveTeamMemberResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates. - * Learn about [Troubleshooting the Team API](https://developer.squareup. - * com/docs/team/troubleshooting#update-a-team-member). - * - * @param string $teamMemberId The ID of the team member to update. - * @param UpdateTeamMemberRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateTeamMember(string $teamMemberId, UpdateTeamMemberRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/team-members/{team_member_id}') - ->auth('global') - ->parameters( - TemplateParam::init('team_member_id', $teamMemberId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateTeamMemberResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a `WageSetting` object for a team member specified - * by `TeamMember.id`. For more information, see - * [Troubleshooting the Team API](https://developer.squareup. - * com/docs/team/troubleshooting#retrievewagesetting). - * - * Square recommends using [RetrieveTeamMember]($e/Team/RetrieveTeamMember) or - * [SearchTeamMembers]($e/Team/SearchTeamMembers) - * to get this information directly from the `TeamMember.wage_setting` field. - * - * @param string $teamMemberId The ID of the team member for which to retrieve the wage setting. - * - * @return ApiResponse Response from the API call - */ - public function retrieveWageSetting(string $teamMemberId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/team-members/{team_member_id}/wage-setting') - ->auth('global') - ->parameters(TemplateParam::init('team_member_id', $teamMemberId)); - - $_resHandler = $this->responseHandler()->type(RetrieveWageSettingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates or updates a `WageSetting` object. The object is created if a - * `WageSetting` with the specified `team_member_id` doesn't exist. Otherwise, - * it fully replaces the `WageSetting` object for the team member. - * The `WageSetting` is returned on a successful update. For more information, see - * [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or- - * update-a-wage-setting). - * - * Square recommends using [CreateTeamMember]($e/Team/CreateTeamMember) or - * [UpdateTeamMember]($e/Team/UpdateTeamMember) - * to manage the `TeamMember.wage_setting` field directly. - * - * @param string $teamMemberId The ID of the team member for which to update the `WageSetting` - * object. - * @param UpdateWageSettingRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateWageSetting(string $teamMemberId, UpdateWageSettingRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/team-members/{team_member_id}/wage-setting') - ->auth('global') - ->parameters( - TemplateParam::init('team_member_id', $teamMemberId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateWageSettingResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/TerminalApi.php b/src/Apis/TerminalApi.php deleted file mode 100644 index 620e1a87..00000000 --- a/src/Apis/TerminalApi.php +++ /dev/null @@ -1,342 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/terminals/actions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateTerminalActionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a filtered list of Terminal action requests created by the account making the request. - * Terminal action requests are available for 30 days. - * - * @param SearchTerminalActionsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchTerminalActions(SearchTerminalActionsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/actions/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchTerminalActionsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 - * days. - * - * @param string $actionId Unique ID for the desired `TerminalAction`. - * - * @return ApiResponse Response from the API call - */ - public function getTerminalAction(string $actionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/terminals/actions/{action_id}') - ->auth('global') - ->parameters(TemplateParam::init('action_id', $actionId)); - - $_resHandler = $this->responseHandler()->type(GetTerminalActionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels a Terminal action request if the status of the request permits it. - * - * @param string $actionId Unique ID for the desired `TerminalAction`. - * - * @return ApiResponse Response from the API call - */ - public function cancelTerminalAction(string $actionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/actions/{action_id}/cancel') - ->auth('global') - ->parameters(TemplateParam::init('action_id', $actionId)); - - $_resHandler = $this->responseHandler()->type(CancelTerminalActionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Dismisses a Terminal action request if the status and type of the request permits it. - * - * See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced- - * features/custom-workflows/link-and-dismiss-actions) for more details. - * - * @param string $actionId Unique ID for the `TerminalAction` associated with the action to be - * dismissed. - * - * @return ApiResponse Response from the API call - */ - public function dismissTerminalAction(string $actionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/actions/{action_id}/dismiss') - ->auth('global') - ->parameters(TemplateParam::init('action_id', $actionId)); - - $_resHandler = $this->responseHandler()->type(DismissTerminalActionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a Terminal checkout request and sends it to the specified device to take a payment - * for the requested amount. - * - * @param CreateTerminalCheckoutRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createTerminalCheckout(CreateTerminalCheckoutRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/checkouts') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateTerminalCheckoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Returns a filtered list of Terminal checkout requests created by the application making the request. - * Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. - * Terminal checkout requests are available for 30 days. - * - * @param SearchTerminalCheckoutsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchTerminalCheckouts(SearchTerminalCheckoutsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/checkouts/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchTerminalCheckoutsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for - * 30 days. - * - * @param string $checkoutId The unique ID for the desired `TerminalCheckout`. - * - * @return ApiResponse Response from the API call - */ - public function getTerminalCheckout(string $checkoutId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/terminals/checkouts/{checkout_id}') - ->auth('global') - ->parameters(TemplateParam::init('checkout_id', $checkoutId)); - - $_resHandler = $this->responseHandler()->type(GetTerminalCheckoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels a Terminal checkout request if the status of the request permits it. - * - * @param string $checkoutId The unique ID for the desired `TerminalCheckout`. - * - * @return ApiResponse Response from the API call - */ - public function cancelTerminalCheckout(string $checkoutId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/checkouts/{checkout_id}/cancel') - ->auth('global') - ->parameters(TemplateParam::init('checkout_id', $checkoutId)); - - $_resHandler = $this->responseHandler()->type(CancelTerminalCheckoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Dismisses a Terminal checkout request if the status and type of the request permits it. - * - * @param string $checkoutId Unique ID for the `TerminalCheckout` associated with the checkout - * to be dismissed. - * - * @return ApiResponse Response from the API call - */ - public function dismissTerminalCheckout(string $checkoutId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/checkouts/{checkout_id}/dismiss') - ->auth('global') - ->parameters(TemplateParam::init('checkout_id', $checkoutId)); - - $_resHandler = $this->responseHandler()->type(DismissTerminalCheckoutResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac - * payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds - * for Terminal payments should use the Refunds API. For more information, see [Refunds - * API]($e/Refunds). - * - * @param CreateTerminalRefundRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createTerminalRefund(CreateTerminalRefundRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/refunds') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateTerminalRefundResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a filtered list of Interac Terminal refund requests created by the seller making the - * request. Terminal refund requests are available for 30 days. - * - * @param SearchTerminalRefundsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchTerminalRefunds(SearchTerminalRefundsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/refunds/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchTerminalRefundsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. - * - * @param string $terminalRefundId The unique ID for the desired `TerminalRefund`. - * - * @return ApiResponse Response from the API call - */ - public function getTerminalRefund(string $terminalRefundId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/terminals/refunds/{terminal_refund_id}') - ->auth('global') - ->parameters(TemplateParam::init('terminal_refund_id', $terminalRefundId)); - - $_resHandler = $this->responseHandler()->type(GetTerminalRefundResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels an Interac Terminal refund request by refund request ID if the status of the request permits - * it. - * - * @param string $terminalRefundId The unique ID for the desired `TerminalRefund`. - * - * @return ApiResponse Response from the API call - */ - public function cancelTerminalRefund(string $terminalRefundId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/terminals/refunds/{terminal_refund_id}/cancel' - )->auth('global')->parameters(TemplateParam::init('terminal_refund_id', $terminalRefundId)); - - $_resHandler = $this->responseHandler()->type(CancelTerminalRefundResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Dismisses a Terminal refund request if the status and type of the request permits it. - * - * @param string $terminalRefundId Unique ID for the `TerminalRefund` associated with the refund - * to be dismissed. - * - * @return ApiResponse Response from the API call - */ - public function dismissTerminalRefund(string $terminalRefundId): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/terminals/refunds/{terminal_refund_id}/dismiss' - )->auth('global')->parameters(TemplateParam::init('terminal_refund_id', $terminalRefundId)); - - $_resHandler = $this->responseHandler()->type(DismissTerminalRefundResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/TransactionsApi.php b/src/Apis/TransactionsApi.php deleted file mode 100644 index 1b59687c..00000000 --- a/src/Apis/TransactionsApi.php +++ /dev/null @@ -1,176 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/locations/{location_id}/transactions') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - QueryParam::init('begin_time', $beginTime), - QueryParam::init('end_time', $endTime), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('cursor', $cursor) - ); - - $_resHandler = $this->responseHandler()->type(ListTransactionsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves details for a single transaction. - * - * @deprecated - * - * @param string $locationId The ID of the transaction's associated location. - * @param string $transactionId The ID of the transaction to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveTransaction(string $locationId, string $transactionId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/v2/locations/{location_id}/transactions/{transaction_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('transaction_id', $transactionId) - ); - - $_resHandler = $this->responseHandler()->type(RetrieveTransactionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - * endpoint with a `delay_capture` value of `true`. - * - * - * See [Delayed capture transactions](https://developer.squareup. - * com/docs/payments/transactions/overview#delayed-capture) - * for more information. - * - * @deprecated - * - * @param string $locationId - * @param string $transactionId - * - * @return ApiResponse Response from the API call - */ - public function captureTransaction(string $locationId, string $transactionId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/locations/{location_id}/transactions/{transaction_id}/capture' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('transaction_id', $transactionId) - ); - - $_resHandler = $this->responseHandler()->type(CaptureTransactionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - * endpoint with a `delay_capture` value of `true`. - * - * - * See [Delayed capture transactions](https://developer.squareup. - * com/docs/payments/transactions/overview#delayed-capture) - * for more information. - * - * @deprecated - * - * @param string $locationId - * @param string $transactionId - * - * @return ApiResponse Response from the API call - */ - public function voidTransaction(string $locationId, string $transactionId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/locations/{location_id}/transactions/{transaction_id}/void' - ) - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('transaction_id', $transactionId) - ); - - $_resHandler = $this->responseHandler()->type(VoidTransactionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/V1TransactionsApi.php b/src/Apis/V1TransactionsApi.php deleted file mode 100644 index 5f099029..00000000 --- a/src/Apis/V1TransactionsApi.php +++ /dev/null @@ -1,113 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v1/{location_id}/orders') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - QueryParam::init('order', $order), - QueryParam::init('limit', $limit), - QueryParam::init('batch_token', $batchToken) - ); - - $_resHandler = $this->responseHandler()->type(V1Order::class, 1)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Provides comprehensive information for a single online store order, including the order's history. - * - * @deprecated - * - * @param string $locationId The ID of the order's associated location. - * @param string $orderId The order's Square-issued ID. You obtain this value from Order objects - * returned by the List Orders endpoint - * - * @return ApiResponse Response from the API call - */ - public function v1RetrieveOrder(string $locationId, string $orderId): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v1/{location_id}/orders/{order_id}') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('order_id', $orderId) - ); - - $_resHandler = $this->responseHandler()->type(V1Order::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the details of an online store order. Every update you perform on an order corresponds to - * one of three actions: - * - * @deprecated - * - * @param string $locationId The ID of the order's associated location. - * @param string $orderId The order's Square-issued ID. You obtain this value from Order objects - * returned by the List Orders endpoint - * @param V1UpdateOrderRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function v1UpdateOrder(string $locationId, string $orderId, V1UpdateOrderRequest $body): ApiResponse - { - trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); - - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v1/{location_id}/orders/{order_id}') - ->auth('global') - ->parameters( - TemplateParam::init('location_id', $locationId), - TemplateParam::init('order_id', $orderId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(V1Order::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/VendorsApi.php b/src/Apis/VendorsApi.php deleted file mode 100644 index fb0b6fa4..00000000 --- a/src/Apis/VendorsApi.php +++ /dev/null @@ -1,171 +0,0 @@ -requestBuilder(RequestMethod::POST, '/v2/vendors/bulk-create') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkCreateVendorsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves one or more vendors of specified [Vendor]($m/Vendor) IDs. - * - * @param BulkRetrieveVendorsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkRetrieveVendors(BulkRetrieveVendorsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/vendors/bulk-retrieve') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkRetrieveVendorsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates one or more of existing [Vendor]($m/Vendor) objects as suppliers to a seller. - * - * @param BulkUpdateVendorsRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function bulkUpdateVendors(BulkUpdateVendorsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/vendors/bulk-update') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(BulkUpdateVendorsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a single [Vendor]($m/Vendor) object to represent a supplier to a seller. - * - * @param CreateVendorRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createVendor(CreateVendorRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/vendors/create') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateVendorResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Searches for vendors using a filter against supported [Vendor]($m/Vendor) properties and a supported - * sorter. - * - * @param SearchVendorsRequest $body An object containing the fields to POST for the request. - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function searchVendors(SearchVendorsRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/vendors/search') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(SearchVendorsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves the vendor of a specified [Vendor]($m/Vendor) ID. - * - * @param string $vendorId ID of the [Vendor](entity:Vendor) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveVendor(string $vendorId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/vendors/{vendor_id}') - ->auth('global') - ->parameters(TemplateParam::init('vendor_id', $vendorId)); - - $_resHandler = $this->responseHandler()->type(RetrieveVendorResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates an existing [Vendor]($m/Vendor) object as a supplier to a seller. - * - * @param UpdateVendorRequest $body An object containing the fields to POST for the request. See - * the corresponding object definition for field details. - * @param string $vendorId - * - * @return ApiResponse Response from the API call - */ - public function updateVendor(UpdateVendorRequest $body, string $vendorId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/vendors/{vendor_id}') - ->auth('global') - ->parameters( - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body), - TemplateParam::init('vendor_id', $vendorId) - ); - - $_resHandler = $this->responseHandler()->type(UpdateVendorResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/Apis/WebhookSubscriptionsApi.php b/src/Apis/WebhookSubscriptionsApi.php deleted file mode 100644 index b0ae6787..00000000 --- a/src/Apis/WebhookSubscriptionsApi.php +++ /dev/null @@ -1,240 +0,0 @@ -requestBuilder(RequestMethod::GET, '/v2/webhooks/event-types') - ->auth('global') - ->parameters(QueryParam::init('api_version', $apiVersion)); - - $_resHandler = $this->responseHandler()->type(ListWebhookEventTypesResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Lists all webhook subscriptions owned by your application. - * - * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build- - * basics/common-api-patterns/pagination). - * @param bool|null $includeDisabled Includes disabled - * [Subscription](entity:WebhookSubscription)s. - * By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - * @param string|null $sortOrder Sorts the returned list by when the - * [Subscription](entity:WebhookSubscription) was created with the specified order. - * This field defaults to ASC. - * @param int|null $limit The maximum number of results to be returned in a single page. It is - * possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. - * - * Default: 100 - * - * @return ApiResponse Response from the API call - */ - public function listWebhookSubscriptions( - ?string $cursor = null, - ?bool $includeDisabled = false, - ?string $sortOrder = null, - ?int $limit = null - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/webhooks/subscriptions') - ->auth('global') - ->parameters( - QueryParam::init('cursor', $cursor), - QueryParam::init('include_disabled', $includeDisabled), - QueryParam::init('sort_order', $sortOrder), - QueryParam::init('limit', $limit) - ); - - $_resHandler = $this->responseHandler()->type(ListWebhookSubscriptionsResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Creates a webhook subscription. - * - * @param CreateWebhookSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function createWebhookSubscription(CreateWebhookSubscriptionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/webhooks/subscriptions') - ->auth('global') - ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); - - $_resHandler = $this->responseHandler()->type(CreateWebhookSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Deletes a webhook subscription. - * - * @param string $subscriptionId [REQUIRED] The ID of the - * [Subscription](entity:WebhookSubscription) to delete. - * - * @return ApiResponse Response from the API call - */ - public function deleteWebhookSubscription(string $subscriptionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v2/webhooks/subscriptions/{subscription_id}') - ->auth('global') - ->parameters(TemplateParam::init('subscription_id', $subscriptionId)); - - $_resHandler = $this->responseHandler()->type(DeleteWebhookSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Retrieves a webhook subscription identified by its ID. - * - * @param string $subscriptionId [REQUIRED] The ID of the - * [Subscription](entity:WebhookSubscription) to retrieve. - * - * @return ApiResponse Response from the API call - */ - public function retrieveWebhookSubscription(string $subscriptionId): ApiResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/webhooks/subscriptions/{subscription_id}') - ->auth('global') - ->parameters(TemplateParam::init('subscription_id', $subscriptionId)); - - $_resHandler = $this->responseHandler()->type(RetrieveWebhookSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a webhook subscription. - * - * @param string $subscriptionId [REQUIRED] The ID of the - * [Subscription](entity:WebhookSubscription) to update. - * @param UpdateWebhookSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateWebhookSubscription( - string $subscriptionId, - UpdateWebhookSubscriptionRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/webhooks/subscriptions/{subscription_id}') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(UpdateWebhookSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates a webhook subscription by replacing the existing signature key with a new one. - * - * @param string $subscriptionId [REQUIRED] The ID of the - * [Subscription](entity:WebhookSubscription) to update. - * @param UpdateWebhookSubscriptionSignatureKeyRequest $body An object containing the fields to - * POST for the request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function updateWebhookSubscriptionSignatureKey( - string $subscriptionId, - UpdateWebhookSubscriptionSignatureKeyRequest $body - ): ApiResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/webhooks/subscriptions/{subscription_id}/signature-key' - ) - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler() - ->type(UpdateWebhookSubscriptionSignatureKeyResponse::class) - ->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Tests a webhook subscription by sending a test event to the notification URL. - * - * @param string $subscriptionId [REQUIRED] The ID of the - * [Subscription](entity:WebhookSubscription) to test. - * @param TestWebhookSubscriptionRequest $body An object containing the fields to POST for the - * request. - * - * See the corresponding object definition for field details. - * - * @return ApiResponse Response from the API call - */ - public function testWebhookSubscription(string $subscriptionId, TestWebhookSubscriptionRequest $body): ApiResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/v2/webhooks/subscriptions/{subscription_id}/test' - ) - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - HeaderParam::init('Content-Type', 'application/json'), - BodyParam::init($body) - ); - - $_resHandler = $this->responseHandler()->type(TestWebhookSubscriptionResponse::class)->returnApiResponse(); - - return $this->execute($_reqBuilder, $_resHandler); - } -} diff --git a/src/ApplePay/ApplePayClient.php b/src/ApplePay/ApplePayClient.php new file mode 100644 index 00000000..c9baba06 --- /dev/null +++ b/src/ApplePay/ApplePayClient.php @@ -0,0 +1,122 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Activates a domain for use with Apple Pay on the Web and Square. A validation + * is performed on this domain by Apple to ensure that it is properly set up as + * an Apple Pay enabled domain. + * + * This endpoint provides an easy way for platform developers to bulk activate + * Apple Pay on the Web with Square for merchants using their platform. + * + * Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The + * current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, + * and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your + * domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding + * long-lived caches that might not keep in sync with the correct file version. + * + * To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). + * + * @param RegisterDomainRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RegisterDomainResponse + * @throws SquareException + * @throws SquareApiException + */ + public function registerDomain(RegisterDomainRequest $request, ?array $options = null): RegisterDomainResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/apple-pay/domains", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RegisterDomainResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/ApplePay/Requests/RegisterDomainRequest.php b/src/ApplePay/Requests/RegisterDomainRequest.php new file mode 100644 index 00000000..420f29ed --- /dev/null +++ b/src/ApplePay/Requests/RegisterDomainRequest.php @@ -0,0 +1,43 @@ +domainName = $values['domainName']; + } + + /** + * @return string + */ + public function getDomainName(): string + { + return $this->domainName; + } + + /** + * @param string $value + */ + public function setDomainName(string $value): self + { + $this->domainName = $value; + return $this; + } +} diff --git a/src/Authentication/BearerAuthCredentialsBuilder.php b/src/Authentication/BearerAuthCredentialsBuilder.php deleted file mode 100644 index 38c8b1ca..00000000 --- a/src/Authentication/BearerAuthCredentialsBuilder.php +++ /dev/null @@ -1,51 +0,0 @@ -config = $config; - } - - /** - * Initializer for BearerAuthCredentialsBuilder - * - * @param string $accessToken - */ - public static function init(string $accessToken): self - { - return new self(['accessToken' => $accessToken]); - } - - /** - * Setter for AccessToken. - * - * @param string $accessToken - * - * @return $this - */ - public function accessToken(string $accessToken): self - { - $this->config['accessToken'] = $accessToken; - return $this; - } - - public function getConfiguration(): array - { - return CoreHelper::clone($this->config); - } -} diff --git a/src/Authentication/BearerAuthManager.php b/src/Authentication/BearerAuthManager.php deleted file mode 100644 index 0416449d..00000000 --- a/src/Authentication/BearerAuthManager.php +++ /dev/null @@ -1,49 +0,0 @@ -config = $config; - parent::__construct( - HeaderParam::init('Authorization', CoreHelper::getBearerAuthString($this->getAccessToken())) - ->requiredNonEmpty() - ); - } - - /** - * String value for accessToken. - */ - public function getAccessToken(): string - { - return $this->config['accessToken'] ?? ConfigurationDefaults::ACCESS_TOKEN; - } - - /** - * Checks if provided credentials match with existing ones. - * - * @param string $accessToken The OAuth 2.0 Access Token to use for API requests. - */ - public function equals(string $accessToken): bool - { - return $accessToken == $this->getAccessToken(); - } -} diff --git a/src/BankAccounts/BankAccountsClient.php b/src/BankAccounts/BankAccountsClient.php new file mode 100644 index 00000000..b050feba --- /dev/null +++ b/src/BankAccounts/BankAccountsClient.php @@ -0,0 +1,266 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. + * + * @param ListBankAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListBankAccountsRequest $request = new ListBankAccountsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListBankAccountsRequest $request) => $this->_list($request, $options), + setCursor: function (ListBankAccountsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListBankAccountsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListBankAccountsResponse $response) => $response?->getBankAccounts() ?? [], + ); + } + + /** + * Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. + * + * @param GetByV1IdBankAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetBankAccountByV1IdResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getByV1Id(GetByV1IdBankAccountsRequest $request, ?array $options = null): GetBankAccountByV1IdResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bank-accounts/by-v1-id/{$request->getV1BankAccountId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetBankAccountByV1IdResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns details of a [BankAccount](entity:BankAccount) + * linked to a Square account. + * + * @param GetBankAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetBankAccountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetBankAccountsRequest $request, ?array $options = null): GetBankAccountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bank-accounts/{$request->getBankAccountId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetBankAccountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. + * + * @param ListBankAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListBankAccountsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListBankAccountsRequest $request = new ListBankAccountsRequest(), ?array $options = null): ListBankAccountsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bank-accounts", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListBankAccountsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/BankAccounts/Requests/GetBankAccountsRequest.php b/src/BankAccounts/Requests/GetBankAccountsRequest.php new file mode 100644 index 00000000..e74007da --- /dev/null +++ b/src/BankAccounts/Requests/GetBankAccountsRequest.php @@ -0,0 +1,41 @@ +bankAccountId = $values['bankAccountId']; + } + + /** + * @return string + */ + public function getBankAccountId(): string + { + return $this->bankAccountId; + } + + /** + * @param string $value + */ + public function setBankAccountId(string $value): self + { + $this->bankAccountId = $value; + return $this; + } +} diff --git a/src/BankAccounts/Requests/GetByV1IdBankAccountsRequest.php b/src/BankAccounts/Requests/GetByV1IdBankAccountsRequest.php new file mode 100644 index 00000000..1b5e020b --- /dev/null +++ b/src/BankAccounts/Requests/GetByV1IdBankAccountsRequest.php @@ -0,0 +1,44 @@ +v1BankAccountId = $values['v1BankAccountId']; + } + + /** + * @return string + */ + public function getV1BankAccountId(): string + { + return $this->v1BankAccountId; + } + + /** + * @param string $value + */ + public function setV1BankAccountId(string $value): self + { + $this->v1BankAccountId = $value; + return $this; + } +} diff --git a/src/BankAccounts/Requests/ListBankAccountsRequest.php b/src/BankAccounts/Requests/ListBankAccountsRequest.php new file mode 100644 index 00000000..a627afdf --- /dev/null +++ b/src/BankAccounts/Requests/ListBankAccountsRequest.php @@ -0,0 +1,102 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/BearerAuthCredentials.php b/src/BearerAuthCredentials.php deleted file mode 100644 index 29045785..00000000 --- a/src/BearerAuthCredentials.php +++ /dev/null @@ -1,23 +0,0 @@ -, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->customAttributeDefinitions = new CustomAttributeDefinitionsClient($this->client, $this->options); + $this->customAttributes = new CustomAttributesClient($this->client, $this->options); + $this->locationProfiles = new LocationProfilesClient($this->client, $this->options); + $this->teamMemberProfiles = new TeamMemberProfilesClient($this->client, $this->options); + } + + /** + * Retrieve a collection of bookings. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListBookingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListBookingsRequest $request = new ListBookingsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListBookingsRequest $request) => $this->_list($request, $options), + setCursor: function (ListBookingsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListBookingsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListBookingsResponse $response) => $response?->getBookings() ?? [], + ); + } + + /** + * Creates a booking. + * + * The required input must include the following: + * - `Booking.location_id` + * - `Booking.start_at` + * - `Booking.AppointmentSegment.team_member_id` + * - `Booking.AppointmentSegment.service_variation_id` + * - `Booking.AppointmentSegment.service_variation_version` + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param CreateBookingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateBookingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateBookingRequest $request, ?array $options = null): CreateBookingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateBookingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for availabilities for booking. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param SearchAvailabilityRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchAvailabilityResponse + * @throws SquareException + * @throws SquareApiException + */ + public function searchAvailability(SearchAvailabilityRequest $request, ?array $options = null): SearchAvailabilityResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/availability/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchAvailabilityResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Bulk-Retrieves a list of bookings by booking IDs. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param BulkRetrieveBookingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkRetrieveBookingsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkRetrieveBookings(BulkRetrieveBookingsRequest $request, ?array $options = null): BulkRetrieveBookingsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/bulk-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkRetrieveBookingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a seller's booking profile. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetBusinessBookingProfileResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getBusinessProfile(?array $options = null): GetBusinessBookingProfileResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/business-booking-profile", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetBusinessBookingProfileResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a seller's location booking profile. + * + * @param RetrieveLocationBookingProfileRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveLocationBookingProfileResponse + * @throws SquareException + * @throws SquareApiException + */ + public function retrieveLocationBookingProfile(RetrieveLocationBookingProfileRequest $request, ?array $options = null): RetrieveLocationBookingProfileResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/location-booking-profiles/{$request->getLocationId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveLocationBookingProfileResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves one or more team members' booking profiles. + * + * @param BulkRetrieveTeamMemberBookingProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkRetrieveTeamMemberBookingProfilesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkRetrieveTeamMemberBookingProfiles(BulkRetrieveTeamMemberBookingProfilesRequest $request, ?array $options = null): BulkRetrieveTeamMemberBookingProfilesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/team-member-booking-profiles/bulk-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkRetrieveTeamMemberBookingProfilesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a booking. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param GetBookingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetBookingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetBookingsRequest $request, ?array $options = null): GetBookingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetBookingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a booking. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param UpdateBookingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateBookingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateBookingRequest $request, ?array $options = null): UpdateBookingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateBookingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels an existing booking. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param CancelBookingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelBookingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelBookingRequest $request, ?array $options = null): CancelBookingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}/cancel", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelBookingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieve a collection of bookings. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListBookingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListBookingsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListBookingsRequest $request = new ListBookingsRequest(), ?array $options = null): ListBookingsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getCustomerId() != null) { + $query['customer_id'] = $request->getCustomerId(); + } + if ($request->getTeamMemberId() != null) { + $query['team_member_id'] = $request->getTeamMemberId(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getStartAtMin() != null) { + $query['start_at_min'] = $request->getStartAtMin(); + } + if ($request->getStartAtMax() != null) { + $query['start_at_max'] = $request->getStartAtMax(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListBookingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php new file mode 100644 index 00000000..f2cf45bf --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -0,0 +1,410 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Get all bookings custom attribute definitions. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributeDefinitionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributeDefinitionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListBookingCustomAttributeDefinitionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListBookingCustomAttributeDefinitionsResponse $response) => $response?->getCustomAttributeDefinitions() ?? [], + ); + } + + /** + * Creates a bookings custom attribute definition. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param CreateBookingCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateBookingCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateBookingCustomAttributeDefinitionRequest $request, ?array $options = null): CreateBookingCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attribute-definitions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateBookingCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a bookings custom attribute definition. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param GetCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveBookingCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributeDefinitionsRequest $request, ?array $options = null): RetrieveBookingCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveBookingCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a bookings custom attribute definition. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param UpdateBookingCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateBookingCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateBookingCustomAttributeDefinitionRequest $request, ?array $options = null): UpdateBookingCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateBookingCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a bookings custom attribute definition. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param DeleteCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteBookingCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributeDefinitionsRequest $request, ?array $options = null): DeleteBookingCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteBookingCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Get all bookings custom attribute definitions. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListBookingCustomAttributeDefinitionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): ListBookingCustomAttributeDefinitionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attribute-definitions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListBookingCustomAttributeDefinitionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/Requests/CreateBookingCustomAttributeDefinitionRequest.php b/src/Bookings/CustomAttributeDefinitions/Requests/CreateBookingCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..09760d6f --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/Requests/CreateBookingCustomAttributeDefinitionRequest.php @@ -0,0 +1,88 @@ +customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php b/src/Bookings/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..3e8c7754 --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php @@ -0,0 +1,41 @@ +key = $values['key']; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php b/src/Bookings/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..5040e4d4 --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +key = $values['key']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php b/src/Bookings/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..59c44c9b --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributeDefinitions/Requests/UpdateBookingCustomAttributeDefinitionRequest.php b/src/Bookings/CustomAttributeDefinitions/Requests/UpdateBookingCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..66edb7b5 --- /dev/null +++ b/src/Bookings/CustomAttributeDefinitions/Requests/UpdateBookingCustomAttributeDefinitionRequest.php @@ -0,0 +1,109 @@ +key = $values['key']; + $this->customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/CustomAttributesClient.php b/src/Bookings/CustomAttributes/CustomAttributesClient.php new file mode 100644 index 00000000..0c5fbacb --- /dev/null +++ b/src/Bookings/CustomAttributes/CustomAttributesClient.php @@ -0,0 +1,480 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Bulk deletes bookings custom attributes. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param BulkDeleteBookingCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkDeleteBookingCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchDelete(BulkDeleteBookingCustomAttributesRequest $request, ?array $options = null): BulkDeleteBookingCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attributes/bulk-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkDeleteBookingCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Bulk upserts bookings custom attributes. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param BulkUpsertBookingCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkUpsertBookingCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BulkUpsertBookingCustomAttributesRequest $request, ?array $options = null): BulkUpsertBookingCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/custom-attributes/bulk-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkUpsertBookingCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists a booking's custom attributes. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListBookingCustomAttributesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListBookingCustomAttributesResponse $response) => $response?->getCustomAttributes() ?? [], + ); + } + + /** + * Retrieves a bookings custom attribute. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param GetCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveBookingCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributesRequest $request, ?array $options = null): RetrieveBookingCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getWithDefinition() != null) { + $query['with_definition'] = $request->getWithDefinition(); + } + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveBookingCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Upserts a bookings custom attribute. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param UpsertBookingCustomAttributeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertBookingCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertBookingCustomAttributeRequest $request, ?array $options = null): UpsertBookingCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertBookingCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a bookings custom attribute. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + * + * For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* + * or *Appointments Premium*. + * + * @param DeleteCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteBookingCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributesRequest $request, ?array $options = null): DeleteBookingCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteBookingCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists a booking's custom attributes. + * + * To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. + * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListBookingCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributesRequest $request, ?array $options = null): ListBookingCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getWithDefinitions() != null) { + $query['with_definitions'] = $request->getWithDefinitions(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/{$request->getBookingId()}/custom-attributes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListBookingCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Bookings/CustomAttributes/Requests/BulkDeleteBookingCustomAttributesRequest.php b/src/Bookings/CustomAttributes/Requests/BulkDeleteBookingCustomAttributesRequest.php new file mode 100644 index 00000000..7c07711d --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/BulkDeleteBookingCustomAttributesRequest.php @@ -0,0 +1,49 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BookingCustomAttributeDeleteRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/Requests/BulkUpsertBookingCustomAttributesRequest.php b/src/Bookings/CustomAttributes/Requests/BulkUpsertBookingCustomAttributesRequest.php new file mode 100644 index 00000000..524a8e00 --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/BulkUpsertBookingCustomAttributesRequest.php @@ -0,0 +1,49 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BookingCustomAttributeUpsertRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/Requests/DeleteCustomAttributesRequest.php b/src/Bookings/CustomAttributes/Requests/DeleteCustomAttributesRequest.php new file mode 100644 index 00000000..b3568a70 --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/DeleteCustomAttributesRequest.php @@ -0,0 +1,69 @@ +bookingId = $values['bookingId']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/Requests/GetCustomAttributesRequest.php b/src/Bookings/CustomAttributes/Requests/GetCustomAttributesRequest.php new file mode 100644 index 00000000..a3fe3f1d --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/GetCustomAttributesRequest.php @@ -0,0 +1,126 @@ +bookingId = $values['bookingId']; + $this->key = $values['key']; + $this->withDefinition = $values['withDefinition'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinition(): ?bool + { + return $this->withDefinition; + } + + /** + * @param ?bool $value + */ + public function setWithDefinition(?bool $value = null): self + { + $this->withDefinition = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/Requests/ListCustomAttributesRequest.php b/src/Bookings/CustomAttributes/Requests/ListCustomAttributesRequest.php new file mode 100644 index 00000000..0e514c4f --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/ListCustomAttributesRequest.php @@ -0,0 +1,125 @@ +bookingId = $values['bookingId']; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->withDefinitions = $values['withDefinitions'] ?? null; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinitions(): ?bool + { + return $this->withDefinitions; + } + + /** + * @param ?bool $value + */ + public function setWithDefinitions(?bool $value = null): self + { + $this->withDefinitions = $value; + return $this; + } +} diff --git a/src/Bookings/CustomAttributes/Requests/UpsertBookingCustomAttributeRequest.php b/src/Bookings/CustomAttributes/Requests/UpsertBookingCustomAttributeRequest.php new file mode 100644 index 00000000..3d2a4941 --- /dev/null +++ b/src/Bookings/CustomAttributes/Requests/UpsertBookingCustomAttributeRequest.php @@ -0,0 +1,133 @@ +bookingId = $values['bookingId']; + $this->key = $values['key']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Bookings/LocationProfiles/LocationProfilesClient.php b/src/Bookings/LocationProfiles/LocationProfilesClient.php new file mode 100644 index 00000000..ec6a8366 --- /dev/null +++ b/src/Bookings/LocationProfiles/LocationProfilesClient.php @@ -0,0 +1,148 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists location booking profiles of a seller. + * + * @param ListLocationProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListLocationProfilesRequest $request = new ListLocationProfilesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListLocationProfilesRequest $request) => $this->_list($request, $options), + setCursor: function (ListLocationProfilesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListLocationBookingProfilesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListLocationBookingProfilesResponse $response) => $response?->getLocationBookingProfiles() ?? [], + ); + } + + /** + * Lists location booking profiles of a seller. + * + * @param ListLocationProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLocationBookingProfilesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListLocationProfilesRequest $request = new ListLocationProfilesRequest(), ?array $options = null): ListLocationBookingProfilesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/location-booking-profiles", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLocationBookingProfilesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Bookings/LocationProfiles/Requests/ListLocationProfilesRequest.php b/src/Bookings/LocationProfiles/Requests/ListLocationProfilesRequest.php new file mode 100644 index 00000000..560c67af --- /dev/null +++ b/src/Bookings/LocationProfiles/Requests/ListLocationProfilesRequest.php @@ -0,0 +1,65 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/BulkRetrieveBookingsRequest.php b/src/Bookings/Requests/BulkRetrieveBookingsRequest.php new file mode 100644 index 00000000..d60b3ad7 --- /dev/null +++ b/src/Bookings/Requests/BulkRetrieveBookingsRequest.php @@ -0,0 +1,44 @@ + $bookingIds A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. + */ + #[JsonProperty('booking_ids'), ArrayType(['string'])] + private array $bookingIds; + + /** + * @param array{ + * bookingIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->bookingIds = $values['bookingIds']; + } + + /** + * @return array + */ + public function getBookingIds(): array + { + return $this->bookingIds; + } + + /** + * @param array $value + */ + public function setBookingIds(array $value): self + { + $this->bookingIds = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/BulkRetrieveTeamMemberBookingProfilesRequest.php b/src/Bookings/Requests/BulkRetrieveTeamMemberBookingProfilesRequest.php new file mode 100644 index 00000000..e953cda6 --- /dev/null +++ b/src/Bookings/Requests/BulkRetrieveTeamMemberBookingProfilesRequest.php @@ -0,0 +1,44 @@ + $teamMemberIds A non-empty list of IDs of team members whose booking profiles you want to retrieve. + */ + #[JsonProperty('team_member_ids'), ArrayType(['string'])] + private array $teamMemberIds; + + /** + * @param array{ + * teamMemberIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->teamMemberIds = $values['teamMemberIds']; + } + + /** + * @return array + */ + public function getTeamMemberIds(): array + { + return $this->teamMemberIds; + } + + /** + * @param array $value + */ + public function setTeamMemberIds(array $value): self + { + $this->teamMemberIds = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/CancelBookingRequest.php b/src/Bookings/Requests/CancelBookingRequest.php new file mode 100644 index 00000000..62c29d96 --- /dev/null +++ b/src/Bookings/Requests/CancelBookingRequest.php @@ -0,0 +1,92 @@ +bookingId = $values['bookingId']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->bookingVersion = $values['bookingVersion'] ?? null; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?int + */ + public function getBookingVersion(): ?int + { + return $this->bookingVersion; + } + + /** + * @param ?int $value + */ + public function setBookingVersion(?int $value = null): self + { + $this->bookingVersion = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/CreateBookingRequest.php b/src/Bookings/Requests/CreateBookingRequest.php new file mode 100644 index 00000000..8b17d6fe --- /dev/null +++ b/src/Bookings/Requests/CreateBookingRequest.php @@ -0,0 +1,69 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->booking = $values['booking']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return Booking + */ + public function getBooking(): Booking + { + return $this->booking; + } + + /** + * @param Booking $value + */ + public function setBooking(Booking $value): self + { + $this->booking = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/GetBookingsRequest.php b/src/Bookings/Requests/GetBookingsRequest.php new file mode 100644 index 00000000..95634c1e --- /dev/null +++ b/src/Bookings/Requests/GetBookingsRequest.php @@ -0,0 +1,41 @@ +bookingId = $values['bookingId']; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/ListBookingsRequest.php b/src/Bookings/Requests/ListBookingsRequest.php new file mode 100644 index 00000000..a585b3ed --- /dev/null +++ b/src/Bookings/Requests/ListBookingsRequest.php @@ -0,0 +1,185 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->startAtMin = $values['startAtMin'] ?? null; + $this->startAtMax = $values['startAtMax'] ?? null; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartAtMin(): ?string + { + return $this->startAtMin; + } + + /** + * @param ?string $value + */ + public function setStartAtMin(?string $value = null): self + { + $this->startAtMin = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartAtMax(): ?string + { + return $this->startAtMax; + } + + /** + * @param ?string $value + */ + public function setStartAtMax(?string $value = null): self + { + $this->startAtMax = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/RetrieveLocationBookingProfileRequest.php b/src/Bookings/Requests/RetrieveLocationBookingProfileRequest.php new file mode 100644 index 00000000..ea45b46b --- /dev/null +++ b/src/Bookings/Requests/RetrieveLocationBookingProfileRequest.php @@ -0,0 +1,41 @@ +locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/SearchAvailabilityRequest.php b/src/Bookings/Requests/SearchAvailabilityRequest.php new file mode 100644 index 00000000..f9fba8e6 --- /dev/null +++ b/src/Bookings/Requests/SearchAvailabilityRequest.php @@ -0,0 +1,44 @@ +query = $values['query']; + } + + /** + * @return SearchAvailabilityQuery + */ + public function getQuery(): SearchAvailabilityQuery + { + return $this->query; + } + + /** + * @param SearchAvailabilityQuery $value + */ + public function setQuery(SearchAvailabilityQuery $value): self + { + $this->query = $value; + return $this; + } +} diff --git a/src/Bookings/Requests/UpdateBookingRequest.php b/src/Bookings/Requests/UpdateBookingRequest.php new file mode 100644 index 00000000..e76b01e3 --- /dev/null +++ b/src/Bookings/Requests/UpdateBookingRequest.php @@ -0,0 +1,93 @@ +bookingId = $values['bookingId']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->booking = $values['booking']; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return Booking + */ + public function getBooking(): Booking + { + return $this->booking; + } + + /** + * @param Booking $value + */ + public function setBooking(Booking $value): self + { + $this->booking = $value; + return $this; + } +} diff --git a/src/Bookings/TeamMemberProfiles/Requests/GetTeamMemberProfilesRequest.php b/src/Bookings/TeamMemberProfiles/Requests/GetTeamMemberProfilesRequest.php new file mode 100644 index 00000000..0525133f --- /dev/null +++ b/src/Bookings/TeamMemberProfiles/Requests/GetTeamMemberProfilesRequest.php @@ -0,0 +1,41 @@ +teamMemberId = $values['teamMemberId']; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } +} diff --git a/src/Bookings/TeamMemberProfiles/Requests/ListTeamMemberProfilesRequest.php b/src/Bookings/TeamMemberProfiles/Requests/ListTeamMemberProfilesRequest.php new file mode 100644 index 00000000..012c1f25 --- /dev/null +++ b/src/Bookings/TeamMemberProfiles/Requests/ListTeamMemberProfilesRequest.php @@ -0,0 +1,113 @@ +bookableOnly = $values['bookableOnly'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?bool + */ + public function getBookableOnly(): ?bool + { + return $this->bookableOnly; + } + + /** + * @param ?bool $value + */ + public function setBookableOnly(?bool $value = null): self + { + $this->bookableOnly = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php b/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php new file mode 100644 index 00000000..c0d68dae --- /dev/null +++ b/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php @@ -0,0 +1,211 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists booking profiles for team members. + * + * @param ListTeamMemberProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListTeamMemberProfilesRequest $request = new ListTeamMemberProfilesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListTeamMemberProfilesRequest $request) => $this->_list($request, $options), + setCursor: function (ListTeamMemberProfilesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListTeamMemberBookingProfilesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListTeamMemberBookingProfilesResponse $response) => $response?->getTeamMemberBookingProfiles() ?? [], + ); + } + + /** + * Retrieves a team member's booking profile. + * + * @param GetTeamMemberProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTeamMemberBookingProfileResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetTeamMemberProfilesRequest $request, ?array $options = null): GetTeamMemberBookingProfileResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/team-member-booking-profiles/{$request->getTeamMemberId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTeamMemberBookingProfileResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists booking profiles for team members. + * + * @param ListTeamMemberProfilesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListTeamMemberBookingProfilesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListTeamMemberProfilesRequest $request = new ListTeamMemberProfilesRequest(), ?array $options = null): ListTeamMemberBookingProfilesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getBookableOnly() != null) { + $query['bookable_only'] = $request->getBookableOnly(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bookings/team-member-booking-profiles", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListTeamMemberBookingProfilesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Cards/CardsClient.php b/src/Cards/CardsClient.php new file mode 100644 index 00000000..215833dc --- /dev/null +++ b/src/Cards/CardsClient.php @@ -0,0 +1,332 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves a list of cards owned by the account making the request. + * A max of 25 cards will be returned. + * + * @param ListCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCardsRequest $request = new ListCardsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCardsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCardsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCardsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCardsResponse $response) => $response?->getCards() ?? [], + ); + } + + /** + * Adds a card on file to an existing merchant. + * + * @param CreateCardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateCardRequest $request, ?array $options = null): CreateCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cards", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves details for a specific Card. + * + * @param GetCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCardsRequest $request, ?array $options = null): GetCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cards/{$request->getCardId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Disables the card, preventing any further updates or charges. + * Disabling an already disabled card is allowed but has no effect. + * + * @param DisableCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DisableCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function disable(DisableCardsRequest $request, ?array $options = null): DisableCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cards/{$request->getCardId()}/disable", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DisableCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a list of cards owned by the account making the request. + * A max of 25 cards will be returned. + * + * @param ListCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCardsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCardsRequest $request = new ListCardsRequest(), ?array $options = null): ListCardsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getCustomerId() != null) { + $query['customer_id'] = $request->getCustomerId(); + } + if ($request->getIncludeDisabled() != null) { + $query['include_disabled'] = $request->getIncludeDisabled(); + } + if ($request->getReferenceId() != null) { + $query['reference_id'] = $request->getReferenceId(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cards", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCardsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Cards/Requests/CreateCardRequest.php b/src/Cards/Requests/CreateCardRequest.php new file mode 100644 index 00000000..835af530 --- /dev/null +++ b/src/Cards/Requests/CreateCardRequest.php @@ -0,0 +1,132 @@ +idempotencyKey = $values['idempotencyKey']; + $this->sourceId = $values['sourceId']; + $this->verificationToken = $values['verificationToken'] ?? null; + $this->card = $values['card']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getSourceId(): string + { + return $this->sourceId; + } + + /** + * @param string $value + */ + public function setSourceId(string $value): self + { + $this->sourceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVerificationToken(): ?string + { + return $this->verificationToken; + } + + /** + * @param ?string $value + */ + public function setVerificationToken(?string $value = null): self + { + $this->verificationToken = $value; + return $this; + } + + /** + * @return Card + */ + public function getCard(): Card + { + return $this->card; + } + + /** + * @param Card $value + */ + public function setCard(Card $value): self + { + $this->card = $value; + return $this; + } +} diff --git a/src/Cards/Requests/DisableCardsRequest.php b/src/Cards/Requests/DisableCardsRequest.php new file mode 100644 index 00000000..a7e29f50 --- /dev/null +++ b/src/Cards/Requests/DisableCardsRequest.php @@ -0,0 +1,41 @@ +cardId = $values['cardId']; + } + + /** + * @return string + */ + public function getCardId(): string + { + return $this->cardId; + } + + /** + * @param string $value + */ + public function setCardId(string $value): self + { + $this->cardId = $value; + return $this; + } +} diff --git a/src/Cards/Requests/GetCardsRequest.php b/src/Cards/Requests/GetCardsRequest.php new file mode 100644 index 00000000..61110c87 --- /dev/null +++ b/src/Cards/Requests/GetCardsRequest.php @@ -0,0 +1,41 @@ +cardId = $values['cardId']; + } + + /** + * @return string + */ + public function getCardId(): string + { + return $this->cardId; + } + + /** + * @param string $value + */ + public function setCardId(string $value): self + { + $this->cardId = $value; + return $this; + } +} diff --git a/src/Cards/Requests/ListCardsRequest.php b/src/Cards/Requests/ListCardsRequest.php new file mode 100644 index 00000000..692747d4 --- /dev/null +++ b/src/Cards/Requests/ListCardsRequest.php @@ -0,0 +1,152 @@ + $sortOrder + */ + private ?string $sortOrder; + + /** + * @param array{ + * cursor?: ?string, + * customerId?: ?string, + * includeDisabled?: ?bool, + * referenceId?: ?string, + * sortOrder?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->includeDisabled = $values['includeDisabled'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeDisabled(): ?bool + { + return $this->includeDisabled; + } + + /** + * @param ?bool $value + */ + public function setIncludeDisabled(?bool $value = null): self + { + $this->includeDisabled = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } +} diff --git a/src/CashDrawers/CashDrawersClient.php b/src/CashDrawers/CashDrawersClient.php new file mode 100644 index 00000000..f1e06b41 --- /dev/null +++ b/src/CashDrawers/CashDrawersClient.php @@ -0,0 +1,50 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->shifts = new ShiftsClient($this->client, $this->options); + } +} diff --git a/src/CashDrawers/Shifts/Requests/GetShiftsRequest.php b/src/CashDrawers/Shifts/Requests/GetShiftsRequest.php new file mode 100644 index 00000000..104cd72e --- /dev/null +++ b/src/CashDrawers/Shifts/Requests/GetShiftsRequest.php @@ -0,0 +1,65 @@ +shiftId = $values['shiftId']; + $this->locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getShiftId(): string + { + return $this->shiftId; + } + + /** + * @param string $value + */ + public function setShiftId(string $value): self + { + $this->shiftId = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/CashDrawers/Shifts/Requests/ListEventsShiftsRequest.php b/src/CashDrawers/Shifts/Requests/ListEventsShiftsRequest.php new file mode 100644 index 00000000..1b971e0d --- /dev/null +++ b/src/CashDrawers/Shifts/Requests/ListEventsShiftsRequest.php @@ -0,0 +1,116 @@ +shiftId = $values['shiftId']; + $this->locationId = $values['locationId']; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getShiftId(): string + { + return $this->shiftId; + } + + /** + * @param string $value + */ + public function setShiftId(string $value): self + { + $this->shiftId = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/CashDrawers/Shifts/Requests/ListShiftsRequest.php b/src/CashDrawers/Shifts/Requests/ListShiftsRequest.php new file mode 100644 index 00000000..6d37a85d --- /dev/null +++ b/src/CashDrawers/Shifts/Requests/ListShiftsRequest.php @@ -0,0 +1,168 @@ + $sortOrder + */ + private ?string $sortOrder; + + /** + * @var ?string $beginTime The inclusive start time of the query on opened_at, in ISO 8601 format. + */ + private ?string $beginTime; + + /** + * @var ?string $endTime The exclusive end date of the query on opened_at, in ISO 8601 format. + */ + private ?string $endTime; + + /** + * Number of cash drawer shift events in a page of results (200 by + * default, 1000 max). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @var ?string $cursor Opaque cursor for fetching the next page of results. + */ + private ?string $cursor; + + /** + * @param array{ + * locationId: string, + * sortOrder?: ?value-of, + * beginTime?: ?string, + * endTime?: ?string, + * limit?: ?int, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/CashDrawers/Shifts/ShiftsClient.php b/src/CashDrawers/Shifts/ShiftsClient.php new file mode 100644 index 00000000..ea978aa6 --- /dev/null +++ b/src/CashDrawers/Shifts/ShiftsClient.php @@ -0,0 +1,317 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Provides the details for all of the cash drawer shifts for a location + * in a date range. + * + * @param ListShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListShiftsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListShiftsRequest $request) => $this->_list($request, $options), + setCursor: function (ListShiftsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCashDrawerShiftsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCashDrawerShiftsResponse $response) => $response?->getCashDrawerShifts() ?? [], + ); + } + + /** + * Provides the summary details for a single cash drawer shift. See + * [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events. + * + * @param GetShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCashDrawerShiftResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetShiftsRequest $request, ?array $options = null): GetCashDrawerShiftResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + $query['location_id'] = $request->getLocationId(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cash-drawers/shifts/{$request->getShiftId()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCashDrawerShiftResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Provides a paginated list of events for a single cash drawer shift. + * + * @param ListEventsShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function listEvents(ListEventsShiftsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEventsShiftsRequest $request) => $this->_listEvents($request, $options), + setCursor: function (ListEventsShiftsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCashDrawerShiftEventsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCashDrawerShiftEventsResponse $response) => $response?->getCashDrawerShiftEvents() ?? [], + ); + } + + /** + * Provides the details for all of the cash drawer shifts for a location + * in a date range. + * + * @param ListShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCashDrawerShiftsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListShiftsRequest $request, ?array $options = null): ListCashDrawerShiftsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + $query['location_id'] = $request->getLocationId(); + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cash-drawers/shifts", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCashDrawerShiftsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Provides a paginated list of events for a single cash drawer shift. + * + * @param ListEventsShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCashDrawerShiftEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _listEvents(ListEventsShiftsRequest $request, ?array $options = null): ListCashDrawerShiftEventsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + $query['location_id'] = $request->getLocationId(); + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/cash-drawers/shifts/{$request->getShiftId()}/events", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCashDrawerShiftEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Catalog/CatalogClient.php b/src/Catalog/CatalogClient.php new file mode 100644 index 00000000..68119489 --- /dev/null +++ b/src/Catalog/CatalogClient.php @@ -0,0 +1,693 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->images = new ImagesClient($this->client, $this->options); + $this->object = new ObjectClient($this->client, $this->options); + } + + /** + * Deletes a set of [CatalogItem](entity:CatalogItem)s based on the + * provided list of target IDs and returns a set of successfully deleted IDs in + * the response. Deletion is a cascading event such that all children of the + * targeted object are also deleted. For example, deleting a CatalogItem will + * also delete all of its [CatalogItemVariation](entity:CatalogItemVariation) + * children. + * + * `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted + * IDs can be deleted. The response will only include IDs that were + * actually deleted. + * + * To ensure consistency, only one delete request is processed at a time per seller account. + * While one (batch or non-batch) delete request is being processed, other (batched and non-batched) + * delete requests are rejected with the `429` error code. + * + * @param BatchDeleteCatalogObjectsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchDeleteCatalogObjectsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchDelete(BatchDeleteCatalogObjectsRequest $request = new BatchDeleteCatalogObjectsRequest(), ?array $options = null): BatchDeleteCatalogObjectsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/batch-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchDeleteCatalogObjectsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a set of objects based on the provided ID. + * Each [CatalogItem](entity:CatalogItem) returned in the set includes all of its + * child information including: all of its + * [CatalogItemVariation](entity:CatalogItemVariation) objects, references to + * its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of + * any [CatalogTax](entity:CatalogTax) objects that apply to it. + * + * @param BatchGetCatalogObjectsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetCatalogObjectsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchGet(BatchGetCatalogObjectsRequest $request, ?array $options = null): BatchGetCatalogObjectsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/batch-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetCatalogObjectsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates up to 10,000 target objects based on the provided + * list of objects. The target objects are grouped into batches and each batch is + * inserted/updated in an all-or-nothing manner. If an object within a batch is + * malformed in some way, or violates a database constraint, the entire batch + * containing that item will be disregarded. However, other batches in the same + * request may still succeed. Each batch may contain up to 1,000 objects, and + * batches will be processed in order as long as the total object count for the + * request (items, variations, modifier lists, discounts, and taxes) is no more + * than 10,000. + * + * To ensure consistency, only one update request is processed at a time per seller account. + * While one (batch or non-batch) update request is being processed, other (batched and non-batched) + * update requests are rejected with the `429` error code. + * + * @param BatchUpsertCatalogObjectsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchUpsertCatalogObjectsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BatchUpsertCatalogObjectsRequest $request, ?array $options = null): BatchUpsertCatalogObjectsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/batch-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchUpsertCatalogObjectsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves information about the Square Catalog API, such as batch size + * limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CatalogInfoResponse + * @throws SquareException + * @throws SquareApiException + */ + public function info(?array $options = null): CatalogInfoResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/info", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CatalogInfoResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. + * + * The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, + * for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". + * + * __Important:__ ListCatalog does not return deleted catalog items. To retrieve + * deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + * and set the `include_deleted_objects` attribute value to `true`. + * + * @param ListCatalogRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCatalogRequest $request = new ListCatalogRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCatalogRequest $request) => $this->_list($request, $options), + setCursor: function (ListCatalogRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCatalogResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCatalogResponse $response) => $response?->getObjects() ?? [], + ); + } + + /** + * Searches for [CatalogObject](entity:CatalogObject) of any type by matching supported search attribute values, + * excluding custom attribute values on items or item variations, against one or more of the specified query filters. + * + * This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + * endpoint in the following aspects: + * + * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. + * - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. + * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. + * - The both endpoints have different call conventions, including the query filter formats. + * + * @param SearchCatalogObjectsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchCatalogObjectsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchCatalogObjectsRequest $request = new SearchCatalogObjectsRequest(), ?array $options = null): SearchCatalogObjectsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchCatalogObjectsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for catalog items or item variations by matching supported search attribute values, including + * custom attribute values, against one or more of the specified query filters. + * + * This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + * endpoint in the following aspects: + * + * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. + * - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. + * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. + * - The both endpoints use different call conventions, including the query filter formats. + * + * @param SearchCatalogItemsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchCatalogItemsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function searchItems(SearchCatalogItemsRequest $request = new SearchCatalogItemsRequest(), ?array $options = null): SearchCatalogItemsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/search-catalog-items", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchCatalogItemsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the [CatalogModifierList](entity:CatalogModifierList) objects + * that apply to the targeted [CatalogItem](entity:CatalogItem) without having + * to perform an upsert on the entire item. + * + * @param UpdateItemModifierListsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateItemModifierListsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateItemModifierLists(UpdateItemModifierListsRequest $request, ?array $options = null): UpdateItemModifierListsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/update-item-modifier-lists", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateItemModifierListsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the [CatalogTax](entity:CatalogTax) objects that apply to the + * targeted [CatalogItem](entity:CatalogItem) without having to perform an + * upsert on the entire item. + * + * @param UpdateItemTaxesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateItemTaxesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateItemTaxes(UpdateItemTaxesRequest $request, ?array $options = null): UpdateItemTaxesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/update-item-taxes", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateItemTaxesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. + * + * The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, + * for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". + * + * __Important:__ ListCatalog does not return deleted catalog items. To retrieve + * deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + * and set the `include_deleted_objects` attribute value to `true`. + * + * @param ListCatalogRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCatalogResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCatalogRequest $request = new ListCatalogRequest(), ?array $options = null): ListCatalogResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getTypes() != null) { + $query['types'] = $request->getTypes(); + } + if ($request->getCatalogVersion() != null) { + $query['catalog_version'] = $request->getCatalogVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/list", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCatalogResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Catalog/Images/ImagesClient.php b/src/Catalog/Images/ImagesClient.php new file mode 100644 index 00000000..298fc491 --- /dev/null +++ b/src/Catalog/Images/ImagesClient.php @@ -0,0 +1,206 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Uploads an image file to be represented by a [CatalogImage](entity:CatalogImage) object that can be linked to an existing + * [CatalogObject](entity:CatalogObject) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id` + * is not specified. + * + * This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in + * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + * + * @param CreateImagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * } $options + * @return CreateCatalogImageResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateImagesRequest $request = new CreateImagesRequest(), ?array $options = null): CreateCatalogImageResponse + { + $options = array_merge($this->options, $options ?? []); + $body = new MultipartFormData(); + if ($request->getRequest() != null) { + $body->add( + name: 'request', + value: $request->getRequest()->toJson(), + contentType: 'application/json; charset=utf-8', + ); + } + if ($request->getImageFile() != null) { + $body->addPart( + $request->getImageFile()->toMultipartFormDataPart( + name: 'image_file', + contentType: 'image/jpeg', + ), + ); + } + try { + $response = $this->client->sendRequest( + new MultipartApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/images", + method: HttpMethod::POST, + body: $body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCatalogImageResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Uploads a new image file to replace the existing one in the specified [CatalogImage](entity:CatalogImage) object. + * + * This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in + * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + * + * @param UpdateImagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * } $options + * @return UpdateCatalogImageResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateImagesRequest $request, ?array $options = null): UpdateCatalogImageResponse + { + $options = array_merge($this->options, $options ?? []); + $body = new MultipartFormData(); + if ($request->getRequest() != null) { + $body->add( + name: 'request', + value: $request->getRequest()->toJson(), + contentType: 'application/json; charset=utf-8', + ); + } + if ($request->getImageFile() != null) { + $body->addPart( + $request->getImageFile()->toMultipartFormDataPart( + name: 'image_file', + contentType: 'image/jpeg', + ), + ); + } + try { + $response = $this->client->sendRequest( + new MultipartApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/images/{$request->getImageId()}", + method: HttpMethod::PUT, + body: $body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateCatalogImageResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Catalog/Images/Requests/CreateImagesRequest.php b/src/Catalog/Images/Requests/CreateImagesRequest.php new file mode 100644 index 00000000..aeb0fe2f --- /dev/null +++ b/src/Catalog/Images/Requests/CreateImagesRequest.php @@ -0,0 +1,69 @@ +request = $values['request'] ?? null; + $this->imageFile = $values['imageFile'] ?? null; + } + + /** + * @return ?CreateCatalogImageRequest + */ + public function getRequest(): ?CreateCatalogImageRequest + { + return $this->request; + } + + /** + * @param ?CreateCatalogImageRequest $value + */ + public function setRequest(?CreateCatalogImageRequest $value = null): self + { + $this->request = $value; + return $this; + } + + /** + * @return ?File + */ + public function getImageFile(): ?File + { + return $this->imageFile; + } + + /** + * @param ?File $value + */ + public function setImageFile(?File $value = null): self + { + $this->imageFile = $value; + return $this; + } +} diff --git a/src/Catalog/Images/Requests/UpdateImagesRequest.php b/src/Catalog/Images/Requests/UpdateImagesRequest.php new file mode 100644 index 00000000..7fc31bbf --- /dev/null +++ b/src/Catalog/Images/Requests/UpdateImagesRequest.php @@ -0,0 +1,93 @@ +imageId = $values['imageId']; + $this->request = $values['request'] ?? null; + $this->imageFile = $values['imageFile'] ?? null; + } + + /** + * @return string + */ + public function getImageId(): string + { + return $this->imageId; + } + + /** + * @param string $value + */ + public function setImageId(string $value): self + { + $this->imageId = $value; + return $this; + } + + /** + * @return ?UpdateCatalogImageRequest + */ + public function getRequest(): ?UpdateCatalogImageRequest + { + return $this->request; + } + + /** + * @param ?UpdateCatalogImageRequest $value + */ + public function setRequest(?UpdateCatalogImageRequest $value = null): self + { + $this->request = $value; + return $this; + } + + /** + * @return ?File + */ + public function getImageFile(): ?File + { + return $this->imageFile; + } + + /** + * @param ?File $value + */ + public function setImageFile(?File $value = null): self + { + $this->imageFile = $value; + return $this; + } +} diff --git a/src/Catalog/Object/ObjectClient.php b/src/Catalog/Object/ObjectClient.php new file mode 100644 index 00000000..0404225b --- /dev/null +++ b/src/Catalog/Object/ObjectClient.php @@ -0,0 +1,253 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a new or updates the specified [CatalogObject](entity:CatalogObject). + * + * To ensure consistency, only one update request is processed at a time per seller account. + * While one (batch or non-batch) update request is being processed, other (batched and non-batched) + * update requests are rejected with the `429` error code. + * + * @param UpsertCatalogObjectRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertCatalogObjectResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertCatalogObjectRequest $request, ?array $options = null): UpsertCatalogObjectResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/object", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertCatalogObjectResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a single [CatalogItem](entity:CatalogItem) as a + * [CatalogObject](entity:CatalogObject) based on the provided ID. The returned + * object includes all of the relevant [CatalogItem](entity:CatalogItem) + * information including: [CatalogItemVariation](entity:CatalogItemVariation) + * children, references to its + * [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of + * any [CatalogTax](entity:CatalogTax) objects that apply to it. + * + * @param GetObjectRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCatalogObjectResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetObjectRequest $request, ?array $options = null): GetCatalogObjectResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getIncludeRelatedObjects() != null) { + $query['include_related_objects'] = $request->getIncludeRelatedObjects(); + } + if ($request->getCatalogVersion() != null) { + $query['catalog_version'] = $request->getCatalogVersion(); + } + if ($request->getIncludeCategoryPathToRoot() != null) { + $query['include_category_path_to_root'] = $request->getIncludeCategoryPathToRoot(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/object/{$request->getObjectId()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCatalogObjectResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a single [CatalogObject](entity:CatalogObject) based on the + * provided ID and returns the set of successfully deleted IDs in the response. + * Deletion is a cascading event such that all children of the targeted object + * are also deleted. For example, deleting a [CatalogItem](entity:CatalogItem) + * will also delete all of its + * [CatalogItemVariation](entity:CatalogItemVariation) children. + * + * To ensure consistency, only one delete request is processed at a time per seller account. + * While one (batch or non-batch) delete request is being processed, other (batched and non-batched) + * delete requests are rejected with the `429` error code. + * + * @param DeleteObjectRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCatalogObjectResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteObjectRequest $request, ?array $options = null): DeleteCatalogObjectResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/catalog/object/{$request->getObjectId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCatalogObjectResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Catalog/Object/Requests/DeleteObjectRequest.php b/src/Catalog/Object/Requests/DeleteObjectRequest.php new file mode 100644 index 00000000..e3ad07ad --- /dev/null +++ b/src/Catalog/Object/Requests/DeleteObjectRequest.php @@ -0,0 +1,45 @@ +objectId = $values['objectId']; + } + + /** + * @return string + */ + public function getObjectId(): string + { + return $this->objectId; + } + + /** + * @param string $value + */ + public function setObjectId(string $value): self + { + $this->objectId = $value; + return $this; + } +} diff --git a/src/Catalog/Object/Requests/GetObjectRequest.php b/src/Catalog/Object/Requests/GetObjectRequest.php new file mode 100644 index 00000000..2378bde1 --- /dev/null +++ b/src/Catalog/Object/Requests/GetObjectRequest.php @@ -0,0 +1,138 @@ +objectId = $values['objectId']; + $this->includeRelatedObjects = $values['includeRelatedObjects'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->includeCategoryPathToRoot = $values['includeCategoryPathToRoot'] ?? null; + } + + /** + * @return string + */ + public function getObjectId(): string + { + return $this->objectId; + } + + /** + * @param string $value + */ + public function setObjectId(string $value): self + { + $this->objectId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeRelatedObjects(): ?bool + { + return $this->includeRelatedObjects; + } + + /** + * @param ?bool $value + */ + public function setIncludeRelatedObjects(?bool $value = null): self + { + $this->includeRelatedObjects = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeCategoryPathToRoot(): ?bool + { + return $this->includeCategoryPathToRoot; + } + + /** + * @param ?bool $value + */ + public function setIncludeCategoryPathToRoot(?bool $value = null): self + { + $this->includeCategoryPathToRoot = $value; + return $this; + } +} diff --git a/src/Catalog/Object/Requests/UpsertCatalogObjectRequest.php b/src/Catalog/Object/Requests/UpsertCatalogObjectRequest.php new file mode 100644 index 00000000..7cacb706 --- /dev/null +++ b/src/Catalog/Object/Requests/UpsertCatalogObjectRequest.php @@ -0,0 +1,85 @@ +idempotencyKey = $values['idempotencyKey']; + $this->object = $values['object']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return CatalogObject + */ + public function getObject(): CatalogObject + { + return $this->object; + } + + /** + * @param CatalogObject $value + */ + public function setObject(CatalogObject $value): self + { + $this->object = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/BatchDeleteCatalogObjectsRequest.php b/src/Catalog/Requests/BatchDeleteCatalogObjectsRequest.php new file mode 100644 index 00000000..36f0eb41 --- /dev/null +++ b/src/Catalog/Requests/BatchDeleteCatalogObjectsRequest.php @@ -0,0 +1,48 @@ + $objectIds + */ + #[JsonProperty('object_ids'), ArrayType(['string'])] + private ?array $objectIds; + + /** + * @param array{ + * objectIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->objectIds = $values['objectIds'] ?? null; + } + + /** + * @return ?array + */ + public function getObjectIds(): ?array + { + return $this->objectIds; + } + + /** + * @param ?array $value + */ + public function setObjectIds(?array $value = null): self + { + $this->objectIds = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/BatchGetCatalogObjectsRequest.php b/src/Catalog/Requests/BatchGetCatalogObjectsRequest.php new file mode 100644 index 00000000..f20be120 --- /dev/null +++ b/src/Catalog/Requests/BatchGetCatalogObjectsRequest.php @@ -0,0 +1,169 @@ + $objectIds The IDs of the CatalogObjects to be retrieved. + */ + #[JsonProperty('object_ids'), ArrayType(['string'])] + private array $objectIds; + + /** + * If `true`, the response will include additional objects that are related to the + * requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field + * of the response. These objects are put in the `related_objects` field. Setting this to `true` is + * helpful when the objects are needed for immediate display to a user. + * This process only goes one level deep. Objects referenced by the related objects will not be included. For example, + * + * if the `objects` field of the response contains a CatalogItem, its associated + * CatalogCategory objects, CatalogTax objects, CatalogImage objects and + * CatalogModifierLists will be returned in the `related_objects` field of the + * response. If the `objects` field of the response contains a CatalogItemVariation, + * its parent CatalogItem will be returned in the `related_objects` field of + * the response. + * + * Default value: `false` + * + * @var ?bool $includeRelatedObjects + */ + #[JsonProperty('include_related_objects')] + private ?bool $includeRelatedObjects; + + /** + * The specific version of the catalog objects to be included in the response. + * This allows you to retrieve historical versions of objects. The specified version value is matched against + * the [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will + * be from the current version of the catalog. + * + * @var ?int $catalogVersion + */ + #[JsonProperty('catalog_version')] + private ?int $catalogVersion; + + /** + * @var ?bool $includeDeletedObjects Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. + */ + #[JsonProperty('include_deleted_objects')] + private ?bool $includeDeletedObjects; + + /** + * Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists + * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category + * and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned + * in the response payload. + * + * @var ?bool $includeCategoryPathToRoot + */ + #[JsonProperty('include_category_path_to_root')] + private ?bool $includeCategoryPathToRoot; + + /** + * @param array{ + * objectIds: array, + * includeRelatedObjects?: ?bool, + * catalogVersion?: ?int, + * includeDeletedObjects?: ?bool, + * includeCategoryPathToRoot?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->objectIds = $values['objectIds']; + $this->includeRelatedObjects = $values['includeRelatedObjects'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->includeDeletedObjects = $values['includeDeletedObjects'] ?? null; + $this->includeCategoryPathToRoot = $values['includeCategoryPathToRoot'] ?? null; + } + + /** + * @return array + */ + public function getObjectIds(): array + { + return $this->objectIds; + } + + /** + * @param array $value + */ + public function setObjectIds(array $value): self + { + $this->objectIds = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeRelatedObjects(): ?bool + { + return $this->includeRelatedObjects; + } + + /** + * @param ?bool $value + */ + public function setIncludeRelatedObjects(?bool $value = null): self + { + $this->includeRelatedObjects = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeDeletedObjects(): ?bool + { + return $this->includeDeletedObjects; + } + + /** + * @param ?bool $value + */ + public function setIncludeDeletedObjects(?bool $value = null): self + { + $this->includeDeletedObjects = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeCategoryPathToRoot(): ?bool + { + return $this->includeCategoryPathToRoot; + } + + /** + * @param ?bool $value + */ + public function setIncludeCategoryPathToRoot(?bool $value = null): self + { + $this->includeCategoryPathToRoot = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/BatchUpsertCatalogObjectsRequest.php b/src/Catalog/Requests/BatchUpsertCatalogObjectsRequest.php new file mode 100644 index 00000000..91c534c1 --- /dev/null +++ b/src/Catalog/Requests/BatchUpsertCatalogObjectsRequest.php @@ -0,0 +1,102 @@ + $batches + */ + #[JsonProperty('batches'), ArrayType([CatalogObjectBatch::class])] + private array $batches; + + /** + * @param array{ + * idempotencyKey: string, + * batches: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->idempotencyKey = $values['idempotencyKey']; + $this->batches = $values['batches']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return array + */ + public function getBatches(): array + { + return $this->batches; + } + + /** + * @param array $value + */ + public function setBatches(array $value): self + { + $this->batches = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/ListCatalogRequest.php b/src/Catalog/Requests/ListCatalogRequest.php new file mode 100644 index 00000000..7fe365b8 --- /dev/null +++ b/src/Catalog/Requests/ListCatalogRequest.php @@ -0,0 +1,113 @@ +cursor = $values['cursor'] ?? null; + $this->types = $values['types'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTypes(): ?string + { + return $this->types; + } + + /** + * @param ?string $value + */ + public function setTypes(?string $value = null): self + { + $this->types = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/SearchCatalogItemsRequest.php b/src/Catalog/Requests/SearchCatalogItemsRequest.php new file mode 100644 index 00000000..2b827e21 --- /dev/null +++ b/src/Catalog/Requests/SearchCatalogItemsRequest.php @@ -0,0 +1,288 @@ + $categoryIds The category id query expression to return items containing the specified category IDs. + */ + #[JsonProperty('category_ids'), ArrayType(['string'])] + private ?array $categoryIds; + + /** + * The stock-level query expression to return item variations with the specified stock levels. + * See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values + * + * @var ?array> $stockLevels + */ + #[JsonProperty('stock_levels'), ArrayType(['string'])] + private ?array $stockLevels; + + /** + * @var ?array $enabledLocationIds The enabled-location query expression to return items and item variations having specified enabled locations. + */ + #[JsonProperty('enabled_location_ids'), ArrayType(['string'])] + private ?array $enabledLocationIds; + + /** + * @var ?string $cursor The pagination token, returned in the previous response, used to fetch the next batch of pending results. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?int $limit The maximum number of results to return per page. The default value is 100. + */ + #[JsonProperty('limit')] + private ?int $limit; + + /** + * The order to sort the results by item names. The default sort order is ascending (`ASC`). + * See [SortOrder](#type-sortorder) for possible values + * + * @var ?value-of $sortOrder + */ + #[JsonProperty('sort_order')] + private ?string $sortOrder; + + /** + * @var ?array> $productTypes The product types query expression to return items or item variations having the specified product types. + */ + #[JsonProperty('product_types'), ArrayType(['string'])] + private ?array $productTypes; + + /** + * The customer-attribute filter to return items or item variations matching the specified + * custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in + * a single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. + * + * @var ?array $customAttributeFilters + */ + #[JsonProperty('custom_attribute_filters'), ArrayType([CustomAttributeFilter::class])] + private ?array $customAttributeFilters; + + /** + * @var ?value-of $archivedState The query filter to return not archived (`ARCHIVED_STATE_NOT_ARCHIVED`), archived (`ARCHIVED_STATE_ARCHIVED`), or either type (`ARCHIVED_STATE_ALL`) of items. + */ + #[JsonProperty('archived_state')] + private ?string $archivedState; + + /** + * @param array{ + * textFilter?: ?string, + * categoryIds?: ?array, + * stockLevels?: ?array>, + * enabledLocationIds?: ?array, + * cursor?: ?string, + * limit?: ?int, + * sortOrder?: ?value-of, + * productTypes?: ?array>, + * customAttributeFilters?: ?array, + * archivedState?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->textFilter = $values['textFilter'] ?? null; + $this->categoryIds = $values['categoryIds'] ?? null; + $this->stockLevels = $values['stockLevels'] ?? null; + $this->enabledLocationIds = $values['enabledLocationIds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->productTypes = $values['productTypes'] ?? null; + $this->customAttributeFilters = $values['customAttributeFilters'] ?? null; + $this->archivedState = $values['archivedState'] ?? null; + } + + /** + * @return ?string + */ + public function getTextFilter(): ?string + { + return $this->textFilter; + } + + /** + * @param ?string $value + */ + public function setTextFilter(?string $value = null): self + { + $this->textFilter = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCategoryIds(): ?array + { + return $this->categoryIds; + } + + /** + * @param ?array $value + */ + public function setCategoryIds(?array $value = null): self + { + $this->categoryIds = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getStockLevels(): ?array + { + return $this->stockLevels; + } + + /** + * @param ?array> $value + */ + public function setStockLevels(?array $value = null): self + { + $this->stockLevels = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEnabledLocationIds(): ?array + { + return $this->enabledLocationIds; + } + + /** + * @param ?array $value + */ + public function setEnabledLocationIds(?array $value = null): self + { + $this->enabledLocationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getProductTypes(): ?array + { + return $this->productTypes; + } + + /** + * @param ?array> $value + */ + public function setProductTypes(?array $value = null): self + { + $this->productTypes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomAttributeFilters(): ?array + { + return $this->customAttributeFilters; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeFilters(?array $value = null): self + { + $this->customAttributeFilters = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getArchivedState(): ?string + { + return $this->archivedState; + } + + /** + * @param ?value-of $value + */ + public function setArchivedState(?string $value = null): self + { + $this->archivedState = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/SearchCatalogObjectsRequest.php b/src/Catalog/Requests/SearchCatalogObjectsRequest.php new file mode 100644 index 00000000..7ad892fb --- /dev/null +++ b/src/Catalog/Requests/SearchCatalogObjectsRequest.php @@ -0,0 +1,262 @@ +> $objectTypes + */ + #[JsonProperty('object_types'), ArrayType(['string'])] + private ?array $objectTypes; + + /** + * @var ?bool $includeDeletedObjects If `true`, deleted objects will be included in the results. Defaults to `false`. Deleted objects will have their `is_deleted` field set to `true`. If `include_deleted_objects` is `true`, then the `include_category_path_to_root` request parameter must be `false`. Both properties cannot be `true` at the same time. + */ + #[JsonProperty('include_deleted_objects')] + private ?bool $includeDeletedObjects; + + /** + * If `true`, the response will include additional objects that are related to the + * requested objects. Related objects are objects that are referenced by object ID by the objects + * in the response. This is helpful if the objects are being fetched for immediate display to a user. + * This process only goes one level deep. Objects referenced by the related objects will not be included. + * For example: + * + * If the `objects` field of the response contains a CatalogItem, its associated + * CatalogCategory objects, CatalogTax objects, CatalogImage objects and + * CatalogModifierLists will be returned in the `related_objects` field of the + * response. If the `objects` field of the response contains a CatalogItemVariation, + * its parent CatalogItem will be returned in the `related_objects` field of + * the response. + * + * Default value: `false` + * + * @var ?bool $includeRelatedObjects + */ + #[JsonProperty('include_related_objects')] + private ?bool $includeRelatedObjects; + + /** + * Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339 + * format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a + * timestamp equal to `begin_time` will not be included in the response. + * + * @var ?string $beginTime + */ + #[JsonProperty('begin_time')] + private ?string $beginTime; + + /** + * @var ?CatalogQuery $query A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned. + */ + #[JsonProperty('query')] + private ?CatalogQuery $query; + + /** + * A limit on the number of results to be returned in a single page. The limit is advisory - + * the implementation may return more or fewer results. If the supplied limit is negative, zero, or + * is higher than the maximum limit of 1,000, it will be ignored. + * + * @var ?int $limit + */ + #[JsonProperty('limit')] + private ?int $limit; + + /** + * @var ?bool $includeCategoryPathToRoot Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned in the response payload. If `include_category_path_to_root` is `true`, then the `include_deleted_objects` request parameter must be `false`. Both properties cannot be `true` at the same time. + */ + #[JsonProperty('include_category_path_to_root')] + private ?bool $includeCategoryPathToRoot; + + /** + * @param array{ + * cursor?: ?string, + * objectTypes?: ?array>, + * includeDeletedObjects?: ?bool, + * includeRelatedObjects?: ?bool, + * beginTime?: ?string, + * query?: ?CatalogQuery, + * limit?: ?int, + * includeCategoryPathToRoot?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->objectTypes = $values['objectTypes'] ?? null; + $this->includeDeletedObjects = $values['includeDeletedObjects'] ?? null; + $this->includeRelatedObjects = $values['includeRelatedObjects'] ?? null; + $this->beginTime = $values['beginTime'] ?? null; + $this->query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->includeCategoryPathToRoot = $values['includeCategoryPathToRoot'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getObjectTypes(): ?array + { + return $this->objectTypes; + } + + /** + * @param ?array> $value + */ + public function setObjectTypes(?array $value = null): self + { + $this->objectTypes = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeDeletedObjects(): ?bool + { + return $this->includeDeletedObjects; + } + + /** + * @param ?bool $value + */ + public function setIncludeDeletedObjects(?bool $value = null): self + { + $this->includeDeletedObjects = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeRelatedObjects(): ?bool + { + return $this->includeRelatedObjects; + } + + /** + * @param ?bool $value + */ + public function setIncludeRelatedObjects(?bool $value = null): self + { + $this->includeRelatedObjects = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?CatalogQuery + */ + public function getQuery(): ?CatalogQuery + { + return $this->query; + } + + /** + * @param ?CatalogQuery $value + */ + public function setQuery(?CatalogQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeCategoryPathToRoot(): ?bool + { + return $this->includeCategoryPathToRoot; + } + + /** + * @param ?bool $value + */ + public function setIncludeCategoryPathToRoot(?bool $value = null): self + { + $this->includeCategoryPathToRoot = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/UpdateItemModifierListsRequest.php b/src/Catalog/Requests/UpdateItemModifierListsRequest.php new file mode 100644 index 00000000..39aaaeb0 --- /dev/null +++ b/src/Catalog/Requests/UpdateItemModifierListsRequest.php @@ -0,0 +1,100 @@ + $itemIds The IDs of the catalog items associated with the CatalogModifierList objects being updated. + */ + #[JsonProperty('item_ids'), ArrayType(['string'])] + private array $itemIds; + + /** + * The IDs of the CatalogModifierList objects to enable for the CatalogItem. + * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. + * + * @var ?array $modifierListsToEnable + */ + #[JsonProperty('modifier_lists_to_enable'), ArrayType(['string'])] + private ?array $modifierListsToEnable; + + /** + * The IDs of the CatalogModifierList objects to disable for the CatalogItem. + * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. + * + * @var ?array $modifierListsToDisable + */ + #[JsonProperty('modifier_lists_to_disable'), ArrayType(['string'])] + private ?array $modifierListsToDisable; + + /** + * @param array{ + * itemIds: array, + * modifierListsToEnable?: ?array, + * modifierListsToDisable?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->itemIds = $values['itemIds']; + $this->modifierListsToEnable = $values['modifierListsToEnable'] ?? null; + $this->modifierListsToDisable = $values['modifierListsToDisable'] ?? null; + } + + /** + * @return array + */ + public function getItemIds(): array + { + return $this->itemIds; + } + + /** + * @param array $value + */ + public function setItemIds(array $value): self + { + $this->itemIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifierListsToEnable(): ?array + { + return $this->modifierListsToEnable; + } + + /** + * @param ?array $value + */ + public function setModifierListsToEnable(?array $value = null): self + { + $this->modifierListsToEnable = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifierListsToDisable(): ?array + { + return $this->modifierListsToDisable; + } + + /** + * @param ?array $value + */ + public function setModifierListsToDisable(?array $value = null): self + { + $this->modifierListsToDisable = $value; + return $this; + } +} diff --git a/src/Catalog/Requests/UpdateItemTaxesRequest.php b/src/Catalog/Requests/UpdateItemTaxesRequest.php new file mode 100644 index 00000000..d5227420 --- /dev/null +++ b/src/Catalog/Requests/UpdateItemTaxesRequest.php @@ -0,0 +1,103 @@ + $itemIds + */ + #[JsonProperty('item_ids'), ArrayType(['string'])] + private array $itemIds; + + /** + * IDs of the CatalogTax objects to enable. + * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. + * + * @var ?array $taxesToEnable + */ + #[JsonProperty('taxes_to_enable'), ArrayType(['string'])] + private ?array $taxesToEnable; + + /** + * IDs of the CatalogTax objects to disable. + * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. + * + * @var ?array $taxesToDisable + */ + #[JsonProperty('taxes_to_disable'), ArrayType(['string'])] + private ?array $taxesToDisable; + + /** + * @param array{ + * itemIds: array, + * taxesToEnable?: ?array, + * taxesToDisable?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->itemIds = $values['itemIds']; + $this->taxesToEnable = $values['taxesToEnable'] ?? null; + $this->taxesToDisable = $values['taxesToDisable'] ?? null; + } + + /** + * @return array + */ + public function getItemIds(): array + { + return $this->itemIds; + } + + /** + * @param array $value + */ + public function setItemIds(array $value): self + { + $this->itemIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTaxesToEnable(): ?array + { + return $this->taxesToEnable; + } + + /** + * @param ?array $value + */ + public function setTaxesToEnable(?array $value = null): self + { + $this->taxesToEnable = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTaxesToDisable(): ?array + { + return $this->taxesToDisable; + } + + /** + * @param ?array $value + */ + public function setTaxesToDisable(?array $value = null): self + { + $this->taxesToDisable = $value; + return $this; + } +} diff --git a/src/Checkout/CheckoutClient.php b/src/Checkout/CheckoutClient.php new file mode 100644 index 00000000..b99e3576 --- /dev/null +++ b/src/Checkout/CheckoutClient.php @@ -0,0 +1,286 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->paymentLinks = new PaymentLinksClient($this->client, $this->options); + } + + /** + * Retrieves the location-level settings for a Square-hosted checkout page. + * + * @param RetrieveLocationSettingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveLocationSettingsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function retrieveLocationSettings(RetrieveLocationSettingsRequest $request, ?array $options = null): RetrieveLocationSettingsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/location-settings/{$request->getLocationId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveLocationSettingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the location-level settings for a Square-hosted checkout page. + * + * @param UpdateLocationSettingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateLocationSettingsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateLocationSettings(UpdateLocationSettingsRequest $request, ?array $options = null): UpdateLocationSettingsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/location-settings/{$request->getLocationId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateLocationSettingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the merchant-level settings for a Square-hosted checkout page. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveMerchantSettingsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function retrieveMerchantSettings(?array $options = null): RetrieveMerchantSettingsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/merchant-settings", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveMerchantSettingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the merchant-level settings for a Square-hosted checkout page. + * + * @param UpdateMerchantSettingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateMerchantSettingsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateMerchantSettings(UpdateMerchantSettingsRequest $request, ?array $options = null): UpdateMerchantSettingsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/merchant-settings", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateMerchantSettingsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Checkout/PaymentLinks/PaymentLinksClient.php b/src/Checkout/PaymentLinks/PaymentLinksClient.php new file mode 100644 index 00000000..e584ab17 --- /dev/null +++ b/src/Checkout/PaymentLinks/PaymentLinksClient.php @@ -0,0 +1,380 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists all payment links. + * + * @param ListPaymentLinksRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListPaymentLinksRequest $request = new ListPaymentLinksRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListPaymentLinksRequest $request) => $this->_list($request, $options), + setCursor: function (ListPaymentLinksRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListPaymentLinksResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListPaymentLinksResponse $response) => $response?->getPaymentLinks() ?? [], + ); + } + + /** + * Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. + * + * @param CreatePaymentLinkRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreatePaymentLinkResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreatePaymentLinkRequest $request = new CreatePaymentLinkRequest(), ?array $options = null): CreatePaymentLinkResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/payment-links", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreatePaymentLinkResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a payment link. + * + * @param GetPaymentLinksRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetPaymentLinkResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetPaymentLinksRequest $request, ?array $options = null): GetPaymentLinkResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/payment-links/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetPaymentLinkResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a payment link. You can update the `payment_link` fields such as + * `description`, `checkout_options`, and `pre_populated_data`. + * You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. + * + * @param UpdatePaymentLinkRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdatePaymentLinkResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdatePaymentLinkRequest $request, ?array $options = null): UpdatePaymentLinkResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/payment-links/{$request->getId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdatePaymentLinkResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a payment link. + * + * @param DeletePaymentLinksRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeletePaymentLinkResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeletePaymentLinksRequest $request, ?array $options = null): DeletePaymentLinkResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/payment-links/{$request->getId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeletePaymentLinkResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all payment links. + * + * @param ListPaymentLinksRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListPaymentLinksResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListPaymentLinksRequest $request = new ListPaymentLinksRequest(), ?array $options = null): ListPaymentLinksResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/online-checkout/payment-links", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListPaymentLinksResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Checkout/PaymentLinks/Requests/CreatePaymentLinkRequest.php b/src/Checkout/PaymentLinks/Requests/CreatePaymentLinkRequest.php new file mode 100644 index 00000000..d1e0f5df --- /dev/null +++ b/src/Checkout/PaymentLinks/Requests/CreatePaymentLinkRequest.php @@ -0,0 +1,221 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->description = $values['description'] ?? null; + $this->quickPay = $values['quickPay'] ?? null; + $this->order = $values['order'] ?? null; + $this->checkoutOptions = $values['checkoutOptions'] ?? null; + $this->prePopulatedData = $values['prePopulatedData'] ?? null; + $this->paymentNote = $values['paymentNote'] ?? null; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?QuickPay + */ + public function getQuickPay(): ?QuickPay + { + return $this->quickPay; + } + + /** + * @param ?QuickPay $value + */ + public function setQuickPay(?QuickPay $value = null): self + { + $this->quickPay = $value; + return $this; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?CheckoutOptions + */ + public function getCheckoutOptions(): ?CheckoutOptions + { + return $this->checkoutOptions; + } + + /** + * @param ?CheckoutOptions $value + */ + public function setCheckoutOptions(?CheckoutOptions $value = null): self + { + $this->checkoutOptions = $value; + return $this; + } + + /** + * @return ?PrePopulatedData + */ + public function getPrePopulatedData(): ?PrePopulatedData + { + return $this->prePopulatedData; + } + + /** + * @param ?PrePopulatedData $value + */ + public function setPrePopulatedData(?PrePopulatedData $value = null): self + { + $this->prePopulatedData = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentNote(): ?string + { + return $this->paymentNote; + } + + /** + * @param ?string $value + */ + public function setPaymentNote(?string $value = null): self + { + $this->paymentNote = $value; + return $this; + } +} diff --git a/src/Checkout/PaymentLinks/Requests/DeletePaymentLinksRequest.php b/src/Checkout/PaymentLinks/Requests/DeletePaymentLinksRequest.php new file mode 100644 index 00000000..89233ab9 --- /dev/null +++ b/src/Checkout/PaymentLinks/Requests/DeletePaymentLinksRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Checkout/PaymentLinks/Requests/GetPaymentLinksRequest.php b/src/Checkout/PaymentLinks/Requests/GetPaymentLinksRequest.php new file mode 100644 index 00000000..fc5beb73 --- /dev/null +++ b/src/Checkout/PaymentLinks/Requests/GetPaymentLinksRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Checkout/PaymentLinks/Requests/ListPaymentLinksRequest.php b/src/Checkout/PaymentLinks/Requests/ListPaymentLinksRequest.php new file mode 100644 index 00000000..b502ed9b --- /dev/null +++ b/src/Checkout/PaymentLinks/Requests/ListPaymentLinksRequest.php @@ -0,0 +1,76 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Checkout/PaymentLinks/Requests/UpdatePaymentLinkRequest.php b/src/Checkout/PaymentLinks/Requests/UpdatePaymentLinkRequest.php new file mode 100644 index 00000000..3c613f4b --- /dev/null +++ b/src/Checkout/PaymentLinks/Requests/UpdatePaymentLinkRequest.php @@ -0,0 +1,71 @@ +id = $values['id']; + $this->paymentLink = $values['paymentLink']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return PaymentLink + */ + public function getPaymentLink(): PaymentLink + { + return $this->paymentLink; + } + + /** + * @param PaymentLink $value + */ + public function setPaymentLink(PaymentLink $value): self + { + $this->paymentLink = $value; + return $this; + } +} diff --git a/src/Checkout/Requests/RetrieveLocationSettingsRequest.php b/src/Checkout/Requests/RetrieveLocationSettingsRequest.php new file mode 100644 index 00000000..dba7104f --- /dev/null +++ b/src/Checkout/Requests/RetrieveLocationSettingsRequest.php @@ -0,0 +1,41 @@ +locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Checkout/Requests/UpdateLocationSettingsRequest.php b/src/Checkout/Requests/UpdateLocationSettingsRequest.php new file mode 100644 index 00000000..57fbfe8b --- /dev/null +++ b/src/Checkout/Requests/UpdateLocationSettingsRequest.php @@ -0,0 +1,68 @@ +locationId = $values['locationId']; + $this->locationSettings = $values['locationSettings']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return CheckoutLocationSettings + */ + public function getLocationSettings(): CheckoutLocationSettings + { + return $this->locationSettings; + } + + /** + * @param CheckoutLocationSettings $value + */ + public function setLocationSettings(CheckoutLocationSettings $value): self + { + $this->locationSettings = $value; + return $this; + } +} diff --git a/src/Checkout/Requests/UpdateMerchantSettingsRequest.php b/src/Checkout/Requests/UpdateMerchantSettingsRequest.php new file mode 100644 index 00000000..565bd997 --- /dev/null +++ b/src/Checkout/Requests/UpdateMerchantSettingsRequest.php @@ -0,0 +1,44 @@ +merchantSettings = $values['merchantSettings']; + } + + /** + * @return CheckoutMerchantSettings + */ + public function getMerchantSettings(): CheckoutMerchantSettings + { + return $this->merchantSettings; + } + + /** + * @param CheckoutMerchantSettings $value + */ + public function setMerchantSettings(CheckoutMerchantSettings $value): self + { + $this->merchantSettings = $value; + return $this; + } +} diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php deleted file mode 100644 index 23b48c9b..00000000 --- a/src/ConfigurationDefaults.php +++ /dev/null @@ -1,62 +0,0 @@ - self::TIMEOUT, - 'enableRetries' => self::ENABLE_RETRIES, - 'numberOfRetries' => self::NUMBER_OF_RETRIES, - 'retryInterval' => self::RETRY_INTERVAL, - 'backOffFactor' => self::BACK_OFF_FACTOR, - 'maximumRetryWaitTime' => self::MAXIMUM_RETRY_WAIT_TIME, - 'retryOnTimeout' => self::RETRY_ON_TIMEOUT, - 'httpStatusCodesToRetry' => self::HTTP_STATUS_CODES_TO_RETRY, - 'httpMethodsToRetry' => self::HTTP_METHODS_TO_RETRY, - 'squareVersion' => self::SQUARE_VERSION, - 'additionalHeaders' => self::ADDITIONAL_HEADERS, - 'userAgentDetail' => self::USER_AGENT_DETAIL, - 'environment' => self::ENVIRONMENT, - 'customUrl' => self::CUSTOM_URL, - 'accessToken' => self::ACCESS_TOKEN - ]; -} diff --git a/src/ConfigurationInterface.php b/src/ConfigurationInterface.php deleted file mode 100644 index e68b412f..00000000 --- a/src/ConfigurationInterface.php +++ /dev/null @@ -1,58 +0,0 @@ - $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + */ + public function __construct( + public readonly string $baseUrl, + public readonly string $path, + public readonly HttpMethod $method, + public readonly array $headers = [], + public readonly array $query = [], + ) { + } +} diff --git a/src/Core/Client/HttpMethod.php b/src/Core/Client/HttpMethod.php new file mode 100644 index 00000000..4d64acee --- /dev/null +++ b/src/Core/Client/HttpMethod.php @@ -0,0 +1,12 @@ + $headers + */ + private array $headers; + + /** + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * headers?: array, + * } $options + */ + public function __construct( + public readonly ?array $options = null, + ) { + $this->client = $this->options['client'] + ?? $this->createDefaultClient(); + $this->headers = $this->options['headers'] ?? []; + } + + /** + * @return Client + */ + private function createDefaultClient(): Client + { + $handler = HandlerStack::create(); + $handler->push(RetryMiddleware::create()); + return new Client(['handler' => $handler]); + } + + /** + * @param BaseApiRequest $request + * @param ?array{ + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ResponseInterface + * @throws ClientExceptionInterface + */ + public function sendRequest( + BaseApiRequest $request, + ?array $options = null, + ): ResponseInterface { + $opts = $options ?? []; + $httpRequest = $this->buildRequest($request, $opts); + return $this->client->send($httpRequest, $this->toGuzzleOptions($opts)); + } + + /** + * @param array{ + * maxRetries?: int, + * timeout?: float, + * } $options + * @return array + */ + private function toGuzzleOptions(array $options): array + { + $guzzleOptions = []; + if (isset($options['maxRetries'])) { + $guzzleOptions['maxRetries'] = $options['maxRetries']; + } + if (isset($options['timeout'])) { + $guzzleOptions['timeout'] = $options['timeout']; + } + return $guzzleOptions; + } + + /** + * @param BaseApiRequest $request + * @param array{ + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Request + */ + private function buildRequest( + BaseApiRequest $request, + array $options + ): Request { + $url = $this->buildUrl($request, $options); + $headers = $this->encodeHeaders($request, $options); + $body = $this->encodeRequestBody($request, $options); + return new Request( + $request->method->name, + $url, + $headers, + $body, + ); + } + + /** + * @param BaseApiRequest $request + * @param array{ + * headers?: array, + * } $options + * @return array + */ + private function encodeHeaders( + BaseApiRequest $request, + array $options, + ): array { + return match (get_class($request)) { + JsonApiRequest::class => array_merge( + ["Content-Type" => "application/json"], + $this->headers, + $request->headers, + $options['headers'] ?? [], + ), + MultipartApiRequest::class => array_merge( + $this->headers, + $request->headers, + $options['headers'] ?? [], + ), + default => throw new InvalidArgumentException('Unsupported request type: ' . get_class($request)), + }; + } + + /** + * @param BaseApiRequest $request + * @param array{ + * bodyProperties?: array, + * } $options + * @return ?StreamInterface + */ + private function encodeRequestBody( + BaseApiRequest $request, + array $options, + ): ?StreamInterface { + return match (get_class($request)) { + JsonApiRequest::class => $request->body === null ? null : Utils::streamFor( + json_encode( + $this->buildJsonBody( + $request->body, + $options, + ), + ) + ), + MultipartApiRequest::class => $request->body != null ? new MultipartStream($request->body->toArray()) : null, + default => throw new InvalidArgumentException('Unsupported request type: ' . get_class($request)), + }; + } + + /** + * @param mixed $body + * @param array{ + * bodyProperties?: array, + * } $options + * @return mixed + */ + private function buildJsonBody( + mixed $body, + array $options, + ): mixed { + $overrideProperties = $options['bodyProperties'] ?? []; + if (is_array($body) && (empty($body) || self::isSequential($body))) { + return array_merge($body, $overrideProperties); + } + + if ($body instanceof JsonSerializable) { + $result = $body->jsonSerialize(); + } else { + $result = $body; + } + if (is_array($result)) { + $result = array_merge($result, $overrideProperties); + if (empty($result)) { + // force to be serialized as {} instead of [] + return (object)($result); + } + } + + return $result; + } + + /** + * @param BaseApiRequest $request + * @param array{ + * queryParameters?: array, + * } $options + * @return string + */ + private function buildUrl( + BaseApiRequest $request, + array $options, + ): string { + $baseUrl = $request->baseUrl; + $trimmedBaseUrl = rtrim($baseUrl, '/'); + $trimmedBasePath = ltrim($request->path, '/'); + $url = "{$trimmedBaseUrl}/{$trimmedBasePath}"; + $query = array_merge( + $request->query, + $options['queryParameters'] ?? [], + ); + if (!empty($query)) { + $url .= '?' . $this->encodeQuery($query); + } + return $url; + } + + /** + * @param array $query + * @return string + */ + private function encodeQuery(array $query): string + { + $parts = []; + foreach ($query as $key => $value) { + if (is_array($value)) { + foreach ($value as $item) { + $parts[] = urlencode($key) . '=' . $this->encodeQueryValue($item); + } + } else { + $parts[] = urlencode($key) . '=' . $this->encodeQueryValue($value); + } + } + return implode('&', $parts); + } + + private function encodeQueryValue(mixed $value): string + { + if (is_string($value)) { + return urlencode($value); + } + if (is_scalar($value)) { + return urlencode((string)$value); + } + if (is_null($value)) { + return 'null'; + } + // Unreachable, but included for a best effort. + return urlencode(strval(json_encode($value))); + } + + /** + * Check if an array is sequential, not associative. + * @param mixed[] $arr + * @return bool + */ + private static function isSequential(array $arr): bool + { + if (empty($arr)) { + return false; + } + $length = count($arr); + $keys = array_keys($arr); + for ($i = 0; $i < $length; $i++) { + if ($keys[$i] !== $i) { + return false; + } + } + return true; + } +} diff --git a/src/Core/Client/RetryMiddleware.php b/src/Core/Client/RetryMiddleware.php new file mode 100644 index 00000000..2b3fabd3 --- /dev/null +++ b/src/Core/Client/RetryMiddleware.php @@ -0,0 +1,191 @@ + 2, + 'baseDelay' => 1000 + ]; + private const RETRY_STATUS_CODES = [408, 429]; + + /** + * @var callable(RequestInterface, array): PromiseInterface + * @phpstan-ignore missingType.iterableValue + */ + private $nextHandler; + + /** + * @var array{ + * maxRetries: int, + * baseDelay: int, + * } + */ + private array $options; + + /** + * @param callable $nextHandler + * @param ?array{ + * maxRetries?: int, + * } $options + */ + public function __construct( + callable $nextHandler, + ?array $options = null, + ) { + $this->nextHandler = $nextHandler; + $this->options = array_merge(self::DEFAULT_RETRY_OPTIONS, $options ?? []); + } + + /** + * @param ?array{ + * maxRetries?: int, + * baseDelay?: int, + * } $options + * @return callable + */ + public static function create(?array $options = null): callable + { + return static function (callable $handler) use ($options): RetryMiddleware { + return new RetryMiddleware($handler, $options); + }; + } + + /** + * @param RequestInterface $request + * @param array{ + * retryAttempt?: int, + * delay: int, + * maxRetries?: int, + * } $options + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $options = array_merge($this->options, $options); + if (!isset($options['retryAttempt'])) { + $options['retryAttempt'] = 0; + } + + $fn = $this->nextHandler; + + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * @param int $retryAttempt + * @param int $maxRetries + * @param ?ResponseInterface $response + * @param ?Throwable $exception + * @return bool + */ + private function shouldRetry( + int $retryAttempt, + int $maxRetries, + ?ResponseInterface $response = null, + ?Throwable $exception = null + ): bool { + if ($retryAttempt >= $maxRetries) { + return false; + } + + if ($exception instanceof ConnectException) { + return true; + } + + if ($response) { + return $response->getStatusCode() >= 500 || + in_array($response->getStatusCode(), self::RETRY_STATUS_CODES); + } + return false; + } + + /** + * Execute fulfilled closure + * @param array{ + * retryAttempt: int, + * delay: int, + * maxRetries: int, + * } $options + */ + private function onFulfilled(RequestInterface $request, array $options): callable + { + $retryAttempt = $options['retryAttempt']; + $maxRetries = $options['maxRetries']; + return function ($value) use ($request, $options, $retryAttempt, $maxRetries) { + if (!$this->shouldRetry( + $retryAttempt, + $maxRetries, + $value + )) { + return $value; + } + + return $this->doRetry($request, $options); + }; + } + + /** + * Execute rejected closure + * @param RequestInterface $req + * @param array{ + * retryAttempt: int, + * delay: int, + * maxRetries: int, + * } $options + * @return callable + */ + private function onRejected(RequestInterface $req, array $options): callable + { + $retryAttempt = $options['retryAttempt']; + $maxRetries = $options['maxRetries']; + return function ($reason) use ($req, $options, $retryAttempt, $maxRetries) { + if (!$this->shouldRetry( + $retryAttempt, + $maxRetries, + null, + $reason + )) { + return P\Create::rejectionFor($reason); + } + + return $this->doRetry($req, $options); + }; + } + + /** + * @param RequestInterface $request + * @param array{ + * delay: int, + * retryAttempt: int, + * } $options + * @return PromiseInterface + */ + private function doRetry(RequestInterface $request, array $options): PromiseInterface + { + $options['delay'] = $this->exponentialDelay(++$options['retryAttempt']); + return $this($request, $options); + } + + /** + * Default exponential backoff delay function. + * + * @return int milliseconds. + */ + private function exponentialDelay(int $retryAttempt): int + { + return 2 ** ($retryAttempt - 1) * $this->options['baseDelay']; + } +} diff --git a/src/Core/Json/JsonApiRequest.php b/src/Core/Json/JsonApiRequest.php new file mode 100644 index 00000000..ecf12110 --- /dev/null +++ b/src/Core/Json/JsonApiRequest.php @@ -0,0 +1,28 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + * @param mixed|null $body The JSON request body (optional) + */ + public function __construct( + string $baseUrl, + string $path, + HttpMethod $method, + array $headers = [], + array $query = [], + public readonly mixed $body = null + ) { + parent::__construct($baseUrl, $path, $method, $headers, $query); + } +} diff --git a/src/Core/Json/JsonDecoder.php b/src/Core/Json/JsonDecoder.php new file mode 100644 index 00000000..e8be4de5 --- /dev/null +++ b/src/Core/Json/JsonDecoder.php @@ -0,0 +1,161 @@ + $type The type definition for deserialization. + * @return mixed[]|array The deserialized array. + * @throws JsonException If the decoded value is not an array. + */ + public static function decodeArray(string $json, array $type): array + { + $decoded = self::decode($json); + if (!is_array($decoded)) { + throw new JsonException("Unexpected non-array json value: " . $json); + } + return JsonDeserializer::deserializeArray($decoded, $type); + } + + /** + * Decodes a JSON string and deserializes it based on the provided union type definition. + * + * @param string $json The JSON string to decode. + * @param Union $union The union type definition for deserialization. + * @return mixed The deserialized value. + * @throws JsonException If the deserialization for all types in the union fails. + */ + public static function decodeUnion(string $json, Union $union): mixed + { + $decoded = self::decode($json); + return JsonDeserializer::deserializeUnion($decoded, $union); + } + /** + * Decodes a JSON string and returns a mixed. + * + * @param string $json The JSON string to decode. + * @return mixed The decoded mixed. + * @throws JsonException If the decoded value is not an mixed. + */ + public static function decodeMixed(string $json): mixed + { + return self::decode($json); + } + + /** + * Decodes a JSON string into a PHP value. + * + * @param string $json The JSON string to decode. + * @return mixed The decoded value. + * @throws JsonException If an error occurs during JSON decoding. + */ + public static function decode(string $json): mixed + { + return json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR); + } +} diff --git a/src/Core/Json/JsonDeserializer.php b/src/Core/Json/JsonDeserializer.php new file mode 100644 index 00000000..7f659cd3 --- /dev/null +++ b/src/Core/Json/JsonDeserializer.php @@ -0,0 +1,204 @@ + $data The array to be deserialized. + * @param mixed[]|array $type The type definition from the annotation. + * @return mixed[]|array The deserialized array. + * @throws JsonException If deserialization fails. + */ + public static function deserializeArray(array $data, array $type): array + { + return Utils::isMapType($type) + ? self::deserializeMap($data, $type) + : self::deserializeList($data, $type); + } + + /** + * Deserializes a value based on its type definition. + * + * @param mixed $data The data to deserialize. + * @param mixed $type The type definition. + * @return mixed The deserialized value. + * @throws JsonException If deserialization fails. + */ + private static function deserializeValue(mixed $data, mixed $type): mixed + { + if ($type instanceof Union) { + return self::deserializeUnion($data, $type); + } + + if (is_array($type)) { + return self::deserializeArray((array)$data, $type); + } + + if (gettype($type) != "string") { + throw new JsonException("Unexpected non-string type."); + } + + return self::deserializeSingleValue($data, $type); + } + + /** + * Deserializes a value based on the possible types in a union type definition. + * + * @param mixed $data The data to deserialize. + * @param Union $type The union type definition. + * @return mixed The deserialized value. + * @throws JsonException If none of the union types can successfully deserialize the value. + */ + public static function deserializeUnion(mixed $data, Union $type): mixed + { + foreach ($type->types as $unionType) { + try { + return self::deserializeValue($data, $unionType); + } catch (Exception) { + continue; + } + } + $readableType = Utils::getReadableType($data); + throw new JsonException( + "Cannot deserialize value of type $readableType with any of the union types: " . $type + ); + } + + /** + * Deserializes a single value based on its expected type. + * + * @param mixed $data The data to deserialize. + * @param string $type The expected type. + * @return mixed The deserialized value. + * @throws JsonException If deserialization fails. + */ + private static function deserializeSingleValue(mixed $data, string $type): mixed + { + if ($type === 'null' && $data === null) { + return null; + } + + if ($type === 'date' && is_string($data)) { + return self::deserializeDate($data); + } + + if ($type === 'datetime' && is_string($data)) { + return self::deserializeDateTime($data); + } + + if ($type === 'mixed') { + return $data; + } + + if (class_exists($type) && is_array($data)) { + return self::deserializeObject($data, $type); + } + + // Handle floats as a special case since gettype($data) returns "double" for float values in PHP, and because + // floats make come through from json_decoded as integers + if ($type === 'float' && (is_numeric($data))) { + return (float) $data; + } + + if (gettype($data) === $type) { + return $data; + } + + throw new JsonException("Unable to deserialize value of type '" . gettype($data) . "' as '$type'."); + } + + /** + * Deserializes an array into an object of the given type. + * + * @param array $data The data to deserialize. + * @param string $type The class name of the object to deserialize into. + * + * @return object The deserialized object. + * + * @throws JsonException If the type does not implement JsonSerializableType. + */ + public static function deserializeObject(array $data, string $type): object + { + if (!is_subclass_of($type, JsonSerializableType::class)) { + throw new JsonException("$type is not a subclass of JsonSerializableType."); + } + return $type::jsonDeserialize($data); + } + + /** + * Deserializes a map (associative array) with defined key and value types. + * + * @param array $data The associative array to deserialize. + * @param array $type The type definition for the map. + * @return array The deserialized map. + * @throws JsonException If deserialization fails. + */ + private static function deserializeMap(array $data, array $type): array + { + $keyType = array_key_first($type); + $valueType = $type[$keyType]; + $result = []; + + foreach ($data as $key => $item) { + $key = Utils::castKey($key, (string)$keyType); + $result[$key] = self::deserializeValue($item, $valueType); + } + + return $result; + } + + /** + * Deserializes a list (indexed array) with a defined value type. + * + * @param array $data The list to deserialize. + * @param array $type The type definition for the list. + * @return array The deserialized list. + * @throws JsonException If deserialization fails. + */ + private static function deserializeList(array $data, array $type): array + { + $valueType = $type[0]; + return array_map(fn ($item) => self::deserializeValue($item, $valueType), $data); + } +} diff --git a/src/Core/Json/JsonEncoder.php b/src/Core/Json/JsonEncoder.php new file mode 100644 index 00000000..0725b86d --- /dev/null +++ b/src/Core/Json/JsonEncoder.php @@ -0,0 +1,20 @@ + Extra properties from JSON that don't map to class properties */ + private array $__additionalProperties = []; + + /** + * Serializes the object to a JSON string. + * + * @return string JSON-encoded string representation of the object. + * @throws Exception If encoding fails. + */ + public function toJson(): string + { + $serializedObject = $this->jsonSerialize(); + $encoded = JsonEncoder::encode($serializedObject); + if (!$encoded) { + throw new Exception("Could not encode type"); + } + return $encoded; + } + + /** + * Serializes the object to an array. + * + * @return mixed[] Array representation of the object. + * @throws JsonException If serialization fails. + */ + public function jsonSerialize(): array + { + $result = []; + $reflectionClass = new \ReflectionClass($this); + foreach ($reflectionClass->getProperties() as $property) { + $jsonKey = self::getJsonKey($property); + if ($jsonKey == null) { + continue; + } + $value = $property->getValue($this); + + // Handle DateTime properties + $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; + if ($dateTypeAttr && $value instanceof DateTime) { + $dateType = $dateTypeAttr->newInstance()->type; + $value = ($dateType === Date::TYPE_DATE) + ? JsonSerializer::serializeDate($value) + : JsonSerializer::serializeDateTime($value); + } + + // Handle Union annotations + $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; + if ($unionTypeAttr) { + $unionType = $unionTypeAttr->newInstance(); + $value = JsonSerializer::serializeUnion($value, $unionType); + } + + // Handle arrays with type annotations + $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; + if ($arrayTypeAttr && is_array($value)) { + $arrayType = $arrayTypeAttr->newInstance()->type; + $value = JsonSerializer::serializeArray($value, $arrayType); + } + + // Handle object + if (is_object($value)) { + $value = JsonSerializer::serializeObject($value); + } + + if ($value !== null) { + $result[$jsonKey] = $value; + } + } + return $result; + } + + /** + * Deserializes a JSON string into an instance of the calling class. + * + * @param string $json JSON string to deserialize. + * @return static Deserialized object. + * @throws JsonException If decoding fails or the result is not an array. + * @throws Exception If deserialization fails. + */ + public static function fromJson(string $json): static + { + $decodedJson = JsonDecoder::decode($json); + if (!is_array($decodedJson)) { + throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); + } + return self::jsonDeserialize($decodedJson); + } + + /** + * Deserializes an array into an instance of the calling class. + * + * @param array $data Array data to deserialize. + * @return static Deserialized object. + * @throws JsonException If deserialization fails. + */ + public static function jsonDeserialize(array $data): static + { + $reflectionClass = new \ReflectionClass(static::class); + $constructor = $reflectionClass->getConstructor(); + if ($constructor === null) { + throw new JsonException("No constructor found."); + } + + $args = []; + $properties = []; + $additionalProperties = []; + foreach ($reflectionClass->getProperties() as $property) { + $jsonKey = self::getJsonKey($property) ?? $property->getName(); + $properties[$jsonKey] = $property; + } + + foreach ($data as $jsonKey => $value) { + if (!isset($properties[$jsonKey])) { + // This JSON key doesn't map to any class property - add it to additionalProperties + $additionalProperties[$jsonKey] = $value; + continue; + } + + $property = $properties[$jsonKey]; + + // Handle Date annotation + $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; + if ($dateTypeAttr) { + $dateType = $dateTypeAttr->newInstance()->type; + if (!is_string($value)) { + throw new JsonException("Unexpected non-string type for date."); + } + $value = ($dateType === Date::TYPE_DATE) + ? JsonDeserializer::deserializeDate($value) + : JsonDeserializer::deserializeDateTime($value); + } + + // Handle Array annotation + $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; + if (is_array($value) && $arrayTypeAttr) { + $arrayType = $arrayTypeAttr->newInstance()->type; + $value = JsonDeserializer::deserializeArray($value, $arrayType); + } + + // Handle Union annotations + $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; + if ($unionTypeAttr) { + $unionType = $unionTypeAttr->newInstance(); + $value = JsonDeserializer::deserializeUnion($value, $unionType); + } + + // Handle object + $type = $property->getType(); + if (is_array($value) && $type instanceof ReflectionNamedType && !$type->isBuiltin()) { + $value = JsonDeserializer::deserializeObject($value, $type->getName()); + } + + $args[$property->getName()] = $value; + } + + // Fill in any missing properties with defaults + foreach ($properties as $property) { + if (!isset($args[$property->getName()])) { + $args[$property->getName()] = $property->getDefaultValue() ?? null; + } + } + + // @phpstan-ignore-next-line + $result = new static($args); + $result->__additionalProperties = $additionalProperties; + return $result; + } + + /** + * Get properties from JSON that weren't mapped to class fields + * @return array + */ + public function getAdditionalProperties(): array + { + return $this->__additionalProperties; + } + + /** + * Retrieves the JSON key associated with a property. + * + * @param ReflectionProperty $property The reflection property. + * @return ?string The JSON key, or null if not available. + */ + private static function getJsonKey(ReflectionProperty $property): ?string + { + $jsonPropertyAttr = $property->getAttributes(JsonProperty::class)[0] ?? null; + return $jsonPropertyAttr?->newInstance()?->name; + } +} diff --git a/src/Core/Json/JsonSerializer.php b/src/Core/Json/JsonSerializer.php new file mode 100644 index 00000000..d3039ce0 --- /dev/null +++ b/src/Core/Json/JsonSerializer.php @@ -0,0 +1,192 @@ +format(Constant::DateFormat); + } + + /** + * Serializes a DateTime object into a string using the date-time format. + * + * @param DateTime $date The DateTime object to serialize. + * @return string The serialized date-time string. + */ + public static function serializeDateTime(DateTime $date): string + { + return $date->format(Constant::DateTimeFormat); + } + + /** + * Serializes an array based on type annotations (either a list or map). + * + * @param mixed[]|array $data The array to be serialized. + * @param mixed[]|array $type The type definition from the annotation. + * @return mixed[]|array The serialized array. + * @throws JsonException If serialization fails. + */ + public static function serializeArray(array $data, array $type): array + { + return Utils::isMapType($type) + ? self::serializeMap($data, $type) + : self::serializeList($data, $type); + } + + /** + * Serializes a value based on its type definition. + * + * @param mixed $data The value to serialize. + * @param mixed $type The type definition. + * @return mixed The serialized value. + * @throws JsonException If serialization fails. + */ + private static function serializeValue(mixed $data, mixed $type): mixed + { + if ($type instanceof Union) { + return self::serializeUnion($data, $type); + } + + if (is_array($type)) { + return self::serializeArray((array)$data, $type); + } + + if (gettype($type) != "string") { + throw new JsonException("Unexpected non-string type."); + } + + return self::serializeSingleValue($data, $type); + } + + /** + * Serializes a value for a union type definition. + * + * @param mixed $data The value to serialize. + * @param Union $unionType The union type definition. + * @return mixed The serialized value. + * @throws JsonException If serialization fails for all union types. + */ + public static function serializeUnion(mixed $data, Union $unionType): mixed + { + foreach ($unionType->types as $type) { + try { + return self::serializeValue($data, $type); + } catch (Exception) { + // Try the next type in the union + continue; + } + } + $readableType = Utils::getReadableType($data); + throw new JsonException( + "Cannot serialize value of type $readableType with any of the union types: " . $unionType + ); + } + + /** + * Serializes a single value based on its type. + * + * @param mixed $data The value to serialize. + * @param string $type The expected type. + * @return mixed The serialized value. + * @throws JsonException If serialization fails. + */ + private static function serializeSingleValue(mixed $data, string $type): mixed + { + if ($type === 'null' && $data === null) { + return null; + } + + if (($type === 'date' || $type === 'datetime') && $data instanceof DateTime) { + return $type === 'date' ? self::serializeDate($data) : self::serializeDateTime($data); + } + + if ($type === 'mixed') { + return $data; + } + + if (class_exists($type) && $data instanceof $type) { + return self::serializeObject($data); + } + + // Handle floats as a special case since gettype($data) returns "double" for float values in PHP. + if ($type === 'float' && is_float($data)) { + return $data; + } + + if (gettype($data) === $type) { + return $data; + } + + throw new JsonException("Unable to serialize value of type '" . gettype($data) . "' as '$type'."); + } + + /** + * Serializes an object to a JSON-serializable format. + * + * @param object $data The object to serialize. + * @return mixed The serialized data. + * @throws JsonException If the object does not implement JsonSerializable. + */ + public static function serializeObject(object $data): mixed + { + if (!is_subclass_of($data, JsonSerializable::class)) { + $type = get_class($data); + throw new JsonException("Class $type must implement JsonSerializable."); + } + return $data->jsonSerialize(); + } + + /** + * Serializes a map (associative array) with defined key and value types. + * + * @param array $data The associative array to serialize. + * @param array $type The type definition for the map. + * @return array The serialized map. + * @throws JsonException If serialization fails. + */ + private static function serializeMap(array $data, array $type): array + { + $keyType = array_key_first($type); + if ($keyType === null) { + throw new JsonException("Unexpected no key in ArrayType."); + } + $valueType = $type[$keyType]; + $result = []; + + foreach ($data as $key => $item) { + $key = Utils::castKey($key, $keyType); + $result[$key] = self::serializeValue($item, $valueType); + } + + return $result; + } + + /** + * Serializes a list (indexed array) where only the value type is defined. + * + * @param array $data The list to serialize. + * @param array $type The type definition for the list. + * @return array The serialized list. + * @throws JsonException If serialization fails. + */ + private static function serializeList(array $data, array $type): array + { + $valueType = $type[0]; + return array_map(fn ($item) => self::serializeValue($item, $valueType), $data); + } +} diff --git a/src/Core/Json/Utils.php b/src/Core/Json/Utils.php new file mode 100644 index 00000000..db7fa658 --- /dev/null +++ b/src/Core/Json/Utils.php @@ -0,0 +1,61 @@ + $type The type definition from the annotation. + * @return bool True if the type is a map, false if it's a list. + */ + public static function isMapType(array $type): bool + { + return count($type) === 1 && !array_is_list($type); + } + + /** + * Casts the key to the appropriate type based on the key type. + * + * @param mixed $key The key to be cast. + * @param string $keyType The type to cast the key to ('string', 'integer', 'float'). + * @return mixed The casted key. + * @throws JsonException + */ + public static function castKey(mixed $key, string $keyType): mixed + { + if (!is_scalar($key)) { + throw new JsonException("Key must be a scalar type."); + } + return match ($keyType) { + 'integer' => (int)$key, + 'float' => (float)$key, + 'string' => (string)$key, + default => $key, + }; + } + + /** + * Returns a human-readable representation of the input's type. + * + * @param mixed $input The input value to determine the type of. + * @return string A readable description of the input type. + */ + public static function getReadableType(mixed $input): string + { + if (is_object($input)) { + return get_class($input); + } elseif (is_array($input)) { + return 'array(' . count($input) . ' items)'; + } elseif (is_null($input)) { + return 'null'; + } else { + return gettype($input); + } + } +} diff --git a/src/Core/Multipart/MultipartApiRequest.php b/src/Core/Multipart/MultipartApiRequest.php new file mode 100644 index 00000000..4609cb14 --- /dev/null +++ b/src/Core/Multipart/MultipartApiRequest.php @@ -0,0 +1,28 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + * @param ?MultipartFormData $body The multipart form data for the request (optional) + */ + public function __construct( + string $baseUrl, + string $path, + HttpMethod $method, + array $headers = [], + array $query = [], + public readonly ?MultipartFormData $body = null + ) { + parent::__construct($baseUrl, $path, $method, $headers, $query); + } +} diff --git a/src/Core/Multipart/MultipartFormData.php b/src/Core/Multipart/MultipartFormData.php new file mode 100644 index 00000000..1b83c496 --- /dev/null +++ b/src/Core/Multipart/MultipartFormData.php @@ -0,0 +1,61 @@ + + */ + private array $parts = []; + + /** + * Adds a new part to the multipart form data. + * + * @param string $name + * @param string|int|bool|float|StreamInterface $value + * @param ?string $contentType + */ + public function add( + string $name, + string|int|bool|float|StreamInterface $value, + ?string $contentType = null, + ): void { + $headers = $contentType != null ? ['Content-Type' => $contentType] : null; + self::addPart( + new MultipartFormDataPart( + name: $name, + value: $value, + headers: $headers, + ) + ); + } + + /** + * Adds a new part to the multipart form data. + * + * @param MultipartFormDataPart $part + */ + public function addPart(MultipartFormDataPart $part): void + { + $this->parts[] = $part; + } + + /** + * Converts the multipart form data into an array suitable + * for Guzzle's multipart form data. + * + * @return array + * }> + */ + public function toArray(): array + { + return array_map(fn ($part) => $part->toArray(), $this->parts); + } +} diff --git a/src/Core/Multipart/MultipartFormDataPart.php b/src/Core/Multipart/MultipartFormDataPart.php new file mode 100644 index 00000000..8a55cc9c --- /dev/null +++ b/src/Core/Multipart/MultipartFormDataPart.php @@ -0,0 +1,76 @@ + + */ + private ?array $headers; + + /** + * @param string $name + * @param string|bool|float|int|StreamInterface $value + * @param ?string $filename + * @param ?array $headers + */ + public function __construct( + string $name, + string|bool|float|int|StreamInterface $value, + ?string $filename = null, + ?array $headers = null + ) { + $this->name = $name; + $this->contents = Utils::streamFor($value); + $this->filename = $filename; + $this->headers = $headers; + } + + /** + * Converts the multipart form data part into an array suitable + * for Guzzle's multipart form data. + * + * @return array{ + * name: string, + * contents: StreamInterface, + * filename?: string, + * headers?: array + * } + */ + public function toArray(): array + { + $formData = [ + 'name' => $this->name, + 'contents' => $this->contents, + ]; + + if ($this->filename != null) { + $formData['filename'] = $this->filename; + } + + if ($this->headers != null) { + $formData['headers'] = $this->headers; + } + + return $formData; + } +} diff --git a/src/Core/Pagination/CursorPager.php b/src/Core/Pagination/CursorPager.php new file mode 100644 index 00000000..d029fdc0 --- /dev/null +++ b/src/Core/Pagination/CursorPager.php @@ -0,0 +1,73 @@ + + * @internal Use the Pager class + */ +class CursorPager extends Pager +{ + /** @var TRequest */ + private $request; + + /** @var callable(TRequest): TResponse */ + private $getNextPage; + + /** @var callable(TRequest, TCursor): void */ + private $setCursor; + + /** @var callable(TResponse): ?TCursor */ + private $getNextCursor; + + /** @var callable(TResponse): ?array */ + private $getItems; + + /** + * @param TRequest $request + * @param callable(TRequest): TResponse $getNextPage + * @param callable(TRequest, TCursor): void $setCursor + * @param callable(TResponse): ?TCursor $getNextCursor + * @param callable(TResponse): ?array $getItems + */ + public function __construct( + $request, + callable $getNextPage, + callable $setCursor, + callable $getNextCursor, + callable $getItems + ) { + $this->request = clone $request; + $this->getNextPage = $getNextPage; + $this->setCursor = $setCursor; + $this->getNextCursor = $getNextCursor; + $this->getItems = $getItems; + } + + /** + * @return Generator> + */ + public function getPages(): Generator + { + do { + $response = ($this->getNextPage)($this->request); + $items = ($this->getItems)($response); + $nextCursor = ($this->getNextCursor)($response); + if ($items !== null) { + yield new Page($items); + } + + if ($nextCursor === null || $nextCursor === '') { + break; + } + + ($this->setCursor)($this->request, $nextCursor); + } while (true); + } +} diff --git a/src/Core/Pagination/OffsetPager.php b/src/Core/Pagination/OffsetPager.php new file mode 100644 index 00000000..9653a636 --- /dev/null +++ b/src/Core/Pagination/OffsetPager.php @@ -0,0 +1,89 @@ + + * @internal Use the Pager class + */ +class OffsetPager extends Pager +{ + /** @var TRequest */ + private $request; + + /** @var callable(TRequest): TResponse */ + private $getNextPage; + + /** @var callable(TRequest): int */ + private $getOffset; + + /** @var callable(TRequest, int): void */ + private $setOffset; + + /** @var ?callable(TRequest): ?int */ + private $getStep; + + /** @var callable(TResponse): ?array */ + private $getItems; + + /** @var ?callable(TResponse): ?bool */ + private $hasNextPage; + + /** + * @param TRequest $request + * @param callable(TRequest): TResponse $getNextPage + * @param callable(TRequest): int $getOffset + * @param callable(TRequest, int): void $setOffset + * @param ?callable(TRequest): ?int $getStep + * @param callable(TResponse): ?array $getItems + * @param ?callable(TResponse): ?bool $hasNextPage + */ + public function __construct( + $request, + callable $getNextPage, + callable $getOffset, + callable $setOffset, + ?callable $getStep, + callable $getItems, + ?callable $hasNextPage + ) { + $this->request = clone $request; + $this->getNextPage = $getNextPage; + $this->getOffset = $getOffset; + $this->setOffset = $setOffset; + $this->getStep = $getStep; + $this->getItems = $getItems; + $this->hasNextPage = $hasNextPage; + } + + /** + * @return Generator> + */ + public function getPages(): Generator + { + $hasStep = $this->getStep !== null && ($this->getStep)($this->request) !== null; + $offset = ($this->getOffset)($this->request); + do { + $response = ($this->getNextPage)($this->request); + $items = ($this->getItems)($response); + $itemCount = $items !== null ? count($items) : 0; + $hasNextPage = $this->hasNextPage !== null ? ($this->hasNextPage)($response) : $itemCount > 0; + if ($items !== null) { + yield new Page($items); + } + + if ($hasStep) { + $offset += $items !== null ? count($items) : 1; + } else { + $offset++; + } + + ($this->setOffset)($this->request, $offset); + } while ($hasNextPage); + } +} diff --git a/src/Core/Pagination/Page.php b/src/Core/Pagination/Page.php new file mode 100644 index 00000000..6296e561 --- /dev/null +++ b/src/Core/Pagination/Page.php @@ -0,0 +1,49 @@ + + */ +class Page implements IteratorAggregate +{ + /** + * @var array + */ + private array $items; + + /** + * @param array $items + */ + public function __construct(array $items) + { + $this->items = $items; + } + + /** + * Gets the items in this Page. + * + * @return array + */ + public function getItems(): array + { + return $this->items; + } + + /** + * Get items in this Page as an iterator. + * + * @return Generator + */ + public function getIterator(): Generator + { + return yield from $this->getItems(); + } +} diff --git a/src/Core/Pagination/Pager.php b/src/Core/Pagination/Pager.php new file mode 100644 index 00000000..85c33f8c --- /dev/null +++ b/src/Core/Pagination/Pager.php @@ -0,0 +1,36 @@ + + */ +abstract class Pager implements IteratorAggregate +{ + /** + * Enumerate the values a Page at a time. This may + * make multiple service requests. + * + * @return Generator> + */ + abstract public function getPages(): Generator; + + /** + * Enumerate the values one at a time. This may make multiple service requests. + * + * @return Generator + */ + public function getIterator(): Generator + { + foreach ($this->getPages() as $page) { + yield from $page->getItems(); + } + } +} diff --git a/src/Core/Pagination/PaginationHelper.php b/src/Core/Pagination/PaginationHelper.php new file mode 100644 index 00000000..47150ebd --- /dev/null +++ b/src/Core/Pagination/PaginationHelper.php @@ -0,0 +1,167 @@ + $className + * @return T + */ + public static function createRequestWithDefaults(string $className) + { + return self::createInstanceWithDefaults($className); + } + + /** + * Sets a nested property on an object, creating intermediate objects as needed. + * + * @template TObject of object + * @template TValue + * @param TObject $object The object to set the property on. + * @param string[] $propertyPath The path to the property, as an array of strings. + * @param TValue $value The value to set. + * @return void + * @internal + */ + public static function setDeep(mixed $object, array $propertyPath, mixed $value): void + { + try { + /** @var object $current */ + $current = $object; + + foreach ($propertyPath as $i => $part) { + /* @phpstan-ignore-next-line */ + $reflectionClass = new ReflectionClass($current); + + $reflectionProperty = $reflectionClass->getProperty($part); + $reflectionProperty->setAccessible(true); + if ($i === count($propertyPath) - 1) { + /* @phpstan-ignore-next-line */ + $reflectionProperty->setValue($current, $value); + return; + } + + /* @phpstan-ignore-next-line */ + $next = $reflectionProperty->getValue($current); + + if ($next === null) { + $propertyType = $reflectionProperty->getType(); + if ($propertyType === null) { + throw new RuntimeException("Property type is null for property '$part' in class '" . $reflectionClass->getName() . "'"); + } + + /** @var class-string $nextTypeName */ + /* @phpstan-ignore-next-line */ + $nextTypeName = $propertyType->getName(); + /** @var object $next */ + $next = self::createInstanceWithDefaults($nextTypeName); + /* @phpstan-ignore-next-line */ + $reflectionProperty->setValue($current, $next); + } + + $current = $next; + } + } catch (ReflectionException $ex) { + $path = implode('->', $propertyPath); + throw new RuntimeException("Failed to set deep property at $path", 0, $ex); + } + } + + /** + * @template T of object + * @param class-string $className + * @return T + */ + private static function createInstanceWithDefaults(string $className) + { + try { + $reflectionClass = new ReflectionClass($className); + $args = []; + $values = []; + + $properties = $reflectionClass->getProperties(); + foreach ($properties as $property) { + if ($property->isStatic()) { + continue; + } + /** @var ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType|null $type */ + $type = $property->getType(); + $value = self::getDefaultValueForType($type); + // if something is nullable, don't explicitly pass the null value as a parameter + if ($value === null) { + continue; + } + + $values[$property->getName()] = $value; + } + $args = [$values]; + + /** @var T|null $instance */ + $instance = $reflectionClass->newInstanceArgs($args); + if ($instance === null) { + return new $className(); + } + return $instance; + } catch (ReflectionException $ex) { + throw new RuntimeException("Failed create instance of $className", 0, $ex); + } + } + + private static function getDefaultValueForType( + null|ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType $type + ): mixed { + if ($type === null) { + return null; + } + + if ($type instanceof ReflectionUnionType) { + foreach ($type->getTypes() as $t) { + if ($t instanceof ReflectionNamedType) { + return self::getDefaultValueForType($t); + } + } + } + + if ($type instanceof ReflectionIntersectionType) { + foreach ($type->getTypes() as $t) { + if ($t instanceof ReflectionNamedType) { + return self::getDefaultValueForType($t); + } + } + } + + if ($type->allowsNull()) { + return null; + } + + if ($type instanceof ReflectionNamedType) { + if ($type->isBuiltin()) { + return match ($type->getName()) { + 'int' => 0, + 'string' => '', + 'bool' => false, + 'array' => [], + default => null, + }; + } + + /** @var class-string $typeName */ + $typeName = $type->getName(); + return self::createInstanceWithDefaults($typeName); + } + + return null; + } +} diff --git a/src/Core/Types/ArrayType.php b/src/Core/Types/ArrayType.php new file mode 100644 index 00000000..96b23dd8 --- /dev/null +++ b/src/Core/Types/ArrayType.php @@ -0,0 +1,16 @@ + 'valueType'] for maps, or ['valueType'] for lists + */ + public function __construct(public array $type) + { + } +} diff --git a/src/Core/Types/Constant.php b/src/Core/Types/Constant.php new file mode 100644 index 00000000..2b483fa0 --- /dev/null +++ b/src/Core/Types/Constant.php @@ -0,0 +1,12 @@ +> The types allowed for this property, which can be strings, arrays, or nested Union types. + */ + public array $types; + + /** + * Constructor for the Union attribute. + * + * @param string|Union|array ...$types The list of types that the property can accept. + * This can include primitive types (e.g., 'string', 'int'), arrays, or other Union instances. + * + * Example: + * ```php + * #[Union('string', 'null', 'date', new Union('boolean', 'int'))] + * ``` + */ + public function __construct(string|Union|array ...$types) + { + $this->types = $types; + } + + /** + * Converts the Union type to a string representation. + * + * @return string A string representation of the union types. + */ + public function __toString(): string + { + return implode(' | ', array_map(function ($type) { + if (is_string($type)) { + return $type; + } elseif ($type instanceof Union) { + return (string) $type; // Recursively handle nested unions + } elseif (is_array($type)) { + return 'array'; // Handle arrays + } + }, $this->types)); + } +} diff --git a/src/Customers/Cards/CardsClient.php b/src/Customers/Cards/CardsClient.php new file mode 100644 index 00000000..faa3a824 --- /dev/null +++ b/src/Customers/Cards/CardsClient.php @@ -0,0 +1,170 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Adds a card on file to an existing customer. + * + * As with charges, calls to `CreateCustomerCard` are idempotent. Multiple + * calls with the same card nonce return the same card record that was created + * with the provided nonce during the _first_ call. + * + * @param CreateCustomerCardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCustomerCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateCustomerCardRequest $request, ?array $options = null): CreateCustomerCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/cards", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCustomerCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Removes a card on file from a customer. + * + * @param DeleteCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCustomerCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCardsRequest $request, ?array $options = null): DeleteCustomerCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/cards/{$request->getCardId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCustomerCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Customers/Cards/Requests/CreateCustomerCardRequest.php b/src/Customers/Cards/Requests/CreateCustomerCardRequest.php new file mode 100644 index 00000000..94715a37 --- /dev/null +++ b/src/Customers/Cards/Requests/CreateCustomerCardRequest.php @@ -0,0 +1,162 @@ +customerId = $values['customerId']; + $this->cardNonce = $values['cardNonce']; + $this->billingAddress = $values['billingAddress'] ?? null; + $this->cardholderName = $values['cardholderName'] ?? null; + $this->verificationToken = $values['verificationToken'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getCardNonce(): string + { + return $this->cardNonce; + } + + /** + * @param string $value + */ + public function setCardNonce(string $value): self + { + $this->cardNonce = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getBillingAddress(): ?Address + { + return $this->billingAddress; + } + + /** + * @param ?Address $value + */ + public function setBillingAddress(?Address $value = null): self + { + $this->billingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardholderName(): ?string + { + return $this->cardholderName; + } + + /** + * @param ?string $value + */ + public function setCardholderName(?string $value = null): self + { + $this->cardholderName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVerificationToken(): ?string + { + return $this->verificationToken; + } + + /** + * @param ?string $value + */ + public function setVerificationToken(?string $value = null): self + { + $this->verificationToken = $value; + return $this; + } +} diff --git a/src/Customers/Cards/Requests/DeleteCardsRequest.php b/src/Customers/Cards/Requests/DeleteCardsRequest.php new file mode 100644 index 00000000..ee4b1476 --- /dev/null +++ b/src/Customers/Cards/Requests/DeleteCardsRequest.php @@ -0,0 +1,65 @@ +customerId = $values['customerId']; + $this->cardId = $values['cardId']; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getCardId(): string + { + return $this->cardId; + } + + /** + * @param string $value + */ + public function setCardId(string $value): self + { + $this->cardId = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php new file mode 100644 index 00000000..69836d21 --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -0,0 +1,489 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributeDefinitionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributeDefinitionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCustomerCustomAttributeDefinitionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCustomerCustomAttributeDefinitionsResponse $response) => $response?->getCustomAttributeDefinitions() ?? [], + ); + } + + /** + * Creates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * Use this endpoint to define a custom attribute that can be associated with customer profiles. + * + * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + * for a custom attribute. After the definition is created, you can call + * [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) or + * [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + * to set the custom attribute for customer profiles in the seller's Customer Directory. + * + * Sellers can view all custom attributes in exported customer data, including those set to + * `VISIBILITY_HIDDEN`. + * + * @param CreateCustomerCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCustomerCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateCustomerCustomAttributeDefinitionRequest $request, ?array $options = null): CreateCustomerCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attribute-definitions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCustomerCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * + * To retrieve a custom attribute definition created by another application, the `visibility` + * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCustomerCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributeDefinitionsRequest $request, ?array $options = null): GetCustomerCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCustomerCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * + * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + * `schema` for a `Selection` data type. + * + * Only the definition owner can update a custom attribute definition. Note that sellers can view + * all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + * + * @param UpdateCustomerCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateCustomerCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateCustomerCustomAttributeDefinitionRequest $request, ?array $options = null): UpdateCustomerCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateCustomerCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * + * Deleting a custom attribute definition also deletes the corresponding custom attribute from + * all customer profiles in the seller's Customer Directory. + * + * Only the definition owner can delete a custom attribute definition. + * + * @param DeleteCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCustomerCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributeDefinitionsRequest $request, ?array $options = null): DeleteCustomerCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCustomerCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates [custom attributes](entity:CustomAttribute) for customer profiles as a bulk operation. + * + * Use this endpoint to set the value of one or more custom attributes for one or more customer profiles. + * A custom attribute is based on a custom attribute definition in a Square seller account, which is + * created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint. + * + * This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + * requests and returns a map of individual upsert responses. Each upsert request has a unique ID + * and provides a customer ID and custom attribute. Each upsert response is returned with the ID + * of the corresponding request. + * + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BatchUpsertCustomerCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchUpsertCustomerCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BatchUpsertCustomerCustomAttributesRequest $request, ?array $options = null): BatchUpsertCustomerCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attributes/bulk-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchUpsertCustomerCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCustomerCustomAttributeDefinitionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): ListCustomerCustomAttributeDefinitionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/custom-attribute-definitions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCustomerCustomAttributeDefinitionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/BatchUpsertCustomerCustomAttributesRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/BatchUpsertCustomerCustomAttributesRequest.php new file mode 100644 index 00000000..28e236b8 --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/BatchUpsertCustomerCustomAttributesRequest.php @@ -0,0 +1,49 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/CreateCustomerCustomAttributeDefinitionRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/CreateCustomerCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..066f3e38 --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/CreateCustomerCustomAttributeDefinitionRequest.php @@ -0,0 +1,79 @@ +customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..f3293557 --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php @@ -0,0 +1,41 @@ +key = $values['key']; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..4ad11c4d --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +key = $values['key']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..8a59f09f --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributeDefinitions/Requests/UpdateCustomerCustomAttributeDefinitionRequest.php b/src/Customers/CustomAttributeDefinitions/Requests/UpdateCustomerCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..fe7bb45c --- /dev/null +++ b/src/Customers/CustomAttributeDefinitions/Requests/UpdateCustomerCustomAttributeDefinitionRequest.php @@ -0,0 +1,112 @@ +key = $values['key']; + $this->customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributes/CustomAttributesClient.php b/src/Customers/CustomAttributes/CustomAttributesClient.php new file mode 100644 index 00000000..782c12d2 --- /dev/null +++ b/src/Customers/CustomAttributes/CustomAttributesClient.php @@ -0,0 +1,364 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. + * + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCustomerCustomAttributesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCustomerCustomAttributesResponse $response) => $response?->getCustomAttributes() ?? [], + ); + } + + /** + * Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile. + * + * You can use the `with_definition` query parameter to also retrieve the custom attribute definition + * in the same call. + * + * To retrieve a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCustomerCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributesRequest $request, ?array $options = null): GetCustomerCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getWithDefinition() != null) { + $query['with_definition'] = $request->getWithDefinition(); + } + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCustomerCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates a [custom attribute](entity:CustomAttribute) for a customer profile. + * + * Use this endpoint to set the value of a custom attribute for a specified customer profile. + * A custom attribute is based on a custom attribute definition in a Square seller account, which + * is created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint. + * + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param UpsertCustomerCustomAttributeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertCustomerCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertCustomerCustomAttributeRequest $request, ?array $options = null): UpsertCustomerCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertCustomerCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile. + * + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param DeleteCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCustomerCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributesRequest $request, ?array $options = null): DeleteCustomerCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCustomerCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. + * + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCustomerCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributesRequest $request, ?array $options = null): ListCustomerCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getWithDefinitions() != null) { + $query['with_definitions'] = $request->getWithDefinitions(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/custom-attributes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCustomerCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Customers/CustomAttributes/Requests/DeleteCustomAttributesRequest.php b/src/Customers/CustomAttributes/Requests/DeleteCustomAttributesRequest.php new file mode 100644 index 00000000..1cfa9043 --- /dev/null +++ b/src/Customers/CustomAttributes/Requests/DeleteCustomAttributesRequest.php @@ -0,0 +1,69 @@ +customerId = $values['customerId']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributes/Requests/GetCustomAttributesRequest.php b/src/Customers/CustomAttributes/Requests/GetCustomAttributesRequest.php new file mode 100644 index 00000000..ed72937a --- /dev/null +++ b/src/Customers/CustomAttributes/Requests/GetCustomAttributesRequest.php @@ -0,0 +1,126 @@ +customerId = $values['customerId']; + $this->key = $values['key']; + $this->withDefinition = $values['withDefinition'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinition(): ?bool + { + return $this->withDefinition; + } + + /** + * @param ?bool $value + */ + public function setWithDefinition(?bool $value = null): self + { + $this->withDefinition = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributes/Requests/ListCustomAttributesRequest.php b/src/Customers/CustomAttributes/Requests/ListCustomAttributesRequest.php new file mode 100644 index 00000000..56395b93 --- /dev/null +++ b/src/Customers/CustomAttributes/Requests/ListCustomAttributesRequest.php @@ -0,0 +1,125 @@ +customerId = $values['customerId']; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->withDefinitions = $values['withDefinitions'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinitions(): ?bool + { + return $this->withDefinitions; + } + + /** + * @param ?bool $value + */ + public function setWithDefinitions(?bool $value = null): self + { + $this->withDefinitions = $value; + return $this; + } +} diff --git a/src/Customers/CustomAttributes/Requests/UpsertCustomerCustomAttributeRequest.php b/src/Customers/CustomAttributes/Requests/UpsertCustomerCustomAttributeRequest.php new file mode 100644 index 00000000..69db23bf --- /dev/null +++ b/src/Customers/CustomAttributes/Requests/UpsertCustomerCustomAttributeRequest.php @@ -0,0 +1,133 @@ +customerId = $values['customerId']; + $this->key = $values['key']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Customers/CustomersClient.php b/src/Customers/CustomersClient.php new file mode 100644 index 00000000..ad0c9be4 --- /dev/null +++ b/src/Customers/CustomersClient.php @@ -0,0 +1,763 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->customAttributeDefinitions = new CustomAttributeDefinitionsClient($this->client, $this->options); + $this->groups = new GroupsClient($this->client, $this->options); + $this->segments = new SegmentsClient($this->client, $this->options); + $this->cards = new CardsClient($this->client, $this->options); + $this->customAttributes = new CustomAttributesClient($this->client, $this->options); + } + + /** + * Lists customer profiles associated with a Square account. + * + * Under normal operating conditions, newly created or updated customer profiles become available + * for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated + * profiles can take closer to one minute or longer, especially during network incidents and outages. + * + * @param ListCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomersRequest $request = new ListCustomersRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomersRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomersRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCustomersResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCustomersResponse $response) => $response?->getCustomers() ?? [], + ); + } + + /** + * Creates a new customer for a business. + * + * You must provide at least one of the following values in your request to this + * endpoint: + * + * - `given_name` + * - `family_name` + * - `company_name` + * - `email_address` + * - `phone_number` + * + * @param CreateCustomerRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateCustomerRequest $request = new CreateCustomerRequest(), ?array $options = null): CreateCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates multiple [customer profiles](entity:Customer) for a business. + * + * This endpoint takes a map of individual create requests and returns a map of responses. + * + * You must provide at least one of the following values in each create request: + * + * - `given_name` + * - `family_name` + * - `company_name` + * - `email_address` + * - `phone_number` + * + * @param BulkCreateCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkCreateCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchCreate(BulkCreateCustomersRequest $request, ?array $options = null): BulkCreateCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/bulk-create", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkCreateCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes multiple customer profiles. + * + * The endpoint takes a list of customer IDs and returns a map of responses. + * + * @param BulkDeleteCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkDeleteCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkDeleteCustomers(BulkDeleteCustomersRequest $request, ?array $options = null): BulkDeleteCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/bulk-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkDeleteCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves multiple customer profiles. + * + * This endpoint takes a list of customer IDs and returns a map of responses. + * + * @param BulkRetrieveCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkRetrieveCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkRetrieveCustomers(BulkRetrieveCustomersRequest $request, ?array $options = null): BulkRetrieveCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/bulk-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkRetrieveCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates multiple customer profiles. + * + * This endpoint takes a map of individual update requests and returns a map of responses. + * + * @param BulkUpdateCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkUpdateCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkUpdateCustomers(BulkUpdateCustomersRequest $request, ?array $options = null): BulkUpdateCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/bulk-update", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkUpdateCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches the customer profiles associated with a Square account using one or more supported query filters. + * + * Calling `SearchCustomers` without any explicit query filter returns all + * customer profiles ordered alphabetically based on `given_name` and + * `family_name`. + * + * Under normal operating conditions, newly created or updated customer profiles become available + * for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated + * profiles can take closer to one minute or longer, especially during network incidents and outages. + * + * @param SearchCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchCustomersRequest $request = new SearchCustomersRequest(), ?array $options = null): SearchCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns details for a single customer. + * + * @param GetCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomersRequest $request, ?array $options = null): GetCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. + * To add or update a field, specify the new value. To remove a field, specify `null`. + * + * To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + * + * @param UpdateCustomerRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateCustomerRequest $request, ?array $options = null): UpdateCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a customer profile from a business. + * + * To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + * + * @param DeleteCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomersRequest $request, ?array $options = null): DeleteCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}", + method: HttpMethod::DELETE, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists customer profiles associated with a Square account. + * + * Under normal operating conditions, newly created or updated customer profiles become available + * for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated + * profiles can take closer to one minute or longer, especially during network incidents and outages. + * + * @param ListCustomersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCustomersResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomersRequest $request = new ListCustomersRequest(), ?array $options = null): ListCustomersResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getSortField() != null) { + $query['sort_field'] = $request->getSortField(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCount() != null) { + $query['count'] = $request->getCount(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCustomersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Customers/Groups/GroupsClient.php b/src/Customers/Groups/GroupsClient.php new file mode 100644 index 00000000..9395e72b --- /dev/null +++ b/src/Customers/Groups/GroupsClient.php @@ -0,0 +1,500 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves the list of customer groups of a business. + * + * @param ListGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListGroupsRequest $request = new ListGroupsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListGroupsRequest $request) => $this->_list($request, $options), + setCursor: function (ListGroupsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCustomerGroupsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCustomerGroupsResponse $response) => $response?->getGroups() ?? [], + ); + } + + /** + * Creates a new customer group for a business. + * + * The request must include the `name` value of the group. + * + * @param CreateCustomerGroupRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCustomerGroupResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateCustomerGroupRequest $request, ?array $options = null): CreateCustomerGroupResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/groups", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCustomerGroupResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a specific customer group as identified by the `group_id` value. + * + * @param GetGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCustomerGroupResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetGroupsRequest $request, ?array $options = null): GetCustomerGroupResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/groups/{$request->getGroupId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCustomerGroupResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a customer group as identified by the `group_id` value. + * + * @param UpdateCustomerGroupRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateCustomerGroupResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateCustomerGroupRequest $request, ?array $options = null): UpdateCustomerGroupResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/groups/{$request->getGroupId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateCustomerGroupResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a customer group as identified by the `group_id` value. + * + * @param DeleteGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteCustomerGroupResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteGroupsRequest $request, ?array $options = null): DeleteCustomerGroupResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/groups/{$request->getGroupId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteCustomerGroupResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Adds a group membership to a customer. + * + * The customer is identified by the `customer_id` value + * and the customer group is identified by the `group_id` value. + * + * @param AddGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return AddGroupToCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function add(AddGroupsRequest $request, ?array $options = null): AddGroupToCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/groups/{$request->getGroupId()}", + method: HttpMethod::PUT, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return AddGroupToCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Removes a group membership from a customer. + * + * The customer is identified by the `customer_id` value + * and the customer group is identified by the `group_id` value. + * + * @param RemoveGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RemoveGroupFromCustomerResponse + * @throws SquareException + * @throws SquareApiException + */ + public function remove(RemoveGroupsRequest $request, ?array $options = null): RemoveGroupFromCustomerResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/{$request->getCustomerId()}/groups/{$request->getGroupId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RemoveGroupFromCustomerResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the list of customer groups of a business. + * + * @param ListGroupsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCustomerGroupsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListGroupsRequest $request = new ListGroupsRequest(), ?array $options = null): ListCustomerGroupsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/groups", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCustomerGroupsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Customers/Groups/Requests/AddGroupsRequest.php b/src/Customers/Groups/Requests/AddGroupsRequest.php new file mode 100644 index 00000000..b622c8f8 --- /dev/null +++ b/src/Customers/Groups/Requests/AddGroupsRequest.php @@ -0,0 +1,65 @@ +customerId = $values['customerId']; + $this->groupId = $values['groupId']; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getGroupId(): string + { + return $this->groupId; + } + + /** + * @param string $value + */ + public function setGroupId(string $value): self + { + $this->groupId = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/CreateCustomerGroupRequest.php b/src/Customers/Groups/Requests/CreateCustomerGroupRequest.php new file mode 100644 index 00000000..eb238519 --- /dev/null +++ b/src/Customers/Groups/Requests/CreateCustomerGroupRequest.php @@ -0,0 +1,69 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->group = $values['group']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return CustomerGroup + */ + public function getGroup(): CustomerGroup + { + return $this->group; + } + + /** + * @param CustomerGroup $value + */ + public function setGroup(CustomerGroup $value): self + { + $this->group = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/DeleteGroupsRequest.php b/src/Customers/Groups/Requests/DeleteGroupsRequest.php new file mode 100644 index 00000000..aa05f0ae --- /dev/null +++ b/src/Customers/Groups/Requests/DeleteGroupsRequest.php @@ -0,0 +1,41 @@ +groupId = $values['groupId']; + } + + /** + * @return string + */ + public function getGroupId(): string + { + return $this->groupId; + } + + /** + * @param string $value + */ + public function setGroupId(string $value): self + { + $this->groupId = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/GetGroupsRequest.php b/src/Customers/Groups/Requests/GetGroupsRequest.php new file mode 100644 index 00000000..8b6ac868 --- /dev/null +++ b/src/Customers/Groups/Requests/GetGroupsRequest.php @@ -0,0 +1,41 @@ +groupId = $values['groupId']; + } + + /** + * @return string + */ + public function getGroupId(): string + { + return $this->groupId; + } + + /** + * @param string $value + */ + public function setGroupId(string $value): self + { + $this->groupId = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/ListGroupsRequest.php b/src/Customers/Groups/Requests/ListGroupsRequest.php new file mode 100644 index 00000000..9dff5e0a --- /dev/null +++ b/src/Customers/Groups/Requests/ListGroupsRequest.php @@ -0,0 +1,75 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/RemoveGroupsRequest.php b/src/Customers/Groups/Requests/RemoveGroupsRequest.php new file mode 100644 index 00000000..344bf015 --- /dev/null +++ b/src/Customers/Groups/Requests/RemoveGroupsRequest.php @@ -0,0 +1,65 @@ +customerId = $values['customerId']; + $this->groupId = $values['groupId']; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function getGroupId(): string + { + return $this->groupId; + } + + /** + * @param string $value + */ + public function setGroupId(string $value): self + { + $this->groupId = $value; + return $this; + } +} diff --git a/src/Customers/Groups/Requests/UpdateCustomerGroupRequest.php b/src/Customers/Groups/Requests/UpdateCustomerGroupRequest.php new file mode 100644 index 00000000..37cb3896 --- /dev/null +++ b/src/Customers/Groups/Requests/UpdateCustomerGroupRequest.php @@ -0,0 +1,68 @@ +groupId = $values['groupId']; + $this->group = $values['group']; + } + + /** + * @return string + */ + public function getGroupId(): string + { + return $this->groupId; + } + + /** + * @param string $value + */ + public function setGroupId(string $value): self + { + $this->groupId = $value; + return $this; + } + + /** + * @return CustomerGroup + */ + public function getGroup(): CustomerGroup + { + return $this->group; + } + + /** + * @param CustomerGroup $value + */ + public function setGroup(CustomerGroup $value): self + { + $this->group = $value; + return $this; + } +} diff --git a/src/Customers/Requests/BulkCreateCustomersRequest.php b/src/Customers/Requests/BulkCreateCustomersRequest.php new file mode 100644 index 00000000..06c914f8 --- /dev/null +++ b/src/Customers/Requests/BulkCreateCustomersRequest.php @@ -0,0 +1,52 @@ + $customers + */ + #[JsonProperty('customers'), ArrayType(['string' => BulkCreateCustomerData::class])] + private array $customers; + + /** + * @param array{ + * customers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->customers = $values['customers']; + } + + /** + * @return array + */ + public function getCustomers(): array + { + return $this->customers; + } + + /** + * @param array $value + */ + public function setCustomers(array $value): self + { + $this->customers = $value; + return $this; + } +} diff --git a/src/Customers/Requests/BulkDeleteCustomersRequest.php b/src/Customers/Requests/BulkDeleteCustomersRequest.php new file mode 100644 index 00000000..fdf1ae70 --- /dev/null +++ b/src/Customers/Requests/BulkDeleteCustomersRequest.php @@ -0,0 +1,44 @@ + $customerIds The IDs of the [customer profiles](entity:Customer) to delete. + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private array $customerIds; + + /** + * @param array{ + * customerIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->customerIds = $values['customerIds']; + } + + /** + * @return array + */ + public function getCustomerIds(): array + { + return $this->customerIds; + } + + /** + * @param array $value + */ + public function setCustomerIds(array $value): self + { + $this->customerIds = $value; + return $this; + } +} diff --git a/src/Customers/Requests/BulkRetrieveCustomersRequest.php b/src/Customers/Requests/BulkRetrieveCustomersRequest.php new file mode 100644 index 00000000..b245e610 --- /dev/null +++ b/src/Customers/Requests/BulkRetrieveCustomersRequest.php @@ -0,0 +1,44 @@ + $customerIds The IDs of the [customer profiles](entity:Customer) to retrieve. + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private array $customerIds; + + /** + * @param array{ + * customerIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->customerIds = $values['customerIds']; + } + + /** + * @return array + */ + public function getCustomerIds(): array + { + return $this->customerIds; + } + + /** + * @param array $value + */ + public function setCustomerIds(array $value): self + { + $this->customerIds = $value; + return $this; + } +} diff --git a/src/Customers/Requests/BulkUpdateCustomersRequest.php b/src/Customers/Requests/BulkUpdateCustomersRequest.php new file mode 100644 index 00000000..2efae9c4 --- /dev/null +++ b/src/Customers/Requests/BulkUpdateCustomersRequest.php @@ -0,0 +1,54 @@ + $customers + */ + #[JsonProperty('customers'), ArrayType(['string' => BulkUpdateCustomerData::class])] + private array $customers; + + /** + * @param array{ + * customers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->customers = $values['customers']; + } + + /** + * @return array + */ + public function getCustomers(): array + { + return $this->customers; + } + + /** + * @param array $value + */ + public function setCustomers(array $value): self + { + $this->customers = $value; + return $this; + } +} diff --git a/src/Customers/Requests/CreateCustomerRequest.php b/src/Customers/Requests/CreateCustomerRequest.php new file mode 100644 index 00000000..03d17a4c --- /dev/null +++ b/src/Customers/Requests/CreateCustomerRequest.php @@ -0,0 +1,364 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->nickname = $values['nickname'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->birthday = $values['birthday'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNickname(): ?string + { + return $this->nickname; + } + + /** + * @param ?string $value + */ + public function setNickname(?string $value = null): self + { + $this->nickname = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBirthday(): ?string + { + return $this->birthday; + } + + /** + * @param ?string $value + */ + public function setBirthday(?string $value = null): self + { + $this->birthday = $value; + return $this; + } + + /** + * @return ?CustomerTaxIds + */ + public function getTaxIds(): ?CustomerTaxIds + { + return $this->taxIds; + } + + /** + * @param ?CustomerTaxIds $value + */ + public function setTaxIds(?CustomerTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } +} diff --git a/src/Customers/Requests/DeleteCustomersRequest.php b/src/Customers/Requests/DeleteCustomersRequest.php new file mode 100644 index 00000000..3031d46d --- /dev/null +++ b/src/Customers/Requests/DeleteCustomersRequest.php @@ -0,0 +1,69 @@ +customerId = $values['customerId']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Customers/Requests/GetCustomersRequest.php b/src/Customers/Requests/GetCustomersRequest.php new file mode 100644 index 00000000..7a427bed --- /dev/null +++ b/src/Customers/Requests/GetCustomersRequest.php @@ -0,0 +1,41 @@ +customerId = $values['customerId']; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } +} diff --git a/src/Customers/Requests/ListCustomersRequest.php b/src/Customers/Requests/ListCustomersRequest.php new file mode 100644 index 00000000..8750e4a4 --- /dev/null +++ b/src/Customers/Requests/ListCustomersRequest.php @@ -0,0 +1,162 @@ + $sortField + */ + private ?string $sortField; + + /** + * Indicates whether customers should be sorted in ascending (`ASC`) or + * descending (`DESC`) order. + * + * The default value is `ASC`. + * + * @var ?value-of $sortOrder + */ + private ?string $sortOrder; + + /** + * Indicates whether to return the total count of customers in the `count` field of the response. + * + * The default value is `false`. + * + * @var ?bool $count + */ + private ?bool $count; + + /** + * @param array{ + * cursor?: ?string, + * limit?: ?int, + * sortField?: ?value-of, + * sortOrder?: ?value-of, + * count?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->sortField = $values['sortField'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->count = $values['count'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortField(): ?string + { + return $this->sortField; + } + + /** + * @param ?value-of $value + */ + public function setSortField(?string $value = null): self + { + $this->sortField = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCount(): ?bool + { + return $this->count; + } + + /** + * @param ?bool $value + */ + public function setCount(?bool $value = null): self + { + $this->count = $value; + return $this; + } +} diff --git a/src/Customers/Requests/SearchCustomersRequest.php b/src/Customers/Requests/SearchCustomersRequest.php new file mode 100644 index 00000000..856cbcbe --- /dev/null +++ b/src/Customers/Requests/SearchCustomersRequest.php @@ -0,0 +1,136 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->query = $values['query'] ?? null; + $this->count = $values['count'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?CustomerQuery + */ + public function getQuery(): ?CustomerQuery + { + return $this->query; + } + + /** + * @param ?CustomerQuery $value + */ + public function setQuery(?CustomerQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCount(): ?bool + { + return $this->count; + } + + /** + * @param ?bool $value + */ + public function setCount(?bool $value = null): self + { + $this->count = $value; + return $this; + } +} diff --git a/src/Customers/Requests/UpdateCustomerRequest.php b/src/Customers/Requests/UpdateCustomerRequest.php new file mode 100644 index 00000000..00269b1a --- /dev/null +++ b/src/Customers/Requests/UpdateCustomerRequest.php @@ -0,0 +1,390 @@ +customerId = $values['customerId']; + $this->givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->nickname = $values['nickname'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->birthday = $values['birthday'] ?? null; + $this->version = $values['version'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNickname(): ?string + { + return $this->nickname; + } + + /** + * @param ?string $value + */ + public function setNickname(?string $value = null): self + { + $this->nickname = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBirthday(): ?string + { + return $this->birthday; + } + + /** + * @param ?string $value + */ + public function setBirthday(?string $value = null): self + { + $this->birthday = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?CustomerTaxIds + */ + public function getTaxIds(): ?CustomerTaxIds + { + return $this->taxIds; + } + + /** + * @param ?CustomerTaxIds $value + */ + public function setTaxIds(?CustomerTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } +} diff --git a/src/Customers/Segments/Requests/GetSegmentsRequest.php b/src/Customers/Segments/Requests/GetSegmentsRequest.php new file mode 100644 index 00000000..2ddc4378 --- /dev/null +++ b/src/Customers/Segments/Requests/GetSegmentsRequest.php @@ -0,0 +1,41 @@ +segmentId = $values['segmentId']; + } + + /** + * @return string + */ + public function getSegmentId(): string + { + return $this->segmentId; + } + + /** + * @param string $value + */ + public function setSegmentId(string $value): self + { + $this->segmentId = $value; + return $this; + } +} diff --git a/src/Customers/Segments/Requests/ListSegmentsRequest.php b/src/Customers/Segments/Requests/ListSegmentsRequest.php new file mode 100644 index 00000000..bff69246 --- /dev/null +++ b/src/Customers/Segments/Requests/ListSegmentsRequest.php @@ -0,0 +1,75 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Customers/Segments/SegmentsClient.php b/src/Customers/Segments/SegmentsClient.php new file mode 100644 index 00000000..f1869330 --- /dev/null +++ b/src/Customers/Segments/SegmentsClient.php @@ -0,0 +1,205 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves the list of customer segments of a business. + * + * @param ListSegmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListSegmentsRequest $request = new ListSegmentsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListSegmentsRequest $request) => $this->_list($request, $options), + setCursor: function (ListSegmentsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListCustomerSegmentsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListCustomerSegmentsResponse $response) => $response?->getSegments() ?? [], + ); + } + + /** + * Retrieves a specific customer segment as identified by the `segment_id` value. + * + * @param GetSegmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetCustomerSegmentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetSegmentsRequest $request, ?array $options = null): GetCustomerSegmentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/segments/{$request->getSegmentId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetCustomerSegmentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the list of customer segments of a business. + * + * @param ListSegmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListCustomerSegmentsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListSegmentsRequest $request = new ListSegmentsRequest(), ?array $options = null): ListCustomerSegmentsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/customers/segments", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListCustomerSegmentsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Devices/Codes/CodesClient.php b/src/Devices/Codes/CodesClient.php new file mode 100644 index 00000000..ae4e670f --- /dev/null +++ b/src/Devices/Codes/CodesClient.php @@ -0,0 +1,270 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists all DeviceCodes associated with the merchant. + * + * @param ListCodesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCodesRequest $request = new ListCodesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCodesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCodesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListDeviceCodesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListDeviceCodesResponse $response) => $response?->getDeviceCodes() ?? [], + ); + } + + /** + * Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected + * terminal mode. + * + * @param CreateDeviceCodeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateDeviceCodeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateDeviceCodeRequest $request, ?array $options = null): CreateDeviceCodeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/devices/codes", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateDeviceCodeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves DeviceCode with the associated ID. + * + * @param GetCodesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetDeviceCodeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCodesRequest $request, ?array $options = null): GetDeviceCodeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/devices/codes/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetDeviceCodeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all DeviceCodes associated with the merchant. + * + * @param ListCodesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListDeviceCodesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCodesRequest $request = new ListCodesRequest(), ?array $options = null): ListDeviceCodesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getProductType() != null) { + $query['product_type'] = $request->getProductType(); + } + if ($request->getStatus() != null) { + $query['status'] = $request->getStatus(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/devices/codes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListDeviceCodesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Devices/Codes/Requests/CreateDeviceCodeRequest.php b/src/Devices/Codes/Requests/CreateDeviceCodeRequest.php new file mode 100644 index 00000000..6868a336 --- /dev/null +++ b/src/Devices/Codes/Requests/CreateDeviceCodeRequest.php @@ -0,0 +1,74 @@ +idempotencyKey = $values['idempotencyKey']; + $this->deviceCode = $values['deviceCode']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return DeviceCode + */ + public function getDeviceCode(): DeviceCode + { + return $this->deviceCode; + } + + /** + * @param DeviceCode $value + */ + public function setDeviceCode(DeviceCode $value): self + { + $this->deviceCode = $value; + return $this; + } +} diff --git a/src/Devices/Codes/Requests/GetCodesRequest.php b/src/Devices/Codes/Requests/GetCodesRequest.php new file mode 100644 index 00000000..4ddb4f5c --- /dev/null +++ b/src/Devices/Codes/Requests/GetCodesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Devices/Codes/Requests/ListCodesRequest.php b/src/Devices/Codes/Requests/ListCodesRequest.php new file mode 100644 index 00000000..d43314e3 --- /dev/null +++ b/src/Devices/Codes/Requests/ListCodesRequest.php @@ -0,0 +1,128 @@ + $status + */ + private ?string $status; + + /** + * @param array{ + * cursor?: ?string, + * locationId?: ?string, + * productType?: ?'TERMINAL_API', + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->productType = $values['productType'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?'TERMINAL_API' + */ + public function getProductType(): ?string + { + return $this->productType; + } + + /** + * @param ?'TERMINAL_API' $value + */ + public function setProductType(?string $value = null): self + { + $this->productType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } +} diff --git a/src/Devices/DevicesClient.php b/src/Devices/DevicesClient.php new file mode 100644 index 00000000..84133f50 --- /dev/null +++ b/src/Devices/DevicesClient.php @@ -0,0 +1,220 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->codes = new CodesClient($this->client, $this->options); + } + + /** + * List devices associated with the merchant. Currently, only Terminal API + * devices are supported. + * + * @param ListDevicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListDevicesRequest $request = new ListDevicesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListDevicesRequest $request) => $this->_list($request, $options), + setCursor: function (ListDevicesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListDevicesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListDevicesResponse $response) => $response?->getDevices() ?? [], + ); + } + + /** + * Retrieves Device with the associated `device_id`. + * + * @param GetDevicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetDeviceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetDevicesRequest $request, ?array $options = null): GetDeviceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/devices/{$request->getDeviceId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetDeviceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * List devices associated with the merchant. Currently, only Terminal API + * devices are supported. + * + * @param ListDevicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListDevicesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListDevicesRequest $request = new ListDevicesRequest(), ?array $options = null): ListDevicesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/devices", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListDevicesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Devices/Requests/GetDevicesRequest.php b/src/Devices/Requests/GetDevicesRequest.php new file mode 100644 index 00000000..3f5bc37d --- /dev/null +++ b/src/Devices/Requests/GetDevicesRequest.php @@ -0,0 +1,41 @@ +deviceId = $values['deviceId']; + } + + /** + * @return string + */ + public function getDeviceId(): string + { + return $this->deviceId; + } + + /** + * @param string $value + */ + public function setDeviceId(string $value): self + { + $this->deviceId = $value; + return $this; + } +} diff --git a/src/Devices/Requests/ListDevicesRequest.php b/src/Devices/Requests/ListDevicesRequest.php new file mode 100644 index 00000000..cf9c74c7 --- /dev/null +++ b/src/Devices/Requests/ListDevicesRequest.php @@ -0,0 +1,122 @@ + $sortOrder + */ + private ?string $sortOrder; + + /** + * @var ?int $limit The number of results to return in a single page. + */ + private ?int $limit; + + /** + * @var ?string $locationId If present, only returns devices at the target location. + */ + private ?string $locationId; + + /** + * @param array{ + * cursor?: ?string, + * sortOrder?: ?value-of, + * limit?: ?int, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Disputes/DisputesClient.php b/src/Disputes/DisputesClient.php new file mode 100644 index 00000000..06377251 --- /dev/null +++ b/src/Disputes/DisputesClient.php @@ -0,0 +1,473 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->evidence = new EvidenceClient($this->client, $this->options); + } + + /** + * Returns a list of disputes associated with a particular account. + * + * @param ListDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListDisputesRequest $request = new ListDisputesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListDisputesRequest $request) => $this->_list($request, $options), + setCursor: function (ListDisputesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListDisputesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListDisputesResponse $response) => $response?->getDisputes() ?? [], + ); + } + + /** + * Returns details about a specific dispute. + * + * @param GetDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetDisputeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetDisputesRequest $request, ?array $options = null): GetDisputeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetDisputeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and + * updates the dispute state to ACCEPTED. + * + * Square debits the disputed amount from the seller’s Square account. If the Square account + * does not have sufficient funds, Square debits the associated bank account. + * + * @param AcceptDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return AcceptDisputeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function accept(AcceptDisputesRequest $request, ?array $options = null): AcceptDisputeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/accept", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return AcceptDisputeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP + * multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. + * + * @param CreateEvidenceFileDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * } $options + * @return CreateDisputeEvidenceFileResponse + * @throws SquareException + * @throws SquareApiException + */ + public function createEvidenceFile(CreateEvidenceFileDisputesRequest $request, ?array $options = null): CreateDisputeEvidenceFileResponse + { + $options = array_merge($this->options, $options ?? []); + $body = new MultipartFormData(); + if ($request->getRequest() != null) { + $body->add( + name: 'request', + value: $request->getRequest()->toJson(), + contentType: 'application/json; charset=utf-8', + ); + } + if ($request->getImageFile() != null) { + $body->addPart( + $request->getImageFile()->toMultipartFormDataPart( + name: 'image_file', + contentType: 'image/jpeg', + ), + ); + } + try { + $response = $this->client->sendRequest( + new MultipartApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/evidence-files", + method: HttpMethod::POST, + body: $body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateDisputeEvidenceFileResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Uploads text to use as evidence for a dispute challenge. + * + * @param CreateDisputeEvidenceTextRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateDisputeEvidenceTextResponse + * @throws SquareException + * @throws SquareApiException + */ + public function createEvidenceText(CreateDisputeEvidenceTextRequest $request, ?array $options = null): CreateDisputeEvidenceTextResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/evidence-text", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateDisputeEvidenceTextResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Submits evidence to the cardholder's bank. + * + * The evidence submitted by this endpoint includes evidence uploaded + * using the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) and + * [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and + * evidence automatically provided by Square, when available. Evidence cannot be removed from + * a dispute after submission. + * + * @param SubmitEvidenceDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SubmitEvidenceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function submitEvidence(SubmitEvidenceDisputesRequest $request, ?array $options = null): SubmitEvidenceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/submit-evidence", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SubmitEvidenceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of disputes associated with a particular account. + * + * @param ListDisputesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListDisputesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListDisputesRequest $request = new ListDisputesRequest(), ?array $options = null): ListDisputesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getStates() != null) { + $query['states'] = $request->getStates(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListDisputesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Disputes/Evidence/EvidenceClient.php b/src/Disputes/Evidence/EvidenceClient.php new file mode 100644 index 00000000..e5b6fd5b --- /dev/null +++ b/src/Disputes/Evidence/EvidenceClient.php @@ -0,0 +1,262 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a list of evidence associated with a dispute. + * + * @param ListEvidenceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListEvidenceRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEvidenceRequest $request) => $this->_list($request, $options), + setCursor: function (ListEvidenceRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListDisputeEvidenceResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListDisputeEvidenceResponse $response) => $response?->getEvidence() ?? [], + ); + } + + /** + * Returns the metadata for the evidence specified in the request URL path. + * + * You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it. + * + * @param GetEvidenceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetDisputeEvidenceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetEvidenceRequest $request, ?array $options = null): GetDisputeEvidenceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/evidence/{$request->getEvidenceId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetDisputeEvidenceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Removes specified evidence from a dispute. + * Square does not send the bank any evidence that is removed. + * + * @param DeleteEvidenceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteDisputeEvidenceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteEvidenceRequest $request, ?array $options = null): DeleteDisputeEvidenceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/evidence/{$request->getEvidenceId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteDisputeEvidenceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of evidence associated with a dispute. + * + * @param ListEvidenceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListDisputeEvidenceResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListEvidenceRequest $request, ?array $options = null): ListDisputeEvidenceResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/disputes/{$request->getDisputeId()}/evidence", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListDisputeEvidenceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Disputes/Evidence/Requests/DeleteEvidenceRequest.php b/src/Disputes/Evidence/Requests/DeleteEvidenceRequest.php new file mode 100644 index 00000000..eaee90bd --- /dev/null +++ b/src/Disputes/Evidence/Requests/DeleteEvidenceRequest.php @@ -0,0 +1,65 @@ +disputeId = $values['disputeId']; + $this->evidenceId = $values['evidenceId']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return string + */ + public function getEvidenceId(): string + { + return $this->evidenceId; + } + + /** + * @param string $value + */ + public function setEvidenceId(string $value): self + { + $this->evidenceId = $value; + return $this; + } +} diff --git a/src/Disputes/Evidence/Requests/GetEvidenceRequest.php b/src/Disputes/Evidence/Requests/GetEvidenceRequest.php new file mode 100644 index 00000000..e54023a3 --- /dev/null +++ b/src/Disputes/Evidence/Requests/GetEvidenceRequest.php @@ -0,0 +1,65 @@ +disputeId = $values['disputeId']; + $this->evidenceId = $values['evidenceId']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return string + */ + public function getEvidenceId(): string + { + return $this->evidenceId; + } + + /** + * @param string $value + */ + public function setEvidenceId(string $value): self + { + $this->evidenceId = $value; + return $this; + } +} diff --git a/src/Disputes/Evidence/Requests/ListEvidenceRequest.php b/src/Disputes/Evidence/Requests/ListEvidenceRequest.php new file mode 100644 index 00000000..d2bd4f08 --- /dev/null +++ b/src/Disputes/Evidence/Requests/ListEvidenceRequest.php @@ -0,0 +1,69 @@ +disputeId = $values['disputeId']; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/AcceptDisputesRequest.php b/src/Disputes/Requests/AcceptDisputesRequest.php new file mode 100644 index 00000000..eb2339e9 --- /dev/null +++ b/src/Disputes/Requests/AcceptDisputesRequest.php @@ -0,0 +1,41 @@ +disputeId = $values['disputeId']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/CreateDisputeEvidenceTextRequest.php b/src/Disputes/Requests/CreateDisputeEvidenceTextRequest.php new file mode 100644 index 00000000..e460629a --- /dev/null +++ b/src/Disputes/Requests/CreateDisputeEvidenceTextRequest.php @@ -0,0 +1,121 @@ + $evidenceType + */ + #[JsonProperty('evidence_type')] + private ?string $evidenceType; + + /** + * @var string $evidenceText The evidence string. + */ + #[JsonProperty('evidence_text')] + private string $evidenceText; + + /** + * @param array{ + * disputeId: string, + * idempotencyKey: string, + * evidenceText: string, + * evidenceType?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->disputeId = $values['disputeId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->evidenceType = $values['evidenceType'] ?? null; + $this->evidenceText = $values['evidenceText']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEvidenceType(): ?string + { + return $this->evidenceType; + } + + /** + * @param ?value-of $value + */ + public function setEvidenceType(?string $value = null): self + { + $this->evidenceType = $value; + return $this; + } + + /** + * @return string + */ + public function getEvidenceText(): string + { + return $this->evidenceText; + } + + /** + * @param string $value + */ + public function setEvidenceText(string $value): self + { + $this->evidenceText = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/CreateEvidenceFileDisputesRequest.php b/src/Disputes/Requests/CreateEvidenceFileDisputesRequest.php new file mode 100644 index 00000000..ee838973 --- /dev/null +++ b/src/Disputes/Requests/CreateEvidenceFileDisputesRequest.php @@ -0,0 +1,93 @@ +disputeId = $values['disputeId']; + $this->request = $values['request'] ?? null; + $this->imageFile = $values['imageFile'] ?? null; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return ?CreateDisputeEvidenceFileRequest + */ + public function getRequest(): ?CreateDisputeEvidenceFileRequest + { + return $this->request; + } + + /** + * @param ?CreateDisputeEvidenceFileRequest $value + */ + public function setRequest(?CreateDisputeEvidenceFileRequest $value = null): self + { + $this->request = $value; + return $this; + } + + /** + * @return ?File + */ + public function getImageFile(): ?File + { + return $this->imageFile; + } + + /** + * @param ?File $value + */ + public function setImageFile(?File $value = null): self + { + $this->imageFile = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/GetDisputesRequest.php b/src/Disputes/Requests/GetDisputesRequest.php new file mode 100644 index 00000000..8cd12927 --- /dev/null +++ b/src/Disputes/Requests/GetDisputesRequest.php @@ -0,0 +1,41 @@ +disputeId = $values['disputeId']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/ListDisputesRequest.php b/src/Disputes/Requests/ListDisputesRequest.php new file mode 100644 index 00000000..a2287b66 --- /dev/null +++ b/src/Disputes/Requests/ListDisputesRequest.php @@ -0,0 +1,97 @@ + $states The dispute states used to filter the result. If not specified, the endpoint returns all disputes. + */ + private ?string $states; + + /** + * The ID of the location for which to return a list of disputes. + * If not specified, the endpoint returns disputes associated with all locations. + * + * @var ?string $locationId + */ + private ?string $locationId; + + /** + * @param array{ + * cursor?: ?string, + * states?: ?value-of, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->states = $values['states'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStates(): ?string + { + return $this->states; + } + + /** + * @param ?value-of $value + */ + public function setStates(?string $value = null): self + { + $this->states = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Disputes/Requests/SubmitEvidenceDisputesRequest.php b/src/Disputes/Requests/SubmitEvidenceDisputesRequest.php new file mode 100644 index 00000000..4de64887 --- /dev/null +++ b/src/Disputes/Requests/SubmitEvidenceDisputesRequest.php @@ -0,0 +1,41 @@ +disputeId = $values['disputeId']; + } + + /** + * @return string + */ + public function getDisputeId(): string + { + return $this->disputeId; + } + + /** + * @param string $value + */ + public function setDisputeId(string $value): self + { + $this->disputeId = $value; + return $this; + } +} diff --git a/src/Employees/EmployeesClient.php b/src/Employees/EmployeesClient.php new file mode 100644 index 00000000..b4c2e25a --- /dev/null +++ b/src/Employees/EmployeesClient.php @@ -0,0 +1,211 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * + * + * @param ListEmployeesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListEmployeesRequest $request = new ListEmployeesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEmployeesRequest $request) => $this->_list($request, $options), + setCursor: function (ListEmployeesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListEmployeesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListEmployeesResponse $response) => $response?->getEmployees() ?? [], + ); + } + + /** + * + * + * @param GetEmployeesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetEmployeeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetEmployeesRequest $request, ?array $options = null): GetEmployeeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/employees/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetEmployeeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * + * + * @param ListEmployeesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListEmployeesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListEmployeesRequest $request = new ListEmployeesRequest(), ?array $options = null): ListEmployeesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getStatus() != null) { + $query['status'] = $request->getStatus(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/employees", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListEmployeesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Employees/Requests/GetEmployeesRequest.php b/src/Employees/Requests/GetEmployeesRequest.php new file mode 100644 index 00000000..53f8a9e7 --- /dev/null +++ b/src/Employees/Requests/GetEmployeesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Employees/Requests/ListEmployeesRequest.php b/src/Employees/Requests/ListEmployeesRequest.php new file mode 100644 index 00000000..a41afeec --- /dev/null +++ b/src/Employees/Requests/ListEmployeesRequest.php @@ -0,0 +1,114 @@ + $status Specifies the EmployeeStatus to filter the employee by. + */ + private ?string $status; + + /** + * @var ?int $limit The number of employees to be returned on each page. + */ + private ?int $limit; + + /** + * @var ?string $cursor The token required to retrieve the specified page of results. + */ + private ?string $cursor; + + /** + * @param array{ + * locationId?: ?string, + * status?: ?value-of, + * limit?: ?int, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->status = $values['status'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Environment.php b/src/Environment.php deleted file mode 100644 index 5805897a..00000000 --- a/src/Environment.php +++ /dev/null @@ -1,17 +0,0 @@ -, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Search for Square API events that occur within a 28-day timeframe. + * + * @param SearchEventsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function searchEvents(SearchEventsRequest $request = new SearchEventsRequest(), ?array $options = null): SearchEventsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/events", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Disables events to prevent them from being searchable. + * All events are disabled by default. You must enable events to make them searchable. + * Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DisableEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function disableEvents(?array $options = null): DisableEventsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/events/disable", + method: HttpMethod::PUT, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DisableEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Enables events to make them searchable. Only events that occur while in the enabled state are searchable. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return EnableEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function enableEvents(?array $options = null): EnableEventsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/events/enable", + method: HttpMethod::PUT, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return EnableEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all event types that you can subscribe to as webhooks or query using the Events API. + * + * @param ListEventTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListEventTypesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function listEventTypes(ListEventTypesRequest $request = new ListEventTypesRequest(), ?array $options = null): ListEventTypesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getApiVersion() != null) { + $query['api_version'] = $request->getApiVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/events/types", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListEventTypesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Events/Requests/ListEventTypesRequest.php b/src/Events/Requests/ListEventTypesRequest.php new file mode 100644 index 00000000..431b6018 --- /dev/null +++ b/src/Events/Requests/ListEventTypesRequest.php @@ -0,0 +1,41 @@ +apiVersion = $values['apiVersion'] ?? null; + } + + /** + * @return ?string + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + + /** + * @param ?string $value + */ + public function setApiVersion(?string $value = null): self + { + $this->apiVersion = $value; + return $this; + } +} diff --git a/src/Events/Requests/SearchEventsRequest.php b/src/Events/Requests/SearchEventsRequest.php new file mode 100644 index 00000000..a62fccd0 --- /dev/null +++ b/src/Events/Requests/SearchEventsRequest.php @@ -0,0 +1,104 @@ +cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->query = $values['query'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?SearchEventsQuery + */ + public function getQuery(): ?SearchEventsQuery + { + return $this->query; + } + + /** + * @param ?SearchEventsQuery $value + */ + public function setQuery(?SearchEventsQuery $value = null): self + { + $this->query = $value; + return $this; + } +} diff --git a/src/Exceptions/ApiException.php b/src/Exceptions/ApiException.php deleted file mode 100644 index b44fe13a..00000000 --- a/src/Exceptions/ApiException.php +++ /dev/null @@ -1,65 +0,0 @@ -getStatusCode()); - $this->request = $request; - $this->response = $response; - } - - /** - * Returns the HTTP request - */ - public function getHttpRequest(): HttpRequest - { - return $this->request; - } - - /** - * Returns the HTTP response - */ - public function getHttpResponse(): ?HttpResponse - { - return $this->response; - } - - /** - * Is the response available? - */ - public function hasResponse(): bool - { - return !\is_null($this->response); - } -} diff --git a/src/Exceptions/SquareApiException.php b/src/Exceptions/SquareApiException.php new file mode 100644 index 00000000..234ab459 --- /dev/null +++ b/src/Exceptions/SquareApiException.php @@ -0,0 +1,53 @@ +body = $body; + parent::__construct($message, $statusCode, $previous); + } + + /** + * Returns the body of the response that triggered the exception. + * + * @return mixed + */ + public function getBody(): mixed + { + return $this->body; + } + + /** + * @return string + */ + public function __toString(): string + { + if (empty($this->body)) { + return "$this->message; Status Code: $this->code\n"; + } + return "$this->message; Status Code: $this->code; Body: " . $this->body . "\n"; + } +} diff --git a/src/Exceptions/SquareException.php b/src/Exceptions/SquareException.php new file mode 100644 index 00000000..e15b2d0c --- /dev/null +++ b/src/Exceptions/SquareException.php @@ -0,0 +1,12 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists gift card activities. By default, you get gift card activities for all + * gift cards in the seller's account. You can optionally specify query parameters to + * filter the list. For example, you can get a list of gift card activities for a gift card, + * for all gift cards in a specific region, or for activities within a time window. + * + * @param ListActivitiesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListActivitiesRequest $request = new ListActivitiesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListActivitiesRequest $request) => $this->_list($request, $options), + setCursor: function (ListActivitiesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListGiftCardActivitiesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListGiftCardActivitiesResponse $response) => $response?->getGiftCardActivities() ?? [], + ); + } + + /** + * Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard). + * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. + * + * @param CreateGiftCardActivityRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateGiftCardActivityResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateGiftCardActivityRequest $request, ?array $options = null): CreateGiftCardActivityResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/activities", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateGiftCardActivityResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists gift card activities. By default, you get gift card activities for all + * gift cards in the seller's account. You can optionally specify query parameters to + * filter the list. For example, you can get a list of gift card activities for a gift card, + * for all gift cards in a specific region, or for activities within a time window. + * + * @param ListActivitiesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListGiftCardActivitiesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListActivitiesRequest $request = new ListActivitiesRequest(), ?array $options = null): ListGiftCardActivitiesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getGiftCardId() != null) { + $query['gift_card_id'] = $request->getGiftCardId(); + } + if ($request->getType() != null) { + $query['type'] = $request->getType(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/activities", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListGiftCardActivitiesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/GiftCards/Activities/Requests/CreateGiftCardActivityRequest.php b/src/GiftCards/Activities/Requests/CreateGiftCardActivityRequest.php new file mode 100644 index 00000000..c222ef54 --- /dev/null +++ b/src/GiftCards/Activities/Requests/CreateGiftCardActivityRequest.php @@ -0,0 +1,72 @@ +idempotencyKey = $values['idempotencyKey']; + $this->giftCardActivity = $values['giftCardActivity']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return GiftCardActivity + */ + public function getGiftCardActivity(): GiftCardActivity + { + return $this->giftCardActivity; + } + + /** + * @param GiftCardActivity $value + */ + public function setGiftCardActivity(GiftCardActivity $value): self + { + $this->giftCardActivity = $value; + return $this; + } +} diff --git a/src/GiftCards/Activities/Requests/ListActivitiesRequest.php b/src/GiftCards/Activities/Requests/ListActivitiesRequest.php new file mode 100644 index 00000000..122d4cad --- /dev/null +++ b/src/GiftCards/Activities/Requests/ListActivitiesRequest.php @@ -0,0 +1,238 @@ +giftCardId = $values['giftCardId'] ?? null; + $this->type = $values['type'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return ?string + */ + public function getGiftCardId(): ?string + { + return $this->giftCardId; + } + + /** + * @param ?string $value + */ + public function setGiftCardId(?string $value = null): self + { + $this->giftCardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?string $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?string $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } +} diff --git a/src/GiftCards/GiftCardsClient.php b/src/GiftCards/GiftCardsClient.php new file mode 100644 index 00000000..1e20719f --- /dev/null +++ b/src/GiftCards/GiftCardsClient.php @@ -0,0 +1,517 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->activities = new ActivitiesClient($this->client, $this->options); + } + + /** + * Lists all gift cards. You can specify optional filters to retrieve + * a subset of the gift cards. Results are sorted by `created_at` in ascending order. + * + * @param ListGiftCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListGiftCardsRequest $request = new ListGiftCardsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListGiftCardsRequest $request) => $this->_list($request, $options), + setCursor: function (ListGiftCardsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListGiftCardsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListGiftCardsResponse $response) => $response?->getGiftCards() ?? [], + ); + } + + /** + * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card + * has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call + * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE` + * activity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment) + * to refund a payment to the new gift card. + * + * @param CreateGiftCardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateGiftCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateGiftCardRequest $request, ?array $options = null): CreateGiftCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateGiftCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a gift card using the gift card account number (GAN). + * + * @param GetGiftCardFromGanRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetGiftCardFromGanResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getFromGan(GetGiftCardFromGanRequest $request, ?array $options = null): GetGiftCardFromGanResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/from-gan", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetGiftCardFromGanResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a gift card using a secure payment token that represents the gift card. + * + * @param GetGiftCardFromNonceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetGiftCardFromNonceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getFromNonce(GetGiftCardFromNonceRequest $request, ?array $options = null): GetGiftCardFromNonceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/from-nonce", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetGiftCardFromNonceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Links a customer to a gift card, which is also referred to as adding a card on file. + * + * @param LinkCustomerToGiftCardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return LinkCustomerToGiftCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function linkCustomer(LinkCustomerToGiftCardRequest $request, ?array $options = null): LinkCustomerToGiftCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/{$request->getGiftCardId()}/link-customer", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return LinkCustomerToGiftCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Unlinks a customer from a gift card, which is also referred to as removing a card on file. + * + * @param UnlinkCustomerFromGiftCardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UnlinkCustomerFromGiftCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function unlinkCustomer(UnlinkCustomerFromGiftCardRequest $request, ?array $options = null): UnlinkCustomerFromGiftCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/{$request->getGiftCardId()}/unlink-customer", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UnlinkCustomerFromGiftCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a gift card using the gift card ID. + * + * @param GetGiftCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetGiftCardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetGiftCardsRequest $request, ?array $options = null): GetGiftCardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetGiftCardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all gift cards. You can specify optional filters to retrieve + * a subset of the gift cards. Results are sorted by `created_at` in ascending order. + * + * @param ListGiftCardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListGiftCardsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListGiftCardsRequest $request = new ListGiftCardsRequest(), ?array $options = null): ListGiftCardsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getType() != null) { + $query['type'] = $request->getType(); + } + if ($request->getState() != null) { + $query['state'] = $request->getState(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getCustomerId() != null) { + $query['customer_id'] = $request->getCustomerId(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/gift-cards", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListGiftCardsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/GiftCards/Requests/CreateGiftCardRequest.php b/src/GiftCards/Requests/CreateGiftCardRequest.php new file mode 100644 index 00000000..e2812474 --- /dev/null +++ b/src/GiftCards/Requests/CreateGiftCardRequest.php @@ -0,0 +1,117 @@ +idempotencyKey = $values['idempotencyKey']; + $this->locationId = $values['locationId']; + $this->giftCard = $values['giftCard']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return GiftCard + */ + public function getGiftCard(): GiftCard + { + return $this->giftCard; + } + + /** + * @param GiftCard $value + */ + public function setGiftCard(GiftCard $value): self + { + $this->giftCard = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/GetGiftCardFromGanRequest.php b/src/GiftCards/Requests/GetGiftCardFromGanRequest.php new file mode 100644 index 00000000..62a31179 --- /dev/null +++ b/src/GiftCards/Requests/GetGiftCardFromGanRequest.php @@ -0,0 +1,47 @@ +gan = $values['gan']; + } + + /** + * @return string + */ + public function getGan(): string + { + return $this->gan; + } + + /** + * @param string $value + */ + public function setGan(string $value): self + { + $this->gan = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/GetGiftCardFromNonceRequest.php b/src/GiftCards/Requests/GetGiftCardFromNonceRequest.php new file mode 100644 index 00000000..971da114 --- /dev/null +++ b/src/GiftCards/Requests/GetGiftCardFromNonceRequest.php @@ -0,0 +1,46 @@ +nonce = $values['nonce']; + } + + /** + * @return string + */ + public function getNonce(): string + { + return $this->nonce; + } + + /** + * @param string $value + */ + public function setNonce(string $value): self + { + $this->nonce = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/GetGiftCardsRequest.php b/src/GiftCards/Requests/GetGiftCardsRequest.php new file mode 100644 index 00000000..63e6778b --- /dev/null +++ b/src/GiftCards/Requests/GetGiftCardsRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/LinkCustomerToGiftCardRequest.php b/src/GiftCards/Requests/LinkCustomerToGiftCardRequest.php new file mode 100644 index 00000000..9c4572d9 --- /dev/null +++ b/src/GiftCards/Requests/LinkCustomerToGiftCardRequest.php @@ -0,0 +1,67 @@ +giftCardId = $values['giftCardId']; + $this->customerId = $values['customerId']; + } + + /** + * @return string + */ + public function getGiftCardId(): string + { + return $this->giftCardId; + } + + /** + * @param string $value + */ + public function setGiftCardId(string $value): self + { + $this->giftCardId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/ListGiftCardsRequest.php b/src/GiftCards/Requests/ListGiftCardsRequest.php new file mode 100644 index 00000000..108b9e5a --- /dev/null +++ b/src/GiftCards/Requests/ListGiftCardsRequest.php @@ -0,0 +1,152 @@ +type = $values['type'] ?? null; + $this->state = $values['state'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->customerId = $values['customerId'] ?? null; + } + + /** + * @return ?string + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?string $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?string $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } +} diff --git a/src/GiftCards/Requests/UnlinkCustomerFromGiftCardRequest.php b/src/GiftCards/Requests/UnlinkCustomerFromGiftCardRequest.php new file mode 100644 index 00000000..f06e5d71 --- /dev/null +++ b/src/GiftCards/Requests/UnlinkCustomerFromGiftCardRequest.php @@ -0,0 +1,67 @@ +giftCardId = $values['giftCardId']; + $this->customerId = $values['customerId']; + } + + /** + * @return string + */ + public function getGiftCardId(): string + { + return $this->giftCardId; + } + + /** + * @param string $value + */ + public function setGiftCardId(string $value): self + { + $this->giftCardId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } +} diff --git a/src/Http/ApiResponse.php b/src/Http/ApiResponse.php deleted file mode 100644 index d9b03382..00000000 --- a/src/Http/ApiResponse.php +++ /dev/null @@ -1,111 +0,0 @@ -getRequest(); - $statusCode = $context->getResponse()->getStatusCode(); - $reasonPhrase = null; // TODO - $headers = $context->getResponse()->getHeaders(); - $body = $context->getResponse()->getRawBody(); - - if (!is_array($decodedBody)) { - $decodedBody = (array) $decodedBody; - } - $cursor = $decodedBody['cursor'] ?? null; - $errors = []; - if ($statusCode >= 400 && $statusCode < 600) { - if (isset($decodedBody['errors'])) { - $errors = ApiHelper::getJsonHelper()->mapClass($decodedBody['errors'], Error::class, 1); - } else { - $error = new Error('V1_ERROR', $decodedBody['type'] ?? 'Unknown'); - $error->setDetail($decodedBody['message'] ?? null); - $error->setField($decodedBody['field'] ?? null); - $errors = [$error]; - } - } - return new self($request, $statusCode, $reasonPhrase, $headers, $result, $body, $errors, $cursor); - } - - /** - * @var Error[] - */ - private $errors; - - /** - * @var mixed - */ - private $cursor; - - /** - * @param HttpRequest $request - * @param int|null $statusCode - * @param string|null $reasonPhrase - * @param array|null $headers - * @param mixed $result - * @param mixed $body - * @param Error[] $errors - * @param mixed $cursor - */ - public function __construct( - HttpRequest $request, - ?int $statusCode, - ?string $reasonPhrase, - ?array $headers, - $result, - $body, - array $errors, - $cursor - ) { - parent::__construct($request, $statusCode, $reasonPhrase, $headers, $result, $body); - $this->errors = $errors; - $this->cursor = $cursor; - } - - /** - * Returns the errors if any. - * - * @return Error[] - */ - public function getErrors(): array - { - return $this->errors; - } - - /** - * Returns the pagination cursor. - * - * @return mixed - */ - public function getCursor() - { - return $this->cursor; - } - - /** - * Returns the original request that resulted in this response. - */ - public function getRequest(): HttpRequest - { - return $this->request; - } -} diff --git a/src/Http/HttpCallBack.php b/src/Http/HttpCallBack.php deleted file mode 100644 index 234f1897..00000000 --- a/src/Http/HttpCallBack.php +++ /dev/null @@ -1,14 +0,0 @@ -request; - } - - /** - * Returns the HTTP Response - * - * @return HttpResponse response - */ - public function getResponse(): HttpResponse - { - return $this->response; - } -} diff --git a/src/Http/HttpMethod.php b/src/Http/HttpMethod.php deleted file mode 100644 index e7364473..00000000 --- a/src/Http/HttpMethod.php +++ /dev/null @@ -1,20 +0,0 @@ -, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL + * is updated to conform to the standard convention. + * + * @param DeprecatedGetAdjustmentInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryAdjustmentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deprecatedGetAdjustment(DeprecatedGetAdjustmentInventoryRequest $request, ?array $options = null): GetInventoryAdjustmentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/adjustment/{$request->getAdjustmentId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryAdjustmentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns the [InventoryAdjustment](entity:InventoryAdjustment) object + * with the provided `adjustment_id`. + * + * @param GetAdjustmentInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryAdjustmentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getAdjustment(GetAdjustmentInventoryRequest $request, ?array $options = null): GetInventoryAdjustmentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/adjustments/{$request->getAdjustmentId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryAdjustmentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL + * is updated to conform to the standard convention. + * + * @param BatchChangeInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchChangeInventoryResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deprecatedBatchChange(BatchChangeInventoryRequest $request, ?array $options = null): BatchChangeInventoryResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/batch-change", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchChangeInventoryResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL + * is updated to conform to the standard convention. + * + * @param BatchRetrieveInventoryChangesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetInventoryChangesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deprecatedBatchGetChanges(BatchRetrieveInventoryChangesRequest $request, ?array $options = null): BatchGetInventoryChangesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/batch-retrieve-changes", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetInventoryChangesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL + * is updated to conform to the standard convention. + * + * @param BatchGetInventoryCountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetInventoryCountsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deprecatedBatchGetCounts(BatchGetInventoryCountsRequest $request, ?array $options = null): BatchGetInventoryCountsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/batch-retrieve-counts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetInventoryCountsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Applies adjustments and counts to the provided item quantities. + * + * On success: returns the current calculated counts for all objects + * referenced in the request. + * On failure: returns a list of related errors. + * + * @param BatchChangeInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchChangeInventoryResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchCreateChanges(BatchChangeInventoryRequest $request, ?array $options = null): BatchChangeInventoryResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/changes/batch-create", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchChangeInventoryResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns historical physical counts and adjustments based on the + * provided filter criteria. + * + * Results are paginated and sorted in ascending order according their + * `occurred_at` timestamp (oldest first). + * + * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries + * that cannot be handled by other, simpler endpoints. + * + * @param BatchRetrieveInventoryChangesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function batchGetChanges(BatchRetrieveInventoryChangesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (BatchRetrieveInventoryChangesRequest $request) => $this->_batchGetChanges($request, $options), + setCursor: function (BatchRetrieveInventoryChangesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (BatchGetInventoryChangesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (BatchGetInventoryChangesResponse $response) => $response?->getChanges() ?? [], + ); + } + + /** + * Returns current counts for the provided + * [CatalogObject](entity:CatalogObject)s at the requested + * [Location](entity:Location)s. + * + * Results are paginated and sorted in descending order according to their + * `calculated_at` timestamp (newest first). + * + * When `updated_after` is specified, only counts that have changed since that + * time (based on the server timestamp for the most recent change) are + * returned. This allows clients to perform a "sync" operation, for example + * in response to receiving a Webhook notification. + * + * @param BatchGetInventoryCountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function batchGetCounts(BatchGetInventoryCountsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (BatchGetInventoryCountsRequest $request) => $this->_batchGetCounts($request, $options), + setCursor: function (BatchGetInventoryCountsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (BatchGetInventoryCountsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (BatchGetInventoryCountsResponse $response) => $response?->getCounts() ?? [], + ); + } + + /** + * Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL + * is updated to conform to the standard convention. + * + * @param DeprecatedGetPhysicalCountInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryPhysicalCountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deprecatedGetPhysicalCount(DeprecatedGetPhysicalCountInventoryRequest $request, ?array $options = null): GetInventoryPhysicalCountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/physical-count/{$request->getPhysicalCountId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryPhysicalCountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) + * object with the provided `physical_count_id`. + * + * @param GetPhysicalCountInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryPhysicalCountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getPhysicalCount(GetPhysicalCountInventoryRequest $request, ?array $options = null): GetInventoryPhysicalCountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/physical-counts/{$request->getPhysicalCountId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryPhysicalCountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns the [InventoryTransfer](entity:InventoryTransfer) object + * with the provided `transfer_id`. + * + * @param GetTransferInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryTransferResponse + * @throws SquareException + * @throws SquareApiException + */ + public function getTransfer(GetTransferInventoryRequest $request, ?array $options = null): GetInventoryTransferResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/transfers/{$request->getTransferId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryTransferResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the current calculated stock count for a given + * [CatalogObject](entity:CatalogObject) at a given set of + * [Location](entity:Location)s. Responses are paginated and unsorted. + * For more sophisticated queries, use a batch endpoint. + * + * @param GetInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function get(GetInventoryRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (GetInventoryRequest $request) => $this->_get($request, $options), + setCursor: function (GetInventoryRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (GetInventoryCountResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (GetInventoryCountResponse $response) => $response?->getCounts() ?? [], + ); + } + + /** + * Returns a set of physical counts and inventory adjustments for the + * provided [CatalogObject](entity:CatalogObject) at the requested + * [Location](entity:Location)s. + * + * You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + * and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. + * + * Results are paginated and sorted in descending order according to their + * `occurred_at` timestamp (newest first). + * + * There are no limits on how far back the caller can page. This endpoint can be + * used to display recent changes for a specific item. For more + * sophisticated queries, use a batch endpoint. + * + * @param ChangesInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function changes(ChangesInventoryRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ChangesInventoryRequest $request) => $this->_changes($request, $options), + setCursor: function (ChangesInventoryRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (GetInventoryChangesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (GetInventoryChangesResponse $response) => $response?->getChanges() ?? [], + ); + } + + /** + * Returns historical physical counts and adjustments based on the + * provided filter criteria. + * + * Results are paginated and sorted in ascending order according their + * `occurred_at` timestamp (oldest first). + * + * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries + * that cannot be handled by other, simpler endpoints. + * + * @param BatchRetrieveInventoryChangesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetInventoryChangesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _batchGetChanges(BatchRetrieveInventoryChangesRequest $request, ?array $options = null): BatchGetInventoryChangesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/changes/batch-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetInventoryChangesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns current counts for the provided + * [CatalogObject](entity:CatalogObject)s at the requested + * [Location](entity:Location)s. + * + * Results are paginated and sorted in descending order according to their + * `calculated_at` timestamp (newest first). + * + * When `updated_after` is specified, only counts that have changed since that + * time (based on the server timestamp for the most recent change) are + * returned. This allows clients to perform a "sync" operation, for example + * in response to receiving a Webhook notification. + * + * @param BatchGetInventoryCountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetInventoryCountsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _batchGetCounts(BatchGetInventoryCountsRequest $request, ?array $options = null): BatchGetInventoryCountsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/counts/batch-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetInventoryCountsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the current calculated stock count for a given + * [CatalogObject](entity:CatalogObject) at a given set of + * [Location](entity:Location)s. Responses are paginated and unsorted. + * For more sophisticated queries, use a batch endpoint. + * + * @param GetInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryCountResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _get(GetInventoryRequest $request, ?array $options = null): GetInventoryCountResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLocationIds() != null) { + $query['location_ids'] = $request->getLocationIds(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/{$request->getCatalogObjectId()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryCountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a set of physical counts and inventory adjustments for the + * provided [CatalogObject](entity:CatalogObject) at the requested + * [Location](entity:Location)s. + * + * You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + * and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. + * + * Results are paginated and sorted in descending order according to their + * `occurred_at` timestamp (newest first). + * + * There are no limits on how far back the caller can page. This endpoint can be + * used to display recent changes for a specific item. For more + * sophisticated queries, use a batch endpoint. + * + * @param ChangesInventoryRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInventoryChangesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _changes(ChangesInventoryRequest $request, ?array $options = null): GetInventoryChangesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLocationIds() != null) { + $query['location_ids'] = $request->getLocationIds(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/inventory/{$request->getCatalogObjectId()}/changes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInventoryChangesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Inventory/Requests/ChangesInventoryRequest.php b/src/Inventory/Requests/ChangesInventoryRequest.php new file mode 100644 index 00000000..b6b18835 --- /dev/null +++ b/src/Inventory/Requests/ChangesInventoryRequest.php @@ -0,0 +1,97 @@ +catalogObjectId = $values['catalogObjectId']; + $this->locationIds = $values['locationIds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getCatalogObjectId(): string + { + return $this->catalogObjectId; + } + + /** + * @param string $value + */ + public function setCatalogObjectId(string $value): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationIds(): ?string + { + return $this->locationIds; + } + + /** + * @param ?string $value + */ + public function setLocationIds(?string $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/DeprecatedGetAdjustmentInventoryRequest.php b/src/Inventory/Requests/DeprecatedGetAdjustmentInventoryRequest.php new file mode 100644 index 00000000..137cbfe4 --- /dev/null +++ b/src/Inventory/Requests/DeprecatedGetAdjustmentInventoryRequest.php @@ -0,0 +1,41 @@ +adjustmentId = $values['adjustmentId']; + } + + /** + * @return string + */ + public function getAdjustmentId(): string + { + return $this->adjustmentId; + } + + /** + * @param string $value + */ + public function setAdjustmentId(string $value): self + { + $this->adjustmentId = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/DeprecatedGetPhysicalCountInventoryRequest.php b/src/Inventory/Requests/DeprecatedGetPhysicalCountInventoryRequest.php new file mode 100644 index 00000000..b793f3bf --- /dev/null +++ b/src/Inventory/Requests/DeprecatedGetPhysicalCountInventoryRequest.php @@ -0,0 +1,44 @@ +physicalCountId = $values['physicalCountId']; + } + + /** + * @return string + */ + public function getPhysicalCountId(): string + { + return $this->physicalCountId; + } + + /** + * @param string $value + */ + public function setPhysicalCountId(string $value): self + { + $this->physicalCountId = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/GetAdjustmentInventoryRequest.php b/src/Inventory/Requests/GetAdjustmentInventoryRequest.php new file mode 100644 index 00000000..52d91287 --- /dev/null +++ b/src/Inventory/Requests/GetAdjustmentInventoryRequest.php @@ -0,0 +1,41 @@ +adjustmentId = $values['adjustmentId']; + } + + /** + * @return string + */ + public function getAdjustmentId(): string + { + return $this->adjustmentId; + } + + /** + * @param string $value + */ + public function setAdjustmentId(string $value): self + { + $this->adjustmentId = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/GetInventoryRequest.php b/src/Inventory/Requests/GetInventoryRequest.php new file mode 100644 index 00000000..5c40f0c7 --- /dev/null +++ b/src/Inventory/Requests/GetInventoryRequest.php @@ -0,0 +1,97 @@ +catalogObjectId = $values['catalogObjectId']; + $this->locationIds = $values['locationIds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getCatalogObjectId(): string + { + return $this->catalogObjectId; + } + + /** + * @param string $value + */ + public function setCatalogObjectId(string $value): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationIds(): ?string + { + return $this->locationIds; + } + + /** + * @param ?string $value + */ + public function setLocationIds(?string $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/GetPhysicalCountInventoryRequest.php b/src/Inventory/Requests/GetPhysicalCountInventoryRequest.php new file mode 100644 index 00000000..d22ae995 --- /dev/null +++ b/src/Inventory/Requests/GetPhysicalCountInventoryRequest.php @@ -0,0 +1,44 @@ +physicalCountId = $values['physicalCountId']; + } + + /** + * @return string + */ + public function getPhysicalCountId(): string + { + return $this->physicalCountId; + } + + /** + * @param string $value + */ + public function setPhysicalCountId(string $value): self + { + $this->physicalCountId = $value; + return $this; + } +} diff --git a/src/Inventory/Requests/GetTransferInventoryRequest.php b/src/Inventory/Requests/GetTransferInventoryRequest.php new file mode 100644 index 00000000..82d073d7 --- /dev/null +++ b/src/Inventory/Requests/GetTransferInventoryRequest.php @@ -0,0 +1,41 @@ +transferId = $values['transferId']; + } + + /** + * @return string + */ + public function getTransferId(): string + { + return $this->transferId; + } + + /** + * @param string $value + */ + public function setTransferId(string $value): self + { + $this->transferId = $value; + return $this; + } +} diff --git a/src/Invoices/InvoicesClient.php b/src/Invoices/InvoicesClient.php new file mode 100644 index 00000000..ea667085 --- /dev/null +++ b/src/Invoices/InvoicesClient.php @@ -0,0 +1,732 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a list of invoices for a given location. The response + * is paginated. If truncated, the response includes a `cursor` that you + * use in a subsequent request to retrieve the next set of invoices. + * + * @param ListInvoicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListInvoicesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListInvoicesRequest $request) => $this->_list($request, $options), + setCursor: function (ListInvoicesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListInvoicesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListInvoicesResponse $response) => $response?->getInvoices() ?? [], + ); + } + + /** + * Creates a draft [invoice](entity:Invoice) + * for an order created using the Orders API. + * + * A draft invoice remains in your account and no action is taken. + * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). + * + * @param CreateInvoiceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateInvoiceRequest $request, ?array $options = null): CreateInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for invoices from a location specified in + * the filter. You can optionally specify customers in the filter for whom to + * retrieve invoices. In the current implementation, you can only specify one location and + * optionally one customer. + * + * The response is paginated. If truncated, the response includes a `cursor` + * that you use in a subsequent request to retrieve the next set of invoices. + * + * @param SearchInvoicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchInvoicesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchInvoicesRequest $request, ?array $options = null): SearchInvoicesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchInvoicesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves an invoice by invoice ID. + * + * @param GetInvoicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetInvoicesRequest $request, ?array $options = null): GetInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an invoice. This endpoint supports sparse updates, so you only need + * to specify the fields you want to change along with the required `version` field. + * Some restrictions apply to updating invoices. For example, you cannot change the + * `order_id` or `location_id` field. + * + * @param UpdateInvoiceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateInvoiceRequest $request, ?array $options = null): UpdateInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes the specified invoice. When an invoice is deleted, the + * associated order status changes to CANCELED. You can only delete a draft + * invoice (you cannot delete a published invoice, including one that is scheduled for processing). + * + * @param DeleteInvoicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteInvoicesRequest $request, ?array $options = null): DeleteInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}", + method: HttpMethod::DELETE, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads + * with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file + * in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. + * + * Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices + * in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + * + * @param CreateInvoiceAttachmentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * } $options + * @return CreateInvoiceAttachmentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function createInvoiceAttachment(CreateInvoiceAttachmentRequest $request, ?array $options = null): CreateInvoiceAttachmentResponse + { + $options = array_merge($this->options, $options ?? []); + $body = new MultipartFormData(); + if ($request->getRequest() != null) { + $body->add( + name: 'request', + value: JsonEncoder::encode($request->getRequest()), + contentType: 'application/json; charset=utf-8', + ); + } + if ($request->getImageFile() != null) { + $body->addPart( + $request->getImageFile()->toMultipartFormDataPart( + name: 'image_file', + contentType: 'image/jpeg', + ), + ); + } + try { + $response = $this->client->sendRequest( + new MultipartApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}/attachments", + method: HttpMethod::POST, + body: $body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateInvoiceAttachmentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only + * from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + * + * @param DeleteInvoiceAttachmentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteInvoiceAttachmentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deleteInvoiceAttachment(DeleteInvoiceAttachmentRequest $request, ?array $options = null): DeleteInvoiceAttachmentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}/attachments/{$request->getAttachmentId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteInvoiceAttachmentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels an invoice. The seller cannot collect payments for + * the canceled invoice. + * + * You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. + * + * @param CancelInvoiceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelInvoiceRequest $request, ?array $options = null): CancelInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}/cancel", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Publishes the specified draft invoice. + * + * After an invoice is published, Square + * follows up based on the invoice configuration. For example, Square + * sends the invoice to the customer's email address, charges the customer's card on file, or does + * nothing. Square also makes the invoice available on a Square-hosted invoice page. + * + * The invoice `status` also changes from `DRAFT` to a status + * based on the invoice configuration. For example, the status changes to `UNPAID` if + * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the + * invoice amount. + * + * In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` + * and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. + * + * @param PublishInvoiceRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return PublishInvoiceResponse + * @throws SquareException + * @throws SquareApiException + */ + public function publish(PublishInvoiceRequest $request, ?array $options = null): PublishInvoiceResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices/{$request->getInvoiceId()}/publish", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return PublishInvoiceResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of invoices for a given location. The response + * is paginated. If truncated, the response includes a `cursor` that you + * use in a subsequent request to retrieve the next set of invoices. + * + * @param ListInvoicesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListInvoicesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListInvoicesRequest $request, ?array $options = null): ListInvoicesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + $query['location_id'] = $request->getLocationId(); + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/invoices", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListInvoicesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Invoices/Requests/CancelInvoiceRequest.php b/src/Invoices/Requests/CancelInvoiceRequest.php new file mode 100644 index 00000000..f80729ab --- /dev/null +++ b/src/Invoices/Requests/CancelInvoiceRequest.php @@ -0,0 +1,71 @@ +invoiceId = $values['invoiceId']; + $this->version = $values['version']; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return int + */ + public function getVersion(): int + { + return $this->version; + } + + /** + * @param int $value + */ + public function setVersion(int $value): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/CreateInvoiceAttachmentRequest.php b/src/Invoices/Requests/CreateInvoiceAttachmentRequest.php new file mode 100644 index 00000000..2ef89200 --- /dev/null +++ b/src/Invoices/Requests/CreateInvoiceAttachmentRequest.php @@ -0,0 +1,92 @@ +invoiceId = $values['invoiceId']; + $this->request = $values['request'] ?? null; + $this->imageFile = $values['imageFile'] ?? null; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return mixed + */ + public function getRequest(): mixed + { + return $this->request; + } + + /** + * @param mixed $value + */ + public function setRequest(mixed $value = null): self + { + $this->request = $value; + return $this; + } + + /** + * @return ?File + */ + public function getImageFile(): ?File + { + return $this->imageFile; + } + + /** + * @param ?File $value + */ + public function setImageFile(?File $value = null): self + { + $this->imageFile = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/CreateInvoiceRequest.php b/src/Invoices/Requests/CreateInvoiceRequest.php new file mode 100644 index 00000000..f6bbacce --- /dev/null +++ b/src/Invoices/Requests/CreateInvoiceRequest.php @@ -0,0 +1,75 @@ +invoice = $values['invoice']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return Invoice + */ + public function getInvoice(): Invoice + { + return $this->invoice; + } + + /** + * @param Invoice $value + */ + public function setInvoice(Invoice $value): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/DeleteInvoiceAttachmentRequest.php b/src/Invoices/Requests/DeleteInvoiceAttachmentRequest.php new file mode 100644 index 00000000..177320ef --- /dev/null +++ b/src/Invoices/Requests/DeleteInvoiceAttachmentRequest.php @@ -0,0 +1,65 @@ +invoiceId = $values['invoiceId']; + $this->attachmentId = $values['attachmentId']; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return string + */ + public function getAttachmentId(): string + { + return $this->attachmentId; + } + + /** + * @param string $value + */ + public function setAttachmentId(string $value): self + { + $this->attachmentId = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/DeleteInvoicesRequest.php b/src/Invoices/Requests/DeleteInvoicesRequest.php new file mode 100644 index 00000000..2fad2a85 --- /dev/null +++ b/src/Invoices/Requests/DeleteInvoicesRequest.php @@ -0,0 +1,69 @@ +invoiceId = $values['invoiceId']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/GetInvoicesRequest.php b/src/Invoices/Requests/GetInvoicesRequest.php new file mode 100644 index 00000000..90ae5b57 --- /dev/null +++ b/src/Invoices/Requests/GetInvoicesRequest.php @@ -0,0 +1,41 @@ +invoiceId = $values['invoiceId']; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/ListInvoicesRequest.php b/src/Invoices/Requests/ListInvoicesRequest.php new file mode 100644 index 00000000..5590e506 --- /dev/null +++ b/src/Invoices/Requests/ListInvoicesRequest.php @@ -0,0 +1,97 @@ +locationId = $values['locationId']; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/PublishInvoiceRequest.php b/src/Invoices/Requests/PublishInvoiceRequest.php new file mode 100644 index 00000000..b1cfeba0 --- /dev/null +++ b/src/Invoices/Requests/PublishInvoiceRequest.php @@ -0,0 +1,101 @@ +invoiceId = $values['invoiceId']; + $this->version = $values['version']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return int + */ + public function getVersion(): int + { + return $this->version; + } + + /** + * @param int $value + */ + public function setVersion(int $value): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/SearchInvoicesRequest.php b/src/Invoices/Requests/SearchInvoicesRequest.php new file mode 100644 index 00000000..d5d51dcb --- /dev/null +++ b/src/Invoices/Requests/SearchInvoicesRequest.php @@ -0,0 +1,102 @@ +query = $values['query']; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return InvoiceQuery + */ + public function getQuery(): InvoiceQuery + { + return $this->query; + } + + /** + * @param InvoiceQuery $value + */ + public function setQuery(InvoiceQuery $value): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Invoices/Requests/UpdateInvoiceRequest.php b/src/Invoices/Requests/UpdateInvoiceRequest.php new file mode 100644 index 00000000..107ab757 --- /dev/null +++ b/src/Invoices/Requests/UpdateInvoiceRequest.php @@ -0,0 +1,134 @@ + $fieldsToClear + */ + #[JsonProperty('fields_to_clear'), ArrayType(['string'])] + private ?array $fieldsToClear; + + /** + * @param array{ + * invoiceId: string, + * invoice: Invoice, + * idempotencyKey?: ?string, + * fieldsToClear?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->invoiceId = $values['invoiceId']; + $this->invoice = $values['invoice']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->fieldsToClear = $values['fieldsToClear'] ?? null; + } + + /** + * @return string + */ + public function getInvoiceId(): string + { + return $this->invoiceId; + } + + /** + * @param string $value + */ + public function setInvoiceId(string $value): self + { + $this->invoiceId = $value; + return $this; + } + + /** + * @return Invoice + */ + public function getInvoice(): Invoice + { + return $this->invoice; + } + + /** + * @param Invoice $value + */ + public function setInvoice(Invoice $value): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?array + */ + public function getFieldsToClear(): ?array + { + return $this->fieldsToClear; + } + + /** + * @param ?array $value + */ + public function setFieldsToClear(?array $value = null): self + { + $this->fieldsToClear = $value; + return $this; + } +} diff --git a/src/Labor/BreakTypes/BreakTypesClient.php b/src/Labor/BreakTypes/BreakTypesClient.php new file mode 100644 index 00000000..a6205b9d --- /dev/null +++ b/src/Labor/BreakTypes/BreakTypesClient.php @@ -0,0 +1,396 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a paginated list of `BreakType` instances for a business. + * + * @param ListBreakTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListBreakTypesRequest $request = new ListBreakTypesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListBreakTypesRequest $request) => $this->_list($request, $options), + setCursor: function (ListBreakTypesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListBreakTypesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListBreakTypesResponse $response) => $response?->getBreakTypes() ?? [], + ); + } + + /** + * Creates a new `BreakType`. + * + * A `BreakType` is a template for creating `Break` objects. + * You must provide the following values in your request to this + * endpoint: + * + * - `location_id` + * - `break_name` + * - `expected_duration` + * - `is_paid` + * + * You can only have three `BreakType` instances per location. If you attempt to add a fourth + * `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." + * is returned. + * + * @param CreateBreakTypeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateBreakTypeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateBreakTypeRequest $request, ?array $options = null): CreateBreakTypeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/break-types", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateBreakTypeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a single `BreakType` specified by `id`. + * + * @param GetBreakTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetBreakTypeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetBreakTypesRequest $request, ?array $options = null): GetBreakTypeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/break-types/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetBreakTypeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an existing `BreakType`. + * + * @param UpdateBreakTypeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateBreakTypeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateBreakTypeRequest $request, ?array $options = null): UpdateBreakTypeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/break-types/{$request->getId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateBreakTypeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes an existing `BreakType`. + * + * A `BreakType` can be deleted even if it is referenced from a `Shift`. + * + * @param DeleteBreakTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteBreakTypeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteBreakTypesRequest $request, ?array $options = null): DeleteBreakTypeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/break-types/{$request->getId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteBreakTypeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a paginated list of `BreakType` instances for a business. + * + * @param ListBreakTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListBreakTypesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListBreakTypesRequest $request = new ListBreakTypesRequest(), ?array $options = null): ListBreakTypesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/break-types", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListBreakTypesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Labor/BreakTypes/Requests/CreateBreakTypeRequest.php b/src/Labor/BreakTypes/Requests/CreateBreakTypeRequest.php new file mode 100644 index 00000000..273e1cad --- /dev/null +++ b/src/Labor/BreakTypes/Requests/CreateBreakTypeRequest.php @@ -0,0 +1,69 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->breakType = $values['breakType']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return BreakType + */ + public function getBreakType(): BreakType + { + return $this->breakType; + } + + /** + * @param BreakType $value + */ + public function setBreakType(BreakType $value): self + { + $this->breakType = $value; + return $this; + } +} diff --git a/src/Labor/BreakTypes/Requests/DeleteBreakTypesRequest.php b/src/Labor/BreakTypes/Requests/DeleteBreakTypesRequest.php new file mode 100644 index 00000000..d60bb6f5 --- /dev/null +++ b/src/Labor/BreakTypes/Requests/DeleteBreakTypesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/BreakTypes/Requests/GetBreakTypesRequest.php b/src/Labor/BreakTypes/Requests/GetBreakTypesRequest.php new file mode 100644 index 00000000..ae1482bd --- /dev/null +++ b/src/Labor/BreakTypes/Requests/GetBreakTypesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/BreakTypes/Requests/ListBreakTypesRequest.php b/src/Labor/BreakTypes/Requests/ListBreakTypesRequest.php new file mode 100644 index 00000000..01cf3c7e --- /dev/null +++ b/src/Labor/BreakTypes/Requests/ListBreakTypesRequest.php @@ -0,0 +1,95 @@ +locationId = $values['locationId'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Labor/BreakTypes/Requests/UpdateBreakTypeRequest.php b/src/Labor/BreakTypes/Requests/UpdateBreakTypeRequest.php new file mode 100644 index 00000000..41b4d7f1 --- /dev/null +++ b/src/Labor/BreakTypes/Requests/UpdateBreakTypeRequest.php @@ -0,0 +1,68 @@ +id = $values['id']; + $this->breakType = $values['breakType']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return BreakType + */ + public function getBreakType(): BreakType + { + return $this->breakType; + } + + /** + * @param BreakType $value + */ + public function setBreakType(BreakType $value): self + { + $this->breakType = $value; + return $this; + } +} diff --git a/src/Labor/EmployeeWages/EmployeeWagesClient.php b/src/Labor/EmployeeWages/EmployeeWagesClient.php new file mode 100644 index 00000000..4a064c66 --- /dev/null +++ b/src/Labor/EmployeeWages/EmployeeWagesClient.php @@ -0,0 +1,208 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a paginated list of `EmployeeWage` instances for a business. + * + * @param ListEmployeeWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListEmployeeWagesRequest $request = new ListEmployeeWagesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEmployeeWagesRequest $request) => $this->_list($request, $options), + setCursor: function (ListEmployeeWagesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListEmployeeWagesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListEmployeeWagesResponse $response) => $response?->getEmployeeWages() ?? [], + ); + } + + /** + * Returns a single `EmployeeWage` specified by `id`. + * + * @param GetEmployeeWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetEmployeeWageResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetEmployeeWagesRequest $request, ?array $options = null): GetEmployeeWageResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/employee-wages/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetEmployeeWageResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a paginated list of `EmployeeWage` instances for a business. + * + * @param ListEmployeeWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListEmployeeWagesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListEmployeeWagesRequest $request = new ListEmployeeWagesRequest(), ?array $options = null): ListEmployeeWagesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getEmployeeId() != null) { + $query['employee_id'] = $request->getEmployeeId(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/employee-wages", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListEmployeeWagesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Labor/EmployeeWages/Requests/GetEmployeeWagesRequest.php b/src/Labor/EmployeeWages/Requests/GetEmployeeWagesRequest.php new file mode 100644 index 00000000..d997ba7c --- /dev/null +++ b/src/Labor/EmployeeWages/Requests/GetEmployeeWagesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/EmployeeWages/Requests/ListEmployeeWagesRequest.php b/src/Labor/EmployeeWages/Requests/ListEmployeeWagesRequest.php new file mode 100644 index 00000000..1d024671 --- /dev/null +++ b/src/Labor/EmployeeWages/Requests/ListEmployeeWagesRequest.php @@ -0,0 +1,92 @@ +employeeId = $values['employeeId'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Labor/LaborClient.php b/src/Labor/LaborClient.php new file mode 100644 index 00000000..ba5be591 --- /dev/null +++ b/src/Labor/LaborClient.php @@ -0,0 +1,78 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->breakTypes = new BreakTypesClient($this->client, $this->options); + $this->employeeWages = new EmployeeWagesClient($this->client, $this->options); + $this->shifts = new ShiftsClient($this->client, $this->options); + $this->teamMemberWages = new TeamMemberWagesClient($this->client, $this->options); + $this->workweekConfigs = new WorkweekConfigsClient($this->client, $this->options); + } +} diff --git a/src/Labor/Shifts/Requests/CreateShiftRequest.php b/src/Labor/Shifts/Requests/CreateShiftRequest.php new file mode 100644 index 00000000..dd882682 --- /dev/null +++ b/src/Labor/Shifts/Requests/CreateShiftRequest.php @@ -0,0 +1,69 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->shift = $values['shift']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return Shift + */ + public function getShift(): Shift + { + return $this->shift; + } + + /** + * @param Shift $value + */ + public function setShift(Shift $value): self + { + $this->shift = $value; + return $this; + } +} diff --git a/src/Labor/Shifts/Requests/DeleteShiftsRequest.php b/src/Labor/Shifts/Requests/DeleteShiftsRequest.php new file mode 100644 index 00000000..4f44a5af --- /dev/null +++ b/src/Labor/Shifts/Requests/DeleteShiftsRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/Shifts/Requests/GetShiftsRequest.php b/src/Labor/Shifts/Requests/GetShiftsRequest.php new file mode 100644 index 00000000..698bce55 --- /dev/null +++ b/src/Labor/Shifts/Requests/GetShiftsRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/Shifts/Requests/SearchShiftsRequest.php b/src/Labor/Shifts/Requests/SearchShiftsRequest.php new file mode 100644 index 00000000..2cae5f5a --- /dev/null +++ b/src/Labor/Shifts/Requests/SearchShiftsRequest.php @@ -0,0 +1,94 @@ +query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?ShiftQuery + */ + public function getQuery(): ?ShiftQuery + { + return $this->query; + } + + /** + * @param ?ShiftQuery $value + */ + public function setQuery(?ShiftQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Labor/Shifts/Requests/UpdateShiftRequest.php b/src/Labor/Shifts/Requests/UpdateShiftRequest.php new file mode 100644 index 00000000..3382313a --- /dev/null +++ b/src/Labor/Shifts/Requests/UpdateShiftRequest.php @@ -0,0 +1,68 @@ +id = $values['id']; + $this->shift = $values['shift']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return Shift + */ + public function getShift(): Shift + { + return $this->shift; + } + + /** + * @param Shift $value + */ + public function setShift(Shift $value): self + { + $this->shift = $value; + return $this; + } +} diff --git a/src/Labor/Shifts/ShiftsClient.php b/src/Labor/Shifts/ShiftsClient.php new file mode 100644 index 00000000..654b7b88 --- /dev/null +++ b/src/Labor/Shifts/ShiftsClient.php @@ -0,0 +1,375 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a new `Shift`. + * + * A `Shift` represents a complete workday for a single team member. + * You must provide the following values in your request to this + * endpoint: + * + * - `location_id` + * - `team_member_id` + * - `start_at` + * + * An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: + * - The `status` of the new `Shift` is `OPEN` and the team member has another + * shift with an `OPEN` status. + * - The `start_at` date is in the future. + * - The `start_at` or `end_at` date overlaps another shift for the same team member. + * - The `Break` instances are set in the request and a break `start_at` + * is before the `Shift.start_at`, a break `end_at` is after + * the `Shift.end_at`, or both. + * + * @param CreateShiftRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateShiftResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateShiftRequest $request, ?array $options = null): CreateShiftResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/shifts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateShiftResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a paginated list of `Shift` records for a business. + * The list to be returned can be filtered by: + * - Location IDs + * - Team member IDs + * - Shift status (`OPEN` or `CLOSED`) + * - Shift start + * - Shift end + * - Workday details + * + * The list can be sorted by: + * - `START_AT` + * - `END_AT` + * - `CREATED_AT` + * - `UPDATED_AT` + * + * @param SearchShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchShiftsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchShiftsRequest $request = new SearchShiftsRequest(), ?array $options = null): SearchShiftsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/shifts/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchShiftsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a single `Shift` specified by `id`. + * + * @param GetShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetShiftResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetShiftsRequest $request, ?array $options = null): GetShiftResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/shifts/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetShiftResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an existing `Shift`. + * + * When adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have + * the `end_at` property set to a valid RFC-3339 datetime string. + * + * When closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at` + * set on each `Break`. + * + * @param UpdateShiftRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateShiftResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateShiftRequest $request, ?array $options = null): UpdateShiftResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/shifts/{$request->getId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateShiftResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a `Shift`. + * + * @param DeleteShiftsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteShiftResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteShiftsRequest $request, ?array $options = null): DeleteShiftResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/shifts/{$request->getId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteShiftResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Labor/TeamMemberWages/Requests/GetTeamMemberWagesRequest.php b/src/Labor/TeamMemberWages/Requests/GetTeamMemberWagesRequest.php new file mode 100644 index 00000000..43a034c5 --- /dev/null +++ b/src/Labor/TeamMemberWages/Requests/GetTeamMemberWagesRequest.php @@ -0,0 +1,41 @@ +id = $values['id']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } +} diff --git a/src/Labor/TeamMemberWages/Requests/ListTeamMemberWagesRequest.php b/src/Labor/TeamMemberWages/Requests/ListTeamMemberWagesRequest.php new file mode 100644 index 00000000..c40f4c3e --- /dev/null +++ b/src/Labor/TeamMemberWages/Requests/ListTeamMemberWagesRequest.php @@ -0,0 +1,95 @@ +teamMemberId = $values['teamMemberId'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Labor/TeamMemberWages/TeamMemberWagesClient.php b/src/Labor/TeamMemberWages/TeamMemberWagesClient.php new file mode 100644 index 00000000..12ec3250 --- /dev/null +++ b/src/Labor/TeamMemberWages/TeamMemberWagesClient.php @@ -0,0 +1,208 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a paginated list of `TeamMemberWage` instances for a business. + * + * @param ListTeamMemberWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListTeamMemberWagesRequest $request = new ListTeamMemberWagesRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListTeamMemberWagesRequest $request) => $this->_list($request, $options), + setCursor: function (ListTeamMemberWagesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListTeamMemberWagesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListTeamMemberWagesResponse $response) => $response?->getTeamMemberWages() ?? [], + ); + } + + /** + * Returns a single `TeamMemberWage` specified by `id`. + * + * @param GetTeamMemberWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTeamMemberWageResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetTeamMemberWagesRequest $request, ?array $options = null): GetTeamMemberWageResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/team-member-wages/{$request->getId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTeamMemberWageResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a paginated list of `TeamMemberWage` instances for a business. + * + * @param ListTeamMemberWagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListTeamMemberWagesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListTeamMemberWagesRequest $request = new ListTeamMemberWagesRequest(), ?array $options = null): ListTeamMemberWagesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getTeamMemberId() != null) { + $query['team_member_id'] = $request->getTeamMemberId(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/team-member-wages", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListTeamMemberWagesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Labor/WorkweekConfigs/Requests/ListWorkweekConfigsRequest.php b/src/Labor/WorkweekConfigs/Requests/ListWorkweekConfigsRequest.php new file mode 100644 index 00000000..8bcd0020 --- /dev/null +++ b/src/Labor/WorkweekConfigs/Requests/ListWorkweekConfigsRequest.php @@ -0,0 +1,65 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Labor/WorkweekConfigs/Requests/UpdateWorkweekConfigRequest.php b/src/Labor/WorkweekConfigs/Requests/UpdateWorkweekConfigRequest.php new file mode 100644 index 00000000..384463f9 --- /dev/null +++ b/src/Labor/WorkweekConfigs/Requests/UpdateWorkweekConfigRequest.php @@ -0,0 +1,68 @@ +id = $values['id']; + $this->workweekConfig = $values['workweekConfig']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return WorkweekConfig + */ + public function getWorkweekConfig(): WorkweekConfig + { + return $this->workweekConfig; + } + + /** + * @param WorkweekConfig $value + */ + public function setWorkweekConfig(WorkweekConfig $value): self + { + $this->workweekConfig = $value; + return $this; + } +} diff --git a/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php b/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php new file mode 100644 index 00000000..fc29afcc --- /dev/null +++ b/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php @@ -0,0 +1,206 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Returns a list of `WorkweekConfig` instances for a business. + * + * @param ListWorkweekConfigsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListWorkweekConfigsRequest $request = new ListWorkweekConfigsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListWorkweekConfigsRequest $request) => $this->_list($request, $options), + setCursor: function (ListWorkweekConfigsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListWorkweekConfigsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListWorkweekConfigsResponse $response) => $response?->getWorkweekConfigs() ?? [], + ); + } + + /** + * Updates a `WorkweekConfig`. + * + * @param UpdateWorkweekConfigRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateWorkweekConfigResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(UpdateWorkweekConfigRequest $request, ?array $options = null): UpdateWorkweekConfigResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/workweek-configs/{$request->getId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateWorkweekConfigResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a list of `WorkweekConfig` instances for a business. + * + * @param ListWorkweekConfigsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListWorkweekConfigsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListWorkweekConfigsRequest $request = new ListWorkweekConfigsRequest(), ?array $options = null): ListWorkweekConfigsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/labor/workweek-configs", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListWorkweekConfigsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php new file mode 100644 index 00000000..a2e4b604 --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -0,0 +1,406 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributeDefinitionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributeDefinitionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListLocationCustomAttributeDefinitionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListLocationCustomAttributeDefinitionsResponse $response) => $response?->getCustomAttributeDefinitions() ?? [], + ); + } + + /** + * Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * Use this endpoint to define a custom attribute that can be associated with locations. + * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + * for a custom attribute. After the definition is created, you can call + * [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or + * [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + * to set the custom attribute for locations. + * + * @param CreateLocationCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateLocationCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateLocationCustomAttributeDefinitionRequest $request, ?array $options = null): CreateLocationCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attribute-definitions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateLocationCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * To retrieve a custom attribute definition created by another application, the `visibility` + * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveLocationCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributeDefinitionsRequest $request, ?array $options = null): RetrieveLocationCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveLocationCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + * `schema` for a `Selection` data type. + * Only the definition owner can update a custom attribute definition. + * + * @param UpdateLocationCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateLocationCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateLocationCustomAttributeDefinitionRequest $request, ?array $options = null): UpdateLocationCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateLocationCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * Deleting a custom attribute definition also deletes the corresponding custom attribute from + * all locations. + * Only the definition owner can delete a custom attribute definition. + * + * @param DeleteCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteLocationCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributeDefinitionsRequest $request, ?array $options = null): DeleteLocationCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteLocationCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLocationCustomAttributeDefinitionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): ListLocationCustomAttributeDefinitionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attribute-definitions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLocationCustomAttributeDefinitionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Locations/CustomAttributeDefinitions/Requests/CreateLocationCustomAttributeDefinitionRequest.php b/src/Locations/CustomAttributeDefinitions/Requests/CreateLocationCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..f1daa50d --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/Requests/CreateLocationCustomAttributeDefinitionRequest.php @@ -0,0 +1,78 @@ +customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php b/src/Locations/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..9129e454 --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php @@ -0,0 +1,41 @@ +key = $values['key']; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php b/src/Locations/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..097d4b47 --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +key = $values['key']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php b/src/Locations/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..70f9e767 --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php @@ -0,0 +1,98 @@ + $visibilityFilter Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ + private ?string $visibilityFilter; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * @param array{ + * visibilityFilter?: ?value-of, + * limit?: ?int, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributeDefinitions/Requests/UpdateLocationCustomAttributeDefinitionRequest.php b/src/Locations/CustomAttributeDefinitions/Requests/UpdateLocationCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..94060362 --- /dev/null +++ b/src/Locations/CustomAttributeDefinitions/Requests/UpdateLocationCustomAttributeDefinitionRequest.php @@ -0,0 +1,111 @@ +key = $values['key']; + $this->customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/CustomAttributesClient.php b/src/Locations/CustomAttributes/CustomAttributesClient.php new file mode 100644 index 00000000..6bcd3f60 --- /dev/null +++ b/src/Locations/CustomAttributes/CustomAttributesClient.php @@ -0,0 +1,482 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation. + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkDeleteLocationCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkDeleteLocationCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchDelete(BulkDeleteLocationCustomAttributesRequest $request, ?array $options = null): BulkDeleteLocationCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attributes/bulk-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkDeleteLocationCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates [custom attributes](entity:CustomAttribute) for locations as a bulk operation. + * Use this endpoint to set the value of one or more custom attributes for one or more locations. + * A custom attribute is based on a custom attribute definition in a Square seller account, which is + * created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. + * This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + * requests and returns a map of individual upsert responses. Each upsert request has a unique ID + * and provides a location ID and custom attribute. Each upsert response is returned with the ID + * of the corresponding request. + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkUpsertLocationCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkUpsertLocationCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BulkUpsertLocationCustomAttributesRequest $request, ?array $options = null): BulkUpsertLocationCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/custom-attributes/bulk-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkUpsertLocationCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a location. + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListLocationCustomAttributesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListLocationCustomAttributesResponse $response) => $response?->getCustomAttributes() ?? [], + ); + } + + /** + * Retrieves a [custom attribute](entity:CustomAttribute) associated with a location. + * You can use the `with_definition` query parameter to also retrieve the custom attribute definition + * in the same call. + * To retrieve a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveLocationCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributesRequest $request, ?array $options = null): RetrieveLocationCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getWithDefinition() != null) { + $query['with_definition'] = $request->getWithDefinition(); + } + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveLocationCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates a [custom attribute](entity:CustomAttribute) for a location. + * Use this endpoint to set the value of a custom attribute for a specified location. + * A custom attribute is based on a custom attribute definition in a Square seller account, which + * is created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. + * + * @param UpsertLocationCustomAttributeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertLocationCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertLocationCustomAttributeRequest $request, ?array $options = null): UpsertLocationCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertLocationCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a [custom attribute](entity:CustomAttribute) associated with a location. + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. + * + * @param DeleteCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteLocationCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributesRequest $request, ?array $options = null): DeleteLocationCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteLocationCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a location. + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLocationCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributesRequest $request, ?array $options = null): ListLocationCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getWithDefinitions() != null) { + $query['with_definitions'] = $request->getWithDefinitions(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/custom-attributes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLocationCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Locations/CustomAttributes/Requests/BulkDeleteLocationCustomAttributesRequest.php b/src/Locations/CustomAttributes/Requests/BulkDeleteLocationCustomAttributesRequest.php new file mode 100644 index 00000000..f07f336c --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/BulkDeleteLocationCustomAttributesRequest.php @@ -0,0 +1,48 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/Requests/BulkUpsertLocationCustomAttributesRequest.php b/src/Locations/CustomAttributes/Requests/BulkUpsertLocationCustomAttributesRequest.php new file mode 100644 index 00000000..934a79ec --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/BulkUpsertLocationCustomAttributesRequest.php @@ -0,0 +1,49 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/Requests/DeleteCustomAttributesRequest.php b/src/Locations/CustomAttributes/Requests/DeleteCustomAttributesRequest.php new file mode 100644 index 00000000..ec20ede8 --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/DeleteCustomAttributesRequest.php @@ -0,0 +1,69 @@ +locationId = $values['locationId']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/Requests/GetCustomAttributesRequest.php b/src/Locations/CustomAttributes/Requests/GetCustomAttributesRequest.php new file mode 100644 index 00000000..289de2b8 --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/GetCustomAttributesRequest.php @@ -0,0 +1,126 @@ +locationId = $values['locationId']; + $this->key = $values['key']; + $this->withDefinition = $values['withDefinition'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinition(): ?bool + { + return $this->withDefinition; + } + + /** + * @param ?bool $value + */ + public function setWithDefinition(?bool $value = null): self + { + $this->withDefinition = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/Requests/ListCustomAttributesRequest.php b/src/Locations/CustomAttributes/Requests/ListCustomAttributesRequest.php new file mode 100644 index 00000000..e42440fa --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/ListCustomAttributesRequest.php @@ -0,0 +1,150 @@ + $visibilityFilter Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ + private ?string $visibilityFilter; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. For more + * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each + * custom attribute. Set this parameter to `true` to get the name and description of each custom + * attribute, information about the data type, or other definition details. The default value is `false`. + * + * @var ?bool $withDefinitions + */ + private ?bool $withDefinitions; + + /** + * @param array{ + * locationId: string, + * visibilityFilter?: ?value-of, + * limit?: ?int, + * cursor?: ?string, + * withDefinitions?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->withDefinitions = $values['withDefinitions'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinitions(): ?bool + { + return $this->withDefinitions; + } + + /** + * @param ?bool $value + */ + public function setWithDefinitions(?bool $value = null): self + { + $this->withDefinitions = $value; + return $this; + } +} diff --git a/src/Locations/CustomAttributes/Requests/UpsertLocationCustomAttributeRequest.php b/src/Locations/CustomAttributes/Requests/UpsertLocationCustomAttributeRequest.php new file mode 100644 index 00000000..d6a75af6 --- /dev/null +++ b/src/Locations/CustomAttributes/Requests/UpsertLocationCustomAttributeRequest.php @@ -0,0 +1,131 @@ +locationId = $values['locationId']; + $this->key = $values['key']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Locations/LocationsClient.php b/src/Locations/LocationsClient.php new file mode 100644 index 00000000..3d2dbfb2 --- /dev/null +++ b/src/Locations/LocationsClient.php @@ -0,0 +1,372 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->customAttributeDefinitions = new CustomAttributeDefinitionsClient($this->client, $this->options); + $this->customAttributes = new CustomAttributesClient($this->client, $this->options); + $this->transactions = new TransactionsClient($this->client, $this->options); + } + + /** + * Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), + * including those with an inactive status. Locations are listed alphabetically by `name`. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLocationsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function list(?array $options = null): ListLocationsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLocationsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates a [location](https://developer.squareup.com/docs/locations-api). + * Creating new locations allows for separate configuration of receipt layouts, item prices, + * and sales reports. Developers can use locations to separate sales activity through applications + * that integrate with Square from sales activity elsewhere in a seller's account. + * Locations created programmatically with the Locations API last forever and + * are visible to the seller for their own management. Therefore, ensure that + * each location has a sensible and unique name. + * + * @param CreateLocationRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateLocationResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateLocationRequest $request = new CreateLocationRequest(), ?array $options = null): CreateLocationResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateLocationResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves details of a single location. Specify "main" + * as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + * + * @param GetLocationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetLocationResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetLocationsRequest $request, ?array $options = null): GetLocationResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetLocationResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a [location](https://developer.squareup.com/docs/locations-api). + * + * @param UpdateLocationRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateLocationResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateLocationRequest $request, ?array $options = null): UpdateLocationResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateLocationResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Links a `checkoutId` to a `checkout_page_url` that customers are + * directed to in order to provide their payment information using a + * payment processing workflow hosted on connect.squareup.com. + * + * + * NOTE: The Checkout API has been updated with new features. + * For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). + * + * @param CreateCheckoutRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateCheckoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function checkouts(CreateCheckoutRequest $request, ?array $options = null): CreateCheckoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/checkouts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateCheckoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Locations/Requests/CreateCheckoutRequest.php b/src/Locations/Requests/CreateCheckoutRequest.php new file mode 100644 index 00000000..2523f91e --- /dev/null +++ b/src/Locations/Requests/CreateCheckoutRequest.php @@ -0,0 +1,335 @@ + $additionalRecipients + */ + #[JsonProperty('additional_recipients'), ArrayType([ChargeRequestAdditionalRecipient::class])] + private ?array $additionalRecipients; + + /** + * An optional note to associate with the `checkout` object. + * + * This value cannot exceed 60 characters. + * + * @var ?string $note + */ + #[JsonProperty('note')] + private ?string $note; + + /** + * @param array{ + * locationId: string, + * idempotencyKey: string, + * order: CreateOrderRequest, + * askForShippingAddress?: ?bool, + * merchantSupportEmail?: ?string, + * prePopulateBuyerEmail?: ?string, + * prePopulateShippingAddress?: ?Address, + * redirectUrl?: ?string, + * additionalRecipients?: ?array, + * note?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->order = $values['order']; + $this->askForShippingAddress = $values['askForShippingAddress'] ?? null; + $this->merchantSupportEmail = $values['merchantSupportEmail'] ?? null; + $this->prePopulateBuyerEmail = $values['prePopulateBuyerEmail'] ?? null; + $this->prePopulateShippingAddress = $values['prePopulateShippingAddress'] ?? null; + $this->redirectUrl = $values['redirectUrl'] ?? null; + $this->additionalRecipients = $values['additionalRecipients'] ?? null; + $this->note = $values['note'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return CreateOrderRequest + */ + public function getOrder(): CreateOrderRequest + { + return $this->order; + } + + /** + * @param CreateOrderRequest $value + */ + public function setOrder(CreateOrderRequest $value): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAskForShippingAddress(): ?bool + { + return $this->askForShippingAddress; + } + + /** + * @param ?bool $value + */ + public function setAskForShippingAddress(?bool $value = null): self + { + $this->askForShippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantSupportEmail(): ?string + { + return $this->merchantSupportEmail; + } + + /** + * @param ?string $value + */ + public function setMerchantSupportEmail(?string $value = null): self + { + $this->merchantSupportEmail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPrePopulateBuyerEmail(): ?string + { + return $this->prePopulateBuyerEmail; + } + + /** + * @param ?string $value + */ + public function setPrePopulateBuyerEmail(?string $value = null): self + { + $this->prePopulateBuyerEmail = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getPrePopulateShippingAddress(): ?Address + { + return $this->prePopulateShippingAddress; + } + + /** + * @param ?Address $value + */ + public function setPrePopulateShippingAddress(?Address $value = null): self + { + $this->prePopulateShippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRedirectUrl(): ?string + { + return $this->redirectUrl; + } + + /** + * @param ?string $value + */ + public function setRedirectUrl(?string $value = null): self + { + $this->redirectUrl = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAdditionalRecipients(): ?array + { + return $this->additionalRecipients; + } + + /** + * @param ?array $value + */ + public function setAdditionalRecipients(?array $value = null): self + { + $this->additionalRecipients = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } +} diff --git a/src/Locations/Requests/CreateLocationRequest.php b/src/Locations/Requests/CreateLocationRequest.php new file mode 100644 index 00000000..713b4197 --- /dev/null +++ b/src/Locations/Requests/CreateLocationRequest.php @@ -0,0 +1,48 @@ +location = $values['location'] ?? null; + } + + /** + * @return ?Location + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @param ?Location $value + */ + public function setLocation(?Location $value = null): self + { + $this->location = $value; + return $this; + } +} diff --git a/src/Locations/Requests/GetLocationsRequest.php b/src/Locations/Requests/GetLocationsRequest.php new file mode 100644 index 00000000..d3854fcd --- /dev/null +++ b/src/Locations/Requests/GetLocationsRequest.php @@ -0,0 +1,44 @@ +locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Locations/Requests/UpdateLocationRequest.php b/src/Locations/Requests/UpdateLocationRequest.php new file mode 100644 index 00000000..6dad3b47 --- /dev/null +++ b/src/Locations/Requests/UpdateLocationRequest.php @@ -0,0 +1,68 @@ +locationId = $values['locationId']; + $this->location = $values['location'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?Location + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @param ?Location $value + */ + public function setLocation(?Location $value = null): self + { + $this->location = $value; + return $this; + } +} diff --git a/src/Locations/Transactions/Requests/CaptureTransactionsRequest.php b/src/Locations/Transactions/Requests/CaptureTransactionsRequest.php new file mode 100644 index 00000000..d156b6df --- /dev/null +++ b/src/Locations/Transactions/Requests/CaptureTransactionsRequest.php @@ -0,0 +1,65 @@ +locationId = $values['locationId']; + $this->transactionId = $values['transactionId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getTransactionId(): string + { + return $this->transactionId; + } + + /** + * @param string $value + */ + public function setTransactionId(string $value): self + { + $this->transactionId = $value; + return $this; + } +} diff --git a/src/Locations/Transactions/Requests/GetTransactionsRequest.php b/src/Locations/Transactions/Requests/GetTransactionsRequest.php new file mode 100644 index 00000000..2ab822e4 --- /dev/null +++ b/src/Locations/Transactions/Requests/GetTransactionsRequest.php @@ -0,0 +1,65 @@ +locationId = $values['locationId']; + $this->transactionId = $values['transactionId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getTransactionId(): string + { + return $this->transactionId; + } + + /** + * @param string $value + */ + public function setTransactionId(string $value): self + { + $this->transactionId = $value; + return $this; + } +} diff --git a/src/Locations/Transactions/Requests/ListTransactionsRequest.php b/src/Locations/Transactions/Requests/ListTransactionsRequest.php new file mode 100644 index 00000000..e005c209 --- /dev/null +++ b/src/Locations/Transactions/Requests/ListTransactionsRequest.php @@ -0,0 +1,160 @@ + $sortOrder + */ + private ?string $sortOrder; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this to retrieve the next set of results for your original query. + * + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * @param array{ + * locationId: string, + * beginTime?: ?string, + * endTime?: ?string, + * sortOrder?: ?value-of, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Locations/Transactions/Requests/VoidTransactionsRequest.php b/src/Locations/Transactions/Requests/VoidTransactionsRequest.php new file mode 100644 index 00000000..26044eeb --- /dev/null +++ b/src/Locations/Transactions/Requests/VoidTransactionsRequest.php @@ -0,0 +1,65 @@ +locationId = $values['locationId']; + $this->transactionId = $values['transactionId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getTransactionId(): string + { + return $this->transactionId; + } + + /** + * @param string $value + */ + public function setTransactionId(string $value): self + { + $this->transactionId = $value; + return $this; + } +} diff --git a/src/Locations/Transactions/TransactionsClient.php b/src/Locations/Transactions/TransactionsClient.php new file mode 100644 index 00000000..ec5f2747 --- /dev/null +++ b/src/Locations/Transactions/TransactionsClient.php @@ -0,0 +1,308 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists transactions for a particular location. + * + * Transactions include payment information from sales and exchanges and refund + * information from returns and exchanges. + * + * Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 + * + * @param ListTransactionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListTransactionsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function list(ListTransactionsRequest $request, ?array $options = null): ListTransactionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/transactions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListTransactionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves details for a single transaction. + * + * @param GetTransactionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTransactionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetTransactionsRequest $request, ?array $options = null): GetTransactionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/transactions/{$request->getTransactionId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTransactionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) + * endpoint with a `delay_capture` value of `true`. + * + * + * See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + * for more information. + * + * @param CaptureTransactionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CaptureTransactionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function capture(CaptureTransactionsRequest $request, ?array $options = null): CaptureTransactionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/transactions/{$request->getTransactionId()}/capture", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CaptureTransactionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) + * endpoint with a `delay_capture` value of `true`. + * + * + * See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + * for more information. + * + * @param VoidTransactionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return VoidTransactionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function void(VoidTransactionsRequest $request, ?array $options = null): VoidTransactionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/locations/{$request->getLocationId()}/transactions/{$request->getTransactionId()}/void", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return VoidTransactionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Loyalty/Accounts/AccountsClient.php b/src/Loyalty/Accounts/AccountsClient.php new file mode 100644 index 00000000..814b6769 --- /dev/null +++ b/src/Loyalty/Accounts/AccountsClient.php @@ -0,0 +1,361 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. + * + * @param CreateLoyaltyAccountRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateLoyaltyAccountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateLoyaltyAccountRequest $request, ?array $options = null): CreateLoyaltyAccountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/accounts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateLoyaltyAccountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for loyalty accounts in a loyalty program. + * + * You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely. + * + * Search results are sorted by `created_at` in ascending order. + * + * @param SearchLoyaltyAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchLoyaltyAccountsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchLoyaltyAccountsRequest $request = new SearchLoyaltyAccountsRequest(), ?array $options = null): SearchLoyaltyAccountsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/accounts/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchLoyaltyAccountsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a loyalty account. + * + * @param GetAccountsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetLoyaltyAccountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetAccountsRequest $request, ?array $options = null): GetLoyaltyAccountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/accounts/{$request->getAccountId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetLoyaltyAccountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount). + * + * - If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order + * to compute the points earned from both the base loyalty program and an associated + * [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual + * rules, Square computes points based on the accrual rule that grants the most points. + * For purchases that qualify for multiple promotions, Square computes points based on the most + * recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. + * + * - If you are not using the Orders API to manage orders, provide `points` with the number of points to add. + * You must first perform a client-side computation of the points earned from the loyalty program and + * loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + * to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see + * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + * + * @param AccumulateLoyaltyPointsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return AccumulateLoyaltyPointsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function accumulatePoints(AccumulateLoyaltyPointsRequest $request, ?array $options = null): AccumulateLoyaltyPointsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/accounts/{$request->getAccountId()}/accumulate", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return AccumulateLoyaltyPointsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Adds points to or subtracts points from a buyer's account. + * + * Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call + * [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + * to add points when a buyer pays for the purchase. + * + * @param AdjustLoyaltyPointsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return AdjustLoyaltyPointsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function adjust(AdjustLoyaltyPointsRequest $request, ?array $options = null): AdjustLoyaltyPointsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/accounts/{$request->getAccountId()}/adjust", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return AdjustLoyaltyPointsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Loyalty/Accounts/Requests/AccumulateLoyaltyPointsRequest.php b/src/Loyalty/Accounts/Requests/AccumulateLoyaltyPointsRequest.php new file mode 100644 index 00000000..5aad436d --- /dev/null +++ b/src/Loyalty/Accounts/Requests/AccumulateLoyaltyPointsRequest.php @@ -0,0 +1,125 @@ +accountId = $values['accountId']; + $this->accumulatePoints = $values['accumulatePoints']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getAccountId(): string + { + return $this->accountId; + } + + /** + * @param string $value + */ + public function setAccountId(string $value): self + { + $this->accountId = $value; + return $this; + } + + /** + * @return LoyaltyEventAccumulatePoints + */ + public function getAccumulatePoints(): LoyaltyEventAccumulatePoints + { + return $this->accumulatePoints; + } + + /** + * @param LoyaltyEventAccumulatePoints $value + */ + public function setAccumulatePoints(LoyaltyEventAccumulatePoints $value): self + { + $this->accumulatePoints = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Loyalty/Accounts/Requests/AdjustLoyaltyPointsRequest.php b/src/Loyalty/Accounts/Requests/AdjustLoyaltyPointsRequest.php new file mode 100644 index 00000000..24a77d0c --- /dev/null +++ b/src/Loyalty/Accounts/Requests/AdjustLoyaltyPointsRequest.php @@ -0,0 +1,128 @@ +accountId = $values['accountId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->adjustPoints = $values['adjustPoints']; + $this->allowNegativeBalance = $values['allowNegativeBalance'] ?? null; + } + + /** + * @return string + */ + public function getAccountId(): string + { + return $this->accountId; + } + + /** + * @param string $value + */ + public function setAccountId(string $value): self + { + $this->accountId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return LoyaltyEventAdjustPoints + */ + public function getAdjustPoints(): LoyaltyEventAdjustPoints + { + return $this->adjustPoints; + } + + /** + * @param LoyaltyEventAdjustPoints $value + */ + public function setAdjustPoints(LoyaltyEventAdjustPoints $value): self + { + $this->adjustPoints = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAllowNegativeBalance(): ?bool + { + return $this->allowNegativeBalance; + } + + /** + * @param ?bool $value + */ + public function setAllowNegativeBalance(?bool $value = null): self + { + $this->allowNegativeBalance = $value; + return $this; + } +} diff --git a/src/Loyalty/Accounts/Requests/CreateLoyaltyAccountRequest.php b/src/Loyalty/Accounts/Requests/CreateLoyaltyAccountRequest.php new file mode 100644 index 00000000..1fb2d4a1 --- /dev/null +++ b/src/Loyalty/Accounts/Requests/CreateLoyaltyAccountRequest.php @@ -0,0 +1,72 @@ +loyaltyAccount = $values['loyaltyAccount']; + $this->idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return LoyaltyAccount + */ + public function getLoyaltyAccount(): LoyaltyAccount + { + return $this->loyaltyAccount; + } + + /** + * @param LoyaltyAccount $value + */ + public function setLoyaltyAccount(LoyaltyAccount $value): self + { + $this->loyaltyAccount = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Loyalty/Accounts/Requests/GetAccountsRequest.php b/src/Loyalty/Accounts/Requests/GetAccountsRequest.php new file mode 100644 index 00000000..36f4fa2c --- /dev/null +++ b/src/Loyalty/Accounts/Requests/GetAccountsRequest.php @@ -0,0 +1,41 @@ +accountId = $values['accountId']; + } + + /** + * @return string + */ + public function getAccountId(): string + { + return $this->accountId; + } + + /** + * @param string $value + */ + public function setAccountId(string $value): self + { + $this->accountId = $value; + return $this; + } +} diff --git a/src/Loyalty/Accounts/Requests/SearchLoyaltyAccountsRequest.php b/src/Loyalty/Accounts/Requests/SearchLoyaltyAccountsRequest.php new file mode 100644 index 00000000..51419d68 --- /dev/null +++ b/src/Loyalty/Accounts/Requests/SearchLoyaltyAccountsRequest.php @@ -0,0 +1,101 @@ +query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?SearchLoyaltyAccountsRequestLoyaltyAccountQuery + */ + public function getQuery(): ?SearchLoyaltyAccountsRequestLoyaltyAccountQuery + { + return $this->query; + } + + /** + * @param ?SearchLoyaltyAccountsRequestLoyaltyAccountQuery $value + */ + public function setQuery(?SearchLoyaltyAccountsRequestLoyaltyAccountQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Loyalty/LoyaltyClient.php b/src/Loyalty/LoyaltyClient.php new file mode 100644 index 00000000..40949973 --- /dev/null +++ b/src/Loyalty/LoyaltyClient.php @@ -0,0 +1,137 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->accounts = new AccountsClient($this->client, $this->options); + $this->programs = new ProgramsClient($this->client, $this->options); + $this->rewards = new RewardsClient($this->client, $this->options); + } + + /** + * Searches for loyalty events. + * + * A Square loyalty program maintains a ledger of events that occur during the lifetime of a + * buyer's loyalty account. Each change in the point balance + * (for example, points earned, points redeemed, and points expired) is + * recorded in the ledger. Using this endpoint, you can search the ledger for events. + * + * Search results are sorted by `created_at` in descending order. + * + * @param SearchLoyaltyEventsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchLoyaltyEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function searchEvents(SearchLoyaltyEventsRequest $request = new SearchLoyaltyEventsRequest(), ?array $options = null): SearchLoyaltyEventsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/events/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchLoyaltyEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Loyalty/Programs/ProgramsClient.php b/src/Loyalty/Programs/ProgramsClient.php new file mode 100644 index 00000000..eb8483f2 --- /dev/null +++ b/src/Loyalty/Programs/ProgramsClient.php @@ -0,0 +1,248 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->promotions = new PromotionsClient($this->client, $this->options); + } + + /** + * Returns a list of loyalty programs in the seller's account. + * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). + * + * + * Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLoyaltyProgramsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function list(?array $options = null): ListLoyaltyProgramsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLoyaltyProgramsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`. + * + * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). + * + * @param GetProgramsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetLoyaltyProgramResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetProgramsRequest $request, ?array $options = null): GetLoyaltyProgramResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetLoyaltyProgramResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint + * to display the points to the buyer. + * + * - If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`. + * Square reads the order to compute the points earned from the base loyalty program and an associated + * [loyalty promotion](entity:LoyaltyPromotion). + * + * - If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the + * purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, + * but not points earned from a loyalty promotion. For spend-based and visit-based programs, the `tax_mode` + * setting of the accrual rule indicates how taxes should be treated for loyalty points accrual. + * If the purchase qualifies for program points, call + * [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation + * to calculate whether the purchase also qualifies for promotion points. For more information, see + * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + * + * @param CalculateLoyaltyPointsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CalculateLoyaltyPointsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function calculate(CalculateLoyaltyPointsRequest $request, ?array $options = null): CalculateLoyaltyPointsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}/calculate", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CalculateLoyaltyPointsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Loyalty/Programs/Promotions/PromotionsClient.php b/src/Loyalty/Programs/Promotions/PromotionsClient.php new file mode 100644 index 00000000..2cde943d --- /dev/null +++ b/src/Loyalty/Programs/Promotions/PromotionsClient.php @@ -0,0 +1,335 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). + * Results are sorted by the `created_at` date in descending order (newest to oldest). + * + * @param ListPromotionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListPromotionsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListPromotionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListPromotionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListLoyaltyPromotionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListLoyaltyPromotionsResponse $response) => $response?->getLoyaltyPromotions() ?? [], + ); + } + + /** + * Creates a loyalty promotion for a [loyalty program](entity:LoyaltyProgram). A loyalty promotion + * enables buyers to earn points in addition to those earned from the base loyalty program. + * + * This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the + * `available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an + * `ACTIVE` or `SCHEDULED` status. + * + * @param CreateLoyaltyPromotionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateLoyaltyPromotionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateLoyaltyPromotionRequest $request, ?array $options = null): CreateLoyaltyPromotionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}/promotions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateLoyaltyPromotionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a loyalty promotion. + * + * @param GetPromotionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetLoyaltyPromotionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetPromotionsRequest $request, ?array $options = null): GetLoyaltyPromotionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}/promotions/{$request->getPromotionId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetLoyaltyPromotionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` promotion earlier than the + * end date, cancel an `ACTIVE` promotion when an end date is not specified, or cancel a `SCHEDULED` promotion. + * Because updating a promotion is not supported, you can also use this endpoint to cancel a promotion before + * you create a new one. + * + * This endpoint sets the loyalty promotion to the `CANCELED` state + * + * @param CancelPromotionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelLoyaltyPromotionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelPromotionsRequest $request, ?array $options = null): CancelLoyaltyPromotionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}/promotions/{$request->getPromotionId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelLoyaltyPromotionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). + * Results are sorted by the `created_at` date in descending order (newest to oldest). + * + * @param ListPromotionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListLoyaltyPromotionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListPromotionsRequest $request, ?array $options = null): ListLoyaltyPromotionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getStatus() != null) { + $query['status'] = $request->getStatus(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/programs/{$request->getProgramId()}/promotions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListLoyaltyPromotionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Loyalty/Programs/Promotions/Requests/CancelPromotionsRequest.php b/src/Loyalty/Programs/Promotions/Requests/CancelPromotionsRequest.php new file mode 100644 index 00000000..25d9551d --- /dev/null +++ b/src/Loyalty/Programs/Promotions/Requests/CancelPromotionsRequest.php @@ -0,0 +1,68 @@ +promotionId = $values['promotionId']; + $this->programId = $values['programId']; + } + + /** + * @return string + */ + public function getPromotionId(): string + { + return $this->promotionId; + } + + /** + * @param string $value + */ + public function setPromotionId(string $value): self + { + $this->promotionId = $value; + return $this; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } +} diff --git a/src/Loyalty/Programs/Promotions/Requests/CreateLoyaltyPromotionRequest.php b/src/Loyalty/Programs/Promotions/Requests/CreateLoyaltyPromotionRequest.php new file mode 100644 index 00000000..7b9d748f --- /dev/null +++ b/src/Loyalty/Programs/Promotions/Requests/CreateLoyaltyPromotionRequest.php @@ -0,0 +1,100 @@ +programId = $values['programId']; + $this->loyaltyPromotion = $values['loyaltyPromotion']; + $this->idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } + + /** + * @return LoyaltyPromotion + */ + public function getLoyaltyPromotion(): LoyaltyPromotion + { + return $this->loyaltyPromotion; + } + + /** + * @param LoyaltyPromotion $value + */ + public function setLoyaltyPromotion(LoyaltyPromotion $value): self + { + $this->loyaltyPromotion = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Loyalty/Programs/Promotions/Requests/GetPromotionsRequest.php b/src/Loyalty/Programs/Promotions/Requests/GetPromotionsRequest.php new file mode 100644 index 00000000..62fd3fc4 --- /dev/null +++ b/src/Loyalty/Programs/Promotions/Requests/GetPromotionsRequest.php @@ -0,0 +1,68 @@ +promotionId = $values['promotionId']; + $this->programId = $values['programId']; + } + + /** + * @return string + */ + public function getPromotionId(): string + { + return $this->promotionId; + } + + /** + * @param string $value + */ + public function setPromotionId(string $value): self + { + $this->promotionId = $value; + return $this; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } +} diff --git a/src/Loyalty/Programs/Promotions/Requests/ListPromotionsRequest.php b/src/Loyalty/Programs/Promotions/Requests/ListPromotionsRequest.php new file mode 100644 index 00000000..59e53bfb --- /dev/null +++ b/src/Loyalty/Programs/Promotions/Requests/ListPromotionsRequest.php @@ -0,0 +1,129 @@ + $status + */ + private ?string $status; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * The maximum number of results to return in a single paged response. + * The minimum value is 1 and the maximum value is 30. The default value is 30. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @param array{ + * programId: string, + * status?: ?value-of, + * cursor?: ?string, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->programId = $values['programId']; + $this->status = $values['status'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Loyalty/Programs/Requests/CalculateLoyaltyPointsRequest.php b/src/Loyalty/Programs/Requests/CalculateLoyaltyPointsRequest.php new file mode 100644 index 00000000..a8721f05 --- /dev/null +++ b/src/Loyalty/Programs/Requests/CalculateLoyaltyPointsRequest.php @@ -0,0 +1,135 @@ +programId = $values['programId']; + $this->orderId = $values['orderId'] ?? null; + $this->transactionAmountMoney = $values['transactionAmountMoney'] ?? null; + $this->loyaltyAccountId = $values['loyaltyAccountId'] ?? null; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTransactionAmountMoney(): ?Money + { + return $this->transactionAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setTransactionAmountMoney(?Money $value = null): self + { + $this->transactionAmountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLoyaltyAccountId(): ?string + { + return $this->loyaltyAccountId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyAccountId(?string $value = null): self + { + $this->loyaltyAccountId = $value; + return $this; + } +} diff --git a/src/Loyalty/Programs/Requests/GetProgramsRequest.php b/src/Loyalty/Programs/Requests/GetProgramsRequest.php new file mode 100644 index 00000000..94832d19 --- /dev/null +++ b/src/Loyalty/Programs/Requests/GetProgramsRequest.php @@ -0,0 +1,41 @@ +programId = $values['programId']; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } +} diff --git a/src/Loyalty/Requests/SearchLoyaltyEventsRequest.php b/src/Loyalty/Requests/SearchLoyaltyEventsRequest.php new file mode 100644 index 00000000..286dbdc1 --- /dev/null +++ b/src/Loyalty/Requests/SearchLoyaltyEventsRequest.php @@ -0,0 +1,107 @@ +query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?LoyaltyEventQuery + */ + public function getQuery(): ?LoyaltyEventQuery + { + return $this->query; + } + + /** + * @param ?LoyaltyEventQuery $value + */ + public function setQuery(?LoyaltyEventQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/Requests/CreateLoyaltyRewardRequest.php b/src/Loyalty/Rewards/Requests/CreateLoyaltyRewardRequest.php new file mode 100644 index 00000000..1b3d1c61 --- /dev/null +++ b/src/Loyalty/Rewards/Requests/CreateLoyaltyRewardRequest.php @@ -0,0 +1,72 @@ +reward = $values['reward']; + $this->idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return LoyaltyReward + */ + public function getReward(): LoyaltyReward + { + return $this->reward; + } + + /** + * @param LoyaltyReward $value + */ + public function setReward(LoyaltyReward $value): self + { + $this->reward = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/Requests/DeleteRewardsRequest.php b/src/Loyalty/Rewards/Requests/DeleteRewardsRequest.php new file mode 100644 index 00000000..a8aa8b91 --- /dev/null +++ b/src/Loyalty/Rewards/Requests/DeleteRewardsRequest.php @@ -0,0 +1,41 @@ +rewardId = $values['rewardId']; + } + + /** + * @return string + */ + public function getRewardId(): string + { + return $this->rewardId; + } + + /** + * @param string $value + */ + public function setRewardId(string $value): self + { + $this->rewardId = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/Requests/GetRewardsRequest.php b/src/Loyalty/Rewards/Requests/GetRewardsRequest.php new file mode 100644 index 00000000..6bff48a9 --- /dev/null +++ b/src/Loyalty/Rewards/Requests/GetRewardsRequest.php @@ -0,0 +1,41 @@ +rewardId = $values['rewardId']; + } + + /** + * @return string + */ + public function getRewardId(): string + { + return $this->rewardId; + } + + /** + * @param string $value + */ + public function setRewardId(string $value): self + { + $this->rewardId = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/Requests/RedeemLoyaltyRewardRequest.php b/src/Loyalty/Rewards/Requests/RedeemLoyaltyRewardRequest.php new file mode 100644 index 00000000..0b2a4d20 --- /dev/null +++ b/src/Loyalty/Rewards/Requests/RedeemLoyaltyRewardRequest.php @@ -0,0 +1,95 @@ +rewardId = $values['rewardId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getRewardId(): string + { + return $this->rewardId; + } + + /** + * @param string $value + */ + public function setRewardId(string $value): self + { + $this->rewardId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/Requests/SearchLoyaltyRewardsRequest.php b/src/Loyalty/Rewards/Requests/SearchLoyaltyRewardsRequest.php new file mode 100644 index 00000000..b9c72361 --- /dev/null +++ b/src/Loyalty/Rewards/Requests/SearchLoyaltyRewardsRequest.php @@ -0,0 +1,103 @@ +query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?SearchLoyaltyRewardsRequestLoyaltyRewardQuery + */ + public function getQuery(): ?SearchLoyaltyRewardsRequestLoyaltyRewardQuery + { + return $this->query; + } + + /** + * @param ?SearchLoyaltyRewardsRequestLoyaltyRewardQuery $value + */ + public function setQuery(?SearchLoyaltyRewardsRequestLoyaltyRewardQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Loyalty/Rewards/RewardsClient.php b/src/Loyalty/Rewards/RewardsClient.php new file mode 100644 index 00000000..95925dfd --- /dev/null +++ b/src/Loyalty/Rewards/RewardsClient.php @@ -0,0 +1,370 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a loyalty reward. In the process, the endpoint does following: + * + * - Uses the `reward_tier_id` in the request to determine the number of points + * to lock for this reward. + * - If the request includes `order_id`, it adds the reward and related discount to the order. + * + * After a reward is created, the points are locked and + * not available for the buyer to redeem another reward. + * + * @param CreateLoyaltyRewardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateLoyaltyRewardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateLoyaltyRewardRequest $request, ?array $options = null): CreateLoyaltyRewardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/rewards", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateLoyaltyRewardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. + * If you include a `query` object, `loyalty_account_id` is required and `status` is optional. + * + * If you know a reward ID, use the + * [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint. + * + * Search results are sorted by `updated_at` in descending order. + * + * @param SearchLoyaltyRewardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchLoyaltyRewardsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchLoyaltyRewardsRequest $request = new SearchLoyaltyRewardsRequest(), ?array $options = null): SearchLoyaltyRewardsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/rewards/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchLoyaltyRewardsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a loyalty reward. + * + * @param GetRewardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetLoyaltyRewardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetRewardsRequest $request, ?array $options = null): GetLoyaltyRewardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/rewards/{$request->getRewardId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetLoyaltyRewardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a loyalty reward by doing the following: + * + * - Returns the loyalty points back to the loyalty account. + * - If an order ID was specified when the reward was created + * (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), + * it updates the order by removing the reward and related + * discounts. + * + * You cannot delete a reward that has reached the terminal state (REDEEMED). + * + * @param DeleteRewardsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteLoyaltyRewardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteRewardsRequest $request, ?array $options = null): DeleteLoyaltyRewardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/rewards/{$request->getRewardId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteLoyaltyRewardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Redeems a loyalty reward. + * + * The endpoint sets the reward to the `REDEEMED` terminal state. + * + * If you are using your own order processing system (not using the + * Orders API), you call this endpoint after the buyer paid for the + * purchase. + * + * After the reward reaches the terminal state, it cannot be deleted. + * In other words, points used for the reward cannot be returned + * to the account. + * + * @param RedeemLoyaltyRewardRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RedeemLoyaltyRewardResponse + * @throws SquareException + * @throws SquareApiException + */ + public function redeem(RedeemLoyaltyRewardRequest $request, ?array $options = null): RedeemLoyaltyRewardResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/loyalty/rewards/{$request->getRewardId()}/redeem", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RedeemLoyaltyRewardResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php new file mode 100644 index 00000000..d08f4bf7 --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -0,0 +1,406 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributeDefinitionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributeDefinitionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListMerchantCustomAttributeDefinitionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListMerchantCustomAttributeDefinitionsResponse $response) => $response?->getCustomAttributeDefinitions() ?? [], + ); + } + + /** + * Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. + * A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + * for a custom attribute. After the definition is created, you can call + * [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or + * [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + * to set the custom attribute for a merchant. + * + * @param CreateMerchantCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateMerchantCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateMerchantCustomAttributeDefinitionRequest $request, ?array $options = null): CreateMerchantCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attribute-definitions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateMerchantCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * To retrieve a custom attribute definition created by another application, the `visibility` + * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveMerchantCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributeDefinitionsRequest $request, ?array $options = null): RetrieveMerchantCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveMerchantCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + * Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + * `schema` for a `Selection` data type. + * Only the definition owner can update a custom attribute definition. + * + * @param UpdateMerchantCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateMerchantCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateMerchantCustomAttributeDefinitionRequest $request, ?array $options = null): UpdateMerchantCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateMerchantCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * Deleting a custom attribute definition also deletes the corresponding custom attribute from + * the merchant. + * Only the definition owner can delete a custom attribute definition. + * + * @param DeleteCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteMerchantCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributeDefinitionsRequest $request, ?array $options = null): DeleteMerchantCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteMerchantCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListMerchantCustomAttributeDefinitionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): ListMerchantCustomAttributeDefinitionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attribute-definitions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListMerchantCustomAttributeDefinitionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/Requests/CreateMerchantCustomAttributeDefinitionRequest.php b/src/Merchants/CustomAttributeDefinitions/Requests/CreateMerchantCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..e515a0e2 --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/Requests/CreateMerchantCustomAttributeDefinitionRequest.php @@ -0,0 +1,78 @@ +customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php b/src/Merchants/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..fb91c32a --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php @@ -0,0 +1,41 @@ +key = $values['key']; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php b/src/Merchants/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..271b7a2d --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php @@ -0,0 +1,73 @@ +key = $values['key']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php b/src/Merchants/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..1d485512 --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php @@ -0,0 +1,98 @@ + $visibilityFilter Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ + private ?string $visibilityFilter; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * @param array{ + * visibilityFilter?: ?value-of, + * limit?: ?int, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributeDefinitions/Requests/UpdateMerchantCustomAttributeDefinitionRequest.php b/src/Merchants/CustomAttributeDefinitions/Requests/UpdateMerchantCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..85fc3877 --- /dev/null +++ b/src/Merchants/CustomAttributeDefinitions/Requests/UpdateMerchantCustomAttributeDefinitionRequest.php @@ -0,0 +1,110 @@ +key = $values['key']; + $this->customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/CustomAttributesClient.php b/src/Merchants/CustomAttributes/CustomAttributesClient.php new file mode 100644 index 00000000..177e5701 --- /dev/null +++ b/src/Merchants/CustomAttributes/CustomAttributesClient.php @@ -0,0 +1,482 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkDeleteMerchantCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkDeleteMerchantCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchDelete(BulkDeleteMerchantCustomAttributesRequest $request, ?array $options = null): BulkDeleteMerchantCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attributes/bulk-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkDeleteMerchantCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. + * Use this endpoint to set the value of one or more custom attributes for a merchant. + * A custom attribute is based on a custom attribute definition in a Square seller account, which is + * created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. + * This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + * requests and returns a map of individual upsert responses. Each upsert request has a unique ID + * and provides a merchant ID and custom attribute. Each upsert response is returned with the ID + * of the corresponding request. + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkUpsertMerchantCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkUpsertMerchantCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BulkUpsertMerchantCustomAttributesRequest $request, ?array $options = null): BulkUpsertMerchantCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/custom-attributes/bulk-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkUpsertMerchantCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListMerchantCustomAttributesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListMerchantCustomAttributesResponse $response) => $response?->getCustomAttributes() ?? [], + ); + } + + /** + * Retrieves a [custom attribute](entity:CustomAttribute) associated with a merchant. + * You can use the `with_definition` query parameter to also retrieve the custom attribute definition + * in the same call. + * To retrieve a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveMerchantCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributesRequest $request, ?array $options = null): RetrieveMerchantCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getWithDefinition() != null) { + $query['with_definition'] = $request->getWithDefinition(); + } + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/{$request->getMerchantId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveMerchantCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates a [custom attribute](entity:CustomAttribute) for a merchant. + * Use this endpoint to set the value of a custom attribute for a specified merchant. + * A custom attribute is based on a custom attribute definition in a Square seller account, which + * is created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. + * + * @param UpsertMerchantCustomAttributeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertMerchantCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertMerchantCustomAttributeRequest $request, ?array $options = null): UpsertMerchantCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/{$request->getMerchantId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertMerchantCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant. + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. + * + * @param DeleteCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteMerchantCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributesRequest $request, ?array $options = null): DeleteMerchantCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/{$request->getMerchantId()}/custom-attributes/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteMerchantCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListMerchantCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributesRequest $request, ?array $options = null): ListMerchantCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getWithDefinitions() != null) { + $query['with_definitions'] = $request->getWithDefinitions(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/{$request->getMerchantId()}/custom-attributes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListMerchantCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Merchants/CustomAttributes/Requests/BulkDeleteMerchantCustomAttributesRequest.php b/src/Merchants/CustomAttributes/Requests/BulkDeleteMerchantCustomAttributesRequest.php new file mode 100644 index 00000000..4f804d69 --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/BulkDeleteMerchantCustomAttributesRequest.php @@ -0,0 +1,48 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/Requests/BulkUpsertMerchantCustomAttributesRequest.php b/src/Merchants/CustomAttributes/Requests/BulkUpsertMerchantCustomAttributesRequest.php new file mode 100644 index 00000000..cc4c2a97 --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/BulkUpsertMerchantCustomAttributesRequest.php @@ -0,0 +1,49 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/Requests/DeleteCustomAttributesRequest.php b/src/Merchants/CustomAttributes/Requests/DeleteCustomAttributesRequest.php new file mode 100644 index 00000000..218984b7 --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/DeleteCustomAttributesRequest.php @@ -0,0 +1,69 @@ +merchantId = $values['merchantId']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/Requests/GetCustomAttributesRequest.php b/src/Merchants/CustomAttributes/Requests/GetCustomAttributesRequest.php new file mode 100644 index 00000000..5fe3adb2 --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/GetCustomAttributesRequest.php @@ -0,0 +1,126 @@ +merchantId = $values['merchantId']; + $this->key = $values['key']; + $this->withDefinition = $values['withDefinition'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinition(): ?bool + { + return $this->withDefinition; + } + + /** + * @param ?bool $value + */ + public function setWithDefinition(?bool $value = null): self + { + $this->withDefinition = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/Requests/ListCustomAttributesRequest.php b/src/Merchants/CustomAttributes/Requests/ListCustomAttributesRequest.php new file mode 100644 index 00000000..93ea40cd --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/ListCustomAttributesRequest.php @@ -0,0 +1,150 @@ + $visibilityFilter Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ + private ?string $visibilityFilter; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. For more + * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each + * custom attribute. Set this parameter to `true` to get the name and description of each custom + * attribute, information about the data type, or other definition details. The default value is `false`. + * + * @var ?bool $withDefinitions + */ + private ?bool $withDefinitions; + + /** + * @param array{ + * merchantId: string, + * visibilityFilter?: ?value-of, + * limit?: ?int, + * cursor?: ?string, + * withDefinitions?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->merchantId = $values['merchantId']; + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->withDefinitions = $values['withDefinitions'] ?? null; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinitions(): ?bool + { + return $this->withDefinitions; + } + + /** + * @param ?bool $value + */ + public function setWithDefinitions(?bool $value = null): self + { + $this->withDefinitions = $value; + return $this; + } +} diff --git a/src/Merchants/CustomAttributes/Requests/UpsertMerchantCustomAttributeRequest.php b/src/Merchants/CustomAttributes/Requests/UpsertMerchantCustomAttributeRequest.php new file mode 100644 index 00000000..d436b81d --- /dev/null +++ b/src/Merchants/CustomAttributes/Requests/UpsertMerchantCustomAttributeRequest.php @@ -0,0 +1,131 @@ +merchantId = $values['merchantId']; + $this->key = $values['key']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Merchants/MerchantsClient.php b/src/Merchants/MerchantsClient.php new file mode 100644 index 00000000..f72b1a6e --- /dev/null +++ b/src/Merchants/MerchantsClient.php @@ -0,0 +1,234 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->customAttributeDefinitions = new CustomAttributeDefinitionsClient($this->client, $this->options); + $this->customAttributes = new CustomAttributesClient($this->client, $this->options); + } + + /** + * Provides details about the merchant associated with a given access token. + * + * The access token used to connect your application to a Square seller is associated + * with a single merchant. That means that `ListMerchants` returns a list + * with a single `Merchant` object. You can specify your personal access token + * to get your own merchant information or specify an OAuth token to get the + * information for the merchant that granted your application access. + * + * If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) + * endpoint to retrieve the merchant information. + * + * @param ListMerchantsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListMerchantsRequest $request = new ListMerchantsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListMerchantsRequest $request) => $this->_list($request, $options), + setCursor: function (ListMerchantsRequest $request, ?int $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListMerchantsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListMerchantsResponse $response) => $response?->getMerchant() ?? [], + ); + } + + /** + * Retrieves the `Merchant` object for the given `merchant_id`. + * + * @param GetMerchantsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetMerchantResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetMerchantsRequest $request, ?array $options = null): GetMerchantResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants/{$request->getMerchantId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetMerchantResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Provides details about the merchant associated with a given access token. + * + * The access token used to connect your application to a Square seller is associated + * with a single merchant. That means that `ListMerchants` returns a list + * with a single `Merchant` object. You can specify your personal access token + * to get your own merchant information or specify an OAuth token to get the + * information for the merchant that granted your application access. + * + * If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) + * endpoint to retrieve the merchant information. + * + * @param ListMerchantsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListMerchantsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListMerchantsRequest $request = new ListMerchantsRequest(), ?array $options = null): ListMerchantsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/merchants", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListMerchantsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Merchants/Requests/GetMerchantsRequest.php b/src/Merchants/Requests/GetMerchantsRequest.php new file mode 100644 index 00000000..5df4fe20 --- /dev/null +++ b/src/Merchants/Requests/GetMerchantsRequest.php @@ -0,0 +1,44 @@ +merchantId = $values['merchantId']; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } +} diff --git a/src/Merchants/Requests/ListMerchantsRequest.php b/src/Merchants/Requests/ListMerchantsRequest.php new file mode 100644 index 00000000..90e12a92 --- /dev/null +++ b/src/Merchants/Requests/ListMerchantsRequest.php @@ -0,0 +1,41 @@ +cursor = $values['cursor'] ?? null; + } + + /** + * @return ?int + */ + public function getCursor(): ?int + { + return $this->cursor; + } + + /** + * @param ?int $value + */ + public function setCursor(?int $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Mobile/MobileClient.php b/src/Mobile/MobileClient.php new file mode 100644 index 00000000..ec5ce928 --- /dev/null +++ b/src/Mobile/MobileClient.php @@ -0,0 +1,123 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * __Note:__ This endpoint is used by the deprecated Reader SDK. + * Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. + * + * Generates code to authorize a mobile application to connect to a Square card reader. + * + * Authorization codes are one-time-use codes and expire 60 minutes after being issued. + * + * The `Authorization` header you provide to this endpoint must have the following format: + * + * ``` + * Authorization: Bearer ACCESS_TOKEN + * ``` + * + * Replace `ACCESS_TOKEN` with a + * [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). + * + * @param CreateMobileAuthorizationCodeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateMobileAuthorizationCodeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function authorizationCode(CreateMobileAuthorizationCodeRequest $request = new CreateMobileAuthorizationCodeRequest(), ?array $options = null): CreateMobileAuthorizationCodeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "mobile/authorization-code", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateMobileAuthorizationCodeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php b/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php new file mode 100644 index 00000000..273e1f09 --- /dev/null +++ b/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php @@ -0,0 +1,43 @@ +locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Models/ACHDetails.php b/src/Models/ACHDetails.php deleted file mode 100644 index f9b664ef..00000000 --- a/src/Models/ACHDetails.php +++ /dev/null @@ -1,155 +0,0 @@ -routingNumber) == 0) { - return null; - } - return $this->routingNumber['value']; - } - - /** - * Sets Routing Number. - * The routing number for the bank account. - * - * @maps routing_number - */ - public function setRoutingNumber(?string $routingNumber): void - { - $this->routingNumber['value'] = $routingNumber; - } - - /** - * Unsets Routing Number. - * The routing number for the bank account. - */ - public function unsetRoutingNumber(): void - { - $this->routingNumber = []; - } - - /** - * Returns Account Number Suffix. - * The last few digits of the bank account number. - */ - public function getAccountNumberSuffix(): ?string - { - if (count($this->accountNumberSuffix) == 0) { - return null; - } - return $this->accountNumberSuffix['value']; - } - - /** - * Sets Account Number Suffix. - * The last few digits of the bank account number. - * - * @maps account_number_suffix - */ - public function setAccountNumberSuffix(?string $accountNumberSuffix): void - { - $this->accountNumberSuffix['value'] = $accountNumberSuffix; - } - - /** - * Unsets Account Number Suffix. - * The last few digits of the bank account number. - */ - public function unsetAccountNumberSuffix(): void - { - $this->accountNumberSuffix = []; - } - - /** - * Returns Account Type. - * The type of the bank account performing the transfer. The account type can be `CHECKING`, - * `SAVINGS`, or `UNKNOWN`. - */ - public function getAccountType(): ?string - { - if (count($this->accountType) == 0) { - return null; - } - return $this->accountType['value']; - } - - /** - * Sets Account Type. - * The type of the bank account performing the transfer. The account type can be `CHECKING`, - * `SAVINGS`, or `UNKNOWN`. - * - * @maps account_type - */ - public function setAccountType(?string $accountType): void - { - $this->accountType['value'] = $accountType; - } - - /** - * Unsets Account Type. - * The type of the bank account performing the transfer. The account type can be `CHECKING`, - * `SAVINGS`, or `UNKNOWN`. - */ - public function unsetAccountType(): void - { - $this->accountType = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->routingNumber)) { - $json['routing_number'] = $this->routingNumber['value']; - } - if (!empty($this->accountNumberSuffix)) { - $json['account_number_suffix'] = $this->accountNumberSuffix['value']; - } - if (!empty($this->accountType)) { - $json['account_type'] = $this->accountType['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AcceptDisputeResponse.php b/src/Models/AcceptDisputeResponse.php deleted file mode 100644 index 6c3db276..00000000 --- a/src/Models/AcceptDisputeResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - */ - public function getDispute(): ?Dispute - { - return $this->dispute; - } - - /** - * Sets Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - * - * @maps dispute - */ - public function setDispute(?Dispute $dispute): void - { - $this->dispute = $dispute; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->dispute)) { - $json['dispute'] = $this->dispute; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AcceptedPaymentMethods.php b/src/Models/AcceptedPaymentMethods.php deleted file mode 100644 index 546aa8b5..00000000 --- a/src/Models/AcceptedPaymentMethods.php +++ /dev/null @@ -1,189 +0,0 @@ -applePay) == 0) { - return null; - } - return $this->applePay['value']; - } - - /** - * Sets Apple Pay. - * Whether Apple Pay is accepted at checkout. - * - * @maps apple_pay - */ - public function setApplePay(?bool $applePay): void - { - $this->applePay['value'] = $applePay; - } - - /** - * Unsets Apple Pay. - * Whether Apple Pay is accepted at checkout. - */ - public function unsetApplePay(): void - { - $this->applePay = []; - } - - /** - * Returns Google Pay. - * Whether Google Pay is accepted at checkout. - */ - public function getGooglePay(): ?bool - { - if (count($this->googlePay) == 0) { - return null; - } - return $this->googlePay['value']; - } - - /** - * Sets Google Pay. - * Whether Google Pay is accepted at checkout. - * - * @maps google_pay - */ - public function setGooglePay(?bool $googlePay): void - { - $this->googlePay['value'] = $googlePay; - } - - /** - * Unsets Google Pay. - * Whether Google Pay is accepted at checkout. - */ - public function unsetGooglePay(): void - { - $this->googlePay = []; - } - - /** - * Returns Cash App Pay. - * Whether Cash App Pay is accepted at checkout. - */ - public function getCashAppPay(): ?bool - { - if (count($this->cashAppPay) == 0) { - return null; - } - return $this->cashAppPay['value']; - } - - /** - * Sets Cash App Pay. - * Whether Cash App Pay is accepted at checkout. - * - * @maps cash_app_pay - */ - public function setCashAppPay(?bool $cashAppPay): void - { - $this->cashAppPay['value'] = $cashAppPay; - } - - /** - * Unsets Cash App Pay. - * Whether Cash App Pay is accepted at checkout. - */ - public function unsetCashAppPay(): void - { - $this->cashAppPay = []; - } - - /** - * Returns Afterpay Clearpay. - * Whether Afterpay/Clearpay is accepted at checkout. - */ - public function getAfterpayClearpay(): ?bool - { - if (count($this->afterpayClearpay) == 0) { - return null; - } - return $this->afterpayClearpay['value']; - } - - /** - * Sets Afterpay Clearpay. - * Whether Afterpay/Clearpay is accepted at checkout. - * - * @maps afterpay_clearpay - */ - public function setAfterpayClearpay(?bool $afterpayClearpay): void - { - $this->afterpayClearpay['value'] = $afterpayClearpay; - } - - /** - * Unsets Afterpay Clearpay. - * Whether Afterpay/Clearpay is accepted at checkout. - */ - public function unsetAfterpayClearpay(): void - { - $this->afterpayClearpay = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->applePay)) { - $json['apple_pay'] = $this->applePay['value']; - } - if (!empty($this->googlePay)) { - $json['google_pay'] = $this->googlePay['value']; - } - if (!empty($this->cashAppPay)) { - $json['cash_app_pay'] = $this->cashAppPay['value']; - } - if (!empty($this->afterpayClearpay)) { - $json['afterpay_clearpay'] = $this->afterpayClearpay['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AccumulateLoyaltyPointsRequest.php b/src/Models/AccumulateLoyaltyPointsRequest.php deleted file mode 100644 index f914201a..00000000 --- a/src/Models/AccumulateLoyaltyPointsRequest.php +++ /dev/null @@ -1,130 +0,0 @@ -accumulatePoints = $accumulatePoints; - $this->idempotencyKey = $idempotencyKey; - $this->locationId = $locationId; - } - - /** - * Returns Accumulate Points. - * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - */ - public function getAccumulatePoints(): LoyaltyEventAccumulatePoints - { - return $this->accumulatePoints; - } - - /** - * Sets Accumulate Points. - * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - * - * @required - * @maps accumulate_points - */ - public function setAccumulatePoints(LoyaltyEventAccumulatePoints $accumulatePoints): void - { - $this->accumulatePoints = $accumulatePoints; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the `AccumulateLoyaltyPoints` request. - * Keys can be any valid string but must be unique for every request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `AccumulateLoyaltyPoints` request. - * Keys can be any valid string but must be unique for every request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Location Id. - * The [location](entity:Location) where the purchase was made. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The [location](entity:Location) where the purchase was made. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['accumulate_points'] = $this->accumulatePoints; - $json['idempotency_key'] = $this->idempotencyKey; - $json['location_id'] = $this->locationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AccumulateLoyaltyPointsResponse.php b/src/Models/AccumulateLoyaltyPointsResponse.php deleted file mode 100644 index dd3c1b79..00000000 --- a/src/Models/AccumulateLoyaltyPointsResponse.php +++ /dev/null @@ -1,132 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - */ - public function getEvent(): ?LoyaltyEvent - { - return $this->event; - } - - /** - * Sets Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - * - * @maps event - */ - public function setEvent(?LoyaltyEvent $event): void - { - $this->event = $event; - } - - /** - * Returns Events. - * The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event - * is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included - * if the purchase also qualifies for a loyalty promotion. - * - * @return LoyaltyEvent[]|null - */ - public function getEvents(): ?array - { - return $this->events; - } - - /** - * Sets Events. - * The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event - * is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included - * if the purchase also qualifies for a loyalty promotion. - * - * @maps events - * - * @param LoyaltyEvent[]|null $events - */ - public function setEvents(?array $events): void - { - $this->events = $events; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->event)) { - $json['event'] = $this->event; - } - if (isset($this->events)) { - $json['events'] = $this->events; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ActionCancelReason.php b/src/Models/ActionCancelReason.php deleted file mode 100644 index 55fdabe5..00000000 --- a/src/Models/ActionCancelReason.php +++ /dev/null @@ -1,23 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AdditionalRecipient.php b/src/Models/AdditionalRecipient.php deleted file mode 100644 index e6846d6c..00000000 --- a/src/Models/AdditionalRecipient.php +++ /dev/null @@ -1,191 +0,0 @@ -locationId = $locationId; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Location Id. - * The location ID for a recipient (other than the merchant) receiving a portion of this tender. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location ID for a recipient (other than the merchant) receiving a portion of this tender. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Description. - * The description of the additional recipient. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The description of the additional recipient. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The description of the additional recipient. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Receivable Id. - * The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for - * any `AdditionalRecipient` objects created after the retirement. - */ - public function getReceivableId(): ?string - { - if (count($this->receivableId) == 0) { - return null; - } - return $this->receivableId['value']; - } - - /** - * Sets Receivable Id. - * The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for - * any `AdditionalRecipient` objects created after the retirement. - * - * @maps receivable_id - */ - public function setReceivableId(?string $receivableId): void - { - $this->receivableId['value'] = $receivableId; - } - - /** - * Unsets Receivable Id. - * The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for - * any `AdditionalRecipient` objects created after the retirement. - */ - public function unsetReceivableId(): void - { - $this->receivableId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - $json['amount_money'] = $this->amountMoney; - if (!empty($this->receivableId)) { - $json['receivable_id'] = $this->receivableId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Address.php b/src/Models/Address.php deleted file mode 100644 index 269332a6..00000000 --- a/src/Models/Address.php +++ /dev/null @@ -1,617 +0,0 @@ -addressLine1) == 0) { - return null; - } - return $this->addressLine1['value']; - } - - /** - * Sets Address Line 1. - * The first line of the address. - * - * Fields that start with `address_line` provide the address's most specific - * details, like street number, street name, and building name. They do *not* - * provide less specific details like city, state/province, or country (these - * details are provided in other fields). - * - * @maps address_line_1 - */ - public function setAddressLine1(?string $addressLine1): void - { - $this->addressLine1['value'] = $addressLine1; - } - - /** - * Unsets Address Line 1. - * The first line of the address. - * - * Fields that start with `address_line` provide the address's most specific - * details, like street number, street name, and building name. They do *not* - * provide less specific details like city, state/province, or country (these - * details are provided in other fields). - */ - public function unsetAddressLine1(): void - { - $this->addressLine1 = []; - } - - /** - * Returns Address Line 2. - * The second line of the address, if any. - */ - public function getAddressLine2(): ?string - { - if (count($this->addressLine2) == 0) { - return null; - } - return $this->addressLine2['value']; - } - - /** - * Sets Address Line 2. - * The second line of the address, if any. - * - * @maps address_line_2 - */ - public function setAddressLine2(?string $addressLine2): void - { - $this->addressLine2['value'] = $addressLine2; - } - - /** - * Unsets Address Line 2. - * The second line of the address, if any. - */ - public function unsetAddressLine2(): void - { - $this->addressLine2 = []; - } - - /** - * Returns Address Line 3. - * The third line of the address, if any. - */ - public function getAddressLine3(): ?string - { - if (count($this->addressLine3) == 0) { - return null; - } - return $this->addressLine3['value']; - } - - /** - * Sets Address Line 3. - * The third line of the address, if any. - * - * @maps address_line_3 - */ - public function setAddressLine3(?string $addressLine3): void - { - $this->addressLine3['value'] = $addressLine3; - } - - /** - * Unsets Address Line 3. - * The third line of the address, if any. - */ - public function unsetAddressLine3(): void - { - $this->addressLine3 = []; - } - - /** - * Returns Locality. - * The city or town of the address. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function getLocality(): ?string - { - if (count($this->locality) == 0) { - return null; - } - return $this->locality['value']; - } - - /** - * Sets Locality. - * The city or town of the address. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - * - * @maps locality - */ - public function setLocality(?string $locality): void - { - $this->locality['value'] = $locality; - } - - /** - * Unsets Locality. - * The city or town of the address. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function unsetLocality(): void - { - $this->locality = []; - } - - /** - * Returns Sublocality. - * A civil region within the address's `locality`, if any. - */ - public function getSublocality(): ?string - { - if (count($this->sublocality) == 0) { - return null; - } - return $this->sublocality['value']; - } - - /** - * Sets Sublocality. - * A civil region within the address's `locality`, if any. - * - * @maps sublocality - */ - public function setSublocality(?string $sublocality): void - { - $this->sublocality['value'] = $sublocality; - } - - /** - * Unsets Sublocality. - * A civil region within the address's `locality`, if any. - */ - public function unsetSublocality(): void - { - $this->sublocality = []; - } - - /** - * Returns Sublocality 2. - * A civil region within the address's `sublocality`, if any. - */ - public function getSublocality2(): ?string - { - if (count($this->sublocality2) == 0) { - return null; - } - return $this->sublocality2['value']; - } - - /** - * Sets Sublocality 2. - * A civil region within the address's `sublocality`, if any. - * - * @maps sublocality_2 - */ - public function setSublocality2(?string $sublocality2): void - { - $this->sublocality2['value'] = $sublocality2; - } - - /** - * Unsets Sublocality 2. - * A civil region within the address's `sublocality`, if any. - */ - public function unsetSublocality2(): void - { - $this->sublocality2 = []; - } - - /** - * Returns Sublocality 3. - * A civil region within the address's `sublocality_2`, if any. - */ - public function getSublocality3(): ?string - { - if (count($this->sublocality3) == 0) { - return null; - } - return $this->sublocality3['value']; - } - - /** - * Sets Sublocality 3. - * A civil region within the address's `sublocality_2`, if any. - * - * @maps sublocality_3 - */ - public function setSublocality3(?string $sublocality3): void - { - $this->sublocality3['value'] = $sublocality3; - } - - /** - * Unsets Sublocality 3. - * A civil region within the address's `sublocality_2`, if any. - */ - public function unsetSublocality3(): void - { - $this->sublocality3 = []; - } - - /** - * Returns Administrative District Level 1. - * A civil entity within the address's country. In the US, this - * is the state. For a full list of field meanings by country, see [Working with Addresses](https: - * //developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function getAdministrativeDistrictLevel1(): ?string - { - if (count($this->administrativeDistrictLevel1) == 0) { - return null; - } - return $this->administrativeDistrictLevel1['value']; - } - - /** - * Sets Administrative District Level 1. - * A civil entity within the address's country. In the US, this - * is the state. For a full list of field meanings by country, see [Working with Addresses](https: - * //developer.squareup.com/docs/build-basics/working-with-addresses). - * - * @maps administrative_district_level_1 - */ - public function setAdministrativeDistrictLevel1(?string $administrativeDistrictLevel1): void - { - $this->administrativeDistrictLevel1['value'] = $administrativeDistrictLevel1; - } - - /** - * Unsets Administrative District Level 1. - * A civil entity within the address's country. In the US, this - * is the state. For a full list of field meanings by country, see [Working with Addresses](https: - * //developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function unsetAdministrativeDistrictLevel1(): void - { - $this->administrativeDistrictLevel1 = []; - } - - /** - * Returns Administrative District Level 2. - * A civil entity within the address's `administrative_district_level_1`. - * In the US, this is the county. - */ - public function getAdministrativeDistrictLevel2(): ?string - { - if (count($this->administrativeDistrictLevel2) == 0) { - return null; - } - return $this->administrativeDistrictLevel2['value']; - } - - /** - * Sets Administrative District Level 2. - * A civil entity within the address's `administrative_district_level_1`. - * In the US, this is the county. - * - * @maps administrative_district_level_2 - */ - public function setAdministrativeDistrictLevel2(?string $administrativeDistrictLevel2): void - { - $this->administrativeDistrictLevel2['value'] = $administrativeDistrictLevel2; - } - - /** - * Unsets Administrative District Level 2. - * A civil entity within the address's `administrative_district_level_1`. - * In the US, this is the county. - */ - public function unsetAdministrativeDistrictLevel2(): void - { - $this->administrativeDistrictLevel2 = []; - } - - /** - * Returns Administrative District Level 3. - * A civil entity within the address's `administrative_district_level_2`, - * if any. - */ - public function getAdministrativeDistrictLevel3(): ?string - { - if (count($this->administrativeDistrictLevel3) == 0) { - return null; - } - return $this->administrativeDistrictLevel3['value']; - } - - /** - * Sets Administrative District Level 3. - * A civil entity within the address's `administrative_district_level_2`, - * if any. - * - * @maps administrative_district_level_3 - */ - public function setAdministrativeDistrictLevel3(?string $administrativeDistrictLevel3): void - { - $this->administrativeDistrictLevel3['value'] = $administrativeDistrictLevel3; - } - - /** - * Unsets Administrative District Level 3. - * A civil entity within the address's `administrative_district_level_2`, - * if any. - */ - public function unsetAdministrativeDistrictLevel3(): void - { - $this->administrativeDistrictLevel3 = []; - } - - /** - * Returns Postal Code. - * The address's postal code. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function getPostalCode(): ?string - { - if (count($this->postalCode) == 0) { - return null; - } - return $this->postalCode['value']; - } - - /** - * Sets Postal Code. - * The address's postal code. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - * - * @maps postal_code - */ - public function setPostalCode(?string $postalCode): void - { - $this->postalCode['value'] = $postalCode; - } - - /** - * Unsets Postal Code. - * The address's postal code. For a full list of field meanings by country, see [Working with - * Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). - */ - public function unsetPostalCode(): void - { - $this->postalCode = []; - } - - /** - * Returns Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - */ - public function getCountry(): ?string - { - return $this->country; - } - - /** - * Sets Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - * - * @maps country - */ - public function setCountry(?string $country): void - { - $this->country = $country; - } - - /** - * Returns First Name. - * Optional first name when it's representing recipient. - */ - public function getFirstName(): ?string - { - if (count($this->firstName) == 0) { - return null; - } - return $this->firstName['value']; - } - - /** - * Sets First Name. - * Optional first name when it's representing recipient. - * - * @maps first_name - */ - public function setFirstName(?string $firstName): void - { - $this->firstName['value'] = $firstName; - } - - /** - * Unsets First Name. - * Optional first name when it's representing recipient. - */ - public function unsetFirstName(): void - { - $this->firstName = []; - } - - /** - * Returns Last Name. - * Optional last name when it's representing recipient. - */ - public function getLastName(): ?string - { - if (count($this->lastName) == 0) { - return null; - } - return $this->lastName['value']; - } - - /** - * Sets Last Name. - * Optional last name when it's representing recipient. - * - * @maps last_name - */ - public function setLastName(?string $lastName): void - { - $this->lastName['value'] = $lastName; - } - - /** - * Unsets Last Name. - * Optional last name when it's representing recipient. - */ - public function unsetLastName(): void - { - $this->lastName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->addressLine1)) { - $json['address_line_1'] = $this->addressLine1['value']; - } - if (!empty($this->addressLine2)) { - $json['address_line_2'] = $this->addressLine2['value']; - } - if (!empty($this->addressLine3)) { - $json['address_line_3'] = $this->addressLine3['value']; - } - if (!empty($this->locality)) { - $json['locality'] = $this->locality['value']; - } - if (!empty($this->sublocality)) { - $json['sublocality'] = $this->sublocality['value']; - } - if (!empty($this->sublocality2)) { - $json['sublocality_2'] = $this->sublocality2['value']; - } - if (!empty($this->sublocality3)) { - $json['sublocality_3'] = $this->sublocality3['value']; - } - if (!empty($this->administrativeDistrictLevel1)) { - $json['administrative_district_level_1'] = $this->administrativeDistrictLevel1['value']; - } - if (!empty($this->administrativeDistrictLevel2)) { - $json['administrative_district_level_2'] = $this->administrativeDistrictLevel2['value']; - } - if (!empty($this->administrativeDistrictLevel3)) { - $json['administrative_district_level_3'] = $this->administrativeDistrictLevel3['value']; - } - if (!empty($this->postalCode)) { - $json['postal_code'] = $this->postalCode['value']; - } - if (isset($this->country)) { - $json['country'] = $this->country; - } - if (!empty($this->firstName)) { - $json['first_name'] = $this->firstName['value']; - } - if (!empty($this->lastName)) { - $json['last_name'] = $this->lastName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AdjustLoyaltyPointsRequest.php b/src/Models/AdjustLoyaltyPointsRequest.php deleted file mode 100644 index 297907a5..00000000 --- a/src/Models/AdjustLoyaltyPointsRequest.php +++ /dev/null @@ -1,150 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->adjustPoints = $adjustPoints; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `AdjustLoyaltyPoints` request. - * Keys can be any valid string, but must be unique for every request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `AdjustLoyaltyPoints` request. - * Keys can be any valid string, but must be unique for every request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Adjust Points. - * Provides metadata when the event `type` is `ADJUST_POINTS`. - */ - public function getAdjustPoints(): LoyaltyEventAdjustPoints - { - return $this->adjustPoints; - } - - /** - * Sets Adjust Points. - * Provides metadata when the event `type` is `ADJUST_POINTS`. - * - * @required - * @maps adjust_points - */ - public function setAdjustPoints(LoyaltyEventAdjustPoints $adjustPoints): void - { - $this->adjustPoints = $adjustPoints; - } - - /** - * Returns Allow Negative Balance. - * Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a - * negative - * balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when - * subtracting - * the specified number of points would result in a negative balance. The default value is `false`. - */ - public function getAllowNegativeBalance(): ?bool - { - if (count($this->allowNegativeBalance) == 0) { - return null; - } - return $this->allowNegativeBalance['value']; - } - - /** - * Sets Allow Negative Balance. - * Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a - * negative - * balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when - * subtracting - * the specified number of points would result in a negative balance. The default value is `false`. - * - * @maps allow_negative_balance - */ - public function setAllowNegativeBalance(?bool $allowNegativeBalance): void - { - $this->allowNegativeBalance['value'] = $allowNegativeBalance; - } - - /** - * Unsets Allow Negative Balance. - * Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a - * negative - * balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when - * subtracting - * the specified number of points would result in a negative balance. The default value is `false`. - */ - public function unsetAllowNegativeBalance(): void - { - $this->allowNegativeBalance = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['adjust_points'] = $this->adjustPoints; - if (!empty($this->allowNegativeBalance)) { - $json['allow_negative_balance'] = $this->allowNegativeBalance['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AdjustLoyaltyPointsResponse.php b/src/Models/AdjustLoyaltyPointsResponse.php deleted file mode 100644 index c4cc755e..00000000 --- a/src/Models/AdjustLoyaltyPointsResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - */ - public function getEvent(): ?LoyaltyEvent - { - return $this->event; - } - - /** - * Sets Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - * - * @maps event - */ - public function setEvent(?LoyaltyEvent $event): void - { - $this->event = $event; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->event)) { - $json['event'] = $this->event; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/AfterpayDetails.php b/src/Models/AfterpayDetails.php deleted file mode 100644 index b98876c3..00000000 --- a/src/Models/AfterpayDetails.php +++ /dev/null @@ -1,72 +0,0 @@ -emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * Email address on the buyer's Afterpay account. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * Email address on the buyer's Afterpay account. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ApplicationDetails.php b/src/Models/ApplicationDetails.php deleted file mode 100644 index 67bb521b..00000000 --- a/src/Models/ApplicationDetails.php +++ /dev/null @@ -1,118 +0,0 @@ -squareProduct; - } - - /** - * Sets Square Product. - * A list of products to return to external callers. - * - * @maps square_product - */ - public function setSquareProduct(?string $squareProduct): void - { - $this->squareProduct = $squareProduct; - } - - /** - * Returns Application Id. - * The Square ID assigned to the application used to take the payment. - * Application developers can use this information to identify payments that - * their application processed. - * For example, if a developer uses a custom application to process payments, - * this field contains the application ID from the Developer Dashboard. - * If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) - * application to process payments, the field contains the corresponding application ID. - */ - public function getApplicationId(): ?string - { - if (count($this->applicationId) == 0) { - return null; - } - return $this->applicationId['value']; - } - - /** - * Sets Application Id. - * The Square ID assigned to the application used to take the payment. - * Application developers can use this information to identify payments that - * their application processed. - * For example, if a developer uses a custom application to process payments, - * this field contains the application ID from the Developer Dashboard. - * If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) - * application to process payments, the field contains the corresponding application ID. - * - * @maps application_id - */ - public function setApplicationId(?string $applicationId): void - { - $this->applicationId['value'] = $applicationId; - } - - /** - * Unsets Application Id. - * The Square ID assigned to the application used to take the payment. - * Application developers can use this information to identify payments that - * their application processed. - * For example, if a developer uses a custom application to process payments, - * this field contains the application ID from the Developer Dashboard. - * If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) - * application to process payments, the field contains the corresponding application ID. - */ - public function unsetApplicationId(): void - { - $this->applicationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->squareProduct)) { - $json['square_product'] = $this->squareProduct; - } - if (!empty($this->applicationId)) { - $json['application_id'] = $this->applicationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ApplicationDetailsExternalSquareProduct.php b/src/Models/ApplicationDetailsExternalSquareProduct.php deleted file mode 100644 index 3b097e39..00000000 --- a/src/Models/ApplicationDetailsExternalSquareProduct.php +++ /dev/null @@ -1,31 +0,0 @@ -teamMemberId = $teamMemberId; - } - - /** - * Returns Duration Minutes. - * The time span in minutes of an appointment segment. - */ - public function getDurationMinutes(): ?int - { - if (count($this->durationMinutes) == 0) { - return null; - } - return $this->durationMinutes['value']; - } - - /** - * Sets Duration Minutes. - * The time span in minutes of an appointment segment. - * - * @maps duration_minutes - */ - public function setDurationMinutes(?int $durationMinutes): void - { - $this->durationMinutes['value'] = $durationMinutes; - } - - /** - * Unsets Duration Minutes. - * The time span in minutes of an appointment segment. - */ - public function unsetDurationMinutes(): void - { - $this->durationMinutes = []; - } - - /** - * Returns Service Variation Id. - * The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service - * booked in this segment. - */ - public function getServiceVariationId(): ?string - { - if (count($this->serviceVariationId) == 0) { - return null; - } - return $this->serviceVariationId['value']; - } - - /** - * Sets Service Variation Id. - * The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service - * booked in this segment. - * - * @maps service_variation_id - */ - public function setServiceVariationId(?string $serviceVariationId): void - { - $this->serviceVariationId['value'] = $serviceVariationId; - } - - /** - * Unsets Service Variation Id. - * The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service - * booked in this segment. - */ - public function unsetServiceVariationId(): void - { - $this->serviceVariationId = []; - } - - /** - * Returns Team Member Id. - * The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this - * segment. - */ - public function getTeamMemberId(): string - { - return $this->teamMemberId; - } - - /** - * Sets Team Member Id. - * The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this - * segment. - * - * @required - * @maps team_member_id - */ - public function setTeamMemberId(string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Returns Service Variation Version. - * The current version of the item variation representing the service booked in this segment. - */ - public function getServiceVariationVersion(): ?int - { - if (count($this->serviceVariationVersion) == 0) { - return null; - } - return $this->serviceVariationVersion['value']; - } - - /** - * Sets Service Variation Version. - * The current version of the item variation representing the service booked in this segment. - * - * @maps service_variation_version - */ - public function setServiceVariationVersion(?int $serviceVariationVersion): void - { - $this->serviceVariationVersion['value'] = $serviceVariationVersion; - } - - /** - * Unsets Service Variation Version. - * The current version of the item variation representing the service booked in this segment. - */ - public function unsetServiceVariationVersion(): void - { - $this->serviceVariationVersion = []; - } - - /** - * Returns Intermission Minutes. - * Time between the end of this segment and the beginning of the subsequent segment. - */ - public function getIntermissionMinutes(): ?int - { - return $this->intermissionMinutes; - } - - /** - * Sets Intermission Minutes. - * Time between the end of this segment and the beginning of the subsequent segment. - * - * @maps intermission_minutes - */ - public function setIntermissionMinutes(?int $intermissionMinutes): void - { - $this->intermissionMinutes = $intermissionMinutes; - } - - /** - * Returns Any Team Member. - * Whether the customer accepts any team member, instead of a specific one, to serve this segment. - */ - public function getAnyTeamMember(): ?bool - { - return $this->anyTeamMember; - } - - /** - * Sets Any Team Member. - * Whether the customer accepts any team member, instead of a specific one, to serve this segment. - * - * @maps any_team_member - */ - public function setAnyTeamMember(?bool $anyTeamMember): void - { - $this->anyTeamMember = $anyTeamMember; - } - - /** - * Returns Resource Ids. - * The IDs of the seller-accessible resources used for this appointment segment. - * - * @return string[]|null - */ - public function getResourceIds(): ?array - { - return $this->resourceIds; - } - - /** - * Sets Resource Ids. - * The IDs of the seller-accessible resources used for this appointment segment. - * - * @maps resource_ids - * - * @param string[]|null $resourceIds - */ - public function setResourceIds(?array $resourceIds): void - { - $this->resourceIds = $resourceIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->durationMinutes)) { - $json['duration_minutes'] = $this->durationMinutes['value']; - } - if (!empty($this->serviceVariationId)) { - $json['service_variation_id'] = $this->serviceVariationId['value']; - } - $json['team_member_id'] = $this->teamMemberId; - if (!empty($this->serviceVariationVersion)) { - $json['service_variation_version'] = $this->serviceVariationVersion['value']; - } - if (isset($this->intermissionMinutes)) { - $json['intermission_minutes'] = $this->intermissionMinutes; - } - if (isset($this->anyTeamMember)) { - $json['any_team_member'] = $this->anyTeamMember; - } - if (isset($this->resourceIds)) { - $json['resource_ids'] = $this->resourceIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ArchivedState.php b/src/Models/ArchivedState.php deleted file mode 100644 index 2deef7e5..00000000 --- a/src/Models/ArchivedState.php +++ /dev/null @@ -1,28 +0,0 @@ -startAt) == 0) { - return null; - } - return $this->startAt['value']; - } - - /** - * Sets Start At. - * The RFC 3339 timestamp specifying the beginning time of the slot available for booking. - * - * @maps start_at - */ - public function setStartAt(?string $startAt): void - { - $this->startAt['value'] = $startAt; - } - - /** - * Unsets Start At. - * The RFC 3339 timestamp specifying the beginning time of the slot available for booking. - */ - public function unsetStartAt(): void - { - $this->startAt = []; - } - - /** - * Returns Location Id. - * The ID of the location available for booking. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location available for booking. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Appointment Segments. - * The list of appointment segments available for booking - * - * @return AppointmentSegment[]|null - */ - public function getAppointmentSegments(): ?array - { - if (count($this->appointmentSegments) == 0) { - return null; - } - return $this->appointmentSegments['value']; - } - - /** - * Sets Appointment Segments. - * The list of appointment segments available for booking - * - * @maps appointment_segments - * - * @param AppointmentSegment[]|null $appointmentSegments - */ - public function setAppointmentSegments(?array $appointmentSegments): void - { - $this->appointmentSegments['value'] = $appointmentSegments; - } - - /** - * Unsets Appointment Segments. - * The list of appointment segments available for booking - */ - public function unsetAppointmentSegments(): void - { - $this->appointmentSegments = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->startAt)) { - $json['start_at'] = $this->startAt['value']; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (!empty($this->appointmentSegments)) { - $json['appointment_segments'] = $this->appointmentSegments['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BankAccount.php b/src/Models/BankAccount.php deleted file mode 100644 index f66ca5e7..00000000 --- a/src/Models/BankAccount.php +++ /dev/null @@ -1,636 +0,0 @@ -id = $id; - $this->accountNumberSuffix = $accountNumberSuffix; - $this->country = $country; - $this->currency = $currency; - $this->accountType = $accountType; - $this->holderName = $holderName; - $this->primaryBankIdentificationNumber = $primaryBankIdentificationNumber; - $this->status = $status; - $this->creditable = $creditable; - $this->debitable = $debitable; - } - - /** - * Returns Id. - * The unique, Square-issued identifier for the bank account. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The unique, Square-issued identifier for the bank account. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Account Number Suffix. - * The last few digits of the account number. - */ - public function getAccountNumberSuffix(): string - { - return $this->accountNumberSuffix; - } - - /** - * Sets Account Number Suffix. - * The last few digits of the account number. - * - * @required - * @maps account_number_suffix - */ - public function setAccountNumberSuffix(string $accountNumberSuffix): void - { - $this->accountNumberSuffix = $accountNumberSuffix; - } - - /** - * Returns Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - */ - public function getCountry(): string - { - return $this->country; - } - - /** - * Sets Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - * - * @required - * @maps country - */ - public function setCountry(string $country): void - { - $this->country = $country; - } - - /** - * Returns Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - */ - public function getCurrency(): string - { - return $this->currency; - } - - /** - * Sets Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - * - * @required - * @maps currency - */ - public function setCurrency(string $currency): void - { - $this->currency = $currency; - } - - /** - * Returns Account Type. - * Indicates the financial purpose of the bank account. - */ - public function getAccountType(): string - { - return $this->accountType; - } - - /** - * Sets Account Type. - * Indicates the financial purpose of the bank account. - * - * @required - * @maps account_type - */ - public function setAccountType(string $accountType): void - { - $this->accountType = $accountType; - } - - /** - * Returns Holder Name. - * Name of the account holder. This name must match the name - * on the targeted bank account record. - */ - public function getHolderName(): string - { - return $this->holderName; - } - - /** - * Sets Holder Name. - * Name of the account holder. This name must match the name - * on the targeted bank account record. - * - * @required - * @maps holder_name - */ - public function setHolderName(string $holderName): void - { - $this->holderName = $holderName; - } - - /** - * Returns Primary Bank Identification Number. - * Primary identifier for the bank. For more information, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - */ - public function getPrimaryBankIdentificationNumber(): string - { - return $this->primaryBankIdentificationNumber; - } - - /** - * Sets Primary Bank Identification Number. - * Primary identifier for the bank. For more information, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - * - * @required - * @maps primary_bank_identification_number - */ - public function setPrimaryBankIdentificationNumber(string $primaryBankIdentificationNumber): void - { - $this->primaryBankIdentificationNumber = $primaryBankIdentificationNumber; - } - - /** - * Returns Secondary Bank Identification Number. - * Secondary identifier for the bank. For more information, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - */ - public function getSecondaryBankIdentificationNumber(): ?string - { - if (count($this->secondaryBankIdentificationNumber) == 0) { - return null; - } - return $this->secondaryBankIdentificationNumber['value']; - } - - /** - * Sets Secondary Bank Identification Number. - * Secondary identifier for the bank. For more information, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - * - * @maps secondary_bank_identification_number - */ - public function setSecondaryBankIdentificationNumber(?string $secondaryBankIdentificationNumber): void - { - $this->secondaryBankIdentificationNumber['value'] = $secondaryBankIdentificationNumber; - } - - /** - * Unsets Secondary Bank Identification Number. - * Secondary identifier for the bank. For more information, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - */ - public function unsetSecondaryBankIdentificationNumber(): void - { - $this->secondaryBankIdentificationNumber = []; - } - - /** - * Returns Debit Mandate Reference Id. - * Reference identifier that will be displayed to UK bank account owners - * when collecting direct debit authorization. Only required for UK bank accounts. - */ - public function getDebitMandateReferenceId(): ?string - { - if (count($this->debitMandateReferenceId) == 0) { - return null; - } - return $this->debitMandateReferenceId['value']; - } - - /** - * Sets Debit Mandate Reference Id. - * Reference identifier that will be displayed to UK bank account owners - * when collecting direct debit authorization. Only required for UK bank accounts. - * - * @maps debit_mandate_reference_id - */ - public function setDebitMandateReferenceId(?string $debitMandateReferenceId): void - { - $this->debitMandateReferenceId['value'] = $debitMandateReferenceId; - } - - /** - * Unsets Debit Mandate Reference Id. - * Reference identifier that will be displayed to UK bank account owners - * when collecting direct debit authorization. Only required for UK bank accounts. - */ - public function unsetDebitMandateReferenceId(): void - { - $this->debitMandateReferenceId = []; - } - - /** - * Returns Reference Id. - * Client-provided identifier for linking the banking account to an entity - * in a third-party system (for example, a bank account number or a user identifier). - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * Client-provided identifier for linking the banking account to an entity - * in a third-party system (for example, a bank account number or a user identifier). - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * Client-provided identifier for linking the banking account to an entity - * in a third-party system (for example, a bank account number or a user identifier). - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Location Id. - * The location to which the bank account belongs. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location to which the bank account belongs. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location to which the bank account belongs. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Status. - * Indicates the current verification status of a `BankAccount` object. - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates the current verification status of a `BankAccount` object. - * - * @required - * @maps status - */ - public function setStatus(string $status): void - { - $this->status = $status; - } - - /** - * Returns Creditable. - * Indicates whether it is possible for Square to send money to this bank account. - */ - public function getCreditable(): bool - { - return $this->creditable; - } - - /** - * Sets Creditable. - * Indicates whether it is possible for Square to send money to this bank account. - * - * @required - * @maps creditable - */ - public function setCreditable(bool $creditable): void - { - $this->creditable = $creditable; - } - - /** - * Returns Debitable. - * Indicates whether it is possible for Square to take money from this - * bank account. - */ - public function getDebitable(): bool - { - return $this->debitable; - } - - /** - * Sets Debitable. - * Indicates whether it is possible for Square to take money from this - * bank account. - * - * @required - * @maps debitable - */ - public function setDebitable(bool $debitable): void - { - $this->debitable = $debitable; - } - - /** - * Returns Fingerprint. - * A Square-assigned, unique identifier for the bank account based on the - * account information. The account fingerprint can be used to compare account - * entries and determine if the they represent the same real-world bank account. - */ - public function getFingerprint(): ?string - { - if (count($this->fingerprint) == 0) { - return null; - } - return $this->fingerprint['value']; - } - - /** - * Sets Fingerprint. - * A Square-assigned, unique identifier for the bank account based on the - * account information. The account fingerprint can be used to compare account - * entries and determine if the they represent the same real-world bank account. - * - * @maps fingerprint - */ - public function setFingerprint(?string $fingerprint): void - { - $this->fingerprint['value'] = $fingerprint; - } - - /** - * Unsets Fingerprint. - * A Square-assigned, unique identifier for the bank account based on the - * account information. The account fingerprint can be used to compare account - * entries and determine if the they represent the same real-world bank account. - */ - public function unsetFingerprint(): void - { - $this->fingerprint = []; - } - - /** - * Returns Version. - * The current version of the `BankAccount`. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the `BankAccount`. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Bank Name. - * Read only. Name of actual financial institution. - * For example "Bank of America". - */ - public function getBankName(): ?string - { - if (count($this->bankName) == 0) { - return null; - } - return $this->bankName['value']; - } - - /** - * Sets Bank Name. - * Read only. Name of actual financial institution. - * For example "Bank of America". - * - * @maps bank_name - */ - public function setBankName(?string $bankName): void - { - $this->bankName['value'] = $bankName; - } - - /** - * Unsets Bank Name. - * Read only. Name of actual financial institution. - * For example "Bank of America". - */ - public function unsetBankName(): void - { - $this->bankName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['account_number_suffix'] = $this->accountNumberSuffix; - $json['country'] = $this->country; - $json['currency'] = $this->currency; - $json['account_type'] = $this->accountType; - $json['holder_name'] = $this->holderName; - $json['primary_bank_identification_number'] = $this->primaryBankIdentificationNumber; - if (!empty($this->secondaryBankIdentificationNumber)) { - $json['secondary_bank_identification_number'] = $this->secondaryBankIdentificationNumber['value']; - } - if (!empty($this->debitMandateReferenceId)) { - $json['debit_mandate_reference_id'] = $this->debitMandateReferenceId['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json['status'] = $this->status; - $json['creditable'] = $this->creditable; - $json['debitable'] = $this->debitable; - if (!empty($this->fingerprint)) { - $json['fingerprint'] = $this->fingerprint['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->bankName)) { - $json['bank_name'] = $this->bankName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BankAccountPaymentDetails.php b/src/Models/BankAccountPaymentDetails.php deleted file mode 100644 index fba68af9..00000000 --- a/src/Models/BankAccountPaymentDetails.php +++ /dev/null @@ -1,350 +0,0 @@ -bankName) == 0) { - return null; - } - return $this->bankName['value']; - } - - /** - * Sets Bank Name. - * The name of the bank associated with the bank account. - * - * @maps bank_name - */ - public function setBankName(?string $bankName): void - { - $this->bankName['value'] = $bankName; - } - - /** - * Unsets Bank Name. - * The name of the bank associated with the bank account. - */ - public function unsetBankName(): void - { - $this->bankName = []; - } - - /** - * Returns Transfer Type. - * The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. - */ - public function getTransferType(): ?string - { - if (count($this->transferType) == 0) { - return null; - } - return $this->transferType['value']; - } - - /** - * Sets Transfer Type. - * The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. - * - * @maps transfer_type - */ - public function setTransferType(?string $transferType): void - { - $this->transferType['value'] = $transferType; - } - - /** - * Unsets Transfer Type. - * The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. - */ - public function unsetTransferType(): void - { - $this->transferType = []; - } - - /** - * Returns Account Ownership Type. - * The ownership type of the bank account performing the transfer. - * The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`. - */ - public function getAccountOwnershipType(): ?string - { - if (count($this->accountOwnershipType) == 0) { - return null; - } - return $this->accountOwnershipType['value']; - } - - /** - * Sets Account Ownership Type. - * The ownership type of the bank account performing the transfer. - * The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`. - * - * @maps account_ownership_type - */ - public function setAccountOwnershipType(?string $accountOwnershipType): void - { - $this->accountOwnershipType['value'] = $accountOwnershipType; - } - - /** - * Unsets Account Ownership Type. - * The ownership type of the bank account performing the transfer. - * The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`. - */ - public function unsetAccountOwnershipType(): void - { - $this->accountOwnershipType = []; - } - - /** - * Returns Fingerprint. - * Uniquely identifies the bank account for this seller and can be used - * to determine if payments are from the same bank account. - */ - public function getFingerprint(): ?string - { - if (count($this->fingerprint) == 0) { - return null; - } - return $this->fingerprint['value']; - } - - /** - * Sets Fingerprint. - * Uniquely identifies the bank account for this seller and can be used - * to determine if payments are from the same bank account. - * - * @maps fingerprint - */ - public function setFingerprint(?string $fingerprint): void - { - $this->fingerprint['value'] = $fingerprint; - } - - /** - * Unsets Fingerprint. - * Uniquely identifies the bank account for this seller and can be used - * to determine if payments are from the same bank account. - */ - public function unsetFingerprint(): void - { - $this->fingerprint = []; - } - - /** - * Returns Country. - * The two-letter ISO code representing the country the bank account is located in. - */ - public function getCountry(): ?string - { - if (count($this->country) == 0) { - return null; - } - return $this->country['value']; - } - - /** - * Sets Country. - * The two-letter ISO code representing the country the bank account is located in. - * - * @maps country - */ - public function setCountry(?string $country): void - { - $this->country['value'] = $country; - } - - /** - * Unsets Country. - * The two-letter ISO code representing the country the bank account is located in. - */ - public function unsetCountry(): void - { - $this->country = []; - } - - /** - * Returns Statement Description. - * The statement description as sent to the bank. - */ - public function getStatementDescription(): ?string - { - if (count($this->statementDescription) == 0) { - return null; - } - return $this->statementDescription['value']; - } - - /** - * Sets Statement Description. - * The statement description as sent to the bank. - * - * @maps statement_description - */ - public function setStatementDescription(?string $statementDescription): void - { - $this->statementDescription['value'] = $statementDescription; - } - - /** - * Unsets Statement Description. - * The statement description as sent to the bank. - */ - public function unsetStatementDescription(): void - { - $this->statementDescription = []; - } - - /** - * Returns Ach Details. - * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. - */ - public function getAchDetails(): ?ACHDetails - { - return $this->achDetails; - } - - /** - * Sets Ach Details. - * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. - * - * @maps ach_details - */ - public function setAchDetails(?ACHDetails $achDetails): void - { - $this->achDetails = $achDetails; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - if (count($this->errors) == 0) { - return null; - } - return $this->errors['value']; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors['value'] = $errors; - } - - /** - * Unsets Errors. - * Information about errors encountered during the request. - */ - public function unsetErrors(): void - { - $this->errors = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->bankName)) { - $json['bank_name'] = $this->bankName['value']; - } - if (!empty($this->transferType)) { - $json['transfer_type'] = $this->transferType['value']; - } - if (!empty($this->accountOwnershipType)) { - $json['account_ownership_type'] = $this->accountOwnershipType['value']; - } - if (!empty($this->fingerprint)) { - $json['fingerprint'] = $this->fingerprint['value']; - } - if (!empty($this->country)) { - $json['country'] = $this->country['value']; - } - if (!empty($this->statementDescription)) { - $json['statement_description'] = $this->statementDescription['value']; - } - if (isset($this->achDetails)) { - $json['ach_details'] = $this->achDetails; - } - if (!empty($this->errors)) { - $json['errors'] = $this->errors['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BankAccountStatus.php b/src/Models/BankAccountStatus.php deleted file mode 100644 index 25144eaa..00000000 --- a/src/Models/BankAccountStatus.php +++ /dev/null @@ -1,30 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A client-supplied, universally unique identifier (UUID) for the - * request. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A client-supplied, universally unique identifier (UUID) for the - * request. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Changes. - * The set of physical counts and inventory adjustments to be made. - * Changes are applied based on the client-supplied timestamp and may be sent - * out of order. - * - * @return InventoryChange[]|null - */ - public function getChanges(): ?array - { - if (count($this->changes) == 0) { - return null; - } - return $this->changes['value']; - } - - /** - * Sets Changes. - * The set of physical counts and inventory adjustments to be made. - * Changes are applied based on the client-supplied timestamp and may be sent - * out of order. - * - * @maps changes - * - * @param InventoryChange[]|null $changes - */ - public function setChanges(?array $changes): void - { - $this->changes['value'] = $changes; - } - - /** - * Unsets Changes. - * The set of physical counts and inventory adjustments to be made. - * Changes are applied based on the client-supplied timestamp and may be sent - * out of order. - */ - public function unsetChanges(): void - { - $this->changes = []; - } - - /** - * Returns Ignore Unchanged Counts. - * Indicates whether the current physical count should be ignored if - * the quantity is unchanged since the last physical count. Default: `true`. - */ - public function getIgnoreUnchangedCounts(): ?bool - { - if (count($this->ignoreUnchangedCounts) == 0) { - return null; - } - return $this->ignoreUnchangedCounts['value']; - } - - /** - * Sets Ignore Unchanged Counts. - * Indicates whether the current physical count should be ignored if - * the quantity is unchanged since the last physical count. Default: `true`. - * - * @maps ignore_unchanged_counts - */ - public function setIgnoreUnchangedCounts(?bool $ignoreUnchangedCounts): void - { - $this->ignoreUnchangedCounts['value'] = $ignoreUnchangedCounts; - } - - /** - * Unsets Ignore Unchanged Counts. - * Indicates whether the current physical count should be ignored if - * the quantity is unchanged since the last physical count. Default: `true`. - */ - public function unsetIgnoreUnchangedCounts(): void - { - $this->ignoreUnchangedCounts = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (!empty($this->changes)) { - $json['changes'] = $this->changes['value']; - } - if (!empty($this->ignoreUnchangedCounts)) { - $json['ignore_unchanged_counts'] = $this->ignoreUnchangedCounts['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchChangeInventoryResponse.php b/src/Models/BatchChangeInventoryResponse.php deleted file mode 100644 index 5edc8321..00000000 --- a/src/Models/BatchChangeInventoryResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Counts. - * The current counts for all objects referenced in the request. - * - * @return InventoryCount[]|null - */ - public function getCounts(): ?array - { - return $this->counts; - } - - /** - * Sets Counts. - * The current counts for all objects referenced in the request. - * - * @maps counts - * - * @param InventoryCount[]|null $counts - */ - public function setCounts(?array $counts): void - { - $this->counts = $counts; - } - - /** - * Returns Changes. - * Changes created for the request. - * - * @return InventoryChange[]|null - */ - public function getChanges(): ?array - { - return $this->changes; - } - - /** - * Sets Changes. - * Changes created for the request. - * - * @maps changes - * - * @param InventoryChange[]|null $changes - */ - public function setChanges(?array $changes): void - { - $this->changes = $changes; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->counts)) { - $json['counts'] = $this->counts; - } - if (isset($this->changes)) { - $json['changes'] = $this->changes; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchDeleteCatalogObjectsRequest.php b/src/Models/BatchDeleteCatalogObjectsRequest.php deleted file mode 100644 index 8f8a72ca..00000000 --- a/src/Models/BatchDeleteCatalogObjectsRequest.php +++ /dev/null @@ -1,79 +0,0 @@ -objectIds) == 0) { - return null; - } - return $this->objectIds['value']; - } - - /** - * Sets Object Ids. - * The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects - * in the graph that depend on that object will be deleted as well (for example, deleting a - * CatalogItem will delete its CatalogItemVariation. - * - * @maps object_ids - * - * @param string[]|null $objectIds - */ - public function setObjectIds(?array $objectIds): void - { - $this->objectIds['value'] = $objectIds; - } - - /** - * Unsets Object Ids. - * The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects - * in the graph that depend on that object will be deleted as well (for example, deleting a - * CatalogItem will delete its CatalogItemVariation. - */ - public function unsetObjectIds(): void - { - $this->objectIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->objectIds)) { - $json['object_ids'] = $this->objectIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchDeleteCatalogObjectsResponse.php b/src/Models/BatchDeleteCatalogObjectsResponse.php deleted file mode 100644 index e686733e..00000000 --- a/src/Models/BatchDeleteCatalogObjectsResponse.php +++ /dev/null @@ -1,123 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Deleted Object Ids. - * The IDs of all CatalogObjects deleted by this request. - * - * @return string[]|null - */ - public function getDeletedObjectIds(): ?array - { - return $this->deletedObjectIds; - } - - /** - * Sets Deleted Object Ids. - * The IDs of all CatalogObjects deleted by this request. - * - * @maps deleted_object_ids - * - * @param string[]|null $deletedObjectIds - */ - public function setDeletedObjectIds(?array $deletedObjectIds): void - { - $this->deletedObjectIds = $deletedObjectIds; - } - - /** - * Returns Deleted At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". - */ - public function getDeletedAt(): ?string - { - return $this->deletedAt; - } - - /** - * Sets Deleted At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". - * - * @maps deleted_at - */ - public function setDeletedAt(?string $deletedAt): void - { - $this->deletedAt = $deletedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->deletedObjectIds)) { - $json['deleted_object_ids'] = $this->deletedObjectIds; - } - if (isset($this->deletedAt)) { - $json['deleted_at'] = $this->deletedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveCatalogObjectsRequest.php b/src/Models/BatchRetrieveCatalogObjectsRequest.php deleted file mode 100644 index 62994b51..00000000 --- a/src/Models/BatchRetrieveCatalogObjectsRequest.php +++ /dev/null @@ -1,306 +0,0 @@ -objectIds = $objectIds; - } - - /** - * Returns Object Ids. - * The IDs of the CatalogObjects to be retrieved. - * - * @return string[] - */ - public function getObjectIds(): array - { - return $this->objectIds; - } - - /** - * Sets Object Ids. - * The IDs of the CatalogObjects to be retrieved. - * - * @required - * @maps object_ids - * - * @param string[] $objectIds - */ - public function setObjectIds(array $objectIds): void - { - $this->objectIds = $objectIds; - } - - /** - * Returns Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by the results in the - * `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - */ - public function getIncludeRelatedObjects(): ?bool - { - if (count($this->includeRelatedObjects) == 0) { - return null; - } - return $this->includeRelatedObjects['value']; - } - - /** - * Sets Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by the results in the - * `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - * - * @maps include_related_objects - */ - public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void - { - $this->includeRelatedObjects['value'] = $includeRelatedObjects; - } - - /** - * Unsets Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by the results in the - * `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - */ - public function unsetIncludeRelatedObjects(): void - { - $this->includeRelatedObjects = []; - } - - /** - * Returns Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will - * be from the current version of the catalog. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will - * be from the current version of the catalog. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will - * be from the current version of the catalog. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Include Deleted Objects. - * Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, - * those with the `is_deleted` attribute set to `true`. - */ - public function getIncludeDeletedObjects(): ?bool - { - if (count($this->includeDeletedObjects) == 0) { - return null; - } - return $this->includeDeletedObjects['value']; - } - - /** - * Sets Include Deleted Objects. - * Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, - * those with the `is_deleted` attribute set to `true`. - * - * @maps include_deleted_objects - */ - public function setIncludeDeletedObjects(?bool $includeDeletedObjects): void - { - $this->includeDeletedObjects['value'] = $includeDeletedObjects; - } - - /** - * Unsets Include Deleted Objects. - * Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, - * those with the `is_deleted` attribute set to `true`. - */ - public function unsetIncludeDeletedObjects(): void - { - $this->includeDeletedObjects = []; - } - - /** - * Returns Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - */ - public function getIncludeCategoryPathToRoot(): ?bool - { - if (count($this->includeCategoryPathToRoot) == 0) { - return null; - } - return $this->includeCategoryPathToRoot['value']; - } - - /** - * Sets Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - * - * @maps include_category_path_to_root - */ - public function setIncludeCategoryPathToRoot(?bool $includeCategoryPathToRoot): void - { - $this->includeCategoryPathToRoot['value'] = $includeCategoryPathToRoot; - } - - /** - * Unsets Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - */ - public function unsetIncludeCategoryPathToRoot(): void - { - $this->includeCategoryPathToRoot = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['object_ids'] = $this->objectIds; - if (!empty($this->includeRelatedObjects)) { - $json['include_related_objects'] = $this->includeRelatedObjects['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->includeDeletedObjects)) { - $json['include_deleted_objects'] = $this->includeDeletedObjects['value']; - } - if (!empty($this->includeCategoryPathToRoot)) { - $json['include_category_path_to_root'] = $this->includeCategoryPathToRoot['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveCatalogObjectsResponse.php b/src/Models/BatchRetrieveCatalogObjectsResponse.php deleted file mode 100644 index ff8f3a0c..00000000 --- a/src/Models/BatchRetrieveCatalogObjectsResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Objects. - * A list of [CatalogObject](entity:CatalogObject)s returned. - * - * @return CatalogObject[]|null - */ - public function getObjects(): ?array - { - return $this->objects; - } - - /** - * Sets Objects. - * A list of [CatalogObject](entity:CatalogObject)s returned. - * - * @maps objects - * - * @param CatalogObject[]|null $objects - */ - public function setObjects(?array $objects): void - { - $this->objects = $objects; - } - - /** - * Returns Related Objects. - * A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. - * - * @return CatalogObject[]|null - */ - public function getRelatedObjects(): ?array - { - return $this->relatedObjects; - } - - /** - * Sets Related Objects. - * A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. - * - * @maps related_objects - * - * @param CatalogObject[]|null $relatedObjects - */ - public function setRelatedObjects(?array $relatedObjects): void - { - $this->relatedObjects = $relatedObjects; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->objects)) { - $json['objects'] = $this->objects; - } - if (isset($this->relatedObjects)) { - $json['related_objects'] = $this->relatedObjects; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveInventoryChangesRequest.php b/src/Models/BatchRetrieveInventoryChangesRequest.php deleted file mode 100644 index bea1d10b..00000000 --- a/src/Models/BatchRetrieveInventoryChangesRequest.php +++ /dev/null @@ -1,404 +0,0 @@ -catalogObjectIds) == 0) { - return null; - } - return $this->catalogObjectIds['value']; - } - - /** - * Sets Catalog Object Ids. - * The filter to return results by `CatalogObject` ID. - * The filter is only applicable when set. The default value is null. - * - * @maps catalog_object_ids - * - * @param string[]|null $catalogObjectIds - */ - public function setCatalogObjectIds(?array $catalogObjectIds): void - { - $this->catalogObjectIds['value'] = $catalogObjectIds; - } - - /** - * Unsets Catalog Object Ids. - * The filter to return results by `CatalogObject` ID. - * The filter is only applicable when set. The default value is null. - */ - public function unsetCatalogObjectIds(): void - { - $this->catalogObjectIds = []; - } - - /** - * Returns Location Ids. - * The filter to return results by `Location` ID. - * The filter is only applicable when set. The default value is null. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The filter to return results by `Location` ID. - * The filter is only applicable when set. The default value is null. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The filter to return results by `Location` ID. - * The filter is only applicable when set. The default value is null. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Types. - * The filter to return results by `InventoryChangeType` values other than `TRANSFER`. - * The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. - * - * @return string[]|null - */ - public function getTypes(): ?array - { - if (count($this->types) == 0) { - return null; - } - return $this->types['value']; - } - - /** - * Sets Types. - * The filter to return results by `InventoryChangeType` values other than `TRANSFER`. - * The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. - * - * @maps types - * - * @param string[]|null $types - */ - public function setTypes(?array $types): void - { - $this->types['value'] = $types; - } - - /** - * Unsets Types. - * The filter to return results by `InventoryChangeType` values other than `TRANSFER`. - * The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. - */ - public function unsetTypes(): void - { - $this->types = []; - } - - /** - * Returns States. - * The filter to return `ADJUSTMENT` query results by - * `InventoryState`. This filter is only applied when set. - * The default value is null. - * - * @return string[]|null - */ - public function getStates(): ?array - { - if (count($this->states) == 0) { - return null; - } - return $this->states['value']; - } - - /** - * Sets States. - * The filter to return `ADJUSTMENT` query results by - * `InventoryState`. This filter is only applied when set. - * The default value is null. - * - * @maps states - * - * @param string[]|null $states - */ - public function setStates(?array $states): void - { - $this->states['value'] = $states; - } - - /** - * Unsets States. - * The filter to return `ADJUSTMENT` query results by - * `InventoryState`. This filter is only applied when set. - * The default value is null. - */ - public function unsetStates(): void - { - $this->states = []; - } - - /** - * Returns Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function getUpdatedAfter(): ?string - { - if (count($this->updatedAfter) == 0) { - return null; - } - return $this->updatedAfter['value']; - } - - /** - * Sets Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - * - * @maps updated_after - */ - public function setUpdatedAfter(?string $updatedAfter): void - { - $this->updatedAfter['value'] = $updatedAfter; - } - - /** - * Unsets Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function unsetUpdatedAfter(): void - { - $this->updatedAfter = []; - } - - /** - * Returns Updated Before. - * The filter to return results with their `created_at` or `calculated_at` value - * strictly before the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function getUpdatedBefore(): ?string - { - if (count($this->updatedBefore) == 0) { - return null; - } - return $this->updatedBefore['value']; - } - - /** - * Sets Updated Before. - * The filter to return results with their `created_at` or `calculated_at` value - * strictly before the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - * - * @maps updated_before - */ - public function setUpdatedBefore(?string $updatedBefore): void - { - $this->updatedBefore['value'] = $updatedBefore; - } - - /** - * Unsets Updated Before. - * The filter to return results with their `created_at` or `calculated_at` value - * strictly before the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function unsetUpdatedBefore(): void - { - $this->updatedBefore = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The number of [records](entity:InventoryChange) to return. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The number of [records](entity:InventoryChange) to return. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The number of [records](entity:InventoryChange) to return. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->catalogObjectIds)) { - $json['catalog_object_ids'] = $this->catalogObjectIds['value']; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->types)) { - $json['types'] = $this->types['value']; - } - if (!empty($this->states)) { - $json['states'] = $this->states['value']; - } - if (!empty($this->updatedAfter)) { - $json['updated_after'] = $this->updatedAfter['value']; - } - if (!empty($this->updatedBefore)) { - $json['updated_before'] = $this->updatedBefore['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveInventoryChangesResponse.php b/src/Models/BatchRetrieveInventoryChangesResponse.php deleted file mode 100644 index 589c60d1..00000000 --- a/src/Models/BatchRetrieveInventoryChangesResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Changes. - * The current calculated inventory changes for the requested objects - * and locations. - * - * @return InventoryChange[]|null - */ - public function getChanges(): ?array - { - return $this->changes; - } - - /** - * Sets Changes. - * The current calculated inventory changes for the requested objects - * and locations. - * - * @maps changes - * - * @param InventoryChange[]|null $changes - */ - public function setChanges(?array $changes): void - { - $this->changes = $changes; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->changes)) { - $json['changes'] = $this->changes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveInventoryCountsRequest.php b/src/Models/BatchRetrieveInventoryCountsRequest.php deleted file mode 100644 index a90388d5..00000000 --- a/src/Models/BatchRetrieveInventoryCountsRequest.php +++ /dev/null @@ -1,311 +0,0 @@ -catalogObjectIds) == 0) { - return null; - } - return $this->catalogObjectIds['value']; - } - - /** - * Sets Catalog Object Ids. - * The filter to return results by `CatalogObject` ID. - * The filter is applicable only when set. The default is null. - * - * @maps catalog_object_ids - * - * @param string[]|null $catalogObjectIds - */ - public function setCatalogObjectIds(?array $catalogObjectIds): void - { - $this->catalogObjectIds['value'] = $catalogObjectIds; - } - - /** - * Unsets Catalog Object Ids. - * The filter to return results by `CatalogObject` ID. - * The filter is applicable only when set. The default is null. - */ - public function unsetCatalogObjectIds(): void - { - $this->catalogObjectIds = []; - } - - /** - * Returns Location Ids. - * The filter to return results by `Location` ID. - * This filter is applicable only when set. The default is null. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The filter to return results by `Location` ID. - * This filter is applicable only when set. The default is null. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The filter to return results by `Location` ID. - * This filter is applicable only when set. The default is null. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function getUpdatedAfter(): ?string - { - if (count($this->updatedAfter) == 0) { - return null; - } - return $this->updatedAfter['value']; - } - - /** - * Sets Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - * - * @maps updated_after - */ - public function setUpdatedAfter(?string $updatedAfter): void - { - $this->updatedAfter['value'] = $updatedAfter; - } - - /** - * Unsets Updated After. - * The filter to return results with their `calculated_at` value - * after the given time as specified in an RFC 3339 timestamp. - * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - */ - public function unsetUpdatedAfter(): void - { - $this->updatedAfter = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns States. - * The filter to return results by `InventoryState`. The filter is only applicable when set. - * Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. - * The default is null. - * - * @return string[]|null - */ - public function getStates(): ?array - { - if (count($this->states) == 0) { - return null; - } - return $this->states['value']; - } - - /** - * Sets States. - * The filter to return results by `InventoryState`. The filter is only applicable when set. - * Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. - * The default is null. - * - * @maps states - * - * @param string[]|null $states - */ - public function setStates(?array $states): void - { - $this->states['value'] = $states; - } - - /** - * Unsets States. - * The filter to return results by `InventoryState`. The filter is only applicable when set. - * Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. - * The default is null. - */ - public function unsetStates(): void - { - $this->states = []; - } - - /** - * Returns Limit. - * The number of [records](entity:InventoryCount) to return. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The number of [records](entity:InventoryCount) to return. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The number of [records](entity:InventoryCount) to return. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->catalogObjectIds)) { - $json['catalog_object_ids'] = $this->catalogObjectIds['value']; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->updatedAfter)) { - $json['updated_after'] = $this->updatedAfter['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->states)) { - $json['states'] = $this->states['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveInventoryCountsResponse.php b/src/Models/BatchRetrieveInventoryCountsResponse.php deleted file mode 100644 index a87889c6..00000000 --- a/src/Models/BatchRetrieveInventoryCountsResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Counts. - * The current calculated inventory counts for the requested objects - * and locations. - * - * @return InventoryCount[]|null - */ - public function getCounts(): ?array - { - return $this->counts; - } - - /** - * Sets Counts. - * The current calculated inventory counts for the requested objects - * and locations. - * - * @maps counts - * - * @param InventoryCount[]|null $counts - */ - public function setCounts(?array $counts): void - { - $this->counts = $counts; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->counts)) { - $json['counts'] = $this->counts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveOrdersRequest.php b/src/Models/BatchRetrieveOrdersRequest.php deleted file mode 100644 index 271c4e46..00000000 --- a/src/Models/BatchRetrieveOrdersRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -orderIds = $orderIds; - } - - /** - * Returns Location Id. - * The ID of the location for these orders. This field is optional: omit it to retrieve - * orders within the scope of the current authorization's merchant ID. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location for these orders. This field is optional: omit it to retrieve - * orders within the scope of the current authorization's merchant ID. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location for these orders. This field is optional: omit it to retrieve - * orders within the scope of the current authorization's merchant ID. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Order Ids. - * The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. - * - * @return string[] - */ - public function getOrderIds(): array - { - return $this->orderIds; - } - - /** - * Sets Order Ids. - * The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. - * - * @required - * @maps order_ids - * - * @param string[] $orderIds - */ - public function setOrderIds(array $orderIds): void - { - $this->orderIds = $orderIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json['order_ids'] = $this->orderIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchRetrieveOrdersResponse.php b/src/Models/BatchRetrieveOrdersResponse.php deleted file mode 100644 index 4656a0be..00000000 --- a/src/Models/BatchRetrieveOrdersResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -orders; - } - - /** - * Sets Orders. - * The requested orders. This will omit any requested orders that do not exist. - * - * @maps orders - * - * @param Order[]|null $orders - */ - public function setOrders(?array $orders): void - { - $this->orders = $orders; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orders)) { - $json['orders'] = $this->orders; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchUpsertCatalogObjectsRequest.php b/src/Models/BatchUpsertCatalogObjectsRequest.php deleted file mode 100644 index c9bc9c67..00000000 --- a/src/Models/BatchUpsertCatalogObjectsRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->batches = $batches; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this - * request among all your requests. A common way to create - * a valid idempotency key is to use a Universally unique - * identifier (UUID). - * - * If you're unsure whether a particular request was successful, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate objects. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this - * request among all your requests. A common way to create - * a valid idempotency key is to use a Universally unique - * identifier (UUID). - * - * If you're unsure whether a particular request was successful, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate objects. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Batches. - * A batch of CatalogObjects to be inserted/updated atomically. - * The objects within a batch will be inserted in an all-or-nothing fashion, i.e., if an error occurs - * attempting to insert or update an object within a batch, the entire batch will be rejected. However, - * an error - * in one batch will not affect other batches within the same request. - * - * For each object, its `updated_at` field is ignored and replaced with a current [timestamp](https: - * //developer.squareup.com/docs/build-basics/working-with-dates), and its - * `is_deleted` field must not be set to `true`. - * - * To modify an existing object, supply its ID. To create a new object, use an ID starting - * with `#`. These IDs may be used to create relationships between an object and attributes of - * other objects that reference it. For example, you can create a CatalogItem with - * ID `#ABC` and a CatalogItemVariation with its `item_id` attribute set to - * `#ABC` in order to associate the CatalogItemVariation with its parent - * CatalogItem. - * - * Any `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server- - * generated IDs. - * - * Each batch may contain up to 1,000 objects. The total number of objects across all batches for a - * single request - * may not exceed 10,000. If either of these limits is violated, an error will be returned and no - * objects will - * be inserted or updated. - * - * @return CatalogObjectBatch[] - */ - public function getBatches(): array - { - return $this->batches; - } - - /** - * Sets Batches. - * A batch of CatalogObjects to be inserted/updated atomically. - * The objects within a batch will be inserted in an all-or-nothing fashion, i.e., if an error occurs - * attempting to insert or update an object within a batch, the entire batch will be rejected. However, - * an error - * in one batch will not affect other batches within the same request. - * - * For each object, its `updated_at` field is ignored and replaced with a current [timestamp](https: - * //developer.squareup.com/docs/build-basics/working-with-dates), and its - * `is_deleted` field must not be set to `true`. - * - * To modify an existing object, supply its ID. To create a new object, use an ID starting - * with `#`. These IDs may be used to create relationships between an object and attributes of - * other objects that reference it. For example, you can create a CatalogItem with - * ID `#ABC` and a CatalogItemVariation with its `item_id` attribute set to - * `#ABC` in order to associate the CatalogItemVariation with its parent - * CatalogItem. - * - * Any `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server- - * generated IDs. - * - * Each batch may contain up to 1,000 objects. The total number of objects across all batches for a - * single request - * may not exceed 10,000. If either of these limits is violated, an error will be returned and no - * objects will - * be inserted or updated. - * - * @required - * @maps batches - * - * @param CatalogObjectBatch[] $batches - */ - public function setBatches(array $batches): void - { - $this->batches = $batches; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['batches'] = $this->batches; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BatchUpsertCatalogObjectsResponse.php b/src/Models/BatchUpsertCatalogObjectsResponse.php deleted file mode 100644 index 5e7d5529..00000000 --- a/src/Models/BatchUpsertCatalogObjectsResponse.php +++ /dev/null @@ -1,155 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Objects. - * The created successfully created CatalogObjects. - * - * @return CatalogObject[]|null - */ - public function getObjects(): ?array - { - return $this->objects; - } - - /** - * Sets Objects. - * The created successfully created CatalogObjects. - * - * @maps objects - * - * @param CatalogObject[]|null $objects - */ - public function setObjects(?array $objects): void - { - $this->objects = $objects; - } - - /** - * Returns Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Id Mappings. - * The mapping between client and server IDs for this upsert. - * - * @return CatalogIdMapping[]|null - */ - public function getIdMappings(): ?array - { - return $this->idMappings; - } - - /** - * Sets Id Mappings. - * The mapping between client and server IDs for this upsert. - * - * @maps id_mappings - * - * @param CatalogIdMapping[]|null $idMappings - */ - public function setIdMappings(?array $idMappings): void - { - $this->idMappings = $idMappings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->objects)) { - $json['objects'] = $this->objects; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->idMappings)) { - $json['id_mappings'] = $this->idMappings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Booking.php b/src/Models/Booking.php deleted file mode 100644 index 72175a6e..00000000 --- a/src/Models/Booking.php +++ /dev/null @@ -1,613 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID of this object representing a booking. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Version. - * The revision number for the booking used for optimistic concurrency. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The revision number for the booking used for optimistic concurrency. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Status. - * Supported booking statuses. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Supported booking statuses. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Created At. - * The RFC 3339 timestamp specifying the creation time of this booking. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The RFC 3339 timestamp specifying the creation time of this booking. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The RFC 3339 timestamp specifying the most recent update time of this booking. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The RFC 3339 timestamp specifying the most recent update time of this booking. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Start At. - * The RFC 3339 timestamp specifying the starting time of this booking. - */ - public function getStartAt(): ?string - { - if (count($this->startAt) == 0) { - return null; - } - return $this->startAt['value']; - } - - /** - * Sets Start At. - * The RFC 3339 timestamp specifying the starting time of this booking. - * - * @maps start_at - */ - public function setStartAt(?string $startAt): void - { - $this->startAt['value'] = $startAt; - } - - /** - * Unsets Start At. - * The RFC 3339 timestamp specifying the starting time of this booking. - */ - public function unsetStartAt(): void - { - $this->startAt = []; - } - - /** - * Returns Location Id. - * The ID of the [Location](entity:Location) object representing the location where the booked service - * is provided. Once set when the booking is created, its value cannot be changed. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the [Location](entity:Location) object representing the location where the booked service - * is provided. Once set when the booking is created, its value cannot be changed. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the [Location](entity:Location) object representing the location where the booked service - * is provided. Once set when the booking is created, its value cannot be changed. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Customer Id. - * The ID of the [Customer](entity:Customer) object representing the customer receiving the booked - * service. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the [Customer](entity:Customer) object representing the customer receiving the booked - * service. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the [Customer](entity:Customer) object representing the customer receiving the booked - * service. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Customer Note. - * The free-text field for the customer to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity: - * CatalogObject) instance. - */ - public function getCustomerNote(): ?string - { - if (count($this->customerNote) == 0) { - return null; - } - return $this->customerNote['value']; - } - - /** - * Sets Customer Note. - * The free-text field for the customer to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity: - * CatalogObject) instance. - * - * @maps customer_note - */ - public function setCustomerNote(?string $customerNote): void - { - $this->customerNote['value'] = $customerNote; - } - - /** - * Unsets Customer Note. - * The free-text field for the customer to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity: - * CatalogObject) instance. - */ - public function unsetCustomerNote(): void - { - $this->customerNote = []; - } - - /** - * Returns Seller Note. - * The free-text field for the seller to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity: - * CatalogObject) instance. - * This field should not be visible to customers. - */ - public function getSellerNote(): ?string - { - if (count($this->sellerNote) == 0) { - return null; - } - return $this->sellerNote['value']; - } - - /** - * Sets Seller Note. - * The free-text field for the seller to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity: - * CatalogObject) instance. - * This field should not be visible to customers. - * - * @maps seller_note - */ - public function setSellerNote(?string $sellerNote): void - { - $this->sellerNote['value'] = $sellerNote; - } - - /** - * Unsets Seller Note. - * The free-text field for the seller to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity: - * CatalogObject) instance. - * This field should not be visible to customers. - */ - public function unsetSellerNote(): void - { - $this->sellerNote = []; - } - - /** - * Returns Appointment Segments. - * A list of appointment segments for this booking. - * - * @return AppointmentSegment[]|null - */ - public function getAppointmentSegments(): ?array - { - if (count($this->appointmentSegments) == 0) { - return null; - } - return $this->appointmentSegments['value']; - } - - /** - * Sets Appointment Segments. - * A list of appointment segments for this booking. - * - * @maps appointment_segments - * - * @param AppointmentSegment[]|null $appointmentSegments - */ - public function setAppointmentSegments(?array $appointmentSegments): void - { - $this->appointmentSegments['value'] = $appointmentSegments; - } - - /** - * Unsets Appointment Segments. - * A list of appointment segments for this booking. - */ - public function unsetAppointmentSegments(): void - { - $this->appointmentSegments = []; - } - - /** - * Returns Transition Time Minutes. - * Additional time at the end of a booking. - * Applications should not make this field visible to customers of a seller. - */ - public function getTransitionTimeMinutes(): ?int - { - return $this->transitionTimeMinutes; - } - - /** - * Sets Transition Time Minutes. - * Additional time at the end of a booking. - * Applications should not make this field visible to customers of a seller. - * - * @maps transition_time_minutes - */ - public function setTransitionTimeMinutes(?int $transitionTimeMinutes): void - { - $this->transitionTimeMinutes = $transitionTimeMinutes; - } - - /** - * Returns All Day. - * Whether the booking is of a full business day. - */ - public function getAllDay(): ?bool - { - return $this->allDay; - } - - /** - * Sets All Day. - * Whether the booking is of a full business day. - * - * @maps all_day - */ - public function setAllDay(?bool $allDay): void - { - $this->allDay = $allDay; - } - - /** - * Returns Location Type. - * Supported types of location where service is provided. - */ - public function getLocationType(): ?string - { - return $this->locationType; - } - - /** - * Sets Location Type. - * Supported types of location where service is provided. - * - * @maps location_type - */ - public function setLocationType(?string $locationType): void - { - $this->locationType = $locationType; - } - - /** - * Returns Creator Details. - * Information about a booking creator. - */ - public function getCreatorDetails(): ?BookingCreatorDetails - { - return $this->creatorDetails; - } - - /** - * Sets Creator Details. - * Information about a booking creator. - * - * @maps creator_details - */ - public function setCreatorDetails(?BookingCreatorDetails $creatorDetails): void - { - $this->creatorDetails = $creatorDetails; - } - - /** - * Returns Source. - * Supported sources a booking was created from. - */ - public function getSource(): ?string - { - return $this->source; - } - - /** - * Sets Source. - * Supported sources a booking was created from. - * - * @maps source - */ - public function setSource(?string $source): void - { - $this->source = $source; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->startAt)) { - $json['start_at'] = $this->startAt['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->customerNote)) { - $json['customer_note'] = $this->customerNote['value']; - } - if (!empty($this->sellerNote)) { - $json['seller_note'] = $this->sellerNote['value']; - } - if (!empty($this->appointmentSegments)) { - $json['appointment_segments'] = $this->appointmentSegments['value']; - } - if (isset($this->transitionTimeMinutes)) { - $json['transition_time_minutes'] = $this->transitionTimeMinutes; - } - if (isset($this->allDay)) { - $json['all_day'] = $this->allDay; - } - if (isset($this->locationType)) { - $json['location_type'] = $this->locationType; - } - if (isset($this->creatorDetails)) { - $json['creator_details'] = $this->creatorDetails; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingBookingSource.php b/src/Models/BookingBookingSource.php deleted file mode 100644 index d9f97ef2..00000000 --- a/src/Models/BookingBookingSource.php +++ /dev/null @@ -1,33 +0,0 @@ -creatorType; - } - - /** - * Sets Creator Type. - * Supported types of a booking creator. - * - * @maps creator_type - */ - public function setCreatorType(?string $creatorType): void - { - $this->creatorType = $creatorType; - } - - /** - * Returns Team Member Id. - * The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` - * type. - * Access to this field requires seller-level permissions. - */ - public function getTeamMemberId(): ?string - { - return $this->teamMemberId; - } - - /** - * Sets Team Member Id. - * The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` - * type. - * Access to this field requires seller-level permissions. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Returns Customer Id. - * The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type. - * Access to this field requires seller-level permissions. - */ - public function getCustomerId(): ?string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type. - * Access to this field requires seller-level permissions. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->creatorType)) { - $json['creator_type'] = $this->creatorType; - } - if (isset($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId; - } - if (isset($this->customerId)) { - $json['customer_id'] = $this->customerId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingCreatorDetailsCreatorType.php b/src/Models/BookingCreatorDetailsCreatorType.php deleted file mode 100644 index a21104a2..00000000 --- a/src/Models/BookingCreatorDetailsCreatorType.php +++ /dev/null @@ -1,21 +0,0 @@ -bookingId = $bookingId; - $this->key = $key; - } - - /** - * Returns Booking Id. - * The ID of the target [booking](entity:Booking). - */ - public function getBookingId(): string - { - return $this->bookingId; - } - - /** - * Sets Booking Id. - * The ID of the target [booking](entity:Booking). - * - * @required - * @maps booking_id - */ - public function setBookingId(string $bookingId): void - { - $this->bookingId = $bookingId; - } - - /** - * Returns Key. - * The key of the custom attribute to delete. This key must match the `key` of a - * custom attribute definition in the Square seller account. If the requesting application is not - * the definition owner, you must use the qualified key. - */ - public function getKey(): string - { - return $this->key; - } - - /** - * Sets Key. - * The key of the custom attribute to delete. This key must match the `key` of a - * custom attribute definition in the Square seller account. If the requesting application is not - * the definition owner, you must use the qualified key. - * - * @required - * @maps key - */ - public function setKey(string $key): void - { - $this->key = $key; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['booking_id'] = $this->bookingId; - $json['key'] = $this->key; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingCustomAttributeDeleteResponse.php b/src/Models/BookingCustomAttributeDeleteResponse.php deleted file mode 100644 index ba44ae84..00000000 --- a/src/Models/BookingCustomAttributeDeleteResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -bookingId; - } - - /** - * Sets Booking Id. - * The ID of the [booking](entity:Booking) associated with the custom attribute. - * - * @maps booking_id - */ - public function setBookingId(?string $bookingId): void - { - $this->bookingId = $bookingId; - } - - /** - * Returns Errors. - * Any errors that occurred while processing the individual request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred while processing the individual request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->bookingId)) { - $json['booking_id'] = $this->bookingId; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingCustomAttributeUpsertRequest.php b/src/Models/BookingCustomAttributeUpsertRequest.php deleted file mode 100644 index 30a82d32..00000000 --- a/src/Models/BookingCustomAttributeUpsertRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -bookingId = $bookingId; - $this->customAttribute = $customAttribute; - } - - /** - * Returns Booking Id. - * The ID of the target [booking](entity:Booking). - */ - public function getBookingId(): string - { - return $this->bookingId; - } - - /** - * Sets Booking Id. - * The ID of the target [booking](entity:Booking). - * - * @required - * @maps booking_id - */ - public function setBookingId(string $bookingId): void - { - $this->bookingId = $bookingId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['booking_id'] = $this->bookingId; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingCustomAttributeUpsertResponse.php b/src/Models/BookingCustomAttributeUpsertResponse.php deleted file mode 100644 index 6223da48..00000000 --- a/src/Models/BookingCustomAttributeUpsertResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -bookingId; - } - - /** - * Sets Booking Id. - * The ID of the [booking](entity:Booking) associated with the custom attribute. - * - * @maps booking_id - */ - public function setBookingId(?string $bookingId): void - { - $this->bookingId = $bookingId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): ?CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred while processing the individual request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred while processing the individual request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->bookingId)) { - $json['booking_id'] = $this->bookingId; - } - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BookingStatus.php b/src/Models/BookingStatus.php deleted file mode 100644 index 3e0ffb5f..00000000 --- a/src/Models/BookingStatus.php +++ /dev/null @@ -1,42 +0,0 @@ -locationId = $locationId; - $this->breakName = $breakName; - $this->expectedDuration = $expectedDuration; - $this->isPaid = $isPaid; - } - - /** - * Returns Id. - * The UUID for this object. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the business location this type of break applies to. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the business location this type of break applies to. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Break Name. - * A human-readable name for this type of break. The name is displayed to - * employees in Square products. - */ - public function getBreakName(): string - { - return $this->breakName; - } - - /** - * Sets Break Name. - * A human-readable name for this type of break. The name is displayed to - * employees in Square products. - * - * @required - * @maps break_name - */ - public function setBreakName(string $breakName): void - { - $this->breakName = $breakName; - } - - /** - * Returns Expected Duration. - * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of - * this break. Precision less than minutes is truncated. - * - * Example for break expected duration of 15 minutes: T15M - */ - public function getExpectedDuration(): string - { - return $this->expectedDuration; - } - - /** - * Sets Expected Duration. - * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of - * this break. Precision less than minutes is truncated. - * - * Example for break expected duration of 15 minutes: T15M - * - * @required - * @maps expected_duration - */ - public function setExpectedDuration(string $expectedDuration): void - { - $this->expectedDuration = $expectedDuration; - } - - /** - * Returns Is Paid. - * Whether this break counts towards time worked for compensation - * purposes. - */ - public function getIsPaid(): bool - { - return $this->isPaid; - } - - /** - * Sets Is Paid. - * Whether this break counts towards time worked for compensation - * purposes. - * - * @required - * @maps is_paid - */ - public function setIsPaid(bool $isPaid): void - { - $this->isPaid = $isPaid; - } - - /** - * Returns Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If a value is not - * provided, Square's servers execute a "blind" write; potentially - * overwriting another writer's data. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If a value is not - * provided, Square's servers execute a "blind" write; potentially - * overwriting another writer's data. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Created At. - * A read-only timestamp in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * A read-only timestamp in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * A read-only timestamp in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * A read-only timestamp in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['location_id'] = $this->locationId; - $json['break_name'] = $this->breakName; - $json['expected_duration'] = $this->expectedDuration; - $json['is_paid'] = $this->isPaid; - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Builders/ACHDetailsBuilder.php b/src/Models/Builders/ACHDetailsBuilder.php deleted file mode 100644 index 08bfd490..00000000 --- a/src/Models/Builders/ACHDetailsBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new ACH Details Builder object. - */ - public static function init(): self - { - return new self(new ACHDetails()); - } - - /** - * Sets routing number field. - * - * @param string|null $value - */ - public function routingNumber(?string $value): self - { - $this->instance->setRoutingNumber($value); - return $this; - } - - /** - * Unsets routing number field. - */ - public function unsetRoutingNumber(): self - { - $this->instance->unsetRoutingNumber(); - return $this; - } - - /** - * Sets account number suffix field. - * - * @param string|null $value - */ - public function accountNumberSuffix(?string $value): self - { - $this->instance->setAccountNumberSuffix($value); - return $this; - } - - /** - * Unsets account number suffix field. - */ - public function unsetAccountNumberSuffix(): self - { - $this->instance->unsetAccountNumberSuffix(); - return $this; - } - - /** - * Sets account type field. - * - * @param string|null $value - */ - public function accountType(?string $value): self - { - $this->instance->setAccountType($value); - return $this; - } - - /** - * Unsets account type field. - */ - public function unsetAccountType(): self - { - $this->instance->unsetAccountType(); - return $this; - } - - /** - * Initializes a new ACH Details object. - */ - public function build(): ACHDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AcceptDisputeResponseBuilder.php b/src/Models/Builders/AcceptDisputeResponseBuilder.php deleted file mode 100644 index a79cd8c9..00000000 --- a/src/Models/Builders/AcceptDisputeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Accept Dispute Response Builder object. - */ - public static function init(): self - { - return new self(new AcceptDisputeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets dispute field. - * - * @param Dispute|null $value - */ - public function dispute(?Dispute $value): self - { - $this->instance->setDispute($value); - return $this; - } - - /** - * Initializes a new Accept Dispute Response object. - */ - public function build(): AcceptDisputeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AcceptedPaymentMethodsBuilder.php b/src/Models/Builders/AcceptedPaymentMethodsBuilder.php deleted file mode 100644 index 7b8decb6..00000000 --- a/src/Models/Builders/AcceptedPaymentMethodsBuilder.php +++ /dev/null @@ -1,122 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Accepted Payment Methods Builder object. - */ - public static function init(): self - { - return new self(new AcceptedPaymentMethods()); - } - - /** - * Sets apple pay field. - * - * @param bool|null $value - */ - public function applePay(?bool $value): self - { - $this->instance->setApplePay($value); - return $this; - } - - /** - * Unsets apple pay field. - */ - public function unsetApplePay(): self - { - $this->instance->unsetApplePay(); - return $this; - } - - /** - * Sets google pay field. - * - * @param bool|null $value - */ - public function googlePay(?bool $value): self - { - $this->instance->setGooglePay($value); - return $this; - } - - /** - * Unsets google pay field. - */ - public function unsetGooglePay(): self - { - $this->instance->unsetGooglePay(); - return $this; - } - - /** - * Sets cash app pay field. - * - * @param bool|null $value - */ - public function cashAppPay(?bool $value): self - { - $this->instance->setCashAppPay($value); - return $this; - } - - /** - * Unsets cash app pay field. - */ - public function unsetCashAppPay(): self - { - $this->instance->unsetCashAppPay(); - return $this; - } - - /** - * Sets afterpay clearpay field. - * - * @param bool|null $value - */ - public function afterpayClearpay(?bool $value): self - { - $this->instance->setAfterpayClearpay($value); - return $this; - } - - /** - * Unsets afterpay clearpay field. - */ - public function unsetAfterpayClearpay(): self - { - $this->instance->unsetAfterpayClearpay(); - return $this; - } - - /** - * Initializes a new Accepted Payment Methods object. - */ - public function build(): AcceptedPaymentMethods - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AccumulateLoyaltyPointsRequestBuilder.php b/src/Models/Builders/AccumulateLoyaltyPointsRequestBuilder.php deleted file mode 100644 index c3a98e3b..00000000 --- a/src/Models/Builders/AccumulateLoyaltyPointsRequestBuilder.php +++ /dev/null @@ -1,50 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Accumulate Loyalty Points Request Builder object. - * - * @param LoyaltyEventAccumulatePoints $accumulatePoints - * @param string $idempotencyKey - * @param string $locationId - */ - public static function init( - LoyaltyEventAccumulatePoints $accumulatePoints, - string $idempotencyKey, - string $locationId - ): self { - return new self(new AccumulateLoyaltyPointsRequest($accumulatePoints, $idempotencyKey, $locationId)); - } - - /** - * Initializes a new Accumulate Loyalty Points Request object. - */ - public function build(): AccumulateLoyaltyPointsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AccumulateLoyaltyPointsResponseBuilder.php b/src/Models/Builders/AccumulateLoyaltyPointsResponseBuilder.php deleted file mode 100644 index a64cf43e..00000000 --- a/src/Models/Builders/AccumulateLoyaltyPointsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Accumulate Loyalty Points Response Builder object. - */ - public static function init(): self - { - return new self(new AccumulateLoyaltyPointsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets event field. - * - * @param LoyaltyEvent|null $value - */ - public function event(?LoyaltyEvent $value): self - { - $this->instance->setEvent($value); - return $this; - } - - /** - * Sets events field. - * - * @param LoyaltyEvent[]|null $value - */ - public function events(?array $value): self - { - $this->instance->setEvents($value); - return $this; - } - - /** - * Initializes a new Accumulate Loyalty Points Response object. - */ - public function build(): AccumulateLoyaltyPointsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AddGroupToCustomerResponseBuilder.php b/src/Models/Builders/AddGroupToCustomerResponseBuilder.php deleted file mode 100644 index 2c9e6bad..00000000 --- a/src/Models/Builders/AddGroupToCustomerResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Add Group To Customer Response Builder object. - */ - public static function init(): self - { - return new self(new AddGroupToCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Add Group To Customer Response object. - */ - public function build(): AddGroupToCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AdditionalRecipientBuilder.php b/src/Models/Builders/AdditionalRecipientBuilder.php deleted file mode 100644 index d414463d..00000000 --- a/src/Models/Builders/AdditionalRecipientBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Additional Recipient Builder object. - * - * @param string $locationId - * @param Money $amountMoney - */ - public static function init(string $locationId, Money $amountMoney): self - { - return new self(new AdditionalRecipient($locationId, $amountMoney)); - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets receivable id field. - * - * @param string|null $value - */ - public function receivableId(?string $value): self - { - $this->instance->setReceivableId($value); - return $this; - } - - /** - * Unsets receivable id field. - */ - public function unsetReceivableId(): self - { - $this->instance->unsetReceivableId(); - return $this; - } - - /** - * Initializes a new Additional Recipient object. - */ - public function build(): AdditionalRecipient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AddressBuilder.php b/src/Models/Builders/AddressBuilder.php deleted file mode 100644 index 7b38d35d..00000000 --- a/src/Models/Builders/AddressBuilder.php +++ /dev/null @@ -1,313 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Address Builder object. - */ - public static function init(): self - { - return new self(new Address()); - } - - /** - * Sets address line 1 field. - * - * @param string|null $value - */ - public function addressLine1(?string $value): self - { - $this->instance->setAddressLine1($value); - return $this; - } - - /** - * Unsets address line 1 field. - */ - public function unsetAddressLine1(): self - { - $this->instance->unsetAddressLine1(); - return $this; - } - - /** - * Sets address line 2 field. - * - * @param string|null $value - */ - public function addressLine2(?string $value): self - { - $this->instance->setAddressLine2($value); - return $this; - } - - /** - * Unsets address line 2 field. - */ - public function unsetAddressLine2(): self - { - $this->instance->unsetAddressLine2(); - return $this; - } - - /** - * Sets address line 3 field. - * - * @param string|null $value - */ - public function addressLine3(?string $value): self - { - $this->instance->setAddressLine3($value); - return $this; - } - - /** - * Unsets address line 3 field. - */ - public function unsetAddressLine3(): self - { - $this->instance->unsetAddressLine3(); - return $this; - } - - /** - * Sets locality field. - * - * @param string|null $value - */ - public function locality(?string $value): self - { - $this->instance->setLocality($value); - return $this; - } - - /** - * Unsets locality field. - */ - public function unsetLocality(): self - { - $this->instance->unsetLocality(); - return $this; - } - - /** - * Sets sublocality field. - * - * @param string|null $value - */ - public function sublocality(?string $value): self - { - $this->instance->setSublocality($value); - return $this; - } - - /** - * Unsets sublocality field. - */ - public function unsetSublocality(): self - { - $this->instance->unsetSublocality(); - return $this; - } - - /** - * Sets sublocality 2 field. - * - * @param string|null $value - */ - public function sublocality2(?string $value): self - { - $this->instance->setSublocality2($value); - return $this; - } - - /** - * Unsets sublocality 2 field. - */ - public function unsetSublocality2(): self - { - $this->instance->unsetSublocality2(); - return $this; - } - - /** - * Sets sublocality 3 field. - * - * @param string|null $value - */ - public function sublocality3(?string $value): self - { - $this->instance->setSublocality3($value); - return $this; - } - - /** - * Unsets sublocality 3 field. - */ - public function unsetSublocality3(): self - { - $this->instance->unsetSublocality3(); - return $this; - } - - /** - * Sets administrative district level 1 field. - * - * @param string|null $value - */ - public function administrativeDistrictLevel1(?string $value): self - { - $this->instance->setAdministrativeDistrictLevel1($value); - return $this; - } - - /** - * Unsets administrative district level 1 field. - */ - public function unsetAdministrativeDistrictLevel1(): self - { - $this->instance->unsetAdministrativeDistrictLevel1(); - return $this; - } - - /** - * Sets administrative district level 2 field. - * - * @param string|null $value - */ - public function administrativeDistrictLevel2(?string $value): self - { - $this->instance->setAdministrativeDistrictLevel2($value); - return $this; - } - - /** - * Unsets administrative district level 2 field. - */ - public function unsetAdministrativeDistrictLevel2(): self - { - $this->instance->unsetAdministrativeDistrictLevel2(); - return $this; - } - - /** - * Sets administrative district level 3 field. - * - * @param string|null $value - */ - public function administrativeDistrictLevel3(?string $value): self - { - $this->instance->setAdministrativeDistrictLevel3($value); - return $this; - } - - /** - * Unsets administrative district level 3 field. - */ - public function unsetAdministrativeDistrictLevel3(): self - { - $this->instance->unsetAdministrativeDistrictLevel3(); - return $this; - } - - /** - * Sets postal code field. - * - * @param string|null $value - */ - public function postalCode(?string $value): self - { - $this->instance->setPostalCode($value); - return $this; - } - - /** - * Unsets postal code field. - */ - public function unsetPostalCode(): self - { - $this->instance->unsetPostalCode(); - return $this; - } - - /** - * Sets country field. - * - * @param string|null $value - */ - public function country(?string $value): self - { - $this->instance->setCountry($value); - return $this; - } - - /** - * Sets first name field. - * - * @param string|null $value - */ - public function firstName(?string $value): self - { - $this->instance->setFirstName($value); - return $this; - } - - /** - * Unsets first name field. - */ - public function unsetFirstName(): self - { - $this->instance->unsetFirstName(); - return $this; - } - - /** - * Sets last name field. - * - * @param string|null $value - */ - public function lastName(?string $value): self - { - $this->instance->setLastName($value); - return $this; - } - - /** - * Unsets last name field. - */ - public function unsetLastName(): self - { - $this->instance->unsetLastName(); - return $this; - } - - /** - * Initializes a new Address object. - */ - public function build(): Address - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AdjustLoyaltyPointsRequestBuilder.php b/src/Models/Builders/AdjustLoyaltyPointsRequestBuilder.php deleted file mode 100644 index ce51eb3f..00000000 --- a/src/Models/Builders/AdjustLoyaltyPointsRequestBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Adjust Loyalty Points Request Builder object. - * - * @param string $idempotencyKey - * @param LoyaltyEventAdjustPoints $adjustPoints - */ - public static function init(string $idempotencyKey, LoyaltyEventAdjustPoints $adjustPoints): self - { - return new self(new AdjustLoyaltyPointsRequest($idempotencyKey, $adjustPoints)); - } - - /** - * Sets allow negative balance field. - * - * @param bool|null $value - */ - public function allowNegativeBalance(?bool $value): self - { - $this->instance->setAllowNegativeBalance($value); - return $this; - } - - /** - * Unsets allow negative balance field. - */ - public function unsetAllowNegativeBalance(): self - { - $this->instance->unsetAllowNegativeBalance(); - return $this; - } - - /** - * Initializes a new Adjust Loyalty Points Request object. - */ - public function build(): AdjustLoyaltyPointsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AdjustLoyaltyPointsResponseBuilder.php b/src/Models/Builders/AdjustLoyaltyPointsResponseBuilder.php deleted file mode 100644 index 9be929c6..00000000 --- a/src/Models/Builders/AdjustLoyaltyPointsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Adjust Loyalty Points Response Builder object. - */ - public static function init(): self - { - return new self(new AdjustLoyaltyPointsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets event field. - * - * @param LoyaltyEvent|null $value - */ - public function event(?LoyaltyEvent $value): self - { - $this->instance->setEvent($value); - return $this; - } - - /** - * Initializes a new Adjust Loyalty Points Response object. - */ - public function build(): AdjustLoyaltyPointsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AfterpayDetailsBuilder.php b/src/Models/Builders/AfterpayDetailsBuilder.php deleted file mode 100644 index e2bf932b..00000000 --- a/src/Models/Builders/AfterpayDetailsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Afterpay Details Builder object. - */ - public static function init(): self - { - return new self(new AfterpayDetails()); - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Initializes a new Afterpay Details object. - */ - public function build(): AfterpayDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ApplicationDetailsBuilder.php b/src/Models/Builders/ApplicationDetailsBuilder.php deleted file mode 100644 index a44852b4..00000000 --- a/src/Models/Builders/ApplicationDetailsBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Application Details Builder object. - */ - public static function init(): self - { - return new self(new ApplicationDetails()); - } - - /** - * Sets square product field. - * - * @param string|null $value - */ - public function squareProduct(?string $value): self - { - $this->instance->setSquareProduct($value); - return $this; - } - - /** - * Sets application id field. - * - * @param string|null $value - */ - public function applicationId(?string $value): self - { - $this->instance->setApplicationId($value); - return $this; - } - - /** - * Unsets application id field. - */ - public function unsetApplicationId(): self - { - $this->instance->unsetApplicationId(); - return $this; - } - - /** - * Initializes a new Application Details object. - */ - public function build(): ApplicationDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AppointmentSegmentBuilder.php b/src/Models/Builders/AppointmentSegmentBuilder.php deleted file mode 100644 index bcc97527..00000000 --- a/src/Models/Builders/AppointmentSegmentBuilder.php +++ /dev/null @@ -1,137 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Appointment Segment Builder object. - * - * @param string $teamMemberId - */ - public static function init(string $teamMemberId): self - { - return new self(new AppointmentSegment($teamMemberId)); - } - - /** - * Sets duration minutes field. - * - * @param int|null $value - */ - public function durationMinutes(?int $value): self - { - $this->instance->setDurationMinutes($value); - return $this; - } - - /** - * Unsets duration minutes field. - */ - public function unsetDurationMinutes(): self - { - $this->instance->unsetDurationMinutes(); - return $this; - } - - /** - * Sets service variation id field. - * - * @param string|null $value - */ - public function serviceVariationId(?string $value): self - { - $this->instance->setServiceVariationId($value); - return $this; - } - - /** - * Unsets service variation id field. - */ - public function unsetServiceVariationId(): self - { - $this->instance->unsetServiceVariationId(); - return $this; - } - - /** - * Sets service variation version field. - * - * @param int|null $value - */ - public function serviceVariationVersion(?int $value): self - { - $this->instance->setServiceVariationVersion($value); - return $this; - } - - /** - * Unsets service variation version field. - */ - public function unsetServiceVariationVersion(): self - { - $this->instance->unsetServiceVariationVersion(); - return $this; - } - - /** - * Sets intermission minutes field. - * - * @param int|null $value - */ - public function intermissionMinutes(?int $value): self - { - $this->instance->setIntermissionMinutes($value); - return $this; - } - - /** - * Sets any team member field. - * - * @param bool|null $value - */ - public function anyTeamMember(?bool $value): self - { - $this->instance->setAnyTeamMember($value); - return $this; - } - - /** - * Sets resource ids field. - * - * @param string[]|null $value - */ - public function resourceIds(?array $value): self - { - $this->instance->setResourceIds($value); - return $this; - } - - /** - * Initializes a new Appointment Segment object. - */ - public function build(): AppointmentSegment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/AvailabilityBuilder.php b/src/Models/Builders/AvailabilityBuilder.php deleted file mode 100644 index d7810f3d..00000000 --- a/src/Models/Builders/AvailabilityBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Availability Builder object. - */ - public static function init(): self - { - return new self(new Availability()); - } - - /** - * Sets start at field. - * - * @param string|null $value - */ - public function startAt(?string $value): self - { - $this->instance->setStartAt($value); - return $this; - } - - /** - * Unsets start at field. - */ - public function unsetStartAt(): self - { - $this->instance->unsetStartAt(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets appointment segments field. - * - * @param AppointmentSegment[]|null $value - */ - public function appointmentSegments(?array $value): self - { - $this->instance->setAppointmentSegments($value); - return $this; - } - - /** - * Unsets appointment segments field. - */ - public function unsetAppointmentSegments(): self - { - $this->instance->unsetAppointmentSegments(); - return $this; - } - - /** - * Initializes a new Availability object. - */ - public function build(): Availability - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BankAccountBuilder.php b/src/Models/Builders/BankAccountBuilder.php deleted file mode 100644 index 0e1e00b8..00000000 --- a/src/Models/Builders/BankAccountBuilder.php +++ /dev/null @@ -1,205 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bank Account Builder object. - * - * @param string $id - * @param string $accountNumberSuffix - * @param string $country - * @param string $currency - * @param string $accountType - * @param string $holderName - * @param string $primaryBankIdentificationNumber - * @param string $status - * @param bool $creditable - * @param bool $debitable - */ - public static function init( - string $id, - string $accountNumberSuffix, - string $country, - string $currency, - string $accountType, - string $holderName, - string $primaryBankIdentificationNumber, - string $status, - bool $creditable, - bool $debitable - ): self { - return new self(new BankAccount( - $id, - $accountNumberSuffix, - $country, - $currency, - $accountType, - $holderName, - $primaryBankIdentificationNumber, - $status, - $creditable, - $debitable - )); - } - - /** - * Sets secondary bank identification number field. - * - * @param string|null $value - */ - public function secondaryBankIdentificationNumber(?string $value): self - { - $this->instance->setSecondaryBankIdentificationNumber($value); - return $this; - } - - /** - * Unsets secondary bank identification number field. - */ - public function unsetSecondaryBankIdentificationNumber(): self - { - $this->instance->unsetSecondaryBankIdentificationNumber(); - return $this; - } - - /** - * Sets debit mandate reference id field. - * - * @param string|null $value - */ - public function debitMandateReferenceId(?string $value): self - { - $this->instance->setDebitMandateReferenceId($value); - return $this; - } - - /** - * Unsets debit mandate reference id field. - */ - public function unsetDebitMandateReferenceId(): self - { - $this->instance->unsetDebitMandateReferenceId(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets fingerprint field. - * - * @param string|null $value - */ - public function fingerprint(?string $value): self - { - $this->instance->setFingerprint($value); - return $this; - } - - /** - * Unsets fingerprint field. - */ - public function unsetFingerprint(): self - { - $this->instance->unsetFingerprint(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets bank name field. - * - * @param string|null $value - */ - public function bankName(?string $value): self - { - $this->instance->setBankName($value); - return $this; - } - - /** - * Unsets bank name field. - */ - public function unsetBankName(): self - { - $this->instance->unsetBankName(); - return $this; - } - - /** - * Initializes a new Bank Account object. - */ - public function build(): BankAccount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BankAccountPaymentDetailsBuilder.php b/src/Models/Builders/BankAccountPaymentDetailsBuilder.php deleted file mode 100644 index fd8b0b00..00000000 --- a/src/Models/Builders/BankAccountPaymentDetailsBuilder.php +++ /dev/null @@ -1,195 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bank Account Payment Details Builder object. - */ - public static function init(): self - { - return new self(new BankAccountPaymentDetails()); - } - - /** - * Sets bank name field. - * - * @param string|null $value - */ - public function bankName(?string $value): self - { - $this->instance->setBankName($value); - return $this; - } - - /** - * Unsets bank name field. - */ - public function unsetBankName(): self - { - $this->instance->unsetBankName(); - return $this; - } - - /** - * Sets transfer type field. - * - * @param string|null $value - */ - public function transferType(?string $value): self - { - $this->instance->setTransferType($value); - return $this; - } - - /** - * Unsets transfer type field. - */ - public function unsetTransferType(): self - { - $this->instance->unsetTransferType(); - return $this; - } - - /** - * Sets account ownership type field. - * - * @param string|null $value - */ - public function accountOwnershipType(?string $value): self - { - $this->instance->setAccountOwnershipType($value); - return $this; - } - - /** - * Unsets account ownership type field. - */ - public function unsetAccountOwnershipType(): self - { - $this->instance->unsetAccountOwnershipType(); - return $this; - } - - /** - * Sets fingerprint field. - * - * @param string|null $value - */ - public function fingerprint(?string $value): self - { - $this->instance->setFingerprint($value); - return $this; - } - - /** - * Unsets fingerprint field. - */ - public function unsetFingerprint(): self - { - $this->instance->unsetFingerprint(); - return $this; - } - - /** - * Sets country field. - * - * @param string|null $value - */ - public function country(?string $value): self - { - $this->instance->setCountry($value); - return $this; - } - - /** - * Unsets country field. - */ - public function unsetCountry(): self - { - $this->instance->unsetCountry(); - return $this; - } - - /** - * Sets statement description field. - * - * @param string|null $value - */ - public function statementDescription(?string $value): self - { - $this->instance->setStatementDescription($value); - return $this; - } - - /** - * Unsets statement description field. - */ - public function unsetStatementDescription(): self - { - $this->instance->unsetStatementDescription(); - return $this; - } - - /** - * Sets ach details field. - * - * @param ACHDetails|null $value - */ - public function achDetails(?ACHDetails $value): self - { - $this->instance->setAchDetails($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Unsets errors field. - */ - public function unsetErrors(): self - { - $this->instance->unsetErrors(); - return $this; - } - - /** - * Initializes a new Bank Account Payment Details object. - */ - public function build(): BankAccountPaymentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchChangeInventoryRequestBuilder.php b/src/Models/Builders/BatchChangeInventoryRequestBuilder.php deleted file mode 100644 index 191285ed..00000000 --- a/src/Models/Builders/BatchChangeInventoryRequestBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Change Inventory Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new BatchChangeInventoryRequest($idempotencyKey)); - } - - /** - * Sets changes field. - * - * @param InventoryChange[]|null $value - */ - public function changes(?array $value): self - { - $this->instance->setChanges($value); - return $this; - } - - /** - * Unsets changes field. - */ - public function unsetChanges(): self - { - $this->instance->unsetChanges(); - return $this; - } - - /** - * Sets ignore unchanged counts field. - * - * @param bool|null $value - */ - public function ignoreUnchangedCounts(?bool $value): self - { - $this->instance->setIgnoreUnchangedCounts($value); - return $this; - } - - /** - * Unsets ignore unchanged counts field. - */ - public function unsetIgnoreUnchangedCounts(): self - { - $this->instance->unsetIgnoreUnchangedCounts(); - return $this; - } - - /** - * Initializes a new Batch Change Inventory Request object. - */ - public function build(): BatchChangeInventoryRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchChangeInventoryResponseBuilder.php b/src/Models/Builders/BatchChangeInventoryResponseBuilder.php deleted file mode 100644 index db2f796a..00000000 --- a/src/Models/Builders/BatchChangeInventoryResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Change Inventory Response Builder object. - */ - public static function init(): self - { - return new self(new BatchChangeInventoryResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets counts field. - * - * @param InventoryCount[]|null $value - */ - public function counts(?array $value): self - { - $this->instance->setCounts($value); - return $this; - } - - /** - * Sets changes field. - * - * @param InventoryChange[]|null $value - */ - public function changes(?array $value): self - { - $this->instance->setChanges($value); - return $this; - } - - /** - * Initializes a new Batch Change Inventory Response object. - */ - public function build(): BatchChangeInventoryResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchDeleteCatalogObjectsRequestBuilder.php b/src/Models/Builders/BatchDeleteCatalogObjectsRequestBuilder.php deleted file mode 100644 index e8e92ffb..00000000 --- a/src/Models/Builders/BatchDeleteCatalogObjectsRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Delete Catalog Objects Request Builder object. - */ - public static function init(): self - { - return new self(new BatchDeleteCatalogObjectsRequest()); - } - - /** - * Sets object ids field. - * - * @param string[]|null $value - */ - public function objectIds(?array $value): self - { - $this->instance->setObjectIds($value); - return $this; - } - - /** - * Unsets object ids field. - */ - public function unsetObjectIds(): self - { - $this->instance->unsetObjectIds(); - return $this; - } - - /** - * Initializes a new Batch Delete Catalog Objects Request object. - */ - public function build(): BatchDeleteCatalogObjectsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchDeleteCatalogObjectsResponseBuilder.php b/src/Models/Builders/BatchDeleteCatalogObjectsResponseBuilder.php deleted file mode 100644 index 4afbe2c0..00000000 --- a/src/Models/Builders/BatchDeleteCatalogObjectsResponseBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Delete Catalog Objects Response Builder object. - */ - public static function init(): self - { - return new self(new BatchDeleteCatalogObjectsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets deleted object ids field. - * - * @param string[]|null $value - */ - public function deletedObjectIds(?array $value): self - { - $this->instance->setDeletedObjectIds($value); - return $this; - } - - /** - * Sets deleted at field. - * - * @param string|null $value - */ - public function deletedAt(?string $value): self - { - $this->instance->setDeletedAt($value); - return $this; - } - - /** - * Initializes a new Batch Delete Catalog Objects Response object. - */ - public function build(): BatchDeleteCatalogObjectsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveCatalogObjectsRequestBuilder.php b/src/Models/Builders/BatchRetrieveCatalogObjectsRequestBuilder.php deleted file mode 100644 index 1f232c05..00000000 --- a/src/Models/Builders/BatchRetrieveCatalogObjectsRequestBuilder.php +++ /dev/null @@ -1,124 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Catalog Objects Request Builder object. - * - * @param string[] $objectIds - */ - public static function init(array $objectIds): self - { - return new self(new BatchRetrieveCatalogObjectsRequest($objectIds)); - } - - /** - * Sets include related objects field. - * - * @param bool|null $value - */ - public function includeRelatedObjects(?bool $value): self - { - $this->instance->setIncludeRelatedObjects($value); - return $this; - } - - /** - * Unsets include related objects field. - */ - public function unsetIncludeRelatedObjects(): self - { - $this->instance->unsetIncludeRelatedObjects(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets include deleted objects field. - * - * @param bool|null $value - */ - public function includeDeletedObjects(?bool $value): self - { - $this->instance->setIncludeDeletedObjects($value); - return $this; - } - - /** - * Unsets include deleted objects field. - */ - public function unsetIncludeDeletedObjects(): self - { - $this->instance->unsetIncludeDeletedObjects(); - return $this; - } - - /** - * Sets include category path to root field. - * - * @param bool|null $value - */ - public function includeCategoryPathToRoot(?bool $value): self - { - $this->instance->setIncludeCategoryPathToRoot($value); - return $this; - } - - /** - * Unsets include category path to root field. - */ - public function unsetIncludeCategoryPathToRoot(): self - { - $this->instance->unsetIncludeCategoryPathToRoot(); - return $this; - } - - /** - * Initializes a new Batch Retrieve Catalog Objects Request object. - */ - public function build(): BatchRetrieveCatalogObjectsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveCatalogObjectsResponseBuilder.php b/src/Models/Builders/BatchRetrieveCatalogObjectsResponseBuilder.php deleted file mode 100644 index 7117b93c..00000000 --- a/src/Models/Builders/BatchRetrieveCatalogObjectsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Catalog Objects Response Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveCatalogObjectsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets objects field. - * - * @param CatalogObject[]|null $value - */ - public function objects(?array $value): self - { - $this->instance->setObjects($value); - return $this; - } - - /** - * Sets related objects field. - * - * @param CatalogObject[]|null $value - */ - public function relatedObjects(?array $value): self - { - $this->instance->setRelatedObjects($value); - return $this; - } - - /** - * Initializes a new Batch Retrieve Catalog Objects Response object. - */ - public function build(): BatchRetrieveCatalogObjectsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveInventoryChangesRequestBuilder.php b/src/Models/Builders/BatchRetrieveInventoryChangesRequestBuilder.php deleted file mode 100644 index a23b6013..00000000 --- a/src/Models/Builders/BatchRetrieveInventoryChangesRequestBuilder.php +++ /dev/null @@ -1,202 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Inventory Changes Request Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveInventoryChangesRequest()); - } - - /** - * Sets catalog object ids field. - * - * @param string[]|null $value - */ - public function catalogObjectIds(?array $value): self - { - $this->instance->setCatalogObjectIds($value); - return $this; - } - - /** - * Unsets catalog object ids field. - */ - public function unsetCatalogObjectIds(): self - { - $this->instance->unsetCatalogObjectIds(); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets types field. - * - * @param string[]|null $value - */ - public function types(?array $value): self - { - $this->instance->setTypes($value); - return $this; - } - - /** - * Unsets types field. - */ - public function unsetTypes(): self - { - $this->instance->unsetTypes(); - return $this; - } - - /** - * Sets states field. - * - * @param string[]|null $value - */ - public function states(?array $value): self - { - $this->instance->setStates($value); - return $this; - } - - /** - * Unsets states field. - */ - public function unsetStates(): self - { - $this->instance->unsetStates(); - return $this; - } - - /** - * Sets updated after field. - * - * @param string|null $value - */ - public function updatedAfter(?string $value): self - { - $this->instance->setUpdatedAfter($value); - return $this; - } - - /** - * Unsets updated after field. - */ - public function unsetUpdatedAfter(): self - { - $this->instance->unsetUpdatedAfter(); - return $this; - } - - /** - * Sets updated before field. - * - * @param string|null $value - */ - public function updatedBefore(?string $value): self - { - $this->instance->setUpdatedBefore($value); - return $this; - } - - /** - * Unsets updated before field. - */ - public function unsetUpdatedBefore(): self - { - $this->instance->unsetUpdatedBefore(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new Batch Retrieve Inventory Changes Request object. - */ - public function build(): BatchRetrieveInventoryChangesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveInventoryChangesResponseBuilder.php b/src/Models/Builders/BatchRetrieveInventoryChangesResponseBuilder.php deleted file mode 100644 index d42d5a96..00000000 --- a/src/Models/Builders/BatchRetrieveInventoryChangesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Inventory Changes Response Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveInventoryChangesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets changes field. - * - * @param InventoryChange[]|null $value - */ - public function changes(?array $value): self - { - $this->instance->setChanges($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Batch Retrieve Inventory Changes Response object. - */ - public function build(): BatchRetrieveInventoryChangesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveInventoryCountsRequestBuilder.php b/src/Models/Builders/BatchRetrieveInventoryCountsRequestBuilder.php deleted file mode 100644 index 2ef24be7..00000000 --- a/src/Models/Builders/BatchRetrieveInventoryCountsRequestBuilder.php +++ /dev/null @@ -1,162 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Inventory Counts Request Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveInventoryCountsRequest()); - } - - /** - * Sets catalog object ids field. - * - * @param string[]|null $value - */ - public function catalogObjectIds(?array $value): self - { - $this->instance->setCatalogObjectIds($value); - return $this; - } - - /** - * Unsets catalog object ids field. - */ - public function unsetCatalogObjectIds(): self - { - $this->instance->unsetCatalogObjectIds(); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets updated after field. - * - * @param string|null $value - */ - public function updatedAfter(?string $value): self - { - $this->instance->setUpdatedAfter($value); - return $this; - } - - /** - * Unsets updated after field. - */ - public function unsetUpdatedAfter(): self - { - $this->instance->unsetUpdatedAfter(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets states field. - * - * @param string[]|null $value - */ - public function states(?array $value): self - { - $this->instance->setStates($value); - return $this; - } - - /** - * Unsets states field. - */ - public function unsetStates(): self - { - $this->instance->unsetStates(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new Batch Retrieve Inventory Counts Request object. - */ - public function build(): BatchRetrieveInventoryCountsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveInventoryCountsResponseBuilder.php b/src/Models/Builders/BatchRetrieveInventoryCountsResponseBuilder.php deleted file mode 100644 index a9fa8b82..00000000 --- a/src/Models/Builders/BatchRetrieveInventoryCountsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Inventory Counts Response Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveInventoryCountsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets counts field. - * - * @param InventoryCount[]|null $value - */ - public function counts(?array $value): self - { - $this->instance->setCounts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Batch Retrieve Inventory Counts Response object. - */ - public function build(): BatchRetrieveInventoryCountsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveOrdersRequestBuilder.php b/src/Models/Builders/BatchRetrieveOrdersRequestBuilder.php deleted file mode 100644 index a574a8d9..00000000 --- a/src/Models/Builders/BatchRetrieveOrdersRequestBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Orders Request Builder object. - * - * @param string[] $orderIds - */ - public static function init(array $orderIds): self - { - return new self(new BatchRetrieveOrdersRequest($orderIds)); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Batch Retrieve Orders Request object. - */ - public function build(): BatchRetrieveOrdersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchRetrieveOrdersResponseBuilder.php b/src/Models/Builders/BatchRetrieveOrdersResponseBuilder.php deleted file mode 100644 index 348799e0..00000000 --- a/src/Models/Builders/BatchRetrieveOrdersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Retrieve Orders Response Builder object. - */ - public static function init(): self - { - return new self(new BatchRetrieveOrdersResponse()); - } - - /** - * Sets orders field. - * - * @param Order[]|null $value - */ - public function orders(?array $value): self - { - $this->instance->setOrders($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Batch Retrieve Orders Response object. - */ - public function build(): BatchRetrieveOrdersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchUpsertCatalogObjectsRequestBuilder.php b/src/Models/Builders/BatchUpsertCatalogObjectsRequestBuilder.php deleted file mode 100644 index 81b22faa..00000000 --- a/src/Models/Builders/BatchUpsertCatalogObjectsRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Upsert Catalog Objects Request Builder object. - * - * @param string $idempotencyKey - * @param CatalogObjectBatch[] $batches - */ - public static function init(string $idempotencyKey, array $batches): self - { - return new self(new BatchUpsertCatalogObjectsRequest($idempotencyKey, $batches)); - } - - /** - * Initializes a new Batch Upsert Catalog Objects Request object. - */ - public function build(): BatchUpsertCatalogObjectsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BatchUpsertCatalogObjectsResponseBuilder.php b/src/Models/Builders/BatchUpsertCatalogObjectsResponseBuilder.php deleted file mode 100644 index 3c907dfb..00000000 --- a/src/Models/Builders/BatchUpsertCatalogObjectsResponseBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Batch Upsert Catalog Objects Response Builder object. - */ - public static function init(): self - { - return new self(new BatchUpsertCatalogObjectsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets objects field. - * - * @param CatalogObject[]|null $value - */ - public function objects(?array $value): self - { - $this->instance->setObjects($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets id mappings field. - * - * @param CatalogIdMapping[]|null $value - */ - public function idMappings(?array $value): self - { - $this->instance->setIdMappings($value); - return $this; - } - - /** - * Initializes a new Batch Upsert Catalog Objects Response object. - */ - public function build(): BatchUpsertCatalogObjectsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingBuilder.php b/src/Models/Builders/BookingBuilder.php deleted file mode 100644 index 4b4cac4f..00000000 --- a/src/Models/Builders/BookingBuilder.php +++ /dev/null @@ -1,286 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Builder object. - */ - public static function init(): self - { - return new self(new Booking()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets start at field. - * - * @param string|null $value - */ - public function startAt(?string $value): self - { - $this->instance->setStartAt($value); - return $this; - } - - /** - * Unsets start at field. - */ - public function unsetStartAt(): self - { - $this->instance->unsetStartAt(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets customer note field. - * - * @param string|null $value - */ - public function customerNote(?string $value): self - { - $this->instance->setCustomerNote($value); - return $this; - } - - /** - * Unsets customer note field. - */ - public function unsetCustomerNote(): self - { - $this->instance->unsetCustomerNote(); - return $this; - } - - /** - * Sets seller note field. - * - * @param string|null $value - */ - public function sellerNote(?string $value): self - { - $this->instance->setSellerNote($value); - return $this; - } - - /** - * Unsets seller note field. - */ - public function unsetSellerNote(): self - { - $this->instance->unsetSellerNote(); - return $this; - } - - /** - * Sets appointment segments field. - * - * @param AppointmentSegment[]|null $value - */ - public function appointmentSegments(?array $value): self - { - $this->instance->setAppointmentSegments($value); - return $this; - } - - /** - * Unsets appointment segments field. - */ - public function unsetAppointmentSegments(): self - { - $this->instance->unsetAppointmentSegments(); - return $this; - } - - /** - * Sets transition time minutes field. - * - * @param int|null $value - */ - public function transitionTimeMinutes(?int $value): self - { - $this->instance->setTransitionTimeMinutes($value); - return $this; - } - - /** - * Sets all day field. - * - * @param bool|null $value - */ - public function allDay(?bool $value): self - { - $this->instance->setAllDay($value); - return $this; - } - - /** - * Sets location type field. - * - * @param string|null $value - */ - public function locationType(?string $value): self - { - $this->instance->setLocationType($value); - return $this; - } - - /** - * Sets creator details field. - * - * @param BookingCreatorDetails|null $value - */ - public function creatorDetails(?BookingCreatorDetails $value): self - { - $this->instance->setCreatorDetails($value); - return $this; - } - - /** - * Sets source field. - * - * @param string|null $value - */ - public function source(?string $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Initializes a new Booking object. - */ - public function build(): Booking - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingCreatorDetailsBuilder.php b/src/Models/Builders/BookingCreatorDetailsBuilder.php deleted file mode 100644 index 696ac279..00000000 --- a/src/Models/Builders/BookingCreatorDetailsBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Creator Details Builder object. - */ - public static function init(): self - { - return new self(new BookingCreatorDetails()); - } - - /** - * Sets creator type field. - * - * @param string|null $value - */ - public function creatorType(?string $value): self - { - $this->instance->setCreatorType($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Initializes a new Booking Creator Details object. - */ - public function build(): BookingCreatorDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingCustomAttributeDeleteRequestBuilder.php b/src/Models/Builders/BookingCustomAttributeDeleteRequestBuilder.php deleted file mode 100644 index 16ac6556..00000000 --- a/src/Models/Builders/BookingCustomAttributeDeleteRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Custom Attribute Delete Request Builder object. - * - * @param string $bookingId - * @param string $key - */ - public static function init(string $bookingId, string $key): self - { - return new self(new BookingCustomAttributeDeleteRequest($bookingId, $key)); - } - - /** - * Initializes a new Booking Custom Attribute Delete Request object. - */ - public function build(): BookingCustomAttributeDeleteRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingCustomAttributeDeleteResponseBuilder.php b/src/Models/Builders/BookingCustomAttributeDeleteResponseBuilder.php deleted file mode 100644 index 3a902f5e..00000000 --- a/src/Models/Builders/BookingCustomAttributeDeleteResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Custom Attribute Delete Response Builder object. - */ - public static function init(): self - { - return new self(new BookingCustomAttributeDeleteResponse()); - } - - /** - * Sets booking id field. - * - * @param string|null $value - */ - public function bookingId(?string $value): self - { - $this->instance->setBookingId($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Booking Custom Attribute Delete Response object. - */ - public function build(): BookingCustomAttributeDeleteResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingCustomAttributeUpsertRequestBuilder.php b/src/Models/Builders/BookingCustomAttributeUpsertRequestBuilder.php deleted file mode 100644 index 07155c59..00000000 --- a/src/Models/Builders/BookingCustomAttributeUpsertRequestBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Custom Attribute Upsert Request Builder object. - * - * @param string $bookingId - * @param CustomAttribute $customAttribute - */ - public static function init(string $bookingId, CustomAttribute $customAttribute): self - { - return new self(new BookingCustomAttributeUpsertRequest($bookingId, $customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Booking Custom Attribute Upsert Request object. - */ - public function build(): BookingCustomAttributeUpsertRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BookingCustomAttributeUpsertResponseBuilder.php b/src/Models/Builders/BookingCustomAttributeUpsertResponseBuilder.php deleted file mode 100644 index 08dc8bb9..00000000 --- a/src/Models/Builders/BookingCustomAttributeUpsertResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Booking Custom Attribute Upsert Response Builder object. - */ - public static function init(): self - { - return new self(new BookingCustomAttributeUpsertResponse()); - } - - /** - * Sets booking id field. - * - * @param string|null $value - */ - public function bookingId(?string $value): self - { - $this->instance->setBookingId($value); - return $this; - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Booking Custom Attribute Upsert Response object. - */ - public function build(): BookingCustomAttributeUpsertResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BreakTypeBuilder.php b/src/Models/Builders/BreakTypeBuilder.php deleted file mode 100644 index e87631b5..00000000 --- a/src/Models/Builders/BreakTypeBuilder.php +++ /dev/null @@ -1,91 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Break Type Builder object. - * - * @param string $locationId - * @param string $breakName - * @param string $expectedDuration - * @param bool $isPaid - */ - public static function init(string $locationId, string $breakName, string $expectedDuration, bool $isPaid): self - { - return new self(new BreakType($locationId, $breakName, $expectedDuration, $isPaid)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Break Type object. - */ - public function build(): BreakType - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateCustomerDataBuilder.php b/src/Models/Builders/BulkCreateCustomerDataBuilder.php deleted file mode 100644 index c2d41597..00000000 --- a/src/Models/Builders/BulkCreateCustomerDataBuilder.php +++ /dev/null @@ -1,246 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Customer Data Builder object. - */ - public static function init(): self - { - return new self(new BulkCreateCustomerData()); - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Unsets given name field. - */ - public function unsetGivenName(): self - { - $this->instance->unsetGivenName(); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Unsets family name field. - */ - public function unsetFamilyName(): self - { - $this->instance->unsetFamilyName(); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Unsets company name field. - */ - public function unsetCompanyName(): self - { - $this->instance->unsetCompanyName(); - return $this; - } - - /** - * Sets nickname field. - * - * @param string|null $value - */ - public function nickname(?string $value): self - { - $this->instance->setNickname($value); - return $this; - } - - /** - * Unsets nickname field. - */ - public function unsetNickname(): self - { - $this->instance->unsetNickname(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets birthday field. - * - * @param string|null $value - */ - public function birthday(?string $value): self - { - $this->instance->setBirthday($value); - return $this; - } - - /** - * Unsets birthday field. - */ - public function unsetBirthday(): self - { - $this->instance->unsetBirthday(); - return $this; - } - - /** - * Sets tax ids field. - * - * @param CustomerTaxIds|null $value - */ - public function taxIds(?CustomerTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Bulk Create Customer Data object. - */ - public function build(): BulkCreateCustomerData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateCustomersRequestBuilder.php b/src/Models/Builders/BulkCreateCustomersRequestBuilder.php deleted file mode 100644 index 258b55a0..00000000 --- a/src/Models/Builders/BulkCreateCustomersRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Customers Request Builder object. - * - * @param array $customers - */ - public static function init(array $customers): self - { - return new self(new BulkCreateCustomersRequest($customers)); - } - - /** - * Initializes a new Bulk Create Customers Request object. - */ - public function build(): BulkCreateCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateCustomersResponseBuilder.php b/src/Models/Builders/BulkCreateCustomersResponseBuilder.php deleted file mode 100644 index 9c789ad4..00000000 --- a/src/Models/Builders/BulkCreateCustomersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Customers Response Builder object. - */ - public static function init(): self - { - return new self(new BulkCreateCustomersResponse()); - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Create Customers Response object. - */ - public function build(): BulkCreateCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateTeamMembersRequestBuilder.php b/src/Models/Builders/BulkCreateTeamMembersRequestBuilder.php deleted file mode 100644 index b6878d1f..00000000 --- a/src/Models/Builders/BulkCreateTeamMembersRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Team Members Request Builder object. - * - * @param array $teamMembers - */ - public static function init(array $teamMembers): self - { - return new self(new BulkCreateTeamMembersRequest($teamMembers)); - } - - /** - * Initializes a new Bulk Create Team Members Request object. - */ - public function build(): BulkCreateTeamMembersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateTeamMembersResponseBuilder.php b/src/Models/Builders/BulkCreateTeamMembersResponseBuilder.php deleted file mode 100644 index 7e7b11b8..00000000 --- a/src/Models/Builders/BulkCreateTeamMembersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Team Members Response Builder object. - */ - public static function init(): self - { - return new self(new BulkCreateTeamMembersResponse()); - } - - /** - * Sets team members field. - * - * @param array|null $value - */ - public function teamMembers(?array $value): self - { - $this->instance->setTeamMembers($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Create Team Members Response object. - */ - public function build(): BulkCreateTeamMembersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateVendorsRequestBuilder.php b/src/Models/Builders/BulkCreateVendorsRequestBuilder.php deleted file mode 100644 index 109058ce..00000000 --- a/src/Models/Builders/BulkCreateVendorsRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Vendors Request Builder object. - * - * @param array $vendors - */ - public static function init(array $vendors): self - { - return new self(new BulkCreateVendorsRequest($vendors)); - } - - /** - * Initializes a new Bulk Create Vendors Request object. - */ - public function build(): BulkCreateVendorsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkCreateVendorsResponseBuilder.php b/src/Models/Builders/BulkCreateVendorsResponseBuilder.php deleted file mode 100644 index 4b3780d4..00000000 --- a/src/Models/Builders/BulkCreateVendorsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Create Vendors Response Builder object. - */ - public static function init(): self - { - return new self(new BulkCreateVendorsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Initializes a new Bulk Create Vendors Response object. - */ - public function build(): BulkCreateVendorsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteBookingCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkDeleteBookingCustomAttributesRequestBuilder.php deleted file mode 100644 index 56b2310b..00000000 --- a/src/Models/Builders/BulkDeleteBookingCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Booking Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteBookingCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Delete Booking Custom Attributes Request object. - */ - public function build(): BulkDeleteBookingCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteBookingCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkDeleteBookingCustomAttributesResponseBuilder.php deleted file mode 100644 index 7843f0cd..00000000 --- a/src/Models/Builders/BulkDeleteBookingCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Booking Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteBookingCustomAttributesResponse()); - } - - /** - * Sets values field. - * - * @param array|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Booking Custom Attributes Response object. - */ - public function build(): BulkDeleteBookingCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteCustomersRequestBuilder.php b/src/Models/Builders/BulkDeleteCustomersRequestBuilder.php deleted file mode 100644 index 219b626f..00000000 --- a/src/Models/Builders/BulkDeleteCustomersRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Customers Request Builder object. - * - * @param string[] $customerIds - */ - public static function init(array $customerIds): self - { - return new self(new BulkDeleteCustomersRequest($customerIds)); - } - - /** - * Initializes a new Bulk Delete Customers Request object. - */ - public function build(): BulkDeleteCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteCustomersResponseBuilder.php b/src/Models/Builders/BulkDeleteCustomersResponseBuilder.php deleted file mode 100644 index dee58856..00000000 --- a/src/Models/Builders/BulkDeleteCustomersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Customers Response Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteCustomersResponse()); - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Customers Response object. - */ - public function build(): BulkDeleteCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestBuilder.php deleted file mode 100644 index ba26ab8b..00000000 --- a/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteLocationCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Request object. - */ - public function build(): BulkDeleteLocationCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder.php b/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder.php deleted file mode 100644 index 53d2cfe2..00000000 --- a/src/Models/Builders/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete - * Request Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest()); - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete - * Request object. - */ - public function build(): BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseBuilder.php deleted file mode 100644 index f88de0e5..00000000 --- a/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Response Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteLocationCustomAttributesResponse($values)); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Response object. - */ - public function build(): BulkDeleteLocationCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponseBuilder.php b/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponseBuilder.php deleted file mode 100644 index b59b9ab6..00000000 --- a/src/Models/Builders/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponseBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete - * Response Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete - * Response object. - */ - public function build(): BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestBuilder.php deleted file mode 100644 index 1b5a4636..00000000 --- a/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteMerchantCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Request object. - */ - public function build(): BulkDeleteMerchantCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestBuilder.php b/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestBuilder.php deleted file mode 100644 index c832a21d..00000000 --- a/src/Models/Builders/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete - * Request Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest()); - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete - * Request object. - */ - public function build(): BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseBuilder.php deleted file mode 100644 index 4547c327..00000000 --- a/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Response Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteMerchantCustomAttributesResponse($values)); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Response object. - */ - public function build(): BulkDeleteMerchantCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponseBuilder.php b/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponseBuilder.php deleted file mode 100644 index 43b3a40a..00000000 --- a/src/Models/Builders/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponseBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete - * Response Builder object. - */ - public static function init(): self - { - return new self(new BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete - * Response object. - */ - public function build(): BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestBuilder.php deleted file mode 100644 index 3766ac1a..00000000 --- a/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteOrderCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Request object. - */ - public function build(): BulkDeleteOrderCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeBuilder.php b/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeBuilder.php deleted file mode 100644 index b2e2fff3..00000000 --- a/src/Models/Builders/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeBuilder.php +++ /dev/null @@ -1,55 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Request Delete Custom Attribute Builder object. - * - * @param string $orderId - */ - public static function init(string $orderId): self - { - return new self(new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute($orderId)); - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Request Delete Custom Attribute object. - */ - public function build(): BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkDeleteOrderCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkDeleteOrderCustomAttributesResponseBuilder.php deleted file mode 100644 index 19fe7b7b..00000000 --- a/src/Models/Builders/BulkDeleteOrderCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Response Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkDeleteOrderCustomAttributesResponse($values)); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Delete Order Custom Attributes Response object. - */ - public function build(): BulkDeleteOrderCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveBookingsRequestBuilder.php b/src/Models/Builders/BulkRetrieveBookingsRequestBuilder.php deleted file mode 100644 index 99e390c9..00000000 --- a/src/Models/Builders/BulkRetrieveBookingsRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Bookings Request Builder object. - * - * @param string[] $bookingIds - */ - public static function init(array $bookingIds): self - { - return new self(new BulkRetrieveBookingsRequest($bookingIds)); - } - - /** - * Initializes a new Bulk Retrieve Bookings Request object. - */ - public function build(): BulkRetrieveBookingsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveBookingsResponseBuilder.php b/src/Models/Builders/BulkRetrieveBookingsResponseBuilder.php deleted file mode 100644 index 4fb2a4be..00000000 --- a/src/Models/Builders/BulkRetrieveBookingsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Bookings Response Builder object. - */ - public static function init(): self - { - return new self(new BulkRetrieveBookingsResponse()); - } - - /** - * Sets bookings field. - * - * @param array|null $value - */ - public function bookings(?array $value): self - { - $this->instance->setBookings($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Retrieve Bookings Response object. - */ - public function build(): BulkRetrieveBookingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveCustomersRequestBuilder.php b/src/Models/Builders/BulkRetrieveCustomersRequestBuilder.php deleted file mode 100644 index b50c7c0c..00000000 --- a/src/Models/Builders/BulkRetrieveCustomersRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Customers Request Builder object. - * - * @param string[] $customerIds - */ - public static function init(array $customerIds): self - { - return new self(new BulkRetrieveCustomersRequest($customerIds)); - } - - /** - * Initializes a new Bulk Retrieve Customers Request object. - */ - public function build(): BulkRetrieveCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveCustomersResponseBuilder.php b/src/Models/Builders/BulkRetrieveCustomersResponseBuilder.php deleted file mode 100644 index 5a7af9f9..00000000 --- a/src/Models/Builders/BulkRetrieveCustomersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Customers Response Builder object. - */ - public static function init(): self - { - return new self(new BulkRetrieveCustomersResponse()); - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Retrieve Customers Response object. - */ - public function build(): BulkRetrieveCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesRequestBuilder.php b/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesRequestBuilder.php deleted file mode 100644 index 2fa7e76e..00000000 --- a/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Team Member Booking Profiles Request Builder object. - * - * @param string[] $teamMemberIds - */ - public static function init(array $teamMemberIds): self - { - return new self(new BulkRetrieveTeamMemberBookingProfilesRequest($teamMemberIds)); - } - - /** - * Initializes a new Bulk Retrieve Team Member Booking Profiles Request object. - */ - public function build(): BulkRetrieveTeamMemberBookingProfilesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesResponseBuilder.php b/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesResponseBuilder.php deleted file mode 100644 index 076d3300..00000000 --- a/src/Models/Builders/BulkRetrieveTeamMemberBookingProfilesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Team Member Booking Profiles Response Builder object. - */ - public static function init(): self - { - return new self(new BulkRetrieveTeamMemberBookingProfilesResponse()); - } - - /** - * Sets team member booking profiles field. - * - * @param array|null $value - */ - public function teamMemberBookingProfiles(?array $value): self - { - $this->instance->setTeamMemberBookingProfiles($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Retrieve Team Member Booking Profiles Response object. - */ - public function build(): BulkRetrieveTeamMemberBookingProfilesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveVendorsRequestBuilder.php b/src/Models/Builders/BulkRetrieveVendorsRequestBuilder.php deleted file mode 100644 index 0e44fa74..00000000 --- a/src/Models/Builders/BulkRetrieveVendorsRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Vendors Request Builder object. - */ - public static function init(): self - { - return new self(new BulkRetrieveVendorsRequest()); - } - - /** - * Sets vendor ids field. - * - * @param string[]|null $value - */ - public function vendorIds(?array $value): self - { - $this->instance->setVendorIds($value); - return $this; - } - - /** - * Unsets vendor ids field. - */ - public function unsetVendorIds(): self - { - $this->instance->unsetVendorIds(); - return $this; - } - - /** - * Initializes a new Bulk Retrieve Vendors Request object. - */ - public function build(): BulkRetrieveVendorsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkRetrieveVendorsResponseBuilder.php b/src/Models/Builders/BulkRetrieveVendorsResponseBuilder.php deleted file mode 100644 index fa63f60a..00000000 --- a/src/Models/Builders/BulkRetrieveVendorsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Retrieve Vendors Response Builder object. - */ - public static function init(): self - { - return new self(new BulkRetrieveVendorsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Initializes a new Bulk Retrieve Vendors Response object. - */ - public function build(): BulkRetrieveVendorsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkSwapPlanRequestBuilder.php b/src/Models/Builders/BulkSwapPlanRequestBuilder.php deleted file mode 100644 index 4bba7238..00000000 --- a/src/Models/Builders/BulkSwapPlanRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Swap Plan Request Builder object. - * - * @param string $newPlanVariationId - * @param string $oldPlanVariationId - * @param string $locationId - */ - public static function init(string $newPlanVariationId, string $oldPlanVariationId, string $locationId): self - { - return new self(new BulkSwapPlanRequest($newPlanVariationId, $oldPlanVariationId, $locationId)); - } - - /** - * Initializes a new Bulk Swap Plan Request object. - */ - public function build(): BulkSwapPlanRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkSwapPlanResponseBuilder.php b/src/Models/Builders/BulkSwapPlanResponseBuilder.php deleted file mode 100644 index bf840be3..00000000 --- a/src/Models/Builders/BulkSwapPlanResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Swap Plan Response Builder object. - */ - public static function init(): self - { - return new self(new BulkSwapPlanResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets affected subscriptions field. - * - * @param int|null $value - */ - public function affectedSubscriptions(?int $value): self - { - $this->instance->setAffectedSubscriptions($value); - return $this; - } - - /** - * Initializes a new Bulk Swap Plan Response object. - */ - public function build(): BulkSwapPlanResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateCustomerDataBuilder.php b/src/Models/Builders/BulkUpdateCustomerDataBuilder.php deleted file mode 100644 index 1a6d21e0..00000000 --- a/src/Models/Builders/BulkUpdateCustomerDataBuilder.php +++ /dev/null @@ -1,257 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Customer Data Builder object. - */ - public static function init(): self - { - return new self(new BulkUpdateCustomerData()); - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Unsets given name field. - */ - public function unsetGivenName(): self - { - $this->instance->unsetGivenName(); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Unsets family name field. - */ - public function unsetFamilyName(): self - { - $this->instance->unsetFamilyName(); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Unsets company name field. - */ - public function unsetCompanyName(): self - { - $this->instance->unsetCompanyName(); - return $this; - } - - /** - * Sets nickname field. - * - * @param string|null $value - */ - public function nickname(?string $value): self - { - $this->instance->setNickname($value); - return $this; - } - - /** - * Unsets nickname field. - */ - public function unsetNickname(): self - { - $this->instance->unsetNickname(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets birthday field. - * - * @param string|null $value - */ - public function birthday(?string $value): self - { - $this->instance->setBirthday($value); - return $this; - } - - /** - * Unsets birthday field. - */ - public function unsetBirthday(): self - { - $this->instance->unsetBirthday(); - return $this; - } - - /** - * Sets tax ids field. - * - * @param CustomerTaxIds|null $value - */ - public function taxIds(?CustomerTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Bulk Update Customer Data object. - */ - public function build(): BulkUpdateCustomerData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateCustomersRequestBuilder.php b/src/Models/Builders/BulkUpdateCustomersRequestBuilder.php deleted file mode 100644 index 9d90f223..00000000 --- a/src/Models/Builders/BulkUpdateCustomersRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Customers Request Builder object. - * - * @param array $customers - */ - public static function init(array $customers): self - { - return new self(new BulkUpdateCustomersRequest($customers)); - } - - /** - * Initializes a new Bulk Update Customers Request object. - */ - public function build(): BulkUpdateCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateCustomersResponseBuilder.php b/src/Models/Builders/BulkUpdateCustomersResponseBuilder.php deleted file mode 100644 index b0ff042d..00000000 --- a/src/Models/Builders/BulkUpdateCustomersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Customers Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpdateCustomersResponse()); - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Update Customers Response object. - */ - public function build(): BulkUpdateCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateTeamMembersRequestBuilder.php b/src/Models/Builders/BulkUpdateTeamMembersRequestBuilder.php deleted file mode 100644 index 77dd065c..00000000 --- a/src/Models/Builders/BulkUpdateTeamMembersRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Team Members Request Builder object. - * - * @param array $teamMembers - */ - public static function init(array $teamMembers): self - { - return new self(new BulkUpdateTeamMembersRequest($teamMembers)); - } - - /** - * Initializes a new Bulk Update Team Members Request object. - */ - public function build(): BulkUpdateTeamMembersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateTeamMembersResponseBuilder.php b/src/Models/Builders/BulkUpdateTeamMembersResponseBuilder.php deleted file mode 100644 index 7f69b386..00000000 --- a/src/Models/Builders/BulkUpdateTeamMembersResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Team Members Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpdateTeamMembersResponse()); - } - - /** - * Sets team members field. - * - * @param array|null $value - */ - public function teamMembers(?array $value): self - { - $this->instance->setTeamMembers($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Update Team Members Response object. - */ - public function build(): BulkUpdateTeamMembersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateVendorsRequestBuilder.php b/src/Models/Builders/BulkUpdateVendorsRequestBuilder.php deleted file mode 100644 index cee7b0d2..00000000 --- a/src/Models/Builders/BulkUpdateVendorsRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Vendors Request Builder object. - * - * @param array $vendors - */ - public static function init(array $vendors): self - { - return new self(new BulkUpdateVendorsRequest($vendors)); - } - - /** - * Initializes a new Bulk Update Vendors Request object. - */ - public function build(): BulkUpdateVendorsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpdateVendorsResponseBuilder.php b/src/Models/Builders/BulkUpdateVendorsResponseBuilder.php deleted file mode 100644 index f51ac72c..00000000 --- a/src/Models/Builders/BulkUpdateVendorsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Update Vendors Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpdateVendorsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets responses field. - * - * @param array|null $value - */ - public function responses(?array $value): self - { - $this->instance->setResponses($value); - return $this; - } - - /** - * Initializes a new Bulk Update Vendors Response object. - */ - public function build(): BulkUpdateVendorsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertBookingCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkUpsertBookingCustomAttributesRequestBuilder.php deleted file mode 100644 index d1547648..00000000 --- a/src/Models/Builders/BulkUpsertBookingCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Booking Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertBookingCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Upsert Booking Custom Attributes Request object. - */ - public function build(): BulkUpsertBookingCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertBookingCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkUpsertBookingCustomAttributesResponseBuilder.php deleted file mode 100644 index 8aa8cd4a..00000000 --- a/src/Models/Builders/BulkUpsertBookingCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Booking Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertBookingCustomAttributesResponse()); - } - - /** - * Sets values field. - * - * @param array|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Booking Custom Attributes Response object. - */ - public function build(): BulkUpsertBookingCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestBuilder.php deleted file mode 100644 index cfcc2588..00000000 --- a/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertCustomerCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Request object. - */ - public function build(): BulkUpsertCustomerCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestBuilder.php b/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestBuilder.php deleted file mode 100644 index 1e065048..00000000 --- a/src/Models/Builders/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestBuilder.php +++ /dev/null @@ -1,72 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert - * Request Builder object. - * - * @param string $customerId - * @param CustomAttribute $customAttribute - */ - public static function init(string $customerId, CustomAttribute $customAttribute): self - { - return new self(new BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest( - $customerId, - $customAttribute - )); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert - * Request object. - */ - public function build(): BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseBuilder.php deleted file mode 100644 index dd10e7ca..00000000 --- a/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertCustomerCustomAttributesResponse()); - } - - /** - * Sets values field. - * - * @param array|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Response object. - */ - public function build(): BulkUpsertCustomerCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponseBuilder.php b/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponseBuilder.php deleted file mode 100644 index 36c0ef1a..00000000 --- a/src/Models/Builders/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponseBuilder.php +++ /dev/null @@ -1,80 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert - * Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse()); - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert - * Response object. - */ - public function build(): BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestBuilder.php deleted file mode 100644 index d7d17698..00000000 --- a/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertLocationCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Request object. - */ - public function build(): BulkUpsertLocationCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestBuilder.php b/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestBuilder.php deleted file mode 100644 index 47e6e002..00000000 --- a/src/Models/Builders/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestBuilder.php +++ /dev/null @@ -1,72 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert - * Request Builder object. - * - * @param string $locationId - * @param CustomAttribute $customAttribute - */ - public static function init(string $locationId, CustomAttribute $customAttribute): self - { - return new self(new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest( - $locationId, - $customAttribute - )); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert - * Request object. - */ - public function build(): BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseBuilder.php deleted file mode 100644 index 9c145683..00000000 --- a/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertLocationCustomAttributesResponse()); - } - - /** - * Sets values field. - * - * @param array|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Response object. - */ - public function build(): BulkUpsertLocationCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponseBuilder.php b/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponseBuilder.php deleted file mode 100644 index 39e3b9d1..00000000 --- a/src/Models/Builders/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponseBuilder.php +++ /dev/null @@ -1,80 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert - * Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert - * Response object. - */ - public function build(): BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestBuilder.php deleted file mode 100644 index b579e56c..00000000 --- a/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertMerchantCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Request object. - */ - public function build(): BulkUpsertMerchantCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestBuilder.php b/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestBuilder.php deleted file mode 100644 index 368f6005..00000000 --- a/src/Models/Builders/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestBuilder.php +++ /dev/null @@ -1,72 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert - * Request Builder object. - * - * @param string $merchantId - * @param CustomAttribute $customAttribute - */ - public static function init(string $merchantId, CustomAttribute $customAttribute): self - { - return new self(new BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest( - $merchantId, - $customAttribute - )); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert - * Request object. - */ - public function build(): BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseBuilder.php deleted file mode 100644 index f34f2229..00000000 --- a/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertMerchantCustomAttributesResponse()); - } - - /** - * Sets values field. - * - * @param array|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Response object. - */ - public function build(): BulkUpsertMerchantCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponseBuilder.php b/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponseBuilder.php deleted file mode 100644 index 2bccbfb0..00000000 --- a/src/Models/Builders/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponseBuilder.php +++ /dev/null @@ -1,80 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert - * Response Builder object. - */ - public static function init(): self - { - return new self(new BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse()); - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert - * Response object. - */ - public function build(): BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestBuilder.php b/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestBuilder.php deleted file mode 100644 index 9007f571..00000000 --- a/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Request Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertOrderCustomAttributesRequest($values)); - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Request object. - */ - public function build(): BulkUpsertOrderCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeBuilder.php b/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeBuilder.php deleted file mode 100644 index 32c73504..00000000 --- a/src/Models/Builders/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute Builder object. - * - * @param CustomAttribute $customAttribute - * @param string $orderId - */ - public static function init(CustomAttribute $customAttribute, string $orderId): self - { - return new self( - new BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute($customAttribute, $orderId) - ); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute object. - */ - public function build(): BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BulkUpsertOrderCustomAttributesResponseBuilder.php b/src/Models/Builders/BulkUpsertOrderCustomAttributesResponseBuilder.php deleted file mode 100644 index 489fe394..00000000 --- a/src/Models/Builders/BulkUpsertOrderCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Response Builder object. - * - * @param array $values - */ - public static function init(array $values): self - { - return new self(new BulkUpsertOrderCustomAttributesResponse($values)); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Bulk Upsert Order Custom Attributes Response object. - */ - public function build(): BulkUpsertOrderCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BusinessAppointmentSettingsBuilder.php b/src/Models/Builders/BusinessAppointmentSettingsBuilder.php deleted file mode 100644 index 71453f62..00000000 --- a/src/Models/Builders/BusinessAppointmentSettingsBuilder.php +++ /dev/null @@ -1,267 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Business Appointment Settings Builder object. - */ - public static function init(): self - { - return new self(new BusinessAppointmentSettings()); - } - - /** - * Sets location types field. - * - * @param string[]|null $value - */ - public function locationTypes(?array $value): self - { - $this->instance->setLocationTypes($value); - return $this; - } - - /** - * Unsets location types field. - */ - public function unsetLocationTypes(): self - { - $this->instance->unsetLocationTypes(); - return $this; - } - - /** - * Sets alignment time field. - * - * @param string|null $value - */ - public function alignmentTime(?string $value): self - { - $this->instance->setAlignmentTime($value); - return $this; - } - - /** - * Sets min booking lead time seconds field. - * - * @param int|null $value - */ - public function minBookingLeadTimeSeconds(?int $value): self - { - $this->instance->setMinBookingLeadTimeSeconds($value); - return $this; - } - - /** - * Unsets min booking lead time seconds field. - */ - public function unsetMinBookingLeadTimeSeconds(): self - { - $this->instance->unsetMinBookingLeadTimeSeconds(); - return $this; - } - - /** - * Sets max booking lead time seconds field. - * - * @param int|null $value - */ - public function maxBookingLeadTimeSeconds(?int $value): self - { - $this->instance->setMaxBookingLeadTimeSeconds($value); - return $this; - } - - /** - * Unsets max booking lead time seconds field. - */ - public function unsetMaxBookingLeadTimeSeconds(): self - { - $this->instance->unsetMaxBookingLeadTimeSeconds(); - return $this; - } - - /** - * Sets any team member booking enabled field. - * - * @param bool|null $value - */ - public function anyTeamMemberBookingEnabled(?bool $value): self - { - $this->instance->setAnyTeamMemberBookingEnabled($value); - return $this; - } - - /** - * Unsets any team member booking enabled field. - */ - public function unsetAnyTeamMemberBookingEnabled(): self - { - $this->instance->unsetAnyTeamMemberBookingEnabled(); - return $this; - } - - /** - * Sets multiple service booking enabled field. - * - * @param bool|null $value - */ - public function multipleServiceBookingEnabled(?bool $value): self - { - $this->instance->setMultipleServiceBookingEnabled($value); - return $this; - } - - /** - * Unsets multiple service booking enabled field. - */ - public function unsetMultipleServiceBookingEnabled(): self - { - $this->instance->unsetMultipleServiceBookingEnabled(); - return $this; - } - - /** - * Sets max appointments per day limit type field. - * - * @param string|null $value - */ - public function maxAppointmentsPerDayLimitType(?string $value): self - { - $this->instance->setMaxAppointmentsPerDayLimitType($value); - return $this; - } - - /** - * Sets max appointments per day limit field. - * - * @param int|null $value - */ - public function maxAppointmentsPerDayLimit(?int $value): self - { - $this->instance->setMaxAppointmentsPerDayLimit($value); - return $this; - } - - /** - * Unsets max appointments per day limit field. - */ - public function unsetMaxAppointmentsPerDayLimit(): self - { - $this->instance->unsetMaxAppointmentsPerDayLimit(); - return $this; - } - - /** - * Sets cancellation window seconds field. - * - * @param int|null $value - */ - public function cancellationWindowSeconds(?int $value): self - { - $this->instance->setCancellationWindowSeconds($value); - return $this; - } - - /** - * Unsets cancellation window seconds field. - */ - public function unsetCancellationWindowSeconds(): self - { - $this->instance->unsetCancellationWindowSeconds(); - return $this; - } - - /** - * Sets cancellation fee money field. - * - * @param Money|null $value - */ - public function cancellationFeeMoney(?Money $value): self - { - $this->instance->setCancellationFeeMoney($value); - return $this; - } - - /** - * Sets cancellation policy field. - * - * @param string|null $value - */ - public function cancellationPolicy(?string $value): self - { - $this->instance->setCancellationPolicy($value); - return $this; - } - - /** - * Sets cancellation policy text field. - * - * @param string|null $value - */ - public function cancellationPolicyText(?string $value): self - { - $this->instance->setCancellationPolicyText($value); - return $this; - } - - /** - * Unsets cancellation policy text field. - */ - public function unsetCancellationPolicyText(): self - { - $this->instance->unsetCancellationPolicyText(); - return $this; - } - - /** - * Sets skip booking flow staff selection field. - * - * @param bool|null $value - */ - public function skipBookingFlowStaffSelection(?bool $value): self - { - $this->instance->setSkipBookingFlowStaffSelection($value); - return $this; - } - - /** - * Unsets skip booking flow staff selection field. - */ - public function unsetSkipBookingFlowStaffSelection(): self - { - $this->instance->unsetSkipBookingFlowStaffSelection(); - return $this; - } - - /** - * Initializes a new Business Appointment Settings object. - */ - public function build(): BusinessAppointmentSettings - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BusinessBookingProfileBuilder.php b/src/Models/Builders/BusinessBookingProfileBuilder.php deleted file mode 100644 index 009e196b..00000000 --- a/src/Models/Builders/BusinessBookingProfileBuilder.php +++ /dev/null @@ -1,167 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Business Booking Profile Builder object. - */ - public static function init(): self - { - return new self(new BusinessBookingProfile()); - } - - /** - * Sets seller id field. - * - * @param string|null $value - */ - public function sellerId(?string $value): self - { - $this->instance->setSellerId($value); - return $this; - } - - /** - * Unsets seller id field. - */ - public function unsetSellerId(): self - { - $this->instance->unsetSellerId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets booking enabled field. - * - * @param bool|null $value - */ - public function bookingEnabled(?bool $value): self - { - $this->instance->setBookingEnabled($value); - return $this; - } - - /** - * Unsets booking enabled field. - */ - public function unsetBookingEnabled(): self - { - $this->instance->unsetBookingEnabled(); - return $this; - } - - /** - * Sets customer timezone choice field. - * - * @param string|null $value - */ - public function customerTimezoneChoice(?string $value): self - { - $this->instance->setCustomerTimezoneChoice($value); - return $this; - } - - /** - * Sets booking policy field. - * - * @param string|null $value - */ - public function bookingPolicy(?string $value): self - { - $this->instance->setBookingPolicy($value); - return $this; - } - - /** - * Sets allow user cancel field. - * - * @param bool|null $value - */ - public function allowUserCancel(?bool $value): self - { - $this->instance->setAllowUserCancel($value); - return $this; - } - - /** - * Unsets allow user cancel field. - */ - public function unsetAllowUserCancel(): self - { - $this->instance->unsetAllowUserCancel(); - return $this; - } - - /** - * Sets business appointment settings field. - * - * @param BusinessAppointmentSettings|null $value - */ - public function businessAppointmentSettings(?BusinessAppointmentSettings $value): self - { - $this->instance->setBusinessAppointmentSettings($value); - return $this; - } - - /** - * Sets support seller level writes field. - * - * @param bool|null $value - */ - public function supportSellerLevelWrites(?bool $value): self - { - $this->instance->setSupportSellerLevelWrites($value); - return $this; - } - - /** - * Unsets support seller level writes field. - */ - public function unsetSupportSellerLevelWrites(): self - { - $this->instance->unsetSupportSellerLevelWrites(); - return $this; - } - - /** - * Initializes a new Business Booking Profile object. - */ - public function build(): BusinessBookingProfile - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BusinessHoursBuilder.php b/src/Models/Builders/BusinessHoursBuilder.php deleted file mode 100644 index b2e8127d..00000000 --- a/src/Models/Builders/BusinessHoursBuilder.php +++ /dev/null @@ -1,63 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Business Hours Builder object. - */ - public static function init(): self - { - return new self(new BusinessHours()); - } - - /** - * Sets periods field. - * - * @param BusinessHoursPeriod[]|null $value - */ - public function periods(?array $value): self - { - $this->instance->setPeriods($value); - return $this; - } - - /** - * Unsets periods field. - */ - public function unsetPeriods(): self - { - $this->instance->unsetPeriods(); - return $this; - } - - /** - * Initializes a new Business Hours object. - */ - public function build(): BusinessHours - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BusinessHoursPeriodBuilder.php b/src/Models/Builders/BusinessHoursPeriodBuilder.php deleted file mode 100644 index b883aea8..00000000 --- a/src/Models/Builders/BusinessHoursPeriodBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Business Hours Period Builder object. - */ - public static function init(): self - { - return new self(new BusinessHoursPeriod()); - } - - /** - * Sets day of week field. - * - * @param string|null $value - */ - public function dayOfWeek(?string $value): self - { - $this->instance->setDayOfWeek($value); - return $this; - } - - /** - * Sets start local time field. - * - * @param string|null $value - */ - public function startLocalTime(?string $value): self - { - $this->instance->setStartLocalTime($value); - return $this; - } - - /** - * Unsets start local time field. - */ - public function unsetStartLocalTime(): self - { - $this->instance->unsetStartLocalTime(); - return $this; - } - - /** - * Sets end local time field. - * - * @param string|null $value - */ - public function endLocalTime(?string $value): self - { - $this->instance->setEndLocalTime($value); - return $this; - } - - /** - * Unsets end local time field. - */ - public function unsetEndLocalTime(): self - { - $this->instance->unsetEndLocalTime(); - return $this; - } - - /** - * Initializes a new Business Hours Period object. - */ - public function build(): BusinessHoursPeriod - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/BuyNowPayLaterDetailsBuilder.php b/src/Models/Builders/BuyNowPayLaterDetailsBuilder.php deleted file mode 100644 index 863f2f73..00000000 --- a/src/Models/Builders/BuyNowPayLaterDetailsBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Buy Now Pay Later Details Builder object. - */ - public static function init(): self - { - return new self(new BuyNowPayLaterDetails()); - } - - /** - * Sets brand field. - * - * @param string|null $value - */ - public function brand(?string $value): self - { - $this->instance->setBrand($value); - return $this; - } - - /** - * Unsets brand field. - */ - public function unsetBrand(): self - { - $this->instance->unsetBrand(); - return $this; - } - - /** - * Sets afterpay details field. - * - * @param AfterpayDetails|null $value - */ - public function afterpayDetails(?AfterpayDetails $value): self - { - $this->instance->setAfterpayDetails($value); - return $this; - } - - /** - * Sets clearpay details field. - * - * @param ClearpayDetails|null $value - */ - public function clearpayDetails(?ClearpayDetails $value): self - { - $this->instance->setClearpayDetails($value); - return $this; - } - - /** - * Initializes a new Buy Now Pay Later Details object. - */ - public function build(): BuyNowPayLaterDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CalculateLoyaltyPointsRequestBuilder.php b/src/Models/Builders/CalculateLoyaltyPointsRequestBuilder.php deleted file mode 100644 index b9c0b734..00000000 --- a/src/Models/Builders/CalculateLoyaltyPointsRequestBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Calculate Loyalty Points Request Builder object. - */ - public static function init(): self - { - return new self(new CalculateLoyaltyPointsRequest()); - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets transaction amount money field. - * - * @param Money|null $value - */ - public function transactionAmountMoney(?Money $value): self - { - $this->instance->setTransactionAmountMoney($value); - return $this; - } - - /** - * Sets loyalty account id field. - * - * @param string|null $value - */ - public function loyaltyAccountId(?string $value): self - { - $this->instance->setLoyaltyAccountId($value); - return $this; - } - - /** - * Unsets loyalty account id field. - */ - public function unsetLoyaltyAccountId(): self - { - $this->instance->unsetLoyaltyAccountId(); - return $this; - } - - /** - * Initializes a new Calculate Loyalty Points Request object. - */ - public function build(): CalculateLoyaltyPointsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CalculateLoyaltyPointsResponseBuilder.php b/src/Models/Builders/CalculateLoyaltyPointsResponseBuilder.php deleted file mode 100644 index f38ad7c4..00000000 --- a/src/Models/Builders/CalculateLoyaltyPointsResponseBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Calculate Loyalty Points Response Builder object. - */ - public static function init(): self - { - return new self(new CalculateLoyaltyPointsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets points field. - * - * @param int|null $value - */ - public function points(?int $value): self - { - $this->instance->setPoints($value); - return $this; - } - - /** - * Sets promotion points field. - * - * @param int|null $value - */ - public function promotionPoints(?int $value): self - { - $this->instance->setPromotionPoints($value); - return $this; - } - - /** - * Initializes a new Calculate Loyalty Points Response object. - */ - public function build(): CalculateLoyaltyPointsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CalculateOrderRequestBuilder.php b/src/Models/Builders/CalculateOrderRequestBuilder.php deleted file mode 100644 index 37582a92..00000000 --- a/src/Models/Builders/CalculateOrderRequestBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Calculate Order Request Builder object. - * - * @param Order $order - */ - public static function init(Order $order): self - { - return new self(new CalculateOrderRequest($order)); - } - - /** - * Sets proposed rewards field. - * - * @param OrderReward[]|null $value - */ - public function proposedRewards(?array $value): self - { - $this->instance->setProposedRewards($value); - return $this; - } - - /** - * Unsets proposed rewards field. - */ - public function unsetProposedRewards(): self - { - $this->instance->unsetProposedRewards(); - return $this; - } - - /** - * Initializes a new Calculate Order Request object. - */ - public function build(): CalculateOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CalculateOrderResponseBuilder.php b/src/Models/Builders/CalculateOrderResponseBuilder.php deleted file mode 100644 index 5fd45315..00000000 --- a/src/Models/Builders/CalculateOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Calculate Order Response Builder object. - */ - public static function init(): self - { - return new self(new CalculateOrderResponse()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Calculate Order Response object. - */ - public function build(): CalculateOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelBookingRequestBuilder.php b/src/Models/Builders/CancelBookingRequestBuilder.php deleted file mode 100644 index a7ed7a0b..00000000 --- a/src/Models/Builders/CancelBookingRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Booking Request Builder object. - */ - public static function init(): self - { - return new self(new CancelBookingRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Sets booking version field. - * - * @param int|null $value - */ - public function bookingVersion(?int $value): self - { - $this->instance->setBookingVersion($value); - return $this; - } - - /** - * Unsets booking version field. - */ - public function unsetBookingVersion(): self - { - $this->instance->unsetBookingVersion(); - return $this; - } - - /** - * Initializes a new Cancel Booking Request object. - */ - public function build(): CancelBookingRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelBookingResponseBuilder.php b/src/Models/Builders/CancelBookingResponseBuilder.php deleted file mode 100644 index b05e14d1..00000000 --- a/src/Models/Builders/CancelBookingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Booking Response Builder object. - */ - public static function init(): self - { - return new self(new CancelBookingResponse()); - } - - /** - * Sets booking field. - * - * @param Booking|null $value - */ - public function booking(?Booking $value): self - { - $this->instance->setBooking($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Cancel Booking Response object. - */ - public function build(): CancelBookingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelInvoiceRequestBuilder.php b/src/Models/Builders/CancelInvoiceRequestBuilder.php deleted file mode 100644 index 5413f0d9..00000000 --- a/src/Models/Builders/CancelInvoiceRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Invoice Request Builder object. - * - * @param int $version - */ - public static function init(int $version): self - { - return new self(new CancelInvoiceRequest($version)); - } - - /** - * Initializes a new Cancel Invoice Request object. - */ - public function build(): CancelInvoiceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelInvoiceResponseBuilder.php b/src/Models/Builders/CancelInvoiceResponseBuilder.php deleted file mode 100644 index a838d5b3..00000000 --- a/src/Models/Builders/CancelInvoiceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new CancelInvoiceResponse()); - } - - /** - * Sets invoice field. - * - * @param Invoice|null $value - */ - public function invoice(?Invoice $value): self - { - $this->instance->setInvoice($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Cancel Invoice Response object. - */ - public function build(): CancelInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelLoyaltyPromotionResponseBuilder.php b/src/Models/Builders/CancelLoyaltyPromotionResponseBuilder.php deleted file mode 100644 index daeb8e88..00000000 --- a/src/Models/Builders/CancelLoyaltyPromotionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Loyalty Promotion Response Builder object. - */ - public static function init(): self - { - return new self(new CancelLoyaltyPromotionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty promotion field. - * - * @param LoyaltyPromotion|null $value - */ - public function loyaltyPromotion(?LoyaltyPromotion $value): self - { - $this->instance->setLoyaltyPromotion($value); - return $this; - } - - /** - * Initializes a new Cancel Loyalty Promotion Response object. - */ - public function build(): CancelLoyaltyPromotionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelPaymentByIdempotencyKeyRequestBuilder.php b/src/Models/Builders/CancelPaymentByIdempotencyKeyRequestBuilder.php deleted file mode 100644 index 30e470b6..00000000 --- a/src/Models/Builders/CancelPaymentByIdempotencyKeyRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Payment By Idempotency Key Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new CancelPaymentByIdempotencyKeyRequest($idempotencyKey)); - } - - /** - * Initializes a new Cancel Payment By Idempotency Key Request object. - */ - public function build(): CancelPaymentByIdempotencyKeyRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelPaymentByIdempotencyKeyResponseBuilder.php b/src/Models/Builders/CancelPaymentByIdempotencyKeyResponseBuilder.php deleted file mode 100644 index 72d048ef..00000000 --- a/src/Models/Builders/CancelPaymentByIdempotencyKeyResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Payment By Idempotency Key Response Builder object. - */ - public static function init(): self - { - return new self(new CancelPaymentByIdempotencyKeyResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Cancel Payment By Idempotency Key Response object. - */ - public function build(): CancelPaymentByIdempotencyKeyResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelPaymentResponseBuilder.php b/src/Models/Builders/CancelPaymentResponseBuilder.php deleted file mode 100644 index 1bd039fa..00000000 --- a/src/Models/Builders/CancelPaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Payment Response Builder object. - */ - public static function init(): self - { - return new self(new CancelPaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Cancel Payment Response object. - */ - public function build(): CancelPaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelSubscriptionResponseBuilder.php b/src/Models/Builders/CancelSubscriptionResponseBuilder.php deleted file mode 100644 index b209305c..00000000 --- a/src/Models/Builders/CancelSubscriptionResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new CancelSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Initializes a new Cancel Subscription Response object. - */ - public function build(): CancelSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelTerminalActionResponseBuilder.php b/src/Models/Builders/CancelTerminalActionResponseBuilder.php deleted file mode 100644 index cf8e2e69..00000000 --- a/src/Models/Builders/CancelTerminalActionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Terminal Action Response Builder object. - */ - public static function init(): self - { - return new self(new CancelTerminalActionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets action field. - * - * @param TerminalAction|null $value - */ - public function action(?TerminalAction $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Initializes a new Cancel Terminal Action Response object. - */ - public function build(): CancelTerminalActionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelTerminalCheckoutResponseBuilder.php b/src/Models/Builders/CancelTerminalCheckoutResponseBuilder.php deleted file mode 100644 index a6beb276..00000000 --- a/src/Models/Builders/CancelTerminalCheckoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Terminal Checkout Response Builder object. - */ - public static function init(): self - { - return new self(new CancelTerminalCheckoutResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets checkout field. - * - * @param TerminalCheckout|null $value - */ - public function checkout(?TerminalCheckout $value): self - { - $this->instance->setCheckout($value); - return $this; - } - - /** - * Initializes a new Cancel Terminal Checkout Response object. - */ - public function build(): CancelTerminalCheckoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CancelTerminalRefundResponseBuilder.php b/src/Models/Builders/CancelTerminalRefundResponseBuilder.php deleted file mode 100644 index 94c535b5..00000000 --- a/src/Models/Builders/CancelTerminalRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cancel Terminal Refund Response Builder object. - */ - public static function init(): self - { - return new self(new CancelTerminalRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param TerminalRefund|null $value - */ - public function refund(?TerminalRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Cancel Terminal Refund Response object. - */ - public function build(): CancelTerminalRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CaptureTransactionResponseBuilder.php b/src/Models/Builders/CaptureTransactionResponseBuilder.php deleted file mode 100644 index ece70cd3..00000000 --- a/src/Models/Builders/CaptureTransactionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Capture Transaction Response Builder object. - */ - public static function init(): self - { - return new self(new CaptureTransactionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Capture Transaction Response object. - */ - public function build(): CaptureTransactionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CardBuilder.php b/src/Models/Builders/CardBuilder.php deleted file mode 100644 index 1e3e837f..00000000 --- a/src/Models/Builders/CardBuilder.php +++ /dev/null @@ -1,275 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Card Builder object. - */ - public static function init(): self - { - return new self(new Card()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets card brand field. - * - * @param string|null $value - */ - public function cardBrand(?string $value): self - { - $this->instance->setCardBrand($value); - return $this; - } - - /** - * Sets last 4 field. - * - * @param string|null $value - */ - public function last4(?string $value): self - { - $this->instance->setLast4($value); - return $this; - } - - /** - * Sets exp month field. - * - * @param int|null $value - */ - public function expMonth(?int $value): self - { - $this->instance->setExpMonth($value); - return $this; - } - - /** - * Unsets exp month field. - */ - public function unsetExpMonth(): self - { - $this->instance->unsetExpMonth(); - return $this; - } - - /** - * Sets exp year field. - * - * @param int|null $value - */ - public function expYear(?int $value): self - { - $this->instance->setExpYear($value); - return $this; - } - - /** - * Unsets exp year field. - */ - public function unsetExpYear(): self - { - $this->instance->unsetExpYear(); - return $this; - } - - /** - * Sets cardholder name field. - * - * @param string|null $value - */ - public function cardholderName(?string $value): self - { - $this->instance->setCardholderName($value); - return $this; - } - - /** - * Unsets cardholder name field. - */ - public function unsetCardholderName(): self - { - $this->instance->unsetCardholderName(); - return $this; - } - - /** - * Sets billing address field. - * - * @param Address|null $value - */ - public function billingAddress(?Address $value): self - { - $this->instance->setBillingAddress($value); - return $this; - } - - /** - * Sets fingerprint field. - * - * @param string|null $value - */ - public function fingerprint(?string $value): self - { - $this->instance->setFingerprint($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Sets card type field. - * - * @param string|null $value - */ - public function cardType(?string $value): self - { - $this->instance->setCardType($value); - return $this; - } - - /** - * Sets prepaid type field. - * - * @param string|null $value - */ - public function prepaidType(?string $value): self - { - $this->instance->setPrepaidType($value); - return $this; - } - - /** - * Sets bin field. - * - * @param string|null $value - */ - public function bin(?string $value): self - { - $this->instance->setBin($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets card co brand field. - * - * @param string|null $value - */ - public function cardCoBrand(?string $value): self - { - $this->instance->setCardCoBrand($value); - return $this; - } - - /** - * Initializes a new Card object. - */ - public function build(): Card - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CardPaymentDetailsBuilder.php b/src/Models/Builders/CardPaymentDetailsBuilder.php deleted file mode 100644 index bba8d887..00000000 --- a/src/Models/Builders/CardPaymentDetailsBuilder.php +++ /dev/null @@ -1,339 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Card Payment Details Builder object. - */ - public static function init(): self - { - return new self(new CardPaymentDetails()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Sets entry method field. - * - * @param string|null $value - */ - public function entryMethod(?string $value): self - { - $this->instance->setEntryMethod($value); - return $this; - } - - /** - * Unsets entry method field. - */ - public function unsetEntryMethod(): self - { - $this->instance->unsetEntryMethod(); - return $this; - } - - /** - * Sets cvv status field. - * - * @param string|null $value - */ - public function cvvStatus(?string $value): self - { - $this->instance->setCvvStatus($value); - return $this; - } - - /** - * Unsets cvv status field. - */ - public function unsetCvvStatus(): self - { - $this->instance->unsetCvvStatus(); - return $this; - } - - /** - * Sets avs status field. - * - * @param string|null $value - */ - public function avsStatus(?string $value): self - { - $this->instance->setAvsStatus($value); - return $this; - } - - /** - * Unsets avs status field. - */ - public function unsetAvsStatus(): self - { - $this->instance->unsetAvsStatus(); - return $this; - } - - /** - * Sets auth result code field. - * - * @param string|null $value - */ - public function authResultCode(?string $value): self - { - $this->instance->setAuthResultCode($value); - return $this; - } - - /** - * Unsets auth result code field. - */ - public function unsetAuthResultCode(): self - { - $this->instance->unsetAuthResultCode(); - return $this; - } - - /** - * Sets application identifier field. - * - * @param string|null $value - */ - public function applicationIdentifier(?string $value): self - { - $this->instance->setApplicationIdentifier($value); - return $this; - } - - /** - * Unsets application identifier field. - */ - public function unsetApplicationIdentifier(): self - { - $this->instance->unsetApplicationIdentifier(); - return $this; - } - - /** - * Sets application name field. - * - * @param string|null $value - */ - public function applicationName(?string $value): self - { - $this->instance->setApplicationName($value); - return $this; - } - - /** - * Unsets application name field. - */ - public function unsetApplicationName(): self - { - $this->instance->unsetApplicationName(); - return $this; - } - - /** - * Sets application cryptogram field. - * - * @param string|null $value - */ - public function applicationCryptogram(?string $value): self - { - $this->instance->setApplicationCryptogram($value); - return $this; - } - - /** - * Unsets application cryptogram field. - */ - public function unsetApplicationCryptogram(): self - { - $this->instance->unsetApplicationCryptogram(); - return $this; - } - - /** - * Sets verification method field. - * - * @param string|null $value - */ - public function verificationMethod(?string $value): self - { - $this->instance->setVerificationMethod($value); - return $this; - } - - /** - * Unsets verification method field. - */ - public function unsetVerificationMethod(): self - { - $this->instance->unsetVerificationMethod(); - return $this; - } - - /** - * Sets verification results field. - * - * @param string|null $value - */ - public function verificationResults(?string $value): self - { - $this->instance->setVerificationResults($value); - return $this; - } - - /** - * Unsets verification results field. - */ - public function unsetVerificationResults(): self - { - $this->instance->unsetVerificationResults(); - return $this; - } - - /** - * Sets statement description field. - * - * @param string|null $value - */ - public function statementDescription(?string $value): self - { - $this->instance->setStatementDescription($value); - return $this; - } - - /** - * Unsets statement description field. - */ - public function unsetStatementDescription(): self - { - $this->instance->unsetStatementDescription(); - return $this; - } - - /** - * Sets device details field. - * - * @param DeviceDetails|null $value - */ - public function deviceDetails(?DeviceDetails $value): self - { - $this->instance->setDeviceDetails($value); - return $this; - } - - /** - * Sets card payment timeline field. - * - * @param CardPaymentTimeline|null $value - */ - public function cardPaymentTimeline(?CardPaymentTimeline $value): self - { - $this->instance->setCardPaymentTimeline($value); - return $this; - } - - /** - * Sets refund requires card presence field. - * - * @param bool|null $value - */ - public function refundRequiresCardPresence(?bool $value): self - { - $this->instance->setRefundRequiresCardPresence($value); - return $this; - } - - /** - * Unsets refund requires card presence field. - */ - public function unsetRefundRequiresCardPresence(): self - { - $this->instance->unsetRefundRequiresCardPresence(); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Unsets errors field. - */ - public function unsetErrors(): self - { - $this->instance->unsetErrors(); - return $this; - } - - /** - * Initializes a new Card Payment Details object. - */ - public function build(): CardPaymentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CardPaymentTimelineBuilder.php b/src/Models/Builders/CardPaymentTimelineBuilder.php deleted file mode 100644 index f1cc107f..00000000 --- a/src/Models/Builders/CardPaymentTimelineBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Card Payment Timeline Builder object. - */ - public static function init(): self - { - return new self(new CardPaymentTimeline()); - } - - /** - * Sets authorized at field. - * - * @param string|null $value - */ - public function authorizedAt(?string $value): self - { - $this->instance->setAuthorizedAt($value); - return $this; - } - - /** - * Unsets authorized at field. - */ - public function unsetAuthorizedAt(): self - { - $this->instance->unsetAuthorizedAt(); - return $this; - } - - /** - * Sets captured at field. - * - * @param string|null $value - */ - public function capturedAt(?string $value): self - { - $this->instance->setCapturedAt($value); - return $this; - } - - /** - * Unsets captured at field. - */ - public function unsetCapturedAt(): self - { - $this->instance->unsetCapturedAt(); - return $this; - } - - /** - * Sets voided at field. - * - * @param string|null $value - */ - public function voidedAt(?string $value): self - { - $this->instance->setVoidedAt($value); - return $this; - } - - /** - * Unsets voided at field. - */ - public function unsetVoidedAt(): self - { - $this->instance->unsetVoidedAt(); - return $this; - } - - /** - * Initializes a new Card Payment Timeline object. - */ - public function build(): CardPaymentTimeline - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashAppDetailsBuilder.php b/src/Models/Builders/CashAppDetailsBuilder.php deleted file mode 100644 index 18977e0e..00000000 --- a/src/Models/Builders/CashAppDetailsBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash App Details Builder object. - */ - public static function init(): self - { - return new self(new CashAppDetails()); - } - - /** - * Sets buyer full name field. - * - * @param string|null $value - */ - public function buyerFullName(?string $value): self - { - $this->instance->setBuyerFullName($value); - return $this; - } - - /** - * Unsets buyer full name field. - */ - public function unsetBuyerFullName(): self - { - $this->instance->unsetBuyerFullName(); - return $this; - } - - /** - * Sets buyer country code field. - * - * @param string|null $value - */ - public function buyerCountryCode(?string $value): self - { - $this->instance->setBuyerCountryCode($value); - return $this; - } - - /** - * Unsets buyer country code field. - */ - public function unsetBuyerCountryCode(): self - { - $this->instance->unsetBuyerCountryCode(); - return $this; - } - - /** - * Sets buyer cashtag field. - * - * @param string|null $value - */ - public function buyerCashtag(?string $value): self - { - $this->instance->setBuyerCashtag($value); - return $this; - } - - /** - * Initializes a new Cash App Details object. - */ - public function build(): CashAppDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashDrawerDeviceBuilder.php b/src/Models/Builders/CashDrawerDeviceBuilder.php deleted file mode 100644 index b2c0908a..00000000 --- a/src/Models/Builders/CashDrawerDeviceBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash Drawer Device Builder object. - */ - public static function init(): self - { - return new self(new CashDrawerDevice()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new Cash Drawer Device object. - */ - public function build(): CashDrawerDevice - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashDrawerShiftBuilder.php b/src/Models/Builders/CashDrawerShiftBuilder.php deleted file mode 100644 index 11ebb4d0..00000000 --- a/src/Models/Builders/CashDrawerShiftBuilder.php +++ /dev/null @@ -1,311 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash Drawer Shift Builder object. - */ - public static function init(): self - { - return new self(new CashDrawerShift()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets opened at field. - * - * @param string|null $value - */ - public function openedAt(?string $value): self - { - $this->instance->setOpenedAt($value); - return $this; - } - - /** - * Unsets opened at field. - */ - public function unsetOpenedAt(): self - { - $this->instance->unsetOpenedAt(); - return $this; - } - - /** - * Sets ended at field. - * - * @param string|null $value - */ - public function endedAt(?string $value): self - { - $this->instance->setEndedAt($value); - return $this; - } - - /** - * Unsets ended at field. - */ - public function unsetEndedAt(): self - { - $this->instance->unsetEndedAt(); - return $this; - } - - /** - * Sets closed at field. - * - * @param string|null $value - */ - public function closedAt(?string $value): self - { - $this->instance->setClosedAt($value); - return $this; - } - - /** - * Unsets closed at field. - */ - public function unsetClosedAt(): self - { - $this->instance->unsetClosedAt(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets opened cash money field. - * - * @param Money|null $value - */ - public function openedCashMoney(?Money $value): self - { - $this->instance->setOpenedCashMoney($value); - return $this; - } - - /** - * Sets cash payment money field. - * - * @param Money|null $value - */ - public function cashPaymentMoney(?Money $value): self - { - $this->instance->setCashPaymentMoney($value); - return $this; - } - - /** - * Sets cash refunds money field. - * - * @param Money|null $value - */ - public function cashRefundsMoney(?Money $value): self - { - $this->instance->setCashRefundsMoney($value); - return $this; - } - - /** - * Sets cash paid in money field. - * - * @param Money|null $value - */ - public function cashPaidInMoney(?Money $value): self - { - $this->instance->setCashPaidInMoney($value); - return $this; - } - - /** - * Sets cash paid out money field. - * - * @param Money|null $value - */ - public function cashPaidOutMoney(?Money $value): self - { - $this->instance->setCashPaidOutMoney($value); - return $this; - } - - /** - * Sets expected cash money field. - * - * @param Money|null $value - */ - public function expectedCashMoney(?Money $value): self - { - $this->instance->setExpectedCashMoney($value); - return $this; - } - - /** - * Sets closed cash money field. - * - * @param Money|null $value - */ - public function closedCashMoney(?Money $value): self - { - $this->instance->setClosedCashMoney($value); - return $this; - } - - /** - * Sets device field. - * - * @param CashDrawerDevice|null $value - */ - public function device(?CashDrawerDevice $value): self - { - $this->instance->setDevice($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets team member ids field. - * - * @param string[]|null $value - */ - public function teamMemberIds(?array $value): self - { - $this->instance->setTeamMemberIds($value); - return $this; - } - - /** - * Sets opening team member id field. - * - * @param string|null $value - */ - public function openingTeamMemberId(?string $value): self - { - $this->instance->setOpeningTeamMemberId($value); - return $this; - } - - /** - * Sets ending team member id field. - * - * @param string|null $value - */ - public function endingTeamMemberId(?string $value): self - { - $this->instance->setEndingTeamMemberId($value); - return $this; - } - - /** - * Sets closing team member id field. - * - * @param string|null $value - */ - public function closingTeamMemberId(?string $value): self - { - $this->instance->setClosingTeamMemberId($value); - return $this; - } - - /** - * Initializes a new Cash Drawer Shift object. - */ - public function build(): CashDrawerShift - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashDrawerShiftEventBuilder.php b/src/Models/Builders/CashDrawerShiftEventBuilder.php deleted file mode 100644 index 8b5ec621..00000000 --- a/src/Models/Builders/CashDrawerShiftEventBuilder.php +++ /dev/null @@ -1,118 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash Drawer Shift Event Builder object. - */ - public static function init(): self - { - return new self(new CashDrawerShiftEvent()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets event type field. - * - * @param string|null $value - */ - public function eventType(?string $value): self - { - $this->instance->setEventType($value); - return $this; - } - - /** - * Sets event money field. - * - * @param Money|null $value - */ - public function eventMoney(?Money $value): self - { - $this->instance->setEventMoney($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Initializes a new Cash Drawer Shift Event object. - */ - public function build(): CashDrawerShiftEvent - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashDrawerShiftSummaryBuilder.php b/src/Models/Builders/CashDrawerShiftSummaryBuilder.php deleted file mode 100644 index 7ec3bc0e..00000000 --- a/src/Models/Builders/CashDrawerShiftSummaryBuilder.php +++ /dev/null @@ -1,211 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash Drawer Shift Summary Builder object. - */ - public static function init(): self - { - return new self(new CashDrawerShiftSummary()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets opened at field. - * - * @param string|null $value - */ - public function openedAt(?string $value): self - { - $this->instance->setOpenedAt($value); - return $this; - } - - /** - * Unsets opened at field. - */ - public function unsetOpenedAt(): self - { - $this->instance->unsetOpenedAt(); - return $this; - } - - /** - * Sets ended at field. - * - * @param string|null $value - */ - public function endedAt(?string $value): self - { - $this->instance->setEndedAt($value); - return $this; - } - - /** - * Unsets ended at field. - */ - public function unsetEndedAt(): self - { - $this->instance->unsetEndedAt(); - return $this; - } - - /** - * Sets closed at field. - * - * @param string|null $value - */ - public function closedAt(?string $value): self - { - $this->instance->setClosedAt($value); - return $this; - } - - /** - * Unsets closed at field. - */ - public function unsetClosedAt(): self - { - $this->instance->unsetClosedAt(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets opened cash money field. - * - * @param Money|null $value - */ - public function openedCashMoney(?Money $value): self - { - $this->instance->setOpenedCashMoney($value); - return $this; - } - - /** - * Sets expected cash money field. - * - * @param Money|null $value - */ - public function expectedCashMoney(?Money $value): self - { - $this->instance->setExpectedCashMoney($value); - return $this; - } - - /** - * Sets closed cash money field. - * - * @param Money|null $value - */ - public function closedCashMoney(?Money $value): self - { - $this->instance->setClosedCashMoney($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Initializes a new Cash Drawer Shift Summary object. - */ - public function build(): CashDrawerShiftSummary - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CashPaymentDetailsBuilder.php b/src/Models/Builders/CashPaymentDetailsBuilder.php deleted file mode 100644 index ab28ed66..00000000 --- a/src/Models/Builders/CashPaymentDetailsBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Cash Payment Details Builder object. - * - * @param Money $buyerSuppliedMoney - */ - public static function init(Money $buyerSuppliedMoney): self - { - return new self(new CashPaymentDetails($buyerSuppliedMoney)); - } - - /** - * Sets change back money field. - * - * @param Money|null $value - */ - public function changeBackMoney(?Money $value): self - { - $this->instance->setChangeBackMoney($value); - return $this; - } - - /** - * Initializes a new Cash Payment Details object. - */ - public function build(): CashPaymentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogAvailabilityPeriodBuilder.php b/src/Models/Builders/CatalogAvailabilityPeriodBuilder.php deleted file mode 100644 index 8fa55631..00000000 --- a/src/Models/Builders/CatalogAvailabilityPeriodBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Availability Period Builder object. - */ - public static function init(): self - { - return new self(new CatalogAvailabilityPeriod()); - } - - /** - * Sets start local time field. - * - * @param string|null $value - */ - public function startLocalTime(?string $value): self - { - $this->instance->setStartLocalTime($value); - return $this; - } - - /** - * Unsets start local time field. - */ - public function unsetStartLocalTime(): self - { - $this->instance->unsetStartLocalTime(); - return $this; - } - - /** - * Sets end local time field. - * - * @param string|null $value - */ - public function endLocalTime(?string $value): self - { - $this->instance->setEndLocalTime($value); - return $this; - } - - /** - * Unsets end local time field. - */ - public function unsetEndLocalTime(): self - { - $this->instance->unsetEndLocalTime(); - return $this; - } - - /** - * Sets day of week field. - * - * @param string|null $value - */ - public function dayOfWeek(?string $value): self - { - $this->instance->setDayOfWeek($value); - return $this; - } - - /** - * Initializes a new Catalog Availability Period object. - */ - public function build(): CatalogAvailabilityPeriod - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCategoryBuilder.php b/src/Models/Builders/CatalogCategoryBuilder.php deleted file mode 100644 index a1c6f4d2..00000000 --- a/src/Models/Builders/CatalogCategoryBuilder.php +++ /dev/null @@ -1,229 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Category Builder object. - */ - public static function init(): self - { - return new self(new CatalogCategory()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets image ids field. - * - * @param string[]|null $value - */ - public function imageIds(?array $value): self - { - $this->instance->setImageIds($value); - return $this; - } - - /** - * Unsets image ids field. - */ - public function unsetImageIds(): self - { - $this->instance->unsetImageIds(); - return $this; - } - - /** - * Sets category type field. - * - * @param string|null $value - */ - public function categoryType(?string $value): self - { - $this->instance->setCategoryType($value); - return $this; - } - - /** - * Sets parent category field. - * - * @param CatalogObjectCategory|null $value - */ - public function parentCategory(?CatalogObjectCategory $value): self - { - $this->instance->setParentCategory($value); - return $this; - } - - /** - * Sets is top level field. - * - * @param bool|null $value - */ - public function isTopLevel(?bool $value): self - { - $this->instance->setIsTopLevel($value); - return $this; - } - - /** - * Unsets is top level field. - */ - public function unsetIsTopLevel(): self - { - $this->instance->unsetIsTopLevel(); - return $this; - } - - /** - * Sets channels field. - * - * @param string[]|null $value - */ - public function channels(?array $value): self - { - $this->instance->setChannels($value); - return $this; - } - - /** - * Unsets channels field. - */ - public function unsetChannels(): self - { - $this->instance->unsetChannels(); - return $this; - } - - /** - * Sets availability period ids field. - * - * @param string[]|null $value - */ - public function availabilityPeriodIds(?array $value): self - { - $this->instance->setAvailabilityPeriodIds($value); - return $this; - } - - /** - * Unsets availability period ids field. - */ - public function unsetAvailabilityPeriodIds(): self - { - $this->instance->unsetAvailabilityPeriodIds(); - return $this; - } - - /** - * Sets online visibility field. - * - * @param bool|null $value - */ - public function onlineVisibility(?bool $value): self - { - $this->instance->setOnlineVisibility($value); - return $this; - } - - /** - * Unsets online visibility field. - */ - public function unsetOnlineVisibility(): self - { - $this->instance->unsetOnlineVisibility(); - return $this; - } - - /** - * Sets root category field. - * - * @param string|null $value - */ - public function rootCategory(?string $value): self - { - $this->instance->setRootCategory($value); - return $this; - } - - /** - * Sets ecom seo data field. - * - * @param CatalogEcomSeoData|null $value - */ - public function ecomSeoData(?CatalogEcomSeoData $value): self - { - $this->instance->setEcomSeoData($value); - return $this; - } - - /** - * Sets path to root field. - * - * @param CategoryPathToRootNode[]|null $value - */ - public function pathToRoot(?array $value): self - { - $this->instance->setPathToRoot($value); - return $this; - } - - /** - * Unsets path to root field. - */ - public function unsetPathToRoot(): self - { - $this->instance->unsetPathToRoot(); - return $this; - } - - /** - * Initializes a new Catalog Category object. - */ - public function build(): CatalogCategory - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeDefinitionBuilder.php b/src/Models/Builders/CatalogCustomAttributeDefinitionBuilder.php deleted file mode 100644 index 0facc903..00000000 --- a/src/Models/Builders/CatalogCustomAttributeDefinitionBuilder.php +++ /dev/null @@ -1,167 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Builder object. - * - * @param string $type - * @param string $name - * @param string[] $allowedObjectTypes - */ - public static function init(string $type, string $name, array $allowedObjectTypes): self - { - return new self(new CatalogCustomAttributeDefinition($type, $name, $allowedObjectTypes)); - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets source application field. - * - * @param SourceApplication|null $value - */ - public function sourceApplication(?SourceApplication $value): self - { - $this->instance->setSourceApplication($value); - return $this; - } - - /** - * Sets seller visibility field. - * - * @param string|null $value - */ - public function sellerVisibility(?string $value): self - { - $this->instance->setSellerVisibility($value); - return $this; - } - - /** - * Sets app visibility field. - * - * @param string|null $value - */ - public function appVisibility(?string $value): self - { - $this->instance->setAppVisibility($value); - return $this; - } - - /** - * Sets string config field. - * - * @param CatalogCustomAttributeDefinitionStringConfig|null $value - */ - public function stringConfig(?CatalogCustomAttributeDefinitionStringConfig $value): self - { - $this->instance->setStringConfig($value); - return $this; - } - - /** - * Sets number config field. - * - * @param CatalogCustomAttributeDefinitionNumberConfig|null $value - */ - public function numberConfig(?CatalogCustomAttributeDefinitionNumberConfig $value): self - { - $this->instance->setNumberConfig($value); - return $this; - } - - /** - * Sets selection config field. - * - * @param CatalogCustomAttributeDefinitionSelectionConfig|null $value - */ - public function selectionConfig(?CatalogCustomAttributeDefinitionSelectionConfig $value): self - { - $this->instance->setSelectionConfig($value); - return $this; - } - - /** - * Sets custom attribute usage count field. - * - * @param int|null $value - */ - public function customAttributeUsageCount(?int $value): self - { - $this->instance->setCustomAttributeUsageCount($value); - return $this; - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Unsets key field. - */ - public function unsetKey(): self - { - $this->instance->unsetKey(); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Definition object. - */ - public function build(): CatalogCustomAttributeDefinition - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeDefinitionNumberConfigBuilder.php b/src/Models/Builders/CatalogCustomAttributeDefinitionNumberConfigBuilder.php deleted file mode 100644 index f155ba4e..00000000 --- a/src/Models/Builders/CatalogCustomAttributeDefinitionNumberConfigBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Number Config Builder object. - */ - public static function init(): self - { - return new self(new CatalogCustomAttributeDefinitionNumberConfig()); - } - - /** - * Sets precision field. - * - * @param int|null $value - */ - public function precision(?int $value): self - { - $this->instance->setPrecision($value); - return $this; - } - - /** - * Unsets precision field. - */ - public function unsetPrecision(): self - { - $this->instance->unsetPrecision(); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Number Config object. - */ - public function build(): CatalogCustomAttributeDefinitionNumberConfig - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigBuilder.php b/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigBuilder.php deleted file mode 100644 index f761d19a..00000000 --- a/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigBuilder.php +++ /dev/null @@ -1,83 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Selection Config Builder object. - */ - public static function init(): self - { - return new self(new CatalogCustomAttributeDefinitionSelectionConfig()); - } - - /** - * Sets max allowed selections field. - * - * @param int|null $value - */ - public function maxAllowedSelections(?int $value): self - { - $this->instance->setMaxAllowedSelections($value); - return $this; - } - - /** - * Unsets max allowed selections field. - */ - public function unsetMaxAllowedSelections(): self - { - $this->instance->unsetMaxAllowedSelections(); - return $this; - } - - /** - * Sets allowed selections field. - * - * @param CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[]|null $value - */ - public function allowedSelections(?array $value): self - { - $this->instance->setAllowedSelections($value); - return $this; - } - - /** - * Unsets allowed selections field. - */ - public function unsetAllowedSelections(): self - { - $this->instance->unsetAllowedSelections(); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Selection Config object. - */ - public function build(): CatalogCustomAttributeDefinitionSelectionConfig - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelectionBuilder.php b/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelectionBuilder.php deleted file mode 100644 index 9d92876c..00000000 --- a/src/Models/Builders/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelectionBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Selection Config Custom Attribute Selection - * Builder object. - * - * @param string $name - */ - public static function init(string $name): self - { - return new self(new CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection($name)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Definition Selection Config Custom Attribute Selection - * object. - */ - public function build(): CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeDefinitionStringConfigBuilder.php b/src/Models/Builders/CatalogCustomAttributeDefinitionStringConfigBuilder.php deleted file mode 100644 index d07d5d23..00000000 --- a/src/Models/Builders/CatalogCustomAttributeDefinitionStringConfigBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Definition String Config Builder object. - */ - public static function init(): self - { - return new self(new CatalogCustomAttributeDefinitionStringConfig()); - } - - /** - * Sets enforce uniqueness field. - * - * @param bool|null $value - */ - public function enforceUniqueness(?bool $value): self - { - $this->instance->setEnforceUniqueness($value); - return $this; - } - - /** - * Unsets enforce uniqueness field. - */ - public function unsetEnforceUniqueness(): self - { - $this->instance->unsetEnforceUniqueness(); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Definition String Config object. - */ - public function build(): CatalogCustomAttributeDefinitionStringConfig - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogCustomAttributeValueBuilder.php b/src/Models/Builders/CatalogCustomAttributeValueBuilder.php deleted file mode 100644 index 046041e1..00000000 --- a/src/Models/Builders/CatalogCustomAttributeValueBuilder.php +++ /dev/null @@ -1,175 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Custom Attribute Value Builder object. - */ - public static function init(): self - { - return new self(new CatalogCustomAttributeValue()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets string value field. - * - * @param string|null $value - */ - public function stringValue(?string $value): self - { - $this->instance->setStringValue($value); - return $this; - } - - /** - * Unsets string value field. - */ - public function unsetStringValue(): self - { - $this->instance->unsetStringValue(); - return $this; - } - - /** - * Sets custom attribute definition id field. - * - * @param string|null $value - */ - public function customAttributeDefinitionId(?string $value): self - { - $this->instance->setCustomAttributeDefinitionId($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets number value field. - * - * @param string|null $value - */ - public function numberValue(?string $value): self - { - $this->instance->setNumberValue($value); - return $this; - } - - /** - * Unsets number value field. - */ - public function unsetNumberValue(): self - { - $this->instance->unsetNumberValue(); - return $this; - } - - /** - * Sets boolean value field. - * - * @param bool|null $value - */ - public function booleanValue(?bool $value): self - { - $this->instance->setBooleanValue($value); - return $this; - } - - /** - * Unsets boolean value field. - */ - public function unsetBooleanValue(): self - { - $this->instance->unsetBooleanValue(); - return $this; - } - - /** - * Sets selection uid values field. - * - * @param string[]|null $value - */ - public function selectionUidValues(?array $value): self - { - $this->instance->setSelectionUidValues($value); - return $this; - } - - /** - * Unsets selection uid values field. - */ - public function unsetSelectionUidValues(): self - { - $this->instance->unsetSelectionUidValues(); - return $this; - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Initializes a new Catalog Custom Attribute Value object. - */ - public function build(): CatalogCustomAttributeValue - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogDiscountBuilder.php b/src/Models/Builders/CatalogDiscountBuilder.php deleted file mode 100644 index 017c5952..00000000 --- a/src/Models/Builders/CatalogDiscountBuilder.php +++ /dev/null @@ -1,167 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Discount Builder object. - */ - public static function init(): self - { - return new self(new CatalogDiscount()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets discount type field. - * - * @param string|null $value - */ - public function discountType(?string $value): self - { - $this->instance->setDiscountType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets pin required field. - * - * @param bool|null $value - */ - public function pinRequired(?bool $value): self - { - $this->instance->setPinRequired($value); - return $this; - } - - /** - * Unsets pin required field. - */ - public function unsetPinRequired(): self - { - $this->instance->unsetPinRequired(); - return $this; - } - - /** - * Sets label color field. - * - * @param string|null $value - */ - public function labelColor(?string $value): self - { - $this->instance->setLabelColor($value); - return $this; - } - - /** - * Unsets label color field. - */ - public function unsetLabelColor(): self - { - $this->instance->unsetLabelColor(); - return $this; - } - - /** - * Sets modify tax basis field. - * - * @param string|null $value - */ - public function modifyTaxBasis(?string $value): self - { - $this->instance->setModifyTaxBasis($value); - return $this; - } - - /** - * Sets maximum amount money field. - * - * @param Money|null $value - */ - public function maximumAmountMoney(?Money $value): self - { - $this->instance->setMaximumAmountMoney($value); - return $this; - } - - /** - * Initializes a new Catalog Discount object. - */ - public function build(): CatalogDiscount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogEcomSeoDataBuilder.php b/src/Models/Builders/CatalogEcomSeoDataBuilder.php deleted file mode 100644 index f65ef7db..00000000 --- a/src/Models/Builders/CatalogEcomSeoDataBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Ecom Seo Data Builder object. - */ - public static function init(): self - { - return new self(new CatalogEcomSeoData()); - } - - /** - * Sets page title field. - * - * @param string|null $value - */ - public function pageTitle(?string $value): self - { - $this->instance->setPageTitle($value); - return $this; - } - - /** - * Unsets page title field. - */ - public function unsetPageTitle(): self - { - $this->instance->unsetPageTitle(); - return $this; - } - - /** - * Sets page description field. - * - * @param string|null $value - */ - public function pageDescription(?string $value): self - { - $this->instance->setPageDescription($value); - return $this; - } - - /** - * Unsets page description field. - */ - public function unsetPageDescription(): self - { - $this->instance->unsetPageDescription(); - return $this; - } - - /** - * Sets permalink field. - * - * @param string|null $value - */ - public function permalink(?string $value): self - { - $this->instance->setPermalink($value); - return $this; - } - - /** - * Unsets permalink field. - */ - public function unsetPermalink(): self - { - $this->instance->unsetPermalink(); - return $this; - } - - /** - * Initializes a new Catalog Ecom Seo Data object. - */ - public function build(): CatalogEcomSeoData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogIdMappingBuilder.php b/src/Models/Builders/CatalogIdMappingBuilder.php deleted file mode 100644 index bd308b75..00000000 --- a/src/Models/Builders/CatalogIdMappingBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Id Mapping Builder object. - */ - public static function init(): self - { - return new self(new CatalogIdMapping()); - } - - /** - * Sets client object id field. - * - * @param string|null $value - */ - public function clientObjectId(?string $value): self - { - $this->instance->setClientObjectId($value); - return $this; - } - - /** - * Unsets client object id field. - */ - public function unsetClientObjectId(): self - { - $this->instance->unsetClientObjectId(); - return $this; - } - - /** - * Sets object id field. - * - * @param string|null $value - */ - public function objectId(?string $value): self - { - $this->instance->setObjectId($value); - return $this; - } - - /** - * Unsets object id field. - */ - public function unsetObjectId(): self - { - $this->instance->unsetObjectId(); - return $this; - } - - /** - * Initializes a new Catalog Id Mapping object. - */ - public function build(): CatalogIdMapping - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogImageBuilder.php b/src/Models/Builders/CatalogImageBuilder.php deleted file mode 100644 index af6132aa..00000000 --- a/src/Models/Builders/CatalogImageBuilder.php +++ /dev/null @@ -1,122 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Image Builder object. - */ - public static function init(): self - { - return new self(new CatalogImage()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets url field. - * - * @param string|null $value - */ - public function url(?string $value): self - { - $this->instance->setUrl($value); - return $this; - } - - /** - * Unsets url field. - */ - public function unsetUrl(): self - { - $this->instance->unsetUrl(); - return $this; - } - - /** - * Sets caption field. - * - * @param string|null $value - */ - public function caption(?string $value): self - { - $this->instance->setCaption($value); - return $this; - } - - /** - * Unsets caption field. - */ - public function unsetCaption(): self - { - $this->instance->unsetCaption(); - return $this; - } - - /** - * Sets photo studio order id field. - * - * @param string|null $value - */ - public function photoStudioOrderId(?string $value): self - { - $this->instance->setPhotoStudioOrderId($value); - return $this; - } - - /** - * Unsets photo studio order id field. - */ - public function unsetPhotoStudioOrderId(): self - { - $this->instance->unsetPhotoStudioOrderId(); - return $this; - } - - /** - * Initializes a new Catalog Image object. - */ - public function build(): CatalogImage - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogInfoResponseBuilder.php b/src/Models/Builders/CatalogInfoResponseBuilder.php deleted file mode 100644 index 5dd6328d..00000000 --- a/src/Models/Builders/CatalogInfoResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Info Response Builder object. - */ - public static function init(): self - { - return new self(new CatalogInfoResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets limits field. - * - * @param CatalogInfoResponseLimits|null $value - */ - public function limits(?CatalogInfoResponseLimits $value): self - { - $this->instance->setLimits($value); - return $this; - } - - /** - * Sets standard unit description group field. - * - * @param StandardUnitDescriptionGroup|null $value - */ - public function standardUnitDescriptionGroup(?StandardUnitDescriptionGroup $value): self - { - $this->instance->setStandardUnitDescriptionGroup($value); - return $this; - } - - /** - * Initializes a new Catalog Info Response object. - */ - public function build(): CatalogInfoResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogInfoResponseLimitsBuilder.php b/src/Models/Builders/CatalogInfoResponseLimitsBuilder.php deleted file mode 100644 index c06179ed..00000000 --- a/src/Models/Builders/CatalogInfoResponseLimitsBuilder.php +++ /dev/null @@ -1,262 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Info Response Limits Builder object. - */ - public static function init(): self - { - return new self(new CatalogInfoResponseLimits()); - } - - /** - * Sets batch upsert max objects per batch field. - * - * @param int|null $value - */ - public function batchUpsertMaxObjectsPerBatch(?int $value): self - { - $this->instance->setBatchUpsertMaxObjectsPerBatch($value); - return $this; - } - - /** - * Unsets batch upsert max objects per batch field. - */ - public function unsetBatchUpsertMaxObjectsPerBatch(): self - { - $this->instance->unsetBatchUpsertMaxObjectsPerBatch(); - return $this; - } - - /** - * Sets batch upsert max total objects field. - * - * @param int|null $value - */ - public function batchUpsertMaxTotalObjects(?int $value): self - { - $this->instance->setBatchUpsertMaxTotalObjects($value); - return $this; - } - - /** - * Unsets batch upsert max total objects field. - */ - public function unsetBatchUpsertMaxTotalObjects(): self - { - $this->instance->unsetBatchUpsertMaxTotalObjects(); - return $this; - } - - /** - * Sets batch retrieve max object ids field. - * - * @param int|null $value - */ - public function batchRetrieveMaxObjectIds(?int $value): self - { - $this->instance->setBatchRetrieveMaxObjectIds($value); - return $this; - } - - /** - * Unsets batch retrieve max object ids field. - */ - public function unsetBatchRetrieveMaxObjectIds(): self - { - $this->instance->unsetBatchRetrieveMaxObjectIds(); - return $this; - } - - /** - * Sets search max page limit field. - * - * @param int|null $value - */ - public function searchMaxPageLimit(?int $value): self - { - $this->instance->setSearchMaxPageLimit($value); - return $this; - } - - /** - * Unsets search max page limit field. - */ - public function unsetSearchMaxPageLimit(): self - { - $this->instance->unsetSearchMaxPageLimit(); - return $this; - } - - /** - * Sets batch delete max object ids field. - * - * @param int|null $value - */ - public function batchDeleteMaxObjectIds(?int $value): self - { - $this->instance->setBatchDeleteMaxObjectIds($value); - return $this; - } - - /** - * Unsets batch delete max object ids field. - */ - public function unsetBatchDeleteMaxObjectIds(): self - { - $this->instance->unsetBatchDeleteMaxObjectIds(); - return $this; - } - - /** - * Sets update item taxes max item ids field. - * - * @param int|null $value - */ - public function updateItemTaxesMaxItemIds(?int $value): self - { - $this->instance->setUpdateItemTaxesMaxItemIds($value); - return $this; - } - - /** - * Unsets update item taxes max item ids field. - */ - public function unsetUpdateItemTaxesMaxItemIds(): self - { - $this->instance->unsetUpdateItemTaxesMaxItemIds(); - return $this; - } - - /** - * Sets update item taxes max taxes to enable field. - * - * @param int|null $value - */ - public function updateItemTaxesMaxTaxesToEnable(?int $value): self - { - $this->instance->setUpdateItemTaxesMaxTaxesToEnable($value); - return $this; - } - - /** - * Unsets update item taxes max taxes to enable field. - */ - public function unsetUpdateItemTaxesMaxTaxesToEnable(): self - { - $this->instance->unsetUpdateItemTaxesMaxTaxesToEnable(); - return $this; - } - - /** - * Sets update item taxes max taxes to disable field. - * - * @param int|null $value - */ - public function updateItemTaxesMaxTaxesToDisable(?int $value): self - { - $this->instance->setUpdateItemTaxesMaxTaxesToDisable($value); - return $this; - } - - /** - * Unsets update item taxes max taxes to disable field. - */ - public function unsetUpdateItemTaxesMaxTaxesToDisable(): self - { - $this->instance->unsetUpdateItemTaxesMaxTaxesToDisable(); - return $this; - } - - /** - * Sets update item modifier lists max item ids field. - * - * @param int|null $value - */ - public function updateItemModifierListsMaxItemIds(?int $value): self - { - $this->instance->setUpdateItemModifierListsMaxItemIds($value); - return $this; - } - - /** - * Unsets update item modifier lists max item ids field. - */ - public function unsetUpdateItemModifierListsMaxItemIds(): self - { - $this->instance->unsetUpdateItemModifierListsMaxItemIds(); - return $this; - } - - /** - * Sets update item modifier lists max modifier lists to enable field. - * - * @param int|null $value - */ - public function updateItemModifierListsMaxModifierListsToEnable(?int $value): self - { - $this->instance->setUpdateItemModifierListsMaxModifierListsToEnable($value); - return $this; - } - - /** - * Unsets update item modifier lists max modifier lists to enable field. - */ - public function unsetUpdateItemModifierListsMaxModifierListsToEnable(): self - { - $this->instance->unsetUpdateItemModifierListsMaxModifierListsToEnable(); - return $this; - } - - /** - * Sets update item modifier lists max modifier lists to disable field. - * - * @param int|null $value - */ - public function updateItemModifierListsMaxModifierListsToDisable(?int $value): self - { - $this->instance->setUpdateItemModifierListsMaxModifierListsToDisable($value); - return $this; - } - - /** - * Unsets update item modifier lists max modifier lists to disable field. - */ - public function unsetUpdateItemModifierListsMaxModifierListsToDisable(): self - { - $this->instance->unsetUpdateItemModifierListsMaxModifierListsToDisable(); - return $this; - } - - /** - * Initializes a new Catalog Info Response Limits object. - */ - public function build(): CatalogInfoResponseLimits - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemBuilder.php b/src/Models/Builders/CatalogItemBuilder.php deleted file mode 100644 index 37af4f97..00000000 --- a/src/Models/Builders/CatalogItemBuilder.php +++ /dev/null @@ -1,503 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Builder object. - */ - public static function init(): self - { - return new self(new CatalogItem()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets abbreviation field. - * - * @param string|null $value - */ - public function abbreviation(?string $value): self - { - $this->instance->setAbbreviation($value); - return $this; - } - - /** - * Unsets abbreviation field. - */ - public function unsetAbbreviation(): self - { - $this->instance->unsetAbbreviation(); - return $this; - } - - /** - * Sets label color field. - * - * @param string|null $value - */ - public function labelColor(?string $value): self - { - $this->instance->setLabelColor($value); - return $this; - } - - /** - * Unsets label color field. - */ - public function unsetLabelColor(): self - { - $this->instance->unsetLabelColor(); - return $this; - } - - /** - * Sets is taxable field. - * - * @param bool|null $value - */ - public function isTaxable(?bool $value): self - { - $this->instance->setIsTaxable($value); - return $this; - } - - /** - * Unsets is taxable field. - */ - public function unsetIsTaxable(): self - { - $this->instance->unsetIsTaxable(); - return $this; - } - - /** - * Sets available online field. - * - * @param bool|null $value - */ - public function availableOnline(?bool $value): self - { - $this->instance->setAvailableOnline($value); - return $this; - } - - /** - * Unsets available online field. - */ - public function unsetAvailableOnline(): self - { - $this->instance->unsetAvailableOnline(); - return $this; - } - - /** - * Sets available for pickup field. - * - * @param bool|null $value - */ - public function availableForPickup(?bool $value): self - { - $this->instance->setAvailableForPickup($value); - return $this; - } - - /** - * Unsets available for pickup field. - */ - public function unsetAvailableForPickup(): self - { - $this->instance->unsetAvailableForPickup(); - return $this; - } - - /** - * Sets available electronically field. - * - * @param bool|null $value - */ - public function availableElectronically(?bool $value): self - { - $this->instance->setAvailableElectronically($value); - return $this; - } - - /** - * Unsets available electronically field. - */ - public function unsetAvailableElectronically(): self - { - $this->instance->unsetAvailableElectronically(); - return $this; - } - - /** - * Sets category id field. - * - * @param string|null $value - */ - public function categoryId(?string $value): self - { - $this->instance->setCategoryId($value); - return $this; - } - - /** - * Unsets category id field. - */ - public function unsetCategoryId(): self - { - $this->instance->unsetCategoryId(); - return $this; - } - - /** - * Sets tax ids field. - * - * @param string[]|null $value - */ - public function taxIds(?array $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Unsets tax ids field. - */ - public function unsetTaxIds(): self - { - $this->instance->unsetTaxIds(); - return $this; - } - - /** - * Sets modifier list info field. - * - * @param CatalogItemModifierListInfo[]|null $value - */ - public function modifierListInfo(?array $value): self - { - $this->instance->setModifierListInfo($value); - return $this; - } - - /** - * Unsets modifier list info field. - */ - public function unsetModifierListInfo(): self - { - $this->instance->unsetModifierListInfo(); - return $this; - } - - /** - * Sets variations field. - * - * @param CatalogObject[]|null $value - */ - public function variations(?array $value): self - { - $this->instance->setVariations($value); - return $this; - } - - /** - * Unsets variations field. - */ - public function unsetVariations(): self - { - $this->instance->unsetVariations(); - return $this; - } - - /** - * Sets product type field. - * - * @param string|null $value - */ - public function productType(?string $value): self - { - $this->instance->setProductType($value); - return $this; - } - - /** - * Sets skip modifier screen field. - * - * @param bool|null $value - */ - public function skipModifierScreen(?bool $value): self - { - $this->instance->setSkipModifierScreen($value); - return $this; - } - - /** - * Unsets skip modifier screen field. - */ - public function unsetSkipModifierScreen(): self - { - $this->instance->unsetSkipModifierScreen(); - return $this; - } - - /** - * Sets item options field. - * - * @param CatalogItemOptionForItem[]|null $value - */ - public function itemOptions(?array $value): self - { - $this->instance->setItemOptions($value); - return $this; - } - - /** - * Unsets item options field. - */ - public function unsetItemOptions(): self - { - $this->instance->unsetItemOptions(); - return $this; - } - - /** - * Sets image ids field. - * - * @param string[]|null $value - */ - public function imageIds(?array $value): self - { - $this->instance->setImageIds($value); - return $this; - } - - /** - * Unsets image ids field. - */ - public function unsetImageIds(): self - { - $this->instance->unsetImageIds(); - return $this; - } - - /** - * Sets sort name field. - * - * @param string|null $value - */ - public function sortName(?string $value): self - { - $this->instance->setSortName($value); - return $this; - } - - /** - * Unsets sort name field. - */ - public function unsetSortName(): self - { - $this->instance->unsetSortName(); - return $this; - } - - /** - * Sets categories field. - * - * @param CatalogObjectCategory[]|null $value - */ - public function categories(?array $value): self - { - $this->instance->setCategories($value); - return $this; - } - - /** - * Unsets categories field. - */ - public function unsetCategories(): self - { - $this->instance->unsetCategories(); - return $this; - } - - /** - * Sets description html field. - * - * @param string|null $value - */ - public function descriptionHtml(?string $value): self - { - $this->instance->setDescriptionHtml($value); - return $this; - } - - /** - * Unsets description html field. - */ - public function unsetDescriptionHtml(): self - { - $this->instance->unsetDescriptionHtml(); - return $this; - } - - /** - * Sets description plaintext field. - * - * @param string|null $value - */ - public function descriptionPlaintext(?string $value): self - { - $this->instance->setDescriptionPlaintext($value); - return $this; - } - - /** - * Sets channels field. - * - * @param string[]|null $value - */ - public function channels(?array $value): self - { - $this->instance->setChannels($value); - return $this; - } - - /** - * Unsets channels field. - */ - public function unsetChannels(): self - { - $this->instance->unsetChannels(); - return $this; - } - - /** - * Sets is archived field. - * - * @param bool|null $value - */ - public function isArchived(?bool $value): self - { - $this->instance->setIsArchived($value); - return $this; - } - - /** - * Unsets is archived field. - */ - public function unsetIsArchived(): self - { - $this->instance->unsetIsArchived(); - return $this; - } - - /** - * Sets ecom seo data field. - * - * @param CatalogEcomSeoData|null $value - */ - public function ecomSeoData(?CatalogEcomSeoData $value): self - { - $this->instance->setEcomSeoData($value); - return $this; - } - - /** - * Sets food and beverage details field. - * - * @param CatalogItemFoodAndBeverageDetails|null $value - */ - public function foodAndBeverageDetails(?CatalogItemFoodAndBeverageDetails $value): self - { - $this->instance->setFoodAndBeverageDetails($value); - return $this; - } - - /** - * Sets reporting category field. - * - * @param CatalogObjectCategory|null $value - */ - public function reportingCategory(?CatalogObjectCategory $value): self - { - $this->instance->setReportingCategory($value); - return $this; - } - - /** - * Initializes a new Catalog Item object. - */ - public function build(): CatalogItem - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsBuilder.php b/src/Models/Builders/CatalogItemFoodAndBeverageDetailsBuilder.php deleted file mode 100644 index 2ba8d1b8..00000000 --- a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsBuilder.php +++ /dev/null @@ -1,104 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemFoodAndBeverageDetails()); - } - - /** - * Sets calorie count field. - * - * @param int|null $value - */ - public function calorieCount(?int $value): self - { - $this->instance->setCalorieCount($value); - return $this; - } - - /** - * Unsets calorie count field. - */ - public function unsetCalorieCount(): self - { - $this->instance->unsetCalorieCount(); - return $this; - } - - /** - * Sets dietary preferences field. - * - * @param CatalogItemFoodAndBeverageDetailsDietaryPreference[]|null $value - */ - public function dietaryPreferences(?array $value): self - { - $this->instance->setDietaryPreferences($value); - return $this; - } - - /** - * Unsets dietary preferences field. - */ - public function unsetDietaryPreferences(): self - { - $this->instance->unsetDietaryPreferences(); - return $this; - } - - /** - * Sets ingredients field. - * - * @param CatalogItemFoodAndBeverageDetailsIngredient[]|null $value - */ - public function ingredients(?array $value): self - { - $this->instance->setIngredients($value); - return $this; - } - - /** - * Unsets ingredients field. - */ - public function unsetIngredients(): self - { - $this->instance->unsetIngredients(); - return $this; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details object. - */ - public function build(): CatalogItemFoodAndBeverageDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsDietaryPreferenceBuilder.php b/src/Models/Builders/CatalogItemFoodAndBeverageDetailsDietaryPreferenceBuilder.php deleted file mode 100644 index 3cd77b7a..00000000 --- a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsDietaryPreferenceBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details Dietary Preference Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemFoodAndBeverageDetailsDietaryPreference()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets standard name field. - * - * @param string|null $value - */ - public function standardName(?string $value): self - { - $this->instance->setStandardName($value); - return $this; - } - - /** - * Sets custom name field. - * - * @param string|null $value - */ - public function customName(?string $value): self - { - $this->instance->setCustomName($value); - return $this; - } - - /** - * Unsets custom name field. - */ - public function unsetCustomName(): self - { - $this->instance->unsetCustomName(); - return $this; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details Dietary Preference object. - */ - public function build(): CatalogItemFoodAndBeverageDetailsDietaryPreference - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsIngredientBuilder.php b/src/Models/Builders/CatalogItemFoodAndBeverageDetailsIngredientBuilder.php deleted file mode 100644 index e172d678..00000000 --- a/src/Models/Builders/CatalogItemFoodAndBeverageDetailsIngredientBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details Ingredient Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemFoodAndBeverageDetailsIngredient()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets standard name field. - * - * @param string|null $value - */ - public function standardName(?string $value): self - { - $this->instance->setStandardName($value); - return $this; - } - - /** - * Sets custom name field. - * - * @param string|null $value - */ - public function customName(?string $value): self - { - $this->instance->setCustomName($value); - return $this; - } - - /** - * Unsets custom name field. - */ - public function unsetCustomName(): self - { - $this->instance->unsetCustomName(); - return $this; - } - - /** - * Initializes a new Catalog Item Food And Beverage Details Ingredient object. - */ - public function build(): CatalogItemFoodAndBeverageDetailsIngredient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemModifierListInfoBuilder.php b/src/Models/Builders/CatalogItemModifierListInfoBuilder.php deleted file mode 100644 index ade3b943..00000000 --- a/src/Models/Builders/CatalogItemModifierListInfoBuilder.php +++ /dev/null @@ -1,145 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Modifier List Info Builder object. - * - * @param string $modifierListId - */ - public static function init(string $modifierListId): self - { - return new self(new CatalogItemModifierListInfo($modifierListId)); - } - - /** - * Sets modifier overrides field. - * - * @param CatalogModifierOverride[]|null $value - */ - public function modifierOverrides(?array $value): self - { - $this->instance->setModifierOverrides($value); - return $this; - } - - /** - * Unsets modifier overrides field. - */ - public function unsetModifierOverrides(): self - { - $this->instance->unsetModifierOverrides(); - return $this; - } - - /** - * Sets min selected modifiers field. - * - * @param int|null $value - */ - public function minSelectedModifiers(?int $value): self - { - $this->instance->setMinSelectedModifiers($value); - return $this; - } - - /** - * Unsets min selected modifiers field. - */ - public function unsetMinSelectedModifiers(): self - { - $this->instance->unsetMinSelectedModifiers(); - return $this; - } - - /** - * Sets max selected modifiers field. - * - * @param int|null $value - */ - public function maxSelectedModifiers(?int $value): self - { - $this->instance->setMaxSelectedModifiers($value); - return $this; - } - - /** - * Unsets max selected modifiers field. - */ - public function unsetMaxSelectedModifiers(): self - { - $this->instance->unsetMaxSelectedModifiers(); - return $this; - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Unsets enabled field. - */ - public function unsetEnabled(): self - { - $this->instance->unsetEnabled(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Initializes a new Catalog Item Modifier List Info object. - */ - public function build(): CatalogItemModifierListInfo - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemOptionBuilder.php b/src/Models/Builders/CatalogItemOptionBuilder.php deleted file mode 100644 index a6c307e4..00000000 --- a/src/Models/Builders/CatalogItemOptionBuilder.php +++ /dev/null @@ -1,143 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Option Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemOption()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets display name field. - * - * @param string|null $value - */ - public function displayName(?string $value): self - { - $this->instance->setDisplayName($value); - return $this; - } - - /** - * Unsets display name field. - */ - public function unsetDisplayName(): self - { - $this->instance->unsetDisplayName(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets show colors field. - * - * @param bool|null $value - */ - public function showColors(?bool $value): self - { - $this->instance->setShowColors($value); - return $this; - } - - /** - * Unsets show colors field. - */ - public function unsetShowColors(): self - { - $this->instance->unsetShowColors(); - return $this; - } - - /** - * Sets values field. - * - * @param CatalogObject[]|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Unsets values field. - */ - public function unsetValues(): self - { - $this->instance->unsetValues(); - return $this; - } - - /** - * Initializes a new Catalog Item Option object. - */ - public function build(): CatalogItemOption - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemOptionForItemBuilder.php b/src/Models/Builders/CatalogItemOptionForItemBuilder.php deleted file mode 100644 index 9eac6490..00000000 --- a/src/Models/Builders/CatalogItemOptionForItemBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Option For Item Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemOptionForItem()); - } - - /** - * Sets item option id field. - * - * @param string|null $value - */ - public function itemOptionId(?string $value): self - { - $this->instance->setItemOptionId($value); - return $this; - } - - /** - * Unsets item option id field. - */ - public function unsetItemOptionId(): self - { - $this->instance->unsetItemOptionId(); - return $this; - } - - /** - * Initializes a new Catalog Item Option For Item object. - */ - public function build(): CatalogItemOptionForItem - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemOptionValueBuilder.php b/src/Models/Builders/CatalogItemOptionValueBuilder.php deleted file mode 100644 index 01d3dbc7..00000000 --- a/src/Models/Builders/CatalogItemOptionValueBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Option Value Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemOptionValue()); - } - - /** - * Sets item option id field. - * - * @param string|null $value - */ - public function itemOptionId(?string $value): self - { - $this->instance->setItemOptionId($value); - return $this; - } - - /** - * Unsets item option id field. - */ - public function unsetItemOptionId(): self - { - $this->instance->unsetItemOptionId(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets color field. - * - * @param string|null $value - */ - public function color(?string $value): self - { - $this->instance->setColor($value); - return $this; - } - - /** - * Unsets color field. - */ - public function unsetColor(): self - { - $this->instance->unsetColor(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Initializes a new Catalog Item Option Value object. - */ - public function build(): CatalogItemOptionValue - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemOptionValueForItemVariationBuilder.php b/src/Models/Builders/CatalogItemOptionValueForItemVariationBuilder.php deleted file mode 100644 index 9e6c0210..00000000 --- a/src/Models/Builders/CatalogItemOptionValueForItemVariationBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Option Value For Item Variation Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemOptionValueForItemVariation()); - } - - /** - * Sets item option id field. - * - * @param string|null $value - */ - public function itemOptionId(?string $value): self - { - $this->instance->setItemOptionId($value); - return $this; - } - - /** - * Unsets item option id field. - */ - public function unsetItemOptionId(): self - { - $this->instance->unsetItemOptionId(); - return $this; - } - - /** - * Sets item option value id field. - * - * @param string|null $value - */ - public function itemOptionValueId(?string $value): self - { - $this->instance->setItemOptionValueId($value); - return $this; - } - - /** - * Unsets item option value id field. - */ - public function unsetItemOptionValueId(): self - { - $this->instance->unsetItemOptionValueId(); - return $this; - } - - /** - * Initializes a new Catalog Item Option Value For Item Variation object. - */ - public function build(): CatalogItemOptionValueForItemVariation - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogItemVariationBuilder.php b/src/Models/Builders/CatalogItemVariationBuilder.php deleted file mode 100644 index 32abc285..00000000 --- a/src/Models/Builders/CatalogItemVariationBuilder.php +++ /dev/null @@ -1,421 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Item Variation Builder object. - */ - public static function init(): self - { - return new self(new CatalogItemVariation()); - } - - /** - * Sets item id field. - * - * @param string|null $value - */ - public function itemId(?string $value): self - { - $this->instance->setItemId($value); - return $this; - } - - /** - * Unsets item id field. - */ - public function unsetItemId(): self - { - $this->instance->unsetItemId(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets sku field. - * - * @param string|null $value - */ - public function sku(?string $value): self - { - $this->instance->setSku($value); - return $this; - } - - /** - * Unsets sku field. - */ - public function unsetSku(): self - { - $this->instance->unsetSku(); - return $this; - } - - /** - * Sets upc field. - * - * @param string|null $value - */ - public function upc(?string $value): self - { - $this->instance->setUpc($value); - return $this; - } - - /** - * Unsets upc field. - */ - public function unsetUpc(): self - { - $this->instance->unsetUpc(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Sets pricing type field. - * - * @param string|null $value - */ - public function pricingType(?string $value): self - { - $this->instance->setPricingType($value); - return $this; - } - - /** - * Sets price money field. - * - * @param Money|null $value - */ - public function priceMoney(?Money $value): self - { - $this->instance->setPriceMoney($value); - return $this; - } - - /** - * Sets location overrides field. - * - * @param ItemVariationLocationOverrides[]|null $value - */ - public function locationOverrides(?array $value): self - { - $this->instance->setLocationOverrides($value); - return $this; - } - - /** - * Unsets location overrides field. - */ - public function unsetLocationOverrides(): self - { - $this->instance->unsetLocationOverrides(); - return $this; - } - - /** - * Sets track inventory field. - * - * @param bool|null $value - */ - public function trackInventory(?bool $value): self - { - $this->instance->setTrackInventory($value); - return $this; - } - - /** - * Unsets track inventory field. - */ - public function unsetTrackInventory(): self - { - $this->instance->unsetTrackInventory(); - return $this; - } - - /** - * Sets inventory alert type field. - * - * @param string|null $value - */ - public function inventoryAlertType(?string $value): self - { - $this->instance->setInventoryAlertType($value); - return $this; - } - - /** - * Sets inventory alert threshold field. - * - * @param int|null $value - */ - public function inventoryAlertThreshold(?int $value): self - { - $this->instance->setInventoryAlertThreshold($value); - return $this; - } - - /** - * Unsets inventory alert threshold field. - */ - public function unsetInventoryAlertThreshold(): self - { - $this->instance->unsetInventoryAlertThreshold(); - return $this; - } - - /** - * Sets user data field. - * - * @param string|null $value - */ - public function userData(?string $value): self - { - $this->instance->setUserData($value); - return $this; - } - - /** - * Unsets user data field. - */ - public function unsetUserData(): self - { - $this->instance->unsetUserData(); - return $this; - } - - /** - * Sets service duration field. - * - * @param int|null $value - */ - public function serviceDuration(?int $value): self - { - $this->instance->setServiceDuration($value); - return $this; - } - - /** - * Unsets service duration field. - */ - public function unsetServiceDuration(): self - { - $this->instance->unsetServiceDuration(); - return $this; - } - - /** - * Sets available for booking field. - * - * @param bool|null $value - */ - public function availableForBooking(?bool $value): self - { - $this->instance->setAvailableForBooking($value); - return $this; - } - - /** - * Unsets available for booking field. - */ - public function unsetAvailableForBooking(): self - { - $this->instance->unsetAvailableForBooking(); - return $this; - } - - /** - * Sets item option values field. - * - * @param CatalogItemOptionValueForItemVariation[]|null $value - */ - public function itemOptionValues(?array $value): self - { - $this->instance->setItemOptionValues($value); - return $this; - } - - /** - * Unsets item option values field. - */ - public function unsetItemOptionValues(): self - { - $this->instance->unsetItemOptionValues(); - return $this; - } - - /** - * Sets measurement unit id field. - * - * @param string|null $value - */ - public function measurementUnitId(?string $value): self - { - $this->instance->setMeasurementUnitId($value); - return $this; - } - - /** - * Unsets measurement unit id field. - */ - public function unsetMeasurementUnitId(): self - { - $this->instance->unsetMeasurementUnitId(); - return $this; - } - - /** - * Sets sellable field. - * - * @param bool|null $value - */ - public function sellable(?bool $value): self - { - $this->instance->setSellable($value); - return $this; - } - - /** - * Unsets sellable field. - */ - public function unsetSellable(): self - { - $this->instance->unsetSellable(); - return $this; - } - - /** - * Sets stockable field. - * - * @param bool|null $value - */ - public function stockable(?bool $value): self - { - $this->instance->setStockable($value); - return $this; - } - - /** - * Unsets stockable field. - */ - public function unsetStockable(): self - { - $this->instance->unsetStockable(); - return $this; - } - - /** - * Sets image ids field. - * - * @param string[]|null $value - */ - public function imageIds(?array $value): self - { - $this->instance->setImageIds($value); - return $this; - } - - /** - * Unsets image ids field. - */ - public function unsetImageIds(): self - { - $this->instance->unsetImageIds(); - return $this; - } - - /** - * Sets team member ids field. - * - * @param string[]|null $value - */ - public function teamMemberIds(?array $value): self - { - $this->instance->setTeamMemberIds($value); - return $this; - } - - /** - * Unsets team member ids field. - */ - public function unsetTeamMemberIds(): self - { - $this->instance->unsetTeamMemberIds(); - return $this; - } - - /** - * Sets stockable conversion field. - * - * @param CatalogStockConversion|null $value - */ - public function stockableConversion(?CatalogStockConversion $value): self - { - $this->instance->setStockableConversion($value); - return $this; - } - - /** - * Initializes a new Catalog Item Variation object. - */ - public function build(): CatalogItemVariation - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogMeasurementUnitBuilder.php b/src/Models/Builders/CatalogMeasurementUnitBuilder.php deleted file mode 100644 index 51a57ed7..00000000 --- a/src/Models/Builders/CatalogMeasurementUnitBuilder.php +++ /dev/null @@ -1,74 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Measurement Unit Builder object. - */ - public static function init(): self - { - return new self(new CatalogMeasurementUnit()); - } - - /** - * Sets measurement unit field. - * - * @param MeasurementUnit|null $value - */ - public function measurementUnit(?MeasurementUnit $value): self - { - $this->instance->setMeasurementUnit($value); - return $this; - } - - /** - * Sets precision field. - * - * @param int|null $value - */ - public function precision(?int $value): self - { - $this->instance->setPrecision($value); - return $this; - } - - /** - * Unsets precision field. - */ - public function unsetPrecision(): self - { - $this->instance->unsetPrecision(); - return $this; - } - - /** - * Initializes a new Catalog Measurement Unit object. - */ - public function build(): CatalogMeasurementUnit - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogModifierBuilder.php b/src/Models/Builders/CatalogModifierBuilder.php deleted file mode 100644 index 2750f7fc..00000000 --- a/src/Models/Builders/CatalogModifierBuilder.php +++ /dev/null @@ -1,155 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Modifier Builder object. - */ - public static function init(): self - { - return new self(new CatalogModifier()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets price money field. - * - * @param Money|null $value - */ - public function priceMoney(?Money $value): self - { - $this->instance->setPriceMoney($value); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Sets modifier list id field. - * - * @param string|null $value - */ - public function modifierListId(?string $value): self - { - $this->instance->setModifierListId($value); - return $this; - } - - /** - * Unsets modifier list id field. - */ - public function unsetModifierListId(): self - { - $this->instance->unsetModifierListId(); - return $this; - } - - /** - * Sets location overrides field. - * - * @param ModifierLocationOverrides[]|null $value - */ - public function locationOverrides(?array $value): self - { - $this->instance->setLocationOverrides($value); - return $this; - } - - /** - * Unsets location overrides field. - */ - public function unsetLocationOverrides(): self - { - $this->instance->unsetLocationOverrides(); - return $this; - } - - /** - * Sets image id field. - * - * @param string|null $value - */ - public function imageId(?string $value): self - { - $this->instance->setImageId($value); - return $this; - } - - /** - * Unsets image id field. - */ - public function unsetImageId(): self - { - $this->instance->unsetImageId(); - return $this; - } - - /** - * Initializes a new Catalog Modifier object. - */ - public function build(): CatalogModifier - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogModifierListBuilder.php b/src/Models/Builders/CatalogModifierListBuilder.php deleted file mode 100644 index 4bd223e1..00000000 --- a/src/Models/Builders/CatalogModifierListBuilder.php +++ /dev/null @@ -1,205 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Modifier List Builder object. - */ - public static function init(): self - { - return new self(new CatalogModifierList()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Sets selection type field. - * - * @param string|null $value - */ - public function selectionType(?string $value): self - { - $this->instance->setSelectionType($value); - return $this; - } - - /** - * Sets modifiers field. - * - * @param CatalogObject[]|null $value - */ - public function modifiers(?array $value): self - { - $this->instance->setModifiers($value); - return $this; - } - - /** - * Unsets modifiers field. - */ - public function unsetModifiers(): self - { - $this->instance->unsetModifiers(); - return $this; - } - - /** - * Sets image ids field. - * - * @param string[]|null $value - */ - public function imageIds(?array $value): self - { - $this->instance->setImageIds($value); - return $this; - } - - /** - * Unsets image ids field. - */ - public function unsetImageIds(): self - { - $this->instance->unsetImageIds(); - return $this; - } - - /** - * Sets modifier type field. - * - * @param string|null $value - */ - public function modifierType(?string $value): self - { - $this->instance->setModifierType($value); - return $this; - } - - /** - * Sets max length field. - * - * @param int|null $value - */ - public function maxLength(?int $value): self - { - $this->instance->setMaxLength($value); - return $this; - } - - /** - * Unsets max length field. - */ - public function unsetMaxLength(): self - { - $this->instance->unsetMaxLength(); - return $this; - } - - /** - * Sets text required field. - * - * @param bool|null $value - */ - public function textRequired(?bool $value): self - { - $this->instance->setTextRequired($value); - return $this; - } - - /** - * Unsets text required field. - */ - public function unsetTextRequired(): self - { - $this->instance->unsetTextRequired(); - return $this; - } - - /** - * Sets internal name field. - * - * @param string|null $value - */ - public function internalName(?string $value): self - { - $this->instance->setInternalName($value); - return $this; - } - - /** - * Unsets internal name field. - */ - public function unsetInternalName(): self - { - $this->instance->unsetInternalName(); - return $this; - } - - /** - * Initializes a new Catalog Modifier List object. - */ - public function build(): CatalogModifierList - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogModifierOverrideBuilder.php b/src/Models/Builders/CatalogModifierOverrideBuilder.php deleted file mode 100644 index c40ed560..00000000 --- a/src/Models/Builders/CatalogModifierOverrideBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Modifier Override Builder object. - * - * @param string $modifierId - */ - public static function init(string $modifierId): self - { - return new self(new CatalogModifierOverride($modifierId)); - } - - /** - * Sets on by default field. - * - * @param bool|null $value - */ - public function onByDefault(?bool $value): self - { - $this->instance->setOnByDefault($value); - return $this; - } - - /** - * Unsets on by default field. - */ - public function unsetOnByDefault(): self - { - $this->instance->unsetOnByDefault(); - return $this; - } - - /** - * Initializes a new Catalog Modifier Override object. - */ - public function build(): CatalogModifierOverride - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogObjectBatchBuilder.php b/src/Models/Builders/CatalogObjectBatchBuilder.php deleted file mode 100644 index a6023f00..00000000 --- a/src/Models/Builders/CatalogObjectBatchBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Object Batch Builder object. - * - * @param CatalogObject[] $objects - */ - public static function init(array $objects): self - { - return new self(new CatalogObjectBatch($objects)); - } - - /** - * Initializes a new Catalog Object Batch object. - */ - public function build(): CatalogObjectBatch - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogObjectBuilder.php b/src/Models/Builders/CatalogObjectBuilder.php deleted file mode 100644 index 3a5f4a51..00000000 --- a/src/Models/Builders/CatalogObjectBuilder.php +++ /dev/null @@ -1,417 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Object Builder object. - * - * @param string $type - * @param string $id - */ - public static function init(string $type, string $id): self - { - return new self(new CatalogObject($type, $id)); - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets is deleted field. - * - * @param bool|null $value - */ - public function isDeleted(?bool $value): self - { - $this->instance->setIsDeleted($value); - return $this; - } - - /** - * Unsets is deleted field. - */ - public function unsetIsDeleted(): self - { - $this->instance->unsetIsDeleted(); - return $this; - } - - /** - * Sets custom attribute values field. - * - * @param array|null $value - */ - public function customAttributeValues(?array $value): self - { - $this->instance->setCustomAttributeValues($value); - return $this; - } - - /** - * Unsets custom attribute values field. - */ - public function unsetCustomAttributeValues(): self - { - $this->instance->unsetCustomAttributeValues(); - return $this; - } - - /** - * Sets catalog v 1 ids field. - * - * @param CatalogV1Id[]|null $value - */ - public function catalogV1Ids(?array $value): self - { - $this->instance->setCatalogV1Ids($value); - return $this; - } - - /** - * Unsets catalog v 1 ids field. - */ - public function unsetCatalogV1Ids(): self - { - $this->instance->unsetCatalogV1Ids(); - return $this; - } - - /** - * Sets present at all locations field. - * - * @param bool|null $value - */ - public function presentAtAllLocations(?bool $value): self - { - $this->instance->setPresentAtAllLocations($value); - return $this; - } - - /** - * Unsets present at all locations field. - */ - public function unsetPresentAtAllLocations(): self - { - $this->instance->unsetPresentAtAllLocations(); - return $this; - } - - /** - * Sets present at location ids field. - * - * @param string[]|null $value - */ - public function presentAtLocationIds(?array $value): self - { - $this->instance->setPresentAtLocationIds($value); - return $this; - } - - /** - * Unsets present at location ids field. - */ - public function unsetPresentAtLocationIds(): self - { - $this->instance->unsetPresentAtLocationIds(); - return $this; - } - - /** - * Sets absent at location ids field. - * - * @param string[]|null $value - */ - public function absentAtLocationIds(?array $value): self - { - $this->instance->setAbsentAtLocationIds($value); - return $this; - } - - /** - * Unsets absent at location ids field. - */ - public function unsetAbsentAtLocationIds(): self - { - $this->instance->unsetAbsentAtLocationIds(); - return $this; - } - - /** - * Sets item data field. - * - * @param CatalogItem|null $value - */ - public function itemData(?CatalogItem $value): self - { - $this->instance->setItemData($value); - return $this; - } - - /** - * Sets category data field. - * - * @param CatalogCategory|null $value - */ - public function categoryData(?CatalogCategory $value): self - { - $this->instance->setCategoryData($value); - return $this; - } - - /** - * Sets item variation data field. - * - * @param CatalogItemVariation|null $value - */ - public function itemVariationData(?CatalogItemVariation $value): self - { - $this->instance->setItemVariationData($value); - return $this; - } - - /** - * Sets tax data field. - * - * @param CatalogTax|null $value - */ - public function taxData(?CatalogTax $value): self - { - $this->instance->setTaxData($value); - return $this; - } - - /** - * Sets discount data field. - * - * @param CatalogDiscount|null $value - */ - public function discountData(?CatalogDiscount $value): self - { - $this->instance->setDiscountData($value); - return $this; - } - - /** - * Sets modifier list data field. - * - * @param CatalogModifierList|null $value - */ - public function modifierListData(?CatalogModifierList $value): self - { - $this->instance->setModifierListData($value); - return $this; - } - - /** - * Sets modifier data field. - * - * @param CatalogModifier|null $value - */ - public function modifierData(?CatalogModifier $value): self - { - $this->instance->setModifierData($value); - return $this; - } - - /** - * Sets time period data field. - * - * @param CatalogTimePeriod|null $value - */ - public function timePeriodData(?CatalogTimePeriod $value): self - { - $this->instance->setTimePeriodData($value); - return $this; - } - - /** - * Sets product set data field. - * - * @param CatalogProductSet|null $value - */ - public function productSetData(?CatalogProductSet $value): self - { - $this->instance->setProductSetData($value); - return $this; - } - - /** - * Sets pricing rule data field. - * - * @param CatalogPricingRule|null $value - */ - public function pricingRuleData(?CatalogPricingRule $value): self - { - $this->instance->setPricingRuleData($value); - return $this; - } - - /** - * Sets image data field. - * - * @param CatalogImage|null $value - */ - public function imageData(?CatalogImage $value): self - { - $this->instance->setImageData($value); - return $this; - } - - /** - * Sets measurement unit data field. - * - * @param CatalogMeasurementUnit|null $value - */ - public function measurementUnitData(?CatalogMeasurementUnit $value): self - { - $this->instance->setMeasurementUnitData($value); - return $this; - } - - /** - * Sets subscription plan data field. - * - * @param CatalogSubscriptionPlan|null $value - */ - public function subscriptionPlanData(?CatalogSubscriptionPlan $value): self - { - $this->instance->setSubscriptionPlanData($value); - return $this; - } - - /** - * Sets item option data field. - * - * @param CatalogItemOption|null $value - */ - public function itemOptionData(?CatalogItemOption $value): self - { - $this->instance->setItemOptionData($value); - return $this; - } - - /** - * Sets item option value data field. - * - * @param CatalogItemOptionValue|null $value - */ - public function itemOptionValueData(?CatalogItemOptionValue $value): self - { - $this->instance->setItemOptionValueData($value); - return $this; - } - - /** - * Sets custom attribute definition data field. - * - * @param CatalogCustomAttributeDefinition|null $value - */ - public function customAttributeDefinitionData(?CatalogCustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinitionData($value); - return $this; - } - - /** - * Sets quick amounts settings data field. - * - * @param CatalogQuickAmountsSettings|null $value - */ - public function quickAmountsSettingsData(?CatalogQuickAmountsSettings $value): self - { - $this->instance->setQuickAmountsSettingsData($value); - return $this; - } - - /** - * Sets subscription plan variation data field. - * - * @param CatalogSubscriptionPlanVariation|null $value - */ - public function subscriptionPlanVariationData(?CatalogSubscriptionPlanVariation $value): self - { - $this->instance->setSubscriptionPlanVariationData($value); - return $this; - } - - /** - * Sets availability period data field. - * - * @param CatalogAvailabilityPeriod|null $value - */ - public function availabilityPeriodData(?CatalogAvailabilityPeriod $value): self - { - $this->instance->setAvailabilityPeriodData($value); - return $this; - } - - /** - * Initializes a new Catalog Object object. - */ - public function build(): CatalogObject - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogObjectCategoryBuilder.php b/src/Models/Builders/CatalogObjectCategoryBuilder.php deleted file mode 100644 index 8fe72603..00000000 --- a/src/Models/Builders/CatalogObjectCategoryBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Object Category Builder object. - */ - public static function init(): self - { - return new self(new CatalogObjectCategory()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Initializes a new Catalog Object Category object. - */ - public function build(): CatalogObjectCategory - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogObjectReferenceBuilder.php b/src/Models/Builders/CatalogObjectReferenceBuilder.php deleted file mode 100644 index db1b6859..00000000 --- a/src/Models/Builders/CatalogObjectReferenceBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Object Reference Builder object. - */ - public static function init(): self - { - return new self(new CatalogObjectReference()); - } - - /** - * Sets object id field. - * - * @param string|null $value - */ - public function objectId(?string $value): self - { - $this->instance->setObjectId($value); - return $this; - } - - /** - * Unsets object id field. - */ - public function unsetObjectId(): self - { - $this->instance->unsetObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Initializes a new Catalog Object Reference object. - */ - public function build(): CatalogObjectReference - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogPricingRuleBuilder.php b/src/Models/Builders/CatalogPricingRuleBuilder.php deleted file mode 100644 index ab36a665..00000000 --- a/src/Models/Builders/CatalogPricingRuleBuilder.php +++ /dev/null @@ -1,285 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Pricing Rule Builder object. - */ - public static function init(): self - { - return new self(new CatalogPricingRule()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets time period ids field. - * - * @param string[]|null $value - */ - public function timePeriodIds(?array $value): self - { - $this->instance->setTimePeriodIds($value); - return $this; - } - - /** - * Unsets time period ids field. - */ - public function unsetTimePeriodIds(): self - { - $this->instance->unsetTimePeriodIds(); - return $this; - } - - /** - * Sets discount id field. - * - * @param string|null $value - */ - public function discountId(?string $value): self - { - $this->instance->setDiscountId($value); - return $this; - } - - /** - * Unsets discount id field. - */ - public function unsetDiscountId(): self - { - $this->instance->unsetDiscountId(); - return $this; - } - - /** - * Sets match products id field. - * - * @param string|null $value - */ - public function matchProductsId(?string $value): self - { - $this->instance->setMatchProductsId($value); - return $this; - } - - /** - * Unsets match products id field. - */ - public function unsetMatchProductsId(): self - { - $this->instance->unsetMatchProductsId(); - return $this; - } - - /** - * Sets apply products id field. - * - * @param string|null $value - */ - public function applyProductsId(?string $value): self - { - $this->instance->setApplyProductsId($value); - return $this; - } - - /** - * Unsets apply products id field. - */ - public function unsetApplyProductsId(): self - { - $this->instance->unsetApplyProductsId(); - return $this; - } - - /** - * Sets exclude products id field. - * - * @param string|null $value - */ - public function excludeProductsId(?string $value): self - { - $this->instance->setExcludeProductsId($value); - return $this; - } - - /** - * Unsets exclude products id field. - */ - public function unsetExcludeProductsId(): self - { - $this->instance->unsetExcludeProductsId(); - return $this; - } - - /** - * Sets valid from date field. - * - * @param string|null $value - */ - public function validFromDate(?string $value): self - { - $this->instance->setValidFromDate($value); - return $this; - } - - /** - * Unsets valid from date field. - */ - public function unsetValidFromDate(): self - { - $this->instance->unsetValidFromDate(); - return $this; - } - - /** - * Sets valid from local time field. - * - * @param string|null $value - */ - public function validFromLocalTime(?string $value): self - { - $this->instance->setValidFromLocalTime($value); - return $this; - } - - /** - * Unsets valid from local time field. - */ - public function unsetValidFromLocalTime(): self - { - $this->instance->unsetValidFromLocalTime(); - return $this; - } - - /** - * Sets valid until date field. - * - * @param string|null $value - */ - public function validUntilDate(?string $value): self - { - $this->instance->setValidUntilDate($value); - return $this; - } - - /** - * Unsets valid until date field. - */ - public function unsetValidUntilDate(): self - { - $this->instance->unsetValidUntilDate(); - return $this; - } - - /** - * Sets valid until local time field. - * - * @param string|null $value - */ - public function validUntilLocalTime(?string $value): self - { - $this->instance->setValidUntilLocalTime($value); - return $this; - } - - /** - * Unsets valid until local time field. - */ - public function unsetValidUntilLocalTime(): self - { - $this->instance->unsetValidUntilLocalTime(); - return $this; - } - - /** - * Sets exclude strategy field. - * - * @param string|null $value - */ - public function excludeStrategy(?string $value): self - { - $this->instance->setExcludeStrategy($value); - return $this; - } - - /** - * Sets minimum order subtotal money field. - * - * @param Money|null $value - */ - public function minimumOrderSubtotalMoney(?Money $value): self - { - $this->instance->setMinimumOrderSubtotalMoney($value); - return $this; - } - - /** - * Sets customer group ids any field. - * - * @param string[]|null $value - */ - public function customerGroupIdsAny(?array $value): self - { - $this->instance->setCustomerGroupIdsAny($value); - return $this; - } - - /** - * Unsets customer group ids any field. - */ - public function unsetCustomerGroupIdsAny(): self - { - $this->instance->unsetCustomerGroupIdsAny(); - return $this; - } - - /** - * Initializes a new Catalog Pricing Rule object. - */ - public function build(): CatalogPricingRule - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogProductSetBuilder.php b/src/Models/Builders/CatalogProductSetBuilder.php deleted file mode 100644 index 5b32873b..00000000 --- a/src/Models/Builders/CatalogProductSetBuilder.php +++ /dev/null @@ -1,182 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Product Set Builder object. - */ - public static function init(): self - { - return new self(new CatalogProductSet()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets product ids any field. - * - * @param string[]|null $value - */ - public function productIdsAny(?array $value): self - { - $this->instance->setProductIdsAny($value); - return $this; - } - - /** - * Unsets product ids any field. - */ - public function unsetProductIdsAny(): self - { - $this->instance->unsetProductIdsAny(); - return $this; - } - - /** - * Sets product ids all field. - * - * @param string[]|null $value - */ - public function productIdsAll(?array $value): self - { - $this->instance->setProductIdsAll($value); - return $this; - } - - /** - * Unsets product ids all field. - */ - public function unsetProductIdsAll(): self - { - $this->instance->unsetProductIdsAll(); - return $this; - } - - /** - * Sets quantity exact field. - * - * @param int|null $value - */ - public function quantityExact(?int $value): self - { - $this->instance->setQuantityExact($value); - return $this; - } - - /** - * Unsets quantity exact field. - */ - public function unsetQuantityExact(): self - { - $this->instance->unsetQuantityExact(); - return $this; - } - - /** - * Sets quantity min field. - * - * @param int|null $value - */ - public function quantityMin(?int $value): self - { - $this->instance->setQuantityMin($value); - return $this; - } - - /** - * Unsets quantity min field. - */ - public function unsetQuantityMin(): self - { - $this->instance->unsetQuantityMin(); - return $this; - } - - /** - * Sets quantity max field. - * - * @param int|null $value - */ - public function quantityMax(?int $value): self - { - $this->instance->setQuantityMax($value); - return $this; - } - - /** - * Unsets quantity max field. - */ - public function unsetQuantityMax(): self - { - $this->instance->unsetQuantityMax(); - return $this; - } - - /** - * Sets all products field. - * - * @param bool|null $value - */ - public function allProducts(?bool $value): self - { - $this->instance->setAllProducts($value); - return $this; - } - - /** - * Unsets all products field. - */ - public function unsetAllProducts(): self - { - $this->instance->unsetAllProducts(); - return $this; - } - - /** - * Initializes a new Catalog Product Set object. - */ - public function build(): CatalogProductSet - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryBuilder.php b/src/Models/Builders/CatalogQueryBuilder.php deleted file mode 100644 index 3e1d7bb5..00000000 --- a/src/Models/Builders/CatalogQueryBuilder.php +++ /dev/null @@ -1,162 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Builder object. - */ - public static function init(): self - { - return new self(new CatalogQuery()); - } - - /** - * Sets sorted attribute query field. - * - * @param CatalogQuerySortedAttribute|null $value - */ - public function sortedAttributeQuery(?CatalogQuerySortedAttribute $value): self - { - $this->instance->setSortedAttributeQuery($value); - return $this; - } - - /** - * Sets exact query field. - * - * @param CatalogQueryExact|null $value - */ - public function exactQuery(?CatalogQueryExact $value): self - { - $this->instance->setExactQuery($value); - return $this; - } - - /** - * Sets set query field. - * - * @param CatalogQuerySet|null $value - */ - public function setQuery(?CatalogQuerySet $value): self - { - $this->instance->setSetQuery($value); - return $this; - } - - /** - * Sets prefix query field. - * - * @param CatalogQueryPrefix|null $value - */ - public function prefixQuery(?CatalogQueryPrefix $value): self - { - $this->instance->setPrefixQuery($value); - return $this; - } - - /** - * Sets range query field. - * - * @param CatalogQueryRange|null $value - */ - public function rangeQuery(?CatalogQueryRange $value): self - { - $this->instance->setRangeQuery($value); - return $this; - } - - /** - * Sets text query field. - * - * @param CatalogQueryText|null $value - */ - public function textQuery(?CatalogQueryText $value): self - { - $this->instance->setTextQuery($value); - return $this; - } - - /** - * Sets items for tax query field. - * - * @param CatalogQueryItemsForTax|null $value - */ - public function itemsForTaxQuery(?CatalogQueryItemsForTax $value): self - { - $this->instance->setItemsForTaxQuery($value); - return $this; - } - - /** - * Sets items for modifier list query field. - * - * @param CatalogQueryItemsForModifierList|null $value - */ - public function itemsForModifierListQuery(?CatalogQueryItemsForModifierList $value): self - { - $this->instance->setItemsForModifierListQuery($value); - return $this; - } - - /** - * Sets items for item options query field. - * - * @param CatalogQueryItemsForItemOptions|null $value - */ - public function itemsForItemOptionsQuery(?CatalogQueryItemsForItemOptions $value): self - { - $this->instance->setItemsForItemOptionsQuery($value); - return $this; - } - - /** - * Sets item variations for item option values query field. - * - * @param CatalogQueryItemVariationsForItemOptionValues|null $value - */ - public function itemVariationsForItemOptionValuesQuery(?CatalogQueryItemVariationsForItemOptionValues $value): self - { - $this->instance->setItemVariationsForItemOptionValuesQuery($value); - return $this; - } - - /** - * Initializes a new Catalog Query object. - */ - public function build(): CatalogQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryExactBuilder.php b/src/Models/Builders/CatalogQueryExactBuilder.php deleted file mode 100644 index 25a64d24..00000000 --- a/src/Models/Builders/CatalogQueryExactBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Exact Builder object. - * - * @param string $attributeName - * @param string $attributeValue - */ - public static function init(string $attributeName, string $attributeValue): self - { - return new self(new CatalogQueryExact($attributeName, $attributeValue)); - } - - /** - * Initializes a new Catalog Query Exact object. - */ - public function build(): CatalogQueryExact - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryItemVariationsForItemOptionValuesBuilder.php b/src/Models/Builders/CatalogQueryItemVariationsForItemOptionValuesBuilder.php deleted file mode 100644 index 5c1f6948..00000000 --- a/src/Models/Builders/CatalogQueryItemVariationsForItemOptionValuesBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Item Variations For Item Option Values Builder object. - */ - public static function init(): self - { - return new self(new CatalogQueryItemVariationsForItemOptionValues()); - } - - /** - * Sets item option value ids field. - * - * @param string[]|null $value - */ - public function itemOptionValueIds(?array $value): self - { - $this->instance->setItemOptionValueIds($value); - return $this; - } - - /** - * Unsets item option value ids field. - */ - public function unsetItemOptionValueIds(): self - { - $this->instance->unsetItemOptionValueIds(); - return $this; - } - - /** - * Initializes a new Catalog Query Item Variations For Item Option Values object. - */ - public function build(): CatalogQueryItemVariationsForItemOptionValues - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryItemsForItemOptionsBuilder.php b/src/Models/Builders/CatalogQueryItemsForItemOptionsBuilder.php deleted file mode 100644 index b7060f69..00000000 --- a/src/Models/Builders/CatalogQueryItemsForItemOptionsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Items For Item Options Builder object. - */ - public static function init(): self - { - return new self(new CatalogQueryItemsForItemOptions()); - } - - /** - * Sets item option ids field. - * - * @param string[]|null $value - */ - public function itemOptionIds(?array $value): self - { - $this->instance->setItemOptionIds($value); - return $this; - } - - /** - * Unsets item option ids field. - */ - public function unsetItemOptionIds(): self - { - $this->instance->unsetItemOptionIds(); - return $this; - } - - /** - * Initializes a new Catalog Query Items For Item Options object. - */ - public function build(): CatalogQueryItemsForItemOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryItemsForModifierListBuilder.php b/src/Models/Builders/CatalogQueryItemsForModifierListBuilder.php deleted file mode 100644 index bfecfd67..00000000 --- a/src/Models/Builders/CatalogQueryItemsForModifierListBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Items For Modifier List Builder object. - * - * @param string[] $modifierListIds - */ - public static function init(array $modifierListIds): self - { - return new self(new CatalogQueryItemsForModifierList($modifierListIds)); - } - - /** - * Initializes a new Catalog Query Items For Modifier List object. - */ - public function build(): CatalogQueryItemsForModifierList - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryItemsForTaxBuilder.php b/src/Models/Builders/CatalogQueryItemsForTaxBuilder.php deleted file mode 100644 index ac3de3c1..00000000 --- a/src/Models/Builders/CatalogQueryItemsForTaxBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Items For Tax Builder object. - * - * @param string[] $taxIds - */ - public static function init(array $taxIds): self - { - return new self(new CatalogQueryItemsForTax($taxIds)); - } - - /** - * Initializes a new Catalog Query Items For Tax object. - */ - public function build(): CatalogQueryItemsForTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryPrefixBuilder.php b/src/Models/Builders/CatalogQueryPrefixBuilder.php deleted file mode 100644 index 7ed0de54..00000000 --- a/src/Models/Builders/CatalogQueryPrefixBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Prefix Builder object. - * - * @param string $attributeName - * @param string $attributePrefix - */ - public static function init(string $attributeName, string $attributePrefix): self - { - return new self(new CatalogQueryPrefix($attributeName, $attributePrefix)); - } - - /** - * Initializes a new Catalog Query Prefix object. - */ - public function build(): CatalogQueryPrefix - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryRangeBuilder.php b/src/Models/Builders/CatalogQueryRangeBuilder.php deleted file mode 100644 index 443ad3c1..00000000 --- a/src/Models/Builders/CatalogQueryRangeBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Range Builder object. - * - * @param string $attributeName - */ - public static function init(string $attributeName): self - { - return new self(new CatalogQueryRange($attributeName)); - } - - /** - * Sets attribute min value field. - * - * @param int|null $value - */ - public function attributeMinValue(?int $value): self - { - $this->instance->setAttributeMinValue($value); - return $this; - } - - /** - * Unsets attribute min value field. - */ - public function unsetAttributeMinValue(): self - { - $this->instance->unsetAttributeMinValue(); - return $this; - } - - /** - * Sets attribute max value field. - * - * @param int|null $value - */ - public function attributeMaxValue(?int $value): self - { - $this->instance->setAttributeMaxValue($value); - return $this; - } - - /** - * Unsets attribute max value field. - */ - public function unsetAttributeMaxValue(): self - { - $this->instance->unsetAttributeMaxValue(); - return $this; - } - - /** - * Initializes a new Catalog Query Range object. - */ - public function build(): CatalogQueryRange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQuerySetBuilder.php b/src/Models/Builders/CatalogQuerySetBuilder.php deleted file mode 100644 index 5a954c9a..00000000 --- a/src/Models/Builders/CatalogQuerySetBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Set Builder object. - * - * @param string $attributeName - * @param string[] $attributeValues - */ - public static function init(string $attributeName, array $attributeValues): self - { - return new self(new CatalogQuerySet($attributeName, $attributeValues)); - } - - /** - * Initializes a new Catalog Query Set object. - */ - public function build(): CatalogQuerySet - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQuerySortedAttributeBuilder.php b/src/Models/Builders/CatalogQuerySortedAttributeBuilder.php deleted file mode 100644 index 353c656f..00000000 --- a/src/Models/Builders/CatalogQuerySortedAttributeBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Sorted Attribute Builder object. - * - * @param string $attributeName - */ - public static function init(string $attributeName): self - { - return new self(new CatalogQuerySortedAttribute($attributeName)); - } - - /** - * Sets initial attribute value field. - * - * @param string|null $value - */ - public function initialAttributeValue(?string $value): self - { - $this->instance->setInitialAttributeValue($value); - return $this; - } - - /** - * Unsets initial attribute value field. - */ - public function unsetInitialAttributeValue(): self - { - $this->instance->unsetInitialAttributeValue(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Initializes a new Catalog Query Sorted Attribute object. - */ - public function build(): CatalogQuerySortedAttribute - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQueryTextBuilder.php b/src/Models/Builders/CatalogQueryTextBuilder.php deleted file mode 100644 index fee16cda..00000000 --- a/src/Models/Builders/CatalogQueryTextBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Query Text Builder object. - * - * @param string[] $keywords - */ - public static function init(array $keywords): self - { - return new self(new CatalogQueryText($keywords)); - } - - /** - * Initializes a new Catalog Query Text object. - */ - public function build(): CatalogQueryText - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQuickAmountBuilder.php b/src/Models/Builders/CatalogQuickAmountBuilder.php deleted file mode 100644 index 15cabe30..00000000 --- a/src/Models/Builders/CatalogQuickAmountBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Quick Amount Builder object. - * - * @param string $type - * @param Money $amount - */ - public static function init(string $type, Money $amount): self - { - return new self(new CatalogQuickAmount($type, $amount)); - } - - /** - * Sets score field. - * - * @param int|null $value - */ - public function score(?int $value): self - { - $this->instance->setScore($value); - return $this; - } - - /** - * Unsets score field. - */ - public function unsetScore(): self - { - $this->instance->unsetScore(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Initializes a new Catalog Quick Amount object. - */ - public function build(): CatalogQuickAmount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogQuickAmountsSettingsBuilder.php b/src/Models/Builders/CatalogQuickAmountsSettingsBuilder.php deleted file mode 100644 index 2f3045db..00000000 --- a/src/Models/Builders/CatalogQuickAmountsSettingsBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Quick Amounts Settings Builder object. - * - * @param string $option - */ - public static function init(string $option): self - { - return new self(new CatalogQuickAmountsSettings($option)); - } - - /** - * Sets eligible for auto amounts field. - * - * @param bool|null $value - */ - public function eligibleForAutoAmounts(?bool $value): self - { - $this->instance->setEligibleForAutoAmounts($value); - return $this; - } - - /** - * Unsets eligible for auto amounts field. - */ - public function unsetEligibleForAutoAmounts(): self - { - $this->instance->unsetEligibleForAutoAmounts(); - return $this; - } - - /** - * Sets amounts field. - * - * @param CatalogQuickAmount[]|null $value - */ - public function amounts(?array $value): self - { - $this->instance->setAmounts($value); - return $this; - } - - /** - * Unsets amounts field. - */ - public function unsetAmounts(): self - { - $this->instance->unsetAmounts(); - return $this; - } - - /** - * Initializes a new Catalog Quick Amounts Settings object. - */ - public function build(): CatalogQuickAmountsSettings - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogStockConversionBuilder.php b/src/Models/Builders/CatalogStockConversionBuilder.php deleted file mode 100644 index 1590da0b..00000000 --- a/src/Models/Builders/CatalogStockConversionBuilder.php +++ /dev/null @@ -1,51 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Stock Conversion Builder object. - * - * @param string $stockableItemVariationId - * @param string $stockableQuantity - * @param string $nonstockableQuantity - */ - public static function init( - string $stockableItemVariationId, - string $stockableQuantity, - string $nonstockableQuantity - ): self { - return new self( - new CatalogStockConversion($stockableItemVariationId, $stockableQuantity, $nonstockableQuantity) - ); - } - - /** - * Initializes a new Catalog Stock Conversion object. - */ - public function build(): CatalogStockConversion - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogSubscriptionPlanBuilder.php b/src/Models/Builders/CatalogSubscriptionPlanBuilder.php deleted file mode 100644 index 439e6136..00000000 --- a/src/Models/Builders/CatalogSubscriptionPlanBuilder.php +++ /dev/null @@ -1,146 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Subscription Plan Builder object. - * - * @param string $name - */ - public static function init(string $name): self - { - return new self(new CatalogSubscriptionPlan($name)); - } - - /** - * Sets phases field. - * - * @param SubscriptionPhase[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Unsets phases field. - */ - public function unsetPhases(): self - { - $this->instance->unsetPhases(); - return $this; - } - - /** - * Sets subscription plan variations field. - * - * @param CatalogObject[]|null $value - */ - public function subscriptionPlanVariations(?array $value): self - { - $this->instance->setSubscriptionPlanVariations($value); - return $this; - } - - /** - * Unsets subscription plan variations field. - */ - public function unsetSubscriptionPlanVariations(): self - { - $this->instance->unsetSubscriptionPlanVariations(); - return $this; - } - - /** - * Sets eligible item ids field. - * - * @param string[]|null $value - */ - public function eligibleItemIds(?array $value): self - { - $this->instance->setEligibleItemIds($value); - return $this; - } - - /** - * Unsets eligible item ids field. - */ - public function unsetEligibleItemIds(): self - { - $this->instance->unsetEligibleItemIds(); - return $this; - } - - /** - * Sets eligible category ids field. - * - * @param string[]|null $value - */ - public function eligibleCategoryIds(?array $value): self - { - $this->instance->setEligibleCategoryIds($value); - return $this; - } - - /** - * Unsets eligible category ids field. - */ - public function unsetEligibleCategoryIds(): self - { - $this->instance->unsetEligibleCategoryIds(); - return $this; - } - - /** - * Sets all items field. - * - * @param bool|null $value - */ - public function allItems(?bool $value): self - { - $this->instance->setAllItems($value); - return $this; - } - - /** - * Unsets all items field. - */ - public function unsetAllItems(): self - { - $this->instance->unsetAllItems(); - return $this; - } - - /** - * Initializes a new Catalog Subscription Plan object. - */ - public function build(): CatalogSubscriptionPlan - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php b/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php deleted file mode 100644 index 448a96df..00000000 --- a/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php +++ /dev/null @@ -1,126 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Subscription Plan Variation Builder object. - * - * @param string $name - * @param SubscriptionPhase[] $phases - */ - public static function init(string $name, array $phases): self - { - return new self(new CatalogSubscriptionPlanVariation($name, $phases)); - } - - /** - * Sets subscription plan id field. - * - * @param string|null $value - */ - public function subscriptionPlanId(?string $value): self - { - $this->instance->setSubscriptionPlanId($value); - return $this; - } - - /** - * Unsets subscription plan id field. - */ - public function unsetSubscriptionPlanId(): self - { - $this->instance->unsetSubscriptionPlanId(); - return $this; - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Unsets monthly billing anchor date field. - */ - public function unsetMonthlyBillingAnchorDate(): self - { - $this->instance->unsetMonthlyBillingAnchorDate(); - return $this; - } - - /** - * Sets can prorate field. - * - * @param bool|null $value - */ - public function canProrate(?bool $value): self - { - $this->instance->setCanProrate($value); - return $this; - } - - /** - * Unsets can prorate field. - */ - public function unsetCanProrate(): self - { - $this->instance->unsetCanProrate(); - return $this; - } - - /** - * Sets successor plan variation id field. - * - * @param string|null $value - */ - public function successorPlanVariationId(?string $value): self - { - $this->instance->setSuccessorPlanVariationId($value); - return $this; - } - - /** - * Unsets successor plan variation id field. - */ - public function unsetSuccessorPlanVariationId(): self - { - $this->instance->unsetSuccessorPlanVariationId(); - return $this; - } - - /** - * Initializes a new Catalog Subscription Plan Variation object. - */ - public function build(): CatalogSubscriptionPlanVariation - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogTaxBuilder.php b/src/Models/Builders/CatalogTaxBuilder.php deleted file mode 100644 index 1cb9ccf1..00000000 --- a/src/Models/Builders/CatalogTaxBuilder.php +++ /dev/null @@ -1,164 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Tax Builder object. - */ - public static function init(): self - { - return new self(new CatalogTax()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets calculation phase field. - * - * @param string|null $value - */ - public function calculationPhase(?string $value): self - { - $this->instance->setCalculationPhase($value); - return $this; - } - - /** - * Sets inclusion type field. - * - * @param string|null $value - */ - public function inclusionType(?string $value): self - { - $this->instance->setInclusionType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets applies to custom amounts field. - * - * @param bool|null $value - */ - public function appliesToCustomAmounts(?bool $value): self - { - $this->instance->setAppliesToCustomAmounts($value); - return $this; - } - - /** - * Unsets applies to custom amounts field. - */ - public function unsetAppliesToCustomAmounts(): self - { - $this->instance->unsetAppliesToCustomAmounts(); - return $this; - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Unsets enabled field. - */ - public function unsetEnabled(): self - { - $this->instance->unsetEnabled(); - return $this; - } - - /** - * Sets applies to product set id field. - * - * @param string|null $value - */ - public function appliesToProductSetId(?string $value): self - { - $this->instance->setAppliesToProductSetId($value); - return $this; - } - - /** - * Unsets applies to product set id field. - */ - public function unsetAppliesToProductSetId(): self - { - $this->instance->unsetAppliesToProductSetId(); - return $this; - } - - /** - * Initializes a new Catalog Tax object. - */ - public function build(): CatalogTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogTimePeriodBuilder.php b/src/Models/Builders/CatalogTimePeriodBuilder.php deleted file mode 100644 index eb6cfdf0..00000000 --- a/src/Models/Builders/CatalogTimePeriodBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog Time Period Builder object. - */ - public static function init(): self - { - return new self(new CatalogTimePeriod()); - } - - /** - * Sets event field. - * - * @param string|null $value - */ - public function event(?string $value): self - { - $this->instance->setEvent($value); - return $this; - } - - /** - * Unsets event field. - */ - public function unsetEvent(): self - { - $this->instance->unsetEvent(); - return $this; - } - - /** - * Initializes a new Catalog Time Period object. - */ - public function build(): CatalogTimePeriod - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CatalogV1IdBuilder.php b/src/Models/Builders/CatalogV1IdBuilder.php deleted file mode 100644 index 704a5b00..00000000 --- a/src/Models/Builders/CatalogV1IdBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Catalog V1 Id Builder object. - */ - public static function init(): self - { - return new self(new CatalogV1Id()); - } - - /** - * Sets catalog v 1 id field. - * - * @param string|null $value - */ - public function catalogV1Id(?string $value): self - { - $this->instance->setCatalogV1Id($value); - return $this; - } - - /** - * Unsets catalog v 1 id field. - */ - public function unsetCatalogV1Id(): self - { - $this->instance->unsetCatalogV1Id(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Catalog V1 Id object. - */ - public function build(): CatalogV1Id - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CategoryPathToRootNodeBuilder.php b/src/Models/Builders/CategoryPathToRootNodeBuilder.php deleted file mode 100644 index 13372da4..00000000 --- a/src/Models/Builders/CategoryPathToRootNodeBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Category Path To Root Node Builder object. - */ - public static function init(): self - { - return new self(new CategoryPathToRootNode()); - } - - /** - * Sets category id field. - * - * @param string|null $value - */ - public function categoryId(?string $value): self - { - $this->instance->setCategoryId($value); - return $this; - } - - /** - * Unsets category id field. - */ - public function unsetCategoryId(): self - { - $this->instance->unsetCategoryId(); - return $this; - } - - /** - * Sets category name field. - * - * @param string|null $value - */ - public function categoryName(?string $value): self - { - $this->instance->setCategoryName($value); - return $this; - } - - /** - * Unsets category name field. - */ - public function unsetCategoryName(): self - { - $this->instance->unsetCategoryName(); - return $this; - } - - /** - * Initializes a new Category Path To Root Node object. - */ - public function build(): CategoryPathToRootNode - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ChangeBillingAnchorDateRequestBuilder.php b/src/Models/Builders/ChangeBillingAnchorDateRequestBuilder.php deleted file mode 100644 index 5a45174d..00000000 --- a/src/Models/Builders/ChangeBillingAnchorDateRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Change Billing Anchor Date Request Builder object. - */ - public static function init(): self - { - return new self(new ChangeBillingAnchorDateRequest()); - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Unsets monthly billing anchor date field. - */ - public function unsetMonthlyBillingAnchorDate(): self - { - $this->instance->unsetMonthlyBillingAnchorDate(); - return $this; - } - - /** - * Sets effective date field. - * - * @param string|null $value - */ - public function effectiveDate(?string $value): self - { - $this->instance->setEffectiveDate($value); - return $this; - } - - /** - * Unsets effective date field. - */ - public function unsetEffectiveDate(): self - { - $this->instance->unsetEffectiveDate(); - return $this; - } - - /** - * Initializes a new Change Billing Anchor Date Request object. - */ - public function build(): ChangeBillingAnchorDateRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ChangeBillingAnchorDateResponseBuilder.php b/src/Models/Builders/ChangeBillingAnchorDateResponseBuilder.php deleted file mode 100644 index 1a603855..00000000 --- a/src/Models/Builders/ChangeBillingAnchorDateResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Change Billing Anchor Date Response Builder object. - */ - public static function init(): self - { - return new self(new ChangeBillingAnchorDateResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Initializes a new Change Billing Anchor Date Response object. - */ - public function build(): ChangeBillingAnchorDateResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ChargeRequestAdditionalRecipientBuilder.php b/src/Models/Builders/ChargeRequestAdditionalRecipientBuilder.php deleted file mode 100644 index 6218c3f2..00000000 --- a/src/Models/Builders/ChargeRequestAdditionalRecipientBuilder.php +++ /dev/null @@ -1,47 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Charge Request Additional Recipient Builder object. - * - * @param string $locationId - * @param string $description - * @param Money $amountMoney - */ - public static function init(string $locationId, string $description, Money $amountMoney): self - { - return new self(new ChargeRequestAdditionalRecipient($locationId, $description, $amountMoney)); - } - - /** - * Initializes a new Charge Request Additional Recipient object. - */ - public function build(): ChargeRequestAdditionalRecipient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ChargeRequestBuilder.php b/src/Models/Builders/ChargeRequestBuilder.php deleted file mode 100644 index 91e676bd..00000000 --- a/src/Models/Builders/ChargeRequestBuilder.php +++ /dev/null @@ -1,270 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Charge Request Builder object. - * - * @param string $idempotencyKey - * @param Money $amountMoney - */ - public static function init(string $idempotencyKey, Money $amountMoney): self - { - return new self(new ChargeRequest($idempotencyKey, $amountMoney)); - } - - /** - * Sets card nonce field. - * - * @param string|null $value - */ - public function cardNonce(?string $value): self - { - $this->instance->setCardNonce($value); - return $this; - } - - /** - * Unsets card nonce field. - */ - public function unsetCardNonce(): self - { - $this->instance->unsetCardNonce(); - return $this; - } - - /** - * Sets customer card id field. - * - * @param string|null $value - */ - public function customerCardId(?string $value): self - { - $this->instance->setCustomerCardId($value); - return $this; - } - - /** - * Unsets customer card id field. - */ - public function unsetCustomerCardId(): self - { - $this->instance->unsetCustomerCardId(); - return $this; - } - - /** - * Sets delay capture field. - * - * @param bool|null $value - */ - public function delayCapture(?bool $value): self - { - $this->instance->setDelayCapture($value); - return $this; - } - - /** - * Unsets delay capture field. - */ - public function unsetDelayCapture(): self - { - $this->instance->unsetDelayCapture(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets billing address field. - * - * @param Address|null $value - */ - public function billingAddress(?Address $value): self - { - $this->instance->setBillingAddress($value); - return $this; - } - - /** - * Sets shipping address field. - * - * @param Address|null $value - */ - public function shippingAddress(?Address $value): self - { - $this->instance->setShippingAddress($value); - return $this; - } - - /** - * Sets buyer email address field. - * - * @param string|null $value - */ - public function buyerEmailAddress(?string $value): self - { - $this->instance->setBuyerEmailAddress($value); - return $this; - } - - /** - * Unsets buyer email address field. - */ - public function unsetBuyerEmailAddress(): self - { - $this->instance->unsetBuyerEmailAddress(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets additional recipients field. - * - * @param ChargeRequestAdditionalRecipient[]|null $value - */ - public function additionalRecipients(?array $value): self - { - $this->instance->setAdditionalRecipients($value); - return $this; - } - - /** - * Unsets additional recipients field. - */ - public function unsetAdditionalRecipients(): self - { - $this->instance->unsetAdditionalRecipients(); - return $this; - } - - /** - * Sets verification token field. - * - * @param string|null $value - */ - public function verificationToken(?string $value): self - { - $this->instance->setVerificationToken($value); - return $this; - } - - /** - * Unsets verification token field. - */ - public function unsetVerificationToken(): self - { - $this->instance->unsetVerificationToken(); - return $this; - } - - /** - * Initializes a new Charge Request object. - */ - public function build(): ChargeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ChargeResponseBuilder.php b/src/Models/Builders/ChargeResponseBuilder.php deleted file mode 100644 index 91866eac..00000000 --- a/src/Models/Builders/ChargeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Charge Response Builder object. - */ - public static function init(): self - { - return new self(new ChargeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets transaction field. - * - * @param Transaction|null $value - */ - public function transaction(?Transaction $value): self - { - $this->instance->setTransaction($value); - return $this; - } - - /** - * Initializes a new Charge Response object. - */ - public function build(): ChargeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutBuilder.php b/src/Models/Builders/CheckoutBuilder.php deleted file mode 100644 index d895c50a..00000000 --- a/src/Models/Builders/CheckoutBuilder.php +++ /dev/null @@ -1,209 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Builder object. - */ - public static function init(): self - { - return new self(new Checkout()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets checkout page url field. - * - * @param string|null $value - */ - public function checkoutPageUrl(?string $value): self - { - $this->instance->setCheckoutPageUrl($value); - return $this; - } - - /** - * Unsets checkout page url field. - */ - public function unsetCheckoutPageUrl(): self - { - $this->instance->unsetCheckoutPageUrl(); - return $this; - } - - /** - * Sets ask for shipping address field. - * - * @param bool|null $value - */ - public function askForShippingAddress(?bool $value): self - { - $this->instance->setAskForShippingAddress($value); - return $this; - } - - /** - * Unsets ask for shipping address field. - */ - public function unsetAskForShippingAddress(): self - { - $this->instance->unsetAskForShippingAddress(); - return $this; - } - - /** - * Sets merchant support email field. - * - * @param string|null $value - */ - public function merchantSupportEmail(?string $value): self - { - $this->instance->setMerchantSupportEmail($value); - return $this; - } - - /** - * Unsets merchant support email field. - */ - public function unsetMerchantSupportEmail(): self - { - $this->instance->unsetMerchantSupportEmail(); - return $this; - } - - /** - * Sets pre populate buyer email field. - * - * @param string|null $value - */ - public function prePopulateBuyerEmail(?string $value): self - { - $this->instance->setPrePopulateBuyerEmail($value); - return $this; - } - - /** - * Unsets pre populate buyer email field. - */ - public function unsetPrePopulateBuyerEmail(): self - { - $this->instance->unsetPrePopulateBuyerEmail(); - return $this; - } - - /** - * Sets pre populate shipping address field. - * - * @param Address|null $value - */ - public function prePopulateShippingAddress(?Address $value): self - { - $this->instance->setPrePopulateShippingAddress($value); - return $this; - } - - /** - * Sets redirect url field. - * - * @param string|null $value - */ - public function redirectUrl(?string $value): self - { - $this->instance->setRedirectUrl($value); - return $this; - } - - /** - * Unsets redirect url field. - */ - public function unsetRedirectUrl(): self - { - $this->instance->unsetRedirectUrl(); - return $this; - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets additional recipients field. - * - * @param AdditionalRecipient[]|null $value - */ - public function additionalRecipients(?array $value): self - { - $this->instance->setAdditionalRecipients($value); - return $this; - } - - /** - * Unsets additional recipients field. - */ - public function unsetAdditionalRecipients(): self - { - $this->instance->unsetAdditionalRecipients(); - return $this; - } - - /** - * Initializes a new Checkout object. - */ - public function build(): Checkout - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutLocationSettingsBrandingBuilder.php b/src/Models/Builders/CheckoutLocationSettingsBrandingBuilder.php deleted file mode 100644 index 27f1f5d2..00000000 --- a/src/Models/Builders/CheckoutLocationSettingsBrandingBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Location Settings Branding Builder object. - */ - public static function init(): self - { - return new self(new CheckoutLocationSettingsBranding()); - } - - /** - * Sets header type field. - * - * @param string|null $value - */ - public function headerType(?string $value): self - { - $this->instance->setHeaderType($value); - return $this; - } - - /** - * Sets button color field. - * - * @param string|null $value - */ - public function buttonColor(?string $value): self - { - $this->instance->setButtonColor($value); - return $this; - } - - /** - * Unsets button color field. - */ - public function unsetButtonColor(): self - { - $this->instance->unsetButtonColor(); - return $this; - } - - /** - * Sets button shape field. - * - * @param string|null $value - */ - public function buttonShape(?string $value): self - { - $this->instance->setButtonShape($value); - return $this; - } - - /** - * Initializes a new Checkout Location Settings Branding object. - */ - public function build(): CheckoutLocationSettingsBranding - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutLocationSettingsBuilder.php b/src/Models/Builders/CheckoutLocationSettingsBuilder.php deleted file mode 100644 index fcb8e1c1..00000000 --- a/src/Models/Builders/CheckoutLocationSettingsBuilder.php +++ /dev/null @@ -1,150 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Location Settings Builder object. - */ - public static function init(): self - { - return new self(new CheckoutLocationSettings()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets customer notes enabled field. - * - * @param bool|null $value - */ - public function customerNotesEnabled(?bool $value): self - { - $this->instance->setCustomerNotesEnabled($value); - return $this; - } - - /** - * Unsets customer notes enabled field. - */ - public function unsetCustomerNotesEnabled(): self - { - $this->instance->unsetCustomerNotesEnabled(); - return $this; - } - - /** - * Sets policies field. - * - * @param CheckoutLocationSettingsPolicy[]|null $value - */ - public function policies(?array $value): self - { - $this->instance->setPolicies($value); - return $this; - } - - /** - * Unsets policies field. - */ - public function unsetPolicies(): self - { - $this->instance->unsetPolicies(); - return $this; - } - - /** - * Sets branding field. - * - * @param CheckoutLocationSettingsBranding|null $value - */ - public function branding(?CheckoutLocationSettingsBranding $value): self - { - $this->instance->setBranding($value); - return $this; - } - - /** - * Sets tipping field. - * - * @param CheckoutLocationSettingsTipping|null $value - */ - public function tipping(?CheckoutLocationSettingsTipping $value): self - { - $this->instance->setTipping($value); - return $this; - } - - /** - * Sets coupons field. - * - * @param CheckoutLocationSettingsCoupons|null $value - */ - public function coupons(?CheckoutLocationSettingsCoupons $value): self - { - $this->instance->setCoupons($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Checkout Location Settings object. - */ - public function build(): CheckoutLocationSettings - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutLocationSettingsCouponsBuilder.php b/src/Models/Builders/CheckoutLocationSettingsCouponsBuilder.php deleted file mode 100644 index 3b76bee8..00000000 --- a/src/Models/Builders/CheckoutLocationSettingsCouponsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Location Settings Coupons Builder object. - */ - public static function init(): self - { - return new self(new CheckoutLocationSettingsCoupons()); - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Unsets enabled field. - */ - public function unsetEnabled(): self - { - $this->instance->unsetEnabled(); - return $this; - } - - /** - * Initializes a new Checkout Location Settings Coupons object. - */ - public function build(): CheckoutLocationSettingsCoupons - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutLocationSettingsPolicyBuilder.php b/src/Models/Builders/CheckoutLocationSettingsPolicyBuilder.php deleted file mode 100644 index 7fd699b0..00000000 --- a/src/Models/Builders/CheckoutLocationSettingsPolicyBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Location Settings Policy Builder object. - */ - public static function init(): self - { - return new self(new CheckoutLocationSettingsPolicy()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Initializes a new Checkout Location Settings Policy object. - */ - public function build(): CheckoutLocationSettingsPolicy - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutLocationSettingsTippingBuilder.php b/src/Models/Builders/CheckoutLocationSettingsTippingBuilder.php deleted file mode 100644 index fb098ccb..00000000 --- a/src/Models/Builders/CheckoutLocationSettingsTippingBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Location Settings Tipping Builder object. - */ - public static function init(): self - { - return new self(new CheckoutLocationSettingsTipping()); - } - - /** - * Sets percentages field. - * - * @param int[]|null $value - */ - public function percentages(?array $value): self - { - $this->instance->setPercentages($value); - return $this; - } - - /** - * Unsets percentages field. - */ - public function unsetPercentages(): self - { - $this->instance->unsetPercentages(); - return $this; - } - - /** - * Sets smart tipping enabled field. - * - * @param bool|null $value - */ - public function smartTippingEnabled(?bool $value): self - { - $this->instance->setSmartTippingEnabled($value); - return $this; - } - - /** - * Unsets smart tipping enabled field. - */ - public function unsetSmartTippingEnabled(): self - { - $this->instance->unsetSmartTippingEnabled(); - return $this; - } - - /** - * Sets default percent field. - * - * @param int|null $value - */ - public function defaultPercent(?int $value): self - { - $this->instance->setDefaultPercent($value); - return $this; - } - - /** - * Unsets default percent field. - */ - public function unsetDefaultPercent(): self - { - $this->instance->unsetDefaultPercent(); - return $this; - } - - /** - * Sets smart tips field. - * - * @param Money[]|null $value - */ - public function smartTips(?array $value): self - { - $this->instance->setSmartTips($value); - return $this; - } - - /** - * Unsets smart tips field. - */ - public function unsetSmartTips(): self - { - $this->instance->unsetSmartTips(); - return $this; - } - - /** - * Sets default smart tip field. - * - * @param Money|null $value - */ - public function defaultSmartTip(?Money $value): self - { - $this->instance->setDefaultSmartTip($value); - return $this; - } - - /** - * Initializes a new Checkout Location Settings Tipping object. - */ - public function build(): CheckoutLocationSettingsTipping - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutMerchantSettingsBuilder.php b/src/Models/Builders/CheckoutMerchantSettingsBuilder.php deleted file mode 100644 index 4d416faf..00000000 --- a/src/Models/Builders/CheckoutMerchantSettingsBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Merchant Settings Builder object. - */ - public static function init(): self - { - return new self(new CheckoutMerchantSettings()); - } - - /** - * Sets payment methods field. - * - * @param CheckoutMerchantSettingsPaymentMethods|null $value - */ - public function paymentMethods(?CheckoutMerchantSettingsPaymentMethods $value): self - { - $this->instance->setPaymentMethods($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Checkout Merchant Settings object. - */ - public function build(): CheckoutMerchantSettings - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayBuilder.php b/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayBuilder.php deleted file mode 100644 index 82b84866..00000000 --- a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Afterpay Clearpay Builder object. - */ - public static function init(): self - { - return new self(new CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay()); - } - - /** - * Sets order eligibility range field. - * - * @param CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange|null $value - */ - public function orderEligibilityRange( - ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value - ): self { - $this->instance->setOrderEligibilityRange($value); - return $this; - } - - /** - * Sets item eligibility range field. - * - * @param CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange|null $value - */ - public function itemEligibilityRange( - ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value - ): self { - $this->instance->setItemEligibilityRange($value); - return $this; - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Afterpay Clearpay object. - */ - public function build(): CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRangeBuilder.php b/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRangeBuilder.php deleted file mode 100644 index 0796dfde..00000000 --- a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRangeBuilder.php +++ /dev/null @@ -1,48 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range - * Builder object. - * - * @param Money $min - * @param Money $max - */ - public static function init(Money $min, Money $max): self - { - return new self(new CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange($min, $max)); - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range - * object. - */ - public function build(): CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsBuilder.php b/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsBuilder.php deleted file mode 100644 index 8e2cf126..00000000 --- a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Builder object. - */ - public static function init(): self - { - return new self(new CheckoutMerchantSettingsPaymentMethods()); - } - - /** - * Sets apple pay field. - * - * @param CheckoutMerchantSettingsPaymentMethodsPaymentMethod|null $value - */ - public function applePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value): self - { - $this->instance->setApplePay($value); - return $this; - } - - /** - * Sets google pay field. - * - * @param CheckoutMerchantSettingsPaymentMethodsPaymentMethod|null $value - */ - public function googlePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value): self - { - $this->instance->setGooglePay($value); - return $this; - } - - /** - * Sets cash app field. - * - * @param CheckoutMerchantSettingsPaymentMethodsPaymentMethod|null $value - */ - public function cashApp(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value): self - { - $this->instance->setCashApp($value); - return $this; - } - - /** - * Sets afterpay clearpay field. - * - * @param CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay|null $value - */ - public function afterpayClearpay(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay $value): self - { - $this->instance->setAfterpayClearpay($value); - return $this; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods object. - */ - public function build(): CheckoutMerchantSettingsPaymentMethods - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsPaymentMethodBuilder.php b/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsPaymentMethodBuilder.php deleted file mode 100644 index d4286bf6..00000000 --- a/src/Models/Builders/CheckoutMerchantSettingsPaymentMethodsPaymentMethodBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Payment Method Builder object. - */ - public static function init(): self - { - return new self(new CheckoutMerchantSettingsPaymentMethodsPaymentMethod()); - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Unsets enabled field. - */ - public function unsetEnabled(): self - { - $this->instance->unsetEnabled(); - return $this; - } - - /** - * Initializes a new Checkout Merchant Settings Payment Methods Payment Method object. - */ - public function build(): CheckoutMerchantSettingsPaymentMethodsPaymentMethod - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CheckoutOptionsBuilder.php b/src/Models/Builders/CheckoutOptionsBuilder.php deleted file mode 100644 index 4a61aa54..00000000 --- a/src/Models/Builders/CheckoutOptionsBuilder.php +++ /dev/null @@ -1,239 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Checkout Options Builder object. - */ - public static function init(): self - { - return new self(new CheckoutOptions()); - } - - /** - * Sets allow tipping field. - * - * @param bool|null $value - */ - public function allowTipping(?bool $value): self - { - $this->instance->setAllowTipping($value); - return $this; - } - - /** - * Unsets allow tipping field. - */ - public function unsetAllowTipping(): self - { - $this->instance->unsetAllowTipping(); - return $this; - } - - /** - * Sets custom fields field. - * - * @param CustomField[]|null $value - */ - public function customFields(?array $value): self - { - $this->instance->setCustomFields($value); - return $this; - } - - /** - * Unsets custom fields field. - */ - public function unsetCustomFields(): self - { - $this->instance->unsetCustomFields(); - return $this; - } - - /** - * Sets subscription plan id field. - * - * @param string|null $value - */ - public function subscriptionPlanId(?string $value): self - { - $this->instance->setSubscriptionPlanId($value); - return $this; - } - - /** - * Unsets subscription plan id field. - */ - public function unsetSubscriptionPlanId(): self - { - $this->instance->unsetSubscriptionPlanId(); - return $this; - } - - /** - * Sets redirect url field. - * - * @param string|null $value - */ - public function redirectUrl(?string $value): self - { - $this->instance->setRedirectUrl($value); - return $this; - } - - /** - * Unsets redirect url field. - */ - public function unsetRedirectUrl(): self - { - $this->instance->unsetRedirectUrl(); - return $this; - } - - /** - * Sets merchant support email field. - * - * @param string|null $value - */ - public function merchantSupportEmail(?string $value): self - { - $this->instance->setMerchantSupportEmail($value); - return $this; - } - - /** - * Unsets merchant support email field. - */ - public function unsetMerchantSupportEmail(): self - { - $this->instance->unsetMerchantSupportEmail(); - return $this; - } - - /** - * Sets ask for shipping address field. - * - * @param bool|null $value - */ - public function askForShippingAddress(?bool $value): self - { - $this->instance->setAskForShippingAddress($value); - return $this; - } - - /** - * Unsets ask for shipping address field. - */ - public function unsetAskForShippingAddress(): self - { - $this->instance->unsetAskForShippingAddress(); - return $this; - } - - /** - * Sets accepted payment methods field. - * - * @param AcceptedPaymentMethods|null $value - */ - public function acceptedPaymentMethods(?AcceptedPaymentMethods $value): self - { - $this->instance->setAcceptedPaymentMethods($value); - return $this; - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets shipping fee field. - * - * @param ShippingFee|null $value - */ - public function shippingFee(?ShippingFee $value): self - { - $this->instance->setShippingFee($value); - return $this; - } - - /** - * Sets enable coupon field. - * - * @param bool|null $value - */ - public function enableCoupon(?bool $value): self - { - $this->instance->setEnableCoupon($value); - return $this; - } - - /** - * Unsets enable coupon field. - */ - public function unsetEnableCoupon(): self - { - $this->instance->unsetEnableCoupon(); - return $this; - } - - /** - * Sets enable loyalty field. - * - * @param bool|null $value - */ - public function enableLoyalty(?bool $value): self - { - $this->instance->setEnableLoyalty($value); - return $this; - } - - /** - * Unsets enable loyalty field. - */ - public function unsetEnableLoyalty(): self - { - $this->instance->unsetEnableLoyalty(); - return $this; - } - - /** - * Initializes a new Checkout Options object. - */ - public function build(): CheckoutOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ClearpayDetailsBuilder.php b/src/Models/Builders/ClearpayDetailsBuilder.php deleted file mode 100644 index 624468e8..00000000 --- a/src/Models/Builders/ClearpayDetailsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Clearpay Details Builder object. - */ - public static function init(): self - { - return new self(new ClearpayDetails()); - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Initializes a new Clearpay Details object. - */ - public function build(): ClearpayDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CloneOrderRequestBuilder.php b/src/Models/Builders/CloneOrderRequestBuilder.php deleted file mode 100644 index 9d05715d..00000000 --- a/src/Models/Builders/CloneOrderRequestBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Clone Order Request Builder object. - * - * @param string $orderId - */ - public static function init(string $orderId): self - { - return new self(new CloneOrderRequest($orderId)); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Clone Order Request object. - */ - public function build(): CloneOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CloneOrderResponseBuilder.php b/src/Models/Builders/CloneOrderResponseBuilder.php deleted file mode 100644 index 70d2eeb5..00000000 --- a/src/Models/Builders/CloneOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Clone Order Response Builder object. - */ - public static function init(): self - { - return new self(new CloneOrderResponse()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Clone Order Response object. - */ - public function build(): CloneOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CollectedDataBuilder.php b/src/Models/Builders/CollectedDataBuilder.php deleted file mode 100644 index 30779af7..00000000 --- a/src/Models/Builders/CollectedDataBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Collected Data Builder object. - */ - public static function init(): self - { - return new self(new CollectedData()); - } - - /** - * Sets input text field. - * - * @param string|null $value - */ - public function inputText(?string $value): self - { - $this->instance->setInputText($value); - return $this; - } - - /** - * Initializes a new Collected Data object. - */ - public function build(): CollectedData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CompletePaymentRequestBuilder.php b/src/Models/Builders/CompletePaymentRequestBuilder.php deleted file mode 100644 index 0c465a89..00000000 --- a/src/Models/Builders/CompletePaymentRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Complete Payment Request Builder object. - */ - public static function init(): self - { - return new self(new CompletePaymentRequest()); - } - - /** - * Sets version token field. - * - * @param string|null $value - */ - public function versionToken(?string $value): self - { - $this->instance->setVersionToken($value); - return $this; - } - - /** - * Unsets version token field. - */ - public function unsetVersionToken(): self - { - $this->instance->unsetVersionToken(); - return $this; - } - - /** - * Initializes a new Complete Payment Request object. - */ - public function build(): CompletePaymentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CompletePaymentResponseBuilder.php b/src/Models/Builders/CompletePaymentResponseBuilder.php deleted file mode 100644 index 1e8f3241..00000000 --- a/src/Models/Builders/CompletePaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Complete Payment Response Builder object. - */ - public static function init(): self - { - return new self(new CompletePaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Complete Payment Response object. - */ - public function build(): CompletePaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ComponentBuilder.php b/src/Models/Builders/ComponentBuilder.php deleted file mode 100644 index 75fb30f8..00000000 --- a/src/Models/Builders/ComponentBuilder.php +++ /dev/null @@ -1,104 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Component Builder object. - * - * @param string $type - */ - public static function init(string $type): self - { - return new self(new Component($type)); - } - - /** - * Sets application details field. - * - * @param DeviceComponentDetailsApplicationDetails|null $value - */ - public function applicationDetails(?DeviceComponentDetailsApplicationDetails $value): self - { - $this->instance->setApplicationDetails($value); - return $this; - } - - /** - * Sets card reader details field. - * - * @param DeviceComponentDetailsCardReaderDetails|null $value - */ - public function cardReaderDetails(?DeviceComponentDetailsCardReaderDetails $value): self - { - $this->instance->setCardReaderDetails($value); - return $this; - } - - /** - * Sets battery details field. - * - * @param DeviceComponentDetailsBatteryDetails|null $value - */ - public function batteryDetails(?DeviceComponentDetailsBatteryDetails $value): self - { - $this->instance->setBatteryDetails($value); - return $this; - } - - /** - * Sets wifi details field. - * - * @param DeviceComponentDetailsWiFiDetails|null $value - */ - public function wifiDetails(?DeviceComponentDetailsWiFiDetails $value): self - { - $this->instance->setWifiDetails($value); - return $this; - } - - /** - * Sets ethernet details field. - * - * @param DeviceComponentDetailsEthernetDetails|null $value - */ - public function ethernetDetails(?DeviceComponentDetailsEthernetDetails $value): self - { - $this->instance->setEthernetDetails($value); - return $this; - } - - /** - * Initializes a new Component object. - */ - public function build(): Component - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ConfirmationDecisionBuilder.php b/src/Models/Builders/ConfirmationDecisionBuilder.php deleted file mode 100644 index b842d565..00000000 --- a/src/Models/Builders/ConfirmationDecisionBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Confirmation Decision Builder object. - */ - public static function init(): self - { - return new self(new ConfirmationDecision()); - } - - /** - * Sets has agreed field. - * - * @param bool|null $value - */ - public function hasAgreed(?bool $value): self - { - $this->instance->setHasAgreed($value); - return $this; - } - - /** - * Initializes a new Confirmation Decision object. - */ - public function build(): ConfirmationDecision - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ConfirmationOptionsBuilder.php b/src/Models/Builders/ConfirmationOptionsBuilder.php deleted file mode 100644 index 8c44bcbe..00000000 --- a/src/Models/Builders/ConfirmationOptionsBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Confirmation Options Builder object. - * - * @param string $title - * @param string $body - * @param string $agreeButtonText - */ - public static function init(string $title, string $body, string $agreeButtonText): self - { - return new self(new ConfirmationOptions($title, $body, $agreeButtonText)); - } - - /** - * Sets disagree button text field. - * - * @param string|null $value - */ - public function disagreeButtonText(?string $value): self - { - $this->instance->setDisagreeButtonText($value); - return $this; - } - - /** - * Unsets disagree button text field. - */ - public function unsetDisagreeButtonText(): self - { - $this->instance->unsetDisagreeButtonText(); - return $this; - } - - /** - * Sets decision field. - * - * @param ConfirmationDecision|null $value - */ - public function decision(?ConfirmationDecision $value): self - { - $this->instance->setDecision($value); - return $this; - } - - /** - * Initializes a new Confirmation Options object. - */ - public function build(): ConfirmationOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CoordinatesBuilder.php b/src/Models/Builders/CoordinatesBuilder.php deleted file mode 100644 index a028baa5..00000000 --- a/src/Models/Builders/CoordinatesBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Coordinates Builder object. - */ - public static function init(): self - { - return new self(new Coordinates()); - } - - /** - * Sets latitude field. - * - * @param float|null $value - */ - public function latitude(?float $value): self - { - $this->instance->setLatitude($value); - return $this; - } - - /** - * Unsets latitude field. - */ - public function unsetLatitude(): self - { - $this->instance->unsetLatitude(); - return $this; - } - - /** - * Sets longitude field. - * - * @param float|null $value - */ - public function longitude(?float $value): self - { - $this->instance->setLongitude($value); - return $this; - } - - /** - * Unsets longitude field. - */ - public function unsetLongitude(): self - { - $this->instance->unsetLongitude(); - return $this; - } - - /** - * Initializes a new Coordinates object. - */ - public function build(): Coordinates - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBookingCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/CreateBookingCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index dcc36ed5..00000000 --- a/src/Models/Builders/CreateBookingCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Booking Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new CreateBookingCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Booking Custom Attribute Definition Request object. - */ - public function build(): CreateBookingCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBookingCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/CreateBookingCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index b61d7029..00000000 --- a/src/Models/Builders/CreateBookingCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Booking Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new CreateBookingCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Booking Custom Attribute Definition Response object. - */ - public function build(): CreateBookingCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBookingRequestBuilder.php b/src/Models/Builders/CreateBookingRequestBuilder.php deleted file mode 100644 index 7801d5f8..00000000 --- a/src/Models/Builders/CreateBookingRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Booking Request Builder object. - * - * @param Booking $booking - */ - public static function init(Booking $booking): self - { - return new self(new CreateBookingRequest($booking)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Booking Request object. - */ - public function build(): CreateBookingRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBookingResponseBuilder.php b/src/Models/Builders/CreateBookingResponseBuilder.php deleted file mode 100644 index eb6bddac..00000000 --- a/src/Models/Builders/CreateBookingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Booking Response Builder object. - */ - public static function init(): self - { - return new self(new CreateBookingResponse()); - } - - /** - * Sets booking field. - * - * @param Booking|null $value - */ - public function booking(?Booking $value): self - { - $this->instance->setBooking($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Booking Response object. - */ - public function build(): CreateBookingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBreakTypeRequestBuilder.php b/src/Models/Builders/CreateBreakTypeRequestBuilder.php deleted file mode 100644 index b11096a3..00000000 --- a/src/Models/Builders/CreateBreakTypeRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Break Type Request Builder object. - * - * @param BreakType $breakType - */ - public static function init(BreakType $breakType): self - { - return new self(new CreateBreakTypeRequest($breakType)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Break Type Request object. - */ - public function build(): CreateBreakTypeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateBreakTypeResponseBuilder.php b/src/Models/Builders/CreateBreakTypeResponseBuilder.php deleted file mode 100644 index 19863bfc..00000000 --- a/src/Models/Builders/CreateBreakTypeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Break Type Response Builder object. - */ - public static function init(): self - { - return new self(new CreateBreakTypeResponse()); - } - - /** - * Sets break type field. - * - * @param BreakType|null $value - */ - public function breakType(?BreakType $value): self - { - $this->instance->setBreakType($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Break Type Response object. - */ - public function build(): CreateBreakTypeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCardRequestBuilder.php b/src/Models/Builders/CreateCardRequestBuilder.php deleted file mode 100644 index 95414163..00000000 --- a/src/Models/Builders/CreateCardRequestBuilder.php +++ /dev/null @@ -1,58 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Card Request Builder object. - * - * @param string $idempotencyKey - * @param string $sourceId - * @param Card $card - */ - public static function init(string $idempotencyKey, string $sourceId, Card $card): self - { - return new self(new CreateCardRequest($idempotencyKey, $sourceId, $card)); - } - - /** - * Sets verification token field. - * - * @param string|null $value - */ - public function verificationToken(?string $value): self - { - $this->instance->setVerificationToken($value); - return $this; - } - - /** - * Initializes a new Create Card Request object. - */ - public function build(): CreateCardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCardResponseBuilder.php b/src/Models/Builders/CreateCardResponseBuilder.php deleted file mode 100644 index ad8a423c..00000000 --- a/src/Models/Builders/CreateCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Card Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Initializes a new Create Card Response object. - */ - public function build(): CreateCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCatalogImageRequestBuilder.php b/src/Models/Builders/CreateCatalogImageRequestBuilder.php deleted file mode 100644 index a34d2c4d..00000000 --- a/src/Models/Builders/CreateCatalogImageRequestBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Catalog Image Request Builder object. - * - * @param string $idempotencyKey - * @param CatalogObject $image - */ - public static function init(string $idempotencyKey, CatalogObject $image): self - { - return new self(new CreateCatalogImageRequest($idempotencyKey, $image)); - } - - /** - * Sets object id field. - * - * @param string|null $value - */ - public function objectId(?string $value): self - { - $this->instance->setObjectId($value); - return $this; - } - - /** - * Sets is primary field. - * - * @param bool|null $value - */ - public function isPrimary(?bool $value): self - { - $this->instance->setIsPrimary($value); - return $this; - } - - /** - * Initializes a new Create Catalog Image Request object. - */ - public function build(): CreateCatalogImageRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCatalogImageResponseBuilder.php b/src/Models/Builders/CreateCatalogImageResponseBuilder.php deleted file mode 100644 index 261f900e..00000000 --- a/src/Models/Builders/CreateCatalogImageResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Catalog Image Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCatalogImageResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets image field. - * - * @param CatalogObject|null $value - */ - public function image(?CatalogObject $value): self - { - $this->instance->setImage($value); - return $this; - } - - /** - * Initializes a new Create Catalog Image Response object. - */ - public function build(): CreateCatalogImageResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCheckoutRequestBuilder.php b/src/Models/Builders/CreateCheckoutRequestBuilder.php deleted file mode 100644 index 5358ec5d..00000000 --- a/src/Models/Builders/CreateCheckoutRequestBuilder.php +++ /dev/null @@ -1,125 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Checkout Request Builder object. - * - * @param string $idempotencyKey - * @param CreateOrderRequest $order - */ - public static function init(string $idempotencyKey, CreateOrderRequest $order): self - { - return new self(new CreateCheckoutRequest($idempotencyKey, $order)); - } - - /** - * Sets ask for shipping address field. - * - * @param bool|null $value - */ - public function askForShippingAddress(?bool $value): self - { - $this->instance->setAskForShippingAddress($value); - return $this; - } - - /** - * Sets merchant support email field. - * - * @param string|null $value - */ - public function merchantSupportEmail(?string $value): self - { - $this->instance->setMerchantSupportEmail($value); - return $this; - } - - /** - * Sets pre populate buyer email field. - * - * @param string|null $value - */ - public function prePopulateBuyerEmail(?string $value): self - { - $this->instance->setPrePopulateBuyerEmail($value); - return $this; - } - - /** - * Sets pre populate shipping address field. - * - * @param Address|null $value - */ - public function prePopulateShippingAddress(?Address $value): self - { - $this->instance->setPrePopulateShippingAddress($value); - return $this; - } - - /** - * Sets redirect url field. - * - * @param string|null $value - */ - public function redirectUrl(?string $value): self - { - $this->instance->setRedirectUrl($value); - return $this; - } - - /** - * Sets additional recipients field. - * - * @param ChargeRequestAdditionalRecipient[]|null $value - */ - public function additionalRecipients(?array $value): self - { - $this->instance->setAdditionalRecipients($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Initializes a new Create Checkout Request object. - */ - public function build(): CreateCheckoutRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCheckoutResponseBuilder.php b/src/Models/Builders/CreateCheckoutResponseBuilder.php deleted file mode 100644 index 193b31a2..00000000 --- a/src/Models/Builders/CreateCheckoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Checkout Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCheckoutResponse()); - } - - /** - * Sets checkout field. - * - * @param Checkout|null $value - */ - public function checkout(?Checkout $value): self - { - $this->instance->setCheckout($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Checkout Response object. - */ - public function build(): CreateCheckoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerCardRequestBuilder.php b/src/Models/Builders/CreateCustomerCardRequestBuilder.php deleted file mode 100644 index 6562d1a9..00000000 --- a/src/Models/Builders/CreateCustomerCardRequestBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Card Request Builder object. - * - * @param string $cardNonce - */ - public static function init(string $cardNonce): self - { - return new self(new CreateCustomerCardRequest($cardNonce)); - } - - /** - * Sets billing address field. - * - * @param Address|null $value - */ - public function billingAddress(?Address $value): self - { - $this->instance->setBillingAddress($value); - return $this; - } - - /** - * Sets cardholder name field. - * - * @param string|null $value - */ - public function cardholderName(?string $value): self - { - $this->instance->setCardholderName($value); - return $this; - } - - /** - * Sets verification token field. - * - * @param string|null $value - */ - public function verificationToken(?string $value): self - { - $this->instance->setVerificationToken($value); - return $this; - } - - /** - * Initializes a new Create Customer Card Request object. - */ - public function build(): CreateCustomerCardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerCardResponseBuilder.php b/src/Models/Builders/CreateCustomerCardResponseBuilder.php deleted file mode 100644 index 4813f9de..00000000 --- a/src/Models/Builders/CreateCustomerCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Card Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCustomerCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Initializes a new Create Customer Card Response object. - */ - public function build(): CreateCustomerCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/CreateCustomerCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index c7402091..00000000 --- a/src/Models/Builders/CreateCustomerCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new CreateCustomerCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Customer Custom Attribute Definition Request object. - */ - public function build(): CreateCustomerCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/CreateCustomerCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 71777f64..00000000 --- a/src/Models/Builders/CreateCustomerCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCustomerCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Customer Custom Attribute Definition Response object. - */ - public function build(): CreateCustomerCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerGroupRequestBuilder.php b/src/Models/Builders/CreateCustomerGroupRequestBuilder.php deleted file mode 100644 index cc1c42e9..00000000 --- a/src/Models/Builders/CreateCustomerGroupRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Group Request Builder object. - * - * @param CustomerGroup $group - */ - public static function init(CustomerGroup $group): self - { - return new self(new CreateCustomerGroupRequest($group)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Customer Group Request object. - */ - public function build(): CreateCustomerGroupRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerGroupResponseBuilder.php b/src/Models/Builders/CreateCustomerGroupResponseBuilder.php deleted file mode 100644 index 094133d9..00000000 --- a/src/Models/Builders/CreateCustomerGroupResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Group Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCustomerGroupResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets group field. - * - * @param CustomerGroup|null $value - */ - public function group(?CustomerGroup $value): self - { - $this->instance->setGroup($value); - return $this; - } - - /** - * Initializes a new Create Customer Group Response object. - */ - public function build(): CreateCustomerGroupResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerRequestBuilder.php b/src/Models/Builders/CreateCustomerRequestBuilder.php deleted file mode 100644 index d72920fb..00000000 --- a/src/Models/Builders/CreateCustomerRequestBuilder.php +++ /dev/null @@ -1,176 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Request Builder object. - */ - public static function init(): self - { - return new self(new CreateCustomerRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Sets nickname field. - * - * @param string|null $value - */ - public function nickname(?string $value): self - { - $this->instance->setNickname($value); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Sets birthday field. - * - * @param string|null $value - */ - public function birthday(?string $value): self - { - $this->instance->setBirthday($value); - return $this; - } - - /** - * Sets tax ids field. - * - * @param CustomerTaxIds|null $value - */ - public function taxIds(?CustomerTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Create Customer Request object. - */ - public function build(): CreateCustomerRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateCustomerResponseBuilder.php b/src/Models/Builders/CreateCustomerResponseBuilder.php deleted file mode 100644 index de36d02c..00000000 --- a/src/Models/Builders/CreateCustomerResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Customer Response Builder object. - */ - public static function init(): self - { - return new self(new CreateCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets customer field. - * - * @param Customer|null $value - */ - public function customer(?Customer $value): self - { - $this->instance->setCustomer($value); - return $this; - } - - /** - * Initializes a new Create Customer Response object. - */ - public function build(): CreateCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDeviceCodeRequestBuilder.php b/src/Models/Builders/CreateDeviceCodeRequestBuilder.php deleted file mode 100644 index 01db2ee6..00000000 --- a/src/Models/Builders/CreateDeviceCodeRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Device Code Request Builder object. - * - * @param string $idempotencyKey - * @param DeviceCode $deviceCode - */ - public static function init(string $idempotencyKey, DeviceCode $deviceCode): self - { - return new self(new CreateDeviceCodeRequest($idempotencyKey, $deviceCode)); - } - - /** - * Initializes a new Create Device Code Request object. - */ - public function build(): CreateDeviceCodeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDeviceCodeResponseBuilder.php b/src/Models/Builders/CreateDeviceCodeResponseBuilder.php deleted file mode 100644 index 064cdff1..00000000 --- a/src/Models/Builders/CreateDeviceCodeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Device Code Response Builder object. - */ - public static function init(): self - { - return new self(new CreateDeviceCodeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets device code field. - * - * @param DeviceCode|null $value - */ - public function deviceCode(?DeviceCode $value): self - { - $this->instance->setDeviceCode($value); - return $this; - } - - /** - * Initializes a new Create Device Code Response object. - */ - public function build(): CreateDeviceCodeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDisputeEvidenceFileRequestBuilder.php b/src/Models/Builders/CreateDisputeEvidenceFileRequestBuilder.php deleted file mode 100644 index c29ca5bf..00000000 --- a/src/Models/Builders/CreateDisputeEvidenceFileRequestBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Dispute Evidence File Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new CreateDisputeEvidenceFileRequest($idempotencyKey)); - } - - /** - * Sets evidence type field. - * - * @param string|null $value - */ - public function evidenceType(?string $value): self - { - $this->instance->setEvidenceType($value); - return $this; - } - - /** - * Sets content type field. - * - * @param string|null $value - */ - public function contentType(?string $value): self - { - $this->instance->setContentType($value); - return $this; - } - - /** - * Initializes a new Create Dispute Evidence File Request object. - */ - public function build(): CreateDisputeEvidenceFileRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDisputeEvidenceFileResponseBuilder.php b/src/Models/Builders/CreateDisputeEvidenceFileResponseBuilder.php deleted file mode 100644 index 610d65c3..00000000 --- a/src/Models/Builders/CreateDisputeEvidenceFileResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Dispute Evidence File Response Builder object. - */ - public static function init(): self - { - return new self(new CreateDisputeEvidenceFileResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence|null $value - */ - public function evidence(?DisputeEvidence $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Initializes a new Create Dispute Evidence File Response object. - */ - public function build(): CreateDisputeEvidenceFileResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDisputeEvidenceTextRequestBuilder.php b/src/Models/Builders/CreateDisputeEvidenceTextRequestBuilder.php deleted file mode 100644 index b76719f7..00000000 --- a/src/Models/Builders/CreateDisputeEvidenceTextRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Dispute Evidence Text Request Builder object. - * - * @param string $idempotencyKey - * @param string $evidenceText - */ - public static function init(string $idempotencyKey, string $evidenceText): self - { - return new self(new CreateDisputeEvidenceTextRequest($idempotencyKey, $evidenceText)); - } - - /** - * Sets evidence type field. - * - * @param string|null $value - */ - public function evidenceType(?string $value): self - { - $this->instance->setEvidenceType($value); - return $this; - } - - /** - * Initializes a new Create Dispute Evidence Text Request object. - */ - public function build(): CreateDisputeEvidenceTextRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateDisputeEvidenceTextResponseBuilder.php b/src/Models/Builders/CreateDisputeEvidenceTextResponseBuilder.php deleted file mode 100644 index 034d7f85..00000000 --- a/src/Models/Builders/CreateDisputeEvidenceTextResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Dispute Evidence Text Response Builder object. - */ - public static function init(): self - { - return new self(new CreateDisputeEvidenceTextResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence|null $value - */ - public function evidence(?DisputeEvidence $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Initializes a new Create Dispute Evidence Text Response object. - */ - public function build(): CreateDisputeEvidenceTextResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateGiftCardActivityRequestBuilder.php b/src/Models/Builders/CreateGiftCardActivityRequestBuilder.php deleted file mode 100644 index 96e7b90a..00000000 --- a/src/Models/Builders/CreateGiftCardActivityRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Gift Card Activity Request Builder object. - * - * @param string $idempotencyKey - * @param GiftCardActivity $giftCardActivity - */ - public static function init(string $idempotencyKey, GiftCardActivity $giftCardActivity): self - { - return new self(new CreateGiftCardActivityRequest($idempotencyKey, $giftCardActivity)); - } - - /** - * Initializes a new Create Gift Card Activity Request object. - */ - public function build(): CreateGiftCardActivityRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateGiftCardActivityResponseBuilder.php b/src/Models/Builders/CreateGiftCardActivityResponseBuilder.php deleted file mode 100644 index eb481cac..00000000 --- a/src/Models/Builders/CreateGiftCardActivityResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Gift Card Activity Response Builder object. - */ - public static function init(): self - { - return new self(new CreateGiftCardActivityResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card activity field. - * - * @param GiftCardActivity|null $value - */ - public function giftCardActivity(?GiftCardActivity $value): self - { - $this->instance->setGiftCardActivity($value); - return $this; - } - - /** - * Initializes a new Create Gift Card Activity Response object. - */ - public function build(): CreateGiftCardActivityResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateGiftCardRequestBuilder.php b/src/Models/Builders/CreateGiftCardRequestBuilder.php deleted file mode 100644 index 2d8dc1f6..00000000 --- a/src/Models/Builders/CreateGiftCardRequestBuilder.php +++ /dev/null @@ -1,47 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Gift Card Request Builder object. - * - * @param string $idempotencyKey - * @param string $locationId - * @param GiftCard $giftCard - */ - public static function init(string $idempotencyKey, string $locationId, GiftCard $giftCard): self - { - return new self(new CreateGiftCardRequest($idempotencyKey, $locationId, $giftCard)); - } - - /** - * Initializes a new Create Gift Card Request object. - */ - public function build(): CreateGiftCardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateGiftCardResponseBuilder.php b/src/Models/Builders/CreateGiftCardResponseBuilder.php deleted file mode 100644 index cbde14f6..00000000 --- a/src/Models/Builders/CreateGiftCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Gift Card Response Builder object. - */ - public static function init(): self - { - return new self(new CreateGiftCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Create Gift Card Response object. - */ - public function build(): CreateGiftCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateInvoiceAttachmentRequestBuilder.php b/src/Models/Builders/CreateInvoiceAttachmentRequestBuilder.php deleted file mode 100644 index 6e59da72..00000000 --- a/src/Models/Builders/CreateInvoiceAttachmentRequestBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Invoice Attachment Request Builder object. - */ - public static function init(): self - { - return new self(new CreateInvoiceAttachmentRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Initializes a new Create Invoice Attachment Request object. - */ - public function build(): CreateInvoiceAttachmentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateInvoiceAttachmentResponseBuilder.php b/src/Models/Builders/CreateInvoiceAttachmentResponseBuilder.php deleted file mode 100644 index bea236f7..00000000 --- a/src/Models/Builders/CreateInvoiceAttachmentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Invoice Attachment Response Builder object. - */ - public static function init(): self - { - return new self(new CreateInvoiceAttachmentResponse()); - } - - /** - * Sets attachment field. - * - * @param InvoiceAttachment|null $value - */ - public function attachment(?InvoiceAttachment $value): self - { - $this->instance->setAttachment($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Invoice Attachment Response object. - */ - public function build(): CreateInvoiceAttachmentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateInvoiceRequestBuilder.php b/src/Models/Builders/CreateInvoiceRequestBuilder.php deleted file mode 100644 index eb826906..00000000 --- a/src/Models/Builders/CreateInvoiceRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Invoice Request Builder object. - * - * @param Invoice $invoice - */ - public static function init(Invoice $invoice): self - { - return new self(new CreateInvoiceRequest($invoice)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Invoice Request object. - */ - public function build(): CreateInvoiceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateInvoiceResponseBuilder.php b/src/Models/Builders/CreateInvoiceResponseBuilder.php deleted file mode 100644 index 97870c17..00000000 --- a/src/Models/Builders/CreateInvoiceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new CreateInvoiceResponse()); - } - - /** - * Sets invoice field. - * - * @param Invoice|null $value - */ - public function invoice(?Invoice $value): self - { - $this->instance->setInvoice($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Invoice Response object. - */ - public function build(): CreateInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateJobRequestBuilder.php b/src/Models/Builders/CreateJobRequestBuilder.php deleted file mode 100644 index 0705c5f8..00000000 --- a/src/Models/Builders/CreateJobRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Job Request Builder object. - * - * @param Job $job - * @param string $idempotencyKey - */ - public static function init(Job $job, string $idempotencyKey): self - { - return new self(new CreateJobRequest($job, $idempotencyKey)); - } - - /** - * Initializes a new Create Job Request object. - */ - public function build(): CreateJobRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateJobResponseBuilder.php b/src/Models/Builders/CreateJobResponseBuilder.php deleted file mode 100644 index aaa1a14e..00000000 --- a/src/Models/Builders/CreateJobResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Job Response Builder object. - */ - public static function init(): self - { - return new self(new CreateJobResponse()); - } - - /** - * Sets job field. - * - * @param Job|null $value - */ - public function job(?Job $value): self - { - $this->instance->setJob($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Job Response object. - */ - public function build(): CreateJobResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLocationCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/CreateLocationCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 0364b75a..00000000 --- a/src/Models/Builders/CreateLocationCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Location Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new CreateLocationCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Location Custom Attribute Definition Request object. - */ - public function build(): CreateLocationCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLocationCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/CreateLocationCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 3c3a7185..00000000 --- a/src/Models/Builders/CreateLocationCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Location Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new CreateLocationCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Location Custom Attribute Definition Response object. - */ - public function build(): CreateLocationCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLocationRequestBuilder.php b/src/Models/Builders/CreateLocationRequestBuilder.php deleted file mode 100644 index 82636855..00000000 --- a/src/Models/Builders/CreateLocationRequestBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Location Request Builder object. - */ - public static function init(): self - { - return new self(new CreateLocationRequest()); - } - - /** - * Sets location field. - * - * @param Location|null $value - */ - public function location(?Location $value): self - { - $this->instance->setLocation($value); - return $this; - } - - /** - * Initializes a new Create Location Request object. - */ - public function build(): CreateLocationRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLocationResponseBuilder.php b/src/Models/Builders/CreateLocationResponseBuilder.php deleted file mode 100644 index 4e8f1cd3..00000000 --- a/src/Models/Builders/CreateLocationResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Location Response Builder object. - */ - public static function init(): self - { - return new self(new CreateLocationResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets location field. - * - * @param Location|null $value - */ - public function location(?Location $value): self - { - $this->instance->setLocation($value); - return $this; - } - - /** - * Initializes a new Create Location Response object. - */ - public function build(): CreateLocationResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyAccountRequestBuilder.php b/src/Models/Builders/CreateLoyaltyAccountRequestBuilder.php deleted file mode 100644 index 0b6f4d6f..00000000 --- a/src/Models/Builders/CreateLoyaltyAccountRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Account Request Builder object. - * - * @param LoyaltyAccount $loyaltyAccount - * @param string $idempotencyKey - */ - public static function init(LoyaltyAccount $loyaltyAccount, string $idempotencyKey): self - { - return new self(new CreateLoyaltyAccountRequest($loyaltyAccount, $idempotencyKey)); - } - - /** - * Initializes a new Create Loyalty Account Request object. - */ - public function build(): CreateLoyaltyAccountRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyAccountResponseBuilder.php b/src/Models/Builders/CreateLoyaltyAccountResponseBuilder.php deleted file mode 100644 index 6cba7d42..00000000 --- a/src/Models/Builders/CreateLoyaltyAccountResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Account Response Builder object. - */ - public static function init(): self - { - return new self(new CreateLoyaltyAccountResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty account field. - * - * @param LoyaltyAccount|null $value - */ - public function loyaltyAccount(?LoyaltyAccount $value): self - { - $this->instance->setLoyaltyAccount($value); - return $this; - } - - /** - * Initializes a new Create Loyalty Account Response object. - */ - public function build(): CreateLoyaltyAccountResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyPromotionRequestBuilder.php b/src/Models/Builders/CreateLoyaltyPromotionRequestBuilder.php deleted file mode 100644 index d0b5472a..00000000 --- a/src/Models/Builders/CreateLoyaltyPromotionRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Promotion Request Builder object. - * - * @param LoyaltyPromotion $loyaltyPromotion - * @param string $idempotencyKey - */ - public static function init(LoyaltyPromotion $loyaltyPromotion, string $idempotencyKey): self - { - return new self(new CreateLoyaltyPromotionRequest($loyaltyPromotion, $idempotencyKey)); - } - - /** - * Initializes a new Create Loyalty Promotion Request object. - */ - public function build(): CreateLoyaltyPromotionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyPromotionResponseBuilder.php b/src/Models/Builders/CreateLoyaltyPromotionResponseBuilder.php deleted file mode 100644 index 8b36e027..00000000 --- a/src/Models/Builders/CreateLoyaltyPromotionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Promotion Response Builder object. - */ - public static function init(): self - { - return new self(new CreateLoyaltyPromotionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty promotion field. - * - * @param LoyaltyPromotion|null $value - */ - public function loyaltyPromotion(?LoyaltyPromotion $value): self - { - $this->instance->setLoyaltyPromotion($value); - return $this; - } - - /** - * Initializes a new Create Loyalty Promotion Response object. - */ - public function build(): CreateLoyaltyPromotionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyRewardRequestBuilder.php b/src/Models/Builders/CreateLoyaltyRewardRequestBuilder.php deleted file mode 100644 index 9d3012e1..00000000 --- a/src/Models/Builders/CreateLoyaltyRewardRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Reward Request Builder object. - * - * @param LoyaltyReward $reward - * @param string $idempotencyKey - */ - public static function init(LoyaltyReward $reward, string $idempotencyKey): self - { - return new self(new CreateLoyaltyRewardRequest($reward, $idempotencyKey)); - } - - /** - * Initializes a new Create Loyalty Reward Request object. - */ - public function build(): CreateLoyaltyRewardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateLoyaltyRewardResponseBuilder.php b/src/Models/Builders/CreateLoyaltyRewardResponseBuilder.php deleted file mode 100644 index f334f826..00000000 --- a/src/Models/Builders/CreateLoyaltyRewardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Loyalty Reward Response Builder object. - */ - public static function init(): self - { - return new self(new CreateLoyaltyRewardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets reward field. - * - * @param LoyaltyReward|null $value - */ - public function reward(?LoyaltyReward $value): self - { - $this->instance->setReward($value); - return $this; - } - - /** - * Initializes a new Create Loyalty Reward Response object. - */ - public function build(): CreateLoyaltyRewardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateMerchantCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/CreateMerchantCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index ab4ef969..00000000 --- a/src/Models/Builders/CreateMerchantCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Merchant Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new CreateMerchantCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Merchant Custom Attribute Definition Request object. - */ - public function build(): CreateMerchantCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateMerchantCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/CreateMerchantCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 978a03d5..00000000 --- a/src/Models/Builders/CreateMerchantCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Merchant Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new CreateMerchantCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Merchant Custom Attribute Definition Response object. - */ - public function build(): CreateMerchantCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateMobileAuthorizationCodeRequestBuilder.php b/src/Models/Builders/CreateMobileAuthorizationCodeRequestBuilder.php deleted file mode 100644 index 307cca99..00000000 --- a/src/Models/Builders/CreateMobileAuthorizationCodeRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Mobile Authorization Code Request Builder object. - */ - public static function init(): self - { - return new self(new CreateMobileAuthorizationCodeRequest()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Initializes a new Create Mobile Authorization Code Request object. - */ - public function build(): CreateMobileAuthorizationCodeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php b/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php deleted file mode 100644 index 176cc1cd..00000000 --- a/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Mobile Authorization Code Response Builder object. - */ - public static function init(): self - { - return new self(new CreateMobileAuthorizationCodeResponse()); - } - - /** - * Sets authorization code field. - * - * @param string|null $value - */ - public function authorizationCode(?string $value): self - { - $this->instance->setAuthorizationCode($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Mobile Authorization Code Response object. - */ - public function build(): CreateMobileAuthorizationCodeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateOrderCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/CreateOrderCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index d531e27b..00000000 --- a/src/Models/Builders/CreateOrderCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Order Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new CreateOrderCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Order Custom Attribute Definition Request object. - */ - public function build(): CreateOrderCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateOrderCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/CreateOrderCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 4ffc39ce..00000000 --- a/src/Models/Builders/CreateOrderCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Order Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new CreateOrderCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Order Custom Attribute Definition Response object. - */ - public function build(): CreateOrderCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateOrderRequestBuilder.php b/src/Models/Builders/CreateOrderRequestBuilder.php deleted file mode 100644 index adce98d3..00000000 --- a/src/Models/Builders/CreateOrderRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Order Request Builder object. - */ - public static function init(): self - { - return new self(new CreateOrderRequest()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Order Request object. - */ - public function build(): CreateOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateOrderResponseBuilder.php b/src/Models/Builders/CreateOrderResponseBuilder.php deleted file mode 100644 index b6b62644..00000000 --- a/src/Models/Builders/CreateOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Order Response Builder object. - */ - public static function init(): self - { - return new self(new CreateOrderResponse()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Order Response object. - */ - public function build(): CreateOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreatePaymentLinkRequestBuilder.php b/src/Models/Builders/CreatePaymentLinkRequestBuilder.php deleted file mode 100644 index 253621e4..00000000 --- a/src/Models/Builders/CreatePaymentLinkRequestBuilder.php +++ /dev/null @@ -1,123 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Payment Link Request Builder object. - */ - public static function init(): self - { - return new self(new CreatePaymentLinkRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Sets quick pay field. - * - * @param QuickPay|null $value - */ - public function quickPay(?QuickPay $value): self - { - $this->instance->setQuickPay($value); - return $this; - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets checkout options field. - * - * @param CheckoutOptions|null $value - */ - public function checkoutOptions(?CheckoutOptions $value): self - { - $this->instance->setCheckoutOptions($value); - return $this; - } - - /** - * Sets pre populated data field. - * - * @param PrePopulatedData|null $value - */ - public function prePopulatedData(?PrePopulatedData $value): self - { - $this->instance->setPrePopulatedData($value); - return $this; - } - - /** - * Sets payment note field. - * - * @param string|null $value - */ - public function paymentNote(?string $value): self - { - $this->instance->setPaymentNote($value); - return $this; - } - - /** - * Initializes a new Create Payment Link Request object. - */ - public function build(): CreatePaymentLinkRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreatePaymentLinkResponseBuilder.php b/src/Models/Builders/CreatePaymentLinkResponseBuilder.php deleted file mode 100644 index e2a6bd0b..00000000 --- a/src/Models/Builders/CreatePaymentLinkResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Payment Link Response Builder object. - */ - public static function init(): self - { - return new self(new CreatePaymentLinkResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment link field. - * - * @param PaymentLink|null $value - */ - public function paymentLink(?PaymentLink $value): self - { - $this->instance->setPaymentLink($value); - return $this; - } - - /** - * Sets related resources field. - * - * @param PaymentLinkRelatedResources|null $value - */ - public function relatedResources(?PaymentLinkRelatedResources $value): self - { - $this->instance->setRelatedResources($value); - return $this; - } - - /** - * Initializes a new Create Payment Link Response object. - */ - public function build(): CreatePaymentLinkResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreatePaymentRequestBuilder.php b/src/Models/Builders/CreatePaymentRequestBuilder.php deleted file mode 100644 index adac1052..00000000 --- a/src/Models/Builders/CreatePaymentRequestBuilder.php +++ /dev/null @@ -1,304 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Payment Request Builder object. - * - * @param string $sourceId - * @param string $idempotencyKey - */ - public static function init(string $sourceId, string $idempotencyKey): self - { - return new self(new CreatePaymentRequest($sourceId, $idempotencyKey)); - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets tip money field. - * - * @param Money|null $value - */ - public function tipMoney(?Money $value): self - { - $this->instance->setTipMoney($value); - return $this; - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets delay duration field. - * - * @param string|null $value - */ - public function delayDuration(?string $value): self - { - $this->instance->setDelayDuration($value); - return $this; - } - - /** - * Sets delay action field. - * - * @param string|null $value - */ - public function delayAction(?string $value): self - { - $this->instance->setDelayAction($value); - return $this; - } - - /** - * Sets autocomplete field. - * - * @param bool|null $value - */ - public function autocomplete(?bool $value): self - { - $this->instance->setAutocomplete($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Sets verification token field. - * - * @param string|null $value - */ - public function verificationToken(?string $value): self - { - $this->instance->setVerificationToken($value); - return $this; - } - - /** - * Sets accept partial authorization field. - * - * @param bool|null $value - */ - public function acceptPartialAuthorization(?bool $value): self - { - $this->instance->setAcceptPartialAuthorization($value); - return $this; - } - - /** - * Sets buyer email address field. - * - * @param string|null $value - */ - public function buyerEmailAddress(?string $value): self - { - $this->instance->setBuyerEmailAddress($value); - return $this; - } - - /** - * Sets buyer phone number field. - * - * @param string|null $value - */ - public function buyerPhoneNumber(?string $value): self - { - $this->instance->setBuyerPhoneNumber($value); - return $this; - } - - /** - * Sets billing address field. - * - * @param Address|null $value - */ - public function billingAddress(?Address $value): self - { - $this->instance->setBillingAddress($value); - return $this; - } - - /** - * Sets shipping address field. - * - * @param Address|null $value - */ - public function shippingAddress(?Address $value): self - { - $this->instance->setShippingAddress($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Sets statement description identifier field. - * - * @param string|null $value - */ - public function statementDescriptionIdentifier(?string $value): self - { - $this->instance->setStatementDescriptionIdentifier($value); - return $this; - } - - /** - * Sets cash details field. - * - * @param CashPaymentDetails|null $value - */ - public function cashDetails(?CashPaymentDetails $value): self - { - $this->instance->setCashDetails($value); - return $this; - } - - /** - * Sets external details field. - * - * @param ExternalPaymentDetails|null $value - */ - public function externalDetails(?ExternalPaymentDetails $value): self - { - $this->instance->setExternalDetails($value); - return $this; - } - - /** - * Sets customer details field. - * - * @param CustomerDetails|null $value - */ - public function customerDetails(?CustomerDetails $value): self - { - $this->instance->setCustomerDetails($value); - return $this; - } - - /** - * Sets offline payment details field. - * - * @param OfflinePaymentDetails|null $value - */ - public function offlinePaymentDetails(?OfflinePaymentDetails $value): self - { - $this->instance->setOfflinePaymentDetails($value); - return $this; - } - - /** - * Initializes a new Create Payment Request object. - */ - public function build(): CreatePaymentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreatePaymentResponseBuilder.php b/src/Models/Builders/CreatePaymentResponseBuilder.php deleted file mode 100644 index 813f9890..00000000 --- a/src/Models/Builders/CreatePaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Payment Response Builder object. - */ - public static function init(): self - { - return new self(new CreatePaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Create Payment Response object. - */ - public function build(): CreatePaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateRefundRequestBuilder.php b/src/Models/Builders/CreateRefundRequestBuilder.php deleted file mode 100644 index a0bc8a49..00000000 --- a/src/Models/Builders/CreateRefundRequestBuilder.php +++ /dev/null @@ -1,58 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Refund Request Builder object. - * - * @param string $idempotencyKey - * @param string $tenderId - * @param Money $amountMoney - */ - public static function init(string $idempotencyKey, string $tenderId, Money $amountMoney): self - { - return new self(new CreateRefundRequest($idempotencyKey, $tenderId, $amountMoney)); - } - - /** - * Sets reason field. - * - * @param string|null $value - */ - public function reason(?string $value): self - { - $this->instance->setReason($value); - return $this; - } - - /** - * Initializes a new Create Refund Request object. - */ - public function build(): CreateRefundRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateRefundResponseBuilder.php b/src/Models/Builders/CreateRefundResponseBuilder.php deleted file mode 100644 index 37d1638a..00000000 --- a/src/Models/Builders/CreateRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Refund Response Builder object. - */ - public static function init(): self - { - return new self(new CreateRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param Refund|null $value - */ - public function refund(?Refund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Create Refund Response object. - */ - public function build(): CreateRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateShiftRequestBuilder.php b/src/Models/Builders/CreateShiftRequestBuilder.php deleted file mode 100644 index 6020a2a7..00000000 --- a/src/Models/Builders/CreateShiftRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Shift Request Builder object. - * - * @param Shift $shift - */ - public static function init(Shift $shift): self - { - return new self(new CreateShiftRequest($shift)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Shift Request object. - */ - public function build(): CreateShiftRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateShiftResponseBuilder.php b/src/Models/Builders/CreateShiftResponseBuilder.php deleted file mode 100644 index 6f683098..00000000 --- a/src/Models/Builders/CreateShiftResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Shift Response Builder object. - */ - public static function init(): self - { - return new self(new CreateShiftResponse()); - } - - /** - * Sets shift field. - * - * @param Shift|null $value - */ - public function shift(?Shift $value): self - { - $this->instance->setShift($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Shift Response object. - */ - public function build(): CreateShiftResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateSubscriptionRequestBuilder.php b/src/Models/Builders/CreateSubscriptionRequestBuilder.php deleted file mode 100644 index 3a005bc1..00000000 --- a/src/Models/Builders/CreateSubscriptionRequestBuilder.php +++ /dev/null @@ -1,169 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Subscription Request Builder object. - * - * @param string $locationId - * @param string $customerId - */ - public static function init(string $locationId, string $customerId): self - { - return new self(new CreateSubscriptionRequest($locationId, $customerId)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Sets plan variation id field. - * - * @param string|null $value - */ - public function planVariationId(?string $value): self - { - $this->instance->setPlanVariationId($value); - return $this; - } - - /** - * Sets start date field. - * - * @param string|null $value - */ - public function startDate(?string $value): self - { - $this->instance->setStartDate($value); - return $this; - } - - /** - * Sets canceled date field. - * - * @param string|null $value - */ - public function canceledDate(?string $value): self - { - $this->instance->setCanceledDate($value); - return $this; - } - - /** - * Sets tax percentage field. - * - * @param string|null $value - */ - public function taxPercentage(?string $value): self - { - $this->instance->setTaxPercentage($value); - return $this; - } - - /** - * Sets price override money field. - * - * @param Money|null $value - */ - public function priceOverrideMoney(?Money $value): self - { - $this->instance->setPriceOverrideMoney($value); - return $this; - } - - /** - * Sets card id field. - * - * @param string|null $value - */ - public function cardId(?string $value): self - { - $this->instance->setCardId($value); - return $this; - } - - /** - * Sets timezone field. - * - * @param string|null $value - */ - public function timezone(?string $value): self - { - $this->instance->setTimezone($value); - return $this; - } - - /** - * Sets source field. - * - * @param SubscriptionSource|null $value - */ - public function source(?SubscriptionSource $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Sets phases field. - * - * @param Phase[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Initializes a new Create Subscription Request object. - */ - public function build(): CreateSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateSubscriptionResponseBuilder.php b/src/Models/Builders/CreateSubscriptionResponseBuilder.php deleted file mode 100644 index 41be7123..00000000 --- a/src/Models/Builders/CreateSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new CreateSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Create Subscription Response object. - */ - public function build(): CreateSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTeamMemberRequestBuilder.php b/src/Models/Builders/CreateTeamMemberRequestBuilder.php deleted file mode 100644 index a9bcf39b..00000000 --- a/src/Models/Builders/CreateTeamMemberRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Team Member Request Builder object. - */ - public static function init(): self - { - return new self(new CreateTeamMemberRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Sets team member field. - * - * @param TeamMember|null $value - */ - public function teamMember(?TeamMember $value): self - { - $this->instance->setTeamMember($value); - return $this; - } - - /** - * Initializes a new Create Team Member Request object. - */ - public function build(): CreateTeamMemberRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTeamMemberResponseBuilder.php b/src/Models/Builders/CreateTeamMemberResponseBuilder.php deleted file mode 100644 index e727f879..00000000 --- a/src/Models/Builders/CreateTeamMemberResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Team Member Response Builder object. - */ - public static function init(): self - { - return new self(new CreateTeamMemberResponse()); - } - - /** - * Sets team member field. - * - * @param TeamMember|null $value - */ - public function teamMember(?TeamMember $value): self - { - $this->instance->setTeamMember($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Create Team Member Response object. - */ - public function build(): CreateTeamMemberResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalActionRequestBuilder.php b/src/Models/Builders/CreateTerminalActionRequestBuilder.php deleted file mode 100644 index 3f2de6e7..00000000 --- a/src/Models/Builders/CreateTerminalActionRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Action Request Builder object. - * - * @param string $idempotencyKey - * @param TerminalAction $action - */ - public static function init(string $idempotencyKey, TerminalAction $action): self - { - return new self(new CreateTerminalActionRequest($idempotencyKey, $action)); - } - - /** - * Initializes a new Create Terminal Action Request object. - */ - public function build(): CreateTerminalActionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalActionResponseBuilder.php b/src/Models/Builders/CreateTerminalActionResponseBuilder.php deleted file mode 100644 index a04a2550..00000000 --- a/src/Models/Builders/CreateTerminalActionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Action Response Builder object. - */ - public static function init(): self - { - return new self(new CreateTerminalActionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets action field. - * - * @param TerminalAction|null $value - */ - public function action(?TerminalAction $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Initializes a new Create Terminal Action Response object. - */ - public function build(): CreateTerminalActionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalCheckoutRequestBuilder.php b/src/Models/Builders/CreateTerminalCheckoutRequestBuilder.php deleted file mode 100644 index b0991cbe..00000000 --- a/src/Models/Builders/CreateTerminalCheckoutRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Checkout Request Builder object. - * - * @param string $idempotencyKey - * @param TerminalCheckout $checkout - */ - public static function init(string $idempotencyKey, TerminalCheckout $checkout): self - { - return new self(new CreateTerminalCheckoutRequest($idempotencyKey, $checkout)); - } - - /** - * Initializes a new Create Terminal Checkout Request object. - */ - public function build(): CreateTerminalCheckoutRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalCheckoutResponseBuilder.php b/src/Models/Builders/CreateTerminalCheckoutResponseBuilder.php deleted file mode 100644 index b40769fe..00000000 --- a/src/Models/Builders/CreateTerminalCheckoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Checkout Response Builder object. - */ - public static function init(): self - { - return new self(new CreateTerminalCheckoutResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets checkout field. - * - * @param TerminalCheckout|null $value - */ - public function checkout(?TerminalCheckout $value): self - { - $this->instance->setCheckout($value); - return $this; - } - - /** - * Initializes a new Create Terminal Checkout Response object. - */ - public function build(): CreateTerminalCheckoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalRefundRequestBuilder.php b/src/Models/Builders/CreateTerminalRefundRequestBuilder.php deleted file mode 100644 index 8a9a0135..00000000 --- a/src/Models/Builders/CreateTerminalRefundRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Refund Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new CreateTerminalRefundRequest($idempotencyKey)); - } - - /** - * Sets refund field. - * - * @param TerminalRefund|null $value - */ - public function refund(?TerminalRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Create Terminal Refund Request object. - */ - public function build(): CreateTerminalRefundRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateTerminalRefundResponseBuilder.php b/src/Models/Builders/CreateTerminalRefundResponseBuilder.php deleted file mode 100644 index c23368ee..00000000 --- a/src/Models/Builders/CreateTerminalRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Terminal Refund Response Builder object. - */ - public static function init(): self - { - return new self(new CreateTerminalRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param TerminalRefund|null $value - */ - public function refund(?TerminalRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Create Terminal Refund Response object. - */ - public function build(): CreateTerminalRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateVendorRequestBuilder.php b/src/Models/Builders/CreateVendorRequestBuilder.php deleted file mode 100644 index 9527aa68..00000000 --- a/src/Models/Builders/CreateVendorRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Vendor Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new CreateVendorRequest($idempotencyKey)); - } - - /** - * Sets vendor field. - * - * @param Vendor|null $value - */ - public function vendor(?Vendor $value): self - { - $this->instance->setVendor($value); - return $this; - } - - /** - * Initializes a new Create Vendor Request object. - */ - public function build(): CreateVendorRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateVendorResponseBuilder.php b/src/Models/Builders/CreateVendorResponseBuilder.php deleted file mode 100644 index b174dd82..00000000 --- a/src/Models/Builders/CreateVendorResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Vendor Response Builder object. - */ - public static function init(): self - { - return new self(new CreateVendorResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets vendor field. - * - * @param Vendor|null $value - */ - public function vendor(?Vendor $value): self - { - $this->instance->setVendor($value); - return $this; - } - - /** - * Initializes a new Create Vendor Response object. - */ - public function build(): CreateVendorResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateWebhookSubscriptionRequestBuilder.php b/src/Models/Builders/CreateWebhookSubscriptionRequestBuilder.php deleted file mode 100644 index 25e46cdc..00000000 --- a/src/Models/Builders/CreateWebhookSubscriptionRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Webhook Subscription Request Builder object. - * - * @param WebhookSubscription $subscription - */ - public static function init(WebhookSubscription $subscription): self - { - return new self(new CreateWebhookSubscriptionRequest($subscription)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Initializes a new Create Webhook Subscription Request object. - */ - public function build(): CreateWebhookSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CreateWebhookSubscriptionResponseBuilder.php b/src/Models/Builders/CreateWebhookSubscriptionResponseBuilder.php deleted file mode 100644 index 71247a02..00000000 --- a/src/Models/Builders/CreateWebhookSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Create Webhook Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new CreateWebhookSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param WebhookSubscription|null $value - */ - public function subscription(?WebhookSubscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Create Webhook Subscription Response object. - */ - public function build(): CreateWebhookSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomAttributeBuilder.php b/src/Models/Builders/CustomAttributeBuilder.php deleted file mode 100644 index 3abd2085..00000000 --- a/src/Models/Builders/CustomAttributeBuilder.php +++ /dev/null @@ -1,138 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Custom Attribute Builder object. - */ - public static function init(): self - { - return new self(new CustomAttribute()); - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Unsets key field. - */ - public function unsetKey(): self - { - $this->instance->unsetKey(); - return $this; - } - - /** - * Sets value field. - * - * @param mixed $value - */ - public function value($value): self - { - $this->instance->setValue($value); - return $this; - } - - /** - * Unsets value field. - */ - public function unsetValue(): self - { - $this->instance->unsetValue(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets visibility field. - * - * @param string|null $value - */ - public function visibility(?string $value): self - { - $this->instance->setVisibility($value); - return $this; - } - - /** - * Sets definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function definition(?CustomAttributeDefinition $value): self - { - $this->instance->setDefinition($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Custom Attribute object. - */ - public function build(): CustomAttribute - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomAttributeDefinitionBuilder.php b/src/Models/Builders/CustomAttributeDefinitionBuilder.php deleted file mode 100644 index 4d0b4c20..00000000 --- a/src/Models/Builders/CustomAttributeDefinitionBuilder.php +++ /dev/null @@ -1,166 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Custom Attribute Definition Builder object. - */ - public static function init(): self - { - return new self(new CustomAttributeDefinition()); - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Unsets key field. - */ - public function unsetKey(): self - { - $this->instance->unsetKey(); - return $this; - } - - /** - * Sets schema field. - * - * @param mixed $value - */ - public function schema($value): self - { - $this->instance->setSchema($value); - return $this; - } - - /** - * Unsets schema field. - */ - public function unsetSchema(): self - { - $this->instance->unsetSchema(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets visibility field. - * - * @param string|null $value - */ - public function visibility(?string $value): self - { - $this->instance->setVisibility($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Custom Attribute Definition object. - */ - public function build(): CustomAttributeDefinition - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomAttributeFilterBuilder.php b/src/Models/Builders/CustomAttributeFilterBuilder.php deleted file mode 100644 index a03c441b..00000000 --- a/src/Models/Builders/CustomAttributeFilterBuilder.php +++ /dev/null @@ -1,154 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Custom Attribute Filter Builder object. - */ - public static function init(): self - { - return new self(new CustomAttributeFilter()); - } - - /** - * Sets custom attribute definition id field. - * - * @param string|null $value - */ - public function customAttributeDefinitionId(?string $value): self - { - $this->instance->setCustomAttributeDefinitionId($value); - return $this; - } - - /** - * Unsets custom attribute definition id field. - */ - public function unsetCustomAttributeDefinitionId(): self - { - $this->instance->unsetCustomAttributeDefinitionId(); - return $this; - } - - /** - * Sets key field. - * - * @param string|null $value - */ - public function key(?string $value): self - { - $this->instance->setKey($value); - return $this; - } - - /** - * Unsets key field. - */ - public function unsetKey(): self - { - $this->instance->unsetKey(); - return $this; - } - - /** - * Sets string filter field. - * - * @param string|null $value - */ - public function stringFilter(?string $value): self - { - $this->instance->setStringFilter($value); - return $this; - } - - /** - * Unsets string filter field. - */ - public function unsetStringFilter(): self - { - $this->instance->unsetStringFilter(); - return $this; - } - - /** - * Sets number filter field. - * - * @param Range|null $value - */ - public function numberFilter(?Range $value): self - { - $this->instance->setNumberFilter($value); - return $this; - } - - /** - * Sets selection uids filter field. - * - * @param string[]|null $value - */ - public function selectionUidsFilter(?array $value): self - { - $this->instance->setSelectionUidsFilter($value); - return $this; - } - - /** - * Unsets selection uids filter field. - */ - public function unsetSelectionUidsFilter(): self - { - $this->instance->unsetSelectionUidsFilter(); - return $this; - } - - /** - * Sets bool filter field. - * - * @param bool|null $value - */ - public function boolFilter(?bool $value): self - { - $this->instance->setBoolFilter($value); - return $this; - } - - /** - * Unsets bool filter field. - */ - public function unsetBoolFilter(): self - { - $this->instance->unsetBoolFilter(); - return $this; - } - - /** - * Initializes a new Custom Attribute Filter object. - */ - public function build(): CustomAttributeFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomFieldBuilder.php b/src/Models/Builders/CustomFieldBuilder.php deleted file mode 100644 index 20de524e..00000000 --- a/src/Models/Builders/CustomFieldBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Custom Field Builder object. - * - * @param string $title - */ - public static function init(string $title): self - { - return new self(new CustomField($title)); - } - - /** - * Initializes a new Custom Field object. - */ - public function build(): CustomField - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerAddressFilterBuilder.php b/src/Models/Builders/CustomerAddressFilterBuilder.php deleted file mode 100644 index d6568fe9..00000000 --- a/src/Models/Builders/CustomerAddressFilterBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Address Filter Builder object. - */ - public static function init(): self - { - return new self(new CustomerAddressFilter()); - } - - /** - * Sets postal code field. - * - * @param CustomerTextFilter|null $value - */ - public function postalCode(?CustomerTextFilter $value): self - { - $this->instance->setPostalCode($value); - return $this; - } - - /** - * Sets country field. - * - * @param string|null $value - */ - public function country(?string $value): self - { - $this->instance->setCountry($value); - return $this; - } - - /** - * Initializes a new Customer Address Filter object. - */ - public function build(): CustomerAddressFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerBuilder.php b/src/Models/Builders/CustomerBuilder.php deleted file mode 100644 index c02eec7d..00000000 --- a/src/Models/Builders/CustomerBuilder.php +++ /dev/null @@ -1,374 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Builder object. - */ - public static function init(): self - { - return new self(new Customer()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets cards field. - * - * @param Card[]|null $value - */ - public function cards(?array $value): self - { - $this->instance->setCards($value); - return $this; - } - - /** - * Unsets cards field. - */ - public function unsetCards(): self - { - $this->instance->unsetCards(); - return $this; - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Unsets given name field. - */ - public function unsetGivenName(): self - { - $this->instance->unsetGivenName(); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Unsets family name field. - */ - public function unsetFamilyName(): self - { - $this->instance->unsetFamilyName(); - return $this; - } - - /** - * Sets nickname field. - * - * @param string|null $value - */ - public function nickname(?string $value): self - { - $this->instance->setNickname($value); - return $this; - } - - /** - * Unsets nickname field. - */ - public function unsetNickname(): self - { - $this->instance->unsetNickname(); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Unsets company name field. - */ - public function unsetCompanyName(): self - { - $this->instance->unsetCompanyName(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets birthday field. - * - * @param string|null $value - */ - public function birthday(?string $value): self - { - $this->instance->setBirthday($value); - return $this; - } - - /** - * Unsets birthday field. - */ - public function unsetBirthday(): self - { - $this->instance->unsetBirthday(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets preferences field. - * - * @param CustomerPreferences|null $value - */ - public function preferences(?CustomerPreferences $value): self - { - $this->instance->setPreferences($value); - return $this; - } - - /** - * Sets creation source field. - * - * @param string|null $value - */ - public function creationSource(?string $value): self - { - $this->instance->setCreationSource($value); - return $this; - } - - /** - * Sets group ids field. - * - * @param string[]|null $value - */ - public function groupIds(?array $value): self - { - $this->instance->setGroupIds($value); - return $this; - } - - /** - * Unsets group ids field. - */ - public function unsetGroupIds(): self - { - $this->instance->unsetGroupIds(); - return $this; - } - - /** - * Sets segment ids field. - * - * @param string[]|null $value - */ - public function segmentIds(?array $value): self - { - $this->instance->setSegmentIds($value); - return $this; - } - - /** - * Unsets segment ids field. - */ - public function unsetSegmentIds(): self - { - $this->instance->unsetSegmentIds(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets tax ids field. - * - * @param CustomerTaxIds|null $value - */ - public function taxIds(?CustomerTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Customer object. - */ - public function build(): Customer - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerCreationSourceFilterBuilder.php b/src/Models/Builders/CustomerCreationSourceFilterBuilder.php deleted file mode 100644 index fd965330..00000000 --- a/src/Models/Builders/CustomerCreationSourceFilterBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Creation Source Filter Builder object. - */ - public static function init(): self - { - return new self(new CustomerCreationSourceFilter()); - } - - /** - * Sets values field. - * - * @param string[]|null $value - */ - public function values(?array $value): self - { - $this->instance->setValues($value); - return $this; - } - - /** - * Unsets values field. - */ - public function unsetValues(): self - { - $this->instance->unsetValues(); - return $this; - } - - /** - * Sets rule field. - * - * @param string|null $value - */ - public function rule(?string $value): self - { - $this->instance->setRule($value); - return $this; - } - - /** - * Initializes a new Customer Creation Source Filter object. - */ - public function build(): CustomerCreationSourceFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerCustomAttributeFilterBuilder.php b/src/Models/Builders/CustomerCustomAttributeFilterBuilder.php deleted file mode 100644 index 6ba0eb8c..00000000 --- a/src/Models/Builders/CustomerCustomAttributeFilterBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Custom Attribute Filter Builder object. - * - * @param string $key - */ - public static function init(string $key): self - { - return new self(new CustomerCustomAttributeFilter($key)); - } - - /** - * Sets filter field. - * - * @param CustomerCustomAttributeFilterValue|null $value - */ - public function filter(?CustomerCustomAttributeFilterValue $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param TimeRange|null $value - */ - public function updatedAt(?TimeRange $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Customer Custom Attribute Filter object. - */ - public function build(): CustomerCustomAttributeFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerCustomAttributeFilterValueBuilder.php b/src/Models/Builders/CustomerCustomAttributeFilterValueBuilder.php deleted file mode 100644 index ade42fd0..00000000 --- a/src/Models/Builders/CustomerCustomAttributeFilterValueBuilder.php +++ /dev/null @@ -1,144 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Custom Attribute Filter Value Builder object. - */ - public static function init(): self - { - return new self(new CustomerCustomAttributeFilterValue()); - } - - /** - * Sets email field. - * - * @param CustomerTextFilter|null $value - */ - public function email(?CustomerTextFilter $value): self - { - $this->instance->setEmail($value); - return $this; - } - - /** - * Sets phone field. - * - * @param CustomerTextFilter|null $value - */ - public function phone(?CustomerTextFilter $value): self - { - $this->instance->setPhone($value); - return $this; - } - - /** - * Sets text field. - * - * @param CustomerTextFilter|null $value - */ - public function text(?CustomerTextFilter $value): self - { - $this->instance->setText($value); - return $this; - } - - /** - * Sets selection field. - * - * @param FilterValue|null $value - */ - public function selection(?FilterValue $value): self - { - $this->instance->setSelection($value); - return $this; - } - - /** - * Sets date field. - * - * @param TimeRange|null $value - */ - public function date(?TimeRange $value): self - { - $this->instance->setDate($value); - return $this; - } - - /** - * Sets number field. - * - * @param FloatNumberRange|null $value - */ - public function number(?FloatNumberRange $value): self - { - $this->instance->setNumber($value); - return $this; - } - - /** - * Sets boolean field. - * - * @param bool|null $value - */ - public function boolean(?bool $value): self - { - $this->instance->setBoolean($value); - return $this; - } - - /** - * Unsets boolean field. - */ - public function unsetBoolean(): self - { - $this->instance->unsetBoolean(); - return $this; - } - - /** - * Sets address field. - * - * @param CustomerAddressFilter|null $value - */ - public function address(?CustomerAddressFilter $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Initializes a new Customer Custom Attribute Filter Value object. - */ - public function build(): CustomerCustomAttributeFilterValue - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerCustomAttributeFiltersBuilder.php b/src/Models/Builders/CustomerCustomAttributeFiltersBuilder.php deleted file mode 100644 index f19e17ae..00000000 --- a/src/Models/Builders/CustomerCustomAttributeFiltersBuilder.php +++ /dev/null @@ -1,63 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Custom Attribute Filters Builder object. - */ - public static function init(): self - { - return new self(new CustomerCustomAttributeFilters()); - } - - /** - * Sets filters field. - * - * @param CustomerCustomAttributeFilter[]|null $value - */ - public function filters(?array $value): self - { - $this->instance->setFilters($value); - return $this; - } - - /** - * Unsets filters field. - */ - public function unsetFilters(): self - { - $this->instance->unsetFilters(); - return $this; - } - - /** - * Initializes a new Customer Custom Attribute Filters object. - */ - public function build(): CustomerCustomAttributeFilters - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerDetailsBuilder.php b/src/Models/Builders/CustomerDetailsBuilder.php deleted file mode 100644 index e7beaa58..00000000 --- a/src/Models/Builders/CustomerDetailsBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Details Builder object. - */ - public static function init(): self - { - return new self(new CustomerDetails()); - } - - /** - * Sets customer initiated field. - * - * @param bool|null $value - */ - public function customerInitiated(?bool $value): self - { - $this->instance->setCustomerInitiated($value); - return $this; - } - - /** - * Unsets customer initiated field. - */ - public function unsetCustomerInitiated(): self - { - $this->instance->unsetCustomerInitiated(); - return $this; - } - - /** - * Sets seller keyed in field. - * - * @param bool|null $value - */ - public function sellerKeyedIn(?bool $value): self - { - $this->instance->setSellerKeyedIn($value); - return $this; - } - - /** - * Unsets seller keyed in field. - */ - public function unsetSellerKeyedIn(): self - { - $this->instance->unsetSellerKeyedIn(); - return $this; - } - - /** - * Initializes a new Customer Details object. - */ - public function build(): CustomerDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerFilterBuilder.php b/src/Models/Builders/CustomerFilterBuilder.php deleted file mode 100644 index 173ae47a..00000000 --- a/src/Models/Builders/CustomerFilterBuilder.php +++ /dev/null @@ -1,146 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Filter Builder object. - */ - public static function init(): self - { - return new self(new CustomerFilter()); - } - - /** - * Sets creation source field. - * - * @param CustomerCreationSourceFilter|null $value - */ - public function creationSource(?CustomerCreationSourceFilter $value): self - { - $this->instance->setCreationSource($value); - return $this; - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param TimeRange|null $value - */ - public function updatedAt(?TimeRange $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets email address field. - * - * @param CustomerTextFilter|null $value - */ - public function emailAddress(?CustomerTextFilter $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param CustomerTextFilter|null $value - */ - public function phoneNumber(?CustomerTextFilter $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param CustomerTextFilter|null $value - */ - public function referenceId(?CustomerTextFilter $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Sets group ids field. - * - * @param FilterValue|null $value - */ - public function groupIds(?FilterValue $value): self - { - $this->instance->setGroupIds($value); - return $this; - } - - /** - * Sets custom attribute field. - * - * @param CustomerCustomAttributeFilters|null $value - */ - public function customAttribute(?CustomerCustomAttributeFilters $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets segment ids field. - * - * @param FilterValue|null $value - */ - public function segmentIds(?FilterValue $value): self - { - $this->instance->setSegmentIds($value); - return $this; - } - - /** - * Initializes a new Customer Filter object. - */ - public function build(): CustomerFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerGroupBuilder.php b/src/Models/Builders/CustomerGroupBuilder.php deleted file mode 100644 index db408369..00000000 --- a/src/Models/Builders/CustomerGroupBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Group Builder object. - * - * @param string $name - */ - public static function init(string $name): self - { - return new self(new CustomerGroup($name)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Customer Group object. - */ - public function build(): CustomerGroup - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerPreferencesBuilder.php b/src/Models/Builders/CustomerPreferencesBuilder.php deleted file mode 100644 index 7fdf5e43..00000000 --- a/src/Models/Builders/CustomerPreferencesBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Preferences Builder object. - */ - public static function init(): self - { - return new self(new CustomerPreferences()); - } - - /** - * Sets email unsubscribed field. - * - * @param bool|null $value - */ - public function emailUnsubscribed(?bool $value): self - { - $this->instance->setEmailUnsubscribed($value); - return $this; - } - - /** - * Unsets email unsubscribed field. - */ - public function unsetEmailUnsubscribed(): self - { - $this->instance->unsetEmailUnsubscribed(); - return $this; - } - - /** - * Initializes a new Customer Preferences object. - */ - public function build(): CustomerPreferences - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerQueryBuilder.php b/src/Models/Builders/CustomerQueryBuilder.php deleted file mode 100644 index 75b7887f..00000000 --- a/src/Models/Builders/CustomerQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Query Builder object. - */ - public static function init(): self - { - return new self(new CustomerQuery()); - } - - /** - * Sets filter field. - * - * @param CustomerFilter|null $value - */ - public function filter(?CustomerFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param CustomerSort|null $value - */ - public function sort(?CustomerSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Customer Query object. - */ - public function build(): CustomerQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerSegmentBuilder.php b/src/Models/Builders/CustomerSegmentBuilder.php deleted file mode 100644 index a6e47808..00000000 --- a/src/Models/Builders/CustomerSegmentBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Segment Builder object. - * - * @param string $name - */ - public static function init(string $name): self - { - return new self(new CustomerSegment($name)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Customer Segment object. - */ - public function build(): CustomerSegment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerSortBuilder.php b/src/Models/Builders/CustomerSortBuilder.php deleted file mode 100644 index ebde1e80..00000000 --- a/src/Models/Builders/CustomerSortBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Sort Builder object. - */ - public static function init(): self - { - return new self(new CustomerSort()); - } - - /** - * Sets field field. - * - * @param string|null $value - */ - public function field(?string $value): self - { - $this->instance->setField($value); - return $this; - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Customer Sort object. - */ - public function build(): CustomerSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerTaxIdsBuilder.php b/src/Models/Builders/CustomerTaxIdsBuilder.php deleted file mode 100644 index 29f708c8..00000000 --- a/src/Models/Builders/CustomerTaxIdsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Tax Ids Builder object. - */ - public static function init(): self - { - return new self(new CustomerTaxIds()); - } - - /** - * Sets eu vat field. - * - * @param string|null $value - */ - public function euVat(?string $value): self - { - $this->instance->setEuVat($value); - return $this; - } - - /** - * Unsets eu vat field. - */ - public function unsetEuVat(): self - { - $this->instance->unsetEuVat(); - return $this; - } - - /** - * Initializes a new Customer Tax Ids object. - */ - public function build(): CustomerTaxIds - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/CustomerTextFilterBuilder.php b/src/Models/Builders/CustomerTextFilterBuilder.php deleted file mode 100644 index e29f7451..00000000 --- a/src/Models/Builders/CustomerTextFilterBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Customer Text Filter Builder object. - */ - public static function init(): self - { - return new self(new CustomerTextFilter()); - } - - /** - * Sets exact field. - * - * @param string|null $value - */ - public function exact(?string $value): self - { - $this->instance->setExact($value); - return $this; - } - - /** - * Unsets exact field. - */ - public function unsetExact(): self - { - $this->instance->unsetExact(); - return $this; - } - - /** - * Sets fuzzy field. - * - * @param string|null $value - */ - public function fuzzy(?string $value): self - { - $this->instance->setFuzzy($value); - return $this; - } - - /** - * Unsets fuzzy field. - */ - public function unsetFuzzy(): self - { - $this->instance->unsetFuzzy(); - return $this; - } - - /** - * Initializes a new Customer Text Filter object. - */ - public function build(): CustomerTextFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DataCollectionOptionsBuilder.php b/src/Models/Builders/DataCollectionOptionsBuilder.php deleted file mode 100644 index a4b84799..00000000 --- a/src/Models/Builders/DataCollectionOptionsBuilder.php +++ /dev/null @@ -1,58 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Data Collection Options Builder object. - * - * @param string $title - * @param string $body - * @param string $inputType - */ - public static function init(string $title, string $body, string $inputType): self - { - return new self(new DataCollectionOptions($title, $body, $inputType)); - } - - /** - * Sets collected data field. - * - * @param CollectedData|null $value - */ - public function collectedData(?CollectedData $value): self - { - $this->instance->setCollectedData($value); - return $this; - } - - /** - * Initializes a new Data Collection Options object. - */ - public function build(): DataCollectionOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DateRangeBuilder.php b/src/Models/Builders/DateRangeBuilder.php deleted file mode 100644 index cad02050..00000000 --- a/src/Models/Builders/DateRangeBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Date Range Builder object. - */ - public static function init(): self - { - return new self(new DateRange()); - } - - /** - * Sets start date field. - * - * @param string|null $value - */ - public function startDate(?string $value): self - { - $this->instance->setStartDate($value); - return $this; - } - - /** - * Unsets start date field. - */ - public function unsetStartDate(): self - { - $this->instance->unsetStartDate(); - return $this; - } - - /** - * Sets end date field. - * - * @param string|null $value - */ - public function endDate(?string $value): self - { - $this->instance->setEndDate($value); - return $this; - } - - /** - * Unsets end date field. - */ - public function unsetEndDate(): self - { - $this->instance->unsetEndDate(); - return $this; - } - - /** - * Initializes a new Date Range object. - */ - public function build(): DateRange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteBookingCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/DeleteBookingCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 07f31b5c..00000000 --- a/src/Models/Builders/DeleteBookingCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Booking Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteBookingCustomAttributeDefinitionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Booking Custom Attribute Definition Response object. - */ - public function build(): DeleteBookingCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteBookingCustomAttributeResponseBuilder.php b/src/Models/Builders/DeleteBookingCustomAttributeResponseBuilder.php deleted file mode 100644 index f7b0a998..00000000 --- a/src/Models/Builders/DeleteBookingCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Booking Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteBookingCustomAttributeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Booking Custom Attribute Response object. - */ - public function build(): DeleteBookingCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteBreakTypeResponseBuilder.php b/src/Models/Builders/DeleteBreakTypeResponseBuilder.php deleted file mode 100644 index 6b40b53f..00000000 --- a/src/Models/Builders/DeleteBreakTypeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Break Type Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteBreakTypeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Break Type Response object. - */ - public function build(): DeleteBreakTypeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCatalogObjectResponseBuilder.php b/src/Models/Builders/DeleteCatalogObjectResponseBuilder.php deleted file mode 100644 index be29c857..00000000 --- a/src/Models/Builders/DeleteCatalogObjectResponseBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Catalog Object Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCatalogObjectResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets deleted object ids field. - * - * @param string[]|null $value - */ - public function deletedObjectIds(?array $value): self - { - $this->instance->setDeletedObjectIds($value); - return $this; - } - - /** - * Sets deleted at field. - * - * @param string|null $value - */ - public function deletedAt(?string $value): self - { - $this->instance->setDeletedAt($value); - return $this; - } - - /** - * Initializes a new Delete Catalog Object Response object. - */ - public function build(): DeleteCatalogObjectResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerCardResponseBuilder.php b/src/Models/Builders/DeleteCustomerCardResponseBuilder.php deleted file mode 100644 index db9e9af4..00000000 --- a/src/Models/Builders/DeleteCustomerCardResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Card Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Customer Card Response object. - */ - public function build(): DeleteCustomerCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/DeleteCustomerCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 69065d23..00000000 --- a/src/Models/Builders/DeleteCustomerCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerCustomAttributeDefinitionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Customer Custom Attribute Definition Response object. - */ - public function build(): DeleteCustomerCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerCustomAttributeResponseBuilder.php b/src/Models/Builders/DeleteCustomerCustomAttributeResponseBuilder.php deleted file mode 100644 index 2f1e5a0b..00000000 --- a/src/Models/Builders/DeleteCustomerCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerCustomAttributeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Customer Custom Attribute Response object. - */ - public function build(): DeleteCustomerCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerGroupResponseBuilder.php b/src/Models/Builders/DeleteCustomerGroupResponseBuilder.php deleted file mode 100644 index 2bc311cb..00000000 --- a/src/Models/Builders/DeleteCustomerGroupResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Group Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerGroupResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Customer Group Response object. - */ - public function build(): DeleteCustomerGroupResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerRequestBuilder.php b/src/Models/Builders/DeleteCustomerRequestBuilder.php deleted file mode 100644 index 9ae2b3e1..00000000 --- a/src/Models/Builders/DeleteCustomerRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Request Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Delete Customer Request object. - */ - public function build(): DeleteCustomerRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteCustomerResponseBuilder.php b/src/Models/Builders/DeleteCustomerResponseBuilder.php deleted file mode 100644 index 81e51647..00000000 --- a/src/Models/Builders/DeleteCustomerResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Customer Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Customer Response object. - */ - public function build(): DeleteCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteDisputeEvidenceResponseBuilder.php b/src/Models/Builders/DeleteDisputeEvidenceResponseBuilder.php deleted file mode 100644 index 518d8256..00000000 --- a/src/Models/Builders/DeleteDisputeEvidenceResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Dispute Evidence Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteDisputeEvidenceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Dispute Evidence Response object. - */ - public function build(): DeleteDisputeEvidenceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteInvoiceAttachmentResponseBuilder.php b/src/Models/Builders/DeleteInvoiceAttachmentResponseBuilder.php deleted file mode 100644 index 6eb5316e..00000000 --- a/src/Models/Builders/DeleteInvoiceAttachmentResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Invoice Attachment Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteInvoiceAttachmentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Invoice Attachment Response object. - */ - public function build(): DeleteInvoiceAttachmentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteInvoiceRequestBuilder.php b/src/Models/Builders/DeleteInvoiceRequestBuilder.php deleted file mode 100644 index dc30cd98..00000000 --- a/src/Models/Builders/DeleteInvoiceRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Invoice Request Builder object. - */ - public static function init(): self - { - return new self(new DeleteInvoiceRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Delete Invoice Request object. - */ - public function build(): DeleteInvoiceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteInvoiceResponseBuilder.php b/src/Models/Builders/DeleteInvoiceResponseBuilder.php deleted file mode 100644 index 0f9603da..00000000 --- a/src/Models/Builders/DeleteInvoiceResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteInvoiceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Invoice Response object. - */ - public function build(): DeleteInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteLocationCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/DeleteLocationCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 373e07b3..00000000 --- a/src/Models/Builders/DeleteLocationCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Location Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteLocationCustomAttributeDefinitionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Location Custom Attribute Definition Response object. - */ - public function build(): DeleteLocationCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteLocationCustomAttributeResponseBuilder.php b/src/Models/Builders/DeleteLocationCustomAttributeResponseBuilder.php deleted file mode 100644 index fd70736f..00000000 --- a/src/Models/Builders/DeleteLocationCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Location Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteLocationCustomAttributeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Location Custom Attribute Response object. - */ - public function build(): DeleteLocationCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteLoyaltyRewardResponseBuilder.php b/src/Models/Builders/DeleteLoyaltyRewardResponseBuilder.php deleted file mode 100644 index b69985c3..00000000 --- a/src/Models/Builders/DeleteLoyaltyRewardResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Loyalty Reward Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteLoyaltyRewardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Loyalty Reward Response object. - */ - public function build(): DeleteLoyaltyRewardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteMerchantCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/DeleteMerchantCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index cdeb3c67..00000000 --- a/src/Models/Builders/DeleteMerchantCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Merchant Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteMerchantCustomAttributeDefinitionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Merchant Custom Attribute Definition Response object. - */ - public function build(): DeleteMerchantCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteMerchantCustomAttributeResponseBuilder.php b/src/Models/Builders/DeleteMerchantCustomAttributeResponseBuilder.php deleted file mode 100644 index b235aba1..00000000 --- a/src/Models/Builders/DeleteMerchantCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Merchant Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteMerchantCustomAttributeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Merchant Custom Attribute Response object. - */ - public function build(): DeleteMerchantCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteOrderCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/DeleteOrderCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index e234fbb5..00000000 --- a/src/Models/Builders/DeleteOrderCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Order Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteOrderCustomAttributeDefinitionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Order Custom Attribute Definition Response object. - */ - public function build(): DeleteOrderCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteOrderCustomAttributeResponseBuilder.php b/src/Models/Builders/DeleteOrderCustomAttributeResponseBuilder.php deleted file mode 100644 index 0422d6d8..00000000 --- a/src/Models/Builders/DeleteOrderCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Order Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteOrderCustomAttributeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Order Custom Attribute Response object. - */ - public function build(): DeleteOrderCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeletePaymentLinkResponseBuilder.php b/src/Models/Builders/DeletePaymentLinkResponseBuilder.php deleted file mode 100644 index c91b2eac..00000000 --- a/src/Models/Builders/DeletePaymentLinkResponseBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Payment Link Response Builder object. - */ - public static function init(): self - { - return new self(new DeletePaymentLinkResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets cancelled order id field. - * - * @param string|null $value - */ - public function cancelledOrderId(?string $value): self - { - $this->instance->setCancelledOrderId($value); - return $this; - } - - /** - * Initializes a new Delete Payment Link Response object. - */ - public function build(): DeletePaymentLinkResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteShiftResponseBuilder.php b/src/Models/Builders/DeleteShiftResponseBuilder.php deleted file mode 100644 index 3e4dd579..00000000 --- a/src/Models/Builders/DeleteShiftResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Shift Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteShiftResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Shift Response object. - */ - public function build(): DeleteShiftResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteSnippetResponseBuilder.php b/src/Models/Builders/DeleteSnippetResponseBuilder.php deleted file mode 100644 index 55a638e3..00000000 --- a/src/Models/Builders/DeleteSnippetResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Snippet Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteSnippetResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Snippet Response object. - */ - public function build(): DeleteSnippetResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteSubscriptionActionResponseBuilder.php b/src/Models/Builders/DeleteSubscriptionActionResponseBuilder.php deleted file mode 100644 index 720573ad..00000000 --- a/src/Models/Builders/DeleteSubscriptionActionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Subscription Action Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteSubscriptionActionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Delete Subscription Action Response object. - */ - public function build(): DeleteSubscriptionActionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeleteWebhookSubscriptionResponseBuilder.php b/src/Models/Builders/DeleteWebhookSubscriptionResponseBuilder.php deleted file mode 100644 index 42df1e3f..00000000 --- a/src/Models/Builders/DeleteWebhookSubscriptionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Delete Webhook Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new DeleteWebhookSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Delete Webhook Subscription Response object. - */ - public function build(): DeleteWebhookSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileRequestBuilder.php b/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileRequestBuilder.php deleted file mode 100644 index 74a019dc..00000000 --- a/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileRequestBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence File Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new DeprecatedCreateDisputeEvidenceFileRequest($idempotencyKey)); - } - - /** - * Sets evidence type field. - * - * @param string|null $value - */ - public function evidenceType(?string $value): self - { - $this->instance->setEvidenceType($value); - return $this; - } - - /** - * Sets content type field. - * - * @param string|null $value - */ - public function contentType(?string $value): self - { - $this->instance->setContentType($value); - return $this; - } - - /** - * Unsets content type field. - */ - public function unsetContentType(): self - { - $this->instance->unsetContentType(); - return $this; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence File Request object. - */ - public function build(): DeprecatedCreateDisputeEvidenceFileRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileResponseBuilder.php b/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileResponseBuilder.php deleted file mode 100644 index 0be08007..00000000 --- a/src/Models/Builders/DeprecatedCreateDisputeEvidenceFileResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence File Response Builder object. - */ - public static function init(): self - { - return new self(new DeprecatedCreateDisputeEvidenceFileResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence|null $value - */ - public function evidence(?DisputeEvidence $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence File Response object. - */ - public function build(): DeprecatedCreateDisputeEvidenceFileResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextRequestBuilder.php b/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextRequestBuilder.php deleted file mode 100644 index d492260e..00000000 --- a/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence Text Request Builder object. - * - * @param string $idempotencyKey - * @param string $evidenceText - */ - public static function init(string $idempotencyKey, string $evidenceText): self - { - return new self(new DeprecatedCreateDisputeEvidenceTextRequest($idempotencyKey, $evidenceText)); - } - - /** - * Sets evidence type field. - * - * @param string|null $value - */ - public function evidenceType(?string $value): self - { - $this->instance->setEvidenceType($value); - return $this; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence Text Request object. - */ - public function build(): DeprecatedCreateDisputeEvidenceTextRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextResponseBuilder.php b/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextResponseBuilder.php deleted file mode 100644 index 1a7350f6..00000000 --- a/src/Models/Builders/DeprecatedCreateDisputeEvidenceTextResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence Text Response Builder object. - */ - public static function init(): self - { - return new self(new DeprecatedCreateDisputeEvidenceTextResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence|null $value - */ - public function evidence(?DisputeEvidence $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Initializes a new Deprecated Create Dispute Evidence Text Response object. - */ - public function build(): DeprecatedCreateDisputeEvidenceTextResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DestinationBuilder.php b/src/Models/Builders/DestinationBuilder.php deleted file mode 100644 index e3b25cb6..00000000 --- a/src/Models/Builders/DestinationBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Destination Builder object. - */ - public static function init(): self - { - return new self(new Destination()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Initializes a new Destination object. - */ - public function build(): Destination - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DestinationDetailsBuilder.php b/src/Models/Builders/DestinationDetailsBuilder.php deleted file mode 100644 index 539f0a2f..00000000 --- a/src/Models/Builders/DestinationDetailsBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Destination Details Builder object. - */ - public static function init(): self - { - return new self(new DestinationDetails()); - } - - /** - * Sets card details field. - * - * @param DestinationDetailsCardRefundDetails|null $value - */ - public function cardDetails(?DestinationDetailsCardRefundDetails $value): self - { - $this->instance->setCardDetails($value); - return $this; - } - - /** - * Sets cash details field. - * - * @param DestinationDetailsCashRefundDetails|null $value - */ - public function cashDetails(?DestinationDetailsCashRefundDetails $value): self - { - $this->instance->setCashDetails($value); - return $this; - } - - /** - * Sets external details field. - * - * @param DestinationDetailsExternalRefundDetails|null $value - */ - public function externalDetails(?DestinationDetailsExternalRefundDetails $value): self - { - $this->instance->setExternalDetails($value); - return $this; - } - - /** - * Initializes a new Destination Details object. - */ - public function build(): DestinationDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php b/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php deleted file mode 100644 index fb189879..00000000 --- a/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Destination Details Card Refund Details Builder object. - */ - public static function init(): self - { - return new self(new DestinationDetailsCardRefundDetails()); - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Sets entry method field. - * - * @param string|null $value - */ - public function entryMethod(?string $value): self - { - $this->instance->setEntryMethod($value); - return $this; - } - - /** - * Unsets entry method field. - */ - public function unsetEntryMethod(): self - { - $this->instance->unsetEntryMethod(); - return $this; - } - - /** - * Sets auth result code field. - * - * @param string|null $value - */ - public function authResultCode(?string $value): self - { - $this->instance->setAuthResultCode($value); - return $this; - } - - /** - * Unsets auth result code field. - */ - public function unsetAuthResultCode(): self - { - $this->instance->unsetAuthResultCode(); - return $this; - } - - /** - * Initializes a new Destination Details Card Refund Details object. - */ - public function build(): DestinationDetailsCardRefundDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DestinationDetailsCashRefundDetailsBuilder.php b/src/Models/Builders/DestinationDetailsCashRefundDetailsBuilder.php deleted file mode 100644 index 3e24e0f0..00000000 --- a/src/Models/Builders/DestinationDetailsCashRefundDetailsBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Destination Details Cash Refund Details Builder object. - * - * @param Money $sellerSuppliedMoney - */ - public static function init(Money $sellerSuppliedMoney): self - { - return new self(new DestinationDetailsCashRefundDetails($sellerSuppliedMoney)); - } - - /** - * Sets change back money field. - * - * @param Money|null $value - */ - public function changeBackMoney(?Money $value): self - { - $this->instance->setChangeBackMoney($value); - return $this; - } - - /** - * Initializes a new Destination Details Cash Refund Details object. - */ - public function build(): DestinationDetailsCashRefundDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DestinationDetailsExternalRefundDetailsBuilder.php b/src/Models/Builders/DestinationDetailsExternalRefundDetailsBuilder.php deleted file mode 100644 index de7b14bf..00000000 --- a/src/Models/Builders/DestinationDetailsExternalRefundDetailsBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Destination Details External Refund Details Builder object. - * - * @param string $type - * @param string $source - */ - public static function init(string $type, string $source): self - { - return new self(new DestinationDetailsExternalRefundDetails($type, $source)); - } - - /** - * Sets source id field. - * - * @param string|null $value - */ - public function sourceId(?string $value): self - { - $this->instance->setSourceId($value); - return $this; - } - - /** - * Unsets source id field. - */ - public function unsetSourceId(): self - { - $this->instance->unsetSourceId(); - return $this; - } - - /** - * Initializes a new Destination Details External Refund Details object. - */ - public function build(): DestinationDetailsExternalRefundDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceAttributesBuilder.php b/src/Models/Builders/DeviceAttributesBuilder.php deleted file mode 100644 index 9a5a733e..00000000 --- a/src/Models/Builders/DeviceAttributesBuilder.php +++ /dev/null @@ -1,146 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Attributes Builder object. - * - * @param string $manufacturer - */ - public static function init(string $manufacturer): self - { - return new self(new DeviceAttributes($manufacturer)); - } - - /** - * Sets model field. - * - * @param string|null $value - */ - public function model(?string $value): self - { - $this->instance->setModel($value); - return $this; - } - - /** - * Unsets model field. - */ - public function unsetModel(): self - { - $this->instance->unsetModel(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets manufacturers id field. - * - * @param string|null $value - */ - public function manufacturersId(?string $value): self - { - $this->instance->setManufacturersId($value); - return $this; - } - - /** - * Unsets manufacturers id field. - */ - public function unsetManufacturersId(): self - { - $this->instance->unsetManufacturersId(); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets version field. - * - * @param string|null $value - */ - public function version(?string $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets merchant token field. - * - * @param string|null $value - */ - public function merchantToken(?string $value): self - { - $this->instance->setMerchantToken($value); - return $this; - } - - /** - * Unsets merchant token field. - */ - public function unsetMerchantToken(): self - { - $this->instance->unsetMerchantToken(); - return $this; - } - - /** - * Initializes a new Device Attributes object. - */ - public function build(): DeviceAttributes - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceBuilder.php b/src/Models/Builders/DeviceBuilder.php deleted file mode 100644 index e75c1110..00000000 --- a/src/Models/Builders/DeviceBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Builder object. - * - * @param DeviceAttributes $attributes - */ - public static function init(DeviceAttributes $attributes): self - { - return new self(new Device($attributes)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets components field. - * - * @param Component[]|null $value - */ - public function components(?array $value): self - { - $this->instance->setComponents($value); - return $this; - } - - /** - * Unsets components field. - */ - public function unsetComponents(): self - { - $this->instance->unsetComponents(); - return $this; - } - - /** - * Sets status field. - * - * @param DeviceStatus|null $value - */ - public function status(?DeviceStatus $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Device object. - */ - public function build(): Device - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceCheckoutOptionsBuilder.php b/src/Models/Builders/DeviceCheckoutOptionsBuilder.php deleted file mode 100644 index 9a518e8f..00000000 --- a/src/Models/Builders/DeviceCheckoutOptionsBuilder.php +++ /dev/null @@ -1,116 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Checkout Options Builder object. - * - * @param string $deviceId - */ - public static function init(string $deviceId): self - { - return new self(new DeviceCheckoutOptions($deviceId)); - } - - /** - * Sets skip receipt screen field. - * - * @param bool|null $value - */ - public function skipReceiptScreen(?bool $value): self - { - $this->instance->setSkipReceiptScreen($value); - return $this; - } - - /** - * Unsets skip receipt screen field. - */ - public function unsetSkipReceiptScreen(): self - { - $this->instance->unsetSkipReceiptScreen(); - return $this; - } - - /** - * Sets collect signature field. - * - * @param bool|null $value - */ - public function collectSignature(?bool $value): self - { - $this->instance->setCollectSignature($value); - return $this; - } - - /** - * Unsets collect signature field. - */ - public function unsetCollectSignature(): self - { - $this->instance->unsetCollectSignature(); - return $this; - } - - /** - * Sets tip settings field. - * - * @param TipSettings|null $value - */ - public function tipSettings(?TipSettings $value): self - { - $this->instance->setTipSettings($value); - return $this; - } - - /** - * Sets show itemized cart field. - * - * @param bool|null $value - */ - public function showItemizedCart(?bool $value): self - { - $this->instance->setShowItemizedCart($value); - return $this; - } - - /** - * Unsets show itemized cart field. - */ - public function unsetShowItemizedCart(): self - { - $this->instance->unsetShowItemizedCart(); - return $this; - } - - /** - * Initializes a new Device Checkout Options object. - */ - public function build(): DeviceCheckoutOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceCodeBuilder.php b/src/Models/Builders/DeviceCodeBuilder.php deleted file mode 100644 index 6123e837..00000000 --- a/src/Models/Builders/DeviceCodeBuilder.php +++ /dev/null @@ -1,170 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Code Builder object. - */ - public static function init(): self - { - return new self(new DeviceCode()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets code field. - * - * @param string|null $value - */ - public function code(?string $value): self - { - $this->instance->setCode($value); - return $this; - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets pair by field. - * - * @param string|null $value - */ - public function pairBy(?string $value): self - { - $this->instance->setPairBy($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets status changed at field. - * - * @param string|null $value - */ - public function statusChangedAt(?string $value): self - { - $this->instance->setStatusChangedAt($value); - return $this; - } - - /** - * Sets paired at field. - * - * @param string|null $value - */ - public function pairedAt(?string $value): self - { - $this->instance->setPairedAt($value); - return $this; - } - - /** - * Initializes a new Device Code object. - */ - public function build(): DeviceCode - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsApplicationDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsApplicationDetailsBuilder.php deleted file mode 100644 index 9c25ce82..00000000 --- a/src/Models/Builders/DeviceComponentDetailsApplicationDetailsBuilder.php +++ /dev/null @@ -1,104 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Application Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsApplicationDetails()); - } - - /** - * Sets application type field. - * - * @param string|null $value - */ - public function applicationType(?string $value): self - { - $this->instance->setApplicationType($value); - return $this; - } - - /** - * Sets version field. - * - * @param string|null $value - */ - public function version(?string $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets session location field. - * - * @param string|null $value - */ - public function sessionLocation(?string $value): self - { - $this->instance->setSessionLocation($value); - return $this; - } - - /** - * Unsets session location field. - */ - public function unsetSessionLocation(): self - { - $this->instance->unsetSessionLocation(); - return $this; - } - - /** - * Sets device code id field. - * - * @param string|null $value - */ - public function deviceCodeId(?string $value): self - { - $this->instance->setDeviceCodeId($value); - return $this; - } - - /** - * Unsets device code id field. - */ - public function unsetDeviceCodeId(): self - { - $this->instance->unsetDeviceCodeId(); - return $this; - } - - /** - * Initializes a new Device Component Details Application Details object. - */ - public function build(): DeviceComponentDetailsApplicationDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsBatteryDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsBatteryDetailsBuilder.php deleted file mode 100644 index b99d226a..00000000 --- a/src/Models/Builders/DeviceComponentDetailsBatteryDetailsBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Battery Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsBatteryDetails()); - } - - /** - * Sets visible percent field. - * - * @param int|null $value - */ - public function visiblePercent(?int $value): self - { - $this->instance->setVisiblePercent($value); - return $this; - } - - /** - * Unsets visible percent field. - */ - public function unsetVisiblePercent(): self - { - $this->instance->unsetVisiblePercent(); - return $this; - } - - /** - * Sets external power field. - * - * @param string|null $value - */ - public function externalPower(?string $value): self - { - $this->instance->setExternalPower($value); - return $this; - } - - /** - * Initializes a new Device Component Details Battery Details object. - */ - public function build(): DeviceComponentDetailsBatteryDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsCardReaderDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsCardReaderDetailsBuilder.php deleted file mode 100644 index b1ebfd29..00000000 --- a/src/Models/Builders/DeviceComponentDetailsCardReaderDetailsBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Card Reader Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsCardReaderDetails()); - } - - /** - * Sets version field. - * - * @param string|null $value - */ - public function version(?string $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Device Component Details Card Reader Details object. - */ - public function build(): DeviceComponentDetailsCardReaderDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsEthernetDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsEthernetDetailsBuilder.php deleted file mode 100644 index 9341a5da..00000000 --- a/src/Models/Builders/DeviceComponentDetailsEthernetDetailsBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Ethernet Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsEthernetDetails()); - } - - /** - * Sets active field. - * - * @param bool|null $value - */ - public function active(?bool $value): self - { - $this->instance->setActive($value); - return $this; - } - - /** - * Unsets active field. - */ - public function unsetActive(): self - { - $this->instance->unsetActive(); - return $this; - } - - /** - * Sets ip address v 4 field. - * - * @param string|null $value - */ - public function ipAddressV4(?string $value): self - { - $this->instance->setIpAddressV4($value); - return $this; - } - - /** - * Unsets ip address v 4 field. - */ - public function unsetIpAddressV4(): self - { - $this->instance->unsetIpAddressV4(); - return $this; - } - - /** - * Initializes a new Device Component Details Ethernet Details object. - */ - public function build(): DeviceComponentDetailsEthernetDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsMeasurementBuilder.php b/src/Models/Builders/DeviceComponentDetailsMeasurementBuilder.php deleted file mode 100644 index b3be6123..00000000 --- a/src/Models/Builders/DeviceComponentDetailsMeasurementBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Measurement Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsMeasurement()); - } - - /** - * Sets value field. - * - * @param int|null $value - */ - public function value(?int $value): self - { - $this->instance->setValue($value); - return $this; - } - - /** - * Unsets value field. - */ - public function unsetValue(): self - { - $this->instance->unsetValue(); - return $this; - } - - /** - * Initializes a new Device Component Details Measurement object. - */ - public function build(): DeviceComponentDetailsMeasurement - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsNetworkInterfaceDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsNetworkInterfaceDetailsBuilder.php deleted file mode 100644 index e9eddc48..00000000 --- a/src/Models/Builders/DeviceComponentDetailsNetworkInterfaceDetailsBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Network Interface Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsNetworkInterfaceDetails()); - } - - /** - * Sets ip address v 4 field. - * - * @param string|null $value - */ - public function ipAddressV4(?string $value): self - { - $this->instance->setIpAddressV4($value); - return $this; - } - - /** - * Unsets ip address v 4 field. - */ - public function unsetIpAddressV4(): self - { - $this->instance->unsetIpAddressV4(); - return $this; - } - - /** - * Initializes a new Device Component Details Network Interface Details object. - */ - public function build(): DeviceComponentDetailsNetworkInterfaceDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceComponentDetailsWiFiDetailsBuilder.php b/src/Models/Builders/DeviceComponentDetailsWiFiDetailsBuilder.php deleted file mode 100644 index 8f51f9f1..00000000 --- a/src/Models/Builders/DeviceComponentDetailsWiFiDetailsBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Component Details Wi Fi Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceComponentDetailsWiFiDetails()); - } - - /** - * Sets active field. - * - * @param bool|null $value - */ - public function active(?bool $value): self - { - $this->instance->setActive($value); - return $this; - } - - /** - * Unsets active field. - */ - public function unsetActive(): self - { - $this->instance->unsetActive(); - return $this; - } - - /** - * Sets ssid field. - * - * @param string|null $value - */ - public function ssid(?string $value): self - { - $this->instance->setSsid($value); - return $this; - } - - /** - * Unsets ssid field. - */ - public function unsetSsid(): self - { - $this->instance->unsetSsid(); - return $this; - } - - /** - * Sets ip address v 4 field. - * - * @param string|null $value - */ - public function ipAddressV4(?string $value): self - { - $this->instance->setIpAddressV4($value); - return $this; - } - - /** - * Unsets ip address v 4 field. - */ - public function unsetIpAddressV4(): self - { - $this->instance->unsetIpAddressV4(); - return $this; - } - - /** - * Sets secure connection field. - * - * @param string|null $value - */ - public function secureConnection(?string $value): self - { - $this->instance->setSecureConnection($value); - return $this; - } - - /** - * Unsets secure connection field. - */ - public function unsetSecureConnection(): self - { - $this->instance->unsetSecureConnection(); - return $this; - } - - /** - * Sets signal strength field. - * - * @param DeviceComponentDetailsMeasurement|null $value - */ - public function signalStrength(?DeviceComponentDetailsMeasurement $value): self - { - $this->instance->setSignalStrength($value); - return $this; - } - - /** - * Initializes a new Device Component Details Wi Fi Details object. - */ - public function build(): DeviceComponentDetailsWiFiDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceDetailsBuilder.php b/src/Models/Builders/DeviceDetailsBuilder.php deleted file mode 100644 index 4190be67..00000000 --- a/src/Models/Builders/DeviceDetailsBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Details Builder object. - */ - public static function init(): self - { - return new self(new DeviceDetails()); - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Unsets device id field. - */ - public function unsetDeviceId(): self - { - $this->instance->unsetDeviceId(); - return $this; - } - - /** - * Sets device installation id field. - * - * @param string|null $value - */ - public function deviceInstallationId(?string $value): self - { - $this->instance->setDeviceInstallationId($value); - return $this; - } - - /** - * Unsets device installation id field. - */ - public function unsetDeviceInstallationId(): self - { - $this->instance->unsetDeviceInstallationId(); - return $this; - } - - /** - * Sets device name field. - * - * @param string|null $value - */ - public function deviceName(?string $value): self - { - $this->instance->setDeviceName($value); - return $this; - } - - /** - * Unsets device name field. - */ - public function unsetDeviceName(): self - { - $this->instance->unsetDeviceName(); - return $this; - } - - /** - * Initializes a new Device Details object. - */ - public function build(): DeviceDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceMetadataBuilder.php b/src/Models/Builders/DeviceMetadataBuilder.php deleted file mode 100644 index f143df91..00000000 --- a/src/Models/Builders/DeviceMetadataBuilder.php +++ /dev/null @@ -1,282 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Metadata Builder object. - */ - public static function init(): self - { - return new self(new DeviceMetadata()); - } - - /** - * Sets battery percentage field. - * - * @param string|null $value - */ - public function batteryPercentage(?string $value): self - { - $this->instance->setBatteryPercentage($value); - return $this; - } - - /** - * Unsets battery percentage field. - */ - public function unsetBatteryPercentage(): self - { - $this->instance->unsetBatteryPercentage(); - return $this; - } - - /** - * Sets charging state field. - * - * @param string|null $value - */ - public function chargingState(?string $value): self - { - $this->instance->setChargingState($value); - return $this; - } - - /** - * Unsets charging state field. - */ - public function unsetChargingState(): self - { - $this->instance->unsetChargingState(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Unsets merchant id field. - */ - public function unsetMerchantId(): self - { - $this->instance->unsetMerchantId(); - return $this; - } - - /** - * Sets network connection type field. - * - * @param string|null $value - */ - public function networkConnectionType(?string $value): self - { - $this->instance->setNetworkConnectionType($value); - return $this; - } - - /** - * Unsets network connection type field. - */ - public function unsetNetworkConnectionType(): self - { - $this->instance->unsetNetworkConnectionType(); - return $this; - } - - /** - * Sets payment region field. - * - * @param string|null $value - */ - public function paymentRegion(?string $value): self - { - $this->instance->setPaymentRegion($value); - return $this; - } - - /** - * Unsets payment region field. - */ - public function unsetPaymentRegion(): self - { - $this->instance->unsetPaymentRegion(); - return $this; - } - - /** - * Sets serial number field. - * - * @param string|null $value - */ - public function serialNumber(?string $value): self - { - $this->instance->setSerialNumber($value); - return $this; - } - - /** - * Unsets serial number field. - */ - public function unsetSerialNumber(): self - { - $this->instance->unsetSerialNumber(); - return $this; - } - - /** - * Sets os version field. - * - * @param string|null $value - */ - public function osVersion(?string $value): self - { - $this->instance->setOsVersion($value); - return $this; - } - - /** - * Unsets os version field. - */ - public function unsetOsVersion(): self - { - $this->instance->unsetOsVersion(); - return $this; - } - - /** - * Sets app version field. - * - * @param string|null $value - */ - public function appVersion(?string $value): self - { - $this->instance->setAppVersion($value); - return $this; - } - - /** - * Unsets app version field. - */ - public function unsetAppVersion(): self - { - $this->instance->unsetAppVersion(); - return $this; - } - - /** - * Sets wifi network name field. - * - * @param string|null $value - */ - public function wifiNetworkName(?string $value): self - { - $this->instance->setWifiNetworkName($value); - return $this; - } - - /** - * Unsets wifi network name field. - */ - public function unsetWifiNetworkName(): self - { - $this->instance->unsetWifiNetworkName(); - return $this; - } - - /** - * Sets wifi network strength field. - * - * @param string|null $value - */ - public function wifiNetworkStrength(?string $value): self - { - $this->instance->setWifiNetworkStrength($value); - return $this; - } - - /** - * Unsets wifi network strength field. - */ - public function unsetWifiNetworkStrength(): self - { - $this->instance->unsetWifiNetworkStrength(); - return $this; - } - - /** - * Sets ip address field. - * - * @param string|null $value - */ - public function ipAddress(?string $value): self - { - $this->instance->setIpAddress($value); - return $this; - } - - /** - * Unsets ip address field. - */ - public function unsetIpAddress(): self - { - $this->instance->unsetIpAddress(); - return $this; - } - - /** - * Initializes a new Device Metadata object. - */ - public function build(): DeviceMetadata - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DeviceStatusBuilder.php b/src/Models/Builders/DeviceStatusBuilder.php deleted file mode 100644 index dd82f24c..00000000 --- a/src/Models/Builders/DeviceStatusBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Device Status Builder object. - */ - public static function init(): self - { - return new self(new DeviceStatus()); - } - - /** - * Sets category field. - * - * @param string|null $value - */ - public function category(?string $value): self - { - $this->instance->setCategory($value); - return $this; - } - - /** - * Initializes a new Device Status object. - */ - public function build(): DeviceStatus - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DigitalWalletDetailsBuilder.php b/src/Models/Builders/DigitalWalletDetailsBuilder.php deleted file mode 100644 index 0dae1713..00000000 --- a/src/Models/Builders/DigitalWalletDetailsBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Digital Wallet Details Builder object. - */ - public static function init(): self - { - return new self(new DigitalWalletDetails()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Sets brand field. - * - * @param string|null $value - */ - public function brand(?string $value): self - { - $this->instance->setBrand($value); - return $this; - } - - /** - * Unsets brand field. - */ - public function unsetBrand(): self - { - $this->instance->unsetBrand(); - return $this; - } - - /** - * Sets cash app details field. - * - * @param CashAppDetails|null $value - */ - public function cashAppDetails(?CashAppDetails $value): self - { - $this->instance->setCashAppDetails($value); - return $this; - } - - /** - * Initializes a new Digital Wallet Details object. - */ - public function build(): DigitalWalletDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisableCardResponseBuilder.php b/src/Models/Builders/DisableCardResponseBuilder.php deleted file mode 100644 index be808cbb..00000000 --- a/src/Models/Builders/DisableCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Disable Card Response Builder object. - */ - public static function init(): self - { - return new self(new DisableCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Initializes a new Disable Card Response object. - */ - public function build(): DisableCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisableEventsResponseBuilder.php b/src/Models/Builders/DisableEventsResponseBuilder.php deleted file mode 100644 index 4ede91b2..00000000 --- a/src/Models/Builders/DisableEventsResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Disable Events Response Builder object. - */ - public static function init(): self - { - return new self(new DisableEventsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Disable Events Response object. - */ - public function build(): DisableEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DismissTerminalActionResponseBuilder.php b/src/Models/Builders/DismissTerminalActionResponseBuilder.php deleted file mode 100644 index 26d76b3a..00000000 --- a/src/Models/Builders/DismissTerminalActionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dismiss Terminal Action Response Builder object. - */ - public static function init(): self - { - return new self(new DismissTerminalActionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets action field. - * - * @param TerminalAction|null $value - */ - public function action(?TerminalAction $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Initializes a new Dismiss Terminal Action Response object. - */ - public function build(): DismissTerminalActionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DismissTerminalCheckoutResponseBuilder.php b/src/Models/Builders/DismissTerminalCheckoutResponseBuilder.php deleted file mode 100644 index abf2d265..00000000 --- a/src/Models/Builders/DismissTerminalCheckoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dismiss Terminal Checkout Response Builder object. - */ - public static function init(): self - { - return new self(new DismissTerminalCheckoutResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets checkout field. - * - * @param TerminalCheckout|null $value - */ - public function checkout(?TerminalCheckout $value): self - { - $this->instance->setCheckout($value); - return $this; - } - - /** - * Initializes a new Dismiss Terminal Checkout Response object. - */ - public function build(): DismissTerminalCheckoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DismissTerminalRefundResponseBuilder.php b/src/Models/Builders/DismissTerminalRefundResponseBuilder.php deleted file mode 100644 index 10e0c659..00000000 --- a/src/Models/Builders/DismissTerminalRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dismiss Terminal Refund Response Builder object. - */ - public static function init(): self - { - return new self(new DismissTerminalRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param TerminalRefund|null $value - */ - public function refund(?TerminalRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Dismiss Terminal Refund Response object. - */ - public function build(): DismissTerminalRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisputeBuilder.php b/src/Models/Builders/DisputeBuilder.php deleted file mode 100644 index ae7bc6eb..00000000 --- a/src/Models/Builders/DisputeBuilder.php +++ /dev/null @@ -1,283 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dispute Builder object. - */ - public static function init(): self - { - return new self(new Dispute()); - } - - /** - * Sets dispute id field. - * - * @param string|null $value - */ - public function disputeId(?string $value): self - { - $this->instance->setDisputeId($value); - return $this; - } - - /** - * Unsets dispute id field. - */ - public function unsetDisputeId(): self - { - $this->instance->unsetDisputeId(); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets reason field. - * - * @param string|null $value - */ - public function reason(?string $value): self - { - $this->instance->setReason($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets due at field. - * - * @param string|null $value - */ - public function dueAt(?string $value): self - { - $this->instance->setDueAt($value); - return $this; - } - - /** - * Unsets due at field. - */ - public function unsetDueAt(): self - { - $this->instance->unsetDueAt(); - return $this; - } - - /** - * Sets disputed payment field. - * - * @param DisputedPayment|null $value - */ - public function disputedPayment(?DisputedPayment $value): self - { - $this->instance->setDisputedPayment($value); - return $this; - } - - /** - * Sets evidence ids field. - * - * @param string[]|null $value - */ - public function evidenceIds(?array $value): self - { - $this->instance->setEvidenceIds($value); - return $this; - } - - /** - * Unsets evidence ids field. - */ - public function unsetEvidenceIds(): self - { - $this->instance->unsetEvidenceIds(); - return $this; - } - - /** - * Sets card brand field. - * - * @param string|null $value - */ - public function cardBrand(?string $value): self - { - $this->instance->setCardBrand($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets brand dispute id field. - * - * @param string|null $value - */ - public function brandDisputeId(?string $value): self - { - $this->instance->setBrandDisputeId($value); - return $this; - } - - /** - * Unsets brand dispute id field. - */ - public function unsetBrandDisputeId(): self - { - $this->instance->unsetBrandDisputeId(); - return $this; - } - - /** - * Sets reported date field. - * - * @param string|null $value - */ - public function reportedDate(?string $value): self - { - $this->instance->setReportedDate($value); - return $this; - } - - /** - * Unsets reported date field. - */ - public function unsetReportedDate(): self - { - $this->instance->unsetReportedDate(); - return $this; - } - - /** - * Sets reported at field. - * - * @param string|null $value - */ - public function reportedAt(?string $value): self - { - $this->instance->setReportedAt($value); - return $this; - } - - /** - * Unsets reported at field. - */ - public function unsetReportedAt(): self - { - $this->instance->unsetReportedAt(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Dispute object. - */ - public function build(): Dispute - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisputeEvidenceBuilder.php b/src/Models/Builders/DisputeEvidenceBuilder.php deleted file mode 100644 index 8e3c10e3..00000000 --- a/src/Models/Builders/DisputeEvidenceBuilder.php +++ /dev/null @@ -1,156 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dispute Evidence Builder object. - */ - public static function init(): self - { - return new self(new DisputeEvidence()); - } - - /** - * Sets evidence id field. - * - * @param string|null $value - */ - public function evidenceId(?string $value): self - { - $this->instance->setEvidenceId($value); - return $this; - } - - /** - * Unsets evidence id field. - */ - public function unsetEvidenceId(): self - { - $this->instance->unsetEvidenceId(); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets dispute id field. - * - * @param string|null $value - */ - public function disputeId(?string $value): self - { - $this->instance->setDisputeId($value); - return $this; - } - - /** - * Unsets dispute id field. - */ - public function unsetDisputeId(): self - { - $this->instance->unsetDisputeId(); - return $this; - } - - /** - * Sets evidence file field. - * - * @param DisputeEvidenceFile|null $value - */ - public function evidenceFile(?DisputeEvidenceFile $value): self - { - $this->instance->setEvidenceFile($value); - return $this; - } - - /** - * Sets evidence text field. - * - * @param string|null $value - */ - public function evidenceText(?string $value): self - { - $this->instance->setEvidenceText($value); - return $this; - } - - /** - * Unsets evidence text field. - */ - public function unsetEvidenceText(): self - { - $this->instance->unsetEvidenceText(); - return $this; - } - - /** - * Sets uploaded at field. - * - * @param string|null $value - */ - public function uploadedAt(?string $value): self - { - $this->instance->setUploadedAt($value); - return $this; - } - - /** - * Unsets uploaded at field. - */ - public function unsetUploadedAt(): self - { - $this->instance->unsetUploadedAt(); - return $this; - } - - /** - * Sets evidence type field. - * - * @param string|null $value - */ - public function evidenceType(?string $value): self - { - $this->instance->setEvidenceType($value); - return $this; - } - - /** - * Initializes a new Dispute Evidence object. - */ - public function build(): DisputeEvidence - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisputeEvidenceFileBuilder.php b/src/Models/Builders/DisputeEvidenceFileBuilder.php deleted file mode 100644 index af76d5bf..00000000 --- a/src/Models/Builders/DisputeEvidenceFileBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Dispute Evidence File Builder object. - */ - public static function init(): self - { - return new self(new DisputeEvidenceFile()); - } - - /** - * Sets filename field. - * - * @param string|null $value - */ - public function filename(?string $value): self - { - $this->instance->setFilename($value); - return $this; - } - - /** - * Unsets filename field. - */ - public function unsetFilename(): self - { - $this->instance->unsetFilename(); - return $this; - } - - /** - * Sets filetype field. - * - * @param string|null $value - */ - public function filetype(?string $value): self - { - $this->instance->setFiletype($value); - return $this; - } - - /** - * Unsets filetype field. - */ - public function unsetFiletype(): self - { - $this->instance->unsetFiletype(); - return $this; - } - - /** - * Initializes a new Dispute Evidence File object. - */ - public function build(): DisputeEvidenceFile - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/DisputedPaymentBuilder.php b/src/Models/Builders/DisputedPaymentBuilder.php deleted file mode 100644 index d05dd91a..00000000 --- a/src/Models/Builders/DisputedPaymentBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Disputed Payment Builder object. - */ - public static function init(): self - { - return new self(new DisputedPayment()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Disputed Payment object. - */ - public function build(): DisputedPayment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EmployeeBuilder.php b/src/Models/Builders/EmployeeBuilder.php deleted file mode 100644 index fc622885..00000000 --- a/src/Models/Builders/EmployeeBuilder.php +++ /dev/null @@ -1,206 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Employee Builder object. - */ - public static function init(): self - { - return new self(new Employee()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets first name field. - * - * @param string|null $value - */ - public function firstName(?string $value): self - { - $this->instance->setFirstName($value); - return $this; - } - - /** - * Unsets first name field. - */ - public function unsetFirstName(): self - { - $this->instance->unsetFirstName(); - return $this; - } - - /** - * Sets last name field. - * - * @param string|null $value - */ - public function lastName(?string $value): self - { - $this->instance->setLastName($value); - return $this; - } - - /** - * Unsets last name field. - */ - public function unsetLastName(): self - { - $this->instance->unsetLastName(); - return $this; - } - - /** - * Sets email field. - * - * @param string|null $value - */ - public function email(?string $value): self - { - $this->instance->setEmail($value); - return $this; - } - - /** - * Unsets email field. - */ - public function unsetEmail(): self - { - $this->instance->unsetEmail(); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets is owner field. - * - * @param bool|null $value - */ - public function isOwner(?bool $value): self - { - $this->instance->setIsOwner($value); - return $this; - } - - /** - * Unsets is owner field. - */ - public function unsetIsOwner(): self - { - $this->instance->unsetIsOwner(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Employee object. - */ - public function build(): Employee - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EmployeeWageBuilder.php b/src/Models/Builders/EmployeeWageBuilder.php deleted file mode 100644 index af71b444..00000000 --- a/src/Models/Builders/EmployeeWageBuilder.php +++ /dev/null @@ -1,105 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Employee Wage Builder object. - */ - public static function init(): self - { - return new self(new EmployeeWage()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets hourly rate field. - * - * @param Money|null $value - */ - public function hourlyRate(?Money $value): self - { - $this->instance->setHourlyRate($value); - return $this; - } - - /** - * Initializes a new Employee Wage object. - */ - public function build(): EmployeeWage - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EnableEventsResponseBuilder.php b/src/Models/Builders/EnableEventsResponseBuilder.php deleted file mode 100644 index 3f10b1f7..00000000 --- a/src/Models/Builders/EnableEventsResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Enable Events Response Builder object. - */ - public static function init(): self - { - return new self(new EnableEventsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Enable Events Response object. - */ - public function build(): EnableEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ErrorBuilder.php b/src/Models/Builders/ErrorBuilder.php deleted file mode 100644 index 60a1a78f..00000000 --- a/src/Models/Builders/ErrorBuilder.php +++ /dev/null @@ -1,67 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Error Builder object. - * - * @param string $category - * @param string $code - */ - public static function init(string $category, string $code): self - { - return new self(new Error($category, $code)); - } - - /** - * Sets detail field. - * - * @param string|null $value - */ - public function detail(?string $value): self - { - $this->instance->setDetail($value); - return $this; - } - - /** - * Sets field field. - * - * @param string|null $value - */ - public function field(?string $value): self - { - $this->instance->setField($value); - return $this; - } - - /** - * Initializes a new Error object. - */ - public function build(): Error - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EventBuilder.php b/src/Models/Builders/EventBuilder.php deleted file mode 100644 index 943117d2..00000000 --- a/src/Models/Builders/EventBuilder.php +++ /dev/null @@ -1,145 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Event Builder object. - */ - public static function init(): self - { - return new self(new Event()); - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Unsets merchant id field. - */ - public function unsetMerchantId(): self - { - $this->instance->unsetMerchantId(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Unsets type field. - */ - public function unsetType(): self - { - $this->instance->unsetType(); - return $this; - } - - /** - * Sets event id field. - * - * @param string|null $value - */ - public function eventId(?string $value): self - { - $this->instance->setEventId($value); - return $this; - } - - /** - * Unsets event id field. - */ - public function unsetEventId(): self - { - $this->instance->unsetEventId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets data field. - * - * @param EventData|null $value - */ - public function data(?EventData $value): self - { - $this->instance->setData($value); - return $this; - } - - /** - * Initializes a new Event object. - */ - public function build(): Event - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EventDataBuilder.php b/src/Models/Builders/EventDataBuilder.php deleted file mode 100644 index 3cf9cee5..00000000 --- a/src/Models/Builders/EventDataBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Event Data Builder object. - */ - public static function init(): self - { - return new self(new EventData()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Unsets type field. - */ - public function unsetType(): self - { - $this->instance->unsetType(); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets deleted field. - * - * @param bool|null $value - */ - public function deleted(?bool $value): self - { - $this->instance->setDeleted($value); - return $this; - } - - /** - * Unsets deleted field. - */ - public function unsetDeleted(): self - { - $this->instance->unsetDeleted(); - return $this; - } - - /** - * Sets object field. - * - * @param mixed $value - */ - public function object($value): self - { - $this->instance->setObject($value); - return $this; - } - - /** - * Unsets object field. - */ - public function unsetObject(): self - { - $this->instance->unsetObject(); - return $this; - } - - /** - * Initializes a new Event Data object. - */ - public function build(): EventData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EventMetadataBuilder.php b/src/Models/Builders/EventMetadataBuilder.php deleted file mode 100644 index 359abfac..00000000 --- a/src/Models/Builders/EventMetadataBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Event Metadata Builder object. - */ - public static function init(): self - { - return new self(new EventMetadata()); - } - - /** - * Sets event id field. - * - * @param string|null $value - */ - public function eventId(?string $value): self - { - $this->instance->setEventId($value); - return $this; - } - - /** - * Unsets event id field. - */ - public function unsetEventId(): self - { - $this->instance->unsetEventId(); - return $this; - } - - /** - * Sets api version field. - * - * @param string|null $value - */ - public function apiVersion(?string $value): self - { - $this->instance->setApiVersion($value); - return $this; - } - - /** - * Unsets api version field. - */ - public function unsetApiVersion(): self - { - $this->instance->unsetApiVersion(); - return $this; - } - - /** - * Initializes a new Event Metadata object. - */ - public function build(): EventMetadata - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/EventTypeMetadataBuilder.php b/src/Models/Builders/EventTypeMetadataBuilder.php deleted file mode 100644 index 49ba9d03..00000000 --- a/src/Models/Builders/EventTypeMetadataBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Event Type Metadata Builder object. - */ - public static function init(): self - { - return new self(new EventTypeMetadata()); - } - - /** - * Sets event type field. - * - * @param string|null $value - */ - public function eventType(?string $value): self - { - $this->instance->setEventType($value); - return $this; - } - - /** - * Sets api version introduced field. - * - * @param string|null $value - */ - public function apiVersionIntroduced(?string $value): self - { - $this->instance->setApiVersionIntroduced($value); - return $this; - } - - /** - * Sets release status field. - * - * @param string|null $value - */ - public function releaseStatus(?string $value): self - { - $this->instance->setReleaseStatus($value); - return $this; - } - - /** - * Initializes a new Event Type Metadata object. - */ - public function build(): EventTypeMetadata - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ExternalPaymentDetailsBuilder.php b/src/Models/Builders/ExternalPaymentDetailsBuilder.php deleted file mode 100644 index eeb0eefb..00000000 --- a/src/Models/Builders/ExternalPaymentDetailsBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new External Payment Details Builder object. - * - * @param string $type - * @param string $source - */ - public static function init(string $type, string $source): self - { - return new self(new ExternalPaymentDetails($type, $source)); - } - - /** - * Sets source id field. - * - * @param string|null $value - */ - public function sourceId(?string $value): self - { - $this->instance->setSourceId($value); - return $this; - } - - /** - * Unsets source id field. - */ - public function unsetSourceId(): self - { - $this->instance->unsetSourceId(); - return $this; - } - - /** - * Sets source fee money field. - * - * @param Money|null $value - */ - public function sourceFeeMoney(?Money $value): self - { - $this->instance->setSourceFeeMoney($value); - return $this; - } - - /** - * Initializes a new External Payment Details object. - */ - public function build(): ExternalPaymentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FilterValueBuilder.php b/src/Models/Builders/FilterValueBuilder.php deleted file mode 100644 index 6a891969..00000000 --- a/src/Models/Builders/FilterValueBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Filter Value Builder object. - */ - public static function init(): self - { - return new self(new FilterValue()); - } - - /** - * Sets all field. - * - * @param string[]|null $value - */ - public function all(?array $value): self - { - $this->instance->setAll($value); - return $this; - } - - /** - * Unsets all field. - */ - public function unsetAll(): self - { - $this->instance->unsetAll(); - return $this; - } - - /** - * Sets any field. - * - * @param string[]|null $value - */ - public function any(?array $value): self - { - $this->instance->setAny($value); - return $this; - } - - /** - * Unsets any field. - */ - public function unsetAny(): self - { - $this->instance->unsetAny(); - return $this; - } - - /** - * Sets none field. - * - * @param string[]|null $value - */ - public function none(?array $value): self - { - $this->instance->setNone($value); - return $this; - } - - /** - * Unsets none field. - */ - public function unsetNone(): self - { - $this->instance->unsetNone(); - return $this; - } - - /** - * Initializes a new Filter Value object. - */ - public function build(): FilterValue - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FloatNumberRangeBuilder.php b/src/Models/Builders/FloatNumberRangeBuilder.php deleted file mode 100644 index 0323af28..00000000 --- a/src/Models/Builders/FloatNumberRangeBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Float Number Range Builder object. - */ - public static function init(): self - { - return new self(new FloatNumberRange()); - } - - /** - * Sets start at field. - * - * @param string|null $value - */ - public function startAt(?string $value): self - { - $this->instance->setStartAt($value); - return $this; - } - - /** - * Unsets start at field. - */ - public function unsetStartAt(): self - { - $this->instance->unsetStartAt(); - return $this; - } - - /** - * Sets end at field. - * - * @param string|null $value - */ - public function endAt(?string $value): self - { - $this->instance->setEndAt($value); - return $this; - } - - /** - * Unsets end at field. - */ - public function unsetEndAt(): self - { - $this->instance->unsetEndAt(); - return $this; - } - - /** - * Initializes a new Float Number Range object. - */ - public function build(): FloatNumberRange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentBuilder.php b/src/Models/Builders/FulfillmentBuilder.php deleted file mode 100644 index 66434854..00000000 --- a/src/Models/Builders/FulfillmentBuilder.php +++ /dev/null @@ -1,163 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Builder object. - */ - public static function init(): self - { - return new self(new Fulfillment()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets line item application field. - * - * @param string|null $value - */ - public function lineItemApplication(?string $value): self - { - $this->instance->setLineItemApplication($value); - return $this; - } - - /** - * Sets entries field. - * - * @param FulfillmentFulfillmentEntry[]|null $value - */ - public function entries(?array $value): self - { - $this->instance->setEntries($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets pickup details field. - * - * @param FulfillmentPickupDetails|null $value - */ - public function pickupDetails(?FulfillmentPickupDetails $value): self - { - $this->instance->setPickupDetails($value); - return $this; - } - - /** - * Sets shipment details field. - * - * @param FulfillmentShipmentDetails|null $value - */ - public function shipmentDetails(?FulfillmentShipmentDetails $value): self - { - $this->instance->setShipmentDetails($value); - return $this; - } - - /** - * Sets delivery details field. - * - * @param FulfillmentDeliveryDetails|null $value - */ - public function deliveryDetails(?FulfillmentDeliveryDetails $value): self - { - $this->instance->setDeliveryDetails($value); - return $this; - } - - /** - * Initializes a new Fulfillment object. - */ - public function build(): Fulfillment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentDeliveryDetailsBuilder.php b/src/Models/Builders/FulfillmentDeliveryDetailsBuilder.php deleted file mode 100644 index 7ff25302..00000000 --- a/src/Models/Builders/FulfillmentDeliveryDetailsBuilder.php +++ /dev/null @@ -1,431 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Delivery Details Builder object. - */ - public static function init(): self - { - return new self(new FulfillmentDeliveryDetails()); - } - - /** - * Sets recipient field. - * - * @param FulfillmentRecipient|null $value - */ - public function recipient(?FulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets schedule type field. - * - * @param string|null $value - */ - public function scheduleType(?string $value): self - { - $this->instance->setScheduleType($value); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets deliver at field. - * - * @param string|null $value - */ - public function deliverAt(?string $value): self - { - $this->instance->setDeliverAt($value); - return $this; - } - - /** - * Unsets deliver at field. - */ - public function unsetDeliverAt(): self - { - $this->instance->unsetDeliverAt(); - return $this; - } - - /** - * Sets prep time duration field. - * - * @param string|null $value - */ - public function prepTimeDuration(?string $value): self - { - $this->instance->setPrepTimeDuration($value); - return $this; - } - - /** - * Unsets prep time duration field. - */ - public function unsetPrepTimeDuration(): self - { - $this->instance->unsetPrepTimeDuration(); - return $this; - } - - /** - * Sets delivery window duration field. - * - * @param string|null $value - */ - public function deliveryWindowDuration(?string $value): self - { - $this->instance->setDeliveryWindowDuration($value); - return $this; - } - - /** - * Unsets delivery window duration field. - */ - public function unsetDeliveryWindowDuration(): self - { - $this->instance->unsetDeliveryWindowDuration(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets completed at field. - * - * @param string|null $value - */ - public function completedAt(?string $value): self - { - $this->instance->setCompletedAt($value); - return $this; - } - - /** - * Unsets completed at field. - */ - public function unsetCompletedAt(): self - { - $this->instance->unsetCompletedAt(); - return $this; - } - - /** - * Sets in progress at field. - * - * @param string|null $value - */ - public function inProgressAt(?string $value): self - { - $this->instance->setInProgressAt($value); - return $this; - } - - /** - * Sets rejected at field. - * - * @param string|null $value - */ - public function rejectedAt(?string $value): self - { - $this->instance->setRejectedAt($value); - return $this; - } - - /** - * Sets ready at field. - * - * @param string|null $value - */ - public function readyAt(?string $value): self - { - $this->instance->setReadyAt($value); - return $this; - } - - /** - * Sets delivered at field. - * - * @param string|null $value - */ - public function deliveredAt(?string $value): self - { - $this->instance->setDeliveredAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets courier pickup at field. - * - * @param string|null $value - */ - public function courierPickupAt(?string $value): self - { - $this->instance->setCourierPickupAt($value); - return $this; - } - - /** - * Unsets courier pickup at field. - */ - public function unsetCourierPickupAt(): self - { - $this->instance->unsetCourierPickupAt(); - return $this; - } - - /** - * Sets courier pickup window duration field. - * - * @param string|null $value - */ - public function courierPickupWindowDuration(?string $value): self - { - $this->instance->setCourierPickupWindowDuration($value); - return $this; - } - - /** - * Unsets courier pickup window duration field. - */ - public function unsetCourierPickupWindowDuration(): self - { - $this->instance->unsetCourierPickupWindowDuration(); - return $this; - } - - /** - * Sets is no contact delivery field. - * - * @param bool|null $value - */ - public function isNoContactDelivery(?bool $value): self - { - $this->instance->setIsNoContactDelivery($value); - return $this; - } - - /** - * Unsets is no contact delivery field. - */ - public function unsetIsNoContactDelivery(): self - { - $this->instance->unsetIsNoContactDelivery(); - return $this; - } - - /** - * Sets dropoff notes field. - * - * @param string|null $value - */ - public function dropoffNotes(?string $value): self - { - $this->instance->setDropoffNotes($value); - return $this; - } - - /** - * Unsets dropoff notes field. - */ - public function unsetDropoffNotes(): self - { - $this->instance->unsetDropoffNotes(); - return $this; - } - - /** - * Sets courier provider name field. - * - * @param string|null $value - */ - public function courierProviderName(?string $value): self - { - $this->instance->setCourierProviderName($value); - return $this; - } - - /** - * Unsets courier provider name field. - */ - public function unsetCourierProviderName(): self - { - $this->instance->unsetCourierProviderName(); - return $this; - } - - /** - * Sets courier support phone number field. - * - * @param string|null $value - */ - public function courierSupportPhoneNumber(?string $value): self - { - $this->instance->setCourierSupportPhoneNumber($value); - return $this; - } - - /** - * Unsets courier support phone number field. - */ - public function unsetCourierSupportPhoneNumber(): self - { - $this->instance->unsetCourierSupportPhoneNumber(); - return $this; - } - - /** - * Sets square delivery id field. - * - * @param string|null $value - */ - public function squareDeliveryId(?string $value): self - { - $this->instance->setSquareDeliveryId($value); - return $this; - } - - /** - * Unsets square delivery id field. - */ - public function unsetSquareDeliveryId(): self - { - $this->instance->unsetSquareDeliveryId(); - return $this; - } - - /** - * Sets external delivery id field. - * - * @param string|null $value - */ - public function externalDeliveryId(?string $value): self - { - $this->instance->setExternalDeliveryId($value); - return $this; - } - - /** - * Unsets external delivery id field. - */ - public function unsetExternalDeliveryId(): self - { - $this->instance->unsetExternalDeliveryId(); - return $this; - } - - /** - * Sets managed delivery field. - * - * @param bool|null $value - */ - public function managedDelivery(?bool $value): self - { - $this->instance->setManagedDelivery($value); - return $this; - } - - /** - * Unsets managed delivery field. - */ - public function unsetManagedDelivery(): self - { - $this->instance->unsetManagedDelivery(); - return $this; - } - - /** - * Initializes a new Fulfillment Delivery Details object. - */ - public function build(): FulfillmentDeliveryDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentFulfillmentEntryBuilder.php b/src/Models/Builders/FulfillmentFulfillmentEntryBuilder.php deleted file mode 100644 index 741fe3a9..00000000 --- a/src/Models/Builders/FulfillmentFulfillmentEntryBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Fulfillment Entry Builder object. - * - * @param string $lineItemUid - * @param string $quantity - */ - public static function init(string $lineItemUid, string $quantity): self - { - return new self(new FulfillmentFulfillmentEntry($lineItemUid, $quantity)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Initializes a new Fulfillment Fulfillment Entry object. - */ - public function build(): FulfillmentFulfillmentEntry - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentPickupDetailsBuilder.php b/src/Models/Builders/FulfillmentPickupDetailsBuilder.php deleted file mode 100644 index 37e63d29..00000000 --- a/src/Models/Builders/FulfillmentPickupDetailsBuilder.php +++ /dev/null @@ -1,314 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Pickup Details Builder object. - */ - public static function init(): self - { - return new self(new FulfillmentPickupDetails()); - } - - /** - * Sets recipient field. - * - * @param FulfillmentRecipient|null $value - */ - public function recipient(?FulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Unsets expires at field. - */ - public function unsetExpiresAt(): self - { - $this->instance->unsetExpiresAt(); - return $this; - } - - /** - * Sets auto complete duration field. - * - * @param string|null $value - */ - public function autoCompleteDuration(?string $value): self - { - $this->instance->setAutoCompleteDuration($value); - return $this; - } - - /** - * Unsets auto complete duration field. - */ - public function unsetAutoCompleteDuration(): self - { - $this->instance->unsetAutoCompleteDuration(); - return $this; - } - - /** - * Sets schedule type field. - * - * @param string|null $value - */ - public function scheduleType(?string $value): self - { - $this->instance->setScheduleType($value); - return $this; - } - - /** - * Sets pickup at field. - * - * @param string|null $value - */ - public function pickupAt(?string $value): self - { - $this->instance->setPickupAt($value); - return $this; - } - - /** - * Unsets pickup at field. - */ - public function unsetPickupAt(): self - { - $this->instance->unsetPickupAt(); - return $this; - } - - /** - * Sets pickup window duration field. - * - * @param string|null $value - */ - public function pickupWindowDuration(?string $value): self - { - $this->instance->setPickupWindowDuration($value); - return $this; - } - - /** - * Unsets pickup window duration field. - */ - public function unsetPickupWindowDuration(): self - { - $this->instance->unsetPickupWindowDuration(); - return $this; - } - - /** - * Sets prep time duration field. - * - * @param string|null $value - */ - public function prepTimeDuration(?string $value): self - { - $this->instance->setPrepTimeDuration($value); - return $this; - } - - /** - * Unsets prep time duration field. - */ - public function unsetPrepTimeDuration(): self - { - $this->instance->unsetPrepTimeDuration(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets accepted at field. - * - * @param string|null $value - */ - public function acceptedAt(?string $value): self - { - $this->instance->setAcceptedAt($value); - return $this; - } - - /** - * Sets rejected at field. - * - * @param string|null $value - */ - public function rejectedAt(?string $value): self - { - $this->instance->setRejectedAt($value); - return $this; - } - - /** - * Sets ready at field. - * - * @param string|null $value - */ - public function readyAt(?string $value): self - { - $this->instance->setReadyAt($value); - return $this; - } - - /** - * Sets expired at field. - * - * @param string|null $value - */ - public function expiredAt(?string $value): self - { - $this->instance->setExpiredAt($value); - return $this; - } - - /** - * Sets picked up at field. - * - * @param string|null $value - */ - public function pickedUpAt(?string $value): self - { - $this->instance->setPickedUpAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets is curbside pickup field. - * - * @param bool|null $value - */ - public function isCurbsidePickup(?bool $value): self - { - $this->instance->setIsCurbsidePickup($value); - return $this; - } - - /** - * Unsets is curbside pickup field. - */ - public function unsetIsCurbsidePickup(): self - { - $this->instance->unsetIsCurbsidePickup(); - return $this; - } - - /** - * Sets curbside pickup details field. - * - * @param FulfillmentPickupDetailsCurbsidePickupDetails|null $value - */ - public function curbsidePickupDetails(?FulfillmentPickupDetailsCurbsidePickupDetails $value): self - { - $this->instance->setCurbsidePickupDetails($value); - return $this; - } - - /** - * Initializes a new Fulfillment Pickup Details object. - */ - public function build(): FulfillmentPickupDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php b/src/Models/Builders/FulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php deleted file mode 100644 index 483f160e..00000000 --- a/src/Models/Builders/FulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Pickup Details Curbside Pickup Details Builder object. - */ - public static function init(): self - { - return new self(new FulfillmentPickupDetailsCurbsidePickupDetails()); - } - - /** - * Sets curbside details field. - * - * @param string|null $value - */ - public function curbsideDetails(?string $value): self - { - $this->instance->setCurbsideDetails($value); - return $this; - } - - /** - * Unsets curbside details field. - */ - public function unsetCurbsideDetails(): self - { - $this->instance->unsetCurbsideDetails(); - return $this; - } - - /** - * Sets buyer arrived at field. - * - * @param string|null $value - */ - public function buyerArrivedAt(?string $value): self - { - $this->instance->setBuyerArrivedAt($value); - return $this; - } - - /** - * Unsets buyer arrived at field. - */ - public function unsetBuyerArrivedAt(): self - { - $this->instance->unsetBuyerArrivedAt(); - return $this; - } - - /** - * Initializes a new Fulfillment Pickup Details Curbside Pickup Details object. - */ - public function build(): FulfillmentPickupDetailsCurbsidePickupDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentRecipientBuilder.php b/src/Models/Builders/FulfillmentRecipientBuilder.php deleted file mode 100644 index a18a5d41..00000000 --- a/src/Models/Builders/FulfillmentRecipientBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Recipient Builder object. - */ - public static function init(): self - { - return new self(new FulfillmentRecipient()); - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets display name field. - * - * @param string|null $value - */ - public function displayName(?string $value): self - { - $this->instance->setDisplayName($value); - return $this; - } - - /** - * Unsets display name field. - */ - public function unsetDisplayName(): self - { - $this->instance->unsetDisplayName(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Initializes a new Fulfillment Recipient object. - */ - public function build(): FulfillmentRecipient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/FulfillmentShipmentDetailsBuilder.php b/src/Models/Builders/FulfillmentShipmentDetailsBuilder.php deleted file mode 100644 index 8b530877..00000000 --- a/src/Models/Builders/FulfillmentShipmentDetailsBuilder.php +++ /dev/null @@ -1,289 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Fulfillment Shipment Details Builder object. - */ - public static function init(): self - { - return new self(new FulfillmentShipmentDetails()); - } - - /** - * Sets recipient field. - * - * @param FulfillmentRecipient|null $value - */ - public function recipient(?FulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets carrier field. - * - * @param string|null $value - */ - public function carrier(?string $value): self - { - $this->instance->setCarrier($value); - return $this; - } - - /** - * Unsets carrier field. - */ - public function unsetCarrier(): self - { - $this->instance->unsetCarrier(); - return $this; - } - - /** - * Sets shipping note field. - * - * @param string|null $value - */ - public function shippingNote(?string $value): self - { - $this->instance->setShippingNote($value); - return $this; - } - - /** - * Unsets shipping note field. - */ - public function unsetShippingNote(): self - { - $this->instance->unsetShippingNote(); - return $this; - } - - /** - * Sets shipping type field. - * - * @param string|null $value - */ - public function shippingType(?string $value): self - { - $this->instance->setShippingType($value); - return $this; - } - - /** - * Unsets shipping type field. - */ - public function unsetShippingType(): self - { - $this->instance->unsetShippingType(); - return $this; - } - - /** - * Sets tracking number field. - * - * @param string|null $value - */ - public function trackingNumber(?string $value): self - { - $this->instance->setTrackingNumber($value); - return $this; - } - - /** - * Unsets tracking number field. - */ - public function unsetTrackingNumber(): self - { - $this->instance->unsetTrackingNumber(); - return $this; - } - - /** - * Sets tracking url field. - * - * @param string|null $value - */ - public function trackingUrl(?string $value): self - { - $this->instance->setTrackingUrl($value); - return $this; - } - - /** - * Unsets tracking url field. - */ - public function unsetTrackingUrl(): self - { - $this->instance->unsetTrackingUrl(); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets in progress at field. - * - * @param string|null $value - */ - public function inProgressAt(?string $value): self - { - $this->instance->setInProgressAt($value); - return $this; - } - - /** - * Sets packaged at field. - * - * @param string|null $value - */ - public function packagedAt(?string $value): self - { - $this->instance->setPackagedAt($value); - return $this; - } - - /** - * Sets expected shipped at field. - * - * @param string|null $value - */ - public function expectedShippedAt(?string $value): self - { - $this->instance->setExpectedShippedAt($value); - return $this; - } - - /** - * Unsets expected shipped at field. - */ - public function unsetExpectedShippedAt(): self - { - $this->instance->unsetExpectedShippedAt(); - return $this; - } - - /** - * Sets shipped at field. - * - * @param string|null $value - */ - public function shippedAt(?string $value): self - { - $this->instance->setShippedAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Unsets canceled at field. - */ - public function unsetCanceledAt(): self - { - $this->instance->unsetCanceledAt(); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets failed at field. - * - * @param string|null $value - */ - public function failedAt(?string $value): self - { - $this->instance->setFailedAt($value); - return $this; - } - - /** - * Sets failure reason field. - * - * @param string|null $value - */ - public function failureReason(?string $value): self - { - $this->instance->setFailureReason($value); - return $this; - } - - /** - * Unsets failure reason field. - */ - public function unsetFailureReason(): self - { - $this->instance->unsetFailureReason(); - return $this; - } - - /** - * Initializes a new Fulfillment Shipment Details object. - */ - public function build(): FulfillmentShipmentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetBankAccountByV1IdResponseBuilder.php b/src/Models/Builders/GetBankAccountByV1IdResponseBuilder.php deleted file mode 100644 index 29bc2c10..00000000 --- a/src/Models/Builders/GetBankAccountByV1IdResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Bank Account By V1 Id Response Builder object. - */ - public static function init(): self - { - return new self(new GetBankAccountByV1IdResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets bank account field. - * - * @param BankAccount|null $value - */ - public function bankAccount(?BankAccount $value): self - { - $this->instance->setBankAccount($value); - return $this; - } - - /** - * Initializes a new Get Bank Account By V1 Id Response object. - */ - public function build(): GetBankAccountByV1IdResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetBankAccountResponseBuilder.php b/src/Models/Builders/GetBankAccountResponseBuilder.php deleted file mode 100644 index 60f086c0..00000000 --- a/src/Models/Builders/GetBankAccountResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Bank Account Response Builder object. - */ - public static function init(): self - { - return new self(new GetBankAccountResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets bank account field. - * - * @param BankAccount|null $value - */ - public function bankAccount(?BankAccount $value): self - { - $this->instance->setBankAccount($value); - return $this; - } - - /** - * Initializes a new Get Bank Account Response object. - */ - public function build(): GetBankAccountResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetBreakTypeResponseBuilder.php b/src/Models/Builders/GetBreakTypeResponseBuilder.php deleted file mode 100644 index edd8b6f2..00000000 --- a/src/Models/Builders/GetBreakTypeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Break Type Response Builder object. - */ - public static function init(): self - { - return new self(new GetBreakTypeResponse()); - } - - /** - * Sets break type field. - * - * @param BreakType|null $value - */ - public function breakType(?BreakType $value): self - { - $this->instance->setBreakType($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Break Type Response object. - */ - public function build(): GetBreakTypeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetDeviceCodeResponseBuilder.php b/src/Models/Builders/GetDeviceCodeResponseBuilder.php deleted file mode 100644 index 62c60661..00000000 --- a/src/Models/Builders/GetDeviceCodeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Device Code Response Builder object. - */ - public static function init(): self - { - return new self(new GetDeviceCodeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets device code field. - * - * @param DeviceCode|null $value - */ - public function deviceCode(?DeviceCode $value): self - { - $this->instance->setDeviceCode($value); - return $this; - } - - /** - * Initializes a new Get Device Code Response object. - */ - public function build(): GetDeviceCodeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetDeviceResponseBuilder.php b/src/Models/Builders/GetDeviceResponseBuilder.php deleted file mode 100644 index 49c50552..00000000 --- a/src/Models/Builders/GetDeviceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Device Response Builder object. - */ - public static function init(): self - { - return new self(new GetDeviceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets device field. - * - * @param Device|null $value - */ - public function device(?Device $value): self - { - $this->instance->setDevice($value); - return $this; - } - - /** - * Initializes a new Get Device Response object. - */ - public function build(): GetDeviceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetEmployeeWageResponseBuilder.php b/src/Models/Builders/GetEmployeeWageResponseBuilder.php deleted file mode 100644 index dfae1376..00000000 --- a/src/Models/Builders/GetEmployeeWageResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Employee Wage Response Builder object. - */ - public static function init(): self - { - return new self(new GetEmployeeWageResponse()); - } - - /** - * Sets employee wage field. - * - * @param EmployeeWage|null $value - */ - public function employeeWage(?EmployeeWage $value): self - { - $this->instance->setEmployeeWage($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Employee Wage Response object. - */ - public function build(): GetEmployeeWageResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetInvoiceResponseBuilder.php b/src/Models/Builders/GetInvoiceResponseBuilder.php deleted file mode 100644 index 7e51f8b3..00000000 --- a/src/Models/Builders/GetInvoiceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new GetInvoiceResponse()); - } - - /** - * Sets invoice field. - * - * @param Invoice|null $value - */ - public function invoice(?Invoice $value): self - { - $this->instance->setInvoice($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Invoice Response object. - */ - public function build(): GetInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetPaymentRefundResponseBuilder.php b/src/Models/Builders/GetPaymentRefundResponseBuilder.php deleted file mode 100644 index 3259c886..00000000 --- a/src/Models/Builders/GetPaymentRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Payment Refund Response Builder object. - */ - public static function init(): self - { - return new self(new GetPaymentRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param PaymentRefund|null $value - */ - public function refund(?PaymentRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Get Payment Refund Response object. - */ - public function build(): GetPaymentRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetPaymentResponseBuilder.php b/src/Models/Builders/GetPaymentResponseBuilder.php deleted file mode 100644 index 601e7466..00000000 --- a/src/Models/Builders/GetPaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Payment Response Builder object. - */ - public static function init(): self - { - return new self(new GetPaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Get Payment Response object. - */ - public function build(): GetPaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetPayoutResponseBuilder.php b/src/Models/Builders/GetPayoutResponseBuilder.php deleted file mode 100644 index 7d2d1850..00000000 --- a/src/Models/Builders/GetPayoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Payout Response Builder object. - */ - public static function init(): self - { - return new self(new GetPayoutResponse()); - } - - /** - * Sets payout field. - * - * @param Payout|null $value - */ - public function payout(?Payout $value): self - { - $this->instance->setPayout($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Payout Response object. - */ - public function build(): GetPayoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetShiftResponseBuilder.php b/src/Models/Builders/GetShiftResponseBuilder.php deleted file mode 100644 index 870a5e87..00000000 --- a/src/Models/Builders/GetShiftResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Shift Response Builder object. - */ - public static function init(): self - { - return new self(new GetShiftResponse()); - } - - /** - * Sets shift field. - * - * @param Shift|null $value - */ - public function shift(?Shift $value): self - { - $this->instance->setShift($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Shift Response object. - */ - public function build(): GetShiftResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetTeamMemberWageResponseBuilder.php b/src/Models/Builders/GetTeamMemberWageResponseBuilder.php deleted file mode 100644 index 32776afd..00000000 --- a/src/Models/Builders/GetTeamMemberWageResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Team Member Wage Response Builder object. - */ - public static function init(): self - { - return new self(new GetTeamMemberWageResponse()); - } - - /** - * Sets team member wage field. - * - * @param TeamMemberWage|null $value - */ - public function teamMemberWage(?TeamMemberWage $value): self - { - $this->instance->setTeamMemberWage($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Get Team Member Wage Response object. - */ - public function build(): GetTeamMemberWageResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetTerminalActionResponseBuilder.php b/src/Models/Builders/GetTerminalActionResponseBuilder.php deleted file mode 100644 index 8a82289e..00000000 --- a/src/Models/Builders/GetTerminalActionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Terminal Action Response Builder object. - */ - public static function init(): self - { - return new self(new GetTerminalActionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets action field. - * - * @param TerminalAction|null $value - */ - public function action(?TerminalAction $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Initializes a new Get Terminal Action Response object. - */ - public function build(): GetTerminalActionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetTerminalCheckoutResponseBuilder.php b/src/Models/Builders/GetTerminalCheckoutResponseBuilder.php deleted file mode 100644 index b5beeef2..00000000 --- a/src/Models/Builders/GetTerminalCheckoutResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Terminal Checkout Response Builder object. - */ - public static function init(): self - { - return new self(new GetTerminalCheckoutResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets checkout field. - * - * @param TerminalCheckout|null $value - */ - public function checkout(?TerminalCheckout $value): self - { - $this->instance->setCheckout($value); - return $this; - } - - /** - * Initializes a new Get Terminal Checkout Response object. - */ - public function build(): GetTerminalCheckoutResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GetTerminalRefundResponseBuilder.php b/src/Models/Builders/GetTerminalRefundResponseBuilder.php deleted file mode 100644 index 3b36c45f..00000000 --- a/src/Models/Builders/GetTerminalRefundResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Get Terminal Refund Response Builder object. - */ - public static function init(): self - { - return new self(new GetTerminalRefundResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param TerminalRefund|null $value - */ - public function refund(?TerminalRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Get Terminal Refund Response object. - */ - public function build(): GetTerminalRefundResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityActivateBuilder.php b/src/Models/Builders/GiftCardActivityActivateBuilder.php deleted file mode 100644 index 3d21afcd..00000000 --- a/src/Models/Builders/GiftCardActivityActivateBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Activate Builder object. - */ - public static function init(): self - { - return new self(new GiftCardActivityActivate()); - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets line item uid field. - * - * @param string|null $value - */ - public function lineItemUid(?string $value): self - { - $this->instance->setLineItemUid($value); - return $this; - } - - /** - * Unsets line item uid field. - */ - public function unsetLineItemUid(): self - { - $this->instance->unsetLineItemUid(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets buyer payment instrument ids field. - * - * @param string[]|null $value - */ - public function buyerPaymentInstrumentIds(?array $value): self - { - $this->instance->setBuyerPaymentInstrumentIds($value); - return $this; - } - - /** - * Unsets buyer payment instrument ids field. - */ - public function unsetBuyerPaymentInstrumentIds(): self - { - $this->instance->unsetBuyerPaymentInstrumentIds(); - return $this; - } - - /** - * Initializes a new Gift Card Activity Activate object. - */ - public function build(): GiftCardActivityActivate - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityAdjustDecrementBuilder.php b/src/Models/Builders/GiftCardActivityAdjustDecrementBuilder.php deleted file mode 100644 index 0ea27d96..00000000 --- a/src/Models/Builders/GiftCardActivityAdjustDecrementBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Adjust Decrement Builder object. - * - * @param Money $amountMoney - * @param string $reason - */ - public static function init(Money $amountMoney, string $reason): self - { - return new self(new GiftCardActivityAdjustDecrement($amountMoney, $reason)); - } - - /** - * Initializes a new Gift Card Activity Adjust Decrement object. - */ - public function build(): GiftCardActivityAdjustDecrement - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityAdjustIncrementBuilder.php b/src/Models/Builders/GiftCardActivityAdjustIncrementBuilder.php deleted file mode 100644 index f7a57f57..00000000 --- a/src/Models/Builders/GiftCardActivityAdjustIncrementBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Adjust Increment Builder object. - * - * @param Money $amountMoney - * @param string $reason - */ - public static function init(Money $amountMoney, string $reason): self - { - return new self(new GiftCardActivityAdjustIncrement($amountMoney, $reason)); - } - - /** - * Initializes a new Gift Card Activity Adjust Increment object. - */ - public function build(): GiftCardActivityAdjustIncrement - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityBlockBuilder.php b/src/Models/Builders/GiftCardActivityBlockBuilder.php deleted file mode 100644 index 3c1a0640..00000000 --- a/src/Models/Builders/GiftCardActivityBlockBuilder.php +++ /dev/null @@ -1,42 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Block Builder object. - */ - public static function init(): self - { - return new self(new GiftCardActivityBlock()); - } - - /** - * Initializes a new Gift Card Activity Block object. - */ - public function build(): GiftCardActivityBlock - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityBuilder.php b/src/Models/Builders/GiftCardActivityBuilder.php deleted file mode 100644 index cfac3b84..00000000 --- a/src/Models/Builders/GiftCardActivityBuilder.php +++ /dev/null @@ -1,299 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Builder object. - * - * @param string $type - * @param string $locationId - */ - public static function init(string $type, string $locationId): self - { - return new self(new GiftCardActivity($type, $locationId)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets gift card id field. - * - * @param string|null $value - */ - public function giftCardId(?string $value): self - { - $this->instance->setGiftCardId($value); - return $this; - } - - /** - * Unsets gift card id field. - */ - public function unsetGiftCardId(): self - { - $this->instance->unsetGiftCardId(); - return $this; - } - - /** - * Sets gift card gan field. - * - * @param string|null $value - */ - public function giftCardGan(?string $value): self - { - $this->instance->setGiftCardGan($value); - return $this; - } - - /** - * Unsets gift card gan field. - */ - public function unsetGiftCardGan(): self - { - $this->instance->unsetGiftCardGan(); - return $this; - } - - /** - * Sets gift card balance money field. - * - * @param Money|null $value - */ - public function giftCardBalanceMoney(?Money $value): self - { - $this->instance->setGiftCardBalanceMoney($value); - return $this; - } - - /** - * Sets load activity details field. - * - * @param GiftCardActivityLoad|null $value - */ - public function loadActivityDetails(?GiftCardActivityLoad $value): self - { - $this->instance->setLoadActivityDetails($value); - return $this; - } - - /** - * Sets activate activity details field. - * - * @param GiftCardActivityActivate|null $value - */ - public function activateActivityDetails(?GiftCardActivityActivate $value): self - { - $this->instance->setActivateActivityDetails($value); - return $this; - } - - /** - * Sets redeem activity details field. - * - * @param GiftCardActivityRedeem|null $value - */ - public function redeemActivityDetails(?GiftCardActivityRedeem $value): self - { - $this->instance->setRedeemActivityDetails($value); - return $this; - } - - /** - * Sets clear balance activity details field. - * - * @param GiftCardActivityClearBalance|null $value - */ - public function clearBalanceActivityDetails(?GiftCardActivityClearBalance $value): self - { - $this->instance->setClearBalanceActivityDetails($value); - return $this; - } - - /** - * Sets deactivate activity details field. - * - * @param GiftCardActivityDeactivate|null $value - */ - public function deactivateActivityDetails(?GiftCardActivityDeactivate $value): self - { - $this->instance->setDeactivateActivityDetails($value); - return $this; - } - - /** - * Sets adjust increment activity details field. - * - * @param GiftCardActivityAdjustIncrement|null $value - */ - public function adjustIncrementActivityDetails(?GiftCardActivityAdjustIncrement $value): self - { - $this->instance->setAdjustIncrementActivityDetails($value); - return $this; - } - - /** - * Sets adjust decrement activity details field. - * - * @param GiftCardActivityAdjustDecrement|null $value - */ - public function adjustDecrementActivityDetails(?GiftCardActivityAdjustDecrement $value): self - { - $this->instance->setAdjustDecrementActivityDetails($value); - return $this; - } - - /** - * Sets refund activity details field. - * - * @param GiftCardActivityRefund|null $value - */ - public function refundActivityDetails(?GiftCardActivityRefund $value): self - { - $this->instance->setRefundActivityDetails($value); - return $this; - } - - /** - * Sets unlinked activity refund activity details field. - * - * @param GiftCardActivityUnlinkedActivityRefund|null $value - */ - public function unlinkedActivityRefundActivityDetails(?GiftCardActivityUnlinkedActivityRefund $value): self - { - $this->instance->setUnlinkedActivityRefundActivityDetails($value); - return $this; - } - - /** - * Sets import activity details field. - * - * @param GiftCardActivityImport|null $value - */ - public function importActivityDetails(?GiftCardActivityImport $value): self - { - $this->instance->setImportActivityDetails($value); - return $this; - } - - /** - * Sets block activity details field. - * - * @param GiftCardActivityBlock|null $value - */ - public function blockActivityDetails(?GiftCardActivityBlock $value): self - { - $this->instance->setBlockActivityDetails($value); - return $this; - } - - /** - * Sets unblock activity details field. - * - * @param GiftCardActivityUnblock|null $value - */ - public function unblockActivityDetails(?GiftCardActivityUnblock $value): self - { - $this->instance->setUnblockActivityDetails($value); - return $this; - } - - /** - * Sets import reversal activity details field. - * - * @param GiftCardActivityImportReversal|null $value - */ - public function importReversalActivityDetails(?GiftCardActivityImportReversal $value): self - { - $this->instance->setImportReversalActivityDetails($value); - return $this; - } - - /** - * Sets transfer balance to activity details field. - * - * @param GiftCardActivityTransferBalanceTo|null $value - */ - public function transferBalanceToActivityDetails(?GiftCardActivityTransferBalanceTo $value): self - { - $this->instance->setTransferBalanceToActivityDetails($value); - return $this; - } - - /** - * Sets transfer balance from activity details field. - * - * @param GiftCardActivityTransferBalanceFrom|null $value - */ - public function transferBalanceFromActivityDetails(?GiftCardActivityTransferBalanceFrom $value): self - { - $this->instance->setTransferBalanceFromActivityDetails($value); - return $this; - } - - /** - * Initializes a new Gift Card Activity object. - */ - public function build(): GiftCardActivity - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityClearBalanceBuilder.php b/src/Models/Builders/GiftCardActivityClearBalanceBuilder.php deleted file mode 100644 index 1828b80f..00000000 --- a/src/Models/Builders/GiftCardActivityClearBalanceBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Clear Balance Builder object. - * - * @param string $reason - */ - public static function init(string $reason): self - { - return new self(new GiftCardActivityClearBalance($reason)); - } - - /** - * Initializes a new Gift Card Activity Clear Balance object. - */ - public function build(): GiftCardActivityClearBalance - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityDeactivateBuilder.php b/src/Models/Builders/GiftCardActivityDeactivateBuilder.php deleted file mode 100644 index 66cd53f0..00000000 --- a/src/Models/Builders/GiftCardActivityDeactivateBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Deactivate Builder object. - * - * @param string $reason - */ - public static function init(string $reason): self - { - return new self(new GiftCardActivityDeactivate($reason)); - } - - /** - * Initializes a new Gift Card Activity Deactivate object. - */ - public function build(): GiftCardActivityDeactivate - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityImportBuilder.php b/src/Models/Builders/GiftCardActivityImportBuilder.php deleted file mode 100644 index 0941e073..00000000 --- a/src/Models/Builders/GiftCardActivityImportBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Import Builder object. - * - * @param Money $amountMoney - */ - public static function init(Money $amountMoney): self - { - return new self(new GiftCardActivityImport($amountMoney)); - } - - /** - * Initializes a new Gift Card Activity Import object. - */ - public function build(): GiftCardActivityImport - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityImportReversalBuilder.php b/src/Models/Builders/GiftCardActivityImportReversalBuilder.php deleted file mode 100644 index 45b0e5fc..00000000 --- a/src/Models/Builders/GiftCardActivityImportReversalBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Import Reversal Builder object. - * - * @param Money $amountMoney - */ - public static function init(Money $amountMoney): self - { - return new self(new GiftCardActivityImportReversal($amountMoney)); - } - - /** - * Initializes a new Gift Card Activity Import Reversal object. - */ - public function build(): GiftCardActivityImportReversal - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityLoadBuilder.php b/src/Models/Builders/GiftCardActivityLoadBuilder.php deleted file mode 100644 index 227aa9a2..00000000 --- a/src/Models/Builders/GiftCardActivityLoadBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Load Builder object. - */ - public static function init(): self - { - return new self(new GiftCardActivityLoad()); - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets line item uid field. - * - * @param string|null $value - */ - public function lineItemUid(?string $value): self - { - $this->instance->setLineItemUid($value); - return $this; - } - - /** - * Unsets line item uid field. - */ - public function unsetLineItemUid(): self - { - $this->instance->unsetLineItemUid(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets buyer payment instrument ids field. - * - * @param string[]|null $value - */ - public function buyerPaymentInstrumentIds(?array $value): self - { - $this->instance->setBuyerPaymentInstrumentIds($value); - return $this; - } - - /** - * Unsets buyer payment instrument ids field. - */ - public function unsetBuyerPaymentInstrumentIds(): self - { - $this->instance->unsetBuyerPaymentInstrumentIds(); - return $this; - } - - /** - * Initializes a new Gift Card Activity Load object. - */ - public function build(): GiftCardActivityLoad - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityRedeemBuilder.php b/src/Models/Builders/GiftCardActivityRedeemBuilder.php deleted file mode 100644 index c92657ec..00000000 --- a/src/Models/Builders/GiftCardActivityRedeemBuilder.php +++ /dev/null @@ -1,87 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Redeem Builder object. - * - * @param Money $amountMoney - */ - public static function init(Money $amountMoney): self - { - return new self(new GiftCardActivityRedeem($amountMoney)); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Gift Card Activity Redeem object. - */ - public function build(): GiftCardActivityRedeem - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityRefundBuilder.php b/src/Models/Builders/GiftCardActivityRefundBuilder.php deleted file mode 100644 index 616bd56c..00000000 --- a/src/Models/Builders/GiftCardActivityRefundBuilder.php +++ /dev/null @@ -1,105 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Refund Builder object. - */ - public static function init(): self - { - return new self(new GiftCardActivityRefund()); - } - - /** - * Sets redeem activity id field. - * - * @param string|null $value - */ - public function redeemActivityId(?string $value): self - { - $this->instance->setRedeemActivityId($value); - return $this; - } - - /** - * Unsets redeem activity id field. - */ - public function unsetRedeemActivityId(): self - { - $this->instance->unsetRedeemActivityId(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Initializes a new Gift Card Activity Refund object. - */ - public function build(): GiftCardActivityRefund - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityTransferBalanceFromBuilder.php b/src/Models/Builders/GiftCardActivityTransferBalanceFromBuilder.php deleted file mode 100644 index a8cd72da..00000000 --- a/src/Models/Builders/GiftCardActivityTransferBalanceFromBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Transfer Balance From Builder object. - * - * @param string $transferToGiftCardId - * @param Money $amountMoney - */ - public static function init(string $transferToGiftCardId, Money $amountMoney): self - { - return new self(new GiftCardActivityTransferBalanceFrom($transferToGiftCardId, $amountMoney)); - } - - /** - * Initializes a new Gift Card Activity Transfer Balance From object. - */ - public function build(): GiftCardActivityTransferBalanceFrom - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityTransferBalanceToBuilder.php b/src/Models/Builders/GiftCardActivityTransferBalanceToBuilder.php deleted file mode 100644 index ee444666..00000000 --- a/src/Models/Builders/GiftCardActivityTransferBalanceToBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Transfer Balance To Builder object. - * - * @param string $transferFromGiftCardId - * @param Money $amountMoney - */ - public static function init(string $transferFromGiftCardId, Money $amountMoney): self - { - return new self(new GiftCardActivityTransferBalanceTo($transferFromGiftCardId, $amountMoney)); - } - - /** - * Initializes a new Gift Card Activity Transfer Balance To object. - */ - public function build(): GiftCardActivityTransferBalanceTo - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityUnblockBuilder.php b/src/Models/Builders/GiftCardActivityUnblockBuilder.php deleted file mode 100644 index f81c5a60..00000000 --- a/src/Models/Builders/GiftCardActivityUnblockBuilder.php +++ /dev/null @@ -1,42 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Unblock Builder object. - */ - public static function init(): self - { - return new self(new GiftCardActivityUnblock()); - } - - /** - * Initializes a new Gift Card Activity Unblock object. - */ - public function build(): GiftCardActivityUnblock - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardActivityUnlinkedActivityRefundBuilder.php b/src/Models/Builders/GiftCardActivityUnlinkedActivityRefundBuilder.php deleted file mode 100644 index 34a25f62..00000000 --- a/src/Models/Builders/GiftCardActivityUnlinkedActivityRefundBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Activity Unlinked Activity Refund Builder object. - * - * @param Money $amountMoney - */ - public static function init(Money $amountMoney): self - { - return new self(new GiftCardActivityUnlinkedActivityRefund($amountMoney)); - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Initializes a new Gift Card Activity Unlinked Activity Refund object. - */ - public function build(): GiftCardActivityUnlinkedActivityRefund - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/GiftCardBuilder.php b/src/Models/Builders/GiftCardBuilder.php deleted file mode 100644 index a3b3c3ae..00000000 --- a/src/Models/Builders/GiftCardBuilder.php +++ /dev/null @@ -1,131 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Gift Card Builder object. - * - * @param string $type - */ - public static function init(string $type): self - { - return new self(new GiftCard($type)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets gan source field. - * - * @param string|null $value - */ - public function ganSource(?string $value): self - { - $this->instance->setGanSource($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets balance money field. - * - * @param Money|null $value - */ - public function balanceMoney(?Money $value): self - { - $this->instance->setBalanceMoney($value); - return $this; - } - - /** - * Sets gan field. - * - * @param string|null $value - */ - public function gan(?string $value): self - { - $this->instance->setGan($value); - return $this; - } - - /** - * Unsets gan field. - */ - public function unsetGan(): self - { - $this->instance->unsetGan(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets customer ids field. - * - * @param string[]|null $value - */ - public function customerIds(?array $value): self - { - $this->instance->setCustomerIds($value); - return $this; - } - - /** - * Initializes a new Gift Card object. - */ - public function build(): GiftCard - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryAdjustmentBuilder.php b/src/Models/Builders/InventoryAdjustmentBuilder.php deleted file mode 100644 index 80317d2f..00000000 --- a/src/Models/Builders/InventoryAdjustmentBuilder.php +++ /dev/null @@ -1,326 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Adjustment Builder object. - */ - public static function init(): self - { - return new self(new InventoryAdjustment()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets from state field. - * - * @param string|null $value - */ - public function fromState(?string $value): self - { - $this->instance->setFromState($value); - return $this; - } - - /** - * Sets to state field. - * - * @param string|null $value - */ - public function toState(?string $value): self - { - $this->instance->setToState($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog object type field. - * - * @param string|null $value - */ - public function catalogObjectType(?string $value): self - { - $this->instance->setCatalogObjectType($value); - return $this; - } - - /** - * Unsets catalog object type field. - */ - public function unsetCatalogObjectType(): self - { - $this->instance->unsetCatalogObjectType(); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets total price money field. - * - * @param Money|null $value - */ - public function totalPriceMoney(?Money $value): self - { - $this->instance->setTotalPriceMoney($value); - return $this; - } - - /** - * Sets occurred at field. - * - * @param string|null $value - */ - public function occurredAt(?string $value): self - { - $this->instance->setOccurredAt($value); - return $this; - } - - /** - * Unsets occurred at field. - */ - public function unsetOccurredAt(): self - { - $this->instance->unsetOccurredAt(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets source field. - * - * @param SourceApplication|null $value - */ - public function source(?SourceApplication $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets transaction id field. - * - * @param string|null $value - */ - public function transactionId(?string $value): self - { - $this->instance->setTransactionId($value); - return $this; - } - - /** - * Sets refund id field. - * - * @param string|null $value - */ - public function refundId(?string $value): self - { - $this->instance->setRefundId($value); - return $this; - } - - /** - * Sets purchase order id field. - * - * @param string|null $value - */ - public function purchaseOrderId(?string $value): self - { - $this->instance->setPurchaseOrderId($value); - return $this; - } - - /** - * Sets goods receipt id field. - * - * @param string|null $value - */ - public function goodsReceiptId(?string $value): self - { - $this->instance->setGoodsReceiptId($value); - return $this; - } - - /** - * Sets adjustment group field. - * - * @param InventoryAdjustmentGroup|null $value - */ - public function adjustmentGroup(?InventoryAdjustmentGroup $value): self - { - $this->instance->setAdjustmentGroup($value); - return $this; - } - - /** - * Initializes a new Inventory Adjustment object. - */ - public function build(): InventoryAdjustment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryAdjustmentGroupBuilder.php b/src/Models/Builders/InventoryAdjustmentGroupBuilder.php deleted file mode 100644 index cb2b6f88..00000000 --- a/src/Models/Builders/InventoryAdjustmentGroupBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Adjustment Group Builder object. - */ - public static function init(): self - { - return new self(new InventoryAdjustmentGroup()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets root adjustment id field. - * - * @param string|null $value - */ - public function rootAdjustmentId(?string $value): self - { - $this->instance->setRootAdjustmentId($value); - return $this; - } - - /** - * Sets from state field. - * - * @param string|null $value - */ - public function fromState(?string $value): self - { - $this->instance->setFromState($value); - return $this; - } - - /** - * Sets to state field. - * - * @param string|null $value - */ - public function toState(?string $value): self - { - $this->instance->setToState($value); - return $this; - } - - /** - * Initializes a new Inventory Adjustment Group object. - */ - public function build(): InventoryAdjustmentGroup - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryChangeBuilder.php b/src/Models/Builders/InventoryChangeBuilder.php deleted file mode 100644 index dbb09d8d..00000000 --- a/src/Models/Builders/InventoryChangeBuilder.php +++ /dev/null @@ -1,112 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Change Builder object. - */ - public static function init(): self - { - return new self(new InventoryChange()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets physical count field. - * - * @param InventoryPhysicalCount|null $value - */ - public function physicalCount(?InventoryPhysicalCount $value): self - { - $this->instance->setPhysicalCount($value); - return $this; - } - - /** - * Sets adjustment field. - * - * @param InventoryAdjustment|null $value - */ - public function adjustment(?InventoryAdjustment $value): self - { - $this->instance->setAdjustment($value); - return $this; - } - - /** - * Sets transfer field. - * - * @param InventoryTransfer|null $value - */ - public function transfer(?InventoryTransfer $value): self - { - $this->instance->setTransfer($value); - return $this; - } - - /** - * Sets measurement unit field. - * - * @param CatalogMeasurementUnit|null $value - */ - public function measurementUnit(?CatalogMeasurementUnit $value): self - { - $this->instance->setMeasurementUnit($value); - return $this; - } - - /** - * Sets measurement unit id field. - * - * @param string|null $value - */ - public function measurementUnitId(?string $value): self - { - $this->instance->setMeasurementUnitId($value); - return $this; - } - - /** - * Initializes a new Inventory Change object. - */ - public function build(): InventoryChange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryCountBuilder.php b/src/Models/Builders/InventoryCountBuilder.php deleted file mode 100644 index 187be207..00000000 --- a/src/Models/Builders/InventoryCountBuilder.php +++ /dev/null @@ -1,155 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Count Builder object. - */ - public static function init(): self - { - return new self(new InventoryCount()); - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog object type field. - * - * @param string|null $value - */ - public function catalogObjectType(?string $value): self - { - $this->instance->setCatalogObjectType($value); - return $this; - } - - /** - * Unsets catalog object type field. - */ - public function unsetCatalogObjectType(): self - { - $this->instance->unsetCatalogObjectType(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets calculated at field. - * - * @param string|null $value - */ - public function calculatedAt(?string $value): self - { - $this->instance->setCalculatedAt($value); - return $this; - } - - /** - * Sets is estimated field. - * - * @param bool|null $value - */ - public function isEstimated(?bool $value): self - { - $this->instance->setIsEstimated($value); - return $this; - } - - /** - * Initializes a new Inventory Count object. - */ - public function build(): InventoryCount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryPhysicalCountBuilder.php b/src/Models/Builders/InventoryPhysicalCountBuilder.php deleted file mode 100644 index fc6e33db..00000000 --- a/src/Models/Builders/InventoryPhysicalCountBuilder.php +++ /dev/null @@ -1,247 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Physical Count Builder object. - */ - public static function init(): self - { - return new self(new InventoryPhysicalCount()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog object type field. - * - * @param string|null $value - */ - public function catalogObjectType(?string $value): self - { - $this->instance->setCatalogObjectType($value); - return $this; - } - - /** - * Unsets catalog object type field. - */ - public function unsetCatalogObjectType(): self - { - $this->instance->unsetCatalogObjectType(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets source field. - * - * @param SourceApplication|null $value - */ - public function source(?SourceApplication $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets occurred at field. - * - * @param string|null $value - */ - public function occurredAt(?string $value): self - { - $this->instance->setOccurredAt($value); - return $this; - } - - /** - * Unsets occurred at field. - */ - public function unsetOccurredAt(): self - { - $this->instance->unsetOccurredAt(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Inventory Physical Count object. - */ - public function build(): InventoryPhysicalCount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InventoryTransferBuilder.php b/src/Models/Builders/InventoryTransferBuilder.php deleted file mode 100644 index 8bdb12a1..00000000 --- a/src/Models/Builders/InventoryTransferBuilder.php +++ /dev/null @@ -1,267 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Inventory Transfer Builder object. - */ - public static function init(): self - { - return new self(new InventoryTransfer()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets from location id field. - * - * @param string|null $value - */ - public function fromLocationId(?string $value): self - { - $this->instance->setFromLocationId($value); - return $this; - } - - /** - * Unsets from location id field. - */ - public function unsetFromLocationId(): self - { - $this->instance->unsetFromLocationId(); - return $this; - } - - /** - * Sets to location id field. - * - * @param string|null $value - */ - public function toLocationId(?string $value): self - { - $this->instance->setToLocationId($value); - return $this; - } - - /** - * Unsets to location id field. - */ - public function unsetToLocationId(): self - { - $this->instance->unsetToLocationId(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog object type field. - * - * @param string|null $value - */ - public function catalogObjectType(?string $value): self - { - $this->instance->setCatalogObjectType($value); - return $this; - } - - /** - * Unsets catalog object type field. - */ - public function unsetCatalogObjectType(): self - { - $this->instance->unsetCatalogObjectType(); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets occurred at field. - * - * @param string|null $value - */ - public function occurredAt(?string $value): self - { - $this->instance->setOccurredAt($value); - return $this; - } - - /** - * Unsets occurred at field. - */ - public function unsetOccurredAt(): self - { - $this->instance->unsetOccurredAt(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets source field. - * - * @param SourceApplication|null $value - */ - public function source(?SourceApplication $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Initializes a new Inventory Transfer object. - */ - public function build(): InventoryTransfer - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceAcceptedPaymentMethodsBuilder.php b/src/Models/Builders/InvoiceAcceptedPaymentMethodsBuilder.php deleted file mode 100644 index 6c273c37..00000000 --- a/src/Models/Builders/InvoiceAcceptedPaymentMethodsBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Accepted Payment Methods Builder object. - */ - public static function init(): self - { - return new self(new InvoiceAcceptedPaymentMethods()); - } - - /** - * Sets card field. - * - * @param bool|null $value - */ - public function card(?bool $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Unsets card field. - */ - public function unsetCard(): self - { - $this->instance->unsetCard(); - return $this; - } - - /** - * Sets square gift card field. - * - * @param bool|null $value - */ - public function squareGiftCard(?bool $value): self - { - $this->instance->setSquareGiftCard($value); - return $this; - } - - /** - * Unsets square gift card field. - */ - public function unsetSquareGiftCard(): self - { - $this->instance->unsetSquareGiftCard(); - return $this; - } - - /** - * Sets bank account field. - * - * @param bool|null $value - */ - public function bankAccount(?bool $value): self - { - $this->instance->setBankAccount($value); - return $this; - } - - /** - * Unsets bank account field. - */ - public function unsetBankAccount(): self - { - $this->instance->unsetBankAccount(); - return $this; - } - - /** - * Sets buy now pay later field. - * - * @param bool|null $value - */ - public function buyNowPayLater(?bool $value): self - { - $this->instance->setBuyNowPayLater($value); - return $this; - } - - /** - * Unsets buy now pay later field. - */ - public function unsetBuyNowPayLater(): self - { - $this->instance->unsetBuyNowPayLater(); - return $this; - } - - /** - * Sets cash app pay field. - * - * @param bool|null $value - */ - public function cashAppPay(?bool $value): self - { - $this->instance->setCashAppPay($value); - return $this; - } - - /** - * Unsets cash app pay field. - */ - public function unsetCashAppPay(): self - { - $this->instance->unsetCashAppPay(); - return $this; - } - - /** - * Initializes a new Invoice Accepted Payment Methods object. - */ - public function build(): InvoiceAcceptedPaymentMethods - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceAttachmentBuilder.php b/src/Models/Builders/InvoiceAttachmentBuilder.php deleted file mode 100644 index 4f1e6dce..00000000 --- a/src/Models/Builders/InvoiceAttachmentBuilder.php +++ /dev/null @@ -1,119 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Attachment Builder object. - */ - public static function init(): self - { - return new self(new InvoiceAttachment()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets filename field. - * - * @param string|null $value - */ - public function filename(?string $value): self - { - $this->instance->setFilename($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Sets filesize field. - * - * @param int|null $value - */ - public function filesize(?int $value): self - { - $this->instance->setFilesize($value); - return $this; - } - - /** - * Sets hash field. - * - * @param string|null $value - */ - public function hash(?string $value): self - { - $this->instance->setHash($value); - return $this; - } - - /** - * Sets mime type field. - * - * @param string|null $value - */ - public function mimeType(?string $value): self - { - $this->instance->setMimeType($value); - return $this; - } - - /** - * Sets uploaded at field. - * - * @param string|null $value - */ - public function uploadedAt(?string $value): self - { - $this->instance->setUploadedAt($value); - return $this; - } - - /** - * Initializes a new Invoice Attachment object. - */ - public function build(): InvoiceAttachment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceBuilder.php b/src/Models/Builders/InvoiceBuilder.php deleted file mode 100644 index ea7f2541..00000000 --- a/src/Models/Builders/InvoiceBuilder.php +++ /dev/null @@ -1,411 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Builder object. - */ - public static function init(): self - { - return new self(new Invoice()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets primary recipient field. - * - * @param InvoiceRecipient|null $value - */ - public function primaryRecipient(?InvoiceRecipient $value): self - { - $this->instance->setPrimaryRecipient($value); - return $this; - } - - /** - * Sets payment requests field. - * - * @param InvoicePaymentRequest[]|null $value - */ - public function paymentRequests(?array $value): self - { - $this->instance->setPaymentRequests($value); - return $this; - } - - /** - * Unsets payment requests field. - */ - public function unsetPaymentRequests(): self - { - $this->instance->unsetPaymentRequests(); - return $this; - } - - /** - * Sets delivery method field. - * - * @param string|null $value - */ - public function deliveryMethod(?string $value): self - { - $this->instance->setDeliveryMethod($value); - return $this; - } - - /** - * Sets invoice number field. - * - * @param string|null $value - */ - public function invoiceNumber(?string $value): self - { - $this->instance->setInvoiceNumber($value); - return $this; - } - - /** - * Unsets invoice number field. - */ - public function unsetInvoiceNumber(): self - { - $this->instance->unsetInvoiceNumber(); - return $this; - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets scheduled at field. - * - * @param string|null $value - */ - public function scheduledAt(?string $value): self - { - $this->instance->setScheduledAt($value); - return $this; - } - - /** - * Unsets scheduled at field. - */ - public function unsetScheduledAt(): self - { - $this->instance->unsetScheduledAt(); - return $this; - } - - /** - * Sets public url field. - * - * @param string|null $value - */ - public function publicUrl(?string $value): self - { - $this->instance->setPublicUrl($value); - return $this; - } - - /** - * Sets next payment amount money field. - * - * @param Money|null $value - */ - public function nextPaymentAmountMoney(?Money $value): self - { - $this->instance->setNextPaymentAmountMoney($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets timezone field. - * - * @param string|null $value - */ - public function timezone(?string $value): self - { - $this->instance->setTimezone($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets accepted payment methods field. - * - * @param InvoiceAcceptedPaymentMethods|null $value - */ - public function acceptedPaymentMethods(?InvoiceAcceptedPaymentMethods $value): self - { - $this->instance->setAcceptedPaymentMethods($value); - return $this; - } - - /** - * Sets custom fields field. - * - * @param InvoiceCustomField[]|null $value - */ - public function customFields(?array $value): self - { - $this->instance->setCustomFields($value); - return $this; - } - - /** - * Unsets custom fields field. - */ - public function unsetCustomFields(): self - { - $this->instance->unsetCustomFields(); - return $this; - } - - /** - * Sets subscription id field. - * - * @param string|null $value - */ - public function subscriptionId(?string $value): self - { - $this->instance->setSubscriptionId($value); - return $this; - } - - /** - * Sets sale or service date field. - * - * @param string|null $value - */ - public function saleOrServiceDate(?string $value): self - { - $this->instance->setSaleOrServiceDate($value); - return $this; - } - - /** - * Unsets sale or service date field. - */ - public function unsetSaleOrServiceDate(): self - { - $this->instance->unsetSaleOrServiceDate(); - return $this; - } - - /** - * Sets payment conditions field. - * - * @param string|null $value - */ - public function paymentConditions(?string $value): self - { - $this->instance->setPaymentConditions($value); - return $this; - } - - /** - * Unsets payment conditions field. - */ - public function unsetPaymentConditions(): self - { - $this->instance->unsetPaymentConditions(); - return $this; - } - - /** - * Sets store payment method enabled field. - * - * @param bool|null $value - */ - public function storePaymentMethodEnabled(?bool $value): self - { - $this->instance->setStorePaymentMethodEnabled($value); - return $this; - } - - /** - * Unsets store payment method enabled field. - */ - public function unsetStorePaymentMethodEnabled(): self - { - $this->instance->unsetStorePaymentMethodEnabled(); - return $this; - } - - /** - * Sets attachments field. - * - * @param InvoiceAttachment[]|null $value - */ - public function attachments(?array $value): self - { - $this->instance->setAttachments($value); - return $this; - } - - /** - * Initializes a new Invoice object. - */ - public function build(): Invoice - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceCustomFieldBuilder.php b/src/Models/Builders/InvoiceCustomFieldBuilder.php deleted file mode 100644 index 02a7c04a..00000000 --- a/src/Models/Builders/InvoiceCustomFieldBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Custom Field Builder object. - */ - public static function init(): self - { - return new self(new InvoiceCustomField()); - } - - /** - * Sets label field. - * - * @param string|null $value - */ - public function label(?string $value): self - { - $this->instance->setLabel($value); - return $this; - } - - /** - * Unsets label field. - */ - public function unsetLabel(): self - { - $this->instance->unsetLabel(); - return $this; - } - - /** - * Sets value field. - * - * @param string|null $value - */ - public function value(?string $value): self - { - $this->instance->setValue($value); - return $this; - } - - /** - * Unsets value field. - */ - public function unsetValue(): self - { - $this->instance->unsetValue(); - return $this; - } - - /** - * Sets placement field. - * - * @param string|null $value - */ - public function placement(?string $value): self - { - $this->instance->setPlacement($value); - return $this; - } - - /** - * Initializes a new Invoice Custom Field object. - */ - public function build(): InvoiceCustomField - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceFilterBuilder.php b/src/Models/Builders/InvoiceFilterBuilder.php deleted file mode 100644 index 3e75fc57..00000000 --- a/src/Models/Builders/InvoiceFilterBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Filter Builder object. - * - * @param string[] $locationIds - */ - public static function init(array $locationIds): self - { - return new self(new InvoiceFilter($locationIds)); - } - - /** - * Sets customer ids field. - * - * @param string[]|null $value - */ - public function customerIds(?array $value): self - { - $this->instance->setCustomerIds($value); - return $this; - } - - /** - * Unsets customer ids field. - */ - public function unsetCustomerIds(): self - { - $this->instance->unsetCustomerIds(); - return $this; - } - - /** - * Initializes a new Invoice Filter object. - */ - public function build(): InvoiceFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoicePaymentReminderBuilder.php b/src/Models/Builders/InvoicePaymentReminderBuilder.php deleted file mode 100644 index b5edce38..00000000 --- a/src/Models/Builders/InvoicePaymentReminderBuilder.php +++ /dev/null @@ -1,115 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Payment Reminder Builder object. - */ - public static function init(): self - { - return new self(new InvoicePaymentReminder()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Sets relative scheduled days field. - * - * @param int|null $value - */ - public function relativeScheduledDays(?int $value): self - { - $this->instance->setRelativeScheduledDays($value); - return $this; - } - - /** - * Unsets relative scheduled days field. - */ - public function unsetRelativeScheduledDays(): self - { - $this->instance->unsetRelativeScheduledDays(); - return $this; - } - - /** - * Sets message field. - * - * @param string|null $value - */ - public function message(?string $value): self - { - $this->instance->setMessage($value); - return $this; - } - - /** - * Unsets message field. - */ - public function unsetMessage(): self - { - $this->instance->unsetMessage(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets sent at field. - * - * @param string|null $value - */ - public function sentAt(?string $value): self - { - $this->instance->setSentAt($value); - return $this; - } - - /** - * Initializes a new Invoice Payment Reminder object. - */ - public function build(): InvoicePaymentReminder - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoicePaymentRequestBuilder.php b/src/Models/Builders/InvoicePaymentRequestBuilder.php deleted file mode 100644 index ac77c18f..00000000 --- a/src/Models/Builders/InvoicePaymentRequestBuilder.php +++ /dev/null @@ -1,241 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Payment Request Builder object. - */ - public static function init(): self - { - return new self(new InvoicePaymentRequest()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets request method field. - * - * @param string|null $value - */ - public function requestMethod(?string $value): self - { - $this->instance->setRequestMethod($value); - return $this; - } - - /** - * Sets request type field. - * - * @param string|null $value - */ - public function requestType(?string $value): self - { - $this->instance->setRequestType($value); - return $this; - } - - /** - * Sets due date field. - * - * @param string|null $value - */ - public function dueDate(?string $value): self - { - $this->instance->setDueDate($value); - return $this; - } - - /** - * Unsets due date field. - */ - public function unsetDueDate(): self - { - $this->instance->unsetDueDate(); - return $this; - } - - /** - * Sets fixed amount requested money field. - * - * @param Money|null $value - */ - public function fixedAmountRequestedMoney(?Money $value): self - { - $this->instance->setFixedAmountRequestedMoney($value); - return $this; - } - - /** - * Sets percentage requested field. - * - * @param string|null $value - */ - public function percentageRequested(?string $value): self - { - $this->instance->setPercentageRequested($value); - return $this; - } - - /** - * Unsets percentage requested field. - */ - public function unsetPercentageRequested(): self - { - $this->instance->unsetPercentageRequested(); - return $this; - } - - /** - * Sets tipping enabled field. - * - * @param bool|null $value - */ - public function tippingEnabled(?bool $value): self - { - $this->instance->setTippingEnabled($value); - return $this; - } - - /** - * Unsets tipping enabled field. - */ - public function unsetTippingEnabled(): self - { - $this->instance->unsetTippingEnabled(); - return $this; - } - - /** - * Sets automatic payment source field. - * - * @param string|null $value - */ - public function automaticPaymentSource(?string $value): self - { - $this->instance->setAutomaticPaymentSource($value); - return $this; - } - - /** - * Sets card id field. - * - * @param string|null $value - */ - public function cardId(?string $value): self - { - $this->instance->setCardId($value); - return $this; - } - - /** - * Unsets card id field. - */ - public function unsetCardId(): self - { - $this->instance->unsetCardId(); - return $this; - } - - /** - * Sets reminders field. - * - * @param InvoicePaymentReminder[]|null $value - */ - public function reminders(?array $value): self - { - $this->instance->setReminders($value); - return $this; - } - - /** - * Unsets reminders field. - */ - public function unsetReminders(): self - { - $this->instance->unsetReminders(); - return $this; - } - - /** - * Sets computed amount money field. - * - * @param Money|null $value - */ - public function computedAmountMoney(?Money $value): self - { - $this->instance->setComputedAmountMoney($value); - return $this; - } - - /** - * Sets total completed amount money field. - * - * @param Money|null $value - */ - public function totalCompletedAmountMoney(?Money $value): self - { - $this->instance->setTotalCompletedAmountMoney($value); - return $this; - } - - /** - * Sets rounding adjustment included money field. - * - * @param Money|null $value - */ - public function roundingAdjustmentIncludedMoney(?Money $value): self - { - $this->instance->setRoundingAdjustmentIncludedMoney($value); - return $this; - } - - /** - * Initializes a new Invoice Payment Request object. - */ - public function build(): InvoicePaymentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceQueryBuilder.php b/src/Models/Builders/InvoiceQueryBuilder.php deleted file mode 100644 index 0fa2ab49..00000000 --- a/src/Models/Builders/InvoiceQueryBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Query Builder object. - * - * @param InvoiceFilter $filter - */ - public static function init(InvoiceFilter $filter): self - { - return new self(new InvoiceQuery($filter)); - } - - /** - * Sets sort field. - * - * @param InvoiceSort|null $value - */ - public function sort(?InvoiceSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Invoice Query object. - */ - public function build(): InvoiceQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceRecipientBuilder.php b/src/Models/Builders/InvoiceRecipientBuilder.php deleted file mode 100644 index 75b847f9..00000000 --- a/src/Models/Builders/InvoiceRecipientBuilder.php +++ /dev/null @@ -1,141 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Recipient Builder object. - */ - public static function init(): self - { - return new self(new InvoiceRecipient()); - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Sets tax ids field. - * - * @param InvoiceRecipientTaxIds|null $value - */ - public function taxIds(?InvoiceRecipientTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Invoice Recipient object. - */ - public function build(): InvoiceRecipient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceRecipientTaxIdsBuilder.php b/src/Models/Builders/InvoiceRecipientTaxIdsBuilder.php deleted file mode 100644 index e54af3d9..00000000 --- a/src/Models/Builders/InvoiceRecipientTaxIdsBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Recipient Tax Ids Builder object. - */ - public static function init(): self - { - return new self(new InvoiceRecipientTaxIds()); - } - - /** - * Sets eu vat field. - * - * @param string|null $value - */ - public function euVat(?string $value): self - { - $this->instance->setEuVat($value); - return $this; - } - - /** - * Initializes a new Invoice Recipient Tax Ids object. - */ - public function build(): InvoiceRecipientTaxIds - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/InvoiceSortBuilder.php b/src/Models/Builders/InvoiceSortBuilder.php deleted file mode 100644 index 6cc13c42..00000000 --- a/src/Models/Builders/InvoiceSortBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Invoice Sort Builder object. - */ - public static function init(): self - { - return new self(new InvoiceSort()); - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Invoice Sort object. - */ - public function build(): InvoiceSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ItemVariationLocationOverridesBuilder.php b/src/Models/Builders/ItemVariationLocationOverridesBuilder.php deleted file mode 100644 index 9274d147..00000000 --- a/src/Models/Builders/ItemVariationLocationOverridesBuilder.php +++ /dev/null @@ -1,158 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Item Variation Location Overrides Builder object. - */ - public static function init(): self - { - return new self(new ItemVariationLocationOverrides()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets price money field. - * - * @param Money|null $value - */ - public function priceMoney(?Money $value): self - { - $this->instance->setPriceMoney($value); - return $this; - } - - /** - * Sets pricing type field. - * - * @param string|null $value - */ - public function pricingType(?string $value): self - { - $this->instance->setPricingType($value); - return $this; - } - - /** - * Sets track inventory field. - * - * @param bool|null $value - */ - public function trackInventory(?bool $value): self - { - $this->instance->setTrackInventory($value); - return $this; - } - - /** - * Unsets track inventory field. - */ - public function unsetTrackInventory(): self - { - $this->instance->unsetTrackInventory(); - return $this; - } - - /** - * Sets inventory alert type field. - * - * @param string|null $value - */ - public function inventoryAlertType(?string $value): self - { - $this->instance->setInventoryAlertType($value); - return $this; - } - - /** - * Sets inventory alert threshold field. - * - * @param int|null $value - */ - public function inventoryAlertThreshold(?int $value): self - { - $this->instance->setInventoryAlertThreshold($value); - return $this; - } - - /** - * Unsets inventory alert threshold field. - */ - public function unsetInventoryAlertThreshold(): self - { - $this->instance->unsetInventoryAlertThreshold(); - return $this; - } - - /** - * Sets sold out field. - * - * @param bool|null $value - */ - public function soldOut(?bool $value): self - { - $this->instance->setSoldOut($value); - return $this; - } - - /** - * Sets sold out valid until field. - * - * @param string|null $value - */ - public function soldOutValidUntil(?string $value): self - { - $this->instance->setSoldOutValidUntil($value); - return $this; - } - - /** - * Initializes a new Item Variation Location Overrides object. - */ - public function build(): ItemVariationLocationOverrides - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/JobAssignmentBuilder.php b/src/Models/Builders/JobAssignmentBuilder.php deleted file mode 100644 index 22ceccf9..00000000 --- a/src/Models/Builders/JobAssignmentBuilder.php +++ /dev/null @@ -1,127 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Job Assignment Builder object. - * - * @param string $payType - */ - public static function init(string $payType): self - { - return new self(new JobAssignment($payType)); - } - - /** - * Sets job title field. - * - * @param string|null $value - */ - public function jobTitle(?string $value): self - { - $this->instance->setJobTitle($value); - return $this; - } - - /** - * Unsets job title field. - */ - public function unsetJobTitle(): self - { - $this->instance->unsetJobTitle(); - return $this; - } - - /** - * Sets hourly rate field. - * - * @param Money|null $value - */ - public function hourlyRate(?Money $value): self - { - $this->instance->setHourlyRate($value); - return $this; - } - - /** - * Sets annual rate field. - * - * @param Money|null $value - */ - public function annualRate(?Money $value): self - { - $this->instance->setAnnualRate($value); - return $this; - } - - /** - * Sets weekly hours field. - * - * @param int|null $value - */ - public function weeklyHours(?int $value): self - { - $this->instance->setWeeklyHours($value); - return $this; - } - - /** - * Unsets weekly hours field. - */ - public function unsetWeeklyHours(): self - { - $this->instance->unsetWeeklyHours(); - return $this; - } - - /** - * Sets job id field. - * - * @param string|null $value - */ - public function jobId(?string $value): self - { - $this->instance->setJobId($value); - return $this; - } - - /** - * Unsets job id field. - */ - public function unsetJobId(): self - { - $this->instance->unsetJobId(); - return $this; - } - - /** - * Initializes a new Job Assignment object. - */ - public function build(): JobAssignment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/JobBuilder.php b/src/Models/Builders/JobBuilder.php deleted file mode 100644 index a6f53678..00000000 --- a/src/Models/Builders/JobBuilder.php +++ /dev/null @@ -1,126 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Job Builder object. - */ - public static function init(): self - { - return new self(new Job()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets is tip eligible field. - * - * @param bool|null $value - */ - public function isTipEligible(?bool $value): self - { - $this->instance->setIsTipEligible($value); - return $this; - } - - /** - * Unsets is tip eligible field. - */ - public function unsetIsTipEligible(): self - { - $this->instance->unsetIsTipEligible(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Job object. - */ - public function build(): Job - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LinkCustomerToGiftCardRequestBuilder.php b/src/Models/Builders/LinkCustomerToGiftCardRequestBuilder.php deleted file mode 100644 index 1b5335d9..00000000 --- a/src/Models/Builders/LinkCustomerToGiftCardRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Link Customer To Gift Card Request Builder object. - * - * @param string $customerId - */ - public static function init(string $customerId): self - { - return new self(new LinkCustomerToGiftCardRequest($customerId)); - } - - /** - * Initializes a new Link Customer To Gift Card Request object. - */ - public function build(): LinkCustomerToGiftCardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LinkCustomerToGiftCardResponseBuilder.php b/src/Models/Builders/LinkCustomerToGiftCardResponseBuilder.php deleted file mode 100644 index a8daba71..00000000 --- a/src/Models/Builders/LinkCustomerToGiftCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Link Customer To Gift Card Response Builder object. - */ - public static function init(): self - { - return new self(new LinkCustomerToGiftCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Link Customer To Gift Card Response object. - */ - public function build(): LinkCustomerToGiftCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBankAccountsRequestBuilder.php b/src/Models/Builders/ListBankAccountsRequestBuilder.php deleted file mode 100644 index 58db3cda..00000000 --- a/src/Models/Builders/ListBankAccountsRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Bank Accounts Request Builder object. - */ - public static function init(): self - { - return new self(new ListBankAccountsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new List Bank Accounts Request object. - */ - public function build(): ListBankAccountsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBankAccountsResponseBuilder.php b/src/Models/Builders/ListBankAccountsResponseBuilder.php deleted file mode 100644 index 8fc7d35b..00000000 --- a/src/Models/Builders/ListBankAccountsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Bank Accounts Response Builder object. - */ - public static function init(): self - { - return new self(new ListBankAccountsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets bank accounts field. - * - * @param BankAccount[]|null $value - */ - public function bankAccounts(?array $value): self - { - $this->instance->setBankAccounts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Bank Accounts Response object. - */ - public function build(): ListBankAccountsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingCustomAttributeDefinitionsRequestBuilder.php b/src/Models/Builders/ListBookingCustomAttributeDefinitionsRequestBuilder.php deleted file mode 100644 index 9c2183ba..00000000 --- a/src/Models/Builders/ListBookingCustomAttributeDefinitionsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Booking Custom Attribute Definitions Request Builder object. - */ - public static function init(): self - { - return new self(new ListBookingCustomAttributeDefinitionsRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Booking Custom Attribute Definitions Request object. - */ - public function build(): ListBookingCustomAttributeDefinitionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingCustomAttributeDefinitionsResponseBuilder.php b/src/Models/Builders/ListBookingCustomAttributeDefinitionsResponseBuilder.php deleted file mode 100644 index de6c5c1e..00000000 --- a/src/Models/Builders/ListBookingCustomAttributeDefinitionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Booking Custom Attribute Definitions Response Builder object. - */ - public static function init(): self - { - return new self(new ListBookingCustomAttributeDefinitionsResponse()); - } - - /** - * Sets custom attribute definitions field. - * - * @param CustomAttributeDefinition[]|null $value - */ - public function customAttributeDefinitions(?array $value): self - { - $this->instance->setCustomAttributeDefinitions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Booking Custom Attribute Definitions Response object. - */ - public function build(): ListBookingCustomAttributeDefinitionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingCustomAttributesRequestBuilder.php b/src/Models/Builders/ListBookingCustomAttributesRequestBuilder.php deleted file mode 100644 index 81fa20fd..00000000 --- a/src/Models/Builders/ListBookingCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Booking Custom Attributes Request Builder object. - */ - public static function init(): self - { - return new self(new ListBookingCustomAttributesRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets with definitions field. - * - * @param bool|null $value - */ - public function withDefinitions(?bool $value): self - { - $this->instance->setWithDefinitions($value); - return $this; - } - - /** - * Unsets with definitions field. - */ - public function unsetWithDefinitions(): self - { - $this->instance->unsetWithDefinitions(); - return $this; - } - - /** - * Initializes a new List Booking Custom Attributes Request object. - */ - public function build(): ListBookingCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingCustomAttributesResponseBuilder.php b/src/Models/Builders/ListBookingCustomAttributesResponseBuilder.php deleted file mode 100644 index 89ff5b5c..00000000 --- a/src/Models/Builders/ListBookingCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Booking Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new ListBookingCustomAttributesResponse()); - } - - /** - * Sets custom attributes field. - * - * @param CustomAttribute[]|null $value - */ - public function customAttributes(?array $value): self - { - $this->instance->setCustomAttributes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Booking Custom Attributes Response object. - */ - public function build(): ListBookingCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingsRequestBuilder.php b/src/Models/Builders/ListBookingsRequestBuilder.php deleted file mode 100644 index 4703d886..00000000 --- a/src/Models/Builders/ListBookingsRequestBuilder.php +++ /dev/null @@ -1,182 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Bookings Request Builder object. - */ - public static function init(): self - { - return new self(new ListBookingsRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets start at min field. - * - * @param string|null $value - */ - public function startAtMin(?string $value): self - { - $this->instance->setStartAtMin($value); - return $this; - } - - /** - * Unsets start at min field. - */ - public function unsetStartAtMin(): self - { - $this->instance->unsetStartAtMin(); - return $this; - } - - /** - * Sets start at max field. - * - * @param string|null $value - */ - public function startAtMax(?string $value): self - { - $this->instance->setStartAtMax($value); - return $this; - } - - /** - * Unsets start at max field. - */ - public function unsetStartAtMax(): self - { - $this->instance->unsetStartAtMax(); - return $this; - } - - /** - * Initializes a new List Bookings Request object. - */ - public function build(): ListBookingsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBookingsResponseBuilder.php b/src/Models/Builders/ListBookingsResponseBuilder.php deleted file mode 100644 index 6c90af5a..00000000 --- a/src/Models/Builders/ListBookingsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Bookings Response Builder object. - */ - public static function init(): self - { - return new self(new ListBookingsResponse()); - } - - /** - * Sets bookings field. - * - * @param Booking[]|null $value - */ - public function bookings(?array $value): self - { - $this->instance->setBookings($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Bookings Response object. - */ - public function build(): ListBookingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBreakTypesRequestBuilder.php b/src/Models/Builders/ListBreakTypesRequestBuilder.php deleted file mode 100644 index 4d1a1c75..00000000 --- a/src/Models/Builders/ListBreakTypesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Break Types Request Builder object. - */ - public static function init(): self - { - return new self(new ListBreakTypesRequest()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Break Types Request object. - */ - public function build(): ListBreakTypesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListBreakTypesResponseBuilder.php b/src/Models/Builders/ListBreakTypesResponseBuilder.php deleted file mode 100644 index 16802ac7..00000000 --- a/src/Models/Builders/ListBreakTypesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Break Types Response Builder object. - */ - public static function init(): self - { - return new self(new ListBreakTypesResponse()); - } - - /** - * Sets break types field. - * - * @param BreakType[]|null $value - */ - public function breakTypes(?array $value): self - { - $this->instance->setBreakTypes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Break Types Response object. - */ - public function build(): ListBreakTypesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCardsRequestBuilder.php b/src/Models/Builders/ListCardsRequestBuilder.php deleted file mode 100644 index b5893982..00000000 --- a/src/Models/Builders/ListCardsRequestBuilder.php +++ /dev/null @@ -1,133 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cards Request Builder object. - */ - public static function init(): self - { - return new self(new ListCardsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets include disabled field. - * - * @param bool|null $value - */ - public function includeDisabled(?bool $value): self - { - $this->instance->setIncludeDisabled($value); - return $this; - } - - /** - * Unsets include disabled field. - */ - public function unsetIncludeDisabled(): self - { - $this->instance->unsetIncludeDisabled(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Initializes a new List Cards Request object. - */ - public function build(): ListCardsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCardsResponseBuilder.php b/src/Models/Builders/ListCardsResponseBuilder.php deleted file mode 100644 index f37bc004..00000000 --- a/src/Models/Builders/ListCardsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cards Response Builder object. - */ - public static function init(): self - { - return new self(new ListCardsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cards field. - * - * @param Card[]|null $value - */ - public function cards(?array $value): self - { - $this->instance->setCards($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Cards Response object. - */ - public function build(): ListCardsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCashDrawerShiftEventsRequestBuilder.php b/src/Models/Builders/ListCashDrawerShiftEventsRequestBuilder.php deleted file mode 100644 index fae7eeb0..00000000 --- a/src/Models/Builders/ListCashDrawerShiftEventsRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cash Drawer Shift Events Request Builder object. - * - * @param string $locationId - */ - public static function init(string $locationId): self - { - return new self(new ListCashDrawerShiftEventsRequest($locationId)); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Cash Drawer Shift Events Request object. - */ - public function build(): ListCashDrawerShiftEventsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCashDrawerShiftEventsResponseBuilder.php b/src/Models/Builders/ListCashDrawerShiftEventsResponseBuilder.php deleted file mode 100644 index cde97a5b..00000000 --- a/src/Models/Builders/ListCashDrawerShiftEventsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cash Drawer Shift Events Response Builder object. - */ - public static function init(): self - { - return new self(new ListCashDrawerShiftEventsResponse()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cash drawer shift events field. - * - * @param CashDrawerShiftEvent[]|null $value - */ - public function cashDrawerShiftEvents(?array $value): self - { - $this->instance->setCashDrawerShiftEvents($value); - return $this; - } - - /** - * Initializes a new List Cash Drawer Shift Events Response object. - */ - public function build(): ListCashDrawerShiftEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCashDrawerShiftsRequestBuilder.php b/src/Models/Builders/ListCashDrawerShiftsRequestBuilder.php deleted file mode 100644 index 7f64fe9a..00000000 --- a/src/Models/Builders/ListCashDrawerShiftsRequestBuilder.php +++ /dev/null @@ -1,135 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cash Drawer Shifts Request Builder object. - * - * @param string $locationId - */ - public static function init(string $locationId): self - { - return new self(new ListCashDrawerShiftsRequest($locationId)); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Cash Drawer Shifts Request object. - */ - public function build(): ListCashDrawerShiftsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCashDrawerShiftsResponseBuilder.php b/src/Models/Builders/ListCashDrawerShiftsResponseBuilder.php deleted file mode 100644 index f878e397..00000000 --- a/src/Models/Builders/ListCashDrawerShiftsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Cash Drawer Shifts Response Builder object. - */ - public static function init(): self - { - return new self(new ListCashDrawerShiftsResponse()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cash drawer shifts field. - * - * @param CashDrawerShiftSummary[]|null $value - */ - public function cashDrawerShifts(?array $value): self - { - $this->instance->setCashDrawerShifts($value); - return $this; - } - - /** - * Initializes a new List Cash Drawer Shifts Response object. - */ - public function build(): ListCashDrawerShiftsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCatalogRequestBuilder.php b/src/Models/Builders/ListCatalogRequestBuilder.php deleted file mode 100644 index b92645dc..00000000 --- a/src/Models/Builders/ListCatalogRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Catalog Request Builder object. - */ - public static function init(): self - { - return new self(new ListCatalogRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets types field. - * - * @param string|null $value - */ - public function types(?string $value): self - { - $this->instance->setTypes($value); - return $this; - } - - /** - * Unsets types field. - */ - public function unsetTypes(): self - { - $this->instance->unsetTypes(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Initializes a new List Catalog Request object. - */ - public function build(): ListCatalogRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCatalogResponseBuilder.php b/src/Models/Builders/ListCatalogResponseBuilder.php deleted file mode 100644 index 2d5100b9..00000000 --- a/src/Models/Builders/ListCatalogResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Catalog Response Builder object. - */ - public static function init(): self - { - return new self(new ListCatalogResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets objects field. - * - * @param CatalogObject[]|null $value - */ - public function objects(?array $value): self - { - $this->instance->setObjects($value); - return $this; - } - - /** - * Initializes a new List Catalog Response object. - */ - public function build(): ListCatalogResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerCustomAttributeDefinitionsRequestBuilder.php b/src/Models/Builders/ListCustomerCustomAttributeDefinitionsRequestBuilder.php deleted file mode 100644 index b9e68fb6..00000000 --- a/src/Models/Builders/ListCustomerCustomAttributeDefinitionsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Custom Attribute Definitions Request Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerCustomAttributeDefinitionsRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Customer Custom Attribute Definitions Request object. - */ - public function build(): ListCustomerCustomAttributeDefinitionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerCustomAttributeDefinitionsResponseBuilder.php b/src/Models/Builders/ListCustomerCustomAttributeDefinitionsResponseBuilder.php deleted file mode 100644 index de890672..00000000 --- a/src/Models/Builders/ListCustomerCustomAttributeDefinitionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Custom Attribute Definitions Response Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerCustomAttributeDefinitionsResponse()); - } - - /** - * Sets custom attribute definitions field. - * - * @param CustomAttributeDefinition[]|null $value - */ - public function customAttributeDefinitions(?array $value): self - { - $this->instance->setCustomAttributeDefinitions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Customer Custom Attribute Definitions Response object. - */ - public function build(): ListCustomerCustomAttributeDefinitionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerCustomAttributesRequestBuilder.php b/src/Models/Builders/ListCustomerCustomAttributesRequestBuilder.php deleted file mode 100644 index bb6852e8..00000000 --- a/src/Models/Builders/ListCustomerCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Custom Attributes Request Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerCustomAttributesRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets with definitions field. - * - * @param bool|null $value - */ - public function withDefinitions(?bool $value): self - { - $this->instance->setWithDefinitions($value); - return $this; - } - - /** - * Unsets with definitions field. - */ - public function unsetWithDefinitions(): self - { - $this->instance->unsetWithDefinitions(); - return $this; - } - - /** - * Initializes a new List Customer Custom Attributes Request object. - */ - public function build(): ListCustomerCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerCustomAttributesResponseBuilder.php b/src/Models/Builders/ListCustomerCustomAttributesResponseBuilder.php deleted file mode 100644 index cc6b74d2..00000000 --- a/src/Models/Builders/ListCustomerCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerCustomAttributesResponse()); - } - - /** - * Sets custom attributes field. - * - * @param CustomAttribute[]|null $value - */ - public function customAttributes(?array $value): self - { - $this->instance->setCustomAttributes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Customer Custom Attributes Response object. - */ - public function build(): ListCustomerCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerGroupsRequestBuilder.php b/src/Models/Builders/ListCustomerGroupsRequestBuilder.php deleted file mode 100644 index 600ad245..00000000 --- a/src/Models/Builders/ListCustomerGroupsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Groups Request Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerGroupsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Customer Groups Request object. - */ - public function build(): ListCustomerGroupsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerGroupsResponseBuilder.php b/src/Models/Builders/ListCustomerGroupsResponseBuilder.php deleted file mode 100644 index 9685d724..00000000 --- a/src/Models/Builders/ListCustomerGroupsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Groups Response Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerGroupsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets groups field. - * - * @param CustomerGroup[]|null $value - */ - public function groups(?array $value): self - { - $this->instance->setGroups($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Customer Groups Response object. - */ - public function build(): ListCustomerGroupsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerSegmentsRequestBuilder.php b/src/Models/Builders/ListCustomerSegmentsRequestBuilder.php deleted file mode 100644 index a54b5034..00000000 --- a/src/Models/Builders/ListCustomerSegmentsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Segments Request Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerSegmentsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Customer Segments Request object. - */ - public function build(): ListCustomerSegmentsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomerSegmentsResponseBuilder.php b/src/Models/Builders/ListCustomerSegmentsResponseBuilder.php deleted file mode 100644 index f0469f41..00000000 --- a/src/Models/Builders/ListCustomerSegmentsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customer Segments Response Builder object. - */ - public static function init(): self - { - return new self(new ListCustomerSegmentsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets segments field. - * - * @param CustomerSegment[]|null $value - */ - public function segments(?array $value): self - { - $this->instance->setSegments($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Customer Segments Response object. - */ - public function build(): ListCustomerSegmentsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomersRequestBuilder.php b/src/Models/Builders/ListCustomersRequestBuilder.php deleted file mode 100644 index eccb7c58..00000000 --- a/src/Models/Builders/ListCustomersRequestBuilder.php +++ /dev/null @@ -1,124 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customers Request Builder object. - */ - public static function init(): self - { - return new self(new ListCustomersRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets sort field field. - * - * @param string|null $value - */ - public function sortField(?string $value): self - { - $this->instance->setSortField($value); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets count field. - * - * @param bool|null $value - */ - public function count(?bool $value): self - { - $this->instance->setCount($value); - return $this; - } - - /** - * Unsets count field. - */ - public function unsetCount(): self - { - $this->instance->unsetCount(); - return $this; - } - - /** - * Initializes a new List Customers Request object. - */ - public function build(): ListCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListCustomersResponseBuilder.php b/src/Models/Builders/ListCustomersResponseBuilder.php deleted file mode 100644 index 7019a3bd..00000000 --- a/src/Models/Builders/ListCustomersResponseBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Customers Response Builder object. - */ - public static function init(): self - { - return new self(new ListCustomersResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets customers field. - * - * @param Customer[]|null $value - */ - public function customers(?array $value): self - { - $this->instance->setCustomers($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets count field. - * - * @param int|null $value - */ - public function count(?int $value): self - { - $this->instance->setCount($value); - return $this; - } - - /** - * Initializes a new List Customers Response object. - */ - public function build(): ListCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDeviceCodesRequestBuilder.php b/src/Models/Builders/ListDeviceCodesRequestBuilder.php deleted file mode 100644 index bc1e38a7..00000000 --- a/src/Models/Builders/ListDeviceCodesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Device Codes Request Builder object. - */ - public static function init(): self - { - return new self(new ListDeviceCodesRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets product type field. - * - * @param string|null $value - */ - public function productType(?string $value): self - { - $this->instance->setProductType($value); - return $this; - } - - /** - * Sets status field. - * - * @param string[]|null $value - */ - public function status(?array $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Initializes a new List Device Codes Request object. - */ - public function build(): ListDeviceCodesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDeviceCodesResponseBuilder.php b/src/Models/Builders/ListDeviceCodesResponseBuilder.php deleted file mode 100644 index 77badb1c..00000000 --- a/src/Models/Builders/ListDeviceCodesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Device Codes Response Builder object. - */ - public static function init(): self - { - return new self(new ListDeviceCodesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets device codes field. - * - * @param DeviceCode[]|null $value - */ - public function deviceCodes(?array $value): self - { - $this->instance->setDeviceCodes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Device Codes Response object. - */ - public function build(): ListDeviceCodesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDevicesRequestBuilder.php b/src/Models/Builders/ListDevicesRequestBuilder.php deleted file mode 100644 index 269982bb..00000000 --- a/src/Models/Builders/ListDevicesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Devices Request Builder object. - */ - public static function init(): self - { - return new self(new ListDevicesRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new List Devices Request object. - */ - public function build(): ListDevicesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDevicesResponseBuilder.php b/src/Models/Builders/ListDevicesResponseBuilder.php deleted file mode 100644 index 210145bc..00000000 --- a/src/Models/Builders/ListDevicesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Devices Response Builder object. - */ - public static function init(): self - { - return new self(new ListDevicesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets devices field. - * - * @param Device[]|null $value - */ - public function devices(?array $value): self - { - $this->instance->setDevices($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Devices Response object. - */ - public function build(): ListDevicesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDisputeEvidenceRequestBuilder.php b/src/Models/Builders/ListDisputeEvidenceRequestBuilder.php deleted file mode 100644 index b32f08bf..00000000 --- a/src/Models/Builders/ListDisputeEvidenceRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Dispute Evidence Request Builder object. - */ - public static function init(): self - { - return new self(new ListDisputeEvidenceRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Dispute Evidence Request object. - */ - public function build(): ListDisputeEvidenceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDisputeEvidenceResponseBuilder.php b/src/Models/Builders/ListDisputeEvidenceResponseBuilder.php deleted file mode 100644 index dbb9a168..00000000 --- a/src/Models/Builders/ListDisputeEvidenceResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Dispute Evidence Response Builder object. - */ - public static function init(): self - { - return new self(new ListDisputeEvidenceResponse()); - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence[]|null $value - */ - public function evidence(?array $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Dispute Evidence Response object. - */ - public function build(): ListDisputeEvidenceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDisputesRequestBuilder.php b/src/Models/Builders/ListDisputesRequestBuilder.php deleted file mode 100644 index 71e69988..00000000 --- a/src/Models/Builders/ListDisputesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Disputes Request Builder object. - */ - public static function init(): self - { - return new self(new ListDisputesRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets states field. - * - * @param string[]|null $value - */ - public function states(?array $value): self - { - $this->instance->setStates($value); - return $this; - } - - /** - * Unsets states field. - */ - public function unsetStates(): self - { - $this->instance->unsetStates(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new List Disputes Request object. - */ - public function build(): ListDisputesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListDisputesResponseBuilder.php b/src/Models/Builders/ListDisputesResponseBuilder.php deleted file mode 100644 index 2b775bde..00000000 --- a/src/Models/Builders/ListDisputesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Disputes Response Builder object. - */ - public static function init(): self - { - return new self(new ListDisputesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets disputes field. - * - * @param Dispute[]|null $value - */ - public function disputes(?array $value): self - { - $this->instance->setDisputes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Disputes Response object. - */ - public function build(): ListDisputesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEmployeeWagesRequestBuilder.php b/src/Models/Builders/ListEmployeeWagesRequestBuilder.php deleted file mode 100644 index 2a38c01c..00000000 --- a/src/Models/Builders/ListEmployeeWagesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Employee Wages Request Builder object. - */ - public static function init(): self - { - return new self(new ListEmployeeWagesRequest()); - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Employee Wages Request object. - */ - public function build(): ListEmployeeWagesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEmployeeWagesResponseBuilder.php b/src/Models/Builders/ListEmployeeWagesResponseBuilder.php deleted file mode 100644 index bf3773be..00000000 --- a/src/Models/Builders/ListEmployeeWagesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Employee Wages Response Builder object. - */ - public static function init(): self - { - return new self(new ListEmployeeWagesResponse()); - } - - /** - * Sets employee wages field. - * - * @param EmployeeWage[]|null $value - */ - public function employeeWages(?array $value): self - { - $this->instance->setEmployeeWages($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Employee Wages Response object. - */ - public function build(): ListEmployeeWagesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEmployeesRequestBuilder.php b/src/Models/Builders/ListEmployeesRequestBuilder.php deleted file mode 100644 index 61f92931..00000000 --- a/src/Models/Builders/ListEmployeesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Employees Request Builder object. - */ - public static function init(): self - { - return new self(new ListEmployeesRequest()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Employees Request object. - */ - public function build(): ListEmployeesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEmployeesResponseBuilder.php b/src/Models/Builders/ListEmployeesResponseBuilder.php deleted file mode 100644 index 14e11bc4..00000000 --- a/src/Models/Builders/ListEmployeesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Employees Response Builder object. - */ - public static function init(): self - { - return new self(new ListEmployeesResponse()); - } - - /** - * Sets employees field. - * - * @param Employee[]|null $value - */ - public function employees(?array $value): self - { - $this->instance->setEmployees($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Employees Response object. - */ - public function build(): ListEmployeesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEventTypesRequestBuilder.php b/src/Models/Builders/ListEventTypesRequestBuilder.php deleted file mode 100644 index e5956f5e..00000000 --- a/src/Models/Builders/ListEventTypesRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Event Types Request Builder object. - */ - public static function init(): self - { - return new self(new ListEventTypesRequest()); - } - - /** - * Sets api version field. - * - * @param string|null $value - */ - public function apiVersion(?string $value): self - { - $this->instance->setApiVersion($value); - return $this; - } - - /** - * Unsets api version field. - */ - public function unsetApiVersion(): self - { - $this->instance->unsetApiVersion(); - return $this; - } - - /** - * Initializes a new List Event Types Request object. - */ - public function build(): ListEventTypesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListEventTypesResponseBuilder.php b/src/Models/Builders/ListEventTypesResponseBuilder.php deleted file mode 100644 index a301784c..00000000 --- a/src/Models/Builders/ListEventTypesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Event Types Response Builder object. - */ - public static function init(): self - { - return new self(new ListEventTypesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets event types field. - * - * @param string[]|null $value - */ - public function eventTypes(?array $value): self - { - $this->instance->setEventTypes($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param EventTypeMetadata[]|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Initializes a new List Event Types Response object. - */ - public function build(): ListEventTypesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListGiftCardActivitiesRequestBuilder.php b/src/Models/Builders/ListGiftCardActivitiesRequestBuilder.php deleted file mode 100644 index f65ce96a..00000000 --- a/src/Models/Builders/ListGiftCardActivitiesRequestBuilder.php +++ /dev/null @@ -1,202 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Gift Card Activities Request Builder object. - */ - public static function init(): self - { - return new self(new ListGiftCardActivitiesRequest()); - } - - /** - * Sets gift card id field. - * - * @param string|null $value - */ - public function giftCardId(?string $value): self - { - $this->instance->setGiftCardId($value); - return $this; - } - - /** - * Unsets gift card id field. - */ - public function unsetGiftCardId(): self - { - $this->instance->unsetGiftCardId(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Unsets type field. - */ - public function unsetType(): self - { - $this->instance->unsetType(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Unsets sort order field. - */ - public function unsetSortOrder(): self - { - $this->instance->unsetSortOrder(); - return $this; - } - - /** - * Initializes a new List Gift Card Activities Request object. - */ - public function build(): ListGiftCardActivitiesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListGiftCardActivitiesResponseBuilder.php b/src/Models/Builders/ListGiftCardActivitiesResponseBuilder.php deleted file mode 100644 index 3cbbf42b..00000000 --- a/src/Models/Builders/ListGiftCardActivitiesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Gift Card Activities Response Builder object. - */ - public static function init(): self - { - return new self(new ListGiftCardActivitiesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card activities field. - * - * @param GiftCardActivity[]|null $value - */ - public function giftCardActivities(?array $value): self - { - $this->instance->setGiftCardActivities($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Gift Card Activities Response object. - */ - public function build(): ListGiftCardActivitiesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListGiftCardsRequestBuilder.php b/src/Models/Builders/ListGiftCardsRequestBuilder.php deleted file mode 100644 index 3d9ab9be..00000000 --- a/src/Models/Builders/ListGiftCardsRequestBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Gift Cards Request Builder object. - */ - public static function init(): self - { - return new self(new ListGiftCardsRequest()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Unsets type field. - */ - public function unsetType(): self - { - $this->instance->unsetType(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Unsets state field. - */ - public function unsetState(): self - { - $this->instance->unsetState(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Initializes a new List Gift Cards Request object. - */ - public function build(): ListGiftCardsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListGiftCardsResponseBuilder.php b/src/Models/Builders/ListGiftCardsResponseBuilder.php deleted file mode 100644 index 6b5f6469..00000000 --- a/src/Models/Builders/ListGiftCardsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Gift Cards Response Builder object. - */ - public static function init(): self - { - return new self(new ListGiftCardsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift cards field. - * - * @param GiftCard[]|null $value - */ - public function giftCards(?array $value): self - { - $this->instance->setGiftCards($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Gift Cards Response object. - */ - public function build(): ListGiftCardsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListInvoicesRequestBuilder.php b/src/Models/Builders/ListInvoicesRequestBuilder.php deleted file mode 100644 index 9f4e4699..00000000 --- a/src/Models/Builders/ListInvoicesRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Invoices Request Builder object. - * - * @param string $locationId - */ - public static function init(string $locationId): self - { - return new self(new ListInvoicesRequest($locationId)); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Invoices Request object. - */ - public function build(): ListInvoicesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListInvoicesResponseBuilder.php b/src/Models/Builders/ListInvoicesResponseBuilder.php deleted file mode 100644 index 6972bd8e..00000000 --- a/src/Models/Builders/ListInvoicesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Invoices Response Builder object. - */ - public static function init(): self - { - return new self(new ListInvoicesResponse()); - } - - /** - * Sets invoices field. - * - * @param Invoice[]|null $value - */ - public function invoices(?array $value): self - { - $this->instance->setInvoices($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Invoices Response object. - */ - public function build(): ListInvoicesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListJobsRequestBuilder.php b/src/Models/Builders/ListJobsRequestBuilder.php deleted file mode 100644 index c86c7eed..00000000 --- a/src/Models/Builders/ListJobsRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Jobs Request Builder object. - */ - public static function init(): self - { - return new self(new ListJobsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Jobs Request object. - */ - public function build(): ListJobsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListJobsResponseBuilder.php b/src/Models/Builders/ListJobsResponseBuilder.php deleted file mode 100644 index 8dc6f909..00000000 --- a/src/Models/Builders/ListJobsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Jobs Response Builder object. - */ - public static function init(): self - { - return new self(new ListJobsResponse()); - } - - /** - * Sets jobs field. - * - * @param Job[]|null $value - */ - public function jobs(?array $value): self - { - $this->instance->setJobs($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Jobs Response object. - */ - public function build(): ListJobsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationBookingProfilesRequestBuilder.php b/src/Models/Builders/ListLocationBookingProfilesRequestBuilder.php deleted file mode 100644 index 53122586..00000000 --- a/src/Models/Builders/ListLocationBookingProfilesRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Booking Profiles Request Builder object. - */ - public static function init(): self - { - return new self(new ListLocationBookingProfilesRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Location Booking Profiles Request object. - */ - public function build(): ListLocationBookingProfilesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationBookingProfilesResponseBuilder.php b/src/Models/Builders/ListLocationBookingProfilesResponseBuilder.php deleted file mode 100644 index ba96a00f..00000000 --- a/src/Models/Builders/ListLocationBookingProfilesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Booking Profiles Response Builder object. - */ - public static function init(): self - { - return new self(new ListLocationBookingProfilesResponse()); - } - - /** - * Sets location booking profiles field. - * - * @param LocationBookingProfile[]|null $value - */ - public function locationBookingProfiles(?array $value): self - { - $this->instance->setLocationBookingProfiles($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Location Booking Profiles Response object. - */ - public function build(): ListLocationBookingProfilesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationCustomAttributeDefinitionsRequestBuilder.php b/src/Models/Builders/ListLocationCustomAttributeDefinitionsRequestBuilder.php deleted file mode 100644 index 03edd10b..00000000 --- a/src/Models/Builders/ListLocationCustomAttributeDefinitionsRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Custom Attribute Definitions Request Builder object. - */ - public static function init(): self - { - return new self(new ListLocationCustomAttributeDefinitionsRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Location Custom Attribute Definitions Request object. - */ - public function build(): ListLocationCustomAttributeDefinitionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationCustomAttributeDefinitionsResponseBuilder.php b/src/Models/Builders/ListLocationCustomAttributeDefinitionsResponseBuilder.php deleted file mode 100644 index e38e26ad..00000000 --- a/src/Models/Builders/ListLocationCustomAttributeDefinitionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Custom Attribute Definitions Response Builder object. - */ - public static function init(): self - { - return new self(new ListLocationCustomAttributeDefinitionsResponse()); - } - - /** - * Sets custom attribute definitions field. - * - * @param CustomAttributeDefinition[]|null $value - */ - public function customAttributeDefinitions(?array $value): self - { - $this->instance->setCustomAttributeDefinitions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Location Custom Attribute Definitions Response object. - */ - public function build(): ListLocationCustomAttributeDefinitionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationCustomAttributesRequestBuilder.php b/src/Models/Builders/ListLocationCustomAttributesRequestBuilder.php deleted file mode 100644 index e3de4a22..00000000 --- a/src/Models/Builders/ListLocationCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Custom Attributes Request Builder object. - */ - public static function init(): self - { - return new self(new ListLocationCustomAttributesRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets with definitions field. - * - * @param bool|null $value - */ - public function withDefinitions(?bool $value): self - { - $this->instance->setWithDefinitions($value); - return $this; - } - - /** - * Unsets with definitions field. - */ - public function unsetWithDefinitions(): self - { - $this->instance->unsetWithDefinitions(); - return $this; - } - - /** - * Initializes a new List Location Custom Attributes Request object. - */ - public function build(): ListLocationCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationCustomAttributesResponseBuilder.php b/src/Models/Builders/ListLocationCustomAttributesResponseBuilder.php deleted file mode 100644 index 9180110c..00000000 --- a/src/Models/Builders/ListLocationCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Location Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new ListLocationCustomAttributesResponse()); - } - - /** - * Sets custom attributes field. - * - * @param CustomAttribute[]|null $value - */ - public function customAttributes(?array $value): self - { - $this->instance->setCustomAttributes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Location Custom Attributes Response object. - */ - public function build(): ListLocationCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLocationsResponseBuilder.php b/src/Models/Builders/ListLocationsResponseBuilder.php deleted file mode 100644 index d1384574..00000000 --- a/src/Models/Builders/ListLocationsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Locations Response Builder object. - */ - public static function init(): self - { - return new self(new ListLocationsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets locations field. - * - * @param Location[]|null $value - */ - public function locations(?array $value): self - { - $this->instance->setLocations($value); - return $this; - } - - /** - * Initializes a new List Locations Response object. - */ - public function build(): ListLocationsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLoyaltyProgramsResponseBuilder.php b/src/Models/Builders/ListLoyaltyProgramsResponseBuilder.php deleted file mode 100644 index c0423272..00000000 --- a/src/Models/Builders/ListLoyaltyProgramsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Loyalty Programs Response Builder object. - */ - public static function init(): self - { - return new self(new ListLoyaltyProgramsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets programs field. - * - * @param LoyaltyProgram[]|null $value - */ - public function programs(?array $value): self - { - $this->instance->setPrograms($value); - return $this; - } - - /** - * Initializes a new List Loyalty Programs Response object. - */ - public function build(): ListLoyaltyProgramsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLoyaltyPromotionsRequestBuilder.php b/src/Models/Builders/ListLoyaltyPromotionsRequestBuilder.php deleted file mode 100644 index 0ca13e79..00000000 --- a/src/Models/Builders/ListLoyaltyPromotionsRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Loyalty Promotions Request Builder object. - */ - public static function init(): self - { - return new self(new ListLoyaltyPromotionsRequest()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Loyalty Promotions Request object. - */ - public function build(): ListLoyaltyPromotionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListLoyaltyPromotionsResponseBuilder.php b/src/Models/Builders/ListLoyaltyPromotionsResponseBuilder.php deleted file mode 100644 index 3b00bd56..00000000 --- a/src/Models/Builders/ListLoyaltyPromotionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Loyalty Promotions Response Builder object. - */ - public static function init(): self - { - return new self(new ListLoyaltyPromotionsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty promotions field. - * - * @param LoyaltyPromotion[]|null $value - */ - public function loyaltyPromotions(?array $value): self - { - $this->instance->setLoyaltyPromotions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Loyalty Promotions Response object. - */ - public function build(): ListLoyaltyPromotionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantCustomAttributeDefinitionsRequestBuilder.php b/src/Models/Builders/ListMerchantCustomAttributeDefinitionsRequestBuilder.php deleted file mode 100644 index 1f1d940f..00000000 --- a/src/Models/Builders/ListMerchantCustomAttributeDefinitionsRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchant Custom Attribute Definitions Request Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantCustomAttributeDefinitionsRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Merchant Custom Attribute Definitions Request object. - */ - public function build(): ListMerchantCustomAttributeDefinitionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantCustomAttributeDefinitionsResponseBuilder.php b/src/Models/Builders/ListMerchantCustomAttributeDefinitionsResponseBuilder.php deleted file mode 100644 index 47bccb74..00000000 --- a/src/Models/Builders/ListMerchantCustomAttributeDefinitionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchant Custom Attribute Definitions Response Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantCustomAttributeDefinitionsResponse()); - } - - /** - * Sets custom attribute definitions field. - * - * @param CustomAttributeDefinition[]|null $value - */ - public function customAttributeDefinitions(?array $value): self - { - $this->instance->setCustomAttributeDefinitions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Merchant Custom Attribute Definitions Response object. - */ - public function build(): ListMerchantCustomAttributeDefinitionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantCustomAttributesRequestBuilder.php b/src/Models/Builders/ListMerchantCustomAttributesRequestBuilder.php deleted file mode 100644 index 00c9f8e8..00000000 --- a/src/Models/Builders/ListMerchantCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchant Custom Attributes Request Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantCustomAttributesRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets with definitions field. - * - * @param bool|null $value - */ - public function withDefinitions(?bool $value): self - { - $this->instance->setWithDefinitions($value); - return $this; - } - - /** - * Unsets with definitions field. - */ - public function unsetWithDefinitions(): self - { - $this->instance->unsetWithDefinitions(); - return $this; - } - - /** - * Initializes a new List Merchant Custom Attributes Request object. - */ - public function build(): ListMerchantCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantCustomAttributesResponseBuilder.php b/src/Models/Builders/ListMerchantCustomAttributesResponseBuilder.php deleted file mode 100644 index 4cdd048f..00000000 --- a/src/Models/Builders/ListMerchantCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchant Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantCustomAttributesResponse()); - } - - /** - * Sets custom attributes field. - * - * @param CustomAttribute[]|null $value - */ - public function customAttributes(?array $value): self - { - $this->instance->setCustomAttributes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Merchant Custom Attributes Response object. - */ - public function build(): ListMerchantCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantsRequestBuilder.php b/src/Models/Builders/ListMerchantsRequestBuilder.php deleted file mode 100644 index 3ca9f84d..00000000 --- a/src/Models/Builders/ListMerchantsRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchants Request Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantsRequest()); - } - - /** - * Sets cursor field. - * - * @param int|null $value - */ - public function cursor(?int $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Merchants Request object. - */ - public function build(): ListMerchantsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListMerchantsResponseBuilder.php b/src/Models/Builders/ListMerchantsResponseBuilder.php deleted file mode 100644 index 2f42d375..00000000 --- a/src/Models/Builders/ListMerchantsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Merchants Response Builder object. - */ - public static function init(): self - { - return new self(new ListMerchantsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets merchant field. - * - * @param Merchant[]|null $value - */ - public function merchant(?array $value): self - { - $this->instance->setMerchant($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param int|null $value - */ - public function cursor(?int $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Merchants Response object. - */ - public function build(): ListMerchantsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListOrderCustomAttributeDefinitionsRequestBuilder.php b/src/Models/Builders/ListOrderCustomAttributeDefinitionsRequestBuilder.php deleted file mode 100644 index 8631b3e1..00000000 --- a/src/Models/Builders/ListOrderCustomAttributeDefinitionsRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Order Custom Attribute Definitions Request Builder object. - */ - public static function init(): self - { - return new self(new ListOrderCustomAttributeDefinitionsRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Order Custom Attribute Definitions Request object. - */ - public function build(): ListOrderCustomAttributeDefinitionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListOrderCustomAttributeDefinitionsResponseBuilder.php b/src/Models/Builders/ListOrderCustomAttributeDefinitionsResponseBuilder.php deleted file mode 100644 index f2aef717..00000000 --- a/src/Models/Builders/ListOrderCustomAttributeDefinitionsResponseBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Order Custom Attribute Definitions Response Builder object. - * - * @param CustomAttributeDefinition[] $customAttributeDefinitions - */ - public static function init(array $customAttributeDefinitions): self - { - return new self(new ListOrderCustomAttributeDefinitionsResponse($customAttributeDefinitions)); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Order Custom Attribute Definitions Response object. - */ - public function build(): ListOrderCustomAttributeDefinitionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListOrderCustomAttributesRequestBuilder.php b/src/Models/Builders/ListOrderCustomAttributesRequestBuilder.php deleted file mode 100644 index 97d37504..00000000 --- a/src/Models/Builders/ListOrderCustomAttributesRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Order Custom Attributes Request Builder object. - */ - public static function init(): self - { - return new self(new ListOrderCustomAttributesRequest()); - } - - /** - * Sets visibility filter field. - * - * @param string|null $value - */ - public function visibilityFilter(?string $value): self - { - $this->instance->setVisibilityFilter($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets with definitions field. - * - * @param bool|null $value - */ - public function withDefinitions(?bool $value): self - { - $this->instance->setWithDefinitions($value); - return $this; - } - - /** - * Unsets with definitions field. - */ - public function unsetWithDefinitions(): self - { - $this->instance->unsetWithDefinitions(); - return $this; - } - - /** - * Initializes a new List Order Custom Attributes Request object. - */ - public function build(): ListOrderCustomAttributesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListOrderCustomAttributesResponseBuilder.php b/src/Models/Builders/ListOrderCustomAttributesResponseBuilder.php deleted file mode 100644 index b9059452..00000000 --- a/src/Models/Builders/ListOrderCustomAttributesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Order Custom Attributes Response Builder object. - */ - public static function init(): self - { - return new self(new ListOrderCustomAttributesResponse()); - } - - /** - * Sets custom attributes field. - * - * @param CustomAttribute[]|null $value - */ - public function customAttributes(?array $value): self - { - $this->instance->setCustomAttributes($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Order Custom Attributes Response object. - */ - public function build(): ListOrderCustomAttributesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentLinksRequestBuilder.php b/src/Models/Builders/ListPaymentLinksRequestBuilder.php deleted file mode 100644 index c51aea34..00000000 --- a/src/Models/Builders/ListPaymentLinksRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payment Links Request Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentLinksRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Payment Links Request object. - */ - public function build(): ListPaymentLinksRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentLinksResponseBuilder.php b/src/Models/Builders/ListPaymentLinksResponseBuilder.php deleted file mode 100644 index ee7a8b3d..00000000 --- a/src/Models/Builders/ListPaymentLinksResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payment Links Response Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentLinksResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment links field. - * - * @param PaymentLink[]|null $value - */ - public function paymentLinks(?array $value): self - { - $this->instance->setPaymentLinks($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Payment Links Response object. - */ - public function build(): ListPaymentLinksResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentRefundsRequestBuilder.php b/src/Models/Builders/ListPaymentRefundsRequestBuilder.php deleted file mode 100644 index 918a391e..00000000 --- a/src/Models/Builders/ListPaymentRefundsRequestBuilder.php +++ /dev/null @@ -1,202 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payment Refunds Request Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentRefundsRequest()); - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Unsets sort order field. - */ - public function unsetSortOrder(): self - { - $this->instance->unsetSortOrder(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Sets source type field. - * - * @param string|null $value - */ - public function sourceType(?string $value): self - { - $this->instance->setSourceType($value); - return $this; - } - - /** - * Unsets source type field. - */ - public function unsetSourceType(): self - { - $this->instance->unsetSourceType(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Payment Refunds Request object. - */ - public function build(): ListPaymentRefundsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentRefundsResponseBuilder.php b/src/Models/Builders/ListPaymentRefundsResponseBuilder.php deleted file mode 100644 index 3dc3908f..00000000 --- a/src/Models/Builders/ListPaymentRefundsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payment Refunds Response Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentRefundsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refunds field. - * - * @param PaymentRefund[]|null $value - */ - public function refunds(?array $value): self - { - $this->instance->setRefunds($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Payment Refunds Response object. - */ - public function build(): ListPaymentRefundsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentsRequestBuilder.php b/src/Models/Builders/ListPaymentsRequestBuilder.php deleted file mode 100644 index d085ccd5..00000000 --- a/src/Models/Builders/ListPaymentsRequestBuilder.php +++ /dev/null @@ -1,333 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payments Request Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentsRequest()); - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Unsets sort order field. - */ - public function unsetSortOrder(): self - { - $this->instance->unsetSortOrder(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets total field. - * - * @param int|null $value - */ - public function total(?int $value): self - { - $this->instance->setTotal($value); - return $this; - } - - /** - * Unsets total field. - */ - public function unsetTotal(): self - { - $this->instance->unsetTotal(); - return $this; - } - - /** - * Sets last 4 field. - * - * @param string|null $value - */ - public function last4(?string $value): self - { - $this->instance->setLast4($value); - return $this; - } - - /** - * Unsets last 4 field. - */ - public function unsetLast4(): self - { - $this->instance->unsetLast4(); - return $this; - } - - /** - * Sets card brand field. - * - * @param string|null $value - */ - public function cardBrand(?string $value): self - { - $this->instance->setCardBrand($value); - return $this; - } - - /** - * Unsets card brand field. - */ - public function unsetCardBrand(): self - { - $this->instance->unsetCardBrand(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets is offline payment field. - * - * @param bool|null $value - */ - public function isOfflinePayment(?bool $value): self - { - $this->instance->setIsOfflinePayment($value); - return $this; - } - - /** - * Unsets is offline payment field. - */ - public function unsetIsOfflinePayment(): self - { - $this->instance->unsetIsOfflinePayment(); - return $this; - } - - /** - * Sets offline begin time field. - * - * @param string|null $value - */ - public function offlineBeginTime(?string $value): self - { - $this->instance->setOfflineBeginTime($value); - return $this; - } - - /** - * Unsets offline begin time field. - */ - public function unsetOfflineBeginTime(): self - { - $this->instance->unsetOfflineBeginTime(); - return $this; - } - - /** - * Sets offline end time field. - * - * @param string|null $value - */ - public function offlineEndTime(?string $value): self - { - $this->instance->setOfflineEndTime($value); - return $this; - } - - /** - * Unsets offline end time field. - */ - public function unsetOfflineEndTime(): self - { - $this->instance->unsetOfflineEndTime(); - return $this; - } - - /** - * Sets updated at begin time field. - * - * @param string|null $value - */ - public function updatedAtBeginTime(?string $value): self - { - $this->instance->setUpdatedAtBeginTime($value); - return $this; - } - - /** - * Unsets updated at begin time field. - */ - public function unsetUpdatedAtBeginTime(): self - { - $this->instance->unsetUpdatedAtBeginTime(); - return $this; - } - - /** - * Sets updated at end time field. - * - * @param string|null $value - */ - public function updatedAtEndTime(?string $value): self - { - $this->instance->setUpdatedAtEndTime($value); - return $this; - } - - /** - * Unsets updated at end time field. - */ - public function unsetUpdatedAtEndTime(): self - { - $this->instance->unsetUpdatedAtEndTime(); - return $this; - } - - /** - * Sets sort field field. - * - * @param string|null $value - */ - public function sortField(?string $value): self - { - $this->instance->setSortField($value); - return $this; - } - - /** - * Initializes a new List Payments Request object. - */ - public function build(): ListPaymentsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPaymentsResponseBuilder.php b/src/Models/Builders/ListPaymentsResponseBuilder.php deleted file mode 100644 index ea34fe04..00000000 --- a/src/Models/Builders/ListPaymentsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payments Response Builder object. - */ - public static function init(): self - { - return new self(new ListPaymentsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payments field. - * - * @param Payment[]|null $value - */ - public function payments(?array $value): self - { - $this->instance->setPayments($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Payments Response object. - */ - public function build(): ListPaymentsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPayoutEntriesRequestBuilder.php b/src/Models/Builders/ListPayoutEntriesRequestBuilder.php deleted file mode 100644 index a45576c5..00000000 --- a/src/Models/Builders/ListPayoutEntriesRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payout Entries Request Builder object. - */ - public static function init(): self - { - return new self(new ListPayoutEntriesRequest()); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Payout Entries Request object. - */ - public function build(): ListPayoutEntriesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPayoutEntriesResponseBuilder.php b/src/Models/Builders/ListPayoutEntriesResponseBuilder.php deleted file mode 100644 index e43d1b04..00000000 --- a/src/Models/Builders/ListPayoutEntriesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payout Entries Response Builder object. - */ - public static function init(): self - { - return new self(new ListPayoutEntriesResponse()); - } - - /** - * Sets payout entries field. - * - * @param PayoutEntry[]|null $value - */ - public function payoutEntries(?array $value): self - { - $this->instance->setPayoutEntries($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Payout Entries Response object. - */ - public function build(): ListPayoutEntriesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPayoutsRequestBuilder.php b/src/Models/Builders/ListPayoutsRequestBuilder.php deleted file mode 100644 index 4db8340f..00000000 --- a/src/Models/Builders/ListPayoutsRequestBuilder.php +++ /dev/null @@ -1,164 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payouts Request Builder object. - */ - public static function init(): self - { - return new self(new ListPayoutsRequest()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Payouts Request object. - */ - public function build(): ListPayoutsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListPayoutsResponseBuilder.php b/src/Models/Builders/ListPayoutsResponseBuilder.php deleted file mode 100644 index 1cf4722f..00000000 --- a/src/Models/Builders/ListPayoutsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Payouts Response Builder object. - */ - public static function init(): self - { - return new self(new ListPayoutsResponse()); - } - - /** - * Sets payouts field. - * - * @param Payout[]|null $value - */ - public function payouts(?array $value): self - { - $this->instance->setPayouts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Payouts Response object. - */ - public function build(): ListPayoutsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListRefundsRequestBuilder.php b/src/Models/Builders/ListRefundsRequestBuilder.php deleted file mode 100644 index 60cc065d..00000000 --- a/src/Models/Builders/ListRefundsRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Refunds Request Builder object. - */ - public static function init(): self - { - return new self(new ListRefundsRequest()); - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Refunds Request object. - */ - public function build(): ListRefundsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListRefundsResponseBuilder.php b/src/Models/Builders/ListRefundsResponseBuilder.php deleted file mode 100644 index cd80ffd4..00000000 --- a/src/Models/Builders/ListRefundsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Refunds Response Builder object. - */ - public static function init(): self - { - return new self(new ListRefundsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refunds field. - * - * @param Refund[]|null $value - */ - public function refunds(?array $value): self - { - $this->instance->setRefunds($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Refunds Response object. - */ - public function build(): ListRefundsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListSitesResponseBuilder.php b/src/Models/Builders/ListSitesResponseBuilder.php deleted file mode 100644 index 043222e2..00000000 --- a/src/Models/Builders/ListSitesResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Sites Response Builder object. - */ - public static function init(): self - { - return new self(new ListSitesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets sites field. - * - * @param Site[]|null $value - */ - public function sites(?array $value): self - { - $this->instance->setSites($value); - return $this; - } - - /** - * Initializes a new List Sites Response object. - */ - public function build(): ListSitesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListSubscriptionEventsRequestBuilder.php b/src/Models/Builders/ListSubscriptionEventsRequestBuilder.php deleted file mode 100644 index 69ad37f6..00000000 --- a/src/Models/Builders/ListSubscriptionEventsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Subscription Events Request Builder object. - */ - public static function init(): self - { - return new self(new ListSubscriptionEventsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Subscription Events Request object. - */ - public function build(): ListSubscriptionEventsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListSubscriptionEventsResponseBuilder.php b/src/Models/Builders/ListSubscriptionEventsResponseBuilder.php deleted file mode 100644 index 971702c8..00000000 --- a/src/Models/Builders/ListSubscriptionEventsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Subscription Events Response Builder object. - */ - public static function init(): self - { - return new self(new ListSubscriptionEventsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription events field. - * - * @param SubscriptionEvent[]|null $value - */ - public function subscriptionEvents(?array $value): self - { - $this->instance->setSubscriptionEvents($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Subscription Events Response object. - */ - public function build(): ListSubscriptionEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTeamMemberBookingProfilesRequestBuilder.php b/src/Models/Builders/ListTeamMemberBookingProfilesRequestBuilder.php deleted file mode 100644 index fdc58c57..00000000 --- a/src/Models/Builders/ListTeamMemberBookingProfilesRequestBuilder.php +++ /dev/null @@ -1,122 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Team Member Booking Profiles Request Builder object. - */ - public static function init(): self - { - return new self(new ListTeamMemberBookingProfilesRequest()); - } - - /** - * Sets bookable only field. - * - * @param bool|null $value - */ - public function bookableOnly(?bool $value): self - { - $this->instance->setBookableOnly($value); - return $this; - } - - /** - * Unsets bookable only field. - */ - public function unsetBookableOnly(): self - { - $this->instance->unsetBookableOnly(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new List Team Member Booking Profiles Request object. - */ - public function build(): ListTeamMemberBookingProfilesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTeamMemberBookingProfilesResponseBuilder.php b/src/Models/Builders/ListTeamMemberBookingProfilesResponseBuilder.php deleted file mode 100644 index 0dc4ef1c..00000000 --- a/src/Models/Builders/ListTeamMemberBookingProfilesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Team Member Booking Profiles Response Builder object. - */ - public static function init(): self - { - return new self(new ListTeamMemberBookingProfilesResponse()); - } - - /** - * Sets team member booking profiles field. - * - * @param TeamMemberBookingProfile[]|null $value - */ - public function teamMemberBookingProfiles(?array $value): self - { - $this->instance->setTeamMemberBookingProfiles($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Team Member Booking Profiles Response object. - */ - public function build(): ListTeamMemberBookingProfilesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTeamMemberWagesRequestBuilder.php b/src/Models/Builders/ListTeamMemberWagesRequestBuilder.php deleted file mode 100644 index 21ac6b3b..00000000 --- a/src/Models/Builders/ListTeamMemberWagesRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Team Member Wages Request Builder object. - */ - public static function init(): self - { - return new self(new ListTeamMemberWagesRequest()); - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Team Member Wages Request object. - */ - public function build(): ListTeamMemberWagesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTeamMemberWagesResponseBuilder.php b/src/Models/Builders/ListTeamMemberWagesResponseBuilder.php deleted file mode 100644 index afd19db5..00000000 --- a/src/Models/Builders/ListTeamMemberWagesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Team Member Wages Response Builder object. - */ - public static function init(): self - { - return new self(new ListTeamMemberWagesResponse()); - } - - /** - * Sets team member wages field. - * - * @param TeamMemberWage[]|null $value - */ - public function teamMemberWages(?array $value): self - { - $this->instance->setTeamMemberWages($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Team Member Wages Response object. - */ - public function build(): ListTeamMemberWagesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTransactionsRequestBuilder.php b/src/Models/Builders/ListTransactionsRequestBuilder.php deleted file mode 100644 index f6ce3697..00000000 --- a/src/Models/Builders/ListTransactionsRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Transactions Request Builder object. - */ - public static function init(): self - { - return new self(new ListTransactionsRequest()); - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Unsets begin time field. - */ - public function unsetBeginTime(): self - { - $this->instance->unsetBeginTime(); - return $this; - } - - /** - * Sets end time field. - * - * @param string|null $value - */ - public function endTime(?string $value): self - { - $this->instance->setEndTime($value); - return $this; - } - - /** - * Unsets end time field. - */ - public function unsetEndTime(): self - { - $this->instance->unsetEndTime(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Transactions Request object. - */ - public function build(): ListTransactionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListTransactionsResponseBuilder.php b/src/Models/Builders/ListTransactionsResponseBuilder.php deleted file mode 100644 index 335f1e4a..00000000 --- a/src/Models/Builders/ListTransactionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Transactions Response Builder object. - */ - public static function init(): self - { - return new self(new ListTransactionsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets transactions field. - * - * @param Transaction[]|null $value - */ - public function transactions(?array $value): self - { - $this->instance->setTransactions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Transactions Response object. - */ - public function build(): ListTransactionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWebhookEventTypesRequestBuilder.php b/src/Models/Builders/ListWebhookEventTypesRequestBuilder.php deleted file mode 100644 index 19154f37..00000000 --- a/src/Models/Builders/ListWebhookEventTypesRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Webhook Event Types Request Builder object. - */ - public static function init(): self - { - return new self(new ListWebhookEventTypesRequest()); - } - - /** - * Sets api version field. - * - * @param string|null $value - */ - public function apiVersion(?string $value): self - { - $this->instance->setApiVersion($value); - return $this; - } - - /** - * Unsets api version field. - */ - public function unsetApiVersion(): self - { - $this->instance->unsetApiVersion(); - return $this; - } - - /** - * Initializes a new List Webhook Event Types Request object. - */ - public function build(): ListWebhookEventTypesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWebhookEventTypesResponseBuilder.php b/src/Models/Builders/ListWebhookEventTypesResponseBuilder.php deleted file mode 100644 index 0b9f3173..00000000 --- a/src/Models/Builders/ListWebhookEventTypesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Webhook Event Types Response Builder object. - */ - public static function init(): self - { - return new self(new ListWebhookEventTypesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets event types field. - * - * @param string[]|null $value - */ - public function eventTypes(?array $value): self - { - $this->instance->setEventTypes($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param EventTypeMetadata[]|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Initializes a new List Webhook Event Types Response object. - */ - public function build(): ListWebhookEventTypesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWebhookSubscriptionsRequestBuilder.php b/src/Models/Builders/ListWebhookSubscriptionsRequestBuilder.php deleted file mode 100644 index 4f4091d9..00000000 --- a/src/Models/Builders/ListWebhookSubscriptionsRequestBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Webhook Subscriptions Request Builder object. - */ - public static function init(): self - { - return new self(new ListWebhookSubscriptionsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Sets include disabled field. - * - * @param bool|null $value - */ - public function includeDisabled(?bool $value): self - { - $this->instance->setIncludeDisabled($value); - return $this; - } - - /** - * Unsets include disabled field. - */ - public function unsetIncludeDisabled(): self - { - $this->instance->unsetIncludeDisabled(); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Initializes a new List Webhook Subscriptions Request object. - */ - public function build(): ListWebhookSubscriptionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWebhookSubscriptionsResponseBuilder.php b/src/Models/Builders/ListWebhookSubscriptionsResponseBuilder.php deleted file mode 100644 index 0eb3fefe..00000000 --- a/src/Models/Builders/ListWebhookSubscriptionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Webhook Subscriptions Response Builder object. - */ - public static function init(): self - { - return new self(new ListWebhookSubscriptionsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscriptions field. - * - * @param WebhookSubscription[]|null $value - */ - public function subscriptions(?array $value): self - { - $this->instance->setSubscriptions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new List Webhook Subscriptions Response object. - */ - public function build(): ListWebhookSubscriptionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWorkweekConfigsRequestBuilder.php b/src/Models/Builders/ListWorkweekConfigsRequestBuilder.php deleted file mode 100644 index 3d132e89..00000000 --- a/src/Models/Builders/ListWorkweekConfigsRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Workweek Configs Request Builder object. - */ - public static function init(): self - { - return new self(new ListWorkweekConfigsRequest()); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new List Workweek Configs Request object. - */ - public function build(): ListWorkweekConfigsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ListWorkweekConfigsResponseBuilder.php b/src/Models/Builders/ListWorkweekConfigsResponseBuilder.php deleted file mode 100644 index a69dc6db..00000000 --- a/src/Models/Builders/ListWorkweekConfigsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new List Workweek Configs Response Builder object. - */ - public static function init(): self - { - return new self(new ListWorkweekConfigsResponse()); - } - - /** - * Sets workweek configs field. - * - * @param WorkweekConfig[]|null $value - */ - public function workweekConfigs(?array $value): self - { - $this->instance->setWorkweekConfigs($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new List Workweek Configs Response object. - */ - public function build(): ListWorkweekConfigsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LocationBookingProfileBuilder.php b/src/Models/Builders/LocationBookingProfileBuilder.php deleted file mode 100644 index db9b2b1c..00000000 --- a/src/Models/Builders/LocationBookingProfileBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Location Booking Profile Builder object. - */ - public static function init(): self - { - return new self(new LocationBookingProfile()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets booking site url field. - * - * @param string|null $value - */ - public function bookingSiteUrl(?string $value): self - { - $this->instance->setBookingSiteUrl($value); - return $this; - } - - /** - * Unsets booking site url field. - */ - public function unsetBookingSiteUrl(): self - { - $this->instance->unsetBookingSiteUrl(); - return $this; - } - - /** - * Sets online booking enabled field. - * - * @param bool|null $value - */ - public function onlineBookingEnabled(?bool $value): self - { - $this->instance->setOnlineBookingEnabled($value); - return $this; - } - - /** - * Unsets online booking enabled field. - */ - public function unsetOnlineBookingEnabled(): self - { - $this->instance->unsetOnlineBookingEnabled(); - return $this; - } - - /** - * Initializes a new Location Booking Profile object. - */ - public function build(): LocationBookingProfile - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LocationBuilder.php b/src/Models/Builders/LocationBuilder.php deleted file mode 100644 index ee4dea84..00000000 --- a/src/Models/Builders/LocationBuilder.php +++ /dev/null @@ -1,451 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Location Builder object. - */ - public static function init(): self - { - return new self(new Location()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets timezone field. - * - * @param string|null $value - */ - public function timezone(?string $value): self - { - $this->instance->setTimezone($value); - return $this; - } - - /** - * Unsets timezone field. - */ - public function unsetTimezone(): self - { - $this->instance->unsetTimezone(); - return $this; - } - - /** - * Sets capabilities field. - * - * @param string[]|null $value - */ - public function capabilities(?array $value): self - { - $this->instance->setCapabilities($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Sets country field. - * - * @param string|null $value - */ - public function country(?string $value): self - { - $this->instance->setCountry($value); - return $this; - } - - /** - * Sets language code field. - * - * @param string|null $value - */ - public function languageCode(?string $value): self - { - $this->instance->setLanguageCode($value); - return $this; - } - - /** - * Unsets language code field. - */ - public function unsetLanguageCode(): self - { - $this->instance->unsetLanguageCode(); - return $this; - } - - /** - * Sets currency field. - * - * @param string|null $value - */ - public function currency(?string $value): self - { - $this->instance->setCurrency($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets business name field. - * - * @param string|null $value - */ - public function businessName(?string $value): self - { - $this->instance->setBusinessName($value); - return $this; - } - - /** - * Unsets business name field. - */ - public function unsetBusinessName(): self - { - $this->instance->unsetBusinessName(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets website url field. - * - * @param string|null $value - */ - public function websiteUrl(?string $value): self - { - $this->instance->setWebsiteUrl($value); - return $this; - } - - /** - * Unsets website url field. - */ - public function unsetWebsiteUrl(): self - { - $this->instance->unsetWebsiteUrl(); - return $this; - } - - /** - * Sets business hours field. - * - * @param BusinessHours|null $value - */ - public function businessHours(?BusinessHours $value): self - { - $this->instance->setBusinessHours($value); - return $this; - } - - /** - * Sets business email field. - * - * @param string|null $value - */ - public function businessEmail(?string $value): self - { - $this->instance->setBusinessEmail($value); - return $this; - } - - /** - * Unsets business email field. - */ - public function unsetBusinessEmail(): self - { - $this->instance->unsetBusinessEmail(); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets twitter username field. - * - * @param string|null $value - */ - public function twitterUsername(?string $value): self - { - $this->instance->setTwitterUsername($value); - return $this; - } - - /** - * Unsets twitter username field. - */ - public function unsetTwitterUsername(): self - { - $this->instance->unsetTwitterUsername(); - return $this; - } - - /** - * Sets instagram username field. - * - * @param string|null $value - */ - public function instagramUsername(?string $value): self - { - $this->instance->setInstagramUsername($value); - return $this; - } - - /** - * Unsets instagram username field. - */ - public function unsetInstagramUsername(): self - { - $this->instance->unsetInstagramUsername(); - return $this; - } - - /** - * Sets facebook url field. - * - * @param string|null $value - */ - public function facebookUrl(?string $value): self - { - $this->instance->setFacebookUrl($value); - return $this; - } - - /** - * Unsets facebook url field. - */ - public function unsetFacebookUrl(): self - { - $this->instance->unsetFacebookUrl(); - return $this; - } - - /** - * Sets coordinates field. - * - * @param Coordinates|null $value - */ - public function coordinates(?Coordinates $value): self - { - $this->instance->setCoordinates($value); - return $this; - } - - /** - * Sets logo url field. - * - * @param string|null $value - */ - public function logoUrl(?string $value): self - { - $this->instance->setLogoUrl($value); - return $this; - } - - /** - * Sets pos background url field. - * - * @param string|null $value - */ - public function posBackgroundUrl(?string $value): self - { - $this->instance->setPosBackgroundUrl($value); - return $this; - } - - /** - * Sets mcc field. - * - * @param string|null $value - */ - public function mcc(?string $value): self - { - $this->instance->setMcc($value); - return $this; - } - - /** - * Unsets mcc field. - */ - public function unsetMcc(): self - { - $this->instance->unsetMcc(); - return $this; - } - - /** - * Sets full format logo url field. - * - * @param string|null $value - */ - public function fullFormatLogoUrl(?string $value): self - { - $this->instance->setFullFormatLogoUrl($value); - return $this; - } - - /** - * Sets tax ids field. - * - * @param TaxIds|null $value - */ - public function taxIds(?TaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Location object. - */ - public function build(): Location - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyAccountBuilder.php b/src/Models/Builders/LoyaltyAccountBuilder.php deleted file mode 100644 index 3c6d0085..00000000 --- a/src/Models/Builders/LoyaltyAccountBuilder.php +++ /dev/null @@ -1,172 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Account Builder object. - * - * @param string $programId - */ - public static function init(string $programId): self - { - return new self(new LoyaltyAccount($programId)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets balance field. - * - * @param int|null $value - */ - public function balance(?int $value): self - { - $this->instance->setBalance($value); - return $this; - } - - /** - * Sets lifetime points field. - * - * @param int|null $value - */ - public function lifetimePoints(?int $value): self - { - $this->instance->setLifetimePoints($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets enrolled at field. - * - * @param string|null $value - */ - public function enrolledAt(?string $value): self - { - $this->instance->setEnrolledAt($value); - return $this; - } - - /** - * Unsets enrolled at field. - */ - public function unsetEnrolledAt(): self - { - $this->instance->unsetEnrolledAt(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets mapping field. - * - * @param LoyaltyAccountMapping|null $value - */ - public function mapping(?LoyaltyAccountMapping $value): self - { - $this->instance->setMapping($value); - return $this; - } - - /** - * Sets expiring point deadlines field. - * - * @param LoyaltyAccountExpiringPointDeadline[]|null $value - */ - public function expiringPointDeadlines(?array $value): self - { - $this->instance->setExpiringPointDeadlines($value); - return $this; - } - - /** - * Unsets expiring point deadlines field. - */ - public function unsetExpiringPointDeadlines(): self - { - $this->instance->unsetExpiringPointDeadlines(); - return $this; - } - - /** - * Initializes a new Loyalty Account object. - */ - public function build(): LoyaltyAccount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyAccountExpiringPointDeadlineBuilder.php b/src/Models/Builders/LoyaltyAccountExpiringPointDeadlineBuilder.php deleted file mode 100644 index 2dc3a781..00000000 --- a/src/Models/Builders/LoyaltyAccountExpiringPointDeadlineBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Account Expiring Point Deadline Builder object. - * - * @param int $points - * @param string $expiresAt - */ - public static function init(int $points, string $expiresAt): self - { - return new self(new LoyaltyAccountExpiringPointDeadline($points, $expiresAt)); - } - - /** - * Initializes a new Loyalty Account Expiring Point Deadline object. - */ - public function build(): LoyaltyAccountExpiringPointDeadline - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyAccountMappingBuilder.php b/src/Models/Builders/LoyaltyAccountMappingBuilder.php deleted file mode 100644 index b1219d18..00000000 --- a/src/Models/Builders/LoyaltyAccountMappingBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Account Mapping Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyAccountMapping()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Initializes a new Loyalty Account Mapping object. - */ - public function build(): LoyaltyAccountMapping - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventAccumulatePointsBuilder.php b/src/Models/Builders/LoyaltyEventAccumulatePointsBuilder.php deleted file mode 100644 index 9ccc631b..00000000 --- a/src/Models/Builders/LoyaltyEventAccumulatePointsBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Accumulate Points Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyEventAccumulatePoints()); - } - - /** - * Sets loyalty program id field. - * - * @param string|null $value - */ - public function loyaltyProgramId(?string $value): self - { - $this->instance->setLoyaltyProgramId($value); - return $this; - } - - /** - * Sets points field. - * - * @param int|null $value - */ - public function points(?int $value): self - { - $this->instance->setPoints($value); - return $this; - } - - /** - * Unsets points field. - */ - public function unsetPoints(): self - { - $this->instance->unsetPoints(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Initializes a new Loyalty Event Accumulate Points object. - */ - public function build(): LoyaltyEventAccumulatePoints - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventAccumulatePromotionPointsBuilder.php b/src/Models/Builders/LoyaltyEventAccumulatePromotionPointsBuilder.php deleted file mode 100644 index 3215380a..00000000 --- a/src/Models/Builders/LoyaltyEventAccumulatePromotionPointsBuilder.php +++ /dev/null @@ -1,67 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Accumulate Promotion Points Builder object. - * - * @param int $points - * @param string $orderId - */ - public static function init(int $points, string $orderId): self - { - return new self(new LoyaltyEventAccumulatePromotionPoints($points, $orderId)); - } - - /** - * Sets loyalty program id field. - * - * @param string|null $value - */ - public function loyaltyProgramId(?string $value): self - { - $this->instance->setLoyaltyProgramId($value); - return $this; - } - - /** - * Sets loyalty promotion id field. - * - * @param string|null $value - */ - public function loyaltyPromotionId(?string $value): self - { - $this->instance->setLoyaltyPromotionId($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Accumulate Promotion Points object. - */ - public function build(): LoyaltyEventAccumulatePromotionPoints - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventAdjustPointsBuilder.php b/src/Models/Builders/LoyaltyEventAdjustPointsBuilder.php deleted file mode 100644 index 14a18bdd..00000000 --- a/src/Models/Builders/LoyaltyEventAdjustPointsBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Adjust Points Builder object. - * - * @param int $points - */ - public static function init(int $points): self - { - return new self(new LoyaltyEventAdjustPoints($points)); - } - - /** - * Sets loyalty program id field. - * - * @param string|null $value - */ - public function loyaltyProgramId(?string $value): self - { - $this->instance->setLoyaltyProgramId($value); - return $this; - } - - /** - * Sets reason field. - * - * @param string|null $value - */ - public function reason(?string $value): self - { - $this->instance->setReason($value); - return $this; - } - - /** - * Unsets reason field. - */ - public function unsetReason(): self - { - $this->instance->unsetReason(); - return $this; - } - - /** - * Initializes a new Loyalty Event Adjust Points object. - */ - public function build(): LoyaltyEventAdjustPoints - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventBuilder.php b/src/Models/Builders/LoyaltyEventBuilder.php deleted file mode 100644 index eef79f74..00000000 --- a/src/Models/Builders/LoyaltyEventBuilder.php +++ /dev/null @@ -1,160 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Builder object. - * - * @param string $id - * @param string $type - * @param string $createdAt - * @param string $loyaltyAccountId - * @param string $source - */ - public static function init( - string $id, - string $type, - string $createdAt, - string $loyaltyAccountId, - string $source - ): self { - return new self(new LoyaltyEvent($id, $type, $createdAt, $loyaltyAccountId, $source)); - } - - /** - * Sets accumulate points field. - * - * @param LoyaltyEventAccumulatePoints|null $value - */ - public function accumulatePoints(?LoyaltyEventAccumulatePoints $value): self - { - $this->instance->setAccumulatePoints($value); - return $this; - } - - /** - * Sets create reward field. - * - * @param LoyaltyEventCreateReward|null $value - */ - public function createReward(?LoyaltyEventCreateReward $value): self - { - $this->instance->setCreateReward($value); - return $this; - } - - /** - * Sets redeem reward field. - * - * @param LoyaltyEventRedeemReward|null $value - */ - public function redeemReward(?LoyaltyEventRedeemReward $value): self - { - $this->instance->setRedeemReward($value); - return $this; - } - - /** - * Sets delete reward field. - * - * @param LoyaltyEventDeleteReward|null $value - */ - public function deleteReward(?LoyaltyEventDeleteReward $value): self - { - $this->instance->setDeleteReward($value); - return $this; - } - - /** - * Sets adjust points field. - * - * @param LoyaltyEventAdjustPoints|null $value - */ - public function adjustPoints(?LoyaltyEventAdjustPoints $value): self - { - $this->instance->setAdjustPoints($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets expire points field. - * - * @param LoyaltyEventExpirePoints|null $value - */ - public function expirePoints(?LoyaltyEventExpirePoints $value): self - { - $this->instance->setExpirePoints($value); - return $this; - } - - /** - * Sets other event field. - * - * @param LoyaltyEventOther|null $value - */ - public function otherEvent(?LoyaltyEventOther $value): self - { - $this->instance->setOtherEvent($value); - return $this; - } - - /** - * Sets accumulate promotion points field. - * - * @param LoyaltyEventAccumulatePromotionPoints|null $value - */ - public function accumulatePromotionPoints(?LoyaltyEventAccumulatePromotionPoints $value): self - { - $this->instance->setAccumulatePromotionPoints($value); - return $this; - } - - /** - * Initializes a new Loyalty Event object. - */ - public function build(): LoyaltyEvent - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventCreateRewardBuilder.php b/src/Models/Builders/LoyaltyEventCreateRewardBuilder.php deleted file mode 100644 index 7243cbc1..00000000 --- a/src/Models/Builders/LoyaltyEventCreateRewardBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Create Reward Builder object. - * - * @param string $loyaltyProgramId - * @param int $points - */ - public static function init(string $loyaltyProgramId, int $points): self - { - return new self(new LoyaltyEventCreateReward($loyaltyProgramId, $points)); - } - - /** - * Sets reward id field. - * - * @param string|null $value - */ - public function rewardId(?string $value): self - { - $this->instance->setRewardId($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Create Reward object. - */ - public function build(): LoyaltyEventCreateReward - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventDateTimeFilterBuilder.php b/src/Models/Builders/LoyaltyEventDateTimeFilterBuilder.php deleted file mode 100644 index 6ba1b697..00000000 --- a/src/Models/Builders/LoyaltyEventDateTimeFilterBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Date Time Filter Builder object. - * - * @param TimeRange $createdAt - */ - public static function init(TimeRange $createdAt): self - { - return new self(new LoyaltyEventDateTimeFilter($createdAt)); - } - - /** - * Initializes a new Loyalty Event Date Time Filter object. - */ - public function build(): LoyaltyEventDateTimeFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventDeleteRewardBuilder.php b/src/Models/Builders/LoyaltyEventDeleteRewardBuilder.php deleted file mode 100644 index 0b3a2eb5..00000000 --- a/src/Models/Builders/LoyaltyEventDeleteRewardBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Delete Reward Builder object. - * - * @param string $loyaltyProgramId - * @param int $points - */ - public static function init(string $loyaltyProgramId, int $points): self - { - return new self(new LoyaltyEventDeleteReward($loyaltyProgramId, $points)); - } - - /** - * Sets reward id field. - * - * @param string|null $value - */ - public function rewardId(?string $value): self - { - $this->instance->setRewardId($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Delete Reward object. - */ - public function build(): LoyaltyEventDeleteReward - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventExpirePointsBuilder.php b/src/Models/Builders/LoyaltyEventExpirePointsBuilder.php deleted file mode 100644 index 33ebace8..00000000 --- a/src/Models/Builders/LoyaltyEventExpirePointsBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Expire Points Builder object. - * - * @param string $loyaltyProgramId - * @param int $points - */ - public static function init(string $loyaltyProgramId, int $points): self - { - return new self(new LoyaltyEventExpirePoints($loyaltyProgramId, $points)); - } - - /** - * Initializes a new Loyalty Event Expire Points object. - */ - public function build(): LoyaltyEventExpirePoints - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventFilterBuilder.php b/src/Models/Builders/LoyaltyEventFilterBuilder.php deleted file mode 100644 index fa3f429c..00000000 --- a/src/Models/Builders/LoyaltyEventFilterBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Filter Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyEventFilter()); - } - - /** - * Sets loyalty account filter field. - * - * @param LoyaltyEventLoyaltyAccountFilter|null $value - */ - public function loyaltyAccountFilter(?LoyaltyEventLoyaltyAccountFilter $value): self - { - $this->instance->setLoyaltyAccountFilter($value); - return $this; - } - - /** - * Sets type filter field. - * - * @param LoyaltyEventTypeFilter|null $value - */ - public function typeFilter(?LoyaltyEventTypeFilter $value): self - { - $this->instance->setTypeFilter($value); - return $this; - } - - /** - * Sets date time filter field. - * - * @param LoyaltyEventDateTimeFilter|null $value - */ - public function dateTimeFilter(?LoyaltyEventDateTimeFilter $value): self - { - $this->instance->setDateTimeFilter($value); - return $this; - } - - /** - * Sets location filter field. - * - * @param LoyaltyEventLocationFilter|null $value - */ - public function locationFilter(?LoyaltyEventLocationFilter $value): self - { - $this->instance->setLocationFilter($value); - return $this; - } - - /** - * Sets order filter field. - * - * @param LoyaltyEventOrderFilter|null $value - */ - public function orderFilter(?LoyaltyEventOrderFilter $value): self - { - $this->instance->setOrderFilter($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Filter object. - */ - public function build(): LoyaltyEventFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventLocationFilterBuilder.php b/src/Models/Builders/LoyaltyEventLocationFilterBuilder.php deleted file mode 100644 index 1860efbf..00000000 --- a/src/Models/Builders/LoyaltyEventLocationFilterBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Location Filter Builder object. - * - * @param string[] $locationIds - */ - public static function init(array $locationIds): self - { - return new self(new LoyaltyEventLocationFilter($locationIds)); - } - - /** - * Initializes a new Loyalty Event Location Filter object. - */ - public function build(): LoyaltyEventLocationFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventLoyaltyAccountFilterBuilder.php b/src/Models/Builders/LoyaltyEventLoyaltyAccountFilterBuilder.php deleted file mode 100644 index df3030e9..00000000 --- a/src/Models/Builders/LoyaltyEventLoyaltyAccountFilterBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Loyalty Account Filter Builder object. - * - * @param string $loyaltyAccountId - */ - public static function init(string $loyaltyAccountId): self - { - return new self(new LoyaltyEventLoyaltyAccountFilter($loyaltyAccountId)); - } - - /** - * Initializes a new Loyalty Event Loyalty Account Filter object. - */ - public function build(): LoyaltyEventLoyaltyAccountFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventOrderFilterBuilder.php b/src/Models/Builders/LoyaltyEventOrderFilterBuilder.php deleted file mode 100644 index 625db28e..00000000 --- a/src/Models/Builders/LoyaltyEventOrderFilterBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Order Filter Builder object. - * - * @param string $orderId - */ - public static function init(string $orderId): self - { - return new self(new LoyaltyEventOrderFilter($orderId)); - } - - /** - * Initializes a new Loyalty Event Order Filter object. - */ - public function build(): LoyaltyEventOrderFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventOtherBuilder.php b/src/Models/Builders/LoyaltyEventOtherBuilder.php deleted file mode 100644 index 0f0df201..00000000 --- a/src/Models/Builders/LoyaltyEventOtherBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Other Builder object. - * - * @param string $loyaltyProgramId - * @param int $points - */ - public static function init(string $loyaltyProgramId, int $points): self - { - return new self(new LoyaltyEventOther($loyaltyProgramId, $points)); - } - - /** - * Initializes a new Loyalty Event Other object. - */ - public function build(): LoyaltyEventOther - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventQueryBuilder.php b/src/Models/Builders/LoyaltyEventQueryBuilder.php deleted file mode 100644 index 9e9bf7c2..00000000 --- a/src/Models/Builders/LoyaltyEventQueryBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Query Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyEventQuery()); - } - - /** - * Sets filter field. - * - * @param LoyaltyEventFilter|null $value - */ - public function filter(?LoyaltyEventFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Query object. - */ - public function build(): LoyaltyEventQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventRedeemRewardBuilder.php b/src/Models/Builders/LoyaltyEventRedeemRewardBuilder.php deleted file mode 100644 index 3c683477..00000000 --- a/src/Models/Builders/LoyaltyEventRedeemRewardBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Redeem Reward Builder object. - * - * @param string $loyaltyProgramId - */ - public static function init(string $loyaltyProgramId): self - { - return new self(new LoyaltyEventRedeemReward($loyaltyProgramId)); - } - - /** - * Sets reward id field. - * - * @param string|null $value - */ - public function rewardId(?string $value): self - { - $this->instance->setRewardId($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Initializes a new Loyalty Event Redeem Reward object. - */ - public function build(): LoyaltyEventRedeemReward - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyEventTypeFilterBuilder.php b/src/Models/Builders/LoyaltyEventTypeFilterBuilder.php deleted file mode 100644 index d69007e6..00000000 --- a/src/Models/Builders/LoyaltyEventTypeFilterBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Event Type Filter Builder object. - * - * @param string[] $types - */ - public static function init(array $types): self - { - return new self(new LoyaltyEventTypeFilter($types)); - } - - /** - * Initializes a new Loyalty Event Type Filter object. - */ - public function build(): LoyaltyEventTypeFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramAccrualRuleBuilder.php b/src/Models/Builders/LoyaltyProgramAccrualRuleBuilder.php deleted file mode 100644 index b11e4387..00000000 --- a/src/Models/Builders/LoyaltyProgramAccrualRuleBuilder.php +++ /dev/null @@ -1,112 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Builder object. - * - * @param string $accrualType - */ - public static function init(string $accrualType): self - { - return new self(new LoyaltyProgramAccrualRule($accrualType)); - } - - /** - * Sets points field. - * - * @param int|null $value - */ - public function points(?int $value): self - { - $this->instance->setPoints($value); - return $this; - } - - /** - * Unsets points field. - */ - public function unsetPoints(): self - { - $this->instance->unsetPoints(); - return $this; - } - - /** - * Sets visit data field. - * - * @param LoyaltyProgramAccrualRuleVisitData|null $value - */ - public function visitData(?LoyaltyProgramAccrualRuleVisitData $value): self - { - $this->instance->setVisitData($value); - return $this; - } - - /** - * Sets spend data field. - * - * @param LoyaltyProgramAccrualRuleSpendData|null $value - */ - public function spendData(?LoyaltyProgramAccrualRuleSpendData $value): self - { - $this->instance->setSpendData($value); - return $this; - } - - /** - * Sets item variation data field. - * - * @param LoyaltyProgramAccrualRuleItemVariationData|null $value - */ - public function itemVariationData(?LoyaltyProgramAccrualRuleItemVariationData $value): self - { - $this->instance->setItemVariationData($value); - return $this; - } - - /** - * Sets category data field. - * - * @param LoyaltyProgramAccrualRuleCategoryData|null $value - */ - public function categoryData(?LoyaltyProgramAccrualRuleCategoryData $value): self - { - $this->instance->setCategoryData($value); - return $this; - } - - /** - * Initializes a new Loyalty Program Accrual Rule object. - */ - public function build(): LoyaltyProgramAccrualRule - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramAccrualRuleCategoryDataBuilder.php b/src/Models/Builders/LoyaltyProgramAccrualRuleCategoryDataBuilder.php deleted file mode 100644 index 799f38b3..00000000 --- a/src/Models/Builders/LoyaltyProgramAccrualRuleCategoryDataBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Category Data Builder object. - * - * @param string $categoryId - */ - public static function init(string $categoryId): self - { - return new self(new LoyaltyProgramAccrualRuleCategoryData($categoryId)); - } - - /** - * Initializes a new Loyalty Program Accrual Rule Category Data object. - */ - public function build(): LoyaltyProgramAccrualRuleCategoryData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramAccrualRuleItemVariationDataBuilder.php b/src/Models/Builders/LoyaltyProgramAccrualRuleItemVariationDataBuilder.php deleted file mode 100644 index 908e0e48..00000000 --- a/src/Models/Builders/LoyaltyProgramAccrualRuleItemVariationDataBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Item Variation Data Builder object. - * - * @param string $itemVariationId - */ - public static function init(string $itemVariationId): self - { - return new self(new LoyaltyProgramAccrualRuleItemVariationData($itemVariationId)); - } - - /** - * Initializes a new Loyalty Program Accrual Rule Item Variation Data object. - */ - public function build(): LoyaltyProgramAccrualRuleItemVariationData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramAccrualRuleSpendDataBuilder.php b/src/Models/Builders/LoyaltyProgramAccrualRuleSpendDataBuilder.php deleted file mode 100644 index d305f6bc..00000000 --- a/src/Models/Builders/LoyaltyProgramAccrualRuleSpendDataBuilder.php +++ /dev/null @@ -1,86 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Spend Data Builder object. - * - * @param Money $amountMoney - * @param string $taxMode - */ - public static function init(Money $amountMoney, string $taxMode): self - { - return new self(new LoyaltyProgramAccrualRuleSpendData($amountMoney, $taxMode)); - } - - /** - * Sets excluded category ids field. - * - * @param string[]|null $value - */ - public function excludedCategoryIds(?array $value): self - { - $this->instance->setExcludedCategoryIds($value); - return $this; - } - - /** - * Unsets excluded category ids field. - */ - public function unsetExcludedCategoryIds(): self - { - $this->instance->unsetExcludedCategoryIds(); - return $this; - } - - /** - * Sets excluded item variation ids field. - * - * @param string[]|null $value - */ - public function excludedItemVariationIds(?array $value): self - { - $this->instance->setExcludedItemVariationIds($value); - return $this; - } - - /** - * Unsets excluded item variation ids field. - */ - public function unsetExcludedItemVariationIds(): self - { - $this->instance->unsetExcludedItemVariationIds(); - return $this; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Spend Data object. - */ - public function build(): LoyaltyProgramAccrualRuleSpendData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramAccrualRuleVisitDataBuilder.php b/src/Models/Builders/LoyaltyProgramAccrualRuleVisitDataBuilder.php deleted file mode 100644 index bed95b4c..00000000 --- a/src/Models/Builders/LoyaltyProgramAccrualRuleVisitDataBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Visit Data Builder object. - * - * @param string $taxMode - */ - public static function init(string $taxMode): self - { - return new self(new LoyaltyProgramAccrualRuleVisitData($taxMode)); - } - - /** - * Sets minimum amount money field. - * - * @param Money|null $value - */ - public function minimumAmountMoney(?Money $value): self - { - $this->instance->setMinimumAmountMoney($value); - return $this; - } - - /** - * Initializes a new Loyalty Program Accrual Rule Visit Data object. - */ - public function build(): LoyaltyProgramAccrualRuleVisitData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramBuilder.php b/src/Models/Builders/LoyaltyProgramBuilder.php deleted file mode 100644 index bf6c14f6..00000000 --- a/src/Models/Builders/LoyaltyProgramBuilder.php +++ /dev/null @@ -1,172 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyProgram()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets reward tiers field. - * - * @param LoyaltyProgramRewardTier[]|null $value - */ - public function rewardTiers(?array $value): self - { - $this->instance->setRewardTiers($value); - return $this; - } - - /** - * Unsets reward tiers field. - */ - public function unsetRewardTiers(): self - { - $this->instance->unsetRewardTiers(); - return $this; - } - - /** - * Sets expiration policy field. - * - * @param LoyaltyProgramExpirationPolicy|null $value - */ - public function expirationPolicy(?LoyaltyProgramExpirationPolicy $value): self - { - $this->instance->setExpirationPolicy($value); - return $this; - } - - /** - * Sets terminology field. - * - * @param LoyaltyProgramTerminology|null $value - */ - public function terminology(?LoyaltyProgramTerminology $value): self - { - $this->instance->setTerminology($value); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets accrual rules field. - * - * @param LoyaltyProgramAccrualRule[]|null $value - */ - public function accrualRules(?array $value): self - { - $this->instance->setAccrualRules($value); - return $this; - } - - /** - * Unsets accrual rules field. - */ - public function unsetAccrualRules(): self - { - $this->instance->unsetAccrualRules(); - return $this; - } - - /** - * Initializes a new Loyalty Program object. - */ - public function build(): LoyaltyProgram - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramExpirationPolicyBuilder.php b/src/Models/Builders/LoyaltyProgramExpirationPolicyBuilder.php deleted file mode 100644 index 867294a2..00000000 --- a/src/Models/Builders/LoyaltyProgramExpirationPolicyBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Expiration Policy Builder object. - * - * @param string $expirationDuration - */ - public static function init(string $expirationDuration): self - { - return new self(new LoyaltyProgramExpirationPolicy($expirationDuration)); - } - - /** - * Initializes a new Loyalty Program Expiration Policy object. - */ - public function build(): LoyaltyProgramExpirationPolicy - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramRewardDefinitionBuilder.php b/src/Models/Builders/LoyaltyProgramRewardDefinitionBuilder.php deleted file mode 100644 index 09b16406..00000000 --- a/src/Models/Builders/LoyaltyProgramRewardDefinitionBuilder.php +++ /dev/null @@ -1,90 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Reward Definition Builder object. - * - * @param string $scope - * @param string $discountType - */ - public static function init(string $scope, string $discountType): self - { - return new self(new LoyaltyProgramRewardDefinition($scope, $discountType)); - } - - /** - * Sets percentage discount field. - * - * @param string|null $value - */ - public function percentageDiscount(?string $value): self - { - $this->instance->setPercentageDiscount($value); - return $this; - } - - /** - * Sets catalog object ids field. - * - * @param string[]|null $value - */ - public function catalogObjectIds(?array $value): self - { - $this->instance->setCatalogObjectIds($value); - return $this; - } - - /** - * Sets fixed discount money field. - * - * @param Money|null $value - */ - public function fixedDiscountMoney(?Money $value): self - { - $this->instance->setFixedDiscountMoney($value); - return $this; - } - - /** - * Sets max discount money field. - * - * @param Money|null $value - */ - public function maxDiscountMoney(?Money $value): self - { - $this->instance->setMaxDiscountMoney($value); - return $this; - } - - /** - * Initializes a new Loyalty Program Reward Definition object. - */ - public function build(): LoyaltyProgramRewardDefinition - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramRewardTierBuilder.php b/src/Models/Builders/LoyaltyProgramRewardTierBuilder.php deleted file mode 100644 index 595e3c9c..00000000 --- a/src/Models/Builders/LoyaltyProgramRewardTierBuilder.php +++ /dev/null @@ -1,91 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Reward Tier Builder object. - * - * @param int $points - * @param CatalogObjectReference $pricingRuleReference - */ - public static function init(int $points, CatalogObjectReference $pricingRuleReference): self - { - return new self(new LoyaltyProgramRewardTier($points, $pricingRuleReference)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Sets definition field. - * - * @param LoyaltyProgramRewardDefinition|null $value - */ - public function definition(?LoyaltyProgramRewardDefinition $value): self - { - $this->instance->setDefinition($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Loyalty Program Reward Tier object. - */ - public function build(): LoyaltyProgramRewardTier - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyProgramTerminologyBuilder.php b/src/Models/Builders/LoyaltyProgramTerminologyBuilder.php deleted file mode 100644 index eb223abb..00000000 --- a/src/Models/Builders/LoyaltyProgramTerminologyBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Program Terminology Builder object. - * - * @param string $one - * @param string $other - */ - public static function init(string $one, string $other): self - { - return new self(new LoyaltyProgramTerminology($one, $other)); - } - - /** - * Initializes a new Loyalty Program Terminology object. - */ - public function build(): LoyaltyProgramTerminology - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionAvailableTimeDataBuilder.php b/src/Models/Builders/LoyaltyPromotionAvailableTimeDataBuilder.php deleted file mode 100644 index 7475dbd2..00000000 --- a/src/Models/Builders/LoyaltyPromotionAvailableTimeDataBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Available Time Data Builder object. - * - * @param string[] $timePeriods - */ - public static function init(array $timePeriods): self - { - return new self(new LoyaltyPromotionAvailableTimeData($timePeriods)); - } - - /** - * Sets start date field. - * - * @param string|null $value - */ - public function startDate(?string $value): self - { - $this->instance->setStartDate($value); - return $this; - } - - /** - * Sets end date field. - * - * @param string|null $value - */ - public function endDate(?string $value): self - { - $this->instance->setEndDate($value); - return $this; - } - - /** - * Initializes a new Loyalty Promotion Available Time Data object. - */ - public function build(): LoyaltyPromotionAvailableTimeData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionBuilder.php b/src/Models/Builders/LoyaltyPromotionBuilder.php deleted file mode 100644 index 009a71d6..00000000 --- a/src/Models/Builders/LoyaltyPromotionBuilder.php +++ /dev/null @@ -1,181 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Builder object. - * - * @param string $name - * @param LoyaltyPromotionIncentive $incentive - * @param LoyaltyPromotionAvailableTimeData $availableTime - */ - public static function init( - string $name, - LoyaltyPromotionIncentive $incentive, - LoyaltyPromotionAvailableTimeData $availableTime - ): self { - return new self(new LoyaltyPromotion($name, $incentive, $availableTime)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets trigger limit field. - * - * @param LoyaltyPromotionTriggerLimit|null $value - */ - public function triggerLimit(?LoyaltyPromotionTriggerLimit $value): self - { - $this->instance->setTriggerLimit($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets loyalty program id field. - * - * @param string|null $value - */ - public function loyaltyProgramId(?string $value): self - { - $this->instance->setLoyaltyProgramId($value); - return $this; - } - - /** - * Sets minimum spend amount money field. - * - * @param Money|null $value - */ - public function minimumSpendAmountMoney(?Money $value): self - { - $this->instance->setMinimumSpendAmountMoney($value); - return $this; - } - - /** - * Sets qualifying item variation ids field. - * - * @param string[]|null $value - */ - public function qualifyingItemVariationIds(?array $value): self - { - $this->instance->setQualifyingItemVariationIds($value); - return $this; - } - - /** - * Unsets qualifying item variation ids field. - */ - public function unsetQualifyingItemVariationIds(): self - { - $this->instance->unsetQualifyingItemVariationIds(); - return $this; - } - - /** - * Sets qualifying category ids field. - * - * @param string[]|null $value - */ - public function qualifyingCategoryIds(?array $value): self - { - $this->instance->setQualifyingCategoryIds($value); - return $this; - } - - /** - * Unsets qualifying category ids field. - */ - public function unsetQualifyingCategoryIds(): self - { - $this->instance->unsetQualifyingCategoryIds(); - return $this; - } - - /** - * Initializes a new Loyalty Promotion object. - */ - public function build(): LoyaltyPromotion - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionIncentiveBuilder.php b/src/Models/Builders/LoyaltyPromotionIncentiveBuilder.php deleted file mode 100644 index da270ed9..00000000 --- a/src/Models/Builders/LoyaltyPromotionIncentiveBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Incentive Builder object. - * - * @param string $type - */ - public static function init(string $type): self - { - return new self(new LoyaltyPromotionIncentive($type)); - } - - /** - * Sets points multiplier data field. - * - * @param LoyaltyPromotionIncentivePointsMultiplierData|null $value - */ - public function pointsMultiplierData(?LoyaltyPromotionIncentivePointsMultiplierData $value): self - { - $this->instance->setPointsMultiplierData($value); - return $this; - } - - /** - * Sets points addition data field. - * - * @param LoyaltyPromotionIncentivePointsAdditionData|null $value - */ - public function pointsAdditionData(?LoyaltyPromotionIncentivePointsAdditionData $value): self - { - $this->instance->setPointsAdditionData($value); - return $this; - } - - /** - * Initializes a new Loyalty Promotion Incentive object. - */ - public function build(): LoyaltyPromotionIncentive - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionIncentivePointsAdditionDataBuilder.php b/src/Models/Builders/LoyaltyPromotionIncentivePointsAdditionDataBuilder.php deleted file mode 100644 index 9060031b..00000000 --- a/src/Models/Builders/LoyaltyPromotionIncentivePointsAdditionDataBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Incentive Points Addition Data Builder object. - * - * @param int $pointsAddition - */ - public static function init(int $pointsAddition): self - { - return new self(new LoyaltyPromotionIncentivePointsAdditionData($pointsAddition)); - } - - /** - * Initializes a new Loyalty Promotion Incentive Points Addition Data object. - */ - public function build(): LoyaltyPromotionIncentivePointsAdditionData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionIncentivePointsMultiplierDataBuilder.php b/src/Models/Builders/LoyaltyPromotionIncentivePointsMultiplierDataBuilder.php deleted file mode 100644 index c1dacfad..00000000 --- a/src/Models/Builders/LoyaltyPromotionIncentivePointsMultiplierDataBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Incentive Points Multiplier Data Builder object. - */ - public static function init(): self - { - return new self(new LoyaltyPromotionIncentivePointsMultiplierData()); - } - - /** - * Sets points multiplier field. - * - * @param int|null $value - */ - public function pointsMultiplier(?int $value): self - { - $this->instance->setPointsMultiplier($value); - return $this; - } - - /** - * Unsets points multiplier field. - */ - public function unsetPointsMultiplier(): self - { - $this->instance->unsetPointsMultiplier(); - return $this; - } - - /** - * Sets multiplier field. - * - * @param string|null $value - */ - public function multiplier(?string $value): self - { - $this->instance->setMultiplier($value); - return $this; - } - - /** - * Unsets multiplier field. - */ - public function unsetMultiplier(): self - { - $this->instance->unsetMultiplier(); - return $this; - } - - /** - * Initializes a new Loyalty Promotion Incentive Points Multiplier Data object. - */ - public function build(): LoyaltyPromotionIncentivePointsMultiplierData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyPromotionTriggerLimitBuilder.php b/src/Models/Builders/LoyaltyPromotionTriggerLimitBuilder.php deleted file mode 100644 index c6b9f8c4..00000000 --- a/src/Models/Builders/LoyaltyPromotionTriggerLimitBuilder.php +++ /dev/null @@ -1,55 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Promotion Trigger Limit Builder object. - * - * @param int $times - */ - public static function init(int $times): self - { - return new self(new LoyaltyPromotionTriggerLimit($times)); - } - - /** - * Sets interval field. - * - * @param string|null $value - */ - public function interval(?string $value): self - { - $this->instance->setInterval($value); - return $this; - } - - /** - * Initializes a new Loyalty Promotion Trigger Limit object. - */ - public function build(): LoyaltyPromotionTriggerLimit - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/LoyaltyRewardBuilder.php b/src/Models/Builders/LoyaltyRewardBuilder.php deleted file mode 100644 index 1b5f07a8..00000000 --- a/src/Models/Builders/LoyaltyRewardBuilder.php +++ /dev/null @@ -1,131 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Loyalty Reward Builder object. - * - * @param string $loyaltyAccountId - * @param string $rewardTierId - */ - public static function init(string $loyaltyAccountId, string $rewardTierId): self - { - return new self(new LoyaltyReward($loyaltyAccountId, $rewardTierId)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets points field. - * - * @param int|null $value - */ - public function points(?int $value): self - { - $this->instance->setPoints($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets redeemed at field. - * - * @param string|null $value - */ - public function redeemedAt(?string $value): self - { - $this->instance->setRedeemedAt($value); - return $this; - } - - /** - * Initializes a new Loyalty Reward object. - */ - public function build(): LoyaltyReward - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/MBreakBuilder.php b/src/Models/Builders/MBreakBuilder.php deleted file mode 100644 index ff08842c..00000000 --- a/src/Models/Builders/MBreakBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new M Break Builder object. - * - * @param string $startAt - * @param string $breakTypeId - * @param string $name - * @param string $expectedDuration - * @param bool $isPaid - */ - public static function init( - string $startAt, - string $breakTypeId, - string $name, - string $expectedDuration, - bool $isPaid - ): self { - return new self(new MBreak($startAt, $breakTypeId, $name, $expectedDuration, $isPaid)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets end at field. - * - * @param string|null $value - */ - public function endAt(?string $value): self - { - $this->instance->setEndAt($value); - return $this; - } - - /** - * Unsets end at field. - */ - public function unsetEndAt(): self - { - $this->instance->unsetEndAt(); - return $this; - } - - /** - * Initializes a new M Break object. - */ - public function build(): MBreak - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/MeasurementUnitBuilder.php b/src/Models/Builders/MeasurementUnitBuilder.php deleted file mode 100644 index 8eb694c6..00000000 --- a/src/Models/Builders/MeasurementUnitBuilder.php +++ /dev/null @@ -1,131 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Measurement Unit Builder object. - */ - public static function init(): self - { - return new self(new MeasurementUnit()); - } - - /** - * Sets custom unit field. - * - * @param MeasurementUnitCustom|null $value - */ - public function customUnit(?MeasurementUnitCustom $value): self - { - $this->instance->setCustomUnit($value); - return $this; - } - - /** - * Sets area unit field. - * - * @param string|null $value - */ - public function areaUnit(?string $value): self - { - $this->instance->setAreaUnit($value); - return $this; - } - - /** - * Sets length unit field. - * - * @param string|null $value - */ - public function lengthUnit(?string $value): self - { - $this->instance->setLengthUnit($value); - return $this; - } - - /** - * Sets volume unit field. - * - * @param string|null $value - */ - public function volumeUnit(?string $value): self - { - $this->instance->setVolumeUnit($value); - return $this; - } - - /** - * Sets weight unit field. - * - * @param string|null $value - */ - public function weightUnit(?string $value): self - { - $this->instance->setWeightUnit($value); - return $this; - } - - /** - * Sets generic unit field. - * - * @param string|null $value - */ - public function genericUnit(?string $value): self - { - $this->instance->setGenericUnit($value); - return $this; - } - - /** - * Sets time unit field. - * - * @param string|null $value - */ - public function timeUnit(?string $value): self - { - $this->instance->setTimeUnit($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Initializes a new Measurement Unit object. - */ - public function build(): MeasurementUnit - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/MeasurementUnitCustomBuilder.php b/src/Models/Builders/MeasurementUnitCustomBuilder.php deleted file mode 100644 index 3b95e67f..00000000 --- a/src/Models/Builders/MeasurementUnitCustomBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Measurement Unit Custom Builder object. - * - * @param string $name - * @param string $abbreviation - */ - public static function init(string $name, string $abbreviation): self - { - return new self(new MeasurementUnitCustom($name, $abbreviation)); - } - - /** - * Initializes a new Measurement Unit Custom object. - */ - public function build(): MeasurementUnitCustom - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/MerchantBuilder.php b/src/Models/Builders/MerchantBuilder.php deleted file mode 100644 index 5295dfbc..00000000 --- a/src/Models/Builders/MerchantBuilder.php +++ /dev/null @@ -1,148 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Merchant Builder object. - * - * @param string $country - */ - public static function init(string $country): self - { - return new self(new Merchant($country)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets business name field. - * - * @param string|null $value - */ - public function businessName(?string $value): self - { - $this->instance->setBusinessName($value); - return $this; - } - - /** - * Unsets business name field. - */ - public function unsetBusinessName(): self - { - $this->instance->unsetBusinessName(); - return $this; - } - - /** - * Sets language code field. - * - * @param string|null $value - */ - public function languageCode(?string $value): self - { - $this->instance->setLanguageCode($value); - return $this; - } - - /** - * Unsets language code field. - */ - public function unsetLanguageCode(): self - { - $this->instance->unsetLanguageCode(); - return $this; - } - - /** - * Sets currency field. - * - * @param string|null $value - */ - public function currency(?string $value): self - { - $this->instance->setCurrency($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets main location id field. - * - * @param string|null $value - */ - public function mainLocationId(?string $value): self - { - $this->instance->setMainLocationId($value); - return $this; - } - - /** - * Unsets main location id field. - */ - public function unsetMainLocationId(): self - { - $this->instance->unsetMainLocationId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Merchant object. - */ - public function build(): Merchant - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ModifierLocationOverridesBuilder.php b/src/Models/Builders/ModifierLocationOverridesBuilder.php deleted file mode 100644 index 57533128..00000000 --- a/src/Models/Builders/ModifierLocationOverridesBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Modifier Location Overrides Builder object. - */ - public static function init(): self - { - return new self(new ModifierLocationOverrides()); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets price money field. - * - * @param Money|null $value - */ - public function priceMoney(?Money $value): self - { - $this->instance->setPriceMoney($value); - return $this; - } - - /** - * Sets sold out field. - * - * @param bool|null $value - */ - public function soldOut(?bool $value): self - { - $this->instance->setSoldOut($value); - return $this; - } - - /** - * Initializes a new Modifier Location Overrides object. - */ - public function build(): ModifierLocationOverrides - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/MoneyBuilder.php b/src/Models/Builders/MoneyBuilder.php deleted file mode 100644 index 6c939eff..00000000 --- a/src/Models/Builders/MoneyBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Money Builder object. - */ - public static function init(): self - { - return new self(new Money()); - } - - /** - * Sets amount field. - * - * @param int|null $value - */ - public function amount(?int $value): self - { - $this->instance->setAmount($value); - return $this; - } - - /** - * Unsets amount field. - */ - public function unsetAmount(): self - { - $this->instance->unsetAmount(); - return $this; - } - - /** - * Sets currency field. - * - * @param string|null $value - */ - public function currency(?string $value): self - { - $this->instance->setCurrency($value); - return $this; - } - - /** - * Initializes a new Money object. - */ - public function build(): Money - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ObtainTokenRequestBuilder.php b/src/Models/Builders/ObtainTokenRequestBuilder.php deleted file mode 100644 index ea8734d3..00000000 --- a/src/Models/Builders/ObtainTokenRequestBuilder.php +++ /dev/null @@ -1,205 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Obtain Token Request Builder object. - * - * @param string $clientId - * @param string $grantType - */ - public static function init(string $clientId, string $grantType): self - { - return new self(new ObtainTokenRequest($clientId, $grantType)); - } - - /** - * Sets client secret field. - * - * @param string|null $value - */ - public function clientSecret(?string $value): self - { - $this->instance->setClientSecret($value); - return $this; - } - - /** - * Unsets client secret field. - */ - public function unsetClientSecret(): self - { - $this->instance->unsetClientSecret(); - return $this; - } - - /** - * Sets code field. - * - * @param string|null $value - */ - public function code(?string $value): self - { - $this->instance->setCode($value); - return $this; - } - - /** - * Unsets code field. - */ - public function unsetCode(): self - { - $this->instance->unsetCode(); - return $this; - } - - /** - * Sets redirect uri field. - * - * @param string|null $value - */ - public function redirectUri(?string $value): self - { - $this->instance->setRedirectUri($value); - return $this; - } - - /** - * Unsets redirect uri field. - */ - public function unsetRedirectUri(): self - { - $this->instance->unsetRedirectUri(); - return $this; - } - - /** - * Sets refresh token field. - * - * @param string|null $value - */ - public function refreshToken(?string $value): self - { - $this->instance->setRefreshToken($value); - return $this; - } - - /** - * Unsets refresh token field. - */ - public function unsetRefreshToken(): self - { - $this->instance->unsetRefreshToken(); - return $this; - } - - /** - * Sets migration token field. - * - * @param string|null $value - */ - public function migrationToken(?string $value): self - { - $this->instance->setMigrationToken($value); - return $this; - } - - /** - * Unsets migration token field. - */ - public function unsetMigrationToken(): self - { - $this->instance->unsetMigrationToken(); - return $this; - } - - /** - * Sets scopes field. - * - * @param string[]|null $value - */ - public function scopes(?array $value): self - { - $this->instance->setScopes($value); - return $this; - } - - /** - * Unsets scopes field. - */ - public function unsetScopes(): self - { - $this->instance->unsetScopes(); - return $this; - } - - /** - * Sets short lived field. - * - * @param bool|null $value - */ - public function shortLived(?bool $value): self - { - $this->instance->setShortLived($value); - return $this; - } - - /** - * Unsets short lived field. - */ - public function unsetShortLived(): self - { - $this->instance->unsetShortLived(); - return $this; - } - - /** - * Sets code verifier field. - * - * @param string|null $value - */ - public function codeVerifier(?string $value): self - { - $this->instance->setCodeVerifier($value); - return $this; - } - - /** - * Unsets code verifier field. - */ - public function unsetCodeVerifier(): self - { - $this->instance->unsetCodeVerifier(); - return $this; - } - - /** - * Initializes a new Obtain Token Request object. - */ - public function build(): ObtainTokenRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ObtainTokenResponseBuilder.php b/src/Models/Builders/ObtainTokenResponseBuilder.php deleted file mode 100644 index 996cfce1..00000000 --- a/src/Models/Builders/ObtainTokenResponseBuilder.php +++ /dev/null @@ -1,164 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Obtain Token Response Builder object. - */ - public static function init(): self - { - return new self(new ObtainTokenResponse()); - } - - /** - * Sets access token field. - * - * @param string|null $value - */ - public function accessToken(?string $value): self - { - $this->instance->setAccessToken($value); - return $this; - } - - /** - * Sets token type field. - * - * @param string|null $value - */ - public function tokenType(?string $value): self - { - $this->instance->setTokenType($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Sets subscription id field. - * - * @param string|null $value - */ - public function subscriptionId(?string $value): self - { - $this->instance->setSubscriptionId($value); - return $this; - } - - /** - * Sets plan id field. - * - * @param string|null $value - */ - public function planId(?string $value): self - { - $this->instance->setPlanId($value); - return $this; - } - - /** - * Sets id token field. - * - * @param string|null $value - */ - public function idToken(?string $value): self - { - $this->instance->setIdToken($value); - return $this; - } - - /** - * Sets refresh token field. - * - * @param string|null $value - */ - public function refreshToken(?string $value): self - { - $this->instance->setRefreshToken($value); - return $this; - } - - /** - * Sets short lived field. - * - * @param bool|null $value - */ - public function shortLived(?bool $value): self - { - $this->instance->setShortLived($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refresh token expires at field. - * - * @param string|null $value - */ - public function refreshTokenExpiresAt(?string $value): self - { - $this->instance->setRefreshTokenExpiresAt($value); - return $this; - } - - /** - * Initializes a new Obtain Token Response object. - */ - public function build(): ObtainTokenResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OfflinePaymentDetailsBuilder.php b/src/Models/Builders/OfflinePaymentDetailsBuilder.php deleted file mode 100644 index 39a889c8..00000000 --- a/src/Models/Builders/OfflinePaymentDetailsBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Offline Payment Details Builder object. - */ - public static function init(): self - { - return new self(new OfflinePaymentDetails()); - } - - /** - * Sets client created at field. - * - * @param string|null $value - */ - public function clientCreatedAt(?string $value): self - { - $this->instance->setClientCreatedAt($value); - return $this; - } - - /** - * Initializes a new Offline Payment Details object. - */ - public function build(): OfflinePaymentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderBuilder.php b/src/Models/Builders/OrderBuilder.php deleted file mode 100644 index 9d9be3c6..00000000 --- a/src/Models/Builders/OrderBuilder.php +++ /dev/null @@ -1,469 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Builder object. - * - * @param string $locationId - */ - public static function init(string $locationId): self - { - return new self(new Order($locationId)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets source field. - * - * @param OrderSource|null $value - */ - public function source(?OrderSource $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets line items field. - * - * @param OrderLineItem[]|null $value - */ - public function lineItems(?array $value): self - { - $this->instance->setLineItems($value); - return $this; - } - - /** - * Unsets line items field. - */ - public function unsetLineItems(): self - { - $this->instance->unsetLineItems(); - return $this; - } - - /** - * Sets taxes field. - * - * @param OrderLineItemTax[]|null $value - */ - public function taxes(?array $value): self - { - $this->instance->setTaxes($value); - return $this; - } - - /** - * Unsets taxes field. - */ - public function unsetTaxes(): self - { - $this->instance->unsetTaxes(); - return $this; - } - - /** - * Sets discounts field. - * - * @param OrderLineItemDiscount[]|null $value - */ - public function discounts(?array $value): self - { - $this->instance->setDiscounts($value); - return $this; - } - - /** - * Unsets discounts field. - */ - public function unsetDiscounts(): self - { - $this->instance->unsetDiscounts(); - return $this; - } - - /** - * Sets service charges field. - * - * @param OrderServiceCharge[]|null $value - */ - public function serviceCharges(?array $value): self - { - $this->instance->setServiceCharges($value); - return $this; - } - - /** - * Unsets service charges field. - */ - public function unsetServiceCharges(): self - { - $this->instance->unsetServiceCharges(); - return $this; - } - - /** - * Sets fulfillments field. - * - * @param Fulfillment[]|null $value - */ - public function fulfillments(?array $value): self - { - $this->instance->setFulfillments($value); - return $this; - } - - /** - * Unsets fulfillments field. - */ - public function unsetFulfillments(): self - { - $this->instance->unsetFulfillments(); - return $this; - } - - /** - * Sets returns field. - * - * @param OrderReturn[]|null $value - */ - public function returns(?array $value): self - { - $this->instance->setReturns($value); - return $this; - } - - /** - * Sets return amounts field. - * - * @param OrderMoneyAmounts|null $value - */ - public function returnAmounts(?OrderMoneyAmounts $value): self - { - $this->instance->setReturnAmounts($value); - return $this; - } - - /** - * Sets net amounts field. - * - * @param OrderMoneyAmounts|null $value - */ - public function netAmounts(?OrderMoneyAmounts $value): self - { - $this->instance->setNetAmounts($value); - return $this; - } - - /** - * Sets rounding adjustment field. - * - * @param OrderRoundingAdjustment|null $value - */ - public function roundingAdjustment(?OrderRoundingAdjustment $value): self - { - $this->instance->setRoundingAdjustment($value); - return $this; - } - - /** - * Sets tenders field. - * - * @param Tender[]|null $value - */ - public function tenders(?array $value): self - { - $this->instance->setTenders($value); - return $this; - } - - /** - * Sets refunds field. - * - * @param Refund[]|null $value - */ - public function refunds(?array $value): self - { - $this->instance->setRefunds($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets closed at field. - * - * @param string|null $value - */ - public function closedAt(?string $value): self - { - $this->instance->setClosedAt($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param Money|null $value - */ - public function totalTaxMoney(?Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets total discount money field. - * - * @param Money|null $value - */ - public function totalDiscountMoney(?Money $value): self - { - $this->instance->setTotalDiscountMoney($value); - return $this; - } - - /** - * Sets total tip money field. - * - * @param Money|null $value - */ - public function totalTipMoney(?Money $value): self - { - $this->instance->setTotalTipMoney($value); - return $this; - } - - /** - * Sets total service charge money field. - * - * @param Money|null $value - */ - public function totalServiceChargeMoney(?Money $value): self - { - $this->instance->setTotalServiceChargeMoney($value); - return $this; - } - - /** - * Sets ticket name field. - * - * @param string|null $value - */ - public function ticketName(?string $value): self - { - $this->instance->setTicketName($value); - return $this; - } - - /** - * Unsets ticket name field. - */ - public function unsetTicketName(): self - { - $this->instance->unsetTicketName(); - return $this; - } - - /** - * Sets pricing options field. - * - * @param OrderPricingOptions|null $value - */ - public function pricingOptions(?OrderPricingOptions $value): self - { - $this->instance->setPricingOptions($value); - return $this; - } - - /** - * Sets rewards field. - * - * @param OrderReward[]|null $value - */ - public function rewards(?array $value): self - { - $this->instance->setRewards($value); - return $this; - } - - /** - * Sets net amount due money field. - * - * @param Money|null $value - */ - public function netAmountDueMoney(?Money $value): self - { - $this->instance->setNetAmountDueMoney($value); - return $this; - } - - /** - * Initializes a new Order object. - */ - public function build(): Order - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderCreatedBuilder.php b/src/Models/Builders/OrderCreatedBuilder.php deleted file mode 100644 index f386c410..00000000 --- a/src/Models/Builders/OrderCreatedBuilder.php +++ /dev/null @@ -1,115 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Created Builder object. - */ - public static function init(): self - { - return new self(new OrderCreated()); - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Order Created object. - */ - public function build(): OrderCreated - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderCreatedObjectBuilder.php b/src/Models/Builders/OrderCreatedObjectBuilder.php deleted file mode 100644 index ffeeb773..00000000 --- a/src/Models/Builders/OrderCreatedObjectBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Created Object Builder object. - */ - public static function init(): self - { - return new self(new OrderCreatedObject()); - } - - /** - * Sets order created field. - * - * @param OrderCreated|null $value - */ - public function orderCreated(?OrderCreated $value): self - { - $this->instance->setOrderCreated($value); - return $this; - } - - /** - * Initializes a new Order Created Object object. - */ - public function build(): OrderCreatedObject - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderEntryBuilder.php b/src/Models/Builders/OrderEntryBuilder.php deleted file mode 100644 index 994d3953..00000000 --- a/src/Models/Builders/OrderEntryBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Entry Builder object. - */ - public static function init(): self - { - return new self(new OrderEntry()); - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Order Entry object. - */ - public function build(): OrderEntry - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentBuilder.php b/src/Models/Builders/OrderFulfillmentBuilder.php deleted file mode 100644 index 063274e9..00000000 --- a/src/Models/Builders/OrderFulfillmentBuilder.php +++ /dev/null @@ -1,163 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillment()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets line item application field. - * - * @param string|null $value - */ - public function lineItemApplication(?string $value): self - { - $this->instance->setLineItemApplication($value); - return $this; - } - - /** - * Sets entries field. - * - * @param OrderFulfillmentFulfillmentEntry[]|null $value - */ - public function entries(?array $value): self - { - $this->instance->setEntries($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets pickup details field. - * - * @param OrderFulfillmentPickupDetails|null $value - */ - public function pickupDetails(?OrderFulfillmentPickupDetails $value): self - { - $this->instance->setPickupDetails($value); - return $this; - } - - /** - * Sets shipment details field. - * - * @param OrderFulfillmentShipmentDetails|null $value - */ - public function shipmentDetails(?OrderFulfillmentShipmentDetails $value): self - { - $this->instance->setShipmentDetails($value); - return $this; - } - - /** - * Sets delivery details field. - * - * @param OrderFulfillmentDeliveryDetails|null $value - */ - public function deliveryDetails(?OrderFulfillmentDeliveryDetails $value): self - { - $this->instance->setDeliveryDetails($value); - return $this; - } - - /** - * Initializes a new Order Fulfillment object. - */ - public function build(): OrderFulfillment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentDeliveryDetailsBuilder.php b/src/Models/Builders/OrderFulfillmentDeliveryDetailsBuilder.php deleted file mode 100644 index 73fba4fd..00000000 --- a/src/Models/Builders/OrderFulfillmentDeliveryDetailsBuilder.php +++ /dev/null @@ -1,431 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Delivery Details Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentDeliveryDetails()); - } - - /** - * Sets recipient field. - * - * @param OrderFulfillmentRecipient|null $value - */ - public function recipient(?OrderFulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets schedule type field. - * - * @param string|null $value - */ - public function scheduleType(?string $value): self - { - $this->instance->setScheduleType($value); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets deliver at field. - * - * @param string|null $value - */ - public function deliverAt(?string $value): self - { - $this->instance->setDeliverAt($value); - return $this; - } - - /** - * Unsets deliver at field. - */ - public function unsetDeliverAt(): self - { - $this->instance->unsetDeliverAt(); - return $this; - } - - /** - * Sets prep time duration field. - * - * @param string|null $value - */ - public function prepTimeDuration(?string $value): self - { - $this->instance->setPrepTimeDuration($value); - return $this; - } - - /** - * Unsets prep time duration field. - */ - public function unsetPrepTimeDuration(): self - { - $this->instance->unsetPrepTimeDuration(); - return $this; - } - - /** - * Sets delivery window duration field. - * - * @param string|null $value - */ - public function deliveryWindowDuration(?string $value): self - { - $this->instance->setDeliveryWindowDuration($value); - return $this; - } - - /** - * Unsets delivery window duration field. - */ - public function unsetDeliveryWindowDuration(): self - { - $this->instance->unsetDeliveryWindowDuration(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets completed at field. - * - * @param string|null $value - */ - public function completedAt(?string $value): self - { - $this->instance->setCompletedAt($value); - return $this; - } - - /** - * Unsets completed at field. - */ - public function unsetCompletedAt(): self - { - $this->instance->unsetCompletedAt(); - return $this; - } - - /** - * Sets in progress at field. - * - * @param string|null $value - */ - public function inProgressAt(?string $value): self - { - $this->instance->setInProgressAt($value); - return $this; - } - - /** - * Sets rejected at field. - * - * @param string|null $value - */ - public function rejectedAt(?string $value): self - { - $this->instance->setRejectedAt($value); - return $this; - } - - /** - * Sets ready at field. - * - * @param string|null $value - */ - public function readyAt(?string $value): self - { - $this->instance->setReadyAt($value); - return $this; - } - - /** - * Sets delivered at field. - * - * @param string|null $value - */ - public function deliveredAt(?string $value): self - { - $this->instance->setDeliveredAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets courier pickup at field. - * - * @param string|null $value - */ - public function courierPickupAt(?string $value): self - { - $this->instance->setCourierPickupAt($value); - return $this; - } - - /** - * Unsets courier pickup at field. - */ - public function unsetCourierPickupAt(): self - { - $this->instance->unsetCourierPickupAt(); - return $this; - } - - /** - * Sets courier pickup window duration field. - * - * @param string|null $value - */ - public function courierPickupWindowDuration(?string $value): self - { - $this->instance->setCourierPickupWindowDuration($value); - return $this; - } - - /** - * Unsets courier pickup window duration field. - */ - public function unsetCourierPickupWindowDuration(): self - { - $this->instance->unsetCourierPickupWindowDuration(); - return $this; - } - - /** - * Sets is no contact delivery field. - * - * @param bool|null $value - */ - public function isNoContactDelivery(?bool $value): self - { - $this->instance->setIsNoContactDelivery($value); - return $this; - } - - /** - * Unsets is no contact delivery field. - */ - public function unsetIsNoContactDelivery(): self - { - $this->instance->unsetIsNoContactDelivery(); - return $this; - } - - /** - * Sets dropoff notes field. - * - * @param string|null $value - */ - public function dropoffNotes(?string $value): self - { - $this->instance->setDropoffNotes($value); - return $this; - } - - /** - * Unsets dropoff notes field. - */ - public function unsetDropoffNotes(): self - { - $this->instance->unsetDropoffNotes(); - return $this; - } - - /** - * Sets courier provider name field. - * - * @param string|null $value - */ - public function courierProviderName(?string $value): self - { - $this->instance->setCourierProviderName($value); - return $this; - } - - /** - * Unsets courier provider name field. - */ - public function unsetCourierProviderName(): self - { - $this->instance->unsetCourierProviderName(); - return $this; - } - - /** - * Sets courier support phone number field. - * - * @param string|null $value - */ - public function courierSupportPhoneNumber(?string $value): self - { - $this->instance->setCourierSupportPhoneNumber($value); - return $this; - } - - /** - * Unsets courier support phone number field. - */ - public function unsetCourierSupportPhoneNumber(): self - { - $this->instance->unsetCourierSupportPhoneNumber(); - return $this; - } - - /** - * Sets square delivery id field. - * - * @param string|null $value - */ - public function squareDeliveryId(?string $value): self - { - $this->instance->setSquareDeliveryId($value); - return $this; - } - - /** - * Unsets square delivery id field. - */ - public function unsetSquareDeliveryId(): self - { - $this->instance->unsetSquareDeliveryId(); - return $this; - } - - /** - * Sets external delivery id field. - * - * @param string|null $value - */ - public function externalDeliveryId(?string $value): self - { - $this->instance->setExternalDeliveryId($value); - return $this; - } - - /** - * Unsets external delivery id field. - */ - public function unsetExternalDeliveryId(): self - { - $this->instance->unsetExternalDeliveryId(); - return $this; - } - - /** - * Sets managed delivery field. - * - * @param bool|null $value - */ - public function managedDelivery(?bool $value): self - { - $this->instance->setManagedDelivery($value); - return $this; - } - - /** - * Unsets managed delivery field. - */ - public function unsetManagedDelivery(): self - { - $this->instance->unsetManagedDelivery(); - return $this; - } - - /** - * Initializes a new Order Fulfillment Delivery Details object. - */ - public function build(): OrderFulfillmentDeliveryDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentFulfillmentEntryBuilder.php b/src/Models/Builders/OrderFulfillmentFulfillmentEntryBuilder.php deleted file mode 100644 index 9643eceb..00000000 --- a/src/Models/Builders/OrderFulfillmentFulfillmentEntryBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Fulfillment Entry Builder object. - * - * @param string $lineItemUid - * @param string $quantity - */ - public static function init(string $lineItemUid, string $quantity): self - { - return new self(new OrderFulfillmentFulfillmentEntry($lineItemUid, $quantity)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Initializes a new Order Fulfillment Fulfillment Entry object. - */ - public function build(): OrderFulfillmentFulfillmentEntry - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentPickupDetailsBuilder.php b/src/Models/Builders/OrderFulfillmentPickupDetailsBuilder.php deleted file mode 100644 index 48b0a23d..00000000 --- a/src/Models/Builders/OrderFulfillmentPickupDetailsBuilder.php +++ /dev/null @@ -1,314 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Pickup Details Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentPickupDetails()); - } - - /** - * Sets recipient field. - * - * @param OrderFulfillmentRecipient|null $value - */ - public function recipient(?OrderFulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Unsets expires at field. - */ - public function unsetExpiresAt(): self - { - $this->instance->unsetExpiresAt(); - return $this; - } - - /** - * Sets auto complete duration field. - * - * @param string|null $value - */ - public function autoCompleteDuration(?string $value): self - { - $this->instance->setAutoCompleteDuration($value); - return $this; - } - - /** - * Unsets auto complete duration field. - */ - public function unsetAutoCompleteDuration(): self - { - $this->instance->unsetAutoCompleteDuration(); - return $this; - } - - /** - * Sets schedule type field. - * - * @param string|null $value - */ - public function scheduleType(?string $value): self - { - $this->instance->setScheduleType($value); - return $this; - } - - /** - * Sets pickup at field. - * - * @param string|null $value - */ - public function pickupAt(?string $value): self - { - $this->instance->setPickupAt($value); - return $this; - } - - /** - * Unsets pickup at field. - */ - public function unsetPickupAt(): self - { - $this->instance->unsetPickupAt(); - return $this; - } - - /** - * Sets pickup window duration field. - * - * @param string|null $value - */ - public function pickupWindowDuration(?string $value): self - { - $this->instance->setPickupWindowDuration($value); - return $this; - } - - /** - * Unsets pickup window duration field. - */ - public function unsetPickupWindowDuration(): self - { - $this->instance->unsetPickupWindowDuration(); - return $this; - } - - /** - * Sets prep time duration field. - * - * @param string|null $value - */ - public function prepTimeDuration(?string $value): self - { - $this->instance->setPrepTimeDuration($value); - return $this; - } - - /** - * Unsets prep time duration field. - */ - public function unsetPrepTimeDuration(): self - { - $this->instance->unsetPrepTimeDuration(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets accepted at field. - * - * @param string|null $value - */ - public function acceptedAt(?string $value): self - { - $this->instance->setAcceptedAt($value); - return $this; - } - - /** - * Sets rejected at field. - * - * @param string|null $value - */ - public function rejectedAt(?string $value): self - { - $this->instance->setRejectedAt($value); - return $this; - } - - /** - * Sets ready at field. - * - * @param string|null $value - */ - public function readyAt(?string $value): self - { - $this->instance->setReadyAt($value); - return $this; - } - - /** - * Sets expired at field. - * - * @param string|null $value - */ - public function expiredAt(?string $value): self - { - $this->instance->setExpiredAt($value); - return $this; - } - - /** - * Sets picked up at field. - * - * @param string|null $value - */ - public function pickedUpAt(?string $value): self - { - $this->instance->setPickedUpAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets is curbside pickup field. - * - * @param bool|null $value - */ - public function isCurbsidePickup(?bool $value): self - { - $this->instance->setIsCurbsidePickup($value); - return $this; - } - - /** - * Unsets is curbside pickup field. - */ - public function unsetIsCurbsidePickup(): self - { - $this->instance->unsetIsCurbsidePickup(); - return $this; - } - - /** - * Sets curbside pickup details field. - * - * @param OrderFulfillmentPickupDetailsCurbsidePickupDetails|null $value - */ - public function curbsidePickupDetails(?OrderFulfillmentPickupDetailsCurbsidePickupDetails $value): self - { - $this->instance->setCurbsidePickupDetails($value); - return $this; - } - - /** - * Initializes a new Order Fulfillment Pickup Details object. - */ - public function build(): OrderFulfillmentPickupDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php b/src/Models/Builders/OrderFulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php deleted file mode 100644 index d6e0dfe4..00000000 --- a/src/Models/Builders/OrderFulfillmentPickupDetailsCurbsidePickupDetailsBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Pickup Details Curbside Pickup Details Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentPickupDetailsCurbsidePickupDetails()); - } - - /** - * Sets curbside details field. - * - * @param string|null $value - */ - public function curbsideDetails(?string $value): self - { - $this->instance->setCurbsideDetails($value); - return $this; - } - - /** - * Unsets curbside details field. - */ - public function unsetCurbsideDetails(): self - { - $this->instance->unsetCurbsideDetails(); - return $this; - } - - /** - * Sets buyer arrived at field. - * - * @param string|null $value - */ - public function buyerArrivedAt(?string $value): self - { - $this->instance->setBuyerArrivedAt($value); - return $this; - } - - /** - * Unsets buyer arrived at field. - */ - public function unsetBuyerArrivedAt(): self - { - $this->instance->unsetBuyerArrivedAt(); - return $this; - } - - /** - * Initializes a new Order Fulfillment Pickup Details Curbside Pickup Details object. - */ - public function build(): OrderFulfillmentPickupDetailsCurbsidePickupDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentRecipientBuilder.php b/src/Models/Builders/OrderFulfillmentRecipientBuilder.php deleted file mode 100644 index 0e8c15e3..00000000 --- a/src/Models/Builders/OrderFulfillmentRecipientBuilder.php +++ /dev/null @@ -1,134 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Recipient Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentRecipient()); - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets display name field. - * - * @param string|null $value - */ - public function displayName(?string $value): self - { - $this->instance->setDisplayName($value); - return $this; - } - - /** - * Unsets display name field. - */ - public function unsetDisplayName(): self - { - $this->instance->unsetDisplayName(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Initializes a new Order Fulfillment Recipient object. - */ - public function build(): OrderFulfillmentRecipient - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentShipmentDetailsBuilder.php b/src/Models/Builders/OrderFulfillmentShipmentDetailsBuilder.php deleted file mode 100644 index 5684940d..00000000 --- a/src/Models/Builders/OrderFulfillmentShipmentDetailsBuilder.php +++ /dev/null @@ -1,289 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Shipment Details Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentShipmentDetails()); - } - - /** - * Sets recipient field. - * - * @param OrderFulfillmentRecipient|null $value - */ - public function recipient(?OrderFulfillmentRecipient $value): self - { - $this->instance->setRecipient($value); - return $this; - } - - /** - * Sets carrier field. - * - * @param string|null $value - */ - public function carrier(?string $value): self - { - $this->instance->setCarrier($value); - return $this; - } - - /** - * Unsets carrier field. - */ - public function unsetCarrier(): self - { - $this->instance->unsetCarrier(); - return $this; - } - - /** - * Sets shipping note field. - * - * @param string|null $value - */ - public function shippingNote(?string $value): self - { - $this->instance->setShippingNote($value); - return $this; - } - - /** - * Unsets shipping note field. - */ - public function unsetShippingNote(): self - { - $this->instance->unsetShippingNote(); - return $this; - } - - /** - * Sets shipping type field. - * - * @param string|null $value - */ - public function shippingType(?string $value): self - { - $this->instance->setShippingType($value); - return $this; - } - - /** - * Unsets shipping type field. - */ - public function unsetShippingType(): self - { - $this->instance->unsetShippingType(); - return $this; - } - - /** - * Sets tracking number field. - * - * @param string|null $value - */ - public function trackingNumber(?string $value): self - { - $this->instance->setTrackingNumber($value); - return $this; - } - - /** - * Unsets tracking number field. - */ - public function unsetTrackingNumber(): self - { - $this->instance->unsetTrackingNumber(); - return $this; - } - - /** - * Sets tracking url field. - * - * @param string|null $value - */ - public function trackingUrl(?string $value): self - { - $this->instance->setTrackingUrl($value); - return $this; - } - - /** - * Unsets tracking url field. - */ - public function unsetTrackingUrl(): self - { - $this->instance->unsetTrackingUrl(); - return $this; - } - - /** - * Sets placed at field. - * - * @param string|null $value - */ - public function placedAt(?string $value): self - { - $this->instance->setPlacedAt($value); - return $this; - } - - /** - * Sets in progress at field. - * - * @param string|null $value - */ - public function inProgressAt(?string $value): self - { - $this->instance->setInProgressAt($value); - return $this; - } - - /** - * Sets packaged at field. - * - * @param string|null $value - */ - public function packagedAt(?string $value): self - { - $this->instance->setPackagedAt($value); - return $this; - } - - /** - * Sets expected shipped at field. - * - * @param string|null $value - */ - public function expectedShippedAt(?string $value): self - { - $this->instance->setExpectedShippedAt($value); - return $this; - } - - /** - * Unsets expected shipped at field. - */ - public function unsetExpectedShippedAt(): self - { - $this->instance->unsetExpectedShippedAt(); - return $this; - } - - /** - * Sets shipped at field. - * - * @param string|null $value - */ - public function shippedAt(?string $value): self - { - $this->instance->setShippedAt($value); - return $this; - } - - /** - * Sets canceled at field. - * - * @param string|null $value - */ - public function canceledAt(?string $value): self - { - $this->instance->setCanceledAt($value); - return $this; - } - - /** - * Unsets canceled at field. - */ - public function unsetCanceledAt(): self - { - $this->instance->unsetCanceledAt(); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Unsets cancel reason field. - */ - public function unsetCancelReason(): self - { - $this->instance->unsetCancelReason(); - return $this; - } - - /** - * Sets failed at field. - * - * @param string|null $value - */ - public function failedAt(?string $value): self - { - $this->instance->setFailedAt($value); - return $this; - } - - /** - * Sets failure reason field. - * - * @param string|null $value - */ - public function failureReason(?string $value): self - { - $this->instance->setFailureReason($value); - return $this; - } - - /** - * Unsets failure reason field. - */ - public function unsetFailureReason(): self - { - $this->instance->unsetFailureReason(); - return $this; - } - - /** - * Initializes a new Order Fulfillment Shipment Details object. - */ - public function build(): OrderFulfillmentShipmentDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentUpdatedBuilder.php b/src/Models/Builders/OrderFulfillmentUpdatedBuilder.php deleted file mode 100644 index caa96d43..00000000 --- a/src/Models/Builders/OrderFulfillmentUpdatedBuilder.php +++ /dev/null @@ -1,147 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Updated Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentUpdated()); - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets fulfillment update field. - * - * @param OrderFulfillmentUpdatedUpdate[]|null $value - */ - public function fulfillmentUpdate(?array $value): self - { - $this->instance->setFulfillmentUpdate($value); - return $this; - } - - /** - * Unsets fulfillment update field. - */ - public function unsetFulfillmentUpdate(): self - { - $this->instance->unsetFulfillmentUpdate(); - return $this; - } - - /** - * Initializes a new Order Fulfillment Updated object. - */ - public function build(): OrderFulfillmentUpdated - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentUpdatedObjectBuilder.php b/src/Models/Builders/OrderFulfillmentUpdatedObjectBuilder.php deleted file mode 100644 index 78514531..00000000 --- a/src/Models/Builders/OrderFulfillmentUpdatedObjectBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Updated Object Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentUpdatedObject()); - } - - /** - * Sets order fulfillment updated field. - * - * @param OrderFulfillmentUpdated|null $value - */ - public function orderFulfillmentUpdated(?OrderFulfillmentUpdated $value): self - { - $this->instance->setOrderFulfillmentUpdated($value); - return $this; - } - - /** - * Initializes a new Order Fulfillment Updated Object object. - */ - public function build(): OrderFulfillmentUpdatedObject - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderFulfillmentUpdatedUpdateBuilder.php b/src/Models/Builders/OrderFulfillmentUpdatedUpdateBuilder.php deleted file mode 100644 index 16dfd3aa..00000000 --- a/src/Models/Builders/OrderFulfillmentUpdatedUpdateBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Fulfillment Updated Update Builder object. - */ - public static function init(): self - { - return new self(new OrderFulfillmentUpdatedUpdate()); - } - - /** - * Sets fulfillment uid field. - * - * @param string|null $value - */ - public function fulfillmentUid(?string $value): self - { - $this->instance->setFulfillmentUid($value); - return $this; - } - - /** - * Unsets fulfillment uid field. - */ - public function unsetFulfillmentUid(): self - { - $this->instance->unsetFulfillmentUid(); - return $this; - } - - /** - * Sets old state field. - * - * @param string|null $value - */ - public function oldState(?string $value): self - { - $this->instance->setOldState($value); - return $this; - } - - /** - * Sets new state field. - * - * @param string|null $value - */ - public function newState(?string $value): self - { - $this->instance->setNewState($value); - return $this; - } - - /** - * Initializes a new Order Fulfillment Updated Update object. - */ - public function build(): OrderFulfillmentUpdatedUpdate - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemAppliedDiscountBuilder.php b/src/Models/Builders/OrderLineItemAppliedDiscountBuilder.php deleted file mode 100644 index f46f06a4..00000000 --- a/src/Models/Builders/OrderLineItemAppliedDiscountBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Applied Discount Builder object. - * - * @param string $discountUid - */ - public static function init(string $discountUid): self - { - return new self(new OrderLineItemAppliedDiscount($discountUid)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Initializes a new Order Line Item Applied Discount object. - */ - public function build(): OrderLineItemAppliedDiscount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemAppliedServiceChargeBuilder.php b/src/Models/Builders/OrderLineItemAppliedServiceChargeBuilder.php deleted file mode 100644 index f839e712..00000000 --- a/src/Models/Builders/OrderLineItemAppliedServiceChargeBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Applied Service Charge Builder object. - * - * @param string $serviceChargeUid - */ - public static function init(string $serviceChargeUid): self - { - return new self(new OrderLineItemAppliedServiceCharge($serviceChargeUid)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Initializes a new Order Line Item Applied Service Charge object. - */ - public function build(): OrderLineItemAppliedServiceCharge - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemAppliedTaxBuilder.php b/src/Models/Builders/OrderLineItemAppliedTaxBuilder.php deleted file mode 100644 index 9119865a..00000000 --- a/src/Models/Builders/OrderLineItemAppliedTaxBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Applied Tax Builder object. - * - * @param string $taxUid - */ - public static function init(string $taxUid): self - { - return new self(new OrderLineItemAppliedTax($taxUid)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Initializes a new Order Line Item Applied Tax object. - */ - public function build(): OrderLineItemAppliedTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemBuilder.php b/src/Models/Builders/OrderLineItemBuilder.php deleted file mode 100644 index 2d2cd48f..00000000 --- a/src/Models/Builders/OrderLineItemBuilder.php +++ /dev/null @@ -1,381 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Builder object. - * - * @param string $quantity - */ - public static function init(string $quantity): self - { - return new self(new OrderLineItem($quantity)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets quantity unit field. - * - * @param OrderQuantityUnit|null $value - */ - public function quantityUnit(?OrderQuantityUnit $value): self - { - $this->instance->setQuantityUnit($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets variation name field. - * - * @param string|null $value - */ - public function variationName(?string $value): self - { - $this->instance->setVariationName($value); - return $this; - } - - /** - * Unsets variation name field. - */ - public function unsetVariationName(): self - { - $this->instance->unsetVariationName(); - return $this; - } - - /** - * Sets item type field. - * - * @param string|null $value - */ - public function itemType(?string $value): self - { - $this->instance->setItemType($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets modifiers field. - * - * @param OrderLineItemModifier[]|null $value - */ - public function modifiers(?array $value): self - { - $this->instance->setModifiers($value); - return $this; - } - - /** - * Unsets modifiers field. - */ - public function unsetModifiers(): self - { - $this->instance->unsetModifiers(); - return $this; - } - - /** - * Sets applied taxes field. - * - * @param OrderLineItemAppliedTax[]|null $value - */ - public function appliedTaxes(?array $value): self - { - $this->instance->setAppliedTaxes($value); - return $this; - } - - /** - * Unsets applied taxes field. - */ - public function unsetAppliedTaxes(): self - { - $this->instance->unsetAppliedTaxes(); - return $this; - } - - /** - * Sets applied discounts field. - * - * @param OrderLineItemAppliedDiscount[]|null $value - */ - public function appliedDiscounts(?array $value): self - { - $this->instance->setAppliedDiscounts($value); - return $this; - } - - /** - * Unsets applied discounts field. - */ - public function unsetAppliedDiscounts(): self - { - $this->instance->unsetAppliedDiscounts(); - return $this; - } - - /** - * Sets applied service charges field. - * - * @param OrderLineItemAppliedServiceCharge[]|null $value - */ - public function appliedServiceCharges(?array $value): self - { - $this->instance->setAppliedServiceCharges($value); - return $this; - } - - /** - * Unsets applied service charges field. - */ - public function unsetAppliedServiceCharges(): self - { - $this->instance->unsetAppliedServiceCharges(); - return $this; - } - - /** - * Sets base price money field. - * - * @param Money|null $value - */ - public function basePriceMoney(?Money $value): self - { - $this->instance->setBasePriceMoney($value); - return $this; - } - - /** - * Sets variation total price money field. - * - * @param Money|null $value - */ - public function variationTotalPriceMoney(?Money $value): self - { - $this->instance->setVariationTotalPriceMoney($value); - return $this; - } - - /** - * Sets gross sales money field. - * - * @param Money|null $value - */ - public function grossSalesMoney(?Money $value): self - { - $this->instance->setGrossSalesMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param Money|null $value - */ - public function totalTaxMoney(?Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets total discount money field. - * - * @param Money|null $value - */ - public function totalDiscountMoney(?Money $value): self - { - $this->instance->setTotalDiscountMoney($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets pricing blocklists field. - * - * @param OrderLineItemPricingBlocklists|null $value - */ - public function pricingBlocklists(?OrderLineItemPricingBlocklists $value): self - { - $this->instance->setPricingBlocklists($value); - return $this; - } - - /** - * Sets total service charge money field. - * - * @param Money|null $value - */ - public function totalServiceChargeMoney(?Money $value): self - { - $this->instance->setTotalServiceChargeMoney($value); - return $this; - } - - /** - * Initializes a new Order Line Item object. - */ - public function build(): OrderLineItem - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemDiscountBuilder.php b/src/Models/Builders/OrderLineItemDiscountBuilder.php deleted file mode 100644 index fc72db5d..00000000 --- a/src/Models/Builders/OrderLineItemDiscountBuilder.php +++ /dev/null @@ -1,229 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Discount Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemDiscount()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Sets reward ids field. - * - * @param string[]|null $value - */ - public function rewardIds(?array $value): self - { - $this->instance->setRewardIds($value); - return $this; - } - - /** - * Sets pricing rule id field. - * - * @param string|null $value - */ - public function pricingRuleId(?string $value): self - { - $this->instance->setPricingRuleId($value); - return $this; - } - - /** - * Initializes a new Order Line Item Discount object. - */ - public function build(): OrderLineItemDiscount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemModifierBuilder.php b/src/Models/Builders/OrderLineItemModifierBuilder.php deleted file mode 100644 index 0e24c73d..00000000 --- a/src/Models/Builders/OrderLineItemModifierBuilder.php +++ /dev/null @@ -1,185 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Modifier Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemModifier()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets base price money field. - * - * @param Money|null $value - */ - public function basePriceMoney(?Money $value): self - { - $this->instance->setBasePriceMoney($value); - return $this; - } - - /** - * Sets total price money field. - * - * @param Money|null $value - */ - public function totalPriceMoney(?Money $value): self - { - $this->instance->setTotalPriceMoney($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Initializes a new Order Line Item Modifier object. - */ - public function build(): OrderLineItemModifier - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedDiscountBuilder.php b/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedDiscountBuilder.php deleted file mode 100644 index 6244766f..00000000 --- a/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedDiscountBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists Blocked Discount Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemPricingBlocklistsBlockedDiscount()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets discount uid field. - * - * @param string|null $value - */ - public function discountUid(?string $value): self - { - $this->instance->setDiscountUid($value); - return $this; - } - - /** - * Unsets discount uid field. - */ - public function unsetDiscountUid(): self - { - $this->instance->unsetDiscountUid(); - return $this; - } - - /** - * Sets discount catalog object id field. - * - * @param string|null $value - */ - public function discountCatalogObjectId(?string $value): self - { - $this->instance->setDiscountCatalogObjectId($value); - return $this; - } - - /** - * Unsets discount catalog object id field. - */ - public function unsetDiscountCatalogObjectId(): self - { - $this->instance->unsetDiscountCatalogObjectId(); - return $this; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists Blocked Discount object. - */ - public function build(): OrderLineItemPricingBlocklistsBlockedDiscount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedTaxBuilder.php b/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedTaxBuilder.php deleted file mode 100644 index 5a7f2038..00000000 --- a/src/Models/Builders/OrderLineItemPricingBlocklistsBlockedTaxBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists Blocked Tax Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemPricingBlocklistsBlockedTax()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets tax uid field. - * - * @param string|null $value - */ - public function taxUid(?string $value): self - { - $this->instance->setTaxUid($value); - return $this; - } - - /** - * Unsets tax uid field. - */ - public function unsetTaxUid(): self - { - $this->instance->unsetTaxUid(); - return $this; - } - - /** - * Sets tax catalog object id field. - * - * @param string|null $value - */ - public function taxCatalogObjectId(?string $value): self - { - $this->instance->setTaxCatalogObjectId($value); - return $this; - } - - /** - * Unsets tax catalog object id field. - */ - public function unsetTaxCatalogObjectId(): self - { - $this->instance->unsetTaxCatalogObjectId(); - return $this; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists Blocked Tax object. - */ - public function build(): OrderLineItemPricingBlocklistsBlockedTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemPricingBlocklistsBuilder.php b/src/Models/Builders/OrderLineItemPricingBlocklistsBuilder.php deleted file mode 100644 index b451c64a..00000000 --- a/src/Models/Builders/OrderLineItemPricingBlocklistsBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemPricingBlocklists()); - } - - /** - * Sets blocked discounts field. - * - * @param OrderLineItemPricingBlocklistsBlockedDiscount[]|null $value - */ - public function blockedDiscounts(?array $value): self - { - $this->instance->setBlockedDiscounts($value); - return $this; - } - - /** - * Unsets blocked discounts field. - */ - public function unsetBlockedDiscounts(): self - { - $this->instance->unsetBlockedDiscounts(); - return $this; - } - - /** - * Sets blocked taxes field. - * - * @param OrderLineItemPricingBlocklistsBlockedTax[]|null $value - */ - public function blockedTaxes(?array $value): self - { - $this->instance->setBlockedTaxes($value); - return $this; - } - - /** - * Unsets blocked taxes field. - */ - public function unsetBlockedTaxes(): self - { - $this->instance->unsetBlockedTaxes(); - return $this; - } - - /** - * Initializes a new Order Line Item Pricing Blocklists object. - */ - public function build(): OrderLineItemPricingBlocklists - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderLineItemTaxBuilder.php b/src/Models/Builders/OrderLineItemTaxBuilder.php deleted file mode 100644 index 77d95b0d..00000000 --- a/src/Models/Builders/OrderLineItemTaxBuilder.php +++ /dev/null @@ -1,207 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Line Item Tax Builder object. - */ - public static function init(): self - { - return new self(new OrderLineItemTax()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Sets auto applied field. - * - * @param bool|null $value - */ - public function autoApplied(?bool $value): self - { - $this->instance->setAutoApplied($value); - return $this; - } - - /** - * Initializes a new Order Line Item Tax object. - */ - public function build(): OrderLineItemTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderMoneyAmountsBuilder.php b/src/Models/Builders/OrderMoneyAmountsBuilder.php deleted file mode 100644 index 4af4813d..00000000 --- a/src/Models/Builders/OrderMoneyAmountsBuilder.php +++ /dev/null @@ -1,98 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Money Amounts Builder object. - */ - public static function init(): self - { - return new self(new OrderMoneyAmounts()); - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets tax money field. - * - * @param Money|null $value - */ - public function taxMoney(?Money $value): self - { - $this->instance->setTaxMoney($value); - return $this; - } - - /** - * Sets discount money field. - * - * @param Money|null $value - */ - public function discountMoney(?Money $value): self - { - $this->instance->setDiscountMoney($value); - return $this; - } - - /** - * Sets tip money field. - * - * @param Money|null $value - */ - public function tipMoney(?Money $value): self - { - $this->instance->setTipMoney($value); - return $this; - } - - /** - * Sets service charge money field. - * - * @param Money|null $value - */ - public function serviceChargeMoney(?Money $value): self - { - $this->instance->setServiceChargeMoney($value); - return $this; - } - - /** - * Initializes a new Order Money Amounts object. - */ - public function build(): OrderMoneyAmounts - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderPricingOptionsBuilder.php b/src/Models/Builders/OrderPricingOptionsBuilder.php deleted file mode 100644 index e26453c4..00000000 --- a/src/Models/Builders/OrderPricingOptionsBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Pricing Options Builder object. - */ - public static function init(): self - { - return new self(new OrderPricingOptions()); - } - - /** - * Sets auto apply discounts field. - * - * @param bool|null $value - */ - public function autoApplyDiscounts(?bool $value): self - { - $this->instance->setAutoApplyDiscounts($value); - return $this; - } - - /** - * Unsets auto apply discounts field. - */ - public function unsetAutoApplyDiscounts(): self - { - $this->instance->unsetAutoApplyDiscounts(); - return $this; - } - - /** - * Sets auto apply taxes field. - * - * @param bool|null $value - */ - public function autoApplyTaxes(?bool $value): self - { - $this->instance->setAutoApplyTaxes($value); - return $this; - } - - /** - * Unsets auto apply taxes field. - */ - public function unsetAutoApplyTaxes(): self - { - $this->instance->unsetAutoApplyTaxes(); - return $this; - } - - /** - * Initializes a new Order Pricing Options object. - */ - public function build(): OrderPricingOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderQuantityUnitBuilder.php b/src/Models/Builders/OrderQuantityUnitBuilder.php deleted file mode 100644 index 83899766..00000000 --- a/src/Models/Builders/OrderQuantityUnitBuilder.php +++ /dev/null @@ -1,114 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Quantity Unit Builder object. - */ - public static function init(): self - { - return new self(new OrderQuantityUnit()); - } - - /** - * Sets measurement unit field. - * - * @param MeasurementUnit|null $value - */ - public function measurementUnit(?MeasurementUnit $value): self - { - $this->instance->setMeasurementUnit($value); - return $this; - } - - /** - * Sets precision field. - * - * @param int|null $value - */ - public function precision(?int $value): self - { - $this->instance->setPrecision($value); - return $this; - } - - /** - * Unsets precision field. - */ - public function unsetPrecision(): self - { - $this->instance->unsetPrecision(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Initializes a new Order Quantity Unit object. - */ - public function build(): OrderQuantityUnit - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnBuilder.php b/src/Models/Builders/OrderReturnBuilder.php deleted file mode 100644 index f014df58..00000000 --- a/src/Models/Builders/OrderReturnBuilder.php +++ /dev/null @@ -1,193 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Builder object. - */ - public static function init(): self - { - return new self(new OrderReturn()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source order id field. - * - * @param string|null $value - */ - public function sourceOrderId(?string $value): self - { - $this->instance->setSourceOrderId($value); - return $this; - } - - /** - * Unsets source order id field. - */ - public function unsetSourceOrderId(): self - { - $this->instance->unsetSourceOrderId(); - return $this; - } - - /** - * Sets return line items field. - * - * @param OrderReturnLineItem[]|null $value - */ - public function returnLineItems(?array $value): self - { - $this->instance->setReturnLineItems($value); - return $this; - } - - /** - * Unsets return line items field. - */ - public function unsetReturnLineItems(): self - { - $this->instance->unsetReturnLineItems(); - return $this; - } - - /** - * Sets return service charges field. - * - * @param OrderReturnServiceCharge[]|null $value - */ - public function returnServiceCharges(?array $value): self - { - $this->instance->setReturnServiceCharges($value); - return $this; - } - - /** - * Unsets return service charges field. - */ - public function unsetReturnServiceCharges(): self - { - $this->instance->unsetReturnServiceCharges(); - return $this; - } - - /** - * Sets return taxes field. - * - * @param OrderReturnTax[]|null $value - */ - public function returnTaxes(?array $value): self - { - $this->instance->setReturnTaxes($value); - return $this; - } - - /** - * Sets return discounts field. - * - * @param OrderReturnDiscount[]|null $value - */ - public function returnDiscounts(?array $value): self - { - $this->instance->setReturnDiscounts($value); - return $this; - } - - /** - * Sets return tips field. - * - * @param OrderReturnTip[]|null $value - */ - public function returnTips(?array $value): self - { - $this->instance->setReturnTips($value); - return $this; - } - - /** - * Unsets return tips field. - */ - public function unsetReturnTips(): self - { - $this->instance->unsetReturnTips(); - return $this; - } - - /** - * Sets rounding adjustment field. - * - * @param OrderRoundingAdjustment|null $value - */ - public function roundingAdjustment(?OrderRoundingAdjustment $value): self - { - $this->instance->setRoundingAdjustment($value); - return $this; - } - - /** - * Sets return amounts field. - * - * @param OrderMoneyAmounts|null $value - */ - public function returnAmounts(?OrderMoneyAmounts $value): self - { - $this->instance->setReturnAmounts($value); - return $this; - } - - /** - * Initializes a new Order Return object. - */ - public function build(): OrderReturn - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnDiscountBuilder.php b/src/Models/Builders/OrderReturnDiscountBuilder.php deleted file mode 100644 index 8775dd18..00000000 --- a/src/Models/Builders/OrderReturnDiscountBuilder.php +++ /dev/null @@ -1,207 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Discount Builder object. - */ - public static function init(): self - { - return new self(new OrderReturnDiscount()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source discount uid field. - * - * @param string|null $value - */ - public function sourceDiscountUid(?string $value): self - { - $this->instance->setSourceDiscountUid($value); - return $this; - } - - /** - * Unsets source discount uid field. - */ - public function unsetSourceDiscountUid(): self - { - $this->instance->unsetSourceDiscountUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Initializes a new Order Return Discount object. - */ - public function build(): OrderReturnDiscount - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnLineItemBuilder.php b/src/Models/Builders/OrderReturnLineItemBuilder.php deleted file mode 100644 index 85c62f12..00000000 --- a/src/Models/Builders/OrderReturnLineItemBuilder.php +++ /dev/null @@ -1,369 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Line Item Builder object. - * - * @param string $quantity - */ - public static function init(string $quantity): self - { - return new self(new OrderReturnLineItem($quantity)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source line item uid field. - * - * @param string|null $value - */ - public function sourceLineItemUid(?string $value): self - { - $this->instance->setSourceLineItemUid($value); - return $this; - } - - /** - * Unsets source line item uid field. - */ - public function unsetSourceLineItemUid(): self - { - $this->instance->unsetSourceLineItemUid(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets quantity unit field. - * - * @param OrderQuantityUnit|null $value - */ - public function quantityUnit(?OrderQuantityUnit $value): self - { - $this->instance->setQuantityUnit($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets variation name field. - * - * @param string|null $value - */ - public function variationName(?string $value): self - { - $this->instance->setVariationName($value); - return $this; - } - - /** - * Unsets variation name field. - */ - public function unsetVariationName(): self - { - $this->instance->unsetVariationName(); - return $this; - } - - /** - * Sets item type field. - * - * @param string|null $value - */ - public function itemType(?string $value): self - { - $this->instance->setItemType($value); - return $this; - } - - /** - * Sets return modifiers field. - * - * @param OrderReturnLineItemModifier[]|null $value - */ - public function returnModifiers(?array $value): self - { - $this->instance->setReturnModifiers($value); - return $this; - } - - /** - * Unsets return modifiers field. - */ - public function unsetReturnModifiers(): self - { - $this->instance->unsetReturnModifiers(); - return $this; - } - - /** - * Sets applied taxes field. - * - * @param OrderLineItemAppliedTax[]|null $value - */ - public function appliedTaxes(?array $value): self - { - $this->instance->setAppliedTaxes($value); - return $this; - } - - /** - * Unsets applied taxes field. - */ - public function unsetAppliedTaxes(): self - { - $this->instance->unsetAppliedTaxes(); - return $this; - } - - /** - * Sets applied discounts field. - * - * @param OrderLineItemAppliedDiscount[]|null $value - */ - public function appliedDiscounts(?array $value): self - { - $this->instance->setAppliedDiscounts($value); - return $this; - } - - /** - * Unsets applied discounts field. - */ - public function unsetAppliedDiscounts(): self - { - $this->instance->unsetAppliedDiscounts(); - return $this; - } - - /** - * Sets base price money field. - * - * @param Money|null $value - */ - public function basePriceMoney(?Money $value): self - { - $this->instance->setBasePriceMoney($value); - return $this; - } - - /** - * Sets variation total price money field. - * - * @param Money|null $value - */ - public function variationTotalPriceMoney(?Money $value): self - { - $this->instance->setVariationTotalPriceMoney($value); - return $this; - } - - /** - * Sets gross return money field. - * - * @param Money|null $value - */ - public function grossReturnMoney(?Money $value): self - { - $this->instance->setGrossReturnMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param Money|null $value - */ - public function totalTaxMoney(?Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets total discount money field. - * - * @param Money|null $value - */ - public function totalDiscountMoney(?Money $value): self - { - $this->instance->setTotalDiscountMoney($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets applied service charges field. - * - * @param OrderLineItemAppliedServiceCharge[]|null $value - */ - public function appliedServiceCharges(?array $value): self - { - $this->instance->setAppliedServiceCharges($value); - return $this; - } - - /** - * Unsets applied service charges field. - */ - public function unsetAppliedServiceCharges(): self - { - $this->instance->unsetAppliedServiceCharges(); - return $this; - } - - /** - * Sets total service charge money field. - * - * @param Money|null $value - */ - public function totalServiceChargeMoney(?Money $value): self - { - $this->instance->setTotalServiceChargeMoney($value); - return $this; - } - - /** - * Initializes a new Order Return Line Item object. - */ - public function build(): OrderReturnLineItem - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnLineItemModifierBuilder.php b/src/Models/Builders/OrderReturnLineItemModifierBuilder.php deleted file mode 100644 index 98966c66..00000000 --- a/src/Models/Builders/OrderReturnLineItemModifierBuilder.php +++ /dev/null @@ -1,185 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Line Item Modifier Builder object. - */ - public static function init(): self - { - return new self(new OrderReturnLineItemModifier()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source modifier uid field. - * - * @param string|null $value - */ - public function sourceModifierUid(?string $value): self - { - $this->instance->setSourceModifierUid($value); - return $this; - } - - /** - * Unsets source modifier uid field. - */ - public function unsetSourceModifierUid(): self - { - $this->instance->unsetSourceModifierUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets base price money field. - * - * @param Money|null $value - */ - public function basePriceMoney(?Money $value): self - { - $this->instance->setBasePriceMoney($value); - return $this; - } - - /** - * Sets total price money field. - * - * @param Money|null $value - */ - public function totalPriceMoney(?Money $value): self - { - $this->instance->setTotalPriceMoney($value); - return $this; - } - - /** - * Sets quantity field. - * - * @param string|null $value - */ - public function quantity(?string $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Initializes a new Order Return Line Item Modifier object. - */ - public function build(): OrderReturnLineItemModifier - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnServiceChargeBuilder.php b/src/Models/Builders/OrderReturnServiceChargeBuilder.php deleted file mode 100644 index 9a4fd679..00000000 --- a/src/Models/Builders/OrderReturnServiceChargeBuilder.php +++ /dev/null @@ -1,281 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Service Charge Builder object. - */ - public static function init(): self - { - return new self(new OrderReturnServiceCharge()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source service charge uid field. - * - * @param string|null $value - */ - public function sourceServiceChargeUid(?string $value): self - { - $this->instance->setSourceServiceChargeUid($value); - return $this; - } - - /** - * Unsets source service charge uid field. - */ - public function unsetSourceServiceChargeUid(): self - { - $this->instance->unsetSourceServiceChargeUid(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param Money|null $value - */ - public function totalTaxMoney(?Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets calculation phase field. - * - * @param string|null $value - */ - public function calculationPhase(?string $value): self - { - $this->instance->setCalculationPhase($value); - return $this; - } - - /** - * Sets taxable field. - * - * @param bool|null $value - */ - public function taxable(?bool $value): self - { - $this->instance->setTaxable($value); - return $this; - } - - /** - * Unsets taxable field. - */ - public function unsetTaxable(): self - { - $this->instance->unsetTaxable(); - return $this; - } - - /** - * Sets applied taxes field. - * - * @param OrderLineItemAppliedTax[]|null $value - */ - public function appliedTaxes(?array $value): self - { - $this->instance->setAppliedTaxes($value); - return $this; - } - - /** - * Unsets applied taxes field. - */ - public function unsetAppliedTaxes(): self - { - $this->instance->unsetAppliedTaxes(); - return $this; - } - - /** - * Sets treatment type field. - * - * @param string|null $value - */ - public function treatmentType(?string $value): self - { - $this->instance->setTreatmentType($value); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Initializes a new Order Return Service Charge object. - */ - public function build(): OrderReturnServiceCharge - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnTaxBuilder.php b/src/Models/Builders/OrderReturnTaxBuilder.php deleted file mode 100644 index 84f21b64..00000000 --- a/src/Models/Builders/OrderReturnTaxBuilder.php +++ /dev/null @@ -1,196 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Tax Builder object. - */ - public static function init(): self - { - return new self(new OrderReturnTax()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets source tax uid field. - * - * @param string|null $value - */ - public function sourceTaxUid(?string $value): self - { - $this->instance->setSourceTaxUid($value); - return $this; - } - - /** - * Unsets source tax uid field. - */ - public function unsetSourceTaxUid(): self - { - $this->instance->unsetSourceTaxUid(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Initializes a new Order Return Tax object. - */ - public function build(): OrderReturnTax - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderReturnTipBuilder.php b/src/Models/Builders/OrderReturnTipBuilder.php deleted file mode 100644 index 3d49ea1c..00000000 --- a/src/Models/Builders/OrderReturnTipBuilder.php +++ /dev/null @@ -1,114 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Return Tip Builder object. - */ - public static function init(): self - { - return new self(new OrderReturnTip()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets source tender uid field. - * - * @param string|null $value - */ - public function sourceTenderUid(?string $value): self - { - $this->instance->setSourceTenderUid($value); - return $this; - } - - /** - * Unsets source tender uid field. - */ - public function unsetSourceTenderUid(): self - { - $this->instance->unsetSourceTenderUid(); - return $this; - } - - /** - * Sets source tender id field. - * - * @param string|null $value - */ - public function sourceTenderId(?string $value): self - { - $this->instance->setSourceTenderId($value); - return $this; - } - - /** - * Unsets source tender id field. - */ - public function unsetSourceTenderId(): self - { - $this->instance->unsetSourceTenderId(); - return $this; - } - - /** - * Initializes a new Order Return Tip object. - */ - public function build(): OrderReturnTip - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderRewardBuilder.php b/src/Models/Builders/OrderRewardBuilder.php deleted file mode 100644 index fa667abd..00000000 --- a/src/Models/Builders/OrderRewardBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Reward Builder object. - * - * @param string $id - * @param string $rewardTierId - */ - public static function init(string $id, string $rewardTierId): self - { - return new self(new OrderReward($id, $rewardTierId)); - } - - /** - * Initializes a new Order Reward object. - */ - public function build(): OrderReward - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderRoundingAdjustmentBuilder.php b/src/Models/Builders/OrderRoundingAdjustmentBuilder.php deleted file mode 100644 index f025d3db..00000000 --- a/src/Models/Builders/OrderRoundingAdjustmentBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Rounding Adjustment Builder object. - */ - public static function init(): self - { - return new self(new OrderRoundingAdjustment()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Initializes a new Order Rounding Adjustment object. - */ - public function build(): OrderRoundingAdjustment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderServiceChargeBuilder.php b/src/Models/Builders/OrderServiceChargeBuilder.php deleted file mode 100644 index e463500d..00000000 --- a/src/Models/Builders/OrderServiceChargeBuilder.php +++ /dev/null @@ -1,292 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Service Charge Builder object. - */ - public static function init(): self - { - return new self(new OrderServiceCharge()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets catalog object id field. - * - * @param string|null $value - */ - public function catalogObjectId(?string $value): self - { - $this->instance->setCatalogObjectId($value); - return $this; - } - - /** - * Unsets catalog object id field. - */ - public function unsetCatalogObjectId(): self - { - $this->instance->unsetCatalogObjectId(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets percentage field. - * - * @param string|null $value - */ - public function percentage(?string $value): self - { - $this->instance->setPercentage($value); - return $this; - } - - /** - * Unsets percentage field. - */ - public function unsetPercentage(): self - { - $this->instance->unsetPercentage(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets applied money field. - * - * @param Money|null $value - */ - public function appliedMoney(?Money $value): self - { - $this->instance->setAppliedMoney($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param Money|null $value - */ - public function totalTaxMoney(?Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets calculation phase field. - * - * @param string|null $value - */ - public function calculationPhase(?string $value): self - { - $this->instance->setCalculationPhase($value); - return $this; - } - - /** - * Sets taxable field. - * - * @param bool|null $value - */ - public function taxable(?bool $value): self - { - $this->instance->setTaxable($value); - return $this; - } - - /** - * Unsets taxable field. - */ - public function unsetTaxable(): self - { - $this->instance->unsetTaxable(); - return $this; - } - - /** - * Sets applied taxes field. - * - * @param OrderLineItemAppliedTax[]|null $value - */ - public function appliedTaxes(?array $value): self - { - $this->instance->setAppliedTaxes($value); - return $this; - } - - /** - * Unsets applied taxes field. - */ - public function unsetAppliedTaxes(): self - { - $this->instance->unsetAppliedTaxes(); - return $this; - } - - /** - * Sets metadata field. - * - * @param array|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Unsets metadata field. - */ - public function unsetMetadata(): self - { - $this->instance->unsetMetadata(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets treatment type field. - * - * @param string|null $value - */ - public function treatmentType(?string $value): self - { - $this->instance->setTreatmentType($value); - return $this; - } - - /** - * Sets scope field. - * - * @param string|null $value - */ - public function scope(?string $value): self - { - $this->instance->setScope($value); - return $this; - } - - /** - * Initializes a new Order Service Charge object. - */ - public function build(): OrderServiceCharge - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderSourceBuilder.php b/src/Models/Builders/OrderSourceBuilder.php deleted file mode 100644 index d5c9e312..00000000 --- a/src/Models/Builders/OrderSourceBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Source Builder object. - */ - public static function init(): self - { - return new self(new OrderSource()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new Order Source object. - */ - public function build(): OrderSource - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderUpdatedBuilder.php b/src/Models/Builders/OrderUpdatedBuilder.php deleted file mode 100644 index 82526f6c..00000000 --- a/src/Models/Builders/OrderUpdatedBuilder.php +++ /dev/null @@ -1,126 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Updated Builder object. - */ - public static function init(): self - { - return new self(new OrderUpdated()); - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Order Updated object. - */ - public function build(): OrderUpdated - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/OrderUpdatedObjectBuilder.php b/src/Models/Builders/OrderUpdatedObjectBuilder.php deleted file mode 100644 index 0ab3ac3e..00000000 --- a/src/Models/Builders/OrderUpdatedObjectBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Order Updated Object Builder object. - */ - public static function init(): self - { - return new self(new OrderUpdatedObject()); - } - - /** - * Sets order updated field. - * - * @param OrderUpdated|null $value - */ - public function orderUpdated(?OrderUpdated $value): self - { - $this->instance->setOrderUpdated($value); - return $this; - } - - /** - * Initializes a new Order Updated Object object. - */ - public function build(): OrderUpdatedObject - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaginationCursorBuilder.php b/src/Models/Builders/PaginationCursorBuilder.php deleted file mode 100644 index c4215e78..00000000 --- a/src/Models/Builders/PaginationCursorBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pagination Cursor Builder object. - */ - public static function init(): self - { - return new self(new PaginationCursor()); - } - - /** - * Sets order value field. - * - * @param string|null $value - */ - public function orderValue(?string $value): self - { - $this->instance->setOrderValue($value); - return $this; - } - - /** - * Unsets order value field. - */ - public function unsetOrderValue(): self - { - $this->instance->unsetOrderValue(); - return $this; - } - - /** - * Initializes a new Pagination Cursor object. - */ - public function build(): PaginationCursor - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PauseSubscriptionRequestBuilder.php b/src/Models/Builders/PauseSubscriptionRequestBuilder.php deleted file mode 100644 index 83575302..00000000 --- a/src/Models/Builders/PauseSubscriptionRequestBuilder.php +++ /dev/null @@ -1,133 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pause Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new PauseSubscriptionRequest()); - } - - /** - * Sets pause effective date field. - * - * @param string|null $value - */ - public function pauseEffectiveDate(?string $value): self - { - $this->instance->setPauseEffectiveDate($value); - return $this; - } - - /** - * Unsets pause effective date field. - */ - public function unsetPauseEffectiveDate(): self - { - $this->instance->unsetPauseEffectiveDate(); - return $this; - } - - /** - * Sets pause cycle duration field. - * - * @param int|null $value - */ - public function pauseCycleDuration(?int $value): self - { - $this->instance->setPauseCycleDuration($value); - return $this; - } - - /** - * Unsets pause cycle duration field. - */ - public function unsetPauseCycleDuration(): self - { - $this->instance->unsetPauseCycleDuration(); - return $this; - } - - /** - * Sets resume effective date field. - * - * @param string|null $value - */ - public function resumeEffectiveDate(?string $value): self - { - $this->instance->setResumeEffectiveDate($value); - return $this; - } - - /** - * Unsets resume effective date field. - */ - public function unsetResumeEffectiveDate(): self - { - $this->instance->unsetResumeEffectiveDate(); - return $this; - } - - /** - * Sets resume change timing field. - * - * @param string|null $value - */ - public function resumeChangeTiming(?string $value): self - { - $this->instance->setResumeChangeTiming($value); - return $this; - } - - /** - * Sets pause reason field. - * - * @param string|null $value - */ - public function pauseReason(?string $value): self - { - $this->instance->setPauseReason($value); - return $this; - } - - /** - * Unsets pause reason field. - */ - public function unsetPauseReason(): self - { - $this->instance->unsetPauseReason(); - return $this; - } - - /** - * Initializes a new Pause Subscription Request object. - */ - public function build(): PauseSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PauseSubscriptionResponseBuilder.php b/src/Models/Builders/PauseSubscriptionResponseBuilder.php deleted file mode 100644 index 0be6bbb1..00000000 --- a/src/Models/Builders/PauseSubscriptionResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pause Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new PauseSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Initializes a new Pause Subscription Response object. - */ - public function build(): PauseSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PayOrderRequestBuilder.php b/src/Models/Builders/PayOrderRequestBuilder.php deleted file mode 100644 index d8ee3de8..00000000 --- a/src/Models/Builders/PayOrderRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pay Order Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new PayOrderRequest($idempotencyKey)); - } - - /** - * Sets order version field. - * - * @param int|null $value - */ - public function orderVersion(?int $value): self - { - $this->instance->setOrderVersion($value); - return $this; - } - - /** - * Unsets order version field. - */ - public function unsetOrderVersion(): self - { - $this->instance->unsetOrderVersion(); - return $this; - } - - /** - * Sets payment ids field. - * - * @param string[]|null $value - */ - public function paymentIds(?array $value): self - { - $this->instance->setPaymentIds($value); - return $this; - } - - /** - * Unsets payment ids field. - */ - public function unsetPaymentIds(): self - { - $this->instance->unsetPaymentIds(); - return $this; - } - - /** - * Initializes a new Pay Order Request object. - */ - public function build(): PayOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PayOrderResponseBuilder.php b/src/Models/Builders/PayOrderResponseBuilder.php deleted file mode 100644 index 9fe4ac30..00000000 --- a/src/Models/Builders/PayOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pay Order Response Builder object. - */ - public static function init(): self - { - return new self(new PayOrderResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Pay Order Response object. - */ - public function build(): PayOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityAppFeeRefundDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityAppFeeRefundDetailBuilder.php deleted file mode 100644 index 9aec21c5..00000000 --- a/src/Models/Builders/PaymentBalanceActivityAppFeeRefundDetailBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity App Fee Refund Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityAppFeeRefundDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets refund id field. - * - * @param string|null $value - */ - public function refundId(?string $value): self - { - $this->instance->setRefundId($value); - return $this; - } - - /** - * Unsets refund id field. - */ - public function unsetRefundId(): self - { - $this->instance->unsetRefundId(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity App Fee Refund Detail object. - */ - public function build(): PaymentBalanceActivityAppFeeRefundDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityAppFeeRevenueDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityAppFeeRevenueDetailBuilder.php deleted file mode 100644 index 4e3f42a8..00000000 --- a/src/Models/Builders/PaymentBalanceActivityAppFeeRevenueDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity App Fee Revenue Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityAppFeeRevenueDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity App Fee Revenue Detail object. - */ - public function build(): PaymentBalanceActivityAppFeeRevenueDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsDetailBuilder.php deleted file mode 100644 index a79fd557..00000000 --- a/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Automatic Savings Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityAutomaticSavingsDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets payout id field. - * - * @param string|null $value - */ - public function payoutId(?string $value): self - { - $this->instance->setPayoutId($value); - return $this; - } - - /** - * Unsets payout id field. - */ - public function unsetPayoutId(): self - { - $this->instance->unsetPayoutId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Automatic Savings Detail object. - */ - public function build(): PaymentBalanceActivityAutomaticSavingsDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsReversedDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsReversedDetailBuilder.php deleted file mode 100644 index 51b771f1..00000000 --- a/src/Models/Builders/PaymentBalanceActivityAutomaticSavingsReversedDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Automatic Savings Reversed Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityAutomaticSavingsReversedDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets payout id field. - * - * @param string|null $value - */ - public function payoutId(?string $value): self - { - $this->instance->setPayoutId($value); - return $this; - } - - /** - * Unsets payout id field. - */ - public function unsetPayoutId(): self - { - $this->instance->unsetPayoutId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Automatic Savings Reversed Detail object. - */ - public function build(): PaymentBalanceActivityAutomaticSavingsReversedDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityChargeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityChargeDetailBuilder.php deleted file mode 100644 index 641c601e..00000000 --- a/src/Models/Builders/PaymentBalanceActivityChargeDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Charge Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityChargeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Charge Detail object. - */ - public function build(): PaymentBalanceActivityChargeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityDepositFeeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityDepositFeeDetailBuilder.php deleted file mode 100644 index e5d3545c..00000000 --- a/src/Models/Builders/PaymentBalanceActivityDepositFeeDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Deposit Fee Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityDepositFeeDetail()); - } - - /** - * Sets payout id field. - * - * @param string|null $value - */ - public function payoutId(?string $value): self - { - $this->instance->setPayoutId($value); - return $this; - } - - /** - * Unsets payout id field. - */ - public function unsetPayoutId(): self - { - $this->instance->unsetPayoutId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Deposit Fee Detail object. - */ - public function build(): PaymentBalanceActivityDepositFeeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityDepositFeeReversedDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityDepositFeeReversedDetailBuilder.php deleted file mode 100644 index 1568addf..00000000 --- a/src/Models/Builders/PaymentBalanceActivityDepositFeeReversedDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Deposit Fee Reversed Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityDepositFeeReversedDetail()); - } - - /** - * Sets payout id field. - * - * @param string|null $value - */ - public function payoutId(?string $value): self - { - $this->instance->setPayoutId($value); - return $this; - } - - /** - * Unsets payout id field. - */ - public function unsetPayoutId(): self - { - $this->instance->unsetPayoutId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Deposit Fee Reversed Detail object. - */ - public function build(): PaymentBalanceActivityDepositFeeReversedDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityDisputeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityDisputeDetailBuilder.php deleted file mode 100644 index 34b6ef00..00000000 --- a/src/Models/Builders/PaymentBalanceActivityDisputeDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Dispute Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityDisputeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets dispute id field. - * - * @param string|null $value - */ - public function disputeId(?string $value): self - { - $this->instance->setDisputeId($value); - return $this; - } - - /** - * Unsets dispute id field. - */ - public function unsetDisputeId(): self - { - $this->instance->unsetDisputeId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Dispute Detail object. - */ - public function build(): PaymentBalanceActivityDisputeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityFeeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityFeeDetailBuilder.php deleted file mode 100644 index 90e81b9b..00000000 --- a/src/Models/Builders/PaymentBalanceActivityFeeDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Fee Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityFeeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Fee Detail object. - */ - public function build(): PaymentBalanceActivityFeeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityFreeProcessingDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityFreeProcessingDetailBuilder.php deleted file mode 100644 index f44a2d8c..00000000 --- a/src/Models/Builders/PaymentBalanceActivityFreeProcessingDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Free Processing Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityFreeProcessingDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Free Processing Detail object. - */ - public function build(): PaymentBalanceActivityFreeProcessingDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityHoldAdjustmentDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityHoldAdjustmentDetailBuilder.php deleted file mode 100644 index 07e40f27..00000000 --- a/src/Models/Builders/PaymentBalanceActivityHoldAdjustmentDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Hold Adjustment Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityHoldAdjustmentDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Hold Adjustment Detail object. - */ - public function build(): PaymentBalanceActivityHoldAdjustmentDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityOpenDisputeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityOpenDisputeDetailBuilder.php deleted file mode 100644 index f75c13e3..00000000 --- a/src/Models/Builders/PaymentBalanceActivityOpenDisputeDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Open Dispute Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityOpenDisputeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets dispute id field. - * - * @param string|null $value - */ - public function disputeId(?string $value): self - { - $this->instance->setDisputeId($value); - return $this; - } - - /** - * Unsets dispute id field. - */ - public function unsetDisputeId(): self - { - $this->instance->unsetDisputeId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Open Dispute Detail object. - */ - public function build(): PaymentBalanceActivityOpenDisputeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityOtherAdjustmentDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityOtherAdjustmentDetailBuilder.php deleted file mode 100644 index ea178244..00000000 --- a/src/Models/Builders/PaymentBalanceActivityOtherAdjustmentDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Other Adjustment Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityOtherAdjustmentDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Other Adjustment Detail object. - */ - public function build(): PaymentBalanceActivityOtherAdjustmentDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityOtherDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityOtherDetailBuilder.php deleted file mode 100644 index 90f8963e..00000000 --- a/src/Models/Builders/PaymentBalanceActivityOtherDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Other Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityOtherDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Other Detail object. - */ - public function build(): PaymentBalanceActivityOtherDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityRefundDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityRefundDetailBuilder.php deleted file mode 100644 index a0850959..00000000 --- a/src/Models/Builders/PaymentBalanceActivityRefundDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Refund Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityRefundDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets refund id field. - * - * @param string|null $value - */ - public function refundId(?string $value): self - { - $this->instance->setRefundId($value); - return $this; - } - - /** - * Unsets refund id field. - */ - public function unsetRefundId(): self - { - $this->instance->unsetRefundId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Refund Detail object. - */ - public function build(): PaymentBalanceActivityRefundDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityReleaseAdjustmentDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityReleaseAdjustmentDetailBuilder.php deleted file mode 100644 index 6d0321bc..00000000 --- a/src/Models/Builders/PaymentBalanceActivityReleaseAdjustmentDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Release Adjustment Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityReleaseAdjustmentDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Release Adjustment Detail object. - */ - public function build(): PaymentBalanceActivityReleaseAdjustmentDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityReserveHoldDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityReserveHoldDetailBuilder.php deleted file mode 100644 index 13159ea1..00000000 --- a/src/Models/Builders/PaymentBalanceActivityReserveHoldDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Reserve Hold Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityReserveHoldDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Reserve Hold Detail object. - */ - public function build(): PaymentBalanceActivityReserveHoldDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityReserveReleaseDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityReserveReleaseDetailBuilder.php deleted file mode 100644 index 045c46e2..00000000 --- a/src/Models/Builders/PaymentBalanceActivityReserveReleaseDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Reserve Release Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityReserveReleaseDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Reserve Release Detail object. - */ - public function build(): PaymentBalanceActivityReserveReleaseDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivitySquareCapitalPaymentDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivitySquareCapitalPaymentDetailBuilder.php deleted file mode 100644 index 2719d995..00000000 --- a/src/Models/Builders/PaymentBalanceActivitySquareCapitalPaymentDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Square Capital Payment Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivitySquareCapitalPaymentDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Square Capital Payment Detail object. - */ - public function build(): PaymentBalanceActivitySquareCapitalPaymentDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivitySquareCapitalReversedPaymentDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivitySquareCapitalReversedPaymentDetailBuilder.php deleted file mode 100644 index 582e95a7..00000000 --- a/src/Models/Builders/PaymentBalanceActivitySquareCapitalReversedPaymentDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Square Capital Reversed Payment Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivitySquareCapitalReversedPaymentDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Square Capital Reversed Payment Detail object. - */ - public function build(): PaymentBalanceActivitySquareCapitalReversedPaymentDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferDetailBuilder.php deleted file mode 100644 index 77b91355..00000000 --- a/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Square Payroll Transfer Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivitySquarePayrollTransferDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Square Payroll Transfer Detail object. - */ - public function build(): PaymentBalanceActivitySquarePayrollTransferDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferReversedDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferReversedDetailBuilder.php deleted file mode 100644 index 31a39b6d..00000000 --- a/src/Models/Builders/PaymentBalanceActivitySquarePayrollTransferReversedDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Square Payroll Transfer Reversed Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivitySquarePayrollTransferReversedDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Square Payroll Transfer Reversed Detail object. - */ - public function build(): PaymentBalanceActivitySquarePayrollTransferReversedDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityTaxOnFeeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityTaxOnFeeDetailBuilder.php deleted file mode 100644 index c0b30e59..00000000 --- a/src/Models/Builders/PaymentBalanceActivityTaxOnFeeDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Tax On Fee Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityTaxOnFeeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets tax rate description field. - * - * @param string|null $value - */ - public function taxRateDescription(?string $value): self - { - $this->instance->setTaxRateDescription($value); - return $this; - } - - /** - * Unsets tax rate description field. - */ - public function unsetTaxRateDescription(): self - { - $this->instance->unsetTaxRateDescription(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Tax On Fee Detail object. - */ - public function build(): PaymentBalanceActivityTaxOnFeeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeDetailBuilder.php deleted file mode 100644 index 16d9eaac..00000000 --- a/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeDetailBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Third Party Fee Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityThirdPartyFeeDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Third Party Fee Detail object. - */ - public function build(): PaymentBalanceActivityThirdPartyFeeDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeRefundDetailBuilder.php b/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeRefundDetailBuilder.php deleted file mode 100644 index ecb16a8d..00000000 --- a/src/Models/Builders/PaymentBalanceActivityThirdPartyFeeRefundDetailBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Balance Activity Third Party Fee Refund Detail Builder object. - */ - public static function init(): self - { - return new self(new PaymentBalanceActivityThirdPartyFeeRefundDetail()); - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets refund id field. - * - * @param string|null $value - */ - public function refundId(?string $value): self - { - $this->instance->setRefundId($value); - return $this; - } - - /** - * Unsets refund id field. - */ - public function unsetRefundId(): self - { - $this->instance->unsetRefundId(); - return $this; - } - - /** - * Initializes a new Payment Balance Activity Third Party Fee Refund Detail object. - */ - public function build(): PaymentBalanceActivityThirdPartyFeeRefundDetail - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentBuilder.php b/src/Models/Builders/PaymentBuilder.php deleted file mode 100644 index 62c71425..00000000 --- a/src/Models/Builders/PaymentBuilder.php +++ /dev/null @@ -1,567 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Builder object. - */ - public static function init(): self - { - return new self(new Payment()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets tip money field. - * - * @param Money|null $value - */ - public function tipMoney(?Money $value): self - { - $this->instance->setTipMoney($value); - return $this; - } - - /** - * Sets total money field. - * - * @param Money|null $value - */ - public function totalMoney(?Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets approved money field. - * - * @param Money|null $value - */ - public function approvedMoney(?Money $value): self - { - $this->instance->setApprovedMoney($value); - return $this; - } - - /** - * Sets processing fee field. - * - * @param ProcessingFee[]|null $value - */ - public function processingFee(?array $value): self - { - $this->instance->setProcessingFee($value); - return $this; - } - - /** - * Sets refunded money field. - * - * @param Money|null $value - */ - public function refundedMoney(?Money $value): self - { - $this->instance->setRefundedMoney($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets delay duration field. - * - * @param string|null $value - */ - public function delayDuration(?string $value): self - { - $this->instance->setDelayDuration($value); - return $this; - } - - /** - * Sets delay action field. - * - * @param string|null $value - */ - public function delayAction(?string $value): self - { - $this->instance->setDelayAction($value); - return $this; - } - - /** - * Unsets delay action field. - */ - public function unsetDelayAction(): self - { - $this->instance->unsetDelayAction(); - return $this; - } - - /** - * Sets delayed until field. - * - * @param string|null $value - */ - public function delayedUntil(?string $value): self - { - $this->instance->setDelayedUntil($value); - return $this; - } - - /** - * Sets source type field. - * - * @param string|null $value - */ - public function sourceType(?string $value): self - { - $this->instance->setSourceType($value); - return $this; - } - - /** - * Sets card details field. - * - * @param CardPaymentDetails|null $value - */ - public function cardDetails(?CardPaymentDetails $value): self - { - $this->instance->setCardDetails($value); - return $this; - } - - /** - * Sets cash details field. - * - * @param CashPaymentDetails|null $value - */ - public function cashDetails(?CashPaymentDetails $value): self - { - $this->instance->setCashDetails($value); - return $this; - } - - /** - * Sets bank account details field. - * - * @param BankAccountPaymentDetails|null $value - */ - public function bankAccountDetails(?BankAccountPaymentDetails $value): self - { - $this->instance->setBankAccountDetails($value); - return $this; - } - - /** - * Sets external details field. - * - * @param ExternalPaymentDetails|null $value - */ - public function externalDetails(?ExternalPaymentDetails $value): self - { - $this->instance->setExternalDetails($value); - return $this; - } - - /** - * Sets wallet details field. - * - * @param DigitalWalletDetails|null $value - */ - public function walletDetails(?DigitalWalletDetails $value): self - { - $this->instance->setWalletDetails($value); - return $this; - } - - /** - * Sets buy now pay later details field. - * - * @param BuyNowPayLaterDetails|null $value - */ - public function buyNowPayLaterDetails(?BuyNowPayLaterDetails $value): self - { - $this->instance->setBuyNowPayLaterDetails($value); - return $this; - } - - /** - * Sets square account details field. - * - * @param SquareAccountDetails|null $value - */ - public function squareAccountDetails(?SquareAccountDetails $value): self - { - $this->instance->setSquareAccountDetails($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets refund ids field. - * - * @param string[]|null $value - */ - public function refundIds(?array $value): self - { - $this->instance->setRefundIds($value); - return $this; - } - - /** - * Sets risk evaluation field. - * - * @param RiskEvaluation|null $value - */ - public function riskEvaluation(?RiskEvaluation $value): self - { - $this->instance->setRiskEvaluation($value); - return $this; - } - - /** - * Sets terminal checkout id field. - * - * @param string|null $value - */ - public function terminalCheckoutId(?string $value): self - { - $this->instance->setTerminalCheckoutId($value); - return $this; - } - - /** - * Sets buyer email address field. - * - * @param string|null $value - */ - public function buyerEmailAddress(?string $value): self - { - $this->instance->setBuyerEmailAddress($value); - return $this; - } - - /** - * Sets billing address field. - * - * @param Address|null $value - */ - public function billingAddress(?Address $value): self - { - $this->instance->setBillingAddress($value); - return $this; - } - - /** - * Sets shipping address field. - * - * @param Address|null $value - */ - public function shippingAddress(?Address $value): self - { - $this->instance->setShippingAddress($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Sets statement description identifier field. - * - * @param string|null $value - */ - public function statementDescriptionIdentifier(?string $value): self - { - $this->instance->setStatementDescriptionIdentifier($value); - return $this; - } - - /** - * Sets capabilities field. - * - * @param string[]|null $value - */ - public function capabilities(?array $value): self - { - $this->instance->setCapabilities($value); - return $this; - } - - /** - * Sets receipt number field. - * - * @param string|null $value - */ - public function receiptNumber(?string $value): self - { - $this->instance->setReceiptNumber($value); - return $this; - } - - /** - * Sets receipt url field. - * - * @param string|null $value - */ - public function receiptUrl(?string $value): self - { - $this->instance->setReceiptUrl($value); - return $this; - } - - /** - * Sets device details field. - * - * @param DeviceDetails|null $value - */ - public function deviceDetails(?DeviceDetails $value): self - { - $this->instance->setDeviceDetails($value); - return $this; - } - - /** - * Sets application details field. - * - * @param ApplicationDetails|null $value - */ - public function applicationDetails(?ApplicationDetails $value): self - { - $this->instance->setApplicationDetails($value); - return $this; - } - - /** - * Sets is offline payment field. - * - * @param bool|null $value - */ - public function isOfflinePayment(?bool $value): self - { - $this->instance->setIsOfflinePayment($value); - return $this; - } - - /** - * Sets offline payment details field. - * - * @param OfflinePaymentDetails|null $value - */ - public function offlinePaymentDetails(?OfflinePaymentDetails $value): self - { - $this->instance->setOfflinePaymentDetails($value); - return $this; - } - - /** - * Sets version token field. - * - * @param string|null $value - */ - public function versionToken(?string $value): self - { - $this->instance->setVersionToken($value); - return $this; - } - - /** - * Unsets version token field. - */ - public function unsetVersionToken(): self - { - $this->instance->unsetVersionToken(); - return $this; - } - - /** - * Initializes a new Payment object. - */ - public function build(): Payment - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentLinkBuilder.php b/src/Models/Builders/PaymentLinkBuilder.php deleted file mode 100644 index ad595cb9..00000000 --- a/src/Models/Builders/PaymentLinkBuilder.php +++ /dev/null @@ -1,174 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Link Builder object. - * - * @param int $version - */ - public static function init(int $version): self - { - return new self(new PaymentLink($version)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Unsets description field. - */ - public function unsetDescription(): self - { - $this->instance->unsetDescription(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Sets checkout options field. - * - * @param CheckoutOptions|null $value - */ - public function checkoutOptions(?CheckoutOptions $value): self - { - $this->instance->setCheckoutOptions($value); - return $this; - } - - /** - * Sets pre populated data field. - * - * @param PrePopulatedData|null $value - */ - public function prePopulatedData(?PrePopulatedData $value): self - { - $this->instance->setPrePopulatedData($value); - return $this; - } - - /** - * Sets url field. - * - * @param string|null $value - */ - public function url(?string $value): self - { - $this->instance->setUrl($value); - return $this; - } - - /** - * Sets long url field. - * - * @param string|null $value - */ - public function longUrl(?string $value): self - { - $this->instance->setLongUrl($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets payment note field. - * - * @param string|null $value - */ - public function paymentNote(?string $value): self - { - $this->instance->setPaymentNote($value); - return $this; - } - - /** - * Unsets payment note field. - */ - public function unsetPaymentNote(): self - { - $this->instance->unsetPaymentNote(); - return $this; - } - - /** - * Initializes a new Payment Link object. - */ - public function build(): PaymentLink - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentLinkRelatedResourcesBuilder.php b/src/Models/Builders/PaymentLinkRelatedResourcesBuilder.php deleted file mode 100644 index 2b7daa61..00000000 --- a/src/Models/Builders/PaymentLinkRelatedResourcesBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Link Related Resources Builder object. - */ - public static function init(): self - { - return new self(new PaymentLinkRelatedResources()); - } - - /** - * Sets orders field. - * - * @param Order[]|null $value - */ - public function orders(?array $value): self - { - $this->instance->setOrders($value); - return $this; - } - - /** - * Unsets orders field. - */ - public function unsetOrders(): self - { - $this->instance->unsetOrders(); - return $this; - } - - /** - * Sets subscription plans field. - * - * @param CatalogObject[]|null $value - */ - public function subscriptionPlans(?array $value): self - { - $this->instance->setSubscriptionPlans($value); - return $this; - } - - /** - * Unsets subscription plans field. - */ - public function unsetSubscriptionPlans(): self - { - $this->instance->unsetSubscriptionPlans(); - return $this; - } - - /** - * Initializes a new Payment Link Related Resources object. - */ - public function build(): PaymentLinkRelatedResources - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentOptionsBuilder.php b/src/Models/Builders/PaymentOptionsBuilder.php deleted file mode 100644 index d5e76014..00000000 --- a/src/Models/Builders/PaymentOptionsBuilder.php +++ /dev/null @@ -1,113 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Options Builder object. - */ - public static function init(): self - { - return new self(new PaymentOptions()); - } - - /** - * Sets autocomplete field. - * - * @param bool|null $value - */ - public function autocomplete(?bool $value): self - { - $this->instance->setAutocomplete($value); - return $this; - } - - /** - * Unsets autocomplete field. - */ - public function unsetAutocomplete(): self - { - $this->instance->unsetAutocomplete(); - return $this; - } - - /** - * Sets delay duration field. - * - * @param string|null $value - */ - public function delayDuration(?string $value): self - { - $this->instance->setDelayDuration($value); - return $this; - } - - /** - * Unsets delay duration field. - */ - public function unsetDelayDuration(): self - { - $this->instance->unsetDelayDuration(); - return $this; - } - - /** - * Sets accept partial authorization field. - * - * @param bool|null $value - */ - public function acceptPartialAuthorization(?bool $value): self - { - $this->instance->setAcceptPartialAuthorization($value); - return $this; - } - - /** - * Unsets accept partial authorization field. - */ - public function unsetAcceptPartialAuthorization(): self - { - $this->instance->unsetAcceptPartialAuthorization(); - return $this; - } - - /** - * Sets delay action field. - * - * @param string|null $value - */ - public function delayAction(?string $value): self - { - $this->instance->setDelayAction($value); - return $this; - } - - /** - * Initializes a new Payment Options object. - */ - public function build(): PaymentOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PaymentRefundBuilder.php b/src/Models/Builders/PaymentRefundBuilder.php deleted file mode 100644 index 9b6f1b51..00000000 --- a/src/Models/Builders/PaymentRefundBuilder.php +++ /dev/null @@ -1,265 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payment Refund Builder object. - * - * @param string $id - * @param Money $amountMoney - */ - public static function init(string $id, Money $amountMoney): self - { - return new self(new PaymentRefund($id, $amountMoney)); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets unlinked field. - * - * @param bool|null $value - */ - public function unlinked(?bool $value): self - { - $this->instance->setUnlinked($value); - return $this; - } - - /** - * Sets destination type field. - * - * @param string|null $value - */ - public function destinationType(?string $value): self - { - $this->instance->setDestinationType($value); - return $this; - } - - /** - * Unsets destination type field. - */ - public function unsetDestinationType(): self - { - $this->instance->unsetDestinationType(); - return $this; - } - - /** - * Sets destination details field. - * - * @param DestinationDetails|null $value - */ - public function destinationDetails(?DestinationDetails $value): self - { - $this->instance->setDestinationDetails($value); - return $this; - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets processing fee field. - * - * @param ProcessingFee[]|null $value - */ - public function processingFee(?array $value): self - { - $this->instance->setProcessingFee($value); - return $this; - } - - /** - * Unsets processing fee field. - */ - public function unsetProcessingFee(): self - { - $this->instance->unsetProcessingFee(); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets reason field. - * - * @param string|null $value - */ - public function reason(?string $value): self - { - $this->instance->setReason($value); - return $this; - } - - /** - * Unsets reason field. - */ - public function unsetReason(): self - { - $this->instance->unsetReason(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Sets terminal refund id field. - * - * @param string|null $value - */ - public function terminalRefundId(?string $value): self - { - $this->instance->setTerminalRefundId($value); - return $this; - } - - /** - * Initializes a new Payment Refund object. - */ - public function build(): PaymentRefund - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PayoutBuilder.php b/src/Models/Builders/PayoutBuilder.php deleted file mode 100644 index 660f341c..00000000 --- a/src/Models/Builders/PayoutBuilder.php +++ /dev/null @@ -1,185 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payout Builder object. - * - * @param string $id - * @param string $locationId - */ - public static function init(string $id, string $locationId): self - { - return new self(new Payout($id, $locationId)); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets destination field. - * - * @param Destination|null $value - */ - public function destination(?Destination $value): self - { - $this->instance->setDestination($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets payout fee field. - * - * @param PayoutFee[]|null $value - */ - public function payoutFee(?array $value): self - { - $this->instance->setPayoutFee($value); - return $this; - } - - /** - * Unsets payout fee field. - */ - public function unsetPayoutFee(): self - { - $this->instance->unsetPayoutFee(); - return $this; - } - - /** - * Sets arrival date field. - * - * @param string|null $value - */ - public function arrivalDate(?string $value): self - { - $this->instance->setArrivalDate($value); - return $this; - } - - /** - * Unsets arrival date field. - */ - public function unsetArrivalDate(): self - { - $this->instance->unsetArrivalDate(); - return $this; - } - - /** - * Sets end to end id field. - * - * @param string|null $value - */ - public function endToEndId(?string $value): self - { - $this->instance->setEndToEndId($value); - return $this; - } - - /** - * Unsets end to end id field. - */ - public function unsetEndToEndId(): self - { - $this->instance->unsetEndToEndId(); - return $this; - } - - /** - * Initializes a new Payout object. - */ - public function build(): Payout - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PayoutEntryBuilder.php b/src/Models/Builders/PayoutEntryBuilder.php deleted file mode 100644 index 7373095a..00000000 --- a/src/Models/Builders/PayoutEntryBuilder.php +++ /dev/null @@ -1,413 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payout Entry Builder object. - * - * @param string $id - * @param string $payoutId - */ - public static function init(string $id, string $payoutId): self - { - return new self(new PayoutEntry($id, $payoutId)); - } - - /** - * Sets effective at field. - * - * @param string|null $value - */ - public function effectiveAt(?string $value): self - { - $this->instance->setEffectiveAt($value); - return $this; - } - - /** - * Unsets effective at field. - */ - public function unsetEffectiveAt(): self - { - $this->instance->unsetEffectiveAt(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets gross amount money field. - * - * @param Money|null $value - */ - public function grossAmountMoney(?Money $value): self - { - $this->instance->setGrossAmountMoney($value); - return $this; - } - - /** - * Sets fee amount money field. - * - * @param Money|null $value - */ - public function feeAmountMoney(?Money $value): self - { - $this->instance->setFeeAmountMoney($value); - return $this; - } - - /** - * Sets net amount money field. - * - * @param Money|null $value - */ - public function netAmountMoney(?Money $value): self - { - $this->instance->setNetAmountMoney($value); - return $this; - } - - /** - * Sets type app fee revenue details field. - * - * @param PaymentBalanceActivityAppFeeRevenueDetail|null $value - */ - public function typeAppFeeRevenueDetails(?PaymentBalanceActivityAppFeeRevenueDetail $value): self - { - $this->instance->setTypeAppFeeRevenueDetails($value); - return $this; - } - - /** - * Sets type app fee refund details field. - * - * @param PaymentBalanceActivityAppFeeRefundDetail|null $value - */ - public function typeAppFeeRefundDetails(?PaymentBalanceActivityAppFeeRefundDetail $value): self - { - $this->instance->setTypeAppFeeRefundDetails($value); - return $this; - } - - /** - * Sets type automatic savings details field. - * - * @param PaymentBalanceActivityAutomaticSavingsDetail|null $value - */ - public function typeAutomaticSavingsDetails(?PaymentBalanceActivityAutomaticSavingsDetail $value): self - { - $this->instance->setTypeAutomaticSavingsDetails($value); - return $this; - } - - /** - * Sets type automatic savings reversed details field. - * - * @param PaymentBalanceActivityAutomaticSavingsReversedDetail|null $value - */ - public function typeAutomaticSavingsReversedDetails( - ?PaymentBalanceActivityAutomaticSavingsReversedDetail $value - ): self { - $this->instance->setTypeAutomaticSavingsReversedDetails($value); - return $this; - } - - /** - * Sets type charge details field. - * - * @param PaymentBalanceActivityChargeDetail|null $value - */ - public function typeChargeDetails(?PaymentBalanceActivityChargeDetail $value): self - { - $this->instance->setTypeChargeDetails($value); - return $this; - } - - /** - * Sets type deposit fee details field. - * - * @param PaymentBalanceActivityDepositFeeDetail|null $value - */ - public function typeDepositFeeDetails(?PaymentBalanceActivityDepositFeeDetail $value): self - { - $this->instance->setTypeDepositFeeDetails($value); - return $this; - } - - /** - * Sets type deposit fee reversed details field. - * - * @param PaymentBalanceActivityDepositFeeReversedDetail|null $value - */ - public function typeDepositFeeReversedDetails(?PaymentBalanceActivityDepositFeeReversedDetail $value): self - { - $this->instance->setTypeDepositFeeReversedDetails($value); - return $this; - } - - /** - * Sets type dispute details field. - * - * @param PaymentBalanceActivityDisputeDetail|null $value - */ - public function typeDisputeDetails(?PaymentBalanceActivityDisputeDetail $value): self - { - $this->instance->setTypeDisputeDetails($value); - return $this; - } - - /** - * Sets type fee details field. - * - * @param PaymentBalanceActivityFeeDetail|null $value - */ - public function typeFeeDetails(?PaymentBalanceActivityFeeDetail $value): self - { - $this->instance->setTypeFeeDetails($value); - return $this; - } - - /** - * Sets type free processing details field. - * - * @param PaymentBalanceActivityFreeProcessingDetail|null $value - */ - public function typeFreeProcessingDetails(?PaymentBalanceActivityFreeProcessingDetail $value): self - { - $this->instance->setTypeFreeProcessingDetails($value); - return $this; - } - - /** - * Sets type hold adjustment details field. - * - * @param PaymentBalanceActivityHoldAdjustmentDetail|null $value - */ - public function typeHoldAdjustmentDetails(?PaymentBalanceActivityHoldAdjustmentDetail $value): self - { - $this->instance->setTypeHoldAdjustmentDetails($value); - return $this; - } - - /** - * Sets type open dispute details field. - * - * @param PaymentBalanceActivityOpenDisputeDetail|null $value - */ - public function typeOpenDisputeDetails(?PaymentBalanceActivityOpenDisputeDetail $value): self - { - $this->instance->setTypeOpenDisputeDetails($value); - return $this; - } - - /** - * Sets type other details field. - * - * @param PaymentBalanceActivityOtherDetail|null $value - */ - public function typeOtherDetails(?PaymentBalanceActivityOtherDetail $value): self - { - $this->instance->setTypeOtherDetails($value); - return $this; - } - - /** - * Sets type other adjustment details field. - * - * @param PaymentBalanceActivityOtherAdjustmentDetail|null $value - */ - public function typeOtherAdjustmentDetails(?PaymentBalanceActivityOtherAdjustmentDetail $value): self - { - $this->instance->setTypeOtherAdjustmentDetails($value); - return $this; - } - - /** - * Sets type refund details field. - * - * @param PaymentBalanceActivityRefundDetail|null $value - */ - public function typeRefundDetails(?PaymentBalanceActivityRefundDetail $value): self - { - $this->instance->setTypeRefundDetails($value); - return $this; - } - - /** - * Sets type release adjustment details field. - * - * @param PaymentBalanceActivityReleaseAdjustmentDetail|null $value - */ - public function typeReleaseAdjustmentDetails(?PaymentBalanceActivityReleaseAdjustmentDetail $value): self - { - $this->instance->setTypeReleaseAdjustmentDetails($value); - return $this; - } - - /** - * Sets type reserve hold details field. - * - * @param PaymentBalanceActivityReserveHoldDetail|null $value - */ - public function typeReserveHoldDetails(?PaymentBalanceActivityReserveHoldDetail $value): self - { - $this->instance->setTypeReserveHoldDetails($value); - return $this; - } - - /** - * Sets type reserve release details field. - * - * @param PaymentBalanceActivityReserveReleaseDetail|null $value - */ - public function typeReserveReleaseDetails(?PaymentBalanceActivityReserveReleaseDetail $value): self - { - $this->instance->setTypeReserveReleaseDetails($value); - return $this; - } - - /** - * Sets type square capital payment details field. - * - * @param PaymentBalanceActivitySquareCapitalPaymentDetail|null $value - */ - public function typeSquareCapitalPaymentDetails(?PaymentBalanceActivitySquareCapitalPaymentDetail $value): self - { - $this->instance->setTypeSquareCapitalPaymentDetails($value); - return $this; - } - - /** - * Sets type square capital reversed payment details field. - * - * @param PaymentBalanceActivitySquareCapitalReversedPaymentDetail|null $value - */ - public function typeSquareCapitalReversedPaymentDetails( - ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $value - ): self { - $this->instance->setTypeSquareCapitalReversedPaymentDetails($value); - return $this; - } - - /** - * Sets type tax on fee details field. - * - * @param PaymentBalanceActivityTaxOnFeeDetail|null $value - */ - public function typeTaxOnFeeDetails(?PaymentBalanceActivityTaxOnFeeDetail $value): self - { - $this->instance->setTypeTaxOnFeeDetails($value); - return $this; - } - - /** - * Sets type third party fee details field. - * - * @param PaymentBalanceActivityThirdPartyFeeDetail|null $value - */ - public function typeThirdPartyFeeDetails(?PaymentBalanceActivityThirdPartyFeeDetail $value): self - { - $this->instance->setTypeThirdPartyFeeDetails($value); - return $this; - } - - /** - * Sets type third party fee refund details field. - * - * @param PaymentBalanceActivityThirdPartyFeeRefundDetail|null $value - */ - public function typeThirdPartyFeeRefundDetails(?PaymentBalanceActivityThirdPartyFeeRefundDetail $value): self - { - $this->instance->setTypeThirdPartyFeeRefundDetails($value); - return $this; - } - - /** - * Sets type square payroll transfer details field. - * - * @param PaymentBalanceActivitySquarePayrollTransferDetail|null $value - */ - public function typeSquarePayrollTransferDetails(?PaymentBalanceActivitySquarePayrollTransferDetail $value): self - { - $this->instance->setTypeSquarePayrollTransferDetails($value); - return $this; - } - - /** - * Sets type square payroll transfer reversed details field. - * - * @param PaymentBalanceActivitySquarePayrollTransferReversedDetail|null $value - */ - public function typeSquarePayrollTransferReversedDetails( - ?PaymentBalanceActivitySquarePayrollTransferReversedDetail $value - ): self { - $this->instance->setTypeSquarePayrollTransferReversedDetails($value); - return $this; - } - - /** - * Initializes a new Payout Entry object. - */ - public function build(): PayoutEntry - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PayoutFeeBuilder.php b/src/Models/Builders/PayoutFeeBuilder.php deleted file mode 100644 index a797e047..00000000 --- a/src/Models/Builders/PayoutFeeBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Payout Fee Builder object. - */ - public static function init(): self - { - return new self(new PayoutFee()); - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets effective at field. - * - * @param string|null $value - */ - public function effectiveAt(?string $value): self - { - $this->instance->setEffectiveAt($value); - return $this; - } - - /** - * Unsets effective at field. - */ - public function unsetEffectiveAt(): self - { - $this->instance->unsetEffectiveAt(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Initializes a new Payout Fee object. - */ - public function build(): PayoutFee - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PhaseBuilder.php b/src/Models/Builders/PhaseBuilder.php deleted file mode 100644 index 7d5d9e9e..00000000 --- a/src/Models/Builders/PhaseBuilder.php +++ /dev/null @@ -1,122 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Phase Builder object. - */ - public static function init(): self - { - return new self(new Phase()); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Sets order template id field. - * - * @param string|null $value - */ - public function orderTemplateId(?string $value): self - { - $this->instance->setOrderTemplateId($value); - return $this; - } - - /** - * Unsets order template id field. - */ - public function unsetOrderTemplateId(): self - { - $this->instance->unsetOrderTemplateId(); - return $this; - } - - /** - * Sets plan phase uid field. - * - * @param string|null $value - */ - public function planPhaseUid(?string $value): self - { - $this->instance->setPlanPhaseUid($value); - return $this; - } - - /** - * Unsets plan phase uid field. - */ - public function unsetPlanPhaseUid(): self - { - $this->instance->unsetPlanPhaseUid(); - return $this; - } - - /** - * Initializes a new Phase object. - */ - public function build(): Phase - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PhaseInputBuilder.php b/src/Models/Builders/PhaseInputBuilder.php deleted file mode 100644 index fbac21ab..00000000 --- a/src/Models/Builders/PhaseInputBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Phase Input Builder object. - * - * @param int $ordinal - */ - public static function init(int $ordinal): self - { - return new self(new PhaseInput($ordinal)); - } - - /** - * Sets order template id field. - * - * @param string|null $value - */ - public function orderTemplateId(?string $value): self - { - $this->instance->setOrderTemplateId($value); - return $this; - } - - /** - * Unsets order template id field. - */ - public function unsetOrderTemplateId(): self - { - $this->instance->unsetOrderTemplateId(); - return $this; - } - - /** - * Initializes a new Phase Input object. - */ - public function build(): PhaseInput - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PrePopulatedDataBuilder.php b/src/Models/Builders/PrePopulatedDataBuilder.php deleted file mode 100644 index 3700d12b..00000000 --- a/src/Models/Builders/PrePopulatedDataBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Pre Populated Data Builder object. - */ - public static function init(): self - { - return new self(new PrePopulatedData()); - } - - /** - * Sets buyer email field. - * - * @param string|null $value - */ - public function buyerEmail(?string $value): self - { - $this->instance->setBuyerEmail($value); - return $this; - } - - /** - * Unsets buyer email field. - */ - public function unsetBuyerEmail(): self - { - $this->instance->unsetBuyerEmail(); - return $this; - } - - /** - * Sets buyer phone number field. - * - * @param string|null $value - */ - public function buyerPhoneNumber(?string $value): self - { - $this->instance->setBuyerPhoneNumber($value); - return $this; - } - - /** - * Unsets buyer phone number field. - */ - public function unsetBuyerPhoneNumber(): self - { - $this->instance->unsetBuyerPhoneNumber(); - return $this; - } - - /** - * Sets buyer address field. - * - * @param Address|null $value - */ - public function buyerAddress(?Address $value): self - { - $this->instance->setBuyerAddress($value); - return $this; - } - - /** - * Initializes a new Pre Populated Data object. - */ - public function build(): PrePopulatedData - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ProcessingFeeBuilder.php b/src/Models/Builders/ProcessingFeeBuilder.php deleted file mode 100644 index 410c9603..00000000 --- a/src/Models/Builders/ProcessingFeeBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Processing Fee Builder object. - */ - public static function init(): self - { - return new self(new ProcessingFee()); - } - - /** - * Sets effective at field. - * - * @param string|null $value - */ - public function effectiveAt(?string $value): self - { - $this->instance->setEffectiveAt($value); - return $this; - } - - /** - * Unsets effective at field. - */ - public function unsetEffectiveAt(): self - { - $this->instance->unsetEffectiveAt(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Unsets type field. - */ - public function unsetType(): self - { - $this->instance->unsetType(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Initializes a new Processing Fee object. - */ - public function build(): ProcessingFee - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PublishInvoiceRequestBuilder.php b/src/Models/Builders/PublishInvoiceRequestBuilder.php deleted file mode 100644 index 44070783..00000000 --- a/src/Models/Builders/PublishInvoiceRequestBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Publish Invoice Request Builder object. - * - * @param int $version - */ - public static function init(int $version): self - { - return new self(new PublishInvoiceRequest($version)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Publish Invoice Request object. - */ - public function build(): PublishInvoiceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/PublishInvoiceResponseBuilder.php b/src/Models/Builders/PublishInvoiceResponseBuilder.php deleted file mode 100644 index cdb6b367..00000000 --- a/src/Models/Builders/PublishInvoiceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Publish Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new PublishInvoiceResponse()); - } - - /** - * Sets invoice field. - * - * @param Invoice|null $value - */ - public function invoice(?Invoice $value): self - { - $this->instance->setInvoice($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Publish Invoice Response object. - */ - public function build(): PublishInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/QrCodeOptionsBuilder.php b/src/Models/Builders/QrCodeOptionsBuilder.php deleted file mode 100644 index ec1c0226..00000000 --- a/src/Models/Builders/QrCodeOptionsBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Qr Code Options Builder object. - * - * @param string $title - * @param string $body - * @param string $barcodeContents - */ - public static function init(string $title, string $body, string $barcodeContents): self - { - return new self(new QrCodeOptions($title, $body, $barcodeContents)); - } - - /** - * Initializes a new Qr Code Options object. - */ - public function build(): QrCodeOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/QuantityRatioBuilder.php b/src/Models/Builders/QuantityRatioBuilder.php deleted file mode 100644 index 4451e4ca..00000000 --- a/src/Models/Builders/QuantityRatioBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Quantity Ratio Builder object. - */ - public static function init(): self - { - return new self(new QuantityRatio()); - } - - /** - * Sets quantity field. - * - * @param int|null $value - */ - public function quantity(?int $value): self - { - $this->instance->setQuantity($value); - return $this; - } - - /** - * Unsets quantity field. - */ - public function unsetQuantity(): self - { - $this->instance->unsetQuantity(); - return $this; - } - - /** - * Sets quantity denominator field. - * - * @param int|null $value - */ - public function quantityDenominator(?int $value): self - { - $this->instance->setQuantityDenominator($value); - return $this; - } - - /** - * Unsets quantity denominator field. - */ - public function unsetQuantityDenominator(): self - { - $this->instance->unsetQuantityDenominator(); - return $this; - } - - /** - * Initializes a new Quantity Ratio object. - */ - public function build(): QuantityRatio - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/QuickPayBuilder.php b/src/Models/Builders/QuickPayBuilder.php deleted file mode 100644 index cee52682..00000000 --- a/src/Models/Builders/QuickPayBuilder.php +++ /dev/null @@ -1,47 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Quick Pay Builder object. - * - * @param string $name - * @param Money $priceMoney - * @param string $locationId - */ - public static function init(string $name, Money $priceMoney, string $locationId): self - { - return new self(new QuickPay($name, $priceMoney, $locationId)); - } - - /** - * Initializes a new Quick Pay object. - */ - public function build(): QuickPay - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RangeBuilder.php b/src/Models/Builders/RangeBuilder.php deleted file mode 100644 index df1112b8..00000000 --- a/src/Models/Builders/RangeBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Range Builder object. - */ - public static function init(): self - { - return new self(new Range()); - } - - /** - * Sets min field. - * - * @param string|null $value - */ - public function min(?string $value): self - { - $this->instance->setMin($value); - return $this; - } - - /** - * Unsets min field. - */ - public function unsetMin(): self - { - $this->instance->unsetMin(); - return $this; - } - - /** - * Sets max field. - * - * @param string|null $value - */ - public function max(?string $value): self - { - $this->instance->setMax($value); - return $this; - } - - /** - * Unsets max field. - */ - public function unsetMax(): self - { - $this->instance->unsetMax(); - return $this; - } - - /** - * Initializes a new Range object. - */ - public function build(): Range - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ReceiptOptionsBuilder.php b/src/Models/Builders/ReceiptOptionsBuilder.php deleted file mode 100644 index b1a52815..00000000 --- a/src/Models/Builders/ReceiptOptionsBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Receipt Options Builder object. - * - * @param string $paymentId - */ - public static function init(string $paymentId): self - { - return new self(new ReceiptOptions($paymentId)); - } - - /** - * Sets print only field. - * - * @param bool|null $value - */ - public function printOnly(?bool $value): self - { - $this->instance->setPrintOnly($value); - return $this; - } - - /** - * Unsets print only field. - */ - public function unsetPrintOnly(): self - { - $this->instance->unsetPrintOnly(); - return $this; - } - - /** - * Sets is duplicate field. - * - * @param bool|null $value - */ - public function isDuplicate(?bool $value): self - { - $this->instance->setIsDuplicate($value); - return $this; - } - - /** - * Unsets is duplicate field. - */ - public function unsetIsDuplicate(): self - { - $this->instance->unsetIsDuplicate(); - return $this; - } - - /** - * Initializes a new Receipt Options object. - */ - public function build(): ReceiptOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RedeemLoyaltyRewardRequestBuilder.php b/src/Models/Builders/RedeemLoyaltyRewardRequestBuilder.php deleted file mode 100644 index bfc1ab6d..00000000 --- a/src/Models/Builders/RedeemLoyaltyRewardRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Redeem Loyalty Reward Request Builder object. - * - * @param string $idempotencyKey - * @param string $locationId - */ - public static function init(string $idempotencyKey, string $locationId): self - { - return new self(new RedeemLoyaltyRewardRequest($idempotencyKey, $locationId)); - } - - /** - * Initializes a new Redeem Loyalty Reward Request object. - */ - public function build(): RedeemLoyaltyRewardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RedeemLoyaltyRewardResponseBuilder.php b/src/Models/Builders/RedeemLoyaltyRewardResponseBuilder.php deleted file mode 100644 index 41f917ef..00000000 --- a/src/Models/Builders/RedeemLoyaltyRewardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Redeem Loyalty Reward Response Builder object. - */ - public static function init(): self - { - return new self(new RedeemLoyaltyRewardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets event field. - * - * @param LoyaltyEvent|null $value - */ - public function event(?LoyaltyEvent $value): self - { - $this->instance->setEvent($value); - return $this; - } - - /** - * Initializes a new Redeem Loyalty Reward Response object. - */ - public function build(): RedeemLoyaltyRewardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RefundBuilder.php b/src/Models/Builders/RefundBuilder.php deleted file mode 100644 index dbdbf7dd..00000000 --- a/src/Models/Builders/RefundBuilder.php +++ /dev/null @@ -1,119 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Refund Builder object. - * - * @param string $id - * @param string $locationId - * @param string $tenderId - * @param string $reason - * @param Money $amountMoney - * @param string $status - */ - public static function init( - string $id, - string $locationId, - string $tenderId, - string $reason, - Money $amountMoney, - string $status - ): self { - return new self(new Refund($id, $locationId, $tenderId, $reason, $amountMoney, $status)); - } - - /** - * Sets transaction id field. - * - * @param string|null $value - */ - public function transactionId(?string $value): self - { - $this->instance->setTransactionId($value); - return $this; - } - - /** - * Unsets transaction id field. - */ - public function unsetTransactionId(): self - { - $this->instance->unsetTransactionId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets processing fee money field. - * - * @param Money|null $value - */ - public function processingFeeMoney(?Money $value): self - { - $this->instance->setProcessingFeeMoney($value); - return $this; - } - - /** - * Sets additional recipients field. - * - * @param AdditionalRecipient[]|null $value - */ - public function additionalRecipients(?array $value): self - { - $this->instance->setAdditionalRecipients($value); - return $this; - } - - /** - * Unsets additional recipients field. - */ - public function unsetAdditionalRecipients(): self - { - $this->instance->unsetAdditionalRecipients(); - return $this; - } - - /** - * Initializes a new Refund object. - */ - public function build(): Refund - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RefundPaymentRequestBuilder.php b/src/Models/Builders/RefundPaymentRequestBuilder.php deleted file mode 100644 index 1bb2bbcd..00000000 --- a/src/Models/Builders/RefundPaymentRequestBuilder.php +++ /dev/null @@ -1,241 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Refund Payment Request Builder object. - * - * @param string $idempotencyKey - * @param Money $amountMoney - */ - public static function init(string $idempotencyKey, Money $amountMoney): self - { - return new self(new RefundPaymentRequest($idempotencyKey, $amountMoney)); - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets destination id field. - * - * @param string|null $value - */ - public function destinationId(?string $value): self - { - $this->instance->setDestinationId($value); - return $this; - } - - /** - * Unsets destination id field. - */ - public function unsetDestinationId(): self - { - $this->instance->unsetDestinationId(); - return $this; - } - - /** - * Sets unlinked field. - * - * @param bool|null $value - */ - public function unlinked(?bool $value): self - { - $this->instance->setUnlinked($value); - return $this; - } - - /** - * Unsets unlinked field. - */ - public function unsetUnlinked(): self - { - $this->instance->unsetUnlinked(); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets reason field. - * - * @param string|null $value - */ - public function reason(?string $value): self - { - $this->instance->setReason($value); - return $this; - } - - /** - * Unsets reason field. - */ - public function unsetReason(): self - { - $this->instance->unsetReason(); - return $this; - } - - /** - * Sets payment version token field. - * - * @param string|null $value - */ - public function paymentVersionToken(?string $value): self - { - $this->instance->setPaymentVersionToken($value); - return $this; - } - - /** - * Unsets payment version token field. - */ - public function unsetPaymentVersionToken(): self - { - $this->instance->unsetPaymentVersionToken(); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets cash details field. - * - * @param DestinationDetailsCashRefundDetails|null $value - */ - public function cashDetails(?DestinationDetailsCashRefundDetails $value): self - { - $this->instance->setCashDetails($value); - return $this; - } - - /** - * Sets external details field. - * - * @param DestinationDetailsExternalRefundDetails|null $value - */ - public function externalDetails(?DestinationDetailsExternalRefundDetails $value): self - { - $this->instance->setExternalDetails($value); - return $this; - } - - /** - * Initializes a new Refund Payment Request object. - */ - public function build(): RefundPaymentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RefundPaymentResponseBuilder.php b/src/Models/Builders/RefundPaymentResponseBuilder.php deleted file mode 100644 index fecd538f..00000000 --- a/src/Models/Builders/RefundPaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Refund Payment Response Builder object. - */ - public static function init(): self - { - return new self(new RefundPaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refund field. - * - * @param PaymentRefund|null $value - */ - public function refund(?PaymentRefund $value): self - { - $this->instance->setRefund($value); - return $this; - } - - /** - * Initializes a new Refund Payment Response object. - */ - public function build(): RefundPaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RegisterDomainRequestBuilder.php b/src/Models/Builders/RegisterDomainRequestBuilder.php deleted file mode 100644 index 60230fdb..00000000 --- a/src/Models/Builders/RegisterDomainRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Register Domain Request Builder object. - * - * @param string $domainName - */ - public static function init(string $domainName): self - { - return new self(new RegisterDomainRequest($domainName)); - } - - /** - * Initializes a new Register Domain Request object. - */ - public function build(): RegisterDomainRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RegisterDomainResponseBuilder.php b/src/Models/Builders/RegisterDomainResponseBuilder.php deleted file mode 100644 index 8446daab..00000000 --- a/src/Models/Builders/RegisterDomainResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Register Domain Response Builder object. - */ - public static function init(): self - { - return new self(new RegisterDomainResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Register Domain Response object. - */ - public function build(): RegisterDomainResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RemoveGroupFromCustomerResponseBuilder.php b/src/Models/Builders/RemoveGroupFromCustomerResponseBuilder.php deleted file mode 100644 index 93a6c5de..00000000 --- a/src/Models/Builders/RemoveGroupFromCustomerResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Remove Group From Customer Response Builder object. - */ - public static function init(): self - { - return new self(new RemoveGroupFromCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Remove Group From Customer Response object. - */ - public function build(): RemoveGroupFromCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ResumeSubscriptionRequestBuilder.php b/src/Models/Builders/ResumeSubscriptionRequestBuilder.php deleted file mode 100644 index 221c428b..00000000 --- a/src/Models/Builders/ResumeSubscriptionRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Resume Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new ResumeSubscriptionRequest()); - } - - /** - * Sets resume effective date field. - * - * @param string|null $value - */ - public function resumeEffectiveDate(?string $value): self - { - $this->instance->setResumeEffectiveDate($value); - return $this; - } - - /** - * Unsets resume effective date field. - */ - public function unsetResumeEffectiveDate(): self - { - $this->instance->unsetResumeEffectiveDate(); - return $this; - } - - /** - * Sets resume change timing field. - * - * @param string|null $value - */ - public function resumeChangeTiming(?string $value): self - { - $this->instance->setResumeChangeTiming($value); - return $this; - } - - /** - * Initializes a new Resume Subscription Request object. - */ - public function build(): ResumeSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ResumeSubscriptionResponseBuilder.php b/src/Models/Builders/ResumeSubscriptionResponseBuilder.php deleted file mode 100644 index 9ac5ba9e..00000000 --- a/src/Models/Builders/ResumeSubscriptionResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Resume Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new ResumeSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Initializes a new Resume Subscription Response object. - */ - public function build(): ResumeSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 54f943b9..00000000 --- a/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Definition Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBookingCustomAttributeDefinitionRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Definition Request object. - */ - public function build(): RetrieveBookingCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index b8307bc7..00000000 --- a/src/Models/Builders/RetrieveBookingCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBookingCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Definition Response object. - */ - public function build(): RetrieveBookingCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBookingCustomAttributeRequestBuilder.php b/src/Models/Builders/RetrieveBookingCustomAttributeRequestBuilder.php deleted file mode 100644 index d4d53657..00000000 --- a/src/Models/Builders/RetrieveBookingCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBookingCustomAttributeRequest()); - } - - /** - * Sets with definition field. - * - * @param bool|null $value - */ - public function withDefinition(?bool $value): self - { - $this->instance->setWithDefinition($value); - return $this; - } - - /** - * Unsets with definition field. - */ - public function unsetWithDefinition(): self - { - $this->instance->unsetWithDefinition(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Request object. - */ - public function build(): RetrieveBookingCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBookingCustomAttributeResponseBuilder.php b/src/Models/Builders/RetrieveBookingCustomAttributeResponseBuilder.php deleted file mode 100644 index 9241bb06..00000000 --- a/src/Models/Builders/RetrieveBookingCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBookingCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Booking Custom Attribute Response object. - */ - public function build(): RetrieveBookingCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBookingResponseBuilder.php b/src/Models/Builders/RetrieveBookingResponseBuilder.php deleted file mode 100644 index 309bcf81..00000000 --- a/src/Models/Builders/RetrieveBookingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Booking Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBookingResponse()); - } - - /** - * Sets booking field. - * - * @param Booking|null $value - */ - public function booking(?Booking $value): self - { - $this->instance->setBooking($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Booking Response object. - */ - public function build(): RetrieveBookingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveBusinessBookingProfileResponseBuilder.php b/src/Models/Builders/RetrieveBusinessBookingProfileResponseBuilder.php deleted file mode 100644 index 5a9470cc..00000000 --- a/src/Models/Builders/RetrieveBusinessBookingProfileResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Business Booking Profile Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveBusinessBookingProfileResponse()); - } - - /** - * Sets business booking profile field. - * - * @param BusinessBookingProfile|null $value - */ - public function businessBookingProfile(?BusinessBookingProfile $value): self - { - $this->instance->setBusinessBookingProfile($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Business Booking Profile Response object. - */ - public function build(): RetrieveBusinessBookingProfileResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCardResponseBuilder.php b/src/Models/Builders/RetrieveCardResponseBuilder.php deleted file mode 100644 index 558179d9..00000000 --- a/src/Models/Builders/RetrieveCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Card Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Initializes a new Retrieve Card Response object. - */ - public function build(): RetrieveCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCashDrawerShiftRequestBuilder.php b/src/Models/Builders/RetrieveCashDrawerShiftRequestBuilder.php deleted file mode 100644 index c575f85b..00000000 --- a/src/Models/Builders/RetrieveCashDrawerShiftRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Cash Drawer Shift Request Builder object. - * - * @param string $locationId - */ - public static function init(string $locationId): self - { - return new self(new RetrieveCashDrawerShiftRequest($locationId)); - } - - /** - * Initializes a new Retrieve Cash Drawer Shift Request object. - */ - public function build(): RetrieveCashDrawerShiftRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCashDrawerShiftResponseBuilder.php b/src/Models/Builders/RetrieveCashDrawerShiftResponseBuilder.php deleted file mode 100644 index e6fcfc7e..00000000 --- a/src/Models/Builders/RetrieveCashDrawerShiftResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Cash Drawer Shift Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCashDrawerShiftResponse()); - } - - /** - * Sets cash drawer shift field. - * - * @param CashDrawerShift|null $value - */ - public function cashDrawerShift(?CashDrawerShift $value): self - { - $this->instance->setCashDrawerShift($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Cash Drawer Shift Response object. - */ - public function build(): RetrieveCashDrawerShiftResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCatalogObjectRequestBuilder.php b/src/Models/Builders/RetrieveCatalogObjectRequestBuilder.php deleted file mode 100644 index 3d5577f6..00000000 --- a/src/Models/Builders/RetrieveCatalogObjectRequestBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Catalog Object Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCatalogObjectRequest()); - } - - /** - * Sets include related objects field. - * - * @param bool|null $value - */ - public function includeRelatedObjects(?bool $value): self - { - $this->instance->setIncludeRelatedObjects($value); - return $this; - } - - /** - * Unsets include related objects field. - */ - public function unsetIncludeRelatedObjects(): self - { - $this->instance->unsetIncludeRelatedObjects(); - return $this; - } - - /** - * Sets catalog version field. - * - * @param int|null $value - */ - public function catalogVersion(?int $value): self - { - $this->instance->setCatalogVersion($value); - return $this; - } - - /** - * Unsets catalog version field. - */ - public function unsetCatalogVersion(): self - { - $this->instance->unsetCatalogVersion(); - return $this; - } - - /** - * Sets include category path to root field. - * - * @param bool|null $value - */ - public function includeCategoryPathToRoot(?bool $value): self - { - $this->instance->setIncludeCategoryPathToRoot($value); - return $this; - } - - /** - * Unsets include category path to root field. - */ - public function unsetIncludeCategoryPathToRoot(): self - { - $this->instance->unsetIncludeCategoryPathToRoot(); - return $this; - } - - /** - * Initializes a new Retrieve Catalog Object Request object. - */ - public function build(): RetrieveCatalogObjectRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCatalogObjectResponseBuilder.php b/src/Models/Builders/RetrieveCatalogObjectResponseBuilder.php deleted file mode 100644 index 965c3bc7..00000000 --- a/src/Models/Builders/RetrieveCatalogObjectResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Catalog Object Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCatalogObjectResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets object field. - * - * @param CatalogObject|null $value - */ - public function object(?CatalogObject $value): self - { - $this->instance->setObject($value); - return $this; - } - - /** - * Sets related objects field. - * - * @param CatalogObject[]|null $value - */ - public function relatedObjects(?array $value): self - { - $this->instance->setRelatedObjects($value); - return $this; - } - - /** - * Initializes a new Retrieve Catalog Object Response object. - */ - public function build(): RetrieveCatalogObjectResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 985b9dd4..00000000 --- a/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Definition Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerCustomAttributeDefinitionRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Definition Request object. - */ - public function build(): RetrieveCustomerCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 328ae914..00000000 --- a/src/Models/Builders/RetrieveCustomerCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Definition Response object. - */ - public function build(): RetrieveCustomerCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerCustomAttributeRequestBuilder.php b/src/Models/Builders/RetrieveCustomerCustomAttributeRequestBuilder.php deleted file mode 100644 index 857bcb30..00000000 --- a/src/Models/Builders/RetrieveCustomerCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerCustomAttributeRequest()); - } - - /** - * Sets with definition field. - * - * @param bool|null $value - */ - public function withDefinition(?bool $value): self - { - $this->instance->setWithDefinition($value); - return $this; - } - - /** - * Unsets with definition field. - */ - public function unsetWithDefinition(): self - { - $this->instance->unsetWithDefinition(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Request object. - */ - public function build(): RetrieveCustomerCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerCustomAttributeResponseBuilder.php b/src/Models/Builders/RetrieveCustomerCustomAttributeResponseBuilder.php deleted file mode 100644 index e652882e..00000000 --- a/src/Models/Builders/RetrieveCustomerCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Custom Attribute Response object. - */ - public function build(): RetrieveCustomerCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerGroupResponseBuilder.php b/src/Models/Builders/RetrieveCustomerGroupResponseBuilder.php deleted file mode 100644 index a73064c7..00000000 --- a/src/Models/Builders/RetrieveCustomerGroupResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Group Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerGroupResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets group field. - * - * @param CustomerGroup|null $value - */ - public function group(?CustomerGroup $value): self - { - $this->instance->setGroup($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Group Response object. - */ - public function build(): RetrieveCustomerGroupResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerResponseBuilder.php b/src/Models/Builders/RetrieveCustomerResponseBuilder.php deleted file mode 100644 index 594fa0cf..00000000 --- a/src/Models/Builders/RetrieveCustomerResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets customer field. - * - * @param Customer|null $value - */ - public function customer(?Customer $value): self - { - $this->instance->setCustomer($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Response object. - */ - public function build(): RetrieveCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveCustomerSegmentResponseBuilder.php b/src/Models/Builders/RetrieveCustomerSegmentResponseBuilder.php deleted file mode 100644 index 3f4681a5..00000000 --- a/src/Models/Builders/RetrieveCustomerSegmentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Customer Segment Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveCustomerSegmentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets segment field. - * - * @param CustomerSegment|null $value - */ - public function segment(?CustomerSegment $value): self - { - $this->instance->setSegment($value); - return $this; - } - - /** - * Initializes a new Retrieve Customer Segment Response object. - */ - public function build(): RetrieveCustomerSegmentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveDisputeEvidenceResponseBuilder.php b/src/Models/Builders/RetrieveDisputeEvidenceResponseBuilder.php deleted file mode 100644 index b7b916af..00000000 --- a/src/Models/Builders/RetrieveDisputeEvidenceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Dispute Evidence Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveDisputeEvidenceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets evidence field. - * - * @param DisputeEvidence|null $value - */ - public function evidence(?DisputeEvidence $value): self - { - $this->instance->setEvidence($value); - return $this; - } - - /** - * Initializes a new Retrieve Dispute Evidence Response object. - */ - public function build(): RetrieveDisputeEvidenceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveDisputeResponseBuilder.php b/src/Models/Builders/RetrieveDisputeResponseBuilder.php deleted file mode 100644 index 5ea97862..00000000 --- a/src/Models/Builders/RetrieveDisputeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Dispute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveDisputeResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets dispute field. - * - * @param Dispute|null $value - */ - public function dispute(?Dispute $value): self - { - $this->instance->setDispute($value); - return $this; - } - - /** - * Initializes a new Retrieve Dispute Response object. - */ - public function build(): RetrieveDisputeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveEmployeeResponseBuilder.php b/src/Models/Builders/RetrieveEmployeeResponseBuilder.php deleted file mode 100644 index e75da525..00000000 --- a/src/Models/Builders/RetrieveEmployeeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Employee Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveEmployeeResponse()); - } - - /** - * Sets employee field. - * - * @param Employee|null $value - */ - public function employee(?Employee $value): self - { - $this->instance->setEmployee($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Employee Response object. - */ - public function build(): RetrieveEmployeeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveGiftCardFromGANRequestBuilder.php b/src/Models/Builders/RetrieveGiftCardFromGANRequestBuilder.php deleted file mode 100644 index 7bfd5242..00000000 --- a/src/Models/Builders/RetrieveGiftCardFromGANRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Gift Card From GAN Request Builder object. - * - * @param string $gan - */ - public static function init(string $gan): self - { - return new self(new RetrieveGiftCardFromGANRequest($gan)); - } - - /** - * Initializes a new Retrieve Gift Card From GAN Request object. - */ - public function build(): RetrieveGiftCardFromGANRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveGiftCardFromGANResponseBuilder.php b/src/Models/Builders/RetrieveGiftCardFromGANResponseBuilder.php deleted file mode 100644 index ef63e0f2..00000000 --- a/src/Models/Builders/RetrieveGiftCardFromGANResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Gift Card From GAN Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveGiftCardFromGANResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Retrieve Gift Card From GAN Response object. - */ - public function build(): RetrieveGiftCardFromGANResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveGiftCardFromNonceRequestBuilder.php b/src/Models/Builders/RetrieveGiftCardFromNonceRequestBuilder.php deleted file mode 100644 index e62e3ea4..00000000 --- a/src/Models/Builders/RetrieveGiftCardFromNonceRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Gift Card From Nonce Request Builder object. - * - * @param string $nonce - */ - public static function init(string $nonce): self - { - return new self(new RetrieveGiftCardFromNonceRequest($nonce)); - } - - /** - * Initializes a new Retrieve Gift Card From Nonce Request object. - */ - public function build(): RetrieveGiftCardFromNonceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveGiftCardFromNonceResponseBuilder.php b/src/Models/Builders/RetrieveGiftCardFromNonceResponseBuilder.php deleted file mode 100644 index ffc3f5b9..00000000 --- a/src/Models/Builders/RetrieveGiftCardFromNonceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Gift Card From Nonce Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveGiftCardFromNonceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Retrieve Gift Card From Nonce Response object. - */ - public function build(): RetrieveGiftCardFromNonceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveGiftCardResponseBuilder.php b/src/Models/Builders/RetrieveGiftCardResponseBuilder.php deleted file mode 100644 index 6049298f..00000000 --- a/src/Models/Builders/RetrieveGiftCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Gift Card Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveGiftCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Retrieve Gift Card Response object. - */ - public function build(): RetrieveGiftCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryAdjustmentResponseBuilder.php b/src/Models/Builders/RetrieveInventoryAdjustmentResponseBuilder.php deleted file mode 100644 index 94c862a4..00000000 --- a/src/Models/Builders/RetrieveInventoryAdjustmentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Adjustment Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryAdjustmentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets adjustment field. - * - * @param InventoryAdjustment|null $value - */ - public function adjustment(?InventoryAdjustment $value): self - { - $this->instance->setAdjustment($value); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Adjustment Response object. - */ - public function build(): RetrieveInventoryAdjustmentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryChangesRequestBuilder.php b/src/Models/Builders/RetrieveInventoryChangesRequestBuilder.php deleted file mode 100644 index cc6ce69d..00000000 --- a/src/Models/Builders/RetrieveInventoryChangesRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Changes Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryChangesRequest()); - } - - /** - * Sets location ids field. - * - * @param string|null $value - */ - public function locationIds(?string $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Changes Request object. - */ - public function build(): RetrieveInventoryChangesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryChangesResponseBuilder.php b/src/Models/Builders/RetrieveInventoryChangesResponseBuilder.php deleted file mode 100644 index 31f91247..00000000 --- a/src/Models/Builders/RetrieveInventoryChangesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Changes Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryChangesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets changes field. - * - * @param InventoryChange[]|null $value - */ - public function changes(?array $value): self - { - $this->instance->setChanges($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Changes Response object. - */ - public function build(): RetrieveInventoryChangesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryCountRequestBuilder.php b/src/Models/Builders/RetrieveInventoryCountRequestBuilder.php deleted file mode 100644 index a439a592..00000000 --- a/src/Models/Builders/RetrieveInventoryCountRequestBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Count Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryCountRequest()); - } - - /** - * Sets location ids field. - * - * @param string|null $value - */ - public function locationIds(?string $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Unsets cursor field. - */ - public function unsetCursor(): self - { - $this->instance->unsetCursor(); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Count Request object. - */ - public function build(): RetrieveInventoryCountRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryCountResponseBuilder.php b/src/Models/Builders/RetrieveInventoryCountResponseBuilder.php deleted file mode 100644 index aa54b816..00000000 --- a/src/Models/Builders/RetrieveInventoryCountResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Count Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryCountResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets counts field. - * - * @param InventoryCount[]|null $value - */ - public function counts(?array $value): self - { - $this->instance->setCounts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Count Response object. - */ - public function build(): RetrieveInventoryCountResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryPhysicalCountResponseBuilder.php b/src/Models/Builders/RetrieveInventoryPhysicalCountResponseBuilder.php deleted file mode 100644 index cc76c0b8..00000000 --- a/src/Models/Builders/RetrieveInventoryPhysicalCountResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Physical Count Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryPhysicalCountResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets count field. - * - * @param InventoryPhysicalCount|null $value - */ - public function count(?InventoryPhysicalCount $value): self - { - $this->instance->setCount($value); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Physical Count Response object. - */ - public function build(): RetrieveInventoryPhysicalCountResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveInventoryTransferResponseBuilder.php b/src/Models/Builders/RetrieveInventoryTransferResponseBuilder.php deleted file mode 100644 index 1b223f2e..00000000 --- a/src/Models/Builders/RetrieveInventoryTransferResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Inventory Transfer Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveInventoryTransferResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets transfer field. - * - * @param InventoryTransfer|null $value - */ - public function transfer(?InventoryTransfer $value): self - { - $this->instance->setTransfer($value); - return $this; - } - - /** - * Initializes a new Retrieve Inventory Transfer Response object. - */ - public function build(): RetrieveInventoryTransferResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveJobResponseBuilder.php b/src/Models/Builders/RetrieveJobResponseBuilder.php deleted file mode 100644 index e2e9d3ea..00000000 --- a/src/Models/Builders/RetrieveJobResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Job Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveJobResponse()); - } - - /** - * Sets job field. - * - * @param Job|null $value - */ - public function job(?Job $value): self - { - $this->instance->setJob($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Job Response object. - */ - public function build(): RetrieveJobResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationBookingProfileResponseBuilder.php b/src/Models/Builders/RetrieveLocationBookingProfileResponseBuilder.php deleted file mode 100644 index e6465873..00000000 --- a/src/Models/Builders/RetrieveLocationBookingProfileResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Booking Profile Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationBookingProfileResponse()); - } - - /** - * Sets location booking profile field. - * - * @param LocationBookingProfile|null $value - */ - public function locationBookingProfile(?LocationBookingProfile $value): self - { - $this->instance->setLocationBookingProfile($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Booking Profile Response object. - */ - public function build(): RetrieveLocationBookingProfileResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 193d3f56..00000000 --- a/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Definition Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationCustomAttributeDefinitionRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Definition Request object. - */ - public function build(): RetrieveLocationCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index d912531c..00000000 --- a/src/Models/Builders/RetrieveLocationCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Definition Response object. - */ - public function build(): RetrieveLocationCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationCustomAttributeRequestBuilder.php b/src/Models/Builders/RetrieveLocationCustomAttributeRequestBuilder.php deleted file mode 100644 index 169adfbf..00000000 --- a/src/Models/Builders/RetrieveLocationCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationCustomAttributeRequest()); - } - - /** - * Sets with definition field. - * - * @param bool|null $value - */ - public function withDefinition(?bool $value): self - { - $this->instance->setWithDefinition($value); - return $this; - } - - /** - * Unsets with definition field. - */ - public function unsetWithDefinition(): self - { - $this->instance->unsetWithDefinition(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Request object. - */ - public function build(): RetrieveLocationCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationCustomAttributeResponseBuilder.php b/src/Models/Builders/RetrieveLocationCustomAttributeResponseBuilder.php deleted file mode 100644 index f44678a5..00000000 --- a/src/Models/Builders/RetrieveLocationCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Custom Attribute Response object. - */ - public function build(): RetrieveLocationCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationResponseBuilder.php b/src/Models/Builders/RetrieveLocationResponseBuilder.php deleted file mode 100644 index 5a40e681..00000000 --- a/src/Models/Builders/RetrieveLocationResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets location field. - * - * @param Location|null $value - */ - public function location(?Location $value): self - { - $this->instance->setLocation($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Response object. - */ - public function build(): RetrieveLocationResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLocationSettingsResponseBuilder.php b/src/Models/Builders/RetrieveLocationSettingsResponseBuilder.php deleted file mode 100644 index fdeb15c0..00000000 --- a/src/Models/Builders/RetrieveLocationSettingsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Location Settings Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLocationSettingsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets location settings field. - * - * @param CheckoutLocationSettings|null $value - */ - public function locationSettings(?CheckoutLocationSettings $value): self - { - $this->instance->setLocationSettings($value); - return $this; - } - - /** - * Initializes a new Retrieve Location Settings Response object. - */ - public function build(): RetrieveLocationSettingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLoyaltyAccountResponseBuilder.php b/src/Models/Builders/RetrieveLoyaltyAccountResponseBuilder.php deleted file mode 100644 index 543c7e1f..00000000 --- a/src/Models/Builders/RetrieveLoyaltyAccountResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Loyalty Account Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLoyaltyAccountResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty account field. - * - * @param LoyaltyAccount|null $value - */ - public function loyaltyAccount(?LoyaltyAccount $value): self - { - $this->instance->setLoyaltyAccount($value); - return $this; - } - - /** - * Initializes a new Retrieve Loyalty Account Response object. - */ - public function build(): RetrieveLoyaltyAccountResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLoyaltyProgramResponseBuilder.php b/src/Models/Builders/RetrieveLoyaltyProgramResponseBuilder.php deleted file mode 100644 index e6843cd9..00000000 --- a/src/Models/Builders/RetrieveLoyaltyProgramResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Loyalty Program Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLoyaltyProgramResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets program field. - * - * @param LoyaltyProgram|null $value - */ - public function program(?LoyaltyProgram $value): self - { - $this->instance->setProgram($value); - return $this; - } - - /** - * Initializes a new Retrieve Loyalty Program Response object. - */ - public function build(): RetrieveLoyaltyProgramResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLoyaltyPromotionResponseBuilder.php b/src/Models/Builders/RetrieveLoyaltyPromotionResponseBuilder.php deleted file mode 100644 index 29066180..00000000 --- a/src/Models/Builders/RetrieveLoyaltyPromotionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Loyalty Promotion Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLoyaltyPromotionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty promotion field. - * - * @param LoyaltyPromotion|null $value - */ - public function loyaltyPromotion(?LoyaltyPromotion $value): self - { - $this->instance->setLoyaltyPromotion($value); - return $this; - } - - /** - * Initializes a new Retrieve Loyalty Promotion Response object. - */ - public function build(): RetrieveLoyaltyPromotionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveLoyaltyRewardResponseBuilder.php b/src/Models/Builders/RetrieveLoyaltyRewardResponseBuilder.php deleted file mode 100644 index b40a7970..00000000 --- a/src/Models/Builders/RetrieveLoyaltyRewardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Loyalty Reward Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveLoyaltyRewardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets reward field. - * - * @param LoyaltyReward|null $value - */ - public function reward(?LoyaltyReward $value): self - { - $this->instance->setReward($value); - return $this; - } - - /** - * Initializes a new Retrieve Loyalty Reward Response object. - */ - public function build(): RetrieveLoyaltyRewardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index bc18bfc7..00000000 --- a/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Definition Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantCustomAttributeDefinitionRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Definition Request object. - */ - public function build(): RetrieveMerchantCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index dfe542eb..00000000 --- a/src/Models/Builders/RetrieveMerchantCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Definition Response object. - */ - public function build(): RetrieveMerchantCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantCustomAttributeRequestBuilder.php b/src/Models/Builders/RetrieveMerchantCustomAttributeRequestBuilder.php deleted file mode 100644 index db72caec..00000000 --- a/src/Models/Builders/RetrieveMerchantCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantCustomAttributeRequest()); - } - - /** - * Sets with definition field. - * - * @param bool|null $value - */ - public function withDefinition(?bool $value): self - { - $this->instance->setWithDefinition($value); - return $this; - } - - /** - * Unsets with definition field. - */ - public function unsetWithDefinition(): self - { - $this->instance->unsetWithDefinition(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Request object. - */ - public function build(): RetrieveMerchantCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantCustomAttributeResponseBuilder.php b/src/Models/Builders/RetrieveMerchantCustomAttributeResponseBuilder.php deleted file mode 100644 index 97fade6c..00000000 --- a/src/Models/Builders/RetrieveMerchantCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Custom Attribute Response object. - */ - public function build(): RetrieveMerchantCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantResponseBuilder.php b/src/Models/Builders/RetrieveMerchantResponseBuilder.php deleted file mode 100644 index 59d2e064..00000000 --- a/src/Models/Builders/RetrieveMerchantResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets merchant field. - * - * @param Merchant|null $value - */ - public function merchant(?Merchant $value): self - { - $this->instance->setMerchant($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Response object. - */ - public function build(): RetrieveMerchantResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveMerchantSettingsResponseBuilder.php b/src/Models/Builders/RetrieveMerchantSettingsResponseBuilder.php deleted file mode 100644 index bd446c3d..00000000 --- a/src/Models/Builders/RetrieveMerchantSettingsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Merchant Settings Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveMerchantSettingsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets merchant settings field. - * - * @param CheckoutMerchantSettings|null $value - */ - public function merchantSettings(?CheckoutMerchantSettings $value): self - { - $this->instance->setMerchantSettings($value); - return $this; - } - - /** - * Initializes a new Retrieve Merchant Settings Response object. - */ - public function build(): RetrieveMerchantSettingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 970d6194..00000000 --- a/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Definition Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveOrderCustomAttributeDefinitionRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Definition Request object. - */ - public function build(): RetrieveOrderCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index d919455c..00000000 --- a/src/Models/Builders/RetrieveOrderCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveOrderCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Definition Response object. - */ - public function build(): RetrieveOrderCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveOrderCustomAttributeRequestBuilder.php b/src/Models/Builders/RetrieveOrderCustomAttributeRequestBuilder.php deleted file mode 100644 index 2289c415..00000000 --- a/src/Models/Builders/RetrieveOrderCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveOrderCustomAttributeRequest()); - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets with definition field. - * - * @param bool|null $value - */ - public function withDefinition(?bool $value): self - { - $this->instance->setWithDefinition($value); - return $this; - } - - /** - * Unsets with definition field. - */ - public function unsetWithDefinition(): self - { - $this->instance->unsetWithDefinition(); - return $this; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Request object. - */ - public function build(): RetrieveOrderCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveOrderCustomAttributeResponseBuilder.php b/src/Models/Builders/RetrieveOrderCustomAttributeResponseBuilder.php deleted file mode 100644 index 8d51d803..00000000 --- a/src/Models/Builders/RetrieveOrderCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveOrderCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Order Custom Attribute Response object. - */ - public function build(): RetrieveOrderCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveOrderResponseBuilder.php b/src/Models/Builders/RetrieveOrderResponseBuilder.php deleted file mode 100644 index b4140f88..00000000 --- a/src/Models/Builders/RetrieveOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Order Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveOrderResponse()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Order Response object. - */ - public function build(): RetrieveOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrievePaymentLinkResponseBuilder.php b/src/Models/Builders/RetrievePaymentLinkResponseBuilder.php deleted file mode 100644 index 2f067304..00000000 --- a/src/Models/Builders/RetrievePaymentLinkResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Payment Link Response Builder object. - */ - public static function init(): self - { - return new self(new RetrievePaymentLinkResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment link field. - * - * @param PaymentLink|null $value - */ - public function paymentLink(?PaymentLink $value): self - { - $this->instance->setPaymentLink($value); - return $this; - } - - /** - * Initializes a new Retrieve Payment Link Response object. - */ - public function build(): RetrievePaymentLinkResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveSnippetResponseBuilder.php b/src/Models/Builders/RetrieveSnippetResponseBuilder.php deleted file mode 100644 index 5b4c2f24..00000000 --- a/src/Models/Builders/RetrieveSnippetResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Snippet Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveSnippetResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets snippet field. - * - * @param Snippet|null $value - */ - public function snippet(?Snippet $value): self - { - $this->instance->setSnippet($value); - return $this; - } - - /** - * Initializes a new Retrieve Snippet Response object. - */ - public function build(): RetrieveSnippetResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveSubscriptionRequestBuilder.php b/src/Models/Builders/RetrieveSubscriptionRequestBuilder.php deleted file mode 100644 index 6632e7ac..00000000 --- a/src/Models/Builders/RetrieveSubscriptionRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new RetrieveSubscriptionRequest()); - } - - /** - * Sets include field. - * - * @param string|null $value - */ - public function include(?string $value): self - { - $this->instance->setInclude($value); - return $this; - } - - /** - * Unsets include field. - */ - public function unsetInclude(): self - { - $this->instance->unsetInclude(); - return $this; - } - - /** - * Initializes a new Retrieve Subscription Request object. - */ - public function build(): RetrieveSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveSubscriptionResponseBuilder.php b/src/Models/Builders/RetrieveSubscriptionResponseBuilder.php deleted file mode 100644 index c4fa3039..00000000 --- a/src/Models/Builders/RetrieveSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Retrieve Subscription Response object. - */ - public function build(): RetrieveSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveTeamMemberBookingProfileResponseBuilder.php b/src/Models/Builders/RetrieveTeamMemberBookingProfileResponseBuilder.php deleted file mode 100644 index 64f81eaf..00000000 --- a/src/Models/Builders/RetrieveTeamMemberBookingProfileResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Team Member Booking Profile Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveTeamMemberBookingProfileResponse()); - } - - /** - * Sets team member booking profile field. - * - * @param TeamMemberBookingProfile|null $value - */ - public function teamMemberBookingProfile(?TeamMemberBookingProfile $value): self - { - $this->instance->setTeamMemberBookingProfile($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Team Member Booking Profile Response object. - */ - public function build(): RetrieveTeamMemberBookingProfileResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveTeamMemberResponseBuilder.php b/src/Models/Builders/RetrieveTeamMemberResponseBuilder.php deleted file mode 100644 index 04822f4c..00000000 --- a/src/Models/Builders/RetrieveTeamMemberResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Team Member Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveTeamMemberResponse()); - } - - /** - * Sets team member field. - * - * @param TeamMember|null $value - */ - public function teamMember(?TeamMember $value): self - { - $this->instance->setTeamMember($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Team Member Response object. - */ - public function build(): RetrieveTeamMemberResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveTokenStatusResponseBuilder.php b/src/Models/Builders/RetrieveTokenStatusResponseBuilder.php deleted file mode 100644 index 0047094e..00000000 --- a/src/Models/Builders/RetrieveTokenStatusResponseBuilder.php +++ /dev/null @@ -1,98 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Token Status Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveTokenStatusResponse()); - } - - /** - * Sets scopes field. - * - * @param string[]|null $value - */ - public function scopes(?array $value): self - { - $this->instance->setScopes($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Sets client id field. - * - * @param string|null $value - */ - public function clientId(?string $value): self - { - $this->instance->setClientId($value); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Token Status Response object. - */ - public function build(): RetrieveTokenStatusResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveTransactionResponseBuilder.php b/src/Models/Builders/RetrieveTransactionResponseBuilder.php deleted file mode 100644 index 61c4fdb5..00000000 --- a/src/Models/Builders/RetrieveTransactionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Transaction Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveTransactionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets transaction field. - * - * @param Transaction|null $value - */ - public function transaction(?Transaction $value): self - { - $this->instance->setTransaction($value); - return $this; - } - - /** - * Initializes a new Retrieve Transaction Response object. - */ - public function build(): RetrieveTransactionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveVendorResponseBuilder.php b/src/Models/Builders/RetrieveVendorResponseBuilder.php deleted file mode 100644 index ece85b91..00000000 --- a/src/Models/Builders/RetrieveVendorResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Vendor Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveVendorResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets vendor field. - * - * @param Vendor|null $value - */ - public function vendor(?Vendor $value): self - { - $this->instance->setVendor($value); - return $this; - } - - /** - * Initializes a new Retrieve Vendor Response object. - */ - public function build(): RetrieveVendorResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveWageSettingResponseBuilder.php b/src/Models/Builders/RetrieveWageSettingResponseBuilder.php deleted file mode 100644 index f86c3cf9..00000000 --- a/src/Models/Builders/RetrieveWageSettingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Wage Setting Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveWageSettingResponse()); - } - - /** - * Sets wage setting field. - * - * @param WageSetting|null $value - */ - public function wageSetting(?WageSetting $value): self - { - $this->instance->setWageSetting($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Retrieve Wage Setting Response object. - */ - public function build(): RetrieveWageSettingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RetrieveWebhookSubscriptionResponseBuilder.php b/src/Models/Builders/RetrieveWebhookSubscriptionResponseBuilder.php deleted file mode 100644 index 072794ea..00000000 --- a/src/Models/Builders/RetrieveWebhookSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Retrieve Webhook Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new RetrieveWebhookSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param WebhookSubscription|null $value - */ - public function subscription(?WebhookSubscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Retrieve Webhook Subscription Response object. - */ - public function build(): RetrieveWebhookSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RevokeTokenRequestBuilder.php b/src/Models/Builders/RevokeTokenRequestBuilder.php deleted file mode 100644 index 024860f3..00000000 --- a/src/Models/Builders/RevokeTokenRequestBuilder.php +++ /dev/null @@ -1,122 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Revoke Token Request Builder object. - */ - public static function init(): self - { - return new self(new RevokeTokenRequest()); - } - - /** - * Sets client id field. - * - * @param string|null $value - */ - public function clientId(?string $value): self - { - $this->instance->setClientId($value); - return $this; - } - - /** - * Unsets client id field. - */ - public function unsetClientId(): self - { - $this->instance->unsetClientId(); - return $this; - } - - /** - * Sets access token field. - * - * @param string|null $value - */ - public function accessToken(?string $value): self - { - $this->instance->setAccessToken($value); - return $this; - } - - /** - * Unsets access token field. - */ - public function unsetAccessToken(): self - { - $this->instance->unsetAccessToken(); - return $this; - } - - /** - * Sets merchant id field. - * - * @param string|null $value - */ - public function merchantId(?string $value): self - { - $this->instance->setMerchantId($value); - return $this; - } - - /** - * Unsets merchant id field. - */ - public function unsetMerchantId(): self - { - $this->instance->unsetMerchantId(); - return $this; - } - - /** - * Sets revoke only access token field. - * - * @param bool|null $value - */ - public function revokeOnlyAccessToken(?bool $value): self - { - $this->instance->setRevokeOnlyAccessToken($value); - return $this; - } - - /** - * Unsets revoke only access token field. - */ - public function unsetRevokeOnlyAccessToken(): self - { - $this->instance->unsetRevokeOnlyAccessToken(); - return $this; - } - - /** - * Initializes a new Revoke Token Request object. - */ - public function build(): RevokeTokenRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RevokeTokenResponseBuilder.php b/src/Models/Builders/RevokeTokenResponseBuilder.php deleted file mode 100644 index 4bb55215..00000000 --- a/src/Models/Builders/RevokeTokenResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Revoke Token Response Builder object. - */ - public static function init(): self - { - return new self(new RevokeTokenResponse()); - } - - /** - * Sets success field. - * - * @param bool|null $value - */ - public function success(?bool $value): self - { - $this->instance->setSuccess($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Revoke Token Response object. - */ - public function build(): RevokeTokenResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/RiskEvaluationBuilder.php b/src/Models/Builders/RiskEvaluationBuilder.php deleted file mode 100644 index 11b28db6..00000000 --- a/src/Models/Builders/RiskEvaluationBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Risk Evaluation Builder object. - */ - public static function init(): self - { - return new self(new RiskEvaluation()); - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets risk level field. - * - * @param string|null $value - */ - public function riskLevel(?string $value): self - { - $this->instance->setRiskLevel($value); - return $this; - } - - /** - * Initializes a new Risk Evaluation object. - */ - public function build(): RiskEvaluation - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SaveCardOptionsBuilder.php b/src/Models/Builders/SaveCardOptionsBuilder.php deleted file mode 100644 index 35eb2995..00000000 --- a/src/Models/Builders/SaveCardOptionsBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Save Card Options Builder object. - * - * @param string $customerId - */ - public static function init(string $customerId): self - { - return new self(new SaveCardOptions($customerId)); - } - - /** - * Sets card id field. - * - * @param string|null $value - */ - public function cardId(?string $value): self - { - $this->instance->setCardId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Initializes a new Save Card Options object. - */ - public function build(): SaveCardOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchAvailabilityFilterBuilder.php b/src/Models/Builders/SearchAvailabilityFilterBuilder.php deleted file mode 100644 index ce1465c1..00000000 --- a/src/Models/Builders/SearchAvailabilityFilterBuilder.php +++ /dev/null @@ -1,106 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Availability Filter Builder object. - * - * @param TimeRange $startAtRange - */ - public static function init(TimeRange $startAtRange): self - { - return new self(new SearchAvailabilityFilter($startAtRange)); - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets segment filters field. - * - * @param SegmentFilter[]|null $value - */ - public function segmentFilters(?array $value): self - { - $this->instance->setSegmentFilters($value); - return $this; - } - - /** - * Unsets segment filters field. - */ - public function unsetSegmentFilters(): self - { - $this->instance->unsetSegmentFilters(); - return $this; - } - - /** - * Sets booking id field. - * - * @param string|null $value - */ - public function bookingId(?string $value): self - { - $this->instance->setBookingId($value); - return $this; - } - - /** - * Unsets booking id field. - */ - public function unsetBookingId(): self - { - $this->instance->unsetBookingId(); - return $this; - } - - /** - * Initializes a new Search Availability Filter object. - */ - public function build(): SearchAvailabilityFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchAvailabilityQueryBuilder.php b/src/Models/Builders/SearchAvailabilityQueryBuilder.php deleted file mode 100644 index a29c05d3..00000000 --- a/src/Models/Builders/SearchAvailabilityQueryBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Availability Query Builder object. - * - * @param SearchAvailabilityFilter $filter - */ - public static function init(SearchAvailabilityFilter $filter): self - { - return new self(new SearchAvailabilityQuery($filter)); - } - - /** - * Initializes a new Search Availability Query object. - */ - public function build(): SearchAvailabilityQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchAvailabilityRequestBuilder.php b/src/Models/Builders/SearchAvailabilityRequestBuilder.php deleted file mode 100644 index 3025763d..00000000 --- a/src/Models/Builders/SearchAvailabilityRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Availability Request Builder object. - * - * @param SearchAvailabilityQuery $query - */ - public static function init(SearchAvailabilityQuery $query): self - { - return new self(new SearchAvailabilityRequest($query)); - } - - /** - * Initializes a new Search Availability Request object. - */ - public function build(): SearchAvailabilityRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchAvailabilityResponseBuilder.php b/src/Models/Builders/SearchAvailabilityResponseBuilder.php deleted file mode 100644 index 70897a52..00000000 --- a/src/Models/Builders/SearchAvailabilityResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Availability Response Builder object. - */ - public static function init(): self - { - return new self(new SearchAvailabilityResponse()); - } - - /** - * Sets availabilities field. - * - * @param Availability[]|null $value - */ - public function availabilities(?array $value): self - { - $this->instance->setAvailabilities($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Search Availability Response object. - */ - public function build(): SearchAvailabilityResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCatalogItemsRequestBuilder.php b/src/Models/Builders/SearchCatalogItemsRequestBuilder.php deleted file mode 100644 index 7dc3e6e5..00000000 --- a/src/Models/Builders/SearchCatalogItemsRequestBuilder.php +++ /dev/null @@ -1,153 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Catalog Items Request Builder object. - */ - public static function init(): self - { - return new self(new SearchCatalogItemsRequest()); - } - - /** - * Sets text filter field. - * - * @param string|null $value - */ - public function textFilter(?string $value): self - { - $this->instance->setTextFilter($value); - return $this; - } - - /** - * Sets category ids field. - * - * @param string[]|null $value - */ - public function categoryIds(?array $value): self - { - $this->instance->setCategoryIds($value); - return $this; - } - - /** - * Sets stock levels field. - * - * @param string[]|null $value - */ - public function stockLevels(?array $value): self - { - $this->instance->setStockLevels($value); - return $this; - } - - /** - * Sets enabled location ids field. - * - * @param string[]|null $value - */ - public function enabledLocationIds(?array $value): self - { - $this->instance->setEnabledLocationIds($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Sets product types field. - * - * @param string[]|null $value - */ - public function productTypes(?array $value): self - { - $this->instance->setProductTypes($value); - return $this; - } - - /** - * Sets custom attribute filters field. - * - * @param CustomAttributeFilter[]|null $value - */ - public function customAttributeFilters(?array $value): self - { - $this->instance->setCustomAttributeFilters($value); - return $this; - } - - /** - * Sets archived state field. - * - * @param string|null $value - */ - public function archivedState(?string $value): self - { - $this->instance->setArchivedState($value); - return $this; - } - - /** - * Initializes a new Search Catalog Items Request object. - */ - public function build(): SearchCatalogItemsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCatalogItemsResponseBuilder.php b/src/Models/Builders/SearchCatalogItemsResponseBuilder.php deleted file mode 100644 index 3bdde7d9..00000000 --- a/src/Models/Builders/SearchCatalogItemsResponseBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Catalog Items Response Builder object. - */ - public static function init(): self - { - return new self(new SearchCatalogItemsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets items field. - * - * @param CatalogObject[]|null $value - */ - public function items(?array $value): self - { - $this->instance->setItems($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets matched variation ids field. - * - * @param string[]|null $value - */ - public function matchedVariationIds(?array $value): self - { - $this->instance->setMatchedVariationIds($value); - return $this; - } - - /** - * Initializes a new Search Catalog Items Response object. - */ - public function build(): SearchCatalogItemsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCatalogObjectsRequestBuilder.php b/src/Models/Builders/SearchCatalogObjectsRequestBuilder.php deleted file mode 100644 index 75559aec..00000000 --- a/src/Models/Builders/SearchCatalogObjectsRequestBuilder.php +++ /dev/null @@ -1,131 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Catalog Objects Request Builder object. - */ - public static function init(): self - { - return new self(new SearchCatalogObjectsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets object types field. - * - * @param string[]|null $value - */ - public function objectTypes(?array $value): self - { - $this->instance->setObjectTypes($value); - return $this; - } - - /** - * Sets include deleted objects field. - * - * @param bool|null $value - */ - public function includeDeletedObjects(?bool $value): self - { - $this->instance->setIncludeDeletedObjects($value); - return $this; - } - - /** - * Sets include related objects field. - * - * @param bool|null $value - */ - public function includeRelatedObjects(?bool $value): self - { - $this->instance->setIncludeRelatedObjects($value); - return $this; - } - - /** - * Sets begin time field. - * - * @param string|null $value - */ - public function beginTime(?string $value): self - { - $this->instance->setBeginTime($value); - return $this; - } - - /** - * Sets query field. - * - * @param CatalogQuery|null $value - */ - public function query(?CatalogQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets include category path to root field. - * - * @param bool|null $value - */ - public function includeCategoryPathToRoot(?bool $value): self - { - $this->instance->setIncludeCategoryPathToRoot($value); - return $this; - } - - /** - * Initializes a new Search Catalog Objects Request object. - */ - public function build(): SearchCatalogObjectsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCatalogObjectsResponseBuilder.php b/src/Models/Builders/SearchCatalogObjectsResponseBuilder.php deleted file mode 100644 index 8b1b2cc5..00000000 --- a/src/Models/Builders/SearchCatalogObjectsResponseBuilder.php +++ /dev/null @@ -1,99 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Catalog Objects Response Builder object. - */ - public static function init(): self - { - return new self(new SearchCatalogObjectsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets objects field. - * - * @param CatalogObject[]|null $value - */ - public function objects(?array $value): self - { - $this->instance->setObjects($value); - return $this; - } - - /** - * Sets related objects field. - * - * @param CatalogObject[]|null $value - */ - public function relatedObjects(?array $value): self - { - $this->instance->setRelatedObjects($value); - return $this; - } - - /** - * Sets latest time field. - * - * @param string|null $value - */ - public function latestTime(?string $value): self - { - $this->instance->setLatestTime($value); - return $this; - } - - /** - * Initializes a new Search Catalog Objects Response object. - */ - public function build(): SearchCatalogObjectsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCustomersRequestBuilder.php b/src/Models/Builders/SearchCustomersRequestBuilder.php deleted file mode 100644 index 173b6fe0..00000000 --- a/src/Models/Builders/SearchCustomersRequestBuilder.php +++ /dev/null @@ -1,87 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Customers Request Builder object. - */ - public static function init(): self - { - return new self(new SearchCustomersRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets query field. - * - * @param CustomerQuery|null $value - */ - public function query(?CustomerQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets count field. - * - * @param bool|null $value - */ - public function count(?bool $value): self - { - $this->instance->setCount($value); - return $this; - } - - /** - * Initializes a new Search Customers Request object. - */ - public function build(): SearchCustomersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchCustomersResponseBuilder.php b/src/Models/Builders/SearchCustomersResponseBuilder.php deleted file mode 100644 index 2011df07..00000000 --- a/src/Models/Builders/SearchCustomersResponseBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Customers Response Builder object. - */ - public static function init(): self - { - return new self(new SearchCustomersResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets customers field. - * - * @param Customer[]|null $value - */ - public function customers(?array $value): self - { - $this->instance->setCustomers($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets count field. - * - * @param int|null $value - */ - public function count(?int $value): self - { - $this->instance->setCount($value); - return $this; - } - - /** - * Initializes a new Search Customers Response object. - */ - public function build(): SearchCustomersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchEventsFilterBuilder.php b/src/Models/Builders/SearchEventsFilterBuilder.php deleted file mode 100644 index 2227de4c..00000000 --- a/src/Models/Builders/SearchEventsFilterBuilder.php +++ /dev/null @@ -1,114 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Events Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchEventsFilter()); - } - - /** - * Sets event types field. - * - * @param string[]|null $value - */ - public function eventTypes(?array $value): self - { - $this->instance->setEventTypes($value); - return $this; - } - - /** - * Unsets event types field. - */ - public function unsetEventTypes(): self - { - $this->instance->unsetEventTypes(); - return $this; - } - - /** - * Sets merchant ids field. - * - * @param string[]|null $value - */ - public function merchantIds(?array $value): self - { - $this->instance->setMerchantIds($value); - return $this; - } - - /** - * Unsets merchant ids field. - */ - public function unsetMerchantIds(): self - { - $this->instance->unsetMerchantIds(); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new Search Events Filter object. - */ - public function build(): SearchEventsFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchEventsQueryBuilder.php b/src/Models/Builders/SearchEventsQueryBuilder.php deleted file mode 100644 index e94ee9e5..00000000 --- a/src/Models/Builders/SearchEventsQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Events Query Builder object. - */ - public static function init(): self - { - return new self(new SearchEventsQuery()); - } - - /** - * Sets filter field. - * - * @param SearchEventsFilter|null $value - */ - public function filter(?SearchEventsFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param SearchEventsSort|null $value - */ - public function sort(?SearchEventsSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Search Events Query object. - */ - public function build(): SearchEventsQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchEventsRequestBuilder.php b/src/Models/Builders/SearchEventsRequestBuilder.php deleted file mode 100644 index 21df20d4..00000000 --- a/src/Models/Builders/SearchEventsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Events Request Builder object. - */ - public static function init(): self - { - return new self(new SearchEventsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets query field. - * - * @param SearchEventsQuery|null $value - */ - public function query(?SearchEventsQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Initializes a new Search Events Request object. - */ - public function build(): SearchEventsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchEventsResponseBuilder.php b/src/Models/Builders/SearchEventsResponseBuilder.php deleted file mode 100644 index cfcecd1b..00000000 --- a/src/Models/Builders/SearchEventsResponseBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Events Response Builder object. - */ - public static function init(): self - { - return new self(new SearchEventsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets events field. - * - * @param Event[]|null $value - */ - public function events(?array $value): self - { - $this->instance->setEvents($value); - return $this; - } - - /** - * Sets metadata field. - * - * @param EventMetadata[]|null $value - */ - public function metadata(?array $value): self - { - $this->instance->setMetadata($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Events Response object. - */ - public function build(): SearchEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchEventsSortBuilder.php b/src/Models/Builders/SearchEventsSortBuilder.php deleted file mode 100644 index 38f23f9f..00000000 --- a/src/Models/Builders/SearchEventsSortBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Events Sort Builder object. - */ - public static function init(): self - { - return new self(new SearchEventsSort()); - } - - /** - * Sets field field. - * - * @param string|null $value - */ - public function field(?string $value): self - { - $this->instance->setField($value); - return $this; - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Search Events Sort object. - */ - public function build(): SearchEventsSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchInvoicesRequestBuilder.php b/src/Models/Builders/SearchInvoicesRequestBuilder.php deleted file mode 100644 index 0a3252b6..00000000 --- a/src/Models/Builders/SearchInvoicesRequestBuilder.php +++ /dev/null @@ -1,67 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Invoices Request Builder object. - * - * @param InvoiceQuery $query - */ - public static function init(InvoiceQuery $query): self - { - return new self(new SearchInvoicesRequest($query)); - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Invoices Request object. - */ - public function build(): SearchInvoicesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchInvoicesResponseBuilder.php b/src/Models/Builders/SearchInvoicesResponseBuilder.php deleted file mode 100644 index b8e56cd0..00000000 --- a/src/Models/Builders/SearchInvoicesResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Invoices Response Builder object. - */ - public static function init(): self - { - return new self(new SearchInvoicesResponse()); - } - - /** - * Sets invoices field. - * - * @param Invoice[]|null $value - */ - public function invoices(?array $value): self - { - $this->instance->setInvoices($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Search Invoices Response object. - */ - public function build(): SearchInvoicesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyAccountsRequestBuilder.php b/src/Models/Builders/SearchLoyaltyAccountsRequestBuilder.php deleted file mode 100644 index f60757b9..00000000 --- a/src/Models/Builders/SearchLoyaltyAccountsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Accounts Request Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyAccountsRequest()); - } - - /** - * Sets query field. - * - * @param SearchLoyaltyAccountsRequestLoyaltyAccountQuery|null $value - */ - public function query(?SearchLoyaltyAccountsRequestLoyaltyAccountQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Accounts Request object. - */ - public function build(): SearchLoyaltyAccountsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyAccountsRequestLoyaltyAccountQueryBuilder.php b/src/Models/Builders/SearchLoyaltyAccountsRequestLoyaltyAccountQueryBuilder.php deleted file mode 100644 index 62737e58..00000000 --- a/src/Models/Builders/SearchLoyaltyAccountsRequestLoyaltyAccountQueryBuilder.php +++ /dev/null @@ -1,83 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Accounts Request Loyalty Account Query Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyAccountsRequestLoyaltyAccountQuery()); - } - - /** - * Sets mappings field. - * - * @param LoyaltyAccountMapping[]|null $value - */ - public function mappings(?array $value): self - { - $this->instance->setMappings($value); - return $this; - } - - /** - * Unsets mappings field. - */ - public function unsetMappings(): self - { - $this->instance->unsetMappings(); - return $this; - } - - /** - * Sets customer ids field. - * - * @param string[]|null $value - */ - public function customerIds(?array $value): self - { - $this->instance->setCustomerIds($value); - return $this; - } - - /** - * Unsets customer ids field. - */ - public function unsetCustomerIds(): self - { - $this->instance->unsetCustomerIds(); - return $this; - } - - /** - * Initializes a new Search Loyalty Accounts Request Loyalty Account Query object. - */ - public function build(): SearchLoyaltyAccountsRequestLoyaltyAccountQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyAccountsResponseBuilder.php b/src/Models/Builders/SearchLoyaltyAccountsResponseBuilder.php deleted file mode 100644 index e6ae3622..00000000 --- a/src/Models/Builders/SearchLoyaltyAccountsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Accounts Response Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyAccountsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets loyalty accounts field. - * - * @param LoyaltyAccount[]|null $value - */ - public function loyaltyAccounts(?array $value): self - { - $this->instance->setLoyaltyAccounts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Accounts Response object. - */ - public function build(): SearchLoyaltyAccountsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyEventsRequestBuilder.php b/src/Models/Builders/SearchLoyaltyEventsRequestBuilder.php deleted file mode 100644 index e06baccd..00000000 --- a/src/Models/Builders/SearchLoyaltyEventsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Events Request Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyEventsRequest()); - } - - /** - * Sets query field. - * - * @param LoyaltyEventQuery|null $value - */ - public function query(?LoyaltyEventQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Events Request object. - */ - public function build(): SearchLoyaltyEventsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyEventsResponseBuilder.php b/src/Models/Builders/SearchLoyaltyEventsResponseBuilder.php deleted file mode 100644 index 03a6cd5c..00000000 --- a/src/Models/Builders/SearchLoyaltyEventsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Events Response Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyEventsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets events field. - * - * @param LoyaltyEvent[]|null $value - */ - public function events(?array $value): self - { - $this->instance->setEvents($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Events Response object. - */ - public function build(): SearchLoyaltyEventsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyRewardsRequestBuilder.php b/src/Models/Builders/SearchLoyaltyRewardsRequestBuilder.php deleted file mode 100644 index 797decc0..00000000 --- a/src/Models/Builders/SearchLoyaltyRewardsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Rewards Request Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyRewardsRequest()); - } - - /** - * Sets query field. - * - * @param SearchLoyaltyRewardsRequestLoyaltyRewardQuery|null $value - */ - public function query(?SearchLoyaltyRewardsRequestLoyaltyRewardQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Rewards Request object. - */ - public function build(): SearchLoyaltyRewardsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyRewardsRequestLoyaltyRewardQueryBuilder.php b/src/Models/Builders/SearchLoyaltyRewardsRequestLoyaltyRewardQueryBuilder.php deleted file mode 100644 index 0f7ed0e0..00000000 --- a/src/Models/Builders/SearchLoyaltyRewardsRequestLoyaltyRewardQueryBuilder.php +++ /dev/null @@ -1,55 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Rewards Request Loyalty Reward Query Builder object. - * - * @param string $loyaltyAccountId - */ - public static function init(string $loyaltyAccountId): self - { - return new self(new SearchLoyaltyRewardsRequestLoyaltyRewardQuery($loyaltyAccountId)); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Rewards Request Loyalty Reward Query object. - */ - public function build(): SearchLoyaltyRewardsRequestLoyaltyRewardQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchLoyaltyRewardsResponseBuilder.php b/src/Models/Builders/SearchLoyaltyRewardsResponseBuilder.php deleted file mode 100644 index 2b912f21..00000000 --- a/src/Models/Builders/SearchLoyaltyRewardsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Loyalty Rewards Response Builder object. - */ - public static function init(): self - { - return new self(new SearchLoyaltyRewardsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets rewards field. - * - * @param LoyaltyReward[]|null $value - */ - public function rewards(?array $value): self - { - $this->instance->setRewards($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Loyalty Rewards Response object. - */ - public function build(): SearchLoyaltyRewardsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersCustomerFilterBuilder.php b/src/Models/Builders/SearchOrdersCustomerFilterBuilder.php deleted file mode 100644 index c9e4258b..00000000 --- a/src/Models/Builders/SearchOrdersCustomerFilterBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Customer Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersCustomerFilter()); - } - - /** - * Sets customer ids field. - * - * @param string[]|null $value - */ - public function customerIds(?array $value): self - { - $this->instance->setCustomerIds($value); - return $this; - } - - /** - * Unsets customer ids field. - */ - public function unsetCustomerIds(): self - { - $this->instance->unsetCustomerIds(); - return $this; - } - - /** - * Initializes a new Search Orders Customer Filter object. - */ - public function build(): SearchOrdersCustomerFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersDateTimeFilterBuilder.php b/src/Models/Builders/SearchOrdersDateTimeFilterBuilder.php deleted file mode 100644 index 4ef6a348..00000000 --- a/src/Models/Builders/SearchOrdersDateTimeFilterBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Date Time Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersDateTimeFilter()); - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param TimeRange|null $value - */ - public function updatedAt(?TimeRange $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets closed at field. - * - * @param TimeRange|null $value - */ - public function closedAt(?TimeRange $value): self - { - $this->instance->setClosedAt($value); - return $this; - } - - /** - * Initializes a new Search Orders Date Time Filter object. - */ - public function build(): SearchOrdersDateTimeFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersFilterBuilder.php b/src/Models/Builders/SearchOrdersFilterBuilder.php deleted file mode 100644 index 6c00f691..00000000 --- a/src/Models/Builders/SearchOrdersFilterBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersFilter()); - } - - /** - * Sets state filter field. - * - * @param SearchOrdersStateFilter|null $value - */ - public function stateFilter(?SearchOrdersStateFilter $value): self - { - $this->instance->setStateFilter($value); - return $this; - } - - /** - * Sets date time filter field. - * - * @param SearchOrdersDateTimeFilter|null $value - */ - public function dateTimeFilter(?SearchOrdersDateTimeFilter $value): self - { - $this->instance->setDateTimeFilter($value); - return $this; - } - - /** - * Sets fulfillment filter field. - * - * @param SearchOrdersFulfillmentFilter|null $value - */ - public function fulfillmentFilter(?SearchOrdersFulfillmentFilter $value): self - { - $this->instance->setFulfillmentFilter($value); - return $this; - } - - /** - * Sets source filter field. - * - * @param SearchOrdersSourceFilter|null $value - */ - public function sourceFilter(?SearchOrdersSourceFilter $value): self - { - $this->instance->setSourceFilter($value); - return $this; - } - - /** - * Sets customer filter field. - * - * @param SearchOrdersCustomerFilter|null $value - */ - public function customerFilter(?SearchOrdersCustomerFilter $value): self - { - $this->instance->setCustomerFilter($value); - return $this; - } - - /** - * Initializes a new Search Orders Filter object. - */ - public function build(): SearchOrdersFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersFulfillmentFilterBuilder.php b/src/Models/Builders/SearchOrdersFulfillmentFilterBuilder.php deleted file mode 100644 index f5aa7d59..00000000 --- a/src/Models/Builders/SearchOrdersFulfillmentFilterBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Fulfillment Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersFulfillmentFilter()); - } - - /** - * Sets fulfillment types field. - * - * @param string[]|null $value - */ - public function fulfillmentTypes(?array $value): self - { - $this->instance->setFulfillmentTypes($value); - return $this; - } - - /** - * Unsets fulfillment types field. - */ - public function unsetFulfillmentTypes(): self - { - $this->instance->unsetFulfillmentTypes(); - return $this; - } - - /** - * Sets fulfillment states field. - * - * @param string[]|null $value - */ - public function fulfillmentStates(?array $value): self - { - $this->instance->setFulfillmentStates($value); - return $this; - } - - /** - * Unsets fulfillment states field. - */ - public function unsetFulfillmentStates(): self - { - $this->instance->unsetFulfillmentStates(); - return $this; - } - - /** - * Initializes a new Search Orders Fulfillment Filter object. - */ - public function build(): SearchOrdersFulfillmentFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersQueryBuilder.php b/src/Models/Builders/SearchOrdersQueryBuilder.php deleted file mode 100644 index e5d84e36..00000000 --- a/src/Models/Builders/SearchOrdersQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Query Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersQuery()); - } - - /** - * Sets filter field. - * - * @param SearchOrdersFilter|null $value - */ - public function filter(?SearchOrdersFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param SearchOrdersSort|null $value - */ - public function sort(?SearchOrdersSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Search Orders Query object. - */ - public function build(): SearchOrdersQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersRequestBuilder.php b/src/Models/Builders/SearchOrdersRequestBuilder.php deleted file mode 100644 index 29b4edca..00000000 --- a/src/Models/Builders/SearchOrdersRequestBuilder.php +++ /dev/null @@ -1,98 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Request Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersRequest()); - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets query field. - * - * @param SearchOrdersQuery|null $value - */ - public function query(?SearchOrdersQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets return entries field. - * - * @param bool|null $value - */ - public function returnEntries(?bool $value): self - { - $this->instance->setReturnEntries($value); - return $this; - } - - /** - * Initializes a new Search Orders Request object. - */ - public function build(): SearchOrdersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersResponseBuilder.php b/src/Models/Builders/SearchOrdersResponseBuilder.php deleted file mode 100644 index 51d2a8d8..00000000 --- a/src/Models/Builders/SearchOrdersResponseBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Response Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersResponse()); - } - - /** - * Sets order entries field. - * - * @param OrderEntry[]|null $value - */ - public function orderEntries(?array $value): self - { - $this->instance->setOrderEntries($value); - return $this; - } - - /** - * Sets orders field. - * - * @param Order[]|null $value - */ - public function orders(?array $value): self - { - $this->instance->setOrders($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Search Orders Response object. - */ - public function build(): SearchOrdersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersSortBuilder.php b/src/Models/Builders/SearchOrdersSortBuilder.php deleted file mode 100644 index 2b682650..00000000 --- a/src/Models/Builders/SearchOrdersSortBuilder.php +++ /dev/null @@ -1,55 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Sort Builder object. - * - * @param string $sortField - */ - public static function init(string $sortField): self - { - return new self(new SearchOrdersSort($sortField)); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Initializes a new Search Orders Sort object. - */ - public function build(): SearchOrdersSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersSourceFilterBuilder.php b/src/Models/Builders/SearchOrdersSourceFilterBuilder.php deleted file mode 100644 index 96afbbeb..00000000 --- a/src/Models/Builders/SearchOrdersSourceFilterBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders Source Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchOrdersSourceFilter()); - } - - /** - * Sets source names field. - * - * @param string[]|null $value - */ - public function sourceNames(?array $value): self - { - $this->instance->setSourceNames($value); - return $this; - } - - /** - * Unsets source names field. - */ - public function unsetSourceNames(): self - { - $this->instance->unsetSourceNames(); - return $this; - } - - /** - * Initializes a new Search Orders Source Filter object. - */ - public function build(): SearchOrdersSourceFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchOrdersStateFilterBuilder.php b/src/Models/Builders/SearchOrdersStateFilterBuilder.php deleted file mode 100644 index ad7bc6d2..00000000 --- a/src/Models/Builders/SearchOrdersStateFilterBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Orders State Filter Builder object. - * - * @param string[] $states - */ - public static function init(array $states): self - { - return new self(new SearchOrdersStateFilter($states)); - } - - /** - * Initializes a new Search Orders State Filter object. - */ - public function build(): SearchOrdersStateFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchShiftsRequestBuilder.php b/src/Models/Builders/SearchShiftsRequestBuilder.php deleted file mode 100644 index 6db1a34d..00000000 --- a/src/Models/Builders/SearchShiftsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Shifts Request Builder object. - */ - public static function init(): self - { - return new self(new SearchShiftsRequest()); - } - - /** - * Sets query field. - * - * @param ShiftQuery|null $value - */ - public function query(?ShiftQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Shifts Request object. - */ - public function build(): SearchShiftsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchShiftsResponseBuilder.php b/src/Models/Builders/SearchShiftsResponseBuilder.php deleted file mode 100644 index f9afb568..00000000 --- a/src/Models/Builders/SearchShiftsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Shifts Response Builder object. - */ - public static function init(): self - { - return new self(new SearchShiftsResponse()); - } - - /** - * Sets shifts field. - * - * @param Shift[]|null $value - */ - public function shifts(?array $value): self - { - $this->instance->setShifts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Search Shifts Response object. - */ - public function build(): SearchShiftsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchSubscriptionsFilterBuilder.php b/src/Models/Builders/SearchSubscriptionsFilterBuilder.php deleted file mode 100644 index c7f9d76a..00000000 --- a/src/Models/Builders/SearchSubscriptionsFilterBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Subscriptions Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchSubscriptionsFilter()); - } - - /** - * Sets customer ids field. - * - * @param string[]|null $value - */ - public function customerIds(?array $value): self - { - $this->instance->setCustomerIds($value); - return $this; - } - - /** - * Unsets customer ids field. - */ - public function unsetCustomerIds(): self - { - $this->instance->unsetCustomerIds(); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets source names field. - * - * @param string[]|null $value - */ - public function sourceNames(?array $value): self - { - $this->instance->setSourceNames($value); - return $this; - } - - /** - * Unsets source names field. - */ - public function unsetSourceNames(): self - { - $this->instance->unsetSourceNames(); - return $this; - } - - /** - * Initializes a new Search Subscriptions Filter object. - */ - public function build(): SearchSubscriptionsFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchSubscriptionsQueryBuilder.php b/src/Models/Builders/SearchSubscriptionsQueryBuilder.php deleted file mode 100644 index 43c80de1..00000000 --- a/src/Models/Builders/SearchSubscriptionsQueryBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Subscriptions Query Builder object. - */ - public static function init(): self - { - return new self(new SearchSubscriptionsQuery()); - } - - /** - * Sets filter field. - * - * @param SearchSubscriptionsFilter|null $value - */ - public function filter(?SearchSubscriptionsFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Initializes a new Search Subscriptions Query object. - */ - public function build(): SearchSubscriptionsQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchSubscriptionsRequestBuilder.php b/src/Models/Builders/SearchSubscriptionsRequestBuilder.php deleted file mode 100644 index 56c82c34..00000000 --- a/src/Models/Builders/SearchSubscriptionsRequestBuilder.php +++ /dev/null @@ -1,87 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Subscriptions Request Builder object. - */ - public static function init(): self - { - return new self(new SearchSubscriptionsRequest()); - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets query field. - * - * @param SearchSubscriptionsQuery|null $value - */ - public function query(?SearchSubscriptionsQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets include field. - * - * @param string[]|null $value - */ - public function include(?array $value): self - { - $this->instance->setInclude($value); - return $this; - } - - /** - * Initializes a new Search Subscriptions Request object. - */ - public function build(): SearchSubscriptionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchSubscriptionsResponseBuilder.php b/src/Models/Builders/SearchSubscriptionsResponseBuilder.php deleted file mode 100644 index 9bc127b2..00000000 --- a/src/Models/Builders/SearchSubscriptionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Subscriptions Response Builder object. - */ - public static function init(): self - { - return new self(new SearchSubscriptionsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscriptions field. - * - * @param Subscription[]|null $value - */ - public function subscriptions(?array $value): self - { - $this->instance->setSubscriptions($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Subscriptions Response object. - */ - public function build(): SearchSubscriptionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTeamMembersFilterBuilder.php b/src/Models/Builders/SearchTeamMembersFilterBuilder.php deleted file mode 100644 index ac9bb336..00000000 --- a/src/Models/Builders/SearchTeamMembersFilterBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Team Members Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchTeamMembersFilter()); - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets is owner field. - * - * @param bool|null $value - */ - public function isOwner(?bool $value): self - { - $this->instance->setIsOwner($value); - return $this; - } - - /** - * Unsets is owner field. - */ - public function unsetIsOwner(): self - { - $this->instance->unsetIsOwner(); - return $this; - } - - /** - * Initializes a new Search Team Members Filter object. - */ - public function build(): SearchTeamMembersFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTeamMembersQueryBuilder.php b/src/Models/Builders/SearchTeamMembersQueryBuilder.php deleted file mode 100644 index 9a0f80aa..00000000 --- a/src/Models/Builders/SearchTeamMembersQueryBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Team Members Query Builder object. - */ - public static function init(): self - { - return new self(new SearchTeamMembersQuery()); - } - - /** - * Sets filter field. - * - * @param SearchTeamMembersFilter|null $value - */ - public function filter(?SearchTeamMembersFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Initializes a new Search Team Members Query object. - */ - public function build(): SearchTeamMembersQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTeamMembersRequestBuilder.php b/src/Models/Builders/SearchTeamMembersRequestBuilder.php deleted file mode 100644 index ba27d2f9..00000000 --- a/src/Models/Builders/SearchTeamMembersRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Team Members Request Builder object. - */ - public static function init(): self - { - return new self(new SearchTeamMembersRequest()); - } - - /** - * Sets query field. - * - * @param SearchTeamMembersQuery|null $value - */ - public function query(?SearchTeamMembersQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Team Members Request object. - */ - public function build(): SearchTeamMembersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTeamMembersResponseBuilder.php b/src/Models/Builders/SearchTeamMembersResponseBuilder.php deleted file mode 100644 index 2cc5be12..00000000 --- a/src/Models/Builders/SearchTeamMembersResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Team Members Response Builder object. - */ - public static function init(): self - { - return new self(new SearchTeamMembersResponse()); - } - - /** - * Sets team members field. - * - * @param TeamMember[]|null $value - */ - public function teamMembers(?array $value): self - { - $this->instance->setTeamMembers($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Search Team Members Response object. - */ - public function build(): SearchTeamMembersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalActionsRequestBuilder.php b/src/Models/Builders/SearchTerminalActionsRequestBuilder.php deleted file mode 100644 index fbac3766..00000000 --- a/src/Models/Builders/SearchTerminalActionsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Actions Request Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalActionsRequest()); - } - - /** - * Sets query field. - * - * @param TerminalActionQuery|null $value - */ - public function query(?TerminalActionQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Initializes a new Search Terminal Actions Request object. - */ - public function build(): SearchTerminalActionsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalActionsResponseBuilder.php b/src/Models/Builders/SearchTerminalActionsResponseBuilder.php deleted file mode 100644 index abf72016..00000000 --- a/src/Models/Builders/SearchTerminalActionsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Actions Response Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalActionsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets action field. - * - * @param TerminalAction[]|null $value - */ - public function action(?array $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Terminal Actions Response object. - */ - public function build(): SearchTerminalActionsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalCheckoutsRequestBuilder.php b/src/Models/Builders/SearchTerminalCheckoutsRequestBuilder.php deleted file mode 100644 index 98523fa2..00000000 --- a/src/Models/Builders/SearchTerminalCheckoutsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Checkouts Request Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalCheckoutsRequest()); - } - - /** - * Sets query field. - * - * @param TerminalCheckoutQuery|null $value - */ - public function query(?TerminalCheckoutQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Initializes a new Search Terminal Checkouts Request object. - */ - public function build(): SearchTerminalCheckoutsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalCheckoutsResponseBuilder.php b/src/Models/Builders/SearchTerminalCheckoutsResponseBuilder.php deleted file mode 100644 index 26fb40f0..00000000 --- a/src/Models/Builders/SearchTerminalCheckoutsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Checkouts Response Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalCheckoutsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets checkouts field. - * - * @param TerminalCheckout[]|null $value - */ - public function checkouts(?array $value): self - { - $this->instance->setCheckouts($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Terminal Checkouts Response object. - */ - public function build(): SearchTerminalCheckoutsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalRefundsRequestBuilder.php b/src/Models/Builders/SearchTerminalRefundsRequestBuilder.php deleted file mode 100644 index 4bbc3799..00000000 --- a/src/Models/Builders/SearchTerminalRefundsRequestBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Refunds Request Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalRefundsRequest()); - } - - /** - * Sets query field. - * - * @param TerminalRefundQuery|null $value - */ - public function query(?TerminalRefundQuery $value): self - { - $this->instance->setQuery($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Initializes a new Search Terminal Refunds Request object. - */ - public function build(): SearchTerminalRefundsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchTerminalRefundsResponseBuilder.php b/src/Models/Builders/SearchTerminalRefundsResponseBuilder.php deleted file mode 100644 index 51a10840..00000000 --- a/src/Models/Builders/SearchTerminalRefundsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Terminal Refunds Response Builder object. - */ - public static function init(): self - { - return new self(new SearchTerminalRefundsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets refunds field. - * - * @param TerminalRefund[]|null $value - */ - public function refunds(?array $value): self - { - $this->instance->setRefunds($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Terminal Refunds Response object. - */ - public function build(): SearchTerminalRefundsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchVendorsRequestBuilder.php b/src/Models/Builders/SearchVendorsRequestBuilder.php deleted file mode 100644 index 85c935a5..00000000 --- a/src/Models/Builders/SearchVendorsRequestBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Vendors Request Builder object. - */ - public static function init(): self - { - return new self(new SearchVendorsRequest()); - } - - /** - * Sets filter field. - * - * @param SearchVendorsRequestFilter|null $value - */ - public function filter(?SearchVendorsRequestFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param SearchVendorsRequestSort|null $value - */ - public function sort(?SearchVendorsRequestSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Vendors Request object. - */ - public function build(): SearchVendorsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchVendorsRequestFilterBuilder.php b/src/Models/Builders/SearchVendorsRequestFilterBuilder.php deleted file mode 100644 index 463c4f5f..00000000 --- a/src/Models/Builders/SearchVendorsRequestFilterBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Vendors Request Filter Builder object. - */ - public static function init(): self - { - return new self(new SearchVendorsRequestFilter()); - } - - /** - * Sets name field. - * - * @param string[]|null $value - */ - public function name(?array $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets status field. - * - * @param string[]|null $value - */ - public function status(?array $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Initializes a new Search Vendors Request Filter object. - */ - public function build(): SearchVendorsRequestFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchVendorsRequestSortBuilder.php b/src/Models/Builders/SearchVendorsRequestSortBuilder.php deleted file mode 100644 index eb5c8d03..00000000 --- a/src/Models/Builders/SearchVendorsRequestSortBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Vendors Request Sort Builder object. - */ - public static function init(): self - { - return new self(new SearchVendorsRequestSort()); - } - - /** - * Sets field field. - * - * @param string|null $value - */ - public function field(?string $value): self - { - $this->instance->setField($value); - return $this; - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Search Vendors Request Sort object. - */ - public function build(): SearchVendorsRequestSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SearchVendorsResponseBuilder.php b/src/Models/Builders/SearchVendorsResponseBuilder.php deleted file mode 100644 index 4e55213e..00000000 --- a/src/Models/Builders/SearchVendorsResponseBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Search Vendors Response Builder object. - */ - public static function init(): self - { - return new self(new SearchVendorsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets vendors field. - * - * @param Vendor[]|null $value - */ - public function vendors(?array $value): self - { - $this->instance->setVendors($value); - return $this; - } - - /** - * Sets cursor field. - * - * @param string|null $value - */ - public function cursor(?string $value): self - { - $this->instance->setCursor($value); - return $this; - } - - /** - * Initializes a new Search Vendors Response object. - */ - public function build(): SearchVendorsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SegmentFilterBuilder.php b/src/Models/Builders/SegmentFilterBuilder.php deleted file mode 100644 index 560db28a..00000000 --- a/src/Models/Builders/SegmentFilterBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Segment Filter Builder object. - * - * @param string $serviceVariationId - */ - public static function init(string $serviceVariationId): self - { - return new self(new SegmentFilter($serviceVariationId)); - } - - /** - * Sets team member id filter field. - * - * @param FilterValue|null $value - */ - public function teamMemberIdFilter(?FilterValue $value): self - { - $this->instance->setTeamMemberIdFilter($value); - return $this; - } - - /** - * Initializes a new Segment Filter object. - */ - public function build(): SegmentFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SelectOptionBuilder.php b/src/Models/Builders/SelectOptionBuilder.php deleted file mode 100644 index 2202e8f0..00000000 --- a/src/Models/Builders/SelectOptionBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Select Option Builder object. - * - * @param string $referenceId - * @param string $title - */ - public static function init(string $referenceId, string $title): self - { - return new self(new SelectOption($referenceId, $title)); - } - - /** - * Initializes a new Select Option object. - */ - public function build(): SelectOption - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SelectOptionsBuilder.php b/src/Models/Builders/SelectOptionsBuilder.php deleted file mode 100644 index d9351e06..00000000 --- a/src/Models/Builders/SelectOptionsBuilder.php +++ /dev/null @@ -1,58 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Select Options Builder object. - * - * @param string $title - * @param string $body - * @param SelectOption[] $options - */ - public static function init(string $title, string $body, array $options): self - { - return new self(new SelectOptions($title, $body, $options)); - } - - /** - * Sets selected option field. - * - * @param SelectOption|null $value - */ - public function selectedOption(?SelectOption $value): self - { - $this->instance->setSelectedOption($value); - return $this; - } - - /** - * Initializes a new Select Options object. - */ - public function build(): SelectOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftBuilder.php b/src/Models/Builders/ShiftBuilder.php deleted file mode 100644 index 1fd3e40b..00000000 --- a/src/Models/Builders/ShiftBuilder.php +++ /dev/null @@ -1,225 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Builder object. - * - * @param string $locationId - * @param string $startAt - */ - public static function init(string $locationId, string $startAt): self - { - return new self(new Shift($locationId, $startAt)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets timezone field. - * - * @param string|null $value - */ - public function timezone(?string $value): self - { - $this->instance->setTimezone($value); - return $this; - } - - /** - * Unsets timezone field. - */ - public function unsetTimezone(): self - { - $this->instance->unsetTimezone(); - return $this; - } - - /** - * Sets end at field. - * - * @param string|null $value - */ - public function endAt(?string $value): self - { - $this->instance->setEndAt($value); - return $this; - } - - /** - * Unsets end at field. - */ - public function unsetEndAt(): self - { - $this->instance->unsetEndAt(); - return $this; - } - - /** - * Sets wage field. - * - * @param ShiftWage|null $value - */ - public function wage(?ShiftWage $value): self - { - $this->instance->setWage($value); - return $this; - } - - /** - * Sets breaks field. - * - * @param MBreak[]|null $value - */ - public function breaks(?array $value): self - { - $this->instance->setBreaks($value); - return $this; - } - - /** - * Unsets breaks field. - */ - public function unsetBreaks(): self - { - $this->instance->unsetBreaks(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets declared cash tip money field. - * - * @param Money|null $value - */ - public function declaredCashTipMoney(?Money $value): self - { - $this->instance->setDeclaredCashTipMoney($value); - return $this; - } - - /** - * Initializes a new Shift object. - */ - public function build(): Shift - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftFilterBuilder.php b/src/Models/Builders/ShiftFilterBuilder.php deleted file mode 100644 index 829b6f53..00000000 --- a/src/Models/Builders/ShiftFilterBuilder.php +++ /dev/null @@ -1,148 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Filter Builder object. - */ - public static function init(): self - { - return new self(new ShiftFilter()); - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Sets employee ids field. - * - * @param string[]|null $value - */ - public function employeeIds(?array $value): self - { - $this->instance->setEmployeeIds($value); - return $this; - } - - /** - * Unsets employee ids field. - */ - public function unsetEmployeeIds(): self - { - $this->instance->unsetEmployeeIds(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets start field. - * - * @param TimeRange|null $value - */ - public function start(?TimeRange $value): self - { - $this->instance->setStart($value); - return $this; - } - - /** - * Sets end field. - * - * @param TimeRange|null $value - */ - public function end(?TimeRange $value): self - { - $this->instance->setEnd($value); - return $this; - } - - /** - * Sets workday field. - * - * @param ShiftWorkday|null $value - */ - public function workday(?ShiftWorkday $value): self - { - $this->instance->setWorkday($value); - return $this; - } - - /** - * Sets team member ids field. - * - * @param string[]|null $value - */ - public function teamMemberIds(?array $value): self - { - $this->instance->setTeamMemberIds($value); - return $this; - } - - /** - * Unsets team member ids field. - */ - public function unsetTeamMemberIds(): self - { - $this->instance->unsetTeamMemberIds(); - return $this; - } - - /** - * Initializes a new Shift Filter object. - */ - public function build(): ShiftFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftQueryBuilder.php b/src/Models/Builders/ShiftQueryBuilder.php deleted file mode 100644 index 4202b743..00000000 --- a/src/Models/Builders/ShiftQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Query Builder object. - */ - public static function init(): self - { - return new self(new ShiftQuery()); - } - - /** - * Sets filter field. - * - * @param ShiftFilter|null $value - */ - public function filter(?ShiftFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param ShiftSort|null $value - */ - public function sort(?ShiftSort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Shift Query object. - */ - public function build(): ShiftQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftSortBuilder.php b/src/Models/Builders/ShiftSortBuilder.php deleted file mode 100644 index f3dc4ebc..00000000 --- a/src/Models/Builders/ShiftSortBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Sort Builder object. - */ - public static function init(): self - { - return new self(new ShiftSort()); - } - - /** - * Sets field field. - * - * @param string|null $value - */ - public function field(?string $value): self - { - $this->instance->setField($value); - return $this; - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Initializes a new Shift Sort object. - */ - public function build(): ShiftSort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftWageBuilder.php b/src/Models/Builders/ShiftWageBuilder.php deleted file mode 100644 index bbc2d41d..00000000 --- a/src/Models/Builders/ShiftWageBuilder.php +++ /dev/null @@ -1,105 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Wage Builder object. - */ - public static function init(): self - { - return new self(new ShiftWage()); - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets hourly rate field. - * - * @param Money|null $value - */ - public function hourlyRate(?Money $value): self - { - $this->instance->setHourlyRate($value); - return $this; - } - - /** - * Sets job id field. - * - * @param string|null $value - */ - public function jobId(?string $value): self - { - $this->instance->setJobId($value); - return $this; - } - - /** - * Sets tip eligible field. - * - * @param bool|null $value - */ - public function tipEligible(?bool $value): self - { - $this->instance->setTipEligible($value); - return $this; - } - - /** - * Unsets tip eligible field. - */ - public function unsetTipEligible(): self - { - $this->instance->unsetTipEligible(); - return $this; - } - - /** - * Initializes a new Shift Wage object. - */ - public function build(): ShiftWage - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShiftWorkdayBuilder.php b/src/Models/Builders/ShiftWorkdayBuilder.php deleted file mode 100644 index ca0d329c..00000000 --- a/src/Models/Builders/ShiftWorkdayBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shift Workday Builder object. - */ - public static function init(): self - { - return new self(new ShiftWorkday()); - } - - /** - * Sets date range field. - * - * @param DateRange|null $value - */ - public function dateRange(?DateRange $value): self - { - $this->instance->setDateRange($value); - return $this; - } - - /** - * Sets match shifts by field. - * - * @param string|null $value - */ - public function matchShiftsBy(?string $value): self - { - $this->instance->setMatchShiftsBy($value); - return $this; - } - - /** - * Sets default timezone field. - * - * @param string|null $value - */ - public function defaultTimezone(?string $value): self - { - $this->instance->setDefaultTimezone($value); - return $this; - } - - /** - * Unsets default timezone field. - */ - public function unsetDefaultTimezone(): self - { - $this->instance->unsetDefaultTimezone(); - return $this; - } - - /** - * Initializes a new Shift Workday object. - */ - public function build(): ShiftWorkday - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/ShippingFeeBuilder.php b/src/Models/Builders/ShippingFeeBuilder.php deleted file mode 100644 index b0e396a3..00000000 --- a/src/Models/Builders/ShippingFeeBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Shipping Fee Builder object. - * - * @param Money $charge - */ - public static function init(Money $charge): self - { - return new self(new ShippingFee($charge)); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new Shipping Fee object. - */ - public function build(): ShippingFee - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SignatureImageBuilder.php b/src/Models/Builders/SignatureImageBuilder.php deleted file mode 100644 index dce60fd4..00000000 --- a/src/Models/Builders/SignatureImageBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Signature Image Builder object. - */ - public static function init(): self - { - return new self(new SignatureImage()); - } - - /** - * Sets image type field. - * - * @param string|null $value - */ - public function imageType(?string $value): self - { - $this->instance->setImageType($value); - return $this; - } - - /** - * Sets data field. - * - * @param string|null $value - */ - public function data(?string $value): self - { - $this->instance->setData($value); - return $this; - } - - /** - * Initializes a new Signature Image object. - */ - public function build(): SignatureImage - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SignatureOptionsBuilder.php b/src/Models/Builders/SignatureOptionsBuilder.php deleted file mode 100644 index c63b2db0..00000000 --- a/src/Models/Builders/SignatureOptionsBuilder.php +++ /dev/null @@ -1,57 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Signature Options Builder object. - * - * @param string $title - * @param string $body - */ - public static function init(string $title, string $body): self - { - return new self(new SignatureOptions($title, $body)); - } - - /** - * Sets signature field. - * - * @param SignatureImage[]|null $value - */ - public function signature(?array $value): self - { - $this->instance->setSignature($value); - return $this; - } - - /** - * Initializes a new Signature Options object. - */ - public function build(): SignatureOptions - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SiteBuilder.php b/src/Models/Builders/SiteBuilder.php deleted file mode 100644 index 39a2041b..00000000 --- a/src/Models/Builders/SiteBuilder.php +++ /dev/null @@ -1,135 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Site Builder object. - */ - public static function init(): self - { - return new self(new Site()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets site title field. - * - * @param string|null $value - */ - public function siteTitle(?string $value): self - { - $this->instance->setSiteTitle($value); - return $this; - } - - /** - * Unsets site title field. - */ - public function unsetSiteTitle(): self - { - $this->instance->unsetSiteTitle(); - return $this; - } - - /** - * Sets domain field. - * - * @param string|null $value - */ - public function domain(?string $value): self - { - $this->instance->setDomain($value); - return $this; - } - - /** - * Unsets domain field. - */ - public function unsetDomain(): self - { - $this->instance->unsetDomain(); - return $this; - } - - /** - * Sets is published field. - * - * @param bool|null $value - */ - public function isPublished(?bool $value): self - { - $this->instance->setIsPublished($value); - return $this; - } - - /** - * Unsets is published field. - */ - public function unsetIsPublished(): self - { - $this->instance->unsetIsPublished(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Site object. - */ - public function build(): Site - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SnippetBuilder.php b/src/Models/Builders/SnippetBuilder.php deleted file mode 100644 index 2e29b9f0..00000000 --- a/src/Models/Builders/SnippetBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Snippet Builder object. - * - * @param string $content - */ - public static function init(string $content): self - { - return new self(new Snippet($content)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets site id field. - * - * @param string|null $value - */ - public function siteId(?string $value): self - { - $this->instance->setSiteId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Snippet object. - */ - public function build(): Snippet - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SnippetResponseBuilder.php b/src/Models/Builders/SnippetResponseBuilder.php deleted file mode 100644 index 04c165cf..00000000 --- a/src/Models/Builders/SnippetResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Snippet Response Builder object. - */ - public static function init(): self - { - return new self(new SnippetResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets snippet field. - * - * @param Snippet|null $value - */ - public function snippet(?Snippet $value): self - { - $this->instance->setSnippet($value); - return $this; - } - - /** - * Initializes a new Snippet Response object. - */ - public function build(): SnippetResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SourceApplicationBuilder.php b/src/Models/Builders/SourceApplicationBuilder.php deleted file mode 100644 index eba1879e..00000000 --- a/src/Models/Builders/SourceApplicationBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Source Application Builder object. - */ - public static function init(): self - { - return new self(new SourceApplication()); - } - - /** - * Sets product field. - * - * @param string|null $value - */ - public function product(?string $value): self - { - $this->instance->setProduct($value); - return $this; - } - - /** - * Sets application id field. - * - * @param string|null $value - */ - public function applicationId(?string $value): self - { - $this->instance->setApplicationId($value); - return $this; - } - - /** - * Unsets application id field. - */ - public function unsetApplicationId(): self - { - $this->instance->unsetApplicationId(); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new Source Application object. - */ - public function build(): SourceApplication - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SquareAccountDetailsBuilder.php b/src/Models/Builders/SquareAccountDetailsBuilder.php deleted file mode 100644 index 07bbbfc5..00000000 --- a/src/Models/Builders/SquareAccountDetailsBuilder.php +++ /dev/null @@ -1,83 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Square Account Details Builder object. - */ - public static function init(): self - { - return new self(new SquareAccountDetails()); - } - - /** - * Sets payment source token field. - * - * @param string|null $value - */ - public function paymentSourceToken(?string $value): self - { - $this->instance->setPaymentSourceToken($value); - return $this; - } - - /** - * Unsets payment source token field. - */ - public function unsetPaymentSourceToken(): self - { - $this->instance->unsetPaymentSourceToken(); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Unsets errors field. - */ - public function unsetErrors(): self - { - $this->instance->unsetErrors(); - return $this; - } - - /** - * Initializes a new Square Account Details object. - */ - public function build(): SquareAccountDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/StandardUnitDescriptionBuilder.php b/src/Models/Builders/StandardUnitDescriptionBuilder.php deleted file mode 100644 index f22a5507..00000000 --- a/src/Models/Builders/StandardUnitDescriptionBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Standard Unit Description Builder object. - */ - public static function init(): self - { - return new self(new StandardUnitDescription()); - } - - /** - * Sets unit field. - * - * @param MeasurementUnit|null $value - */ - public function unit(?MeasurementUnit $value): self - { - $this->instance->setUnit($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets abbreviation field. - * - * @param string|null $value - */ - public function abbreviation(?string $value): self - { - $this->instance->setAbbreviation($value); - return $this; - } - - /** - * Unsets abbreviation field. - */ - public function unsetAbbreviation(): self - { - $this->instance->unsetAbbreviation(); - return $this; - } - - /** - * Initializes a new Standard Unit Description object. - */ - public function build(): StandardUnitDescription - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/StandardUnitDescriptionGroupBuilder.php b/src/Models/Builders/StandardUnitDescriptionGroupBuilder.php deleted file mode 100644 index c7e4f0bb..00000000 --- a/src/Models/Builders/StandardUnitDescriptionGroupBuilder.php +++ /dev/null @@ -1,83 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Standard Unit Description Group Builder object. - */ - public static function init(): self - { - return new self(new StandardUnitDescriptionGroup()); - } - - /** - * Sets standard unit descriptions field. - * - * @param StandardUnitDescription[]|null $value - */ - public function standardUnitDescriptions(?array $value): self - { - $this->instance->setStandardUnitDescriptions($value); - return $this; - } - - /** - * Unsets standard unit descriptions field. - */ - public function unsetStandardUnitDescriptions(): self - { - $this->instance->unsetStandardUnitDescriptions(); - return $this; - } - - /** - * Sets language code field. - * - * @param string|null $value - */ - public function languageCode(?string $value): self - { - $this->instance->setLanguageCode($value); - return $this; - } - - /** - * Unsets language code field. - */ - public function unsetLanguageCode(): self - { - $this->instance->unsetLanguageCode(); - return $this; - } - - /** - * Initializes a new Standard Unit Description Group object. - */ - public function build(): StandardUnitDescriptionGroup - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubmitEvidenceResponseBuilder.php b/src/Models/Builders/SubmitEvidenceResponseBuilder.php deleted file mode 100644 index bc24c604..00000000 --- a/src/Models/Builders/SubmitEvidenceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Submit Evidence Response Builder object. - */ - public static function init(): self - { - return new self(new SubmitEvidenceResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets dispute field. - * - * @param Dispute|null $value - */ - public function dispute(?Dispute $value): self - { - $this->instance->setDispute($value); - return $this; - } - - /** - * Initializes a new Submit Evidence Response object. - */ - public function build(): SubmitEvidenceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionActionBuilder.php b/src/Models/Builders/SubscriptionActionBuilder.php deleted file mode 100644 index 6219ade4..00000000 --- a/src/Models/Builders/SubscriptionActionBuilder.php +++ /dev/null @@ -1,145 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Action Builder object. - */ - public static function init(): self - { - return new self(new SubscriptionAction()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets effective date field. - * - * @param string|null $value - */ - public function effectiveDate(?string $value): self - { - $this->instance->setEffectiveDate($value); - return $this; - } - - /** - * Unsets effective date field. - */ - public function unsetEffectiveDate(): self - { - $this->instance->unsetEffectiveDate(); - return $this; - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Unsets monthly billing anchor date field. - */ - public function unsetMonthlyBillingAnchorDate(): self - { - $this->instance->unsetMonthlyBillingAnchorDate(); - return $this; - } - - /** - * Sets phases field. - * - * @param Phase[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Unsets phases field. - */ - public function unsetPhases(): self - { - $this->instance->unsetPhases(); - return $this; - } - - /** - * Sets new plan variation id field. - * - * @param string|null $value - */ - public function newPlanVariationId(?string $value): self - { - $this->instance->setNewPlanVariationId($value); - return $this; - } - - /** - * Unsets new plan variation id field. - */ - public function unsetNewPlanVariationId(): self - { - $this->instance->unsetNewPlanVariationId(); - return $this; - } - - /** - * Initializes a new Subscription Action object. - */ - public function build(): SubscriptionAction - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionBuilder.php b/src/Models/Builders/SubscriptionBuilder.php deleted file mode 100644 index 5dc78bdb..00000000 --- a/src/Models/Builders/SubscriptionBuilder.php +++ /dev/null @@ -1,291 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Builder object. - */ - public static function init(): self - { - return new self(new Subscription()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets plan variation id field. - * - * @param string|null $value - */ - public function planVariationId(?string $value): self - { - $this->instance->setPlanVariationId($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Sets start date field. - * - * @param string|null $value - */ - public function startDate(?string $value): self - { - $this->instance->setStartDate($value); - return $this; - } - - /** - * Sets canceled date field. - * - * @param string|null $value - */ - public function canceledDate(?string $value): self - { - $this->instance->setCanceledDate($value); - return $this; - } - - /** - * Unsets canceled date field. - */ - public function unsetCanceledDate(): self - { - $this->instance->unsetCanceledDate(); - return $this; - } - - /** - * Sets charged through date field. - * - * @param string|null $value - */ - public function chargedThroughDate(?string $value): self - { - $this->instance->setChargedThroughDate($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets tax percentage field. - * - * @param string|null $value - */ - public function taxPercentage(?string $value): self - { - $this->instance->setTaxPercentage($value); - return $this; - } - - /** - * Unsets tax percentage field. - */ - public function unsetTaxPercentage(): self - { - $this->instance->unsetTaxPercentage(); - return $this; - } - - /** - * Sets invoice ids field. - * - * @param string[]|null $value - */ - public function invoiceIds(?array $value): self - { - $this->instance->setInvoiceIds($value); - return $this; - } - - /** - * Sets price override money field. - * - * @param Money|null $value - */ - public function priceOverrideMoney(?Money $value): self - { - $this->instance->setPriceOverrideMoney($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets card id field. - * - * @param string|null $value - */ - public function cardId(?string $value): self - { - $this->instance->setCardId($value); - return $this; - } - - /** - * Unsets card id field. - */ - public function unsetCardId(): self - { - $this->instance->unsetCardId(); - return $this; - } - - /** - * Sets timezone field. - * - * @param string|null $value - */ - public function timezone(?string $value): self - { - $this->instance->setTimezone($value); - return $this; - } - - /** - * Sets source field. - * - * @param SubscriptionSource|null $value - */ - public function source(?SubscriptionSource $value): self - { - $this->instance->setSource($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Unsets actions field. - */ - public function unsetActions(): self - { - $this->instance->unsetActions(); - return $this; - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Sets phases field. - * - * @param Phase[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Initializes a new Subscription object. - */ - public function build(): Subscription - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionEventBuilder.php b/src/Models/Builders/SubscriptionEventBuilder.php deleted file mode 100644 index 8e191c7c..00000000 --- a/src/Models/Builders/SubscriptionEventBuilder.php +++ /dev/null @@ -1,95 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Event Builder object. - * - * @param string $id - * @param string $subscriptionEventType - * @param string $effectiveDate - * @param string $planVariationId - */ - public static function init( - string $id, - string $subscriptionEventType, - string $effectiveDate, - string $planVariationId - ): self { - return new self(new SubscriptionEvent($id, $subscriptionEventType, $effectiveDate, $planVariationId)); - } - - /** - * Sets monthly billing anchor date field. - * - * @param int|null $value - */ - public function monthlyBillingAnchorDate(?int $value): self - { - $this->instance->setMonthlyBillingAnchorDate($value); - return $this; - } - - /** - * Sets info field. - * - * @param SubscriptionEventInfo|null $value - */ - public function info(?SubscriptionEventInfo $value): self - { - $this->instance->setInfo($value); - return $this; - } - - /** - * Sets phases field. - * - * @param Phase[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Unsets phases field. - */ - public function unsetPhases(): self - { - $this->instance->unsetPhases(); - return $this; - } - - /** - * Initializes a new Subscription Event object. - */ - public function build(): SubscriptionEvent - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionEventInfoBuilder.php b/src/Models/Builders/SubscriptionEventInfoBuilder.php deleted file mode 100644 index be1addf1..00000000 --- a/src/Models/Builders/SubscriptionEventInfoBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Event Info Builder object. - */ - public static function init(): self - { - return new self(new SubscriptionEventInfo()); - } - - /** - * Sets detail field. - * - * @param string|null $value - */ - public function detail(?string $value): self - { - $this->instance->setDetail($value); - return $this; - } - - /** - * Unsets detail field. - */ - public function unsetDetail(): self - { - $this->instance->unsetDetail(); - return $this; - } - - /** - * Sets code field. - * - * @param string|null $value - */ - public function code(?string $value): self - { - $this->instance->setCode($value); - return $this; - } - - /** - * Initializes a new Subscription Event Info object. - */ - public function build(): SubscriptionEventInfo - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionPhaseBuilder.php b/src/Models/Builders/SubscriptionPhaseBuilder.php deleted file mode 100644 index 874b9fcd..00000000 --- a/src/Models/Builders/SubscriptionPhaseBuilder.php +++ /dev/null @@ -1,128 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Phase Builder object. - * - * @param string $cadence - */ - public static function init(string $cadence): self - { - return new self(new SubscriptionPhase($cadence)); - } - - /** - * Sets uid field. - * - * @param string|null $value - */ - public function uid(?string $value): self - { - $this->instance->setUid($value); - return $this; - } - - /** - * Unsets uid field. - */ - public function unsetUid(): self - { - $this->instance->unsetUid(); - return $this; - } - - /** - * Sets periods field. - * - * @param int|null $value - */ - public function periods(?int $value): self - { - $this->instance->setPeriods($value); - return $this; - } - - /** - * Unsets periods field. - */ - public function unsetPeriods(): self - { - $this->instance->unsetPeriods(); - return $this; - } - - /** - * Sets recurring price money field. - * - * @param Money|null $value - */ - public function recurringPriceMoney(?Money $value): self - { - $this->instance->setRecurringPriceMoney($value); - return $this; - } - - /** - * Sets ordinal field. - * - * @param int|null $value - */ - public function ordinal(?int $value): self - { - $this->instance->setOrdinal($value); - return $this; - } - - /** - * Unsets ordinal field. - */ - public function unsetOrdinal(): self - { - $this->instance->unsetOrdinal(); - return $this; - } - - /** - * Sets pricing field. - * - * @param SubscriptionPricing|null $value - */ - public function pricing(?SubscriptionPricing $value): self - { - $this->instance->setPricing($value); - return $this; - } - - /** - * Initializes a new Subscription Phase object. - */ - public function build(): SubscriptionPhase - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionPricingBuilder.php b/src/Models/Builders/SubscriptionPricingBuilder.php deleted file mode 100644 index 6ef183d2..00000000 --- a/src/Models/Builders/SubscriptionPricingBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Pricing Builder object. - */ - public static function init(): self - { - return new self(new SubscriptionPricing()); - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets discount ids field. - * - * @param string[]|null $value - */ - public function discountIds(?array $value): self - { - $this->instance->setDiscountIds($value); - return $this; - } - - /** - * Unsets discount ids field. - */ - public function unsetDiscountIds(): self - { - $this->instance->unsetDiscountIds(); - return $this; - } - - /** - * Sets price money field. - * - * @param Money|null $value - */ - public function priceMoney(?Money $value): self - { - $this->instance->setPriceMoney($value); - return $this; - } - - /** - * Initializes a new Subscription Pricing object. - */ - public function build(): SubscriptionPricing - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionSourceBuilder.php b/src/Models/Builders/SubscriptionSourceBuilder.php deleted file mode 100644 index e16f33c3..00000000 --- a/src/Models/Builders/SubscriptionSourceBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Source Builder object. - */ - public static function init(): self - { - return new self(new SubscriptionSource()); - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new Subscription Source object. - */ - public function build(): SubscriptionSource - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SubscriptionTestResultBuilder.php b/src/Models/Builders/SubscriptionTestResultBuilder.php deleted file mode 100644 index af61aa9a..00000000 --- a/src/Models/Builders/SubscriptionTestResultBuilder.php +++ /dev/null @@ -1,115 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Subscription Test Result Builder object. - */ - public static function init(): self - { - return new self(new SubscriptionTestResult()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets status code field. - * - * @param int|null $value - */ - public function statusCode(?int $value): self - { - $this->instance->setStatusCode($value); - return $this; - } - - /** - * Unsets status code field. - */ - public function unsetStatusCode(): self - { - $this->instance->unsetStatusCode(); - return $this; - } - - /** - * Sets payload field. - * - * @param string|null $value - */ - public function payload(?string $value): self - { - $this->instance->setPayload($value); - return $this; - } - - /** - * Unsets payload field. - */ - public function unsetPayload(): self - { - $this->instance->unsetPayload(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Subscription Test Result object. - */ - public function build(): SubscriptionTestResult - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SwapPlanRequestBuilder.php b/src/Models/Builders/SwapPlanRequestBuilder.php deleted file mode 100644 index 15f87ec4..00000000 --- a/src/Models/Builders/SwapPlanRequestBuilder.php +++ /dev/null @@ -1,83 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Swap Plan Request Builder object. - */ - public static function init(): self - { - return new self(new SwapPlanRequest()); - } - - /** - * Sets new plan variation id field. - * - * @param string|null $value - */ - public function newPlanVariationId(?string $value): self - { - $this->instance->setNewPlanVariationId($value); - return $this; - } - - /** - * Unsets new plan variation id field. - */ - public function unsetNewPlanVariationId(): self - { - $this->instance->unsetNewPlanVariationId(); - return $this; - } - - /** - * Sets phases field. - * - * @param PhaseInput[]|null $value - */ - public function phases(?array $value): self - { - $this->instance->setPhases($value); - return $this; - } - - /** - * Unsets phases field. - */ - public function unsetPhases(): self - { - $this->instance->unsetPhases(); - return $this; - } - - /** - * Initializes a new Swap Plan Request object. - */ - public function build(): SwapPlanRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/SwapPlanResponseBuilder.php b/src/Models/Builders/SwapPlanResponseBuilder.php deleted file mode 100644 index a86c1306..00000000 --- a/src/Models/Builders/SwapPlanResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Swap Plan Response Builder object. - */ - public static function init(): self - { - return new self(new SwapPlanResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Sets actions field. - * - * @param SubscriptionAction[]|null $value - */ - public function actions(?array $value): self - { - $this->instance->setActions($value); - return $this; - } - - /** - * Initializes a new Swap Plan Response object. - */ - public function build(): SwapPlanResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TaxIdsBuilder.php b/src/Models/Builders/TaxIdsBuilder.php deleted file mode 100644 index dd138a8f..00000000 --- a/src/Models/Builders/TaxIdsBuilder.php +++ /dev/null @@ -1,97 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tax Ids Builder object. - */ - public static function init(): self - { - return new self(new TaxIds()); - } - - /** - * Sets eu vat field. - * - * @param string|null $value - */ - public function euVat(?string $value): self - { - $this->instance->setEuVat($value); - return $this; - } - - /** - * Sets fr siret field. - * - * @param string|null $value - */ - public function frSiret(?string $value): self - { - $this->instance->setFrSiret($value); - return $this; - } - - /** - * Sets fr naf field. - * - * @param string|null $value - */ - public function frNaf(?string $value): self - { - $this->instance->setFrNaf($value); - return $this; - } - - /** - * Sets es nif field. - * - * @param string|null $value - */ - public function esNif(?string $value): self - { - $this->instance->setEsNif($value); - return $this; - } - - /** - * Sets jp qii field. - * - * @param string|null $value - */ - public function jpQii(?string $value): self - { - $this->instance->setJpQii($value); - return $this; - } - - /** - * Initializes a new Tax Ids object. - */ - public function build(): TaxIds - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TeamMemberAssignedLocationsBuilder.php b/src/Models/Builders/TeamMemberAssignedLocationsBuilder.php deleted file mode 100644 index dd7a290b..00000000 --- a/src/Models/Builders/TeamMemberAssignedLocationsBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Team Member Assigned Locations Builder object. - */ - public static function init(): self - { - return new self(new TeamMemberAssignedLocations()); - } - - /** - * Sets assignment type field. - * - * @param string|null $value - */ - public function assignmentType(?string $value): self - { - $this->instance->setAssignmentType($value); - return $this; - } - - /** - * Sets location ids field. - * - * @param string[]|null $value - */ - public function locationIds(?array $value): self - { - $this->instance->setLocationIds($value); - return $this; - } - - /** - * Unsets location ids field. - */ - public function unsetLocationIds(): self - { - $this->instance->unsetLocationIds(); - return $this; - } - - /** - * Initializes a new Team Member Assigned Locations object. - */ - public function build(): TeamMemberAssignedLocations - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TeamMemberBookingProfileBuilder.php b/src/Models/Builders/TeamMemberBookingProfileBuilder.php deleted file mode 100644 index 97c4f53a..00000000 --- a/src/Models/Builders/TeamMemberBookingProfileBuilder.php +++ /dev/null @@ -1,106 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Team Member Booking Profile Builder object. - */ - public static function init(): self - { - return new self(new TeamMemberBookingProfile()); - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Sets description field. - * - * @param string|null $value - */ - public function description(?string $value): self - { - $this->instance->setDescription($value); - return $this; - } - - /** - * Sets display name field. - * - * @param string|null $value - */ - public function displayName(?string $value): self - { - $this->instance->setDisplayName($value); - return $this; - } - - /** - * Sets is bookable field. - * - * @param bool|null $value - */ - public function isBookable(?bool $value): self - { - $this->instance->setIsBookable($value); - return $this; - } - - /** - * Unsets is bookable field. - */ - public function unsetIsBookable(): self - { - $this->instance->unsetIsBookable(); - return $this; - } - - /** - * Sets profile image url field. - * - * @param string|null $value - */ - public function profileImageUrl(?string $value): self - { - $this->instance->setProfileImageUrl($value); - return $this; - } - - /** - * Initializes a new Team Member Booking Profile object. - */ - public function build(): TeamMemberBookingProfile - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TeamMemberBuilder.php b/src/Models/Builders/TeamMemberBuilder.php deleted file mode 100644 index e9a7bd42..00000000 --- a/src/Models/Builders/TeamMemberBuilder.php +++ /dev/null @@ -1,221 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Team Member Builder object. - */ - public static function init(): self - { - return new self(new TeamMember()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets is owner field. - * - * @param bool|null $value - */ - public function isOwner(?bool $value): self - { - $this->instance->setIsOwner($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Unsets given name field. - */ - public function unsetGivenName(): self - { - $this->instance->unsetGivenName(); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Unsets family name field. - */ - public function unsetFamilyName(): self - { - $this->instance->unsetFamilyName(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets assigned locations field. - * - * @param TeamMemberAssignedLocations|null $value - */ - public function assignedLocations(?TeamMemberAssignedLocations $value): self - { - $this->instance->setAssignedLocations($value); - return $this; - } - - /** - * Sets wage setting field. - * - * @param WageSetting|null $value - */ - public function wageSetting(?WageSetting $value): self - { - $this->instance->setWageSetting($value); - return $this; - } - - /** - * Initializes a new Team Member object. - */ - public function build(): TeamMember - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TeamMemberWageBuilder.php b/src/Models/Builders/TeamMemberWageBuilder.php deleted file mode 100644 index 76ff8434..00000000 --- a/src/Models/Builders/TeamMemberWageBuilder.php +++ /dev/null @@ -1,145 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Team Member Wage Builder object. - */ - public static function init(): self - { - return new self(new TeamMemberWage()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets title field. - * - * @param string|null $value - */ - public function title(?string $value): self - { - $this->instance->setTitle($value); - return $this; - } - - /** - * Unsets title field. - */ - public function unsetTitle(): self - { - $this->instance->unsetTitle(); - return $this; - } - - /** - * Sets hourly rate field. - * - * @param Money|null $value - */ - public function hourlyRate(?Money $value): self - { - $this->instance->setHourlyRate($value); - return $this; - } - - /** - * Sets job id field. - * - * @param string|null $value - */ - public function jobId(?string $value): self - { - $this->instance->setJobId($value); - return $this; - } - - /** - * Unsets job id field. - */ - public function unsetJobId(): self - { - $this->instance->unsetJobId(); - return $this; - } - - /** - * Sets tip eligible field. - * - * @param bool|null $value - */ - public function tipEligible(?bool $value): self - { - $this->instance->setTipEligible($value); - return $this; - } - - /** - * Unsets tip eligible field. - */ - public function unsetTipEligible(): self - { - $this->instance->unsetTipEligible(); - return $this; - } - - /** - * Initializes a new Team Member Wage object. - */ - public function build(): TeamMemberWage - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderBankAccountDetailsBuilder.php b/src/Models/Builders/TenderBankAccountDetailsBuilder.php deleted file mode 100644 index 3ff49e7c..00000000 --- a/src/Models/Builders/TenderBankAccountDetailsBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Bank Account Details Builder object. - */ - public static function init(): self - { - return new self(new TenderBankAccountDetails()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Tender Bank Account Details object. - */ - public function build(): TenderBankAccountDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderBuilder.php b/src/Models/Builders/TenderBuilder.php deleted file mode 100644 index 54a84669..00000000 --- a/src/Models/Builders/TenderBuilder.php +++ /dev/null @@ -1,281 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Builder object. - * - * @param string $type - */ - public static function init(string $type): self - { - return new self(new Tender($type)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets transaction id field. - * - * @param string|null $value - */ - public function transactionId(?string $value): self - { - $this->instance->setTransactionId($value); - return $this; - } - - /** - * Unsets transaction id field. - */ - public function unsetTransactionId(): self - { - $this->instance->unsetTransactionId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets amount money field. - * - * @param Money|null $value - */ - public function amountMoney(?Money $value): self - { - $this->instance->setAmountMoney($value); - return $this; - } - - /** - * Sets tip money field. - * - * @param Money|null $value - */ - public function tipMoney(?Money $value): self - { - $this->instance->setTipMoney($value); - return $this; - } - - /** - * Sets processing fee money field. - * - * @param Money|null $value - */ - public function processingFeeMoney(?Money $value): self - { - $this->instance->setProcessingFeeMoney($value); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets card details field. - * - * @param TenderCardDetails|null $value - */ - public function cardDetails(?TenderCardDetails $value): self - { - $this->instance->setCardDetails($value); - return $this; - } - - /** - * Sets cash details field. - * - * @param TenderCashDetails|null $value - */ - public function cashDetails(?TenderCashDetails $value): self - { - $this->instance->setCashDetails($value); - return $this; - } - - /** - * Sets bank account details field. - * - * @param TenderBankAccountDetails|null $value - */ - public function bankAccountDetails(?TenderBankAccountDetails $value): self - { - $this->instance->setBankAccountDetails($value); - return $this; - } - - /** - * Sets buy now pay later details field. - * - * @param TenderBuyNowPayLaterDetails|null $value - */ - public function buyNowPayLaterDetails(?TenderBuyNowPayLaterDetails $value): self - { - $this->instance->setBuyNowPayLaterDetails($value); - return $this; - } - - /** - * Sets square account details field. - * - * @param TenderSquareAccountDetails|null $value - */ - public function squareAccountDetails(?TenderSquareAccountDetails $value): self - { - $this->instance->setSquareAccountDetails($value); - return $this; - } - - /** - * Sets additional recipients field. - * - * @param AdditionalRecipient[]|null $value - */ - public function additionalRecipients(?array $value): self - { - $this->instance->setAdditionalRecipients($value); - return $this; - } - - /** - * Unsets additional recipients field. - */ - public function unsetAdditionalRecipients(): self - { - $this->instance->unsetAdditionalRecipients(); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Initializes a new Tender object. - */ - public function build(): Tender - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderBuyNowPayLaterDetailsBuilder.php b/src/Models/Builders/TenderBuyNowPayLaterDetailsBuilder.php deleted file mode 100644 index fd24dbd4..00000000 --- a/src/Models/Builders/TenderBuyNowPayLaterDetailsBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Buy Now Pay Later Details Builder object. - */ - public static function init(): self - { - return new self(new TenderBuyNowPayLaterDetails()); - } - - /** - * Sets buy now pay later brand field. - * - * @param string|null $value - */ - public function buyNowPayLaterBrand(?string $value): self - { - $this->instance->setBuyNowPayLaterBrand($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Tender Buy Now Pay Later Details object. - */ - public function build(): TenderBuyNowPayLaterDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderCardDetailsBuilder.php b/src/Models/Builders/TenderCardDetailsBuilder.php deleted file mode 100644 index 557e5a95..00000000 --- a/src/Models/Builders/TenderCardDetailsBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Card Details Builder object. - */ - public static function init(): self - { - return new self(new TenderCardDetails()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets card field. - * - * @param Card|null $value - */ - public function card(?Card $value): self - { - $this->instance->setCard($value); - return $this; - } - - /** - * Sets entry method field. - * - * @param string|null $value - */ - public function entryMethod(?string $value): self - { - $this->instance->setEntryMethod($value); - return $this; - } - - /** - * Initializes a new Tender Card Details object. - */ - public function build(): TenderCardDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderCashDetailsBuilder.php b/src/Models/Builders/TenderCashDetailsBuilder.php deleted file mode 100644 index fd6b00dd..00000000 --- a/src/Models/Builders/TenderCashDetailsBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Cash Details Builder object. - */ - public static function init(): self - { - return new self(new TenderCashDetails()); - } - - /** - * Sets buyer tendered money field. - * - * @param Money|null $value - */ - public function buyerTenderedMoney(?Money $value): self - { - $this->instance->setBuyerTenderedMoney($value); - return $this; - } - - /** - * Sets change back money field. - * - * @param Money|null $value - */ - public function changeBackMoney(?Money $value): self - { - $this->instance->setChangeBackMoney($value); - return $this; - } - - /** - * Initializes a new Tender Cash Details object. - */ - public function build(): TenderCashDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TenderSquareAccountDetailsBuilder.php b/src/Models/Builders/TenderSquareAccountDetailsBuilder.php deleted file mode 100644 index 48feb6d3..00000000 --- a/src/Models/Builders/TenderSquareAccountDetailsBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tender Square Account Details Builder object. - */ - public static function init(): self - { - return new self(new TenderSquareAccountDetails()); - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Tender Square Account Details object. - */ - public function build(): TenderSquareAccountDetails - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalActionBuilder.php b/src/Models/Builders/TerminalActionBuilder.php deleted file mode 100644 index 1f746191..00000000 --- a/src/Models/Builders/TerminalActionBuilder.php +++ /dev/null @@ -1,306 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Action Builder object. - */ - public static function init(): self - { - return new self(new TerminalAction()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Unsets device id field. - */ - public function unsetDeviceId(): self - { - $this->instance->unsetDeviceId(); - return $this; - } - - /** - * Sets deadline duration field. - * - * @param string|null $value - */ - public function deadlineDuration(?string $value): self - { - $this->instance->setDeadlineDuration($value); - return $this; - } - - /** - * Unsets deadline duration field. - */ - public function unsetDeadlineDuration(): self - { - $this->instance->unsetDeadlineDuration(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets app id field. - * - * @param string|null $value - */ - public function appId(?string $value): self - { - $this->instance->setAppId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets qr code options field. - * - * @param QrCodeOptions|null $value - */ - public function qrCodeOptions(?QrCodeOptions $value): self - { - $this->instance->setQrCodeOptions($value); - return $this; - } - - /** - * Sets save card options field. - * - * @param SaveCardOptions|null $value - */ - public function saveCardOptions(?SaveCardOptions $value): self - { - $this->instance->setSaveCardOptions($value); - return $this; - } - - /** - * Sets signature options field. - * - * @param SignatureOptions|null $value - */ - public function signatureOptions(?SignatureOptions $value): self - { - $this->instance->setSignatureOptions($value); - return $this; - } - - /** - * Sets confirmation options field. - * - * @param ConfirmationOptions|null $value - */ - public function confirmationOptions(?ConfirmationOptions $value): self - { - $this->instance->setConfirmationOptions($value); - return $this; - } - - /** - * Sets receipt options field. - * - * @param ReceiptOptions|null $value - */ - public function receiptOptions(?ReceiptOptions $value): self - { - $this->instance->setReceiptOptions($value); - return $this; - } - - /** - * Sets data collection options field. - * - * @param DataCollectionOptions|null $value - */ - public function dataCollectionOptions(?DataCollectionOptions $value): self - { - $this->instance->setDataCollectionOptions($value); - return $this; - } - - /** - * Sets select options field. - * - * @param SelectOptions|null $value - */ - public function selectOptions(?SelectOptions $value): self - { - $this->instance->setSelectOptions($value); - return $this; - } - - /** - * Sets device metadata field. - * - * @param DeviceMetadata|null $value - */ - public function deviceMetadata(?DeviceMetadata $value): self - { - $this->instance->setDeviceMetadata($value); - return $this; - } - - /** - * Sets await next action field. - * - * @param bool|null $value - */ - public function awaitNextAction(?bool $value): self - { - $this->instance->setAwaitNextAction($value); - return $this; - } - - /** - * Unsets await next action field. - */ - public function unsetAwaitNextAction(): self - { - $this->instance->unsetAwaitNextAction(); - return $this; - } - - /** - * Sets await next action duration field. - * - * @param string|null $value - */ - public function awaitNextActionDuration(?string $value): self - { - $this->instance->setAwaitNextActionDuration($value); - return $this; - } - - /** - * Unsets await next action duration field. - */ - public function unsetAwaitNextActionDuration(): self - { - $this->instance->unsetAwaitNextActionDuration(); - return $this; - } - - /** - * Initializes a new Terminal Action object. - */ - public function build(): TerminalAction - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalActionQueryBuilder.php b/src/Models/Builders/TerminalActionQueryBuilder.php deleted file mode 100644 index 11facfb0..00000000 --- a/src/Models/Builders/TerminalActionQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Action Query Builder object. - */ - public static function init(): self - { - return new self(new TerminalActionQuery()); - } - - /** - * Sets filter field. - * - * @param TerminalActionQueryFilter|null $value - */ - public function filter(?TerminalActionQueryFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param TerminalActionQuerySort|null $value - */ - public function sort(?TerminalActionQuerySort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Terminal Action Query object. - */ - public function build(): TerminalActionQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalActionQueryFilterBuilder.php b/src/Models/Builders/TerminalActionQueryFilterBuilder.php deleted file mode 100644 index 953e2576..00000000 --- a/src/Models/Builders/TerminalActionQueryFilterBuilder.php +++ /dev/null @@ -1,105 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Action Query Filter Builder object. - */ - public static function init(): self - { - return new self(new TerminalActionQueryFilter()); - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Unsets device id field. - */ - public function unsetDeviceId(): self - { - $this->instance->unsetDeviceId(); - return $this; - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Initializes a new Terminal Action Query Filter object. - */ - public function build(): TerminalActionQueryFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalActionQuerySortBuilder.php b/src/Models/Builders/TerminalActionQuerySortBuilder.php deleted file mode 100644 index e518eee7..00000000 --- a/src/Models/Builders/TerminalActionQuerySortBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Action Query Sort Builder object. - */ - public static function init(): self - { - return new self(new TerminalActionQuerySort()); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Initializes a new Terminal Action Query Sort object. - */ - public function build(): TerminalActionQuerySort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalCheckoutBuilder.php b/src/Models/Builders/TerminalCheckoutBuilder.php deleted file mode 100644 index 7327688c..00000000 --- a/src/Models/Builders/TerminalCheckoutBuilder.php +++ /dev/null @@ -1,320 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Checkout Builder object. - * - * @param Money $amountMoney - * @param DeviceCheckoutOptions $deviceOptions - */ - public static function init(Money $amountMoney, DeviceCheckoutOptions $deviceOptions): self - { - return new self(new TerminalCheckout($amountMoney, $deviceOptions)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Sets payment options field. - * - * @param PaymentOptions|null $value - */ - public function paymentOptions(?PaymentOptions $value): self - { - $this->instance->setPaymentOptions($value); - return $this; - } - - /** - * Sets deadline duration field. - * - * @param string|null $value - */ - public function deadlineDuration(?string $value): self - { - $this->instance->setDeadlineDuration($value); - return $this; - } - - /** - * Unsets deadline duration field. - */ - public function unsetDeadlineDuration(): self - { - $this->instance->unsetDeadlineDuration(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Sets payment ids field. - * - * @param string[]|null $value - */ - public function paymentIds(?array $value): self - { - $this->instance->setPaymentIds($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets app id field. - * - * @param string|null $value - */ - public function appId(?string $value): self - { - $this->instance->setAppId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Sets payment type field. - * - * @param string|null $value - */ - public function paymentType(?string $value): self - { - $this->instance->setPaymentType($value); - return $this; - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets customer id field. - * - * @param string|null $value - */ - public function customerId(?string $value): self - { - $this->instance->setCustomerId($value); - return $this; - } - - /** - * Unsets customer id field. - */ - public function unsetCustomerId(): self - { - $this->instance->unsetCustomerId(); - return $this; - } - - /** - * Sets app fee money field. - * - * @param Money|null $value - */ - public function appFeeMoney(?Money $value): self - { - $this->instance->setAppFeeMoney($value); - return $this; - } - - /** - * Sets statement description identifier field. - * - * @param string|null $value - */ - public function statementDescriptionIdentifier(?string $value): self - { - $this->instance->setStatementDescriptionIdentifier($value); - return $this; - } - - /** - * Unsets statement description identifier field. - */ - public function unsetStatementDescriptionIdentifier(): self - { - $this->instance->unsetStatementDescriptionIdentifier(); - return $this; - } - - /** - * Sets tip money field. - * - * @param Money|null $value - */ - public function tipMoney(?Money $value): self - { - $this->instance->setTipMoney($value); - return $this; - } - - /** - * Initializes a new Terminal Checkout object. - */ - public function build(): TerminalCheckout - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalCheckoutQueryBuilder.php b/src/Models/Builders/TerminalCheckoutQueryBuilder.php deleted file mode 100644 index ba7f8f82..00000000 --- a/src/Models/Builders/TerminalCheckoutQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Checkout Query Builder object. - */ - public static function init(): self - { - return new self(new TerminalCheckoutQuery()); - } - - /** - * Sets filter field. - * - * @param TerminalCheckoutQueryFilter|null $value - */ - public function filter(?TerminalCheckoutQueryFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param TerminalCheckoutQuerySort|null $value - */ - public function sort(?TerminalCheckoutQuerySort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Terminal Checkout Query object. - */ - public function build(): TerminalCheckoutQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalCheckoutQueryFilterBuilder.php b/src/Models/Builders/TerminalCheckoutQueryFilterBuilder.php deleted file mode 100644 index 0c0b13ce..00000000 --- a/src/Models/Builders/TerminalCheckoutQueryFilterBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Checkout Query Filter Builder object. - */ - public static function init(): self - { - return new self(new TerminalCheckoutQueryFilter()); - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Unsets device id field. - */ - public function unsetDeviceId(): self - { - $this->instance->unsetDeviceId(); - return $this; - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Initializes a new Terminal Checkout Query Filter object. - */ - public function build(): TerminalCheckoutQueryFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalCheckoutQuerySortBuilder.php b/src/Models/Builders/TerminalCheckoutQuerySortBuilder.php deleted file mode 100644 index 47c548b1..00000000 --- a/src/Models/Builders/TerminalCheckoutQuerySortBuilder.php +++ /dev/null @@ -1,53 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Checkout Query Sort Builder object. - */ - public static function init(): self - { - return new self(new TerminalCheckoutQuerySort()); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Initializes a new Terminal Checkout Query Sort object. - */ - public function build(): TerminalCheckoutQuerySort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalRefundBuilder.php b/src/Models/Builders/TerminalRefundBuilder.php deleted file mode 100644 index afc6453f..00000000 --- a/src/Models/Builders/TerminalRefundBuilder.php +++ /dev/null @@ -1,167 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Refund Builder object. - * - * @param string $paymentId - * @param Money $amountMoney - * @param string $reason - * @param string $deviceId - */ - public static function init(string $paymentId, Money $amountMoney, string $reason, string $deviceId): self - { - return new self(new TerminalRefund($paymentId, $amountMoney, $reason, $deviceId)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets refund id field. - * - * @param string|null $value - */ - public function refundId(?string $value): self - { - $this->instance->setRefundId($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Sets deadline duration field. - * - * @param string|null $value - */ - public function deadlineDuration(?string $value): self - { - $this->instance->setDeadlineDuration($value); - return $this; - } - - /** - * Unsets deadline duration field. - */ - public function unsetDeadlineDuration(): self - { - $this->instance->unsetDeadlineDuration(); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Sets cancel reason field. - * - * @param string|null $value - */ - public function cancelReason(?string $value): self - { - $this->instance->setCancelReason($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets app id field. - * - * @param string|null $value - */ - public function appId(?string $value): self - { - $this->instance->setAppId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Initializes a new Terminal Refund object. - */ - public function build(): TerminalRefund - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalRefundQueryBuilder.php b/src/Models/Builders/TerminalRefundQueryBuilder.php deleted file mode 100644 index 9d952475..00000000 --- a/src/Models/Builders/TerminalRefundQueryBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Refund Query Builder object. - */ - public static function init(): self - { - return new self(new TerminalRefundQuery()); - } - - /** - * Sets filter field. - * - * @param TerminalRefundQueryFilter|null $value - */ - public function filter(?TerminalRefundQueryFilter $value): self - { - $this->instance->setFilter($value); - return $this; - } - - /** - * Sets sort field. - * - * @param TerminalRefundQuerySort|null $value - */ - public function sort(?TerminalRefundQuerySort $value): self - { - $this->instance->setSort($value); - return $this; - } - - /** - * Initializes a new Terminal Refund Query object. - */ - public function build(): TerminalRefundQuery - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalRefundQueryFilterBuilder.php b/src/Models/Builders/TerminalRefundQueryFilterBuilder.php deleted file mode 100644 index c2a17d40..00000000 --- a/src/Models/Builders/TerminalRefundQueryFilterBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Refund Query Filter Builder object. - */ - public static function init(): self - { - return new self(new TerminalRefundQueryFilter()); - } - - /** - * Sets device id field. - * - * @param string|null $value - */ - public function deviceId(?string $value): self - { - $this->instance->setDeviceId($value); - return $this; - } - - /** - * Unsets device id field. - */ - public function unsetDeviceId(): self - { - $this->instance->unsetDeviceId(); - return $this; - } - - /** - * Sets created at field. - * - * @param TimeRange|null $value - */ - public function createdAt(?TimeRange $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Unsets status field. - */ - public function unsetStatus(): self - { - $this->instance->unsetStatus(); - return $this; - } - - /** - * Initializes a new Terminal Refund Query Filter object. - */ - public function build(): TerminalRefundQueryFilter - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TerminalRefundQuerySortBuilder.php b/src/Models/Builders/TerminalRefundQuerySortBuilder.php deleted file mode 100644 index a2c6c87f..00000000 --- a/src/Models/Builders/TerminalRefundQuerySortBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Terminal Refund Query Sort Builder object. - */ - public static function init(): self - { - return new self(new TerminalRefundQuerySort()); - } - - /** - * Sets sort order field. - * - * @param string|null $value - */ - public function sortOrder(?string $value): self - { - $this->instance->setSortOrder($value); - return $this; - } - - /** - * Unsets sort order field. - */ - public function unsetSortOrder(): self - { - $this->instance->unsetSortOrder(); - return $this; - } - - /** - * Initializes a new Terminal Refund Query Sort object. - */ - public function build(): TerminalRefundQuerySort - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TestWebhookSubscriptionRequestBuilder.php b/src/Models/Builders/TestWebhookSubscriptionRequestBuilder.php deleted file mode 100644 index cacfcd6d..00000000 --- a/src/Models/Builders/TestWebhookSubscriptionRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Test Webhook Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new TestWebhookSubscriptionRequest()); - } - - /** - * Sets event type field. - * - * @param string|null $value - */ - public function eventType(?string $value): self - { - $this->instance->setEventType($value); - return $this; - } - - /** - * Unsets event type field. - */ - public function unsetEventType(): self - { - $this->instance->unsetEventType(); - return $this; - } - - /** - * Initializes a new Test Webhook Subscription Request object. - */ - public function build(): TestWebhookSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TestWebhookSubscriptionResponseBuilder.php b/src/Models/Builders/TestWebhookSubscriptionResponseBuilder.php deleted file mode 100644 index 7fa383e4..00000000 --- a/src/Models/Builders/TestWebhookSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Test Webhook Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new TestWebhookSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription test result field. - * - * @param SubscriptionTestResult|null $value - */ - public function subscriptionTestResult(?SubscriptionTestResult $value): self - { - $this->instance->setSubscriptionTestResult($value); - return $this; - } - - /** - * Initializes a new Test Webhook Subscription Response object. - */ - public function build(): TestWebhookSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TimeRangeBuilder.php b/src/Models/Builders/TimeRangeBuilder.php deleted file mode 100644 index 7221ed13..00000000 --- a/src/Models/Builders/TimeRangeBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Time Range Builder object. - */ - public static function init(): self - { - return new self(new TimeRange()); - } - - /** - * Sets start at field. - * - * @param string|null $value - */ - public function startAt(?string $value): self - { - $this->instance->setStartAt($value); - return $this; - } - - /** - * Unsets start at field. - */ - public function unsetStartAt(): self - { - $this->instance->unsetStartAt(); - return $this; - } - - /** - * Sets end at field. - * - * @param string|null $value - */ - public function endAt(?string $value): self - { - $this->instance->setEndAt($value); - return $this; - } - - /** - * Unsets end at field. - */ - public function unsetEndAt(): self - { - $this->instance->unsetEndAt(); - return $this; - } - - /** - * Initializes a new Time Range object. - */ - public function build(): TimeRange - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TipSettingsBuilder.php b/src/Models/Builders/TipSettingsBuilder.php deleted file mode 100644 index 08bf4dcb..00000000 --- a/src/Models/Builders/TipSettingsBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Tip Settings Builder object. - */ - public static function init(): self - { - return new self(new TipSettings()); - } - - /** - * Sets allow tipping field. - * - * @param bool|null $value - */ - public function allowTipping(?bool $value): self - { - $this->instance->setAllowTipping($value); - return $this; - } - - /** - * Unsets allow tipping field. - */ - public function unsetAllowTipping(): self - { - $this->instance->unsetAllowTipping(); - return $this; - } - - /** - * Sets separate tip screen field. - * - * @param bool|null $value - */ - public function separateTipScreen(?bool $value): self - { - $this->instance->setSeparateTipScreen($value); - return $this; - } - - /** - * Unsets separate tip screen field. - */ - public function unsetSeparateTipScreen(): self - { - $this->instance->unsetSeparateTipScreen(); - return $this; - } - - /** - * Sets custom tip field field. - * - * @param bool|null $value - */ - public function customTipField(?bool $value): self - { - $this->instance->setCustomTipField($value); - return $this; - } - - /** - * Unsets custom tip field field. - */ - public function unsetCustomTipField(): self - { - $this->instance->unsetCustomTipField(); - return $this; - } - - /** - * Sets tip percentages field. - * - * @param int[]|null $value - */ - public function tipPercentages(?array $value): self - { - $this->instance->setTipPercentages($value); - return $this; - } - - /** - * Unsets tip percentages field. - */ - public function unsetTipPercentages(): self - { - $this->instance->unsetTipPercentages(); - return $this; - } - - /** - * Sets smart tipping field. - * - * @param bool|null $value - */ - public function smartTipping(?bool $value): self - { - $this->instance->setSmartTipping($value); - return $this; - } - - /** - * Unsets smart tipping field. - */ - public function unsetSmartTipping(): self - { - $this->instance->unsetSmartTipping(); - return $this; - } - - /** - * Initializes a new Tip Settings object. - */ - public function build(): TipSettings - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/TransactionBuilder.php b/src/Models/Builders/TransactionBuilder.php deleted file mode 100644 index 28e11806..00000000 --- a/src/Models/Builders/TransactionBuilder.php +++ /dev/null @@ -1,209 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Transaction Builder object. - */ - public static function init(): self - { - return new self(new Transaction()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets location id field. - * - * @param string|null $value - */ - public function locationId(?string $value): self - { - $this->instance->setLocationId($value); - return $this; - } - - /** - * Unsets location id field. - */ - public function unsetLocationId(): self - { - $this->instance->unsetLocationId(); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets tenders field. - * - * @param Tender[]|null $value - */ - public function tenders(?array $value): self - { - $this->instance->setTenders($value); - return $this; - } - - /** - * Unsets tenders field. - */ - public function unsetTenders(): self - { - $this->instance->unsetTenders(); - return $this; - } - - /** - * Sets refunds field. - * - * @param Refund[]|null $value - */ - public function refunds(?array $value): self - { - $this->instance->setRefunds($value); - return $this; - } - - /** - * Unsets refunds field. - */ - public function unsetRefunds(): self - { - $this->instance->unsetRefunds(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets product field. - * - * @param string|null $value - */ - public function product(?string $value): self - { - $this->instance->setProduct($value); - return $this; - } - - /** - * Sets client id field. - * - * @param string|null $value - */ - public function clientId(?string $value): self - { - $this->instance->setClientId($value); - return $this; - } - - /** - * Unsets client id field. - */ - public function unsetClientId(): self - { - $this->instance->unsetClientId(); - return $this; - } - - /** - * Sets shipping address field. - * - * @param Address|null $value - */ - public function shippingAddress(?Address $value): self - { - $this->instance->setShippingAddress($value); - return $this; - } - - /** - * Sets order id field. - * - * @param string|null $value - */ - public function orderId(?string $value): self - { - $this->instance->setOrderId($value); - return $this; - } - - /** - * Unsets order id field. - */ - public function unsetOrderId(): self - { - $this->instance->unsetOrderId(); - return $this; - } - - /** - * Initializes a new Transaction object. - */ - public function build(): Transaction - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UnlinkCustomerFromGiftCardRequestBuilder.php b/src/Models/Builders/UnlinkCustomerFromGiftCardRequestBuilder.php deleted file mode 100644 index 5d1a38ee..00000000 --- a/src/Models/Builders/UnlinkCustomerFromGiftCardRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Unlink Customer From Gift Card Request Builder object. - * - * @param string $customerId - */ - public static function init(string $customerId): self - { - return new self(new UnlinkCustomerFromGiftCardRequest($customerId)); - } - - /** - * Initializes a new Unlink Customer From Gift Card Request object. - */ - public function build(): UnlinkCustomerFromGiftCardRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UnlinkCustomerFromGiftCardResponseBuilder.php b/src/Models/Builders/UnlinkCustomerFromGiftCardResponseBuilder.php deleted file mode 100644 index 9e5d0e65..00000000 --- a/src/Models/Builders/UnlinkCustomerFromGiftCardResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Unlink Customer From Gift Card Response Builder object. - */ - public static function init(): self - { - return new self(new UnlinkCustomerFromGiftCardResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets gift card field. - * - * @param GiftCard|null $value - */ - public function giftCard(?GiftCard $value): self - { - $this->instance->setGiftCard($value); - return $this; - } - - /** - * Initializes a new Unlink Customer From Gift Card Response object. - */ - public function build(): UnlinkCustomerFromGiftCardResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBookingCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/UpdateBookingCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 22d0ceb9..00000000 --- a/src/Models/Builders/UpdateBookingCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Booking Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new UpdateBookingCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Booking Custom Attribute Definition Request object. - */ - public function build(): UpdateBookingCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBookingCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/UpdateBookingCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 0c0264a5..00000000 --- a/src/Models/Builders/UpdateBookingCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Booking Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateBookingCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Booking Custom Attribute Definition Response object. - */ - public function build(): UpdateBookingCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBookingRequestBuilder.php b/src/Models/Builders/UpdateBookingRequestBuilder.php deleted file mode 100644 index 3ee7df2b..00000000 --- a/src/Models/Builders/UpdateBookingRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Booking Request Builder object. - * - * @param Booking $booking - */ - public static function init(Booking $booking): self - { - return new self(new UpdateBookingRequest($booking)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Booking Request object. - */ - public function build(): UpdateBookingRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBookingResponseBuilder.php b/src/Models/Builders/UpdateBookingResponseBuilder.php deleted file mode 100644 index 7ab93f41..00000000 --- a/src/Models/Builders/UpdateBookingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Booking Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateBookingResponse()); - } - - /** - * Sets booking field. - * - * @param Booking|null $value - */ - public function booking(?Booking $value): self - { - $this->instance->setBooking($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Booking Response object. - */ - public function build(): UpdateBookingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBreakTypeRequestBuilder.php b/src/Models/Builders/UpdateBreakTypeRequestBuilder.php deleted file mode 100644 index 495c68e3..00000000 --- a/src/Models/Builders/UpdateBreakTypeRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Break Type Request Builder object. - * - * @param BreakType $breakType - */ - public static function init(BreakType $breakType): self - { - return new self(new UpdateBreakTypeRequest($breakType)); - } - - /** - * Initializes a new Update Break Type Request object. - */ - public function build(): UpdateBreakTypeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateBreakTypeResponseBuilder.php b/src/Models/Builders/UpdateBreakTypeResponseBuilder.php deleted file mode 100644 index ead41709..00000000 --- a/src/Models/Builders/UpdateBreakTypeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Break Type Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateBreakTypeResponse()); - } - - /** - * Sets break type field. - * - * @param BreakType|null $value - */ - public function breakType(?BreakType $value): self - { - $this->instance->setBreakType($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Break Type Response object. - */ - public function build(): UpdateBreakTypeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCatalogImageRequestBuilder.php b/src/Models/Builders/UpdateCatalogImageRequestBuilder.php deleted file mode 100644 index 872fb62a..00000000 --- a/src/Models/Builders/UpdateCatalogImageRequestBuilder.php +++ /dev/null @@ -1,44 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Catalog Image Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new UpdateCatalogImageRequest($idempotencyKey)); - } - - /** - * Initializes a new Update Catalog Image Request object. - */ - public function build(): UpdateCatalogImageRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCatalogImageResponseBuilder.php b/src/Models/Builders/UpdateCatalogImageResponseBuilder.php deleted file mode 100644 index 1b9f4896..00000000 --- a/src/Models/Builders/UpdateCatalogImageResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Catalog Image Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateCatalogImageResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets image field. - * - * @param CatalogObject|null $value - */ - public function image(?CatalogObject $value): self - { - $this->instance->setImage($value); - return $this; - } - - /** - * Initializes a new Update Catalog Image Response object. - */ - public function build(): UpdateCatalogImageResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 7dbaad61..00000000 --- a/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new UpdateCustomerCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Customer Custom Attribute Definition Request object. - */ - public function build(): UpdateCustomerCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index f686a652..00000000 --- a/src/Models/Builders/UpdateCustomerCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateCustomerCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Customer Custom Attribute Definition Response object. - */ - public function build(): UpdateCustomerCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerGroupRequestBuilder.php b/src/Models/Builders/UpdateCustomerGroupRequestBuilder.php deleted file mode 100644 index 773a3346..00000000 --- a/src/Models/Builders/UpdateCustomerGroupRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Group Request Builder object. - * - * @param CustomerGroup $group - */ - public static function init(CustomerGroup $group): self - { - return new self(new UpdateCustomerGroupRequest($group)); - } - - /** - * Initializes a new Update Customer Group Request object. - */ - public function build(): UpdateCustomerGroupRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerGroupResponseBuilder.php b/src/Models/Builders/UpdateCustomerGroupResponseBuilder.php deleted file mode 100644 index 30231d44..00000000 --- a/src/Models/Builders/UpdateCustomerGroupResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Group Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateCustomerGroupResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets group field. - * - * @param CustomerGroup|null $value - */ - public function group(?CustomerGroup $value): self - { - $this->instance->setGroup($value); - return $this; - } - - /** - * Initializes a new Update Customer Group Response object. - */ - public function build(): UpdateCustomerGroupResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerRequestBuilder.php b/src/Models/Builders/UpdateCustomerRequestBuilder.php deleted file mode 100644 index af8ac1a2..00000000 --- a/src/Models/Builders/UpdateCustomerRequestBuilder.php +++ /dev/null @@ -1,257 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateCustomerRequest()); - } - - /** - * Sets given name field. - * - * @param string|null $value - */ - public function givenName(?string $value): self - { - $this->instance->setGivenName($value); - return $this; - } - - /** - * Unsets given name field. - */ - public function unsetGivenName(): self - { - $this->instance->unsetGivenName(); - return $this; - } - - /** - * Sets family name field. - * - * @param string|null $value - */ - public function familyName(?string $value): self - { - $this->instance->setFamilyName($value); - return $this; - } - - /** - * Unsets family name field. - */ - public function unsetFamilyName(): self - { - $this->instance->unsetFamilyName(); - return $this; - } - - /** - * Sets company name field. - * - * @param string|null $value - */ - public function companyName(?string $value): self - { - $this->instance->setCompanyName($value); - return $this; - } - - /** - * Unsets company name field. - */ - public function unsetCompanyName(): self - { - $this->instance->unsetCompanyName(); - return $this; - } - - /** - * Sets nickname field. - * - * @param string|null $value - */ - public function nickname(?string $value): self - { - $this->instance->setNickname($value); - return $this; - } - - /** - * Unsets nickname field. - */ - public function unsetNickname(): self - { - $this->instance->unsetNickname(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets reference id field. - * - * @param string|null $value - */ - public function referenceId(?string $value): self - { - $this->instance->setReferenceId($value); - return $this; - } - - /** - * Unsets reference id field. - */ - public function unsetReferenceId(): self - { - $this->instance->unsetReferenceId(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets birthday field. - * - * @param string|null $value - */ - public function birthday(?string $value): self - { - $this->instance->setBirthday($value); - return $this; - } - - /** - * Unsets birthday field. - */ - public function unsetBirthday(): self - { - $this->instance->unsetBirthday(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets tax ids field. - * - * @param CustomerTaxIds|null $value - */ - public function taxIds(?CustomerTaxIds $value): self - { - $this->instance->setTaxIds($value); - return $this; - } - - /** - * Initializes a new Update Customer Request object. - */ - public function build(): UpdateCustomerRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateCustomerResponseBuilder.php b/src/Models/Builders/UpdateCustomerResponseBuilder.php deleted file mode 100644 index 1a7490e8..00000000 --- a/src/Models/Builders/UpdateCustomerResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Customer Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateCustomerResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets customer field. - * - * @param Customer|null $value - */ - public function customer(?Customer $value): self - { - $this->instance->setCustomer($value); - return $this; - } - - /** - * Initializes a new Update Customer Response object. - */ - public function build(): UpdateCustomerResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateInvoiceRequestBuilder.php b/src/Models/Builders/UpdateInvoiceRequestBuilder.php deleted file mode 100644 index 06c40a0e..00000000 --- a/src/Models/Builders/UpdateInvoiceRequestBuilder.php +++ /dev/null @@ -1,85 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Invoice Request Builder object. - * - * @param Invoice $invoice - */ - public static function init(Invoice $invoice): self - { - return new self(new UpdateInvoiceRequest($invoice)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Sets fields to clear field. - * - * @param string[]|null $value - */ - public function fieldsToClear(?array $value): self - { - $this->instance->setFieldsToClear($value); - return $this; - } - - /** - * Unsets fields to clear field. - */ - public function unsetFieldsToClear(): self - { - $this->instance->unsetFieldsToClear(); - return $this; - } - - /** - * Initializes a new Update Invoice Request object. - */ - public function build(): UpdateInvoiceRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateInvoiceResponseBuilder.php b/src/Models/Builders/UpdateInvoiceResponseBuilder.php deleted file mode 100644 index f9656e23..00000000 --- a/src/Models/Builders/UpdateInvoiceResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Invoice Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateInvoiceResponse()); - } - - /** - * Sets invoice field. - * - * @param Invoice|null $value - */ - public function invoice(?Invoice $value): self - { - $this->instance->setInvoice($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Invoice Response object. - */ - public function build(): UpdateInvoiceResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateItemModifierListsRequestBuilder.php b/src/Models/Builders/UpdateItemModifierListsRequestBuilder.php deleted file mode 100644 index 5cd37814..00000000 --- a/src/Models/Builders/UpdateItemModifierListsRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Item Modifier Lists Request Builder object. - * - * @param string[] $itemIds - */ - public static function init(array $itemIds): self - { - return new self(new UpdateItemModifierListsRequest($itemIds)); - } - - /** - * Sets modifier lists to enable field. - * - * @param string[]|null $value - */ - public function modifierListsToEnable(?array $value): self - { - $this->instance->setModifierListsToEnable($value); - return $this; - } - - /** - * Unsets modifier lists to enable field. - */ - public function unsetModifierListsToEnable(): self - { - $this->instance->unsetModifierListsToEnable(); - return $this; - } - - /** - * Sets modifier lists to disable field. - * - * @param string[]|null $value - */ - public function modifierListsToDisable(?array $value): self - { - $this->instance->setModifierListsToDisable($value); - return $this; - } - - /** - * Unsets modifier lists to disable field. - */ - public function unsetModifierListsToDisable(): self - { - $this->instance->unsetModifierListsToDisable(); - return $this; - } - - /** - * Initializes a new Update Item Modifier Lists Request object. - */ - public function build(): UpdateItemModifierListsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateItemModifierListsResponseBuilder.php b/src/Models/Builders/UpdateItemModifierListsResponseBuilder.php deleted file mode 100644 index f0382c02..00000000 --- a/src/Models/Builders/UpdateItemModifierListsResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Item Modifier Lists Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateItemModifierListsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Update Item Modifier Lists Response object. - */ - public function build(): UpdateItemModifierListsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateItemTaxesRequestBuilder.php b/src/Models/Builders/UpdateItemTaxesRequestBuilder.php deleted file mode 100644 index bf2781ec..00000000 --- a/src/Models/Builders/UpdateItemTaxesRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Item Taxes Request Builder object. - * - * @param string[] $itemIds - */ - public static function init(array $itemIds): self - { - return new self(new UpdateItemTaxesRequest($itemIds)); - } - - /** - * Sets taxes to enable field. - * - * @param string[]|null $value - */ - public function taxesToEnable(?array $value): self - { - $this->instance->setTaxesToEnable($value); - return $this; - } - - /** - * Unsets taxes to enable field. - */ - public function unsetTaxesToEnable(): self - { - $this->instance->unsetTaxesToEnable(); - return $this; - } - - /** - * Sets taxes to disable field. - * - * @param string[]|null $value - */ - public function taxesToDisable(?array $value): self - { - $this->instance->setTaxesToDisable($value); - return $this; - } - - /** - * Unsets taxes to disable field. - */ - public function unsetTaxesToDisable(): self - { - $this->instance->unsetTaxesToDisable(); - return $this; - } - - /** - * Initializes a new Update Item Taxes Request object. - */ - public function build(): UpdateItemTaxesRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateItemTaxesResponseBuilder.php b/src/Models/Builders/UpdateItemTaxesResponseBuilder.php deleted file mode 100644 index d65fa21b..00000000 --- a/src/Models/Builders/UpdateItemTaxesResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Item Taxes Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateItemTaxesResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Update Item Taxes Response object. - */ - public function build(): UpdateItemTaxesResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateJobRequestBuilder.php b/src/Models/Builders/UpdateJobRequestBuilder.php deleted file mode 100644 index 81559320..00000000 --- a/src/Models/Builders/UpdateJobRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Job Request Builder object. - * - * @param Job $job - */ - public static function init(Job $job): self - { - return new self(new UpdateJobRequest($job)); - } - - /** - * Initializes a new Update Job Request object. - */ - public function build(): UpdateJobRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateJobResponseBuilder.php b/src/Models/Builders/UpdateJobResponseBuilder.php deleted file mode 100644 index d9dd7936..00000000 --- a/src/Models/Builders/UpdateJobResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Job Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateJobResponse()); - } - - /** - * Sets job field. - * - * @param Job|null $value - */ - public function job(?Job $value): self - { - $this->instance->setJob($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Job Response object. - */ - public function build(): UpdateJobResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/UpdateLocationCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 7b421a5f..00000000 --- a/src/Models/Builders/UpdateLocationCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new UpdateLocationCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Location Custom Attribute Definition Request object. - */ - public function build(): UpdateLocationCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/UpdateLocationCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index fedbf4f2..00000000 --- a/src/Models/Builders/UpdateLocationCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateLocationCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Location Custom Attribute Definition Response object. - */ - public function build(): UpdateLocationCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationRequestBuilder.php b/src/Models/Builders/UpdateLocationRequestBuilder.php deleted file mode 100644 index 1a3b32b0..00000000 --- a/src/Models/Builders/UpdateLocationRequestBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateLocationRequest()); - } - - /** - * Sets location field. - * - * @param Location|null $value - */ - public function location(?Location $value): self - { - $this->instance->setLocation($value); - return $this; - } - - /** - * Initializes a new Update Location Request object. - */ - public function build(): UpdateLocationRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationResponseBuilder.php b/src/Models/Builders/UpdateLocationResponseBuilder.php deleted file mode 100644 index da0b9642..00000000 --- a/src/Models/Builders/UpdateLocationResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateLocationResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets location field. - * - * @param Location|null $value - */ - public function location(?Location $value): self - { - $this->instance->setLocation($value); - return $this; - } - - /** - * Initializes a new Update Location Response object. - */ - public function build(): UpdateLocationResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationSettingsRequestBuilder.php b/src/Models/Builders/UpdateLocationSettingsRequestBuilder.php deleted file mode 100644 index d3fc1c10..00000000 --- a/src/Models/Builders/UpdateLocationSettingsRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Settings Request Builder object. - * - * @param CheckoutLocationSettings $locationSettings - */ - public static function init(CheckoutLocationSettings $locationSettings): self - { - return new self(new UpdateLocationSettingsRequest($locationSettings)); - } - - /** - * Initializes a new Update Location Settings Request object. - */ - public function build(): UpdateLocationSettingsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateLocationSettingsResponseBuilder.php b/src/Models/Builders/UpdateLocationSettingsResponseBuilder.php deleted file mode 100644 index 29079cb8..00000000 --- a/src/Models/Builders/UpdateLocationSettingsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Location Settings Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateLocationSettingsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets location settings field. - * - * @param CheckoutLocationSettings|null $value - */ - public function locationSettings(?CheckoutLocationSettings $value): self - { - $this->instance->setLocationSettings($value); - return $this; - } - - /** - * Initializes a new Update Location Settings Response object. - */ - public function build(): UpdateLocationSettingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index b7bd2098..00000000 --- a/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Merchant Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new UpdateMerchantCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Merchant Custom Attribute Definition Request object. - */ - public function build(): UpdateMerchantCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index cbdea2f7..00000000 --- a/src/Models/Builders/UpdateMerchantCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Merchant Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateMerchantCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Merchant Custom Attribute Definition Response object. - */ - public function build(): UpdateMerchantCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateMerchantSettingsRequestBuilder.php b/src/Models/Builders/UpdateMerchantSettingsRequestBuilder.php deleted file mode 100644 index 7d46547e..00000000 --- a/src/Models/Builders/UpdateMerchantSettingsRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Merchant Settings Request Builder object. - * - * @param CheckoutMerchantSettings $merchantSettings - */ - public static function init(CheckoutMerchantSettings $merchantSettings): self - { - return new self(new UpdateMerchantSettingsRequest($merchantSettings)); - } - - /** - * Initializes a new Update Merchant Settings Request object. - */ - public function build(): UpdateMerchantSettingsRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateMerchantSettingsResponseBuilder.php b/src/Models/Builders/UpdateMerchantSettingsResponseBuilder.php deleted file mode 100644 index 6d7c1a7e..00000000 --- a/src/Models/Builders/UpdateMerchantSettingsResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Merchant Settings Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateMerchantSettingsResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets merchant settings field. - * - * @param CheckoutMerchantSettings|null $value - */ - public function merchantSettings(?CheckoutMerchantSettings $value): self - { - $this->instance->setMerchantSettings($value); - return $this; - } - - /** - * Initializes a new Update Merchant Settings Response object. - */ - public function build(): UpdateMerchantSettingsResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateOrderCustomAttributeDefinitionRequestBuilder.php b/src/Models/Builders/UpdateOrderCustomAttributeDefinitionRequestBuilder.php deleted file mode 100644 index 629154cf..00000000 --- a/src/Models/Builders/UpdateOrderCustomAttributeDefinitionRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Order Custom Attribute Definition Request Builder object. - * - * @param CustomAttributeDefinition $customAttributeDefinition - */ - public static function init(CustomAttributeDefinition $customAttributeDefinition): self - { - return new self(new UpdateOrderCustomAttributeDefinitionRequest($customAttributeDefinition)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Order Custom Attribute Definition Request object. - */ - public function build(): UpdateOrderCustomAttributeDefinitionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateOrderCustomAttributeDefinitionResponseBuilder.php b/src/Models/Builders/UpdateOrderCustomAttributeDefinitionResponseBuilder.php deleted file mode 100644 index 4529b33f..00000000 --- a/src/Models/Builders/UpdateOrderCustomAttributeDefinitionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Order Custom Attribute Definition Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateOrderCustomAttributeDefinitionResponse()); - } - - /** - * Sets custom attribute definition field. - * - * @param CustomAttributeDefinition|null $value - */ - public function customAttributeDefinition(?CustomAttributeDefinition $value): self - { - $this->instance->setCustomAttributeDefinition($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Order Custom Attribute Definition Response object. - */ - public function build(): UpdateOrderCustomAttributeDefinitionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateOrderRequestBuilder.php b/src/Models/Builders/UpdateOrderRequestBuilder.php deleted file mode 100644 index b93f9809..00000000 --- a/src/Models/Builders/UpdateOrderRequestBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Order Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateOrderRequest()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets fields to clear field. - * - * @param string[]|null $value - */ - public function fieldsToClear(?array $value): self - { - $this->instance->setFieldsToClear($value); - return $this; - } - - /** - * Unsets fields to clear field. - */ - public function unsetFieldsToClear(): self - { - $this->instance->unsetFieldsToClear(); - return $this; - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Order Request object. - */ - public function build(): UpdateOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateOrderResponseBuilder.php b/src/Models/Builders/UpdateOrderResponseBuilder.php deleted file mode 100644 index 660e7250..00000000 --- a/src/Models/Builders/UpdateOrderResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Order Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateOrderResponse()); - } - - /** - * Sets order field. - * - * @param Order|null $value - */ - public function order(?Order $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Order Response object. - */ - public function build(): UpdateOrderResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdatePaymentLinkRequestBuilder.php b/src/Models/Builders/UpdatePaymentLinkRequestBuilder.php deleted file mode 100644 index ff46e805..00000000 --- a/src/Models/Builders/UpdatePaymentLinkRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Payment Link Request Builder object. - * - * @param PaymentLink $paymentLink - */ - public static function init(PaymentLink $paymentLink): self - { - return new self(new UpdatePaymentLinkRequest($paymentLink)); - } - - /** - * Initializes a new Update Payment Link Request object. - */ - public function build(): UpdatePaymentLinkRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdatePaymentLinkResponseBuilder.php b/src/Models/Builders/UpdatePaymentLinkResponseBuilder.php deleted file mode 100644 index 5d2433e2..00000000 --- a/src/Models/Builders/UpdatePaymentLinkResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Payment Link Response Builder object. - */ - public static function init(): self - { - return new self(new UpdatePaymentLinkResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment link field. - * - * @param PaymentLink|null $value - */ - public function paymentLink(?PaymentLink $value): self - { - $this->instance->setPaymentLink($value); - return $this; - } - - /** - * Initializes a new Update Payment Link Response object. - */ - public function build(): UpdatePaymentLinkResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdatePaymentRequestBuilder.php b/src/Models/Builders/UpdatePaymentRequestBuilder.php deleted file mode 100644 index b0878dd5..00000000 --- a/src/Models/Builders/UpdatePaymentRequestBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Payment Request Builder object. - * - * @param string $idempotencyKey - */ - public static function init(string $idempotencyKey): self - { - return new self(new UpdatePaymentRequest($idempotencyKey)); - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Update Payment Request object. - */ - public function build(): UpdatePaymentRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdatePaymentResponseBuilder.php b/src/Models/Builders/UpdatePaymentResponseBuilder.php deleted file mode 100644 index 79173ca1..00000000 --- a/src/Models/Builders/UpdatePaymentResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Payment Response Builder object. - */ - public static function init(): self - { - return new self(new UpdatePaymentResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets payment field. - * - * @param Payment|null $value - */ - public function payment(?Payment $value): self - { - $this->instance->setPayment($value); - return $this; - } - - /** - * Initializes a new Update Payment Response object. - */ - public function build(): UpdatePaymentResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateShiftRequestBuilder.php b/src/Models/Builders/UpdateShiftRequestBuilder.php deleted file mode 100644 index d325bf30..00000000 --- a/src/Models/Builders/UpdateShiftRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Shift Request Builder object. - * - * @param Shift $shift - */ - public static function init(Shift $shift): self - { - return new self(new UpdateShiftRequest($shift)); - } - - /** - * Initializes a new Update Shift Request object. - */ - public function build(): UpdateShiftRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateShiftResponseBuilder.php b/src/Models/Builders/UpdateShiftResponseBuilder.php deleted file mode 100644 index 85b441fa..00000000 --- a/src/Models/Builders/UpdateShiftResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Shift Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateShiftResponse()); - } - - /** - * Sets shift field. - * - * @param Shift|null $value - */ - public function shift(?Shift $value): self - { - $this->instance->setShift($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Shift Response object. - */ - public function build(): UpdateShiftResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateSubscriptionRequestBuilder.php b/src/Models/Builders/UpdateSubscriptionRequestBuilder.php deleted file mode 100644 index 42382be9..00000000 --- a/src/Models/Builders/UpdateSubscriptionRequestBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateSubscriptionRequest()); - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Update Subscription Request object. - */ - public function build(): UpdateSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateSubscriptionResponseBuilder.php b/src/Models/Builders/UpdateSubscriptionResponseBuilder.php deleted file mode 100644 index 7b50fcb1..00000000 --- a/src/Models/Builders/UpdateSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param Subscription|null $value - */ - public function subscription(?Subscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Update Subscription Response object. - */ - public function build(): UpdateSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateTeamMemberRequestBuilder.php b/src/Models/Builders/UpdateTeamMemberRequestBuilder.php deleted file mode 100644 index 10f9c264..00000000 --- a/src/Models/Builders/UpdateTeamMemberRequestBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Team Member Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateTeamMemberRequest()); - } - - /** - * Sets team member field. - * - * @param TeamMember|null $value - */ - public function teamMember(?TeamMember $value): self - { - $this->instance->setTeamMember($value); - return $this; - } - - /** - * Initializes a new Update Team Member Request object. - */ - public function build(): UpdateTeamMemberRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateTeamMemberResponseBuilder.php b/src/Models/Builders/UpdateTeamMemberResponseBuilder.php deleted file mode 100644 index 91fad065..00000000 --- a/src/Models/Builders/UpdateTeamMemberResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Team Member Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateTeamMemberResponse()); - } - - /** - * Sets team member field. - * - * @param TeamMember|null $value - */ - public function teamMember(?TeamMember $value): self - { - $this->instance->setTeamMember($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Team Member Response object. - */ - public function build(): UpdateTeamMemberResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateVendorRequestBuilder.php b/src/Models/Builders/UpdateVendorRequestBuilder.php deleted file mode 100644 index f6c38be8..00000000 --- a/src/Models/Builders/UpdateVendorRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Vendor Request Builder object. - * - * @param Vendor $vendor - */ - public static function init(Vendor $vendor): self - { - return new self(new UpdateVendorRequest($vendor)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Vendor Request object. - */ - public function build(): UpdateVendorRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateVendorResponseBuilder.php b/src/Models/Builders/UpdateVendorResponseBuilder.php deleted file mode 100644 index 018bc3dc..00000000 --- a/src/Models/Builders/UpdateVendorResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Vendor Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateVendorResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets vendor field. - * - * @param Vendor|null $value - */ - public function vendor(?Vendor $value): self - { - $this->instance->setVendor($value); - return $this; - } - - /** - * Initializes a new Update Vendor Response object. - */ - public function build(): UpdateVendorResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWageSettingRequestBuilder.php b/src/Models/Builders/UpdateWageSettingRequestBuilder.php deleted file mode 100644 index 13220b48..00000000 --- a/src/Models/Builders/UpdateWageSettingRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Wage Setting Request Builder object. - * - * @param WageSetting $wageSetting - */ - public static function init(WageSetting $wageSetting): self - { - return new self(new UpdateWageSettingRequest($wageSetting)); - } - - /** - * Initializes a new Update Wage Setting Request object. - */ - public function build(): UpdateWageSettingRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWageSettingResponseBuilder.php b/src/Models/Builders/UpdateWageSettingResponseBuilder.php deleted file mode 100644 index 2081d63d..00000000 --- a/src/Models/Builders/UpdateWageSettingResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Wage Setting Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateWageSettingResponse()); - } - - /** - * Sets wage setting field. - * - * @param WageSetting|null $value - */ - public function wageSetting(?WageSetting $value): self - { - $this->instance->setWageSetting($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Wage Setting Response object. - */ - public function build(): UpdateWageSettingResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWebhookSubscriptionRequestBuilder.php b/src/Models/Builders/UpdateWebhookSubscriptionRequestBuilder.php deleted file mode 100644 index 002a53dd..00000000 --- a/src/Models/Builders/UpdateWebhookSubscriptionRequestBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Webhook Subscription Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateWebhookSubscriptionRequest()); - } - - /** - * Sets subscription field. - * - * @param WebhookSubscription|null $value - */ - public function subscription(?WebhookSubscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Update Webhook Subscription Request object. - */ - public function build(): UpdateWebhookSubscriptionRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWebhookSubscriptionResponseBuilder.php b/src/Models/Builders/UpdateWebhookSubscriptionResponseBuilder.php deleted file mode 100644 index f6b95155..00000000 --- a/src/Models/Builders/UpdateWebhookSubscriptionResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Webhook Subscription Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateWebhookSubscriptionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets subscription field. - * - * @param WebhookSubscription|null $value - */ - public function subscription(?WebhookSubscription $value): self - { - $this->instance->setSubscription($value); - return $this; - } - - /** - * Initializes a new Update Webhook Subscription Response object. - */ - public function build(): UpdateWebhookSubscriptionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyRequestBuilder.php b/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyRequestBuilder.php deleted file mode 100644 index 2523e67e..00000000 --- a/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyRequestBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Webhook Subscription Signature Key Request Builder object. - */ - public static function init(): self - { - return new self(new UpdateWebhookSubscriptionSignatureKeyRequest()); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Update Webhook Subscription Signature Key Request object. - */ - public function build(): UpdateWebhookSubscriptionSignatureKeyRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyResponseBuilder.php b/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyResponseBuilder.php deleted file mode 100644 index c40a4466..00000000 --- a/src/Models/Builders/UpdateWebhookSubscriptionSignatureKeyResponseBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Webhook Subscription Signature Key Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateWebhookSubscriptionSignatureKeyResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets signature key field. - * - * @param string|null $value - */ - public function signatureKey(?string $value): self - { - $this->instance->setSignatureKey($value); - return $this; - } - - /** - * Initializes a new Update Webhook Subscription Signature Key Response object. - */ - public function build(): UpdateWebhookSubscriptionSignatureKeyResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWorkweekConfigRequestBuilder.php b/src/Models/Builders/UpdateWorkweekConfigRequestBuilder.php deleted file mode 100644 index dac4404d..00000000 --- a/src/Models/Builders/UpdateWorkweekConfigRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Workweek Config Request Builder object. - * - * @param WorkweekConfig $workweekConfig - */ - public static function init(WorkweekConfig $workweekConfig): self - { - return new self(new UpdateWorkweekConfigRequest($workweekConfig)); - } - - /** - * Initializes a new Update Workweek Config Request object. - */ - public function build(): UpdateWorkweekConfigRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpdateWorkweekConfigResponseBuilder.php b/src/Models/Builders/UpdateWorkweekConfigResponseBuilder.php deleted file mode 100644 index e7d02ae2..00000000 --- a/src/Models/Builders/UpdateWorkweekConfigResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Update Workweek Config Response Builder object. - */ - public static function init(): self - { - return new self(new UpdateWorkweekConfigResponse()); - } - - /** - * Sets workweek config field. - * - * @param WorkweekConfig|null $value - */ - public function workweekConfig(?WorkweekConfig $value): self - { - $this->instance->setWorkweekConfig($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Update Workweek Config Response object. - */ - public function build(): UpdateWorkweekConfigResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertBookingCustomAttributeRequestBuilder.php b/src/Models/Builders/UpsertBookingCustomAttributeRequestBuilder.php deleted file mode 100644 index 4f49dd7c..00000000 --- a/src/Models/Builders/UpsertBookingCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Booking Custom Attribute Request Builder object. - * - * @param CustomAttribute $customAttribute - */ - public static function init(CustomAttribute $customAttribute): self - { - return new self(new UpsertBookingCustomAttributeRequest($customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Upsert Booking Custom Attribute Request object. - */ - public function build(): UpsertBookingCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertBookingCustomAttributeResponseBuilder.php b/src/Models/Builders/UpsertBookingCustomAttributeResponseBuilder.php deleted file mode 100644 index 88d7ed51..00000000 --- a/src/Models/Builders/UpsertBookingCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Booking Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertBookingCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Upsert Booking Custom Attribute Response object. - */ - public function build(): UpsertBookingCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertCatalogObjectRequestBuilder.php b/src/Models/Builders/UpsertCatalogObjectRequestBuilder.php deleted file mode 100644 index 6bd3ff5d..00000000 --- a/src/Models/Builders/UpsertCatalogObjectRequestBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Catalog Object Request Builder object. - * - * @param string $idempotencyKey - * @param CatalogObject $object - */ - public static function init(string $idempotencyKey, CatalogObject $object): self - { - return new self(new UpsertCatalogObjectRequest($idempotencyKey, $object)); - } - - /** - * Initializes a new Upsert Catalog Object Request object. - */ - public function build(): UpsertCatalogObjectRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertCatalogObjectResponseBuilder.php b/src/Models/Builders/UpsertCatalogObjectResponseBuilder.php deleted file mode 100644 index 69f77dd9..00000000 --- a/src/Models/Builders/UpsertCatalogObjectResponseBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Catalog Object Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertCatalogObjectResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets catalog object field. - * - * @param CatalogObject|null $value - */ - public function catalogObject(?CatalogObject $value): self - { - $this->instance->setCatalogObject($value); - return $this; - } - - /** - * Sets id mappings field. - * - * @param CatalogIdMapping[]|null $value - */ - public function idMappings(?array $value): self - { - $this->instance->setIdMappings($value); - return $this; - } - - /** - * Initializes a new Upsert Catalog Object Response object. - */ - public function build(): UpsertCatalogObjectResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertCustomerCustomAttributeRequestBuilder.php b/src/Models/Builders/UpsertCustomerCustomAttributeRequestBuilder.php deleted file mode 100644 index dfbe1454..00000000 --- a/src/Models/Builders/UpsertCustomerCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Customer Custom Attribute Request Builder object. - * - * @param CustomAttribute $customAttribute - */ - public static function init(CustomAttribute $customAttribute): self - { - return new self(new UpsertCustomerCustomAttributeRequest($customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Upsert Customer Custom Attribute Request object. - */ - public function build(): UpsertCustomerCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertCustomerCustomAttributeResponseBuilder.php b/src/Models/Builders/UpsertCustomerCustomAttributeResponseBuilder.php deleted file mode 100644 index 8d99ead0..00000000 --- a/src/Models/Builders/UpsertCustomerCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Customer Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertCustomerCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Upsert Customer Custom Attribute Response object. - */ - public function build(): UpsertCustomerCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertLocationCustomAttributeRequestBuilder.php b/src/Models/Builders/UpsertLocationCustomAttributeRequestBuilder.php deleted file mode 100644 index 62e20e23..00000000 --- a/src/Models/Builders/UpsertLocationCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Location Custom Attribute Request Builder object. - * - * @param CustomAttribute $customAttribute - */ - public static function init(CustomAttribute $customAttribute): self - { - return new self(new UpsertLocationCustomAttributeRequest($customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Upsert Location Custom Attribute Request object. - */ - public function build(): UpsertLocationCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertLocationCustomAttributeResponseBuilder.php b/src/Models/Builders/UpsertLocationCustomAttributeResponseBuilder.php deleted file mode 100644 index a7c24b8b..00000000 --- a/src/Models/Builders/UpsertLocationCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Location Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertLocationCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Upsert Location Custom Attribute Response object. - */ - public function build(): UpsertLocationCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertMerchantCustomAttributeRequestBuilder.php b/src/Models/Builders/UpsertMerchantCustomAttributeRequestBuilder.php deleted file mode 100644 index 1c4a06fd..00000000 --- a/src/Models/Builders/UpsertMerchantCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Merchant Custom Attribute Request Builder object. - * - * @param CustomAttribute $customAttribute - */ - public static function init(CustomAttribute $customAttribute): self - { - return new self(new UpsertMerchantCustomAttributeRequest($customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Upsert Merchant Custom Attribute Request object. - */ - public function build(): UpsertMerchantCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertMerchantCustomAttributeResponseBuilder.php b/src/Models/Builders/UpsertMerchantCustomAttributeResponseBuilder.php deleted file mode 100644 index e6352afd..00000000 --- a/src/Models/Builders/UpsertMerchantCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Merchant Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertMerchantCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Upsert Merchant Custom Attribute Response object. - */ - public function build(): UpsertMerchantCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertOrderCustomAttributeRequestBuilder.php b/src/Models/Builders/UpsertOrderCustomAttributeRequestBuilder.php deleted file mode 100644 index b170a9eb..00000000 --- a/src/Models/Builders/UpsertOrderCustomAttributeRequestBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Order Custom Attribute Request Builder object. - * - * @param CustomAttribute $customAttribute - */ - public static function init(CustomAttribute $customAttribute): self - { - return new self(new UpsertOrderCustomAttributeRequest($customAttribute)); - } - - /** - * Sets idempotency key field. - * - * @param string|null $value - */ - public function idempotencyKey(?string $value): self - { - $this->instance->setIdempotencyKey($value); - return $this; - } - - /** - * Unsets idempotency key field. - */ - public function unsetIdempotencyKey(): self - { - $this->instance->unsetIdempotencyKey(); - return $this; - } - - /** - * Initializes a new Upsert Order Custom Attribute Request object. - */ - public function build(): UpsertOrderCustomAttributeRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertOrderCustomAttributeResponseBuilder.php b/src/Models/Builders/UpsertOrderCustomAttributeResponseBuilder.php deleted file mode 100644 index ffc77792..00000000 --- a/src/Models/Builders/UpsertOrderCustomAttributeResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Order Custom Attribute Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertOrderCustomAttributeResponse()); - } - - /** - * Sets custom attribute field. - * - * @param CustomAttribute|null $value - */ - public function customAttribute(?CustomAttribute $value): self - { - $this->instance->setCustomAttribute($value); - return $this; - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Upsert Order Custom Attribute Response object. - */ - public function build(): UpsertOrderCustomAttributeResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertSnippetRequestBuilder.php b/src/Models/Builders/UpsertSnippetRequestBuilder.php deleted file mode 100644 index 43b0acaa..00000000 --- a/src/Models/Builders/UpsertSnippetRequestBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Snippet Request Builder object. - * - * @param Snippet $snippet - */ - public static function init(Snippet $snippet): self - { - return new self(new UpsertSnippetRequest($snippet)); - } - - /** - * Initializes a new Upsert Snippet Request object. - */ - public function build(): UpsertSnippetRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/UpsertSnippetResponseBuilder.php b/src/Models/Builders/UpsertSnippetResponseBuilder.php deleted file mode 100644 index 6c3300e6..00000000 --- a/src/Models/Builders/UpsertSnippetResponseBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Upsert Snippet Response Builder object. - */ - public static function init(): self - { - return new self(new UpsertSnippetResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Sets snippet field. - * - * @param Snippet|null $value - */ - public function snippet(?Snippet $value): self - { - $this->instance->setSnippet($value); - return $this; - } - - /** - * Initializes a new Upsert Snippet Response object. - */ - public function build(): UpsertSnippetResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1DeviceBuilder.php b/src/Models/Builders/V1DeviceBuilder.php deleted file mode 100644 index 518594f1..00000000 --- a/src/Models/Builders/V1DeviceBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Device Builder object. - */ - public static function init(): self - { - return new self(new V1Device()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Initializes a new V1 Device object. - */ - public function build(): V1Device - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1ListOrdersRequestBuilder.php b/src/Models/Builders/V1ListOrdersRequestBuilder.php deleted file mode 100644 index fddcd0a8..00000000 --- a/src/Models/Builders/V1ListOrdersRequestBuilder.php +++ /dev/null @@ -1,93 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 List Orders Request Builder object. - */ - public static function init(): self - { - return new self(new V1ListOrdersRequest()); - } - - /** - * Sets order field. - * - * @param string|null $value - */ - public function order(?string $value): self - { - $this->instance->setOrder($value); - return $this; - } - - /** - * Sets limit field. - * - * @param int|null $value - */ - public function limit(?int $value): self - { - $this->instance->setLimit($value); - return $this; - } - - /** - * Unsets limit field. - */ - public function unsetLimit(): self - { - $this->instance->unsetLimit(); - return $this; - } - - /** - * Sets batch token field. - * - * @param string|null $value - */ - public function batchToken(?string $value): self - { - $this->instance->setBatchToken($value); - return $this; - } - - /** - * Unsets batch token field. - */ - public function unsetBatchToken(): self - { - $this->instance->unsetBatchToken(); - return $this; - } - - /** - * Initializes a new V1 List Orders Request object. - */ - public function build(): V1ListOrdersRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1ListOrdersResponseBuilder.php b/src/Models/Builders/V1ListOrdersResponseBuilder.php deleted file mode 100644 index 022f7984..00000000 --- a/src/Models/Builders/V1ListOrdersResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 List Orders Response Builder object. - */ - public static function init(): self - { - return new self(new V1ListOrdersResponse()); - } - - /** - * Sets items field. - * - * @param V1Order[]|null $value - */ - public function items(?array $value): self - { - $this->instance->setItems($value); - return $this; - } - - /** - * Initializes a new V1 List Orders Response object. - */ - public function build(): V1ListOrdersResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1MoneyBuilder.php b/src/Models/Builders/V1MoneyBuilder.php deleted file mode 100644 index c226dbf4..00000000 --- a/src/Models/Builders/V1MoneyBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Money Builder object. - */ - public static function init(): self - { - return new self(new V1Money()); - } - - /** - * Sets amount field. - * - * @param int|null $value - */ - public function amount(?int $value): self - { - $this->instance->setAmount($value); - return $this; - } - - /** - * Unsets amount field. - */ - public function unsetAmount(): self - { - $this->instance->unsetAmount(); - return $this; - } - - /** - * Sets currency code field. - * - * @param string|null $value - */ - public function currencyCode(?string $value): self - { - $this->instance->setCurrencyCode($value); - return $this; - } - - /** - * Initializes a new V1 Money object. - */ - public function build(): V1Money - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1OrderBuilder.php b/src/Models/Builders/V1OrderBuilder.php deleted file mode 100644 index 0610d1dd..00000000 --- a/src/Models/Builders/V1OrderBuilder.php +++ /dev/null @@ -1,448 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Order Builder object. - */ - public static function init(): self - { - return new self(new V1Order()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Unsets errors field. - */ - public function unsetErrors(): self - { - $this->instance->unsetErrors(); - return $this; - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets buyer email field. - * - * @param string|null $value - */ - public function buyerEmail(?string $value): self - { - $this->instance->setBuyerEmail($value); - return $this; - } - - /** - * Unsets buyer email field. - */ - public function unsetBuyerEmail(): self - { - $this->instance->unsetBuyerEmail(); - return $this; - } - - /** - * Sets recipient name field. - * - * @param string|null $value - */ - public function recipientName(?string $value): self - { - $this->instance->setRecipientName($value); - return $this; - } - - /** - * Unsets recipient name field. - */ - public function unsetRecipientName(): self - { - $this->instance->unsetRecipientName(); - return $this; - } - - /** - * Sets recipient phone number field. - * - * @param string|null $value - */ - public function recipientPhoneNumber(?string $value): self - { - $this->instance->setRecipientPhoneNumber($value); - return $this; - } - - /** - * Unsets recipient phone number field. - */ - public function unsetRecipientPhoneNumber(): self - { - $this->instance->unsetRecipientPhoneNumber(); - return $this; - } - - /** - * Sets state field. - * - * @param string|null $value - */ - public function state(?string $value): self - { - $this->instance->setState($value); - return $this; - } - - /** - * Sets shipping address field. - * - * @param Address|null $value - */ - public function shippingAddress(?Address $value): self - { - $this->instance->setShippingAddress($value); - return $this; - } - - /** - * Sets subtotal money field. - * - * @param V1Money|null $value - */ - public function subtotalMoney(?V1Money $value): self - { - $this->instance->setSubtotalMoney($value); - return $this; - } - - /** - * Sets total shipping money field. - * - * @param V1Money|null $value - */ - public function totalShippingMoney(?V1Money $value): self - { - $this->instance->setTotalShippingMoney($value); - return $this; - } - - /** - * Sets total tax money field. - * - * @param V1Money|null $value - */ - public function totalTaxMoney(?V1Money $value): self - { - $this->instance->setTotalTaxMoney($value); - return $this; - } - - /** - * Sets total price money field. - * - * @param V1Money|null $value - */ - public function totalPriceMoney(?V1Money $value): self - { - $this->instance->setTotalPriceMoney($value); - return $this; - } - - /** - * Sets total discount money field. - * - * @param V1Money|null $value - */ - public function totalDiscountMoney(?V1Money $value): self - { - $this->instance->setTotalDiscountMoney($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets expires at field. - * - * @param string|null $value - */ - public function expiresAt(?string $value): self - { - $this->instance->setExpiresAt($value); - return $this; - } - - /** - * Unsets expires at field. - */ - public function unsetExpiresAt(): self - { - $this->instance->unsetExpiresAt(); - return $this; - } - - /** - * Sets payment id field. - * - * @param string|null $value - */ - public function paymentId(?string $value): self - { - $this->instance->setPaymentId($value); - return $this; - } - - /** - * Unsets payment id field. - */ - public function unsetPaymentId(): self - { - $this->instance->unsetPaymentId(); - return $this; - } - - /** - * Sets buyer note field. - * - * @param string|null $value - */ - public function buyerNote(?string $value): self - { - $this->instance->setBuyerNote($value); - return $this; - } - - /** - * Unsets buyer note field. - */ - public function unsetBuyerNote(): self - { - $this->instance->unsetBuyerNote(); - return $this; - } - - /** - * Sets completed note field. - * - * @param string|null $value - */ - public function completedNote(?string $value): self - { - $this->instance->setCompletedNote($value); - return $this; - } - - /** - * Unsets completed note field. - */ - public function unsetCompletedNote(): self - { - $this->instance->unsetCompletedNote(); - return $this; - } - - /** - * Sets refunded note field. - * - * @param string|null $value - */ - public function refundedNote(?string $value): self - { - $this->instance->setRefundedNote($value); - return $this; - } - - /** - * Unsets refunded note field. - */ - public function unsetRefundedNote(): self - { - $this->instance->unsetRefundedNote(); - return $this; - } - - /** - * Sets canceled note field. - * - * @param string|null $value - */ - public function canceledNote(?string $value): self - { - $this->instance->setCanceledNote($value); - return $this; - } - - /** - * Unsets canceled note field. - */ - public function unsetCanceledNote(): self - { - $this->instance->unsetCanceledNote(); - return $this; - } - - /** - * Sets tender field. - * - * @param V1Tender|null $value - */ - public function tender(?V1Tender $value): self - { - $this->instance->setTender($value); - return $this; - } - - /** - * Sets order history field. - * - * @param V1OrderHistoryEntry[]|null $value - */ - public function orderHistory(?array $value): self - { - $this->instance->setOrderHistory($value); - return $this; - } - - /** - * Unsets order history field. - */ - public function unsetOrderHistory(): self - { - $this->instance->unsetOrderHistory(); - return $this; - } - - /** - * Sets promo code field. - * - * @param string|null $value - */ - public function promoCode(?string $value): self - { - $this->instance->setPromoCode($value); - return $this; - } - - /** - * Unsets promo code field. - */ - public function unsetPromoCode(): self - { - $this->instance->unsetPromoCode(); - return $this; - } - - /** - * Sets btc receive address field. - * - * @param string|null $value - */ - public function btcReceiveAddress(?string $value): self - { - $this->instance->setBtcReceiveAddress($value); - return $this; - } - - /** - * Unsets btc receive address field. - */ - public function unsetBtcReceiveAddress(): self - { - $this->instance->unsetBtcReceiveAddress(); - return $this; - } - - /** - * Sets btc price satoshi field. - * - * @param float|null $value - */ - public function btcPriceSatoshi(?float $value): self - { - $this->instance->setBtcPriceSatoshi($value); - return $this; - } - - /** - * Unsets btc price satoshi field. - */ - public function unsetBtcPriceSatoshi(): self - { - $this->instance->unsetBtcPriceSatoshi(); - return $this; - } - - /** - * Initializes a new V1 Order object. - */ - public function build(): V1Order - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1OrderHistoryEntryBuilder.php b/src/Models/Builders/V1OrderHistoryEntryBuilder.php deleted file mode 100644 index c8f65ce2..00000000 --- a/src/Models/Builders/V1OrderHistoryEntryBuilder.php +++ /dev/null @@ -1,64 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Order History Entry Builder object. - */ - public static function init(): self - { - return new self(new V1OrderHistoryEntry()); - } - - /** - * Sets action field. - * - * @param string|null $value - */ - public function action(?string $value): self - { - $this->instance->setAction($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Initializes a new V1 Order History Entry object. - */ - public function build(): V1OrderHistoryEntry - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1PhoneNumberBuilder.php b/src/Models/Builders/V1PhoneNumberBuilder.php deleted file mode 100644 index 70c15a0c..00000000 --- a/src/Models/Builders/V1PhoneNumberBuilder.php +++ /dev/null @@ -1,45 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Phone Number Builder object. - * - * @param string $callingCode - * @param string $number - */ - public static function init(string $callingCode, string $number): self - { - return new self(new V1PhoneNumber($callingCode, $number)); - } - - /** - * Initializes a new V1 Phone Number object. - */ - public function build(): V1PhoneNumber - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1TenderBuilder.php b/src/Models/Builders/V1TenderBuilder.php deleted file mode 100644 index bbb0c0d2..00000000 --- a/src/Models/Builders/V1TenderBuilder.php +++ /dev/null @@ -1,291 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Tender Builder object. - */ - public static function init(): self - { - return new self(new V1Tender()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets type field. - * - * @param string|null $value - */ - public function type(?string $value): self - { - $this->instance->setType($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets employee id field. - * - * @param string|null $value - */ - public function employeeId(?string $value): self - { - $this->instance->setEmployeeId($value); - return $this; - } - - /** - * Unsets employee id field. - */ - public function unsetEmployeeId(): self - { - $this->instance->unsetEmployeeId(); - return $this; - } - - /** - * Sets receipt url field. - * - * @param string|null $value - */ - public function receiptUrl(?string $value): self - { - $this->instance->setReceiptUrl($value); - return $this; - } - - /** - * Unsets receipt url field. - */ - public function unsetReceiptUrl(): self - { - $this->instance->unsetReceiptUrl(); - return $this; - } - - /** - * Sets card brand field. - * - * @param string|null $value - */ - public function cardBrand(?string $value): self - { - $this->instance->setCardBrand($value); - return $this; - } - - /** - * Sets pan suffix field. - * - * @param string|null $value - */ - public function panSuffix(?string $value): self - { - $this->instance->setPanSuffix($value); - return $this; - } - - /** - * Unsets pan suffix field. - */ - public function unsetPanSuffix(): self - { - $this->instance->unsetPanSuffix(); - return $this; - } - - /** - * Sets entry method field. - * - * @param string|null $value - */ - public function entryMethod(?string $value): self - { - $this->instance->setEntryMethod($value); - return $this; - } - - /** - * Sets payment note field. - * - * @param string|null $value - */ - public function paymentNote(?string $value): self - { - $this->instance->setPaymentNote($value); - return $this; - } - - /** - * Unsets payment note field. - */ - public function unsetPaymentNote(): self - { - $this->instance->unsetPaymentNote(); - return $this; - } - - /** - * Sets total money field. - * - * @param V1Money|null $value - */ - public function totalMoney(?V1Money $value): self - { - $this->instance->setTotalMoney($value); - return $this; - } - - /** - * Sets tendered money field. - * - * @param V1Money|null $value - */ - public function tenderedMoney(?V1Money $value): self - { - $this->instance->setTenderedMoney($value); - return $this; - } - - /** - * Sets tendered at field. - * - * @param string|null $value - */ - public function tenderedAt(?string $value): self - { - $this->instance->setTenderedAt($value); - return $this; - } - - /** - * Unsets tendered at field. - */ - public function unsetTenderedAt(): self - { - $this->instance->unsetTenderedAt(); - return $this; - } - - /** - * Sets settled at field. - * - * @param string|null $value - */ - public function settledAt(?string $value): self - { - $this->instance->setSettledAt($value); - return $this; - } - - /** - * Unsets settled at field. - */ - public function unsetSettledAt(): self - { - $this->instance->unsetSettledAt(); - return $this; - } - - /** - * Sets change back money field. - * - * @param V1Money|null $value - */ - public function changeBackMoney(?V1Money $value): self - { - $this->instance->setChangeBackMoney($value); - return $this; - } - - /** - * Sets refunded money field. - * - * @param V1Money|null $value - */ - public function refundedMoney(?V1Money $value): self - { - $this->instance->setRefundedMoney($value); - return $this; - } - - /** - * Sets is exchange field. - * - * @param bool|null $value - */ - public function isExchange(?bool $value): self - { - $this->instance->setIsExchange($value); - return $this; - } - - /** - * Unsets is exchange field. - */ - public function unsetIsExchange(): self - { - $this->instance->unsetIsExchange(); - return $this; - } - - /** - * Initializes a new V1 Tender object. - */ - public function build(): V1Tender - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/V1UpdateOrderRequestBuilder.php b/src/Models/Builders/V1UpdateOrderRequestBuilder.php deleted file mode 100644 index 7b6cb3f2..00000000 --- a/src/Models/Builders/V1UpdateOrderRequestBuilder.php +++ /dev/null @@ -1,124 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new V1 Update Order Request Builder object. - * - * @param string $action - */ - public static function init(string $action): self - { - return new self(new V1UpdateOrderRequest($action)); - } - - /** - * Sets shipped tracking number field. - * - * @param string|null $value - */ - public function shippedTrackingNumber(?string $value): self - { - $this->instance->setShippedTrackingNumber($value); - return $this; - } - - /** - * Unsets shipped tracking number field. - */ - public function unsetShippedTrackingNumber(): self - { - $this->instance->unsetShippedTrackingNumber(); - return $this; - } - - /** - * Sets completed note field. - * - * @param string|null $value - */ - public function completedNote(?string $value): self - { - $this->instance->setCompletedNote($value); - return $this; - } - - /** - * Unsets completed note field. - */ - public function unsetCompletedNote(): self - { - $this->instance->unsetCompletedNote(); - return $this; - } - - /** - * Sets refunded note field. - * - * @param string|null $value - */ - public function refundedNote(?string $value): self - { - $this->instance->setRefundedNote($value); - return $this; - } - - /** - * Unsets refunded note field. - */ - public function unsetRefundedNote(): self - { - $this->instance->unsetRefundedNote(); - return $this; - } - - /** - * Sets canceled note field. - * - * @param string|null $value - */ - public function canceledNote(?string $value): self - { - $this->instance->setCanceledNote($value); - return $this; - } - - /** - * Unsets canceled note field. - */ - public function unsetCanceledNote(): self - { - $this->instance->unsetCanceledNote(); - return $this; - } - - /** - * Initializes a new V1 Update Order Request object. - */ - public function build(): V1UpdateOrderRequest - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/VendorBuilder.php b/src/Models/Builders/VendorBuilder.php deleted file mode 100644 index 61b352d9..00000000 --- a/src/Models/Builders/VendorBuilder.php +++ /dev/null @@ -1,190 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Vendor Builder object. - */ - public static function init(): self - { - return new self(new Vendor()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets address field. - * - * @param Address|null $value - */ - public function address(?Address $value): self - { - $this->instance->setAddress($value); - return $this; - } - - /** - * Sets contacts field. - * - * @param VendorContact[]|null $value - */ - public function contacts(?array $value): self - { - $this->instance->setContacts($value); - return $this; - } - - /** - * Unsets contacts field. - */ - public function unsetContacts(): self - { - $this->instance->unsetContacts(); - return $this; - } - - /** - * Sets account number field. - * - * @param string|null $value - */ - public function accountNumber(?string $value): self - { - $this->instance->setAccountNumber($value); - return $this; - } - - /** - * Unsets account number field. - */ - public function unsetAccountNumber(): self - { - $this->instance->unsetAccountNumber(); - return $this; - } - - /** - * Sets note field. - * - * @param string|null $value - */ - public function note(?string $value): self - { - $this->instance->setNote($value); - return $this; - } - - /** - * Unsets note field. - */ - public function unsetNote(): self - { - $this->instance->unsetNote(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets status field. - * - * @param string|null $value - */ - public function status(?string $value): self - { - $this->instance->setStatus($value); - return $this; - } - - /** - * Initializes a new Vendor object. - */ - public function build(): Vendor - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/VendorContactBuilder.php b/src/Models/Builders/VendorContactBuilder.php deleted file mode 100644 index 526c5088..00000000 --- a/src/Models/Builders/VendorContactBuilder.php +++ /dev/null @@ -1,135 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Vendor Contact Builder object. - * - * @param int $ordinal - */ - public static function init(int $ordinal): self - { - return new self(new VendorContact($ordinal)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets email address field. - * - * @param string|null $value - */ - public function emailAddress(?string $value): self - { - $this->instance->setEmailAddress($value); - return $this; - } - - /** - * Unsets email address field. - */ - public function unsetEmailAddress(): self - { - $this->instance->unsetEmailAddress(); - return $this; - } - - /** - * Sets phone number field. - * - * @param string|null $value - */ - public function phoneNumber(?string $value): self - { - $this->instance->setPhoneNumber($value); - return $this; - } - - /** - * Unsets phone number field. - */ - public function unsetPhoneNumber(): self - { - $this->instance->unsetPhoneNumber(); - return $this; - } - - /** - * Sets removed field. - * - * @param bool|null $value - */ - public function removed(?bool $value): self - { - $this->instance->setRemoved($value); - return $this; - } - - /** - * Unsets removed field. - */ - public function unsetRemoved(): self - { - $this->instance->unsetRemoved(); - return $this; - } - - /** - * Initializes a new Vendor Contact object. - */ - public function build(): VendorContact - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/VoidTransactionResponseBuilder.php b/src/Models/Builders/VoidTransactionResponseBuilder.php deleted file mode 100644 index 46619224..00000000 --- a/src/Models/Builders/VoidTransactionResponseBuilder.php +++ /dev/null @@ -1,54 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Void Transaction Response Builder object. - */ - public static function init(): self - { - return new self(new VoidTransactionResponse()); - } - - /** - * Sets errors field. - * - * @param Error[]|null $value - */ - public function errors(?array $value): self - { - $this->instance->setErrors($value); - return $this; - } - - /** - * Initializes a new Void Transaction Response object. - */ - public function build(): VoidTransactionResponse - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/WageSettingBuilder.php b/src/Models/Builders/WageSettingBuilder.php deleted file mode 100644 index 97cea9eb..00000000 --- a/src/Models/Builders/WageSettingBuilder.php +++ /dev/null @@ -1,136 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Wage Setting Builder object. - */ - public static function init(): self - { - return new self(new WageSetting()); - } - - /** - * Sets team member id field. - * - * @param string|null $value - */ - public function teamMemberId(?string $value): self - { - $this->instance->setTeamMemberId($value); - return $this; - } - - /** - * Unsets team member id field. - */ - public function unsetTeamMemberId(): self - { - $this->instance->unsetTeamMemberId(); - return $this; - } - - /** - * Sets job assignments field. - * - * @param JobAssignment[]|null $value - */ - public function jobAssignments(?array $value): self - { - $this->instance->setJobAssignments($value); - return $this; - } - - /** - * Unsets job assignments field. - */ - public function unsetJobAssignments(): self - { - $this->instance->unsetJobAssignments(); - return $this; - } - - /** - * Sets is overtime exempt field. - * - * @param bool|null $value - */ - public function isOvertimeExempt(?bool $value): self - { - $this->instance->setIsOvertimeExempt($value); - return $this; - } - - /** - * Unsets is overtime exempt field. - */ - public function unsetIsOvertimeExempt(): self - { - $this->instance->unsetIsOvertimeExempt(); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Wage Setting object. - */ - public function build(): WageSetting - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/WebhookSubscriptionBuilder.php b/src/Models/Builders/WebhookSubscriptionBuilder.php deleted file mode 100644 index 8148b27e..00000000 --- a/src/Models/Builders/WebhookSubscriptionBuilder.php +++ /dev/null @@ -1,186 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Webhook Subscription Builder object. - */ - public static function init(): self - { - return new self(new WebhookSubscription()); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets name field. - * - * @param string|null $value - */ - public function name(?string $value): self - { - $this->instance->setName($value); - return $this; - } - - /** - * Unsets name field. - */ - public function unsetName(): self - { - $this->instance->unsetName(); - return $this; - } - - /** - * Sets enabled field. - * - * @param bool|null $value - */ - public function enabled(?bool $value): self - { - $this->instance->setEnabled($value); - return $this; - } - - /** - * Unsets enabled field. - */ - public function unsetEnabled(): self - { - $this->instance->unsetEnabled(); - return $this; - } - - /** - * Sets event types field. - * - * @param string[]|null $value - */ - public function eventTypes(?array $value): self - { - $this->instance->setEventTypes($value); - return $this; - } - - /** - * Unsets event types field. - */ - public function unsetEventTypes(): self - { - $this->instance->unsetEventTypes(); - return $this; - } - - /** - * Sets notification url field. - * - * @param string|null $value - */ - public function notificationUrl(?string $value): self - { - $this->instance->setNotificationUrl($value); - return $this; - } - - /** - * Unsets notification url field. - */ - public function unsetNotificationUrl(): self - { - $this->instance->unsetNotificationUrl(); - return $this; - } - - /** - * Sets api version field. - * - * @param string|null $value - */ - public function apiVersion(?string $value): self - { - $this->instance->setApiVersion($value); - return $this; - } - - /** - * Unsets api version field. - */ - public function unsetApiVersion(): self - { - $this->instance->unsetApiVersion(); - return $this; - } - - /** - * Sets signature key field. - * - * @param string|null $value - */ - public function signatureKey(?string $value): self - { - $this->instance->setSignatureKey($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Webhook Subscription object. - */ - public function build(): WebhookSubscription - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/Builders/WorkweekConfigBuilder.php b/src/Models/Builders/WorkweekConfigBuilder.php deleted file mode 100644 index 1a1c785a..00000000 --- a/src/Models/Builders/WorkweekConfigBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ -instance = $instance; - } - - /** - * Initializes a new Workweek Config Builder object. - * - * @param string $startOfWeek - * @param string $startOfDayLocalTime - */ - public static function init(string $startOfWeek, string $startOfDayLocalTime): self - { - return new self(new WorkweekConfig($startOfWeek, $startOfDayLocalTime)); - } - - /** - * Sets id field. - * - * @param string|null $value - */ - public function id(?string $value): self - { - $this->instance->setId($value); - return $this; - } - - /** - * Sets version field. - * - * @param int|null $value - */ - public function version(?int $value): self - { - $this->instance->setVersion($value); - return $this; - } - - /** - * Sets created at field. - * - * @param string|null $value - */ - public function createdAt(?string $value): self - { - $this->instance->setCreatedAt($value); - return $this; - } - - /** - * Sets updated at field. - * - * @param string|null $value - */ - public function updatedAt(?string $value): self - { - $this->instance->setUpdatedAt($value); - return $this; - } - - /** - * Initializes a new Workweek Config object. - */ - public function build(): WorkweekConfig - { - return CoreHelper::clone($this->instance); - } -} diff --git a/src/Models/BulkCreateCustomerData.php b/src/Models/BulkCreateCustomerData.php deleted file mode 100644 index fe2a2733..00000000 --- a/src/Models/BulkCreateCustomerData.php +++ /dev/null @@ -1,480 +0,0 @@ -givenName) == 0) { - return null; - } - return $this->givenName['value']; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName['value'] = $givenName; - } - - /** - * Unsets Given Name. - * The given name (that is, the first name) associated with the customer profile. - */ - public function unsetGivenName(): void - { - $this->givenName = []; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function getFamilyName(): ?string - { - if (count($this->familyName) == 0) { - return null; - } - return $this->familyName['value']; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName['value'] = $familyName; - } - - /** - * Unsets Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function unsetFamilyName(): void - { - $this->familyName = []; - } - - /** - * Returns Company Name. - * A business name associated with the customer profile. - */ - public function getCompanyName(): ?string - { - if (count($this->companyName) == 0) { - return null; - } - return $this->companyName['value']; - } - - /** - * Sets Company Name. - * A business name associated with the customer profile. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName['value'] = $companyName; - } - - /** - * Unsets Company Name. - * A business name associated with the customer profile. - */ - public function unsetCompanyName(): void - { - $this->companyName = []; - } - - /** - * Returns Nickname. - * A nickname for the customer profile. - */ - public function getNickname(): ?string - { - if (count($this->nickname) == 0) { - return null; - } - return $this->nickname['value']; - } - - /** - * Sets Nickname. - * A nickname for the customer profile. - * - * @maps nickname - */ - public function setNickname(?string $nickname): void - { - $this->nickname['value'] = $nickname; - } - - /** - * Unsets Nickname. - * A nickname for the customer profile. - */ - public function unsetNickname(): void - { - $this->nickname = []; - } - - /** - * Returns Email Address. - * The email address associated with the customer profile. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address associated with the customer profile. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address associated with the customer profile. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * A custom note associated with the customer profile. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A custom note associated with the customer profile. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A custom note associated with the customer profile. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - */ - public function getBirthday(): ?string - { - if (count($this->birthday) == 0) { - return null; - } - return $this->birthday['value']; - } - - /** - * Sets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - * - * @maps birthday - */ - public function setBirthday(?string $birthday): void - { - $this->birthday['value'] = $birthday; - } - - /** - * Unsets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - */ - public function unsetBirthday(): void - { - $this->birthday = []; - } - - /** - * Returns Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - */ - public function getTaxIds(): ?CustomerTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?CustomerTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->givenName)) { - $json['given_name'] = $this->givenName['value']; - } - if (!empty($this->familyName)) { - $json['family_name'] = $this->familyName['value']; - } - if (!empty($this->companyName)) { - $json['company_name'] = $this->companyName['value']; - } - if (!empty($this->nickname)) { - $json['nickname'] = $this->nickname['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->birthday)) { - $json['birthday'] = $this->birthday['value']; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateCustomersRequest.php b/src/Models/BulkCreateCustomersRequest.php deleted file mode 100644 index 45958661..00000000 --- a/src/Models/BulkCreateCustomersRequest.php +++ /dev/null @@ -1,86 +0,0 @@ - - */ - private $customers; - - /** - * @param array $customers - */ - public function __construct(array $customers) - { - $this->customers = $customers; - } - - /** - * Returns Customers. - * A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }` - * key-value pairs. - * - * Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) - * that uniquely identifies the create request. Each value contains the customer data used to create - * the - * customer profile. - * - * @return array - */ - public function getCustomers(): array - { - return $this->customers; - } - - /** - * Sets Customers. - * A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }` - * key-value pairs. - * - * Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) - * that uniquely identifies the create request. Each value contains the customer data used to create - * the - * customer profile. - * - * @required - * @maps customers - * - * @param array $customers - */ - public function setCustomers(array $customers): void - { - $this->customers = $customers; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customers'] = $this->customers; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateCustomersResponse.php b/src/Models/BulkCreateCustomersResponse.php deleted file mode 100644 index 5a52eda1..00000000 --- a/src/Models/BulkCreateCustomersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -|null - */ - private $responses; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Responses. - * A map of responses that correspond to individual create requests, represented by - * key-value pairs. - * - * Each key is the idempotency key that was provided for a create request and each value - * is the corresponding response. - * If the request succeeds, the value is the new customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A map of responses that correspond to individual create requests, represented by - * key-value pairs. - * - * Each key is the idempotency key that was provided for a create request and each value - * is the corresponding response. - * If the request succeeds, the value is the new customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Returns Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateTeamMembersRequest.php b/src/Models/BulkCreateTeamMembersRequest.php deleted file mode 100644 index ec000327..00000000 --- a/src/Models/BulkCreateTeamMembersRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - - */ - private $teamMembers; - - /** - * @param array $teamMembers - */ - public function __construct(array $teamMembers) - { - $this->teamMembers = $teamMembers; - } - - /** - * Returns Team Members. - * The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the - * `CreateTeamMemberRequest`. - * The maximum number of create objects is 25. - * - * If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To - * get job IDs, - * call [ListJobs](api-endpoint:Team-ListJobs). - * - * @return array - */ - public function getTeamMembers(): array - { - return $this->teamMembers; - } - - /** - * Sets Team Members. - * The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the - * `CreateTeamMemberRequest`. - * The maximum number of create objects is 25. - * - * If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To - * get job IDs, - * call [ListJobs](api-endpoint:Team-ListJobs). - * - * @required - * @maps team_members - * - * @param array $teamMembers - */ - public function setTeamMembers(array $teamMembers): void - { - $this->teamMembers = $teamMembers; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['team_members'] = $this->teamMembers; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateTeamMembersResponse.php b/src/Models/BulkCreateTeamMembersResponse.php deleted file mode 100644 index 656521b0..00000000 --- a/src/Models/BulkCreateTeamMembersResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -|null - */ - private $teamMembers; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Team Members. - * The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the - * `CreateTeamMemberRequest`. - * - * @return array|null - */ - public function getTeamMembers(): ?array - { - return $this->teamMembers; - } - - /** - * Sets Team Members. - * The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the - * `CreateTeamMemberRequest`. - * - * @maps team_members - * - * @param array|null $teamMembers - */ - public function setTeamMembers(?array $teamMembers): void - { - $this->teamMembers = $teamMembers; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMembers)) { - $json['team_members'] = $this->teamMembers; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateVendorsRequest.php b/src/Models/BulkCreateVendorsRequest.php deleted file mode 100644 index 04062e05..00000000 --- a/src/Models/BulkCreateVendorsRequest.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ - private $vendors; - - /** - * @param array $vendors - */ - public function __construct(array $vendors) - { - $this->vendors = $vendors; - } - - /** - * Returns Vendors. - * Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency- - * key/`Vendor`-object pairs. - * - * @return array - */ - public function getVendors(): array - { - return $this->vendors; - } - - /** - * Sets Vendors. - * Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency- - * key/`Vendor`-object pairs. - * - * @required - * @maps vendors - * - * @param array $vendors - */ - public function setVendors(array $vendors): void - { - $this->vendors = $vendors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['vendors'] = $this->vendors; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkCreateVendorsResponse.php b/src/Models/BulkCreateVendorsResponse.php deleted file mode 100644 index 7e30ec38..00000000 --- a/src/Models/BulkCreateVendorsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -|null - */ - private $responses; - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Responses. - * A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully - * created [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by - * a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The - * idempotency keys correspond to those specified - * in the input. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully - * created [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by - * a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The - * idempotency keys correspond to those specified - * in the input. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteBookingCustomAttributesRequest.php b/src/Models/BulkDeleteBookingCustomAttributesRequest.php deleted file mode 100644 index c444eee8..00000000 --- a/src/Models/BulkDeleteBookingCustomAttributesRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map containing 1 to 25 individual Delete requests. For each request, provide an - * arbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the - * information needed to delete a custom attribute. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map containing 1 to 25 individual Delete requests. For each request, provide an - * arbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the - * information needed to delete a custom attribute. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteBookingCustomAttributesResponse.php b/src/Models/BulkDeleteBookingCustomAttributesResponse.php deleted file mode 100644 index 1f36cb41..00000000 --- a/src/Models/BulkDeleteBookingCustomAttributesResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -|null - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same ID as the corresponding request and contains `booking_id` and `errors` field. - * - * @return array|null - */ - public function getValues(): ?array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same ID as the corresponding request and contains `booking_id` and `errors` field. - * - * @maps values - * - * @param array|null $values - */ - public function setValues(?array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->values)) { - $json['values'] = $this->values; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteCustomersRequest.php b/src/Models/BulkDeleteCustomersRequest.php deleted file mode 100644 index ba20c431..00000000 --- a/src/Models/BulkDeleteCustomersRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -customerIds = $customerIds; - } - - /** - * Returns Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to delete. - * - * @return string[] - */ - public function getCustomerIds(): array - { - return $this->customerIds; - } - - /** - * Sets Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to delete. - * - * @required - * @maps customer_ids - * - * @param string[] $customerIds - */ - public function setCustomerIds(array $customerIds): void - { - $this->customerIds = $customerIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_ids'] = $this->customerIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteCustomersResponse.php b/src/Models/BulkDeleteCustomersResponse.php deleted file mode 100644 index 55999a67..00000000 --- a/src/Models/BulkDeleteCustomersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -|null - */ - private $responses; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Responses. - * A map of responses that correspond to individual delete requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for a delete request and each value - * is the corresponding response. - * If the request succeeds, the value is an empty object (`{ }`). - * If the request fails, the value contains any errors that occurred during the request. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A map of responses that correspond to individual delete requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for a delete request and each value - * is the corresponding response. - * If the request succeeds, the value is an empty object (`{ }`). - * If the request fails, the value contains any errors that occurred during the request. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Returns Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteLocationCustomAttributesRequest.php b/src/Models/BulkDeleteLocationCustomAttributesRequest.php deleted file mode 100644 index 440b134f..00000000 --- a/src/Models/BulkDeleteLocationCustomAttributesRequest.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * The data used to update the `CustomAttribute` objects. - * The keys must be unique and are used to map to the corresponding response. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * The data used to update the `CustomAttribute` objects. - * The keys must be unique and are used to map to the corresponding response. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php b/src/Models/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php deleted file mode 100644 index b169178d..00000000 --- a/src/Models/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php +++ /dev/null @@ -1,66 +0,0 @@ -key; - } - - /** - * Sets Key. - * The key of the associated custom attribute definition. - * Represented as a qualified key if the requesting app is not the definition owner. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->key)) { - $json['key'] = $this->key; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteLocationCustomAttributesResponse.php b/src/Models/BulkDeleteLocationCustomAttributesResponse.php deleted file mode 100644 index c2f20006..00000000 --- a/src/Models/BulkDeleteLocationCustomAttributesResponse.php +++ /dev/null @@ -1,108 +0,0 @@ - - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same key as the corresponding request. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same key as the corresponding request. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php b/src/Models/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php deleted file mode 100644 index 7e810ece..00000000 --- a/src/Models/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -locationId; - } - - /** - * Sets Location Id. - * The ID of the location associated with the custom attribute. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Errors. - * Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteMerchantCustomAttributesRequest.php b/src/Models/BulkDeleteMerchantCustomAttributesRequest.php deleted file mode 100644 index 56f3ae10..00000000 --- a/src/Models/BulkDeleteMerchantCustomAttributesRequest.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * The data used to update the `CustomAttribute` objects. - * The keys must be unique and are used to map to the corresponding response. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * The data used to update the `CustomAttribute` objects. - * The keys must be unique and are used to map to the corresponding response. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php b/src/Models/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php deleted file mode 100644 index 15bbfc61..00000000 --- a/src/Models/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php +++ /dev/null @@ -1,66 +0,0 @@ -key; - } - - /** - * Sets Key. - * The key of the associated custom attribute definition. - * Represented as a qualified key if the requesting app is not the definition owner. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->key)) { - $json['key'] = $this->key; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteMerchantCustomAttributesResponse.php b/src/Models/BulkDeleteMerchantCustomAttributesResponse.php deleted file mode 100644 index 7d4836fa..00000000 --- a/src/Models/BulkDeleteMerchantCustomAttributesResponse.php +++ /dev/null @@ -1,108 +0,0 @@ - - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same key as the corresponding request. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual delete requests. Each response has the - * same key as the corresponding request. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php b/src/Models/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php deleted file mode 100644 index 1a3b1f6b..00000000 --- a/src/Models/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteOrderCustomAttributesRequest.php b/src/Models/BulkDeleteOrderCustomAttributesRequest.php deleted file mode 100644 index 16f9d2f0..00000000 --- a/src/Models/BulkDeleteOrderCustomAttributesRequest.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map of requests that correspond to individual delete operations for custom attributes. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of requests that correspond to individual delete operations for custom attributes. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php b/src/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php deleted file mode 100644 index 62df7216..00000000 --- a/src/Models/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php +++ /dev/null @@ -1,97 +0,0 @@ -orderId = $orderId; - } - - /** - * Returns Key. - * The key of the custom attribute to delete. This key must match the key - * of an existing custom attribute definition. - */ - public function getKey(): ?string - { - return $this->key; - } - - /** - * Sets Key. - * The key of the custom attribute to delete. This key must match the key - * of an existing custom attribute definition. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - - /** - * Returns Order Id. - * The ID of the target [order](entity:Order). - */ - public function getOrderId(): string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the target [order](entity:Order). - * - * @required - * @maps order_id - */ - public function setOrderId(string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->key)) { - $json['key'] = $this->key; - } - $json['order_id'] = $this->orderId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkDeleteOrderCustomAttributesResponse.php b/src/Models/BulkDeleteOrderCustomAttributesResponse.php deleted file mode 100644 index c31846c6..00000000 --- a/src/Models/BulkDeleteOrderCustomAttributesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Values. - * A map of responses that correspond to individual delete requests. Each response has the same ID - * as the corresponding request and contains either a `custom_attribute` or an `errors` field. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual delete requests. Each response has the same ID - * as the corresponding request and contains either a `custom_attribute` or an `errors` field. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveBookingsRequest.php b/src/Models/BulkRetrieveBookingsRequest.php deleted file mode 100644 index cc02b4a1..00000000 --- a/src/Models/BulkRetrieveBookingsRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -bookingIds = $bookingIds; - } - - /** - * Returns Booking Ids. - * A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. - * - * @return string[] - */ - public function getBookingIds(): array - { - return $this->bookingIds; - } - - /** - * Sets Booking Ids. - * A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. - * - * @required - * @maps booking_ids - * - * @param string[] $bookingIds - */ - public function setBookingIds(array $bookingIds): void - { - $this->bookingIds = $bookingIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['booking_ids'] = $this->bookingIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveBookingsResponse.php b/src/Models/BulkRetrieveBookingsResponse.php deleted file mode 100644 index 92fd471a..00000000 --- a/src/Models/BulkRetrieveBookingsResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -|null - */ - private $bookings; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Bookings. - * Requested bookings returned as a map containing `booking_id` as the key and - * `RetrieveBookingResponse` as the value. - * - * @return array|null - */ - public function getBookings(): ?array - { - return $this->bookings; - } - - /** - * Sets Bookings. - * Requested bookings returned as a map containing `booking_id` as the key and - * `RetrieveBookingResponse` as the value. - * - * @maps bookings - * - * @param array|null $bookings - */ - public function setBookings(?array $bookings): void - { - $this->bookings = $bookings; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->bookings)) { - $json['bookings'] = $this->bookings; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveCustomersRequest.php b/src/Models/BulkRetrieveCustomersRequest.php deleted file mode 100644 index 4e132165..00000000 --- a/src/Models/BulkRetrieveCustomersRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -customerIds = $customerIds; - } - - /** - * Returns Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to retrieve. - * - * @return string[] - */ - public function getCustomerIds(): array - { - return $this->customerIds; - } - - /** - * Sets Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to retrieve. - * - * @required - * @maps customer_ids - * - * @param string[] $customerIds - */ - public function setCustomerIds(array $customerIds): void - { - $this->customerIds = $customerIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_ids'] = $this->customerIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveCustomersResponse.php b/src/Models/BulkRetrieveCustomersResponse.php deleted file mode 100644 index 14dca84c..00000000 --- a/src/Models/BulkRetrieveCustomersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -|null - */ - private $responses; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Responses. - * A map of responses that correspond to individual retrieve requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for a retrieve request and each value - * is the corresponding response. - * If the request succeeds, the value is the requested customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A map of responses that correspond to individual retrieve requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for a retrieve request and each value - * is the corresponding response. - * If the request succeeds, the value is the requested customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Returns Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveTeamMemberBookingProfilesRequest.php b/src/Models/BulkRetrieveTeamMemberBookingProfilesRequest.php deleted file mode 100644 index b7b61bb2..00000000 --- a/src/Models/BulkRetrieveTeamMemberBookingProfilesRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -teamMemberIds = $teamMemberIds; - } - - /** - * Returns Team Member Ids. - * A non-empty list of IDs of team members whose booking profiles you want to retrieve. - * - * @return string[] - */ - public function getTeamMemberIds(): array - { - return $this->teamMemberIds; - } - - /** - * Sets Team Member Ids. - * A non-empty list of IDs of team members whose booking profiles you want to retrieve. - * - * @required - * @maps team_member_ids - * - * @param string[] $teamMemberIds - */ - public function setTeamMemberIds(array $teamMemberIds): void - { - $this->teamMemberIds = $teamMemberIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['team_member_ids'] = $this->teamMemberIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveTeamMemberBookingProfilesResponse.php b/src/Models/BulkRetrieveTeamMemberBookingProfilesResponse.php deleted file mode 100644 index db3bd050..00000000 --- a/src/Models/BulkRetrieveTeamMemberBookingProfilesResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -|null - */ - private $teamMemberBookingProfiles; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Team Member Booking Profiles. - * The returned team members' booking profiles, as a map with `team_member_id` as the key and - * [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. - * - * @return array|null - */ - public function getTeamMemberBookingProfiles(): ?array - { - return $this->teamMemberBookingProfiles; - } - - /** - * Sets Team Member Booking Profiles. - * The returned team members' booking profiles, as a map with `team_member_id` as the key and - * [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. - * - * @maps team_member_booking_profiles - * - * @param array|null $teamMemberBookingProfiles - */ - public function setTeamMemberBookingProfiles(?array $teamMemberBookingProfiles): void - { - $this->teamMemberBookingProfiles = $teamMemberBookingProfiles; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberBookingProfiles)) { - $json['team_member_booking_profiles'] = $this->teamMemberBookingProfiles; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveVendorsRequest.php b/src/Models/BulkRetrieveVendorsRequest.php deleted file mode 100644 index 87fdeeab..00000000 --- a/src/Models/BulkRetrieveVendorsRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -vendorIds) == 0) { - return null; - } - return $this->vendorIds['value']; - } - - /** - * Sets Vendor Ids. - * IDs of the [Vendor](entity:Vendor) objects to retrieve. - * - * @maps vendor_ids - * - * @param string[]|null $vendorIds - */ - public function setVendorIds(?array $vendorIds): void - { - $this->vendorIds['value'] = $vendorIds; - } - - /** - * Unsets Vendor Ids. - * IDs of the [Vendor](entity:Vendor) objects to retrieve. - */ - public function unsetVendorIds(): void - { - $this->vendorIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->vendorIds)) { - $json['vendor_ids'] = $this->vendorIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkRetrieveVendorsResponse.php b/src/Models/BulkRetrieveVendorsResponse.php deleted file mode 100644 index 94d99a7f..00000000 --- a/src/Models/BulkRetrieveVendorsResponse.php +++ /dev/null @@ -1,102 +0,0 @@ -|null - */ - private $responses; - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Responses. - * The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating - * successfully retrieved [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by - * a collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating - * successfully retrieved [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by - * a collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkSwapPlanRequest.php b/src/Models/BulkSwapPlanRequest.php deleted file mode 100644 index a0af1a88..00000000 --- a/src/Models/BulkSwapPlanRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -newPlanVariationId = $newPlanVariationId; - $this->oldPlanVariationId = $oldPlanVariationId; - $this->locationId = $locationId; - } - - /** - * Returns New Plan Variation Id. - * The ID of the new subscription plan variation. - * - * This field is required. - */ - public function getNewPlanVariationId(): string - { - return $this->newPlanVariationId; - } - - /** - * Sets New Plan Variation Id. - * The ID of the new subscription plan variation. - * - * This field is required. - * - * @required - * @maps new_plan_variation_id - */ - public function setNewPlanVariationId(string $newPlanVariationId): void - { - $this->newPlanVariationId = $newPlanVariationId; - } - - /** - * Returns Old Plan Variation Id. - * The ID of the plan variation whose subscriptions should be swapped. Active subscriptions - * using this plan variation will be subscribed to the new plan variation on their next billing - * day. - */ - public function getOldPlanVariationId(): string - { - return $this->oldPlanVariationId; - } - - /** - * Sets Old Plan Variation Id. - * The ID of the plan variation whose subscriptions should be swapped. Active subscriptions - * using this plan variation will be subscribed to the new plan variation on their next billing - * day. - * - * @required - * @maps old_plan_variation_id - */ - public function setOldPlanVariationId(string $oldPlanVariationId): void - { - $this->oldPlanVariationId = $oldPlanVariationId; - } - - /** - * Returns Location Id. - * The ID of the location to associate with the swapped subscriptions. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location to associate with the swapped subscriptions. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['new_plan_variation_id'] = $this->newPlanVariationId; - $json['old_plan_variation_id'] = $this->oldPlanVariationId; - $json['location_id'] = $this->locationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkSwapPlanResponse.php b/src/Models/BulkSwapPlanResponse.php deleted file mode 100644 index 048861b9..00000000 --- a/src/Models/BulkSwapPlanResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Affected Subscriptions. - * The number of affected subscriptions. - */ - public function getAffectedSubscriptions(): ?int - { - return $this->affectedSubscriptions; - } - - /** - * Sets Affected Subscriptions. - * The number of affected subscriptions. - * - * @maps affected_subscriptions - */ - public function setAffectedSubscriptions(?int $affectedSubscriptions): void - { - $this->affectedSubscriptions = $affectedSubscriptions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->affectedSubscriptions)) { - $json['affected_subscriptions'] = $this->affectedSubscriptions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateCustomerData.php b/src/Models/BulkUpdateCustomerData.php deleted file mode 100644 index d035ed29..00000000 --- a/src/Models/BulkUpdateCustomerData.php +++ /dev/null @@ -1,518 +0,0 @@ -givenName) == 0) { - return null; - } - return $this->givenName['value']; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName['value'] = $givenName; - } - - /** - * Unsets Given Name. - * The given name (that is, the first name) associated with the customer profile. - */ - public function unsetGivenName(): void - { - $this->givenName = []; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function getFamilyName(): ?string - { - if (count($this->familyName) == 0) { - return null; - } - return $this->familyName['value']; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName['value'] = $familyName; - } - - /** - * Unsets Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function unsetFamilyName(): void - { - $this->familyName = []; - } - - /** - * Returns Company Name. - * A business name associated with the customer profile. - */ - public function getCompanyName(): ?string - { - if (count($this->companyName) == 0) { - return null; - } - return $this->companyName['value']; - } - - /** - * Sets Company Name. - * A business name associated with the customer profile. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName['value'] = $companyName; - } - - /** - * Unsets Company Name. - * A business name associated with the customer profile. - */ - public function unsetCompanyName(): void - { - $this->companyName = []; - } - - /** - * Returns Nickname. - * A nickname for the customer profile. - */ - public function getNickname(): ?string - { - if (count($this->nickname) == 0) { - return null; - } - return $this->nickname['value']; - } - - /** - * Sets Nickname. - * A nickname for the customer profile. - * - * @maps nickname - */ - public function setNickname(?string $nickname): void - { - $this->nickname['value'] = $nickname; - } - - /** - * Unsets Nickname. - * A nickname for the customer profile. - */ - public function unsetNickname(): void - { - $this->nickname = []; - } - - /** - * Returns Email Address. - * The email address associated with the customer profile. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address associated with the customer profile. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address associated with the customer profile. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid - * and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, - * see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * An custom note associates with the customer profile. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * An custom note associates with the customer profile. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * An custom note associates with the customer profile. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - */ - public function getBirthday(): ?string - { - if (count($this->birthday) == 0) { - return null; - } - return $this->birthday['value']; - } - - /** - * Sets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - * - * @maps birthday - */ - public function setBirthday(?string $birthday): void - { - $this->birthday['value'] = $birthday; - } - - /** - * Unsets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. - * For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. - * Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or - * `0000` if a birth year is not specified. - */ - public function unsetBirthday(): void - { - $this->birthday = []; - } - - /** - * Returns Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - */ - public function getTaxIds(): ?CustomerTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?CustomerTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Returns Version. - * The current version of the customer profile. - * - * As a best practice, you should include this field to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the customer profile. - * - * As a best practice, you should include this field to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->givenName)) { - $json['given_name'] = $this->givenName['value']; - } - if (!empty($this->familyName)) { - $json['family_name'] = $this->familyName['value']; - } - if (!empty($this->companyName)) { - $json['company_name'] = $this->companyName['value']; - } - if (!empty($this->nickname)) { - $json['nickname'] = $this->nickname['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->birthday)) { - $json['birthday'] = $this->birthday['value']; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateCustomersRequest.php b/src/Models/BulkUpdateCustomersRequest.php deleted file mode 100644 index b8b302a4..00000000 --- a/src/Models/BulkUpdateCustomersRequest.php +++ /dev/null @@ -1,88 +0,0 @@ - - */ - private $customers; - - /** - * @param array $customers - */ - public function __construct(array $customers) - { - $this->customers = $customers; - } - - /** - * Returns Customers. - * A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }` - * key-value pairs. - * - * Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer - * profile - * that was created by merging existing profiles, provide the ID of the newly created profile. - * - * Each value contains the updated customer data. Only new or changed fields are required. To add or - * update a field, specify the new value. To remove a field, specify `null`. - * - * @return array - */ - public function getCustomers(): array - { - return $this->customers; - } - - /** - * Sets Customers. - * A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }` - * key-value pairs. - * - * Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer - * profile - * that was created by merging existing profiles, provide the ID of the newly created profile. - * - * Each value contains the updated customer data. Only new or changed fields are required. To add or - * update a field, specify the new value. To remove a field, specify `null`. - * - * @required - * @maps customers - * - * @param array $customers - */ - public function setCustomers(array $customers): void - { - $this->customers = $customers; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customers'] = $this->customers; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateCustomersResponse.php b/src/Models/BulkUpdateCustomersResponse.php deleted file mode 100644 index b754e2f6..00000000 --- a/src/Models/BulkUpdateCustomersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -|null - */ - private $responses; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Responses. - * A map of responses that correspond to individual update requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for an update request and each value - * is the corresponding response. - * If the request succeeds, the value is the updated customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A map of responses that correspond to individual update requests, represented by - * key-value pairs. - * - * Each key is the customer ID that was specified for an update request and each value - * is the corresponding response. - * If the request succeeds, the value is the updated customer profile. - * If the request fails, the value contains any errors that occurred during the request. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Returns Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any top-level errors that prevented the bulk operation from running. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateTeamMembersRequest.php b/src/Models/BulkUpdateTeamMembersRequest.php deleted file mode 100644 index e81c387e..00000000 --- a/src/Models/BulkUpdateTeamMembersRequest.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ - private $teamMembers; - - /** - * @param array $teamMembers - */ - public function __construct(array $teamMembers) - { - $this->teamMembers = $teamMembers; - } - - /** - * Returns Team Members. - * The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the - * `UpdateTeamMemberRequest`. - * The maximum number of update objects is 25. - * - * For each team member, include the fields to add, change, or clear. Fields can be cleared using a - * null value. - * To update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If - * needed, - * call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values. - * - * @return array - */ - public function getTeamMembers(): array - { - return $this->teamMembers; - } - - /** - * Sets Team Members. - * The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the - * `UpdateTeamMemberRequest`. - * The maximum number of update objects is 25. - * - * For each team member, include the fields to add, change, or clear. Fields can be cleared using a - * null value. - * To update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If - * needed, - * call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values. - * - * @required - * @maps team_members - * - * @param array $teamMembers - */ - public function setTeamMembers(array $teamMembers): void - { - $this->teamMembers = $teamMembers; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['team_members'] = $this->teamMembers; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateTeamMembersResponse.php b/src/Models/BulkUpdateTeamMembersResponse.php deleted file mode 100644 index 59f2c846..00000000 --- a/src/Models/BulkUpdateTeamMembersResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -|null - */ - private $teamMembers; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Team Members. - * The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the - * `UpdateTeamMemberRequest`. - * - * @return array|null - */ - public function getTeamMembers(): ?array - { - return $this->teamMembers; - } - - /** - * Sets Team Members. - * The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the - * `UpdateTeamMemberRequest`. - * - * @maps team_members - * - * @param array|null $teamMembers - */ - public function setTeamMembers(?array $teamMembers): void - { - $this->teamMembers = $teamMembers; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMembers)) { - $json['team_members'] = $this->teamMembers; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateVendorsRequest.php b/src/Models/BulkUpdateVendorsRequest.php deleted file mode 100644 index 9f14c378..00000000 --- a/src/Models/BulkUpdateVendorsRequest.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - private $vendors; - - /** - * @param array $vendors - */ - public function __construct(array $vendors) - { - $this->vendors = $vendors; - } - - /** - * Returns Vendors. - * A set of [UpdateVendorRequest](entity:UpdateVendorRequest) objects encapsulating to-be-updated - * [Vendor](entity:Vendor) - * objects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorRequest`-object pairs. - * - * @return array - */ - public function getVendors(): array - { - return $this->vendors; - } - - /** - * Sets Vendors. - * A set of [UpdateVendorRequest](entity:UpdateVendorRequest) objects encapsulating to-be-updated - * [Vendor](entity:Vendor) - * objects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorRequest`-object pairs. - * - * @required - * @maps vendors - * - * @param array $vendors - */ - public function setVendors(array $vendors): void - { - $this->vendors = $vendors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['vendors'] = $this->vendors; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpdateVendorsResponse.php b/src/Models/BulkUpdateVendorsResponse.php deleted file mode 100644 index 95d01a44..00000000 --- a/src/Models/BulkUpdateVendorsResponse.php +++ /dev/null @@ -1,104 +0,0 @@ -|null - */ - private $responses; - - /** - * Returns Errors. - * Errors encountered when the request fails. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors encountered when the request fails. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Responses. - * A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully - * created [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by a collection of `Vendor`- - * ID/`UpdateVendorResponse`-object or - * `Vendor`-ID/error-object pairs. - * - * @return array|null - */ - public function getResponses(): ?array - { - return $this->responses; - } - - /** - * Sets Responses. - * A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully - * created [Vendor](entity:Vendor) - * objects or error responses for failed attempts. The set is represented by a collection of `Vendor`- - * ID/`UpdateVendorResponse`-object or - * `Vendor`-ID/error-object pairs. - * - * @maps responses - * - * @param array|null $responses - */ - public function setResponses(?array $responses): void - { - $this->responses = $responses; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->responses)) { - $json['responses'] = $this->responses; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertBookingCustomAttributesRequest.php b/src/Models/BulkUpsertBookingCustomAttributesRequest.php deleted file mode 100644 index 987d5188..00000000 --- a/src/Models/BulkUpsertBookingCustomAttributesRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertBookingCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertBookingCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertBookingCustomAttributesResponse.php b/src/Models/BulkUpsertBookingCustomAttributesResponse.php deleted file mode 100644 index 1c8a90f4..00000000 --- a/src/Models/BulkUpsertBookingCustomAttributesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -|null - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `booking_id` and `custom_attribute` or an - * `errors` field. - * - * @return array|null - */ - public function getValues(): ?array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `booking_id` and `custom_attribute` or an - * `errors` field. - * - * @maps values - * - * @param array|null $values - */ - public function setValues(?array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->values)) { - $json['values'] = $this->values; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertCustomerCustomAttributesRequest.php b/src/Models/BulkUpsertCustomerCustomAttributesRequest.php deleted file mode 100644 index 5a38afe0..00000000 --- a/src/Models/BulkUpsertCustomerCustomAttributesRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php b/src/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php deleted file mode 100644 index 2ad5961e..00000000 --- a/src/Models/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -customerId = $customerId; - $this->customAttribute = $customAttribute; - } - - /** - * Returns Customer Id. - * The ID of the target [customer profile](entity:Customer). - */ - public function getCustomerId(): string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the target [customer profile](entity:Customer). - * - * @required - * @maps customer_id - */ - public function setCustomerId(string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_id'] = $this->customerId; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertCustomerCustomAttributesResponse.php b/src/Models/BulkUpsertCustomerCustomAttributesResponse.php deleted file mode 100644 index 7414df4d..00000000 --- a/src/Models/BulkUpsertCustomerCustomAttributesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -|null - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `customer_id` and `custom_attribute` or - * an `errors` field. - * - * @return array|null - */ - public function getValues(): ?array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `customer_id` and `custom_attribute` or - * an `errors` field. - * - * @maps values - * - * @param array|null $values - */ - public function setValues(?array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->values)) { - $json['values'] = $this->values; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php b/src/Models/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php deleted file mode 100644 index 62df4f27..00000000 --- a/src/Models/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -customerId; - } - - /** - * Sets Customer Id. - * The ID of the customer profile associated with the custom attribute. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): ?CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred while processing the individual request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred while processing the individual request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customerId)) { - $json['customer_id'] = $this->customerId; - } - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertLocationCustomAttributesRequest.php b/src/Models/BulkUpsertLocationCustomAttributesRequest.php deleted file mode 100644 index 05fd4f0d..00000000 --- a/src/Models/BulkUpsertLocationCustomAttributesRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertLocationCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertLocationCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php b/src/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php deleted file mode 100644 index 5fad11fc..00000000 --- a/src/Models/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -locationId = $locationId; - $this->customAttribute = $customAttribute; - } - - /** - * Returns Location Id. - * The ID of the target [location](entity:Location). - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the target [location](entity:Location). - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertLocationCustomAttributesResponse.php b/src/Models/BulkUpsertLocationCustomAttributesResponse.php deleted file mode 100644 index 3fde63f8..00000000 --- a/src/Models/BulkUpsertLocationCustomAttributesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -|null - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `location_id` and `custom_attribute` or - * an `errors` field. - * - * @return array|null - */ - public function getValues(): ?array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `location_id` and `custom_attribute` or - * an `errors` field. - * - * @maps values - * - * @param array|null $values - */ - public function setValues(?array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->values)) { - $json['values'] = $this->values; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php b/src/Models/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php deleted file mode 100644 index c393dec6..00000000 --- a/src/Models/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -locationId; - } - - /** - * Sets Location Id. - * The ID of the location associated with the custom attribute. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): ?CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred while processing the individual request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred while processing the individual request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertMerchantCustomAttributesRequest.php b/src/Models/BulkUpsertMerchantCustomAttributesRequest.php deleted file mode 100644 index f80f3dd8..00000000 --- a/src/Models/BulkUpsertMerchantCustomAttributesRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map containing 1 to 25 individual upsert requests. For each request, provide an - * arbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the - * information needed to create or update a custom attribute. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php b/src/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php deleted file mode 100644 index 3a705060..00000000 --- a/src/Models/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -merchantId = $merchantId; - $this->customAttribute = $customAttribute; - } - - /** - * Returns Merchant Id. - * The ID of the target [merchant](entity:Merchant). - */ - public function getMerchantId(): string - { - return $this->merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the target [merchant](entity:Merchant). - * - * @required - * @maps merchant_id - */ - public function setMerchantId(string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this individual upsert request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['merchant_id'] = $this->merchantId; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertMerchantCustomAttributesResponse.php b/src/Models/BulkUpsertMerchantCustomAttributesResponse.php deleted file mode 100644 index 77b131ca..00000000 --- a/src/Models/BulkUpsertMerchantCustomAttributesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -|null - */ - private $values; - - /** - * @var Error[]|null - */ - private $errors; - - /** - * Returns Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or - * an `errors` field. - * - * @return array|null - */ - public function getValues(): ?array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual upsert requests. Each response has the - * same ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or - * an `errors` field. - * - * @maps values - * - * @param array|null $values - */ - public function setValues(?array $values): void - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->values)) { - $json['values'] = $this->values; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php b/src/Models/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php deleted file mode 100644 index 75242307..00000000 --- a/src/Models/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the merchant associated with the custom attribute. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): ?CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred while processing the individual request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred while processing the individual request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->merchantId)) { - $json['merchant_id'] = $this->merchantId; - } - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertOrderCustomAttributesRequest.php b/src/Models/BulkUpsertOrderCustomAttributesRequest.php deleted file mode 100644 index f2c36be7..00000000 --- a/src/Models/BulkUpsertOrderCustomAttributesRequest.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Values. - * A map of requests that correspond to individual upsert operations for custom attributes. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of requests that correspond to individual upsert operations for custom attributes. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php b/src/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php deleted file mode 100644 index 6cb46f04..00000000 --- a/src/Models/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php +++ /dev/null @@ -1,144 +0,0 @@ -customAttribute = $customAttribute; - $this->orderId = $orderId; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Returns Order Id. - * The ID of the target [order](entity:Order). - */ - public function getOrderId(): string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the target [order](entity:Order). - * - * @required - * @maps order_id - */ - public function setOrderId(string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json['order_id'] = $this->orderId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BulkUpsertOrderCustomAttributesResponse.php b/src/Models/BulkUpsertOrderCustomAttributesResponse.php deleted file mode 100644 index 3696efaa..00000000 --- a/src/Models/BulkUpsertOrderCustomAttributesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ - - */ - private $values; - - /** - * @param array $values - */ - public function __construct(array $values) - { - $this->values = $values; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Values. - * A map of responses that correspond to individual upsert operations for custom attributes. - * - * @return array - */ - public function getValues(): array - { - return $this->values; - } - - /** - * Sets Values. - * A map of responses that correspond to individual upsert operations for custom attributes. - * - * @required - * @maps values - * - * @param array $values - */ - public function setValues(array $values): void - { - $this->values = $values; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json['values'] = $this->values; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BusinessAppointmentSettings.php b/src/Models/BusinessAppointmentSettings.php deleted file mode 100644 index c0102840..00000000 --- a/src/Models/BusinessAppointmentSettings.php +++ /dev/null @@ -1,541 +0,0 @@ -locationTypes) == 0) { - return null; - } - return $this->locationTypes['value']; - } - - /** - * Sets Location Types. - * Types of the location allowed for bookings. - * See [BusinessAppointmentSettingsBookingLocationType](#type- - * businessappointmentsettingsbookinglocationtype) for possible values - * - * @maps location_types - * - * @param string[]|null $locationTypes - */ - public function setLocationTypes(?array $locationTypes): void - { - $this->locationTypes['value'] = $locationTypes; - } - - /** - * Unsets Location Types. - * Types of the location allowed for bookings. - * See [BusinessAppointmentSettingsBookingLocationType](#type- - * businessappointmentsettingsbookinglocationtype) for possible values - */ - public function unsetLocationTypes(): void - { - $this->locationTypes = []; - } - - /** - * Returns Alignment Time. - * Time units of a service duration for bookings. - */ - public function getAlignmentTime(): ?string - { - return $this->alignmentTime; - } - - /** - * Sets Alignment Time. - * Time units of a service duration for bookings. - * - * @maps alignment_time - */ - public function setAlignmentTime(?string $alignmentTime): void - { - $this->alignmentTime = $alignmentTime; - } - - /** - * Returns Min Booking Lead Time Seconds. - * The minimum lead time in seconds before a service can be booked. A booking must be created at least - * this amount of time before its starting time. - */ - public function getMinBookingLeadTimeSeconds(): ?int - { - if (count($this->minBookingLeadTimeSeconds) == 0) { - return null; - } - return $this->minBookingLeadTimeSeconds['value']; - } - - /** - * Sets Min Booking Lead Time Seconds. - * The minimum lead time in seconds before a service can be booked. A booking must be created at least - * this amount of time before its starting time. - * - * @maps min_booking_lead_time_seconds - */ - public function setMinBookingLeadTimeSeconds(?int $minBookingLeadTimeSeconds): void - { - $this->minBookingLeadTimeSeconds['value'] = $minBookingLeadTimeSeconds; - } - - /** - * Unsets Min Booking Lead Time Seconds. - * The minimum lead time in seconds before a service can be booked. A booking must be created at least - * this amount of time before its starting time. - */ - public function unsetMinBookingLeadTimeSeconds(): void - { - $this->minBookingLeadTimeSeconds = []; - } - - /** - * Returns Max Booking Lead Time Seconds. - * The maximum lead time in seconds before a service can be booked. A booking must be created at most - * this amount of time before its starting time. - */ - public function getMaxBookingLeadTimeSeconds(): ?int - { - if (count($this->maxBookingLeadTimeSeconds) == 0) { - return null; - } - return $this->maxBookingLeadTimeSeconds['value']; - } - - /** - * Sets Max Booking Lead Time Seconds. - * The maximum lead time in seconds before a service can be booked. A booking must be created at most - * this amount of time before its starting time. - * - * @maps max_booking_lead_time_seconds - */ - public function setMaxBookingLeadTimeSeconds(?int $maxBookingLeadTimeSeconds): void - { - $this->maxBookingLeadTimeSeconds['value'] = $maxBookingLeadTimeSeconds; - } - - /** - * Unsets Max Booking Lead Time Seconds. - * The maximum lead time in seconds before a service can be booked. A booking must be created at most - * this amount of time before its starting time. - */ - public function unsetMaxBookingLeadTimeSeconds(): void - { - $this->maxBookingLeadTimeSeconds = []; - } - - /** - * Returns Any Team Member Booking Enabled. - * Indicates whether a customer can choose from all available time slots and have a staff member - * assigned - * automatically (`true`) or not (`false`). - */ - public function getAnyTeamMemberBookingEnabled(): ?bool - { - if (count($this->anyTeamMemberBookingEnabled) == 0) { - return null; - } - return $this->anyTeamMemberBookingEnabled['value']; - } - - /** - * Sets Any Team Member Booking Enabled. - * Indicates whether a customer can choose from all available time slots and have a staff member - * assigned - * automatically (`true`) or not (`false`). - * - * @maps any_team_member_booking_enabled - */ - public function setAnyTeamMemberBookingEnabled(?bool $anyTeamMemberBookingEnabled): void - { - $this->anyTeamMemberBookingEnabled['value'] = $anyTeamMemberBookingEnabled; - } - - /** - * Unsets Any Team Member Booking Enabled. - * Indicates whether a customer can choose from all available time slots and have a staff member - * assigned - * automatically (`true`) or not (`false`). - */ - public function unsetAnyTeamMemberBookingEnabled(): void - { - $this->anyTeamMemberBookingEnabled = []; - } - - /** - * Returns Multiple Service Booking Enabled. - * Indicates whether a customer can book multiple services in a single online booking. - */ - public function getMultipleServiceBookingEnabled(): ?bool - { - if (count($this->multipleServiceBookingEnabled) == 0) { - return null; - } - return $this->multipleServiceBookingEnabled['value']; - } - - /** - * Sets Multiple Service Booking Enabled. - * Indicates whether a customer can book multiple services in a single online booking. - * - * @maps multiple_service_booking_enabled - */ - public function setMultipleServiceBookingEnabled(?bool $multipleServiceBookingEnabled): void - { - $this->multipleServiceBookingEnabled['value'] = $multipleServiceBookingEnabled; - } - - /** - * Unsets Multiple Service Booking Enabled. - * Indicates whether a customer can book multiple services in a single online booking. - */ - public function unsetMultipleServiceBookingEnabled(): void - { - $this->multipleServiceBookingEnabled = []; - } - - /** - * Returns Max Appointments Per Day Limit Type. - * Types of daily appointment limits. - */ - public function getMaxAppointmentsPerDayLimitType(): ?string - { - return $this->maxAppointmentsPerDayLimitType; - } - - /** - * Sets Max Appointments Per Day Limit Type. - * Types of daily appointment limits. - * - * @maps max_appointments_per_day_limit_type - */ - public function setMaxAppointmentsPerDayLimitType(?string $maxAppointmentsPerDayLimitType): void - { - $this->maxAppointmentsPerDayLimitType = $maxAppointmentsPerDayLimitType; - } - - /** - * Returns Max Appointments Per Day Limit. - * The maximum number of daily appointments per team member or per location. - */ - public function getMaxAppointmentsPerDayLimit(): ?int - { - if (count($this->maxAppointmentsPerDayLimit) == 0) { - return null; - } - return $this->maxAppointmentsPerDayLimit['value']; - } - - /** - * Sets Max Appointments Per Day Limit. - * The maximum number of daily appointments per team member or per location. - * - * @maps max_appointments_per_day_limit - */ - public function setMaxAppointmentsPerDayLimit(?int $maxAppointmentsPerDayLimit): void - { - $this->maxAppointmentsPerDayLimit['value'] = $maxAppointmentsPerDayLimit; - } - - /** - * Unsets Max Appointments Per Day Limit. - * The maximum number of daily appointments per team member or per location. - */ - public function unsetMaxAppointmentsPerDayLimit(): void - { - $this->maxAppointmentsPerDayLimit = []; - } - - /** - * Returns Cancellation Window Seconds. - * The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. - */ - public function getCancellationWindowSeconds(): ?int - { - if (count($this->cancellationWindowSeconds) == 0) { - return null; - } - return $this->cancellationWindowSeconds['value']; - } - - /** - * Sets Cancellation Window Seconds. - * The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. - * - * @maps cancellation_window_seconds - */ - public function setCancellationWindowSeconds(?int $cancellationWindowSeconds): void - { - $this->cancellationWindowSeconds['value'] = $cancellationWindowSeconds; - } - - /** - * Unsets Cancellation Window Seconds. - * The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. - */ - public function unsetCancellationWindowSeconds(): void - { - $this->cancellationWindowSeconds = []; - } - - /** - * Returns Cancellation Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCancellationFeeMoney(): ?Money - { - return $this->cancellationFeeMoney; - } - - /** - * Sets Cancellation Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps cancellation_fee_money - */ - public function setCancellationFeeMoney(?Money $cancellationFeeMoney): void - { - $this->cancellationFeeMoney = $cancellationFeeMoney; - } - - /** - * Returns Cancellation Policy. - * The category of the seller’s cancellation policy. - */ - public function getCancellationPolicy(): ?string - { - return $this->cancellationPolicy; - } - - /** - * Sets Cancellation Policy. - * The category of the seller’s cancellation policy. - * - * @maps cancellation_policy - */ - public function setCancellationPolicy(?string $cancellationPolicy): void - { - $this->cancellationPolicy = $cancellationPolicy; - } - - /** - * Returns Cancellation Policy Text. - * The free-form text of the seller's cancellation policy. - */ - public function getCancellationPolicyText(): ?string - { - if (count($this->cancellationPolicyText) == 0) { - return null; - } - return $this->cancellationPolicyText['value']; - } - - /** - * Sets Cancellation Policy Text. - * The free-form text of the seller's cancellation policy. - * - * @maps cancellation_policy_text - */ - public function setCancellationPolicyText(?string $cancellationPolicyText): void - { - $this->cancellationPolicyText['value'] = $cancellationPolicyText; - } - - /** - * Unsets Cancellation Policy Text. - * The free-form text of the seller's cancellation policy. - */ - public function unsetCancellationPolicyText(): void - { - $this->cancellationPolicyText = []; - } - - /** - * Returns Skip Booking Flow Staff Selection. - * Indicates whether customers has an assigned staff member (`true`) or can select s staff member of - * their choice (`false`). - */ - public function getSkipBookingFlowStaffSelection(): ?bool - { - if (count($this->skipBookingFlowStaffSelection) == 0) { - return null; - } - return $this->skipBookingFlowStaffSelection['value']; - } - - /** - * Sets Skip Booking Flow Staff Selection. - * Indicates whether customers has an assigned staff member (`true`) or can select s staff member of - * their choice (`false`). - * - * @maps skip_booking_flow_staff_selection - */ - public function setSkipBookingFlowStaffSelection(?bool $skipBookingFlowStaffSelection): void - { - $this->skipBookingFlowStaffSelection['value'] = $skipBookingFlowStaffSelection; - } - - /** - * Unsets Skip Booking Flow Staff Selection. - * Indicates whether customers has an assigned staff member (`true`) or can select s staff member of - * their choice (`false`). - */ - public function unsetSkipBookingFlowStaffSelection(): void - { - $this->skipBookingFlowStaffSelection = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationTypes)) { - $json['location_types'] = $this->locationTypes['value']; - } - if (isset($this->alignmentTime)) { - $json['alignment_time'] = $this->alignmentTime; - } - if (!empty($this->minBookingLeadTimeSeconds)) { - $json['min_booking_lead_time_seconds'] = $this->minBookingLeadTimeSeconds['value']; - } - if (!empty($this->maxBookingLeadTimeSeconds)) { - $json['max_booking_lead_time_seconds'] = $this->maxBookingLeadTimeSeconds['value']; - } - if (!empty($this->anyTeamMemberBookingEnabled)) { - $json['any_team_member_booking_enabled'] = $this->anyTeamMemberBookingEnabled['value']; - } - if (!empty($this->multipleServiceBookingEnabled)) { - $json['multiple_service_booking_enabled'] = $this->multipleServiceBookingEnabled['value']; - } - if (isset($this->maxAppointmentsPerDayLimitType)) { - $json['max_appointments_per_day_limit_type'] = $this->maxAppointmentsPerDayLimitType; - } - if (!empty($this->maxAppointmentsPerDayLimit)) { - $json['max_appointments_per_day_limit'] = $this->maxAppointmentsPerDayLimit['value']; - } - if (!empty($this->cancellationWindowSeconds)) { - $json['cancellation_window_seconds'] = $this->cancellationWindowSeconds['value']; - } - if (isset($this->cancellationFeeMoney)) { - $json['cancellation_fee_money'] = $this->cancellationFeeMoney; - } - if (isset($this->cancellationPolicy)) { - $json['cancellation_policy'] = $this->cancellationPolicy; - } - if (!empty($this->cancellationPolicyText)) { - $json['cancellation_policy_text'] = $this->cancellationPolicyText['value']; - } - if (!empty($this->skipBookingFlowStaffSelection)) { - $json['skip_booking_flow_staff_selection'] = $this->skipBookingFlowStaffSelection['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BusinessAppointmentSettingsAlignmentTime.php b/src/Models/BusinessAppointmentSettingsAlignmentTime.php deleted file mode 100644 index 794d252e..00000000 --- a/src/Models/BusinessAppointmentSettingsAlignmentTime.php +++ /dev/null @@ -1,31 +0,0 @@ -sellerId) == 0) { - return null; - } - return $this->sellerId['value']; - } - - /** - * Sets Seller Id. - * The ID of the seller, obtainable using the Merchants API. - * - * @maps seller_id - */ - public function setSellerId(?string $sellerId): void - { - $this->sellerId['value'] = $sellerId; - } - - /** - * Unsets Seller Id. - * The ID of the seller, obtainable using the Merchants API. - */ - public function unsetSellerId(): void - { - $this->sellerId = []; - } - - /** - * Returns Created At. - * The RFC 3339 timestamp specifying the booking's creation time. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The RFC 3339 timestamp specifying the booking's creation time. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Booking Enabled. - * Indicates whether the seller is open for booking. - */ - public function getBookingEnabled(): ?bool - { - if (count($this->bookingEnabled) == 0) { - return null; - } - return $this->bookingEnabled['value']; - } - - /** - * Sets Booking Enabled. - * Indicates whether the seller is open for booking. - * - * @maps booking_enabled - */ - public function setBookingEnabled(?bool $bookingEnabled): void - { - $this->bookingEnabled['value'] = $bookingEnabled; - } - - /** - * Unsets Booking Enabled. - * Indicates whether the seller is open for booking. - */ - public function unsetBookingEnabled(): void - { - $this->bookingEnabled = []; - } - - /** - * Returns Customer Timezone Choice. - * Choices of customer-facing time zone used for bookings. - */ - public function getCustomerTimezoneChoice(): ?string - { - return $this->customerTimezoneChoice; - } - - /** - * Sets Customer Timezone Choice. - * Choices of customer-facing time zone used for bookings. - * - * @maps customer_timezone_choice - */ - public function setCustomerTimezoneChoice(?string $customerTimezoneChoice): void - { - $this->customerTimezoneChoice = $customerTimezoneChoice; - } - - /** - * Returns Booking Policy. - * Policies for accepting bookings. - */ - public function getBookingPolicy(): ?string - { - return $this->bookingPolicy; - } - - /** - * Sets Booking Policy. - * Policies for accepting bookings. - * - * @maps booking_policy - */ - public function setBookingPolicy(?string $bookingPolicy): void - { - $this->bookingPolicy = $bookingPolicy; - } - - /** - * Returns Allow User Cancel. - * Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). - */ - public function getAllowUserCancel(): ?bool - { - if (count($this->allowUserCancel) == 0) { - return null; - } - return $this->allowUserCancel['value']; - } - - /** - * Sets Allow User Cancel. - * Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). - * - * @maps allow_user_cancel - */ - public function setAllowUserCancel(?bool $allowUserCancel): void - { - $this->allowUserCancel['value'] = $allowUserCancel; - } - - /** - * Unsets Allow User Cancel. - * Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). - */ - public function unsetAllowUserCancel(): void - { - $this->allowUserCancel = []; - } - - /** - * Returns Business Appointment Settings. - * The service appointment settings, including where and how the service is provided. - */ - public function getBusinessAppointmentSettings(): ?BusinessAppointmentSettings - { - return $this->businessAppointmentSettings; - } - - /** - * Sets Business Appointment Settings. - * The service appointment settings, including where and how the service is provided. - * - * @maps business_appointment_settings - */ - public function setBusinessAppointmentSettings(?BusinessAppointmentSettings $businessAppointmentSettings): void - { - $this->businessAppointmentSettings = $businessAppointmentSettings; - } - - /** - * Returns Support Seller Level Writes. - * Indicates whether the seller's subscription to Square Appointments supports creating, updating or - * canceling an appointment through the API (`true`) or not (`false`) using seller permission. - */ - public function getSupportSellerLevelWrites(): ?bool - { - if (count($this->supportSellerLevelWrites) == 0) { - return null; - } - return $this->supportSellerLevelWrites['value']; - } - - /** - * Sets Support Seller Level Writes. - * Indicates whether the seller's subscription to Square Appointments supports creating, updating or - * canceling an appointment through the API (`true`) or not (`false`) using seller permission. - * - * @maps support_seller_level_writes - */ - public function setSupportSellerLevelWrites(?bool $supportSellerLevelWrites): void - { - $this->supportSellerLevelWrites['value'] = $supportSellerLevelWrites; - } - - /** - * Unsets Support Seller Level Writes. - * Indicates whether the seller's subscription to Square Appointments supports creating, updating or - * canceling an appointment through the API (`true`) or not (`false`) using seller permission. - */ - public function unsetSupportSellerLevelWrites(): void - { - $this->supportSellerLevelWrites = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->sellerId)) { - $json['seller_id'] = $this->sellerId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->bookingEnabled)) { - $json['booking_enabled'] = $this->bookingEnabled['value']; - } - if (isset($this->customerTimezoneChoice)) { - $json['customer_timezone_choice'] = $this->customerTimezoneChoice; - } - if (isset($this->bookingPolicy)) { - $json['booking_policy'] = $this->bookingPolicy; - } - if (!empty($this->allowUserCancel)) { - $json['allow_user_cancel'] = $this->allowUserCancel['value']; - } - if (isset($this->businessAppointmentSettings)) { - $json['business_appointment_settings'] = $this->businessAppointmentSettings; - } - if (!empty($this->supportSellerLevelWrites)) { - $json['support_seller_level_writes'] = $this->supportSellerLevelWrites['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BusinessBookingProfileBookingPolicy.php b/src/Models/BusinessBookingProfileBookingPolicy.php deleted file mode 100644 index 8515786e..00000000 --- a/src/Models/BusinessBookingProfileBookingPolicy.php +++ /dev/null @@ -1,21 +0,0 @@ -periods) == 0) { - return null; - } - return $this->periods['value']; - } - - /** - * Sets Periods. - * The list of time periods during which the business is open. There can be at most 10 periods per day. - * - * @maps periods - * - * @param BusinessHoursPeriod[]|null $periods - */ - public function setPeriods(?array $periods): void - { - $this->periods['value'] = $periods; - } - - /** - * Unsets Periods. - * The list of time periods during which the business is open. There can be at most 10 periods per day. - */ - public function unsetPeriods(): void - { - $this->periods = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->periods)) { - $json['periods'] = $this->periods['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BusinessHoursPeriod.php b/src/Models/BusinessHoursPeriod.php deleted file mode 100644 index 5a7a9ecc..00000000 --- a/src/Models/BusinessHoursPeriod.php +++ /dev/null @@ -1,152 +0,0 @@ -dayOfWeek; - } - - /** - * Sets Day of Week. - * Indicates the specific day of the week. - * - * @maps day_of_week - */ - public function setDayOfWeek(?string $dayOfWeek): void - { - $this->dayOfWeek = $dayOfWeek; - } - - /** - * Returns Start Local Time. - * The start time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function getStartLocalTime(): ?string - { - if (count($this->startLocalTime) == 0) { - return null; - } - return $this->startLocalTime['value']; - } - - /** - * Sets Start Local Time. - * The start time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - * - * @maps start_local_time - */ - public function setStartLocalTime(?string $startLocalTime): void - { - $this->startLocalTime['value'] = $startLocalTime; - } - - /** - * Unsets Start Local Time. - * The start time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function unsetStartLocalTime(): void - { - $this->startLocalTime = []; - } - - /** - * Returns End Local Time. - * The end time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function getEndLocalTime(): ?string - { - if (count($this->endLocalTime) == 0) { - return null; - } - return $this->endLocalTime['value']; - } - - /** - * Sets End Local Time. - * The end time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - * - * @maps end_local_time - */ - public function setEndLocalTime(?string $endLocalTime): void - { - $this->endLocalTime['value'] = $endLocalTime; - } - - /** - * Unsets End Local Time. - * The end time of a business hours period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function unsetEndLocalTime(): void - { - $this->endLocalTime = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->dayOfWeek)) { - $json['day_of_week'] = $this->dayOfWeek; - } - if (!empty($this->startLocalTime)) { - $json['start_local_time'] = $this->startLocalTime['value']; - } - if (!empty($this->endLocalTime)) { - $json['end_local_time'] = $this->endLocalTime['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/BuyNowPayLaterDetails.php b/src/Models/BuyNowPayLaterDetails.php deleted file mode 100644 index d78e11b9..00000000 --- a/src/Models/BuyNowPayLaterDetails.php +++ /dev/null @@ -1,131 +0,0 @@ -brand) == 0) { - return null; - } - return $this->brand['value']; - } - - /** - * Sets Brand. - * The brand used for the Buy Now Pay Later payment. - * The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`. - * - * @maps brand - */ - public function setBrand(?string $brand): void - { - $this->brand['value'] = $brand; - } - - /** - * Unsets Brand. - * The brand used for the Buy Now Pay Later payment. - * The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`. - */ - public function unsetBrand(): void - { - $this->brand = []; - } - - /** - * Returns Afterpay Details. - * Additional details about Afterpay payments. - */ - public function getAfterpayDetails(): ?AfterpayDetails - { - return $this->afterpayDetails; - } - - /** - * Sets Afterpay Details. - * Additional details about Afterpay payments. - * - * @maps afterpay_details - */ - public function setAfterpayDetails(?AfterpayDetails $afterpayDetails): void - { - $this->afterpayDetails = $afterpayDetails; - } - - /** - * Returns Clearpay Details. - * Additional details about Clearpay payments. - */ - public function getClearpayDetails(): ?ClearpayDetails - { - return $this->clearpayDetails; - } - - /** - * Sets Clearpay Details. - * Additional details about Clearpay payments. - * - * @maps clearpay_details - */ - public function setClearpayDetails(?ClearpayDetails $clearpayDetails): void - { - $this->clearpayDetails = $clearpayDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->brand)) { - $json['brand'] = $this->brand['value']; - } - if (isset($this->afterpayDetails)) { - $json['afterpay_details'] = $this->afterpayDetails; - } - if (isset($this->clearpayDetails)) { - $json['clearpay_details'] = $this->clearpayDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CalculateLoyaltyPointsRequest.php b/src/Models/CalculateLoyaltyPointsRequest.php deleted file mode 100644 index 2121b801..00000000 --- a/src/Models/CalculateLoyaltyPointsRequest.php +++ /dev/null @@ -1,188 +0,0 @@ -orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The [order](entity:Order) ID for which to calculate the points. - * Specify this field if your application uses the Orders API to process orders. - * Otherwise, specify the `transaction_amount_money`. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The [order](entity:Order) ID for which to calculate the points. - * Specify this field if your application uses the Orders API to process orders. - * Otherwise, specify the `transaction_amount_money`. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Transaction Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTransactionAmountMoney(): ?Money - { - return $this->transactionAmountMoney; - } - - /** - * Sets Transaction Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps transaction_amount_money - */ - public function setTransactionAmountMoney(?Money $transactionAmountMoney): void - { - $this->transactionAmountMoney = $transactionAmountMoney; - } - - /** - * Returns Loyalty Account Id. - * The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field - * if your application uses the Orders API to process orders. - * - * If specified, the `promotion_points` field in the response shows the number of points the buyer - * would - * earn from the purchase. In this case, Square uses the account ID to determine whether the - * promotion's - * `trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been - * reached. - * If not specified, the `promotion_points` field shows the number of points the purchase qualifies - * for regardless of the trigger limit. - */ - public function getLoyaltyAccountId(): ?string - { - if (count($this->loyaltyAccountId) == 0) { - return null; - } - return $this->loyaltyAccountId['value']; - } - - /** - * Sets Loyalty Account Id. - * The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field - * if your application uses the Orders API to process orders. - * - * If specified, the `promotion_points` field in the response shows the number of points the buyer - * would - * earn from the purchase. In this case, Square uses the account ID to determine whether the - * promotion's - * `trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been - * reached. - * If not specified, the `promotion_points` field shows the number of points the purchase qualifies - * for regardless of the trigger limit. - * - * @maps loyalty_account_id - */ - public function setLoyaltyAccountId(?string $loyaltyAccountId): void - { - $this->loyaltyAccountId['value'] = $loyaltyAccountId; - } - - /** - * Unsets Loyalty Account Id. - * The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field - * if your application uses the Orders API to process orders. - * - * If specified, the `promotion_points` field in the response shows the number of points the buyer - * would - * earn from the purchase. In this case, Square uses the account ID to determine whether the - * promotion's - * `trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been - * reached. - * If not specified, the `promotion_points` field shows the number of points the purchase qualifies - * for regardless of the trigger limit. - */ - public function unsetLoyaltyAccountId(): void - { - $this->loyaltyAccountId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->transactionAmountMoney)) { - $json['transaction_amount_money'] = $this->transactionAmountMoney; - } - if (!empty($this->loyaltyAccountId)) { - $json['loyalty_account_id'] = $this->loyaltyAccountId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CalculateLoyaltyPointsResponse.php b/src/Models/CalculateLoyaltyPointsResponse.php deleted file mode 100644 index f96725ab..00000000 --- a/src/Models/CalculateLoyaltyPointsResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Points. - * The number of points that the buyer can earn from the base loyalty program. - */ - public function getPoints(): ?int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points that the buyer can earn from the base loyalty program. - * - * @maps points - */ - public function setPoints(?int $points): void - { - $this->points = $points; - } - - /** - * Returns Promotion Points. - * The number of points that the buyer can earn from a loyalty promotion. To be eligible - * to earn promotion points, the purchase must first qualify for program points. When `order_id` - * is not provided in the request, this value is always 0. - */ - public function getPromotionPoints(): ?int - { - return $this->promotionPoints; - } - - /** - * Sets Promotion Points. - * The number of points that the buyer can earn from a loyalty promotion. To be eligible - * to earn promotion points, the purchase must first qualify for program points. When `order_id` - * is not provided in the request, this value is always 0. - * - * @maps promotion_points - */ - public function setPromotionPoints(?int $promotionPoints): void - { - $this->promotionPoints = $promotionPoints; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->points)) { - $json['points'] = $this->points; - } - if (isset($this->promotionPoints)) { - $json['promotion_points'] = $this->promotionPoints; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CalculateOrderRequest.php b/src/Models/CalculateOrderRequest.php deleted file mode 100644 index b6569fd7..00000000 --- a/src/Models/CalculateOrderRequest.php +++ /dev/null @@ -1,130 +0,0 @@ -order = $order; - } - - /** - * Returns Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - */ - public function getOrder(): Order - { - return $this->order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @required - * @maps order - */ - public function setOrder(Order $order): void - { - $this->order = $order; - } - - /** - * Returns Proposed Rewards. - * Identifies one or more loyalty reward tiers to apply during the order calculation. - * The discounts defined by the reward tiers are added to the order only to preview the - * effect of applying the specified rewards. The rewards do not correspond to actual - * redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are - * random strings used only to reference the reward tier. - * - * @return OrderReward[]|null - */ - public function getProposedRewards(): ?array - { - if (count($this->proposedRewards) == 0) { - return null; - } - return $this->proposedRewards['value']; - } - - /** - * Sets Proposed Rewards. - * Identifies one or more loyalty reward tiers to apply during the order calculation. - * The discounts defined by the reward tiers are added to the order only to preview the - * effect of applying the specified rewards. The rewards do not correspond to actual - * redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are - * random strings used only to reference the reward tier. - * - * @maps proposed_rewards - * - * @param OrderReward[]|null $proposedRewards - */ - public function setProposedRewards(?array $proposedRewards): void - { - $this->proposedRewards['value'] = $proposedRewards; - } - - /** - * Unsets Proposed Rewards. - * Identifies one or more loyalty reward tiers to apply during the order calculation. - * The discounts defined by the reward tiers are added to the order only to preview the - * effect of applying the specified rewards. The rewards do not correspond to actual - * redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are - * random strings used only to reference the reward tier. - */ - public function unsetProposedRewards(): void - { - $this->proposedRewards = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['order'] = $this->order; - if (!empty($this->proposedRewards)) { - $json['proposed_rewards'] = $this->proposedRewards['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CalculateOrderResponse.php b/src/Models/CalculateOrderResponse.php deleted file mode 100644 index e38f649e..00000000 --- a/src/Models/CalculateOrderResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelBookingRequest.php b/src/Models/CancelBookingRequest.php deleted file mode 100644 index 5fdd7317..00000000 --- a/src/Models/CancelBookingRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique key to make this request an idempotent operation. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique key to make this request an idempotent operation. - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Returns Booking Version. - * The revision number for the booking used for optimistic concurrency. - */ - public function getBookingVersion(): ?int - { - if (count($this->bookingVersion) == 0) { - return null; - } - return $this->bookingVersion['value']; - } - - /** - * Sets Booking Version. - * The revision number for the booking used for optimistic concurrency. - * - * @maps booking_version - */ - public function setBookingVersion(?int $bookingVersion): void - { - $this->bookingVersion['value'] = $bookingVersion; - } - - /** - * Unsets Booking Version. - * The revision number for the booking used for optimistic concurrency. - */ - public function unsetBookingVersion(): void - { - $this->bookingVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - if (!empty($this->bookingVersion)) { - $json['booking_version'] = $this->bookingVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelBookingResponse.php b/src/Models/CancelBookingResponse.php deleted file mode 100644 index b4f11fde..00000000 --- a/src/Models/CancelBookingResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @maps booking - */ - public function setBooking(?Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->booking)) { - $json['booking'] = $this->booking; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelInvoiceRequest.php b/src/Models/CancelInvoiceRequest.php deleted file mode 100644 index ed0bc248..00000000 --- a/src/Models/CancelInvoiceRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -version = $version; - } - - /** - * Returns Version. - * The version of the [invoice](entity:Invoice) to cancel. - * If you do not know the version, you can call - * [GetInvoice](api-endpoint:Invoices-GetInvoice) or [ListInvoices](api-endpoint:Invoices-ListInvoices). - */ - public function getVersion(): int - { - return $this->version; - } - - /** - * Sets Version. - * The version of the [invoice](entity:Invoice) to cancel. - * If you do not know the version, you can call - * [GetInvoice](api-endpoint:Invoices-GetInvoice) or [ListInvoices](api-endpoint:Invoices-ListInvoices). - * - * @required - * @maps version - */ - public function setVersion(int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['version'] = $this->version; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelInvoiceResponse.php b/src/Models/CancelInvoiceResponse.php deleted file mode 100644 index f28409f9..00000000 --- a/src/Models/CancelInvoiceResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @maps invoice - */ - public function setInvoice(?Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoice)) { - $json['invoice'] = $this->invoice; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelLoyaltyPromotionResponse.php b/src/Models/CancelLoyaltyPromotionResponse.php deleted file mode 100644 index 0ffd71da..00000000 --- a/src/Models/CancelLoyaltyPromotionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - */ - public function getLoyaltyPromotion(): ?LoyaltyPromotion - { - return $this->loyaltyPromotion; - } - - /** - * Sets Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - * - * @maps loyalty_promotion - */ - public function setLoyaltyPromotion(?LoyaltyPromotion $loyaltyPromotion): void - { - $this->loyaltyPromotion = $loyaltyPromotion; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyPromotion)) { - $json['loyalty_promotion'] = $this->loyaltyPromotion; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelPaymentByIdempotencyKeyRequest.php b/src/Models/CancelPaymentByIdempotencyKeyRequest.php deleted file mode 100644 index 1deb1def..00000000 --- a/src/Models/CancelPaymentByIdempotencyKeyRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * The `idempotency_key` identifying the payment to be canceled. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * The `idempotency_key` identifying the payment to be canceled. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelPaymentByIdempotencyKeyResponse.php b/src/Models/CancelPaymentByIdempotencyKeyResponse.php deleted file mode 100644 index d91ac28a..00000000 --- a/src/Models/CancelPaymentByIdempotencyKeyResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelPaymentResponse.php b/src/Models/CancelPaymentResponse.php deleted file mode 100644 index 38299ca1..00000000 --- a/src/Models/CancelPaymentResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelSubscriptionResponse.php b/src/Models/CancelSubscriptionResponse.php deleted file mode 100644 index 8d0d9f03..00000000 --- a/src/Models/CancelSubscriptionResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Returns Actions. - * A list of a single `CANCEL` action scheduled for the subscription. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - return $this->actions; - } - - /** - * Sets Actions. - * A list of a single `CANCEL` action scheduled for the subscription. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions = $actions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - if (isset($this->actions)) { - $json['actions'] = $this->actions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelTerminalActionResponse.php b/src/Models/CancelTerminalActionResponse.php deleted file mode 100644 index 08ccf3c4..00000000 --- a/src/Models/CancelTerminalActionResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Action. - * Represents an action processed by the Square Terminal. - */ - public function getAction(): ?TerminalAction - { - return $this->action; - } - - /** - * Sets Action. - * Represents an action processed by the Square Terminal. - * - * @maps action - */ - public function setAction(?TerminalAction $action): void - { - $this->action = $action; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->action)) { - $json['action'] = $this->action; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelTerminalCheckoutResponse.php b/src/Models/CancelTerminalCheckoutResponse.php deleted file mode 100644 index 36089144..00000000 --- a/src/Models/CancelTerminalCheckoutResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Checkout. - * Represents a checkout processed by the Square Terminal. - */ - public function getCheckout(): ?TerminalCheckout - { - return $this->checkout; - } - - /** - * Sets Checkout. - * Represents a checkout processed by the Square Terminal. - * - * @maps checkout - */ - public function setCheckout(?TerminalCheckout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->checkout)) { - $json['checkout'] = $this->checkout; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CancelTerminalRefundResponse.php b/src/Models/CancelTerminalRefundResponse.php deleted file mode 100644 index 1dcfa1d7..00000000 --- a/src/Models/CancelTerminalRefundResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - */ - public function getRefund(): ?TerminalRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - * - * @maps refund - */ - public function setRefund(?TerminalRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CaptureTransactionResponse.php b/src/Models/CaptureTransactionResponse.php deleted file mode 100644 index 86bd31fc..00000000 --- a/src/Models/CaptureTransactionResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Card.php b/src/Models/Card.php deleted file mode 100644 index 29cd45f8..00000000 --- a/src/Models/Card.php +++ /dev/null @@ -1,591 +0,0 @@ -id; - } - - /** - * Sets Id. - * Unique ID for this card. Generated by Square. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Card Brand. - * Indicates a card's brand, such as `VISA` or `MASTERCARD`. - */ - public function getCardBrand(): ?string - { - return $this->cardBrand; - } - - /** - * Sets Card Brand. - * Indicates a card's brand, such as `VISA` or `MASTERCARD`. - * - * @maps card_brand - */ - public function setCardBrand(?string $cardBrand): void - { - $this->cardBrand = $cardBrand; - } - - /** - * Returns Last 4. - * The last 4 digits of the card number. - */ - public function getLast4(): ?string - { - return $this->last4; - } - - /** - * Sets Last 4. - * The last 4 digits of the card number. - * - * @maps last_4 - */ - public function setLast4(?string $last4): void - { - $this->last4 = $last4; - } - - /** - * Returns Exp Month. - * The expiration month of the associated card as an integer between 1 and 12. - */ - public function getExpMonth(): ?int - { - if (count($this->expMonth) == 0) { - return null; - } - return $this->expMonth['value']; - } - - /** - * Sets Exp Month. - * The expiration month of the associated card as an integer between 1 and 12. - * - * @maps exp_month - */ - public function setExpMonth(?int $expMonth): void - { - $this->expMonth['value'] = $expMonth; - } - - /** - * Unsets Exp Month. - * The expiration month of the associated card as an integer between 1 and 12. - */ - public function unsetExpMonth(): void - { - $this->expMonth = []; - } - - /** - * Returns Exp Year. - * The four-digit year of the card's expiration date. - */ - public function getExpYear(): ?int - { - if (count($this->expYear) == 0) { - return null; - } - return $this->expYear['value']; - } - - /** - * Sets Exp Year. - * The four-digit year of the card's expiration date. - * - * @maps exp_year - */ - public function setExpYear(?int $expYear): void - { - $this->expYear['value'] = $expYear; - } - - /** - * Unsets Exp Year. - * The four-digit year of the card's expiration date. - */ - public function unsetExpYear(): void - { - $this->expYear = []; - } - - /** - * Returns Cardholder Name. - * The name of the cardholder. - */ - public function getCardholderName(): ?string - { - if (count($this->cardholderName) == 0) { - return null; - } - return $this->cardholderName['value']; - } - - /** - * Sets Cardholder Name. - * The name of the cardholder. - * - * @maps cardholder_name - */ - public function setCardholderName(?string $cardholderName): void - { - $this->cardholderName['value'] = $cardholderName; - } - - /** - * Unsets Cardholder Name. - * The name of the cardholder. - */ - public function unsetCardholderName(): void - { - $this->cardholderName = []; - } - - /** - * Returns Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBillingAddress(): ?Address - { - return $this->billingAddress; - } - - /** - * Sets Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps billing_address - */ - public function setBillingAddress(?Address $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * Returns Fingerprint. - * Intended as a Square-assigned identifier, based - * on the card number, to identify the card across multiple locations within a - * single application. - */ - public function getFingerprint(): ?string - { - return $this->fingerprint; - } - - /** - * Sets Fingerprint. - * Intended as a Square-assigned identifier, based - * on the card number, to identify the card across multiple locations within a - * single application. - * - * @maps fingerprint - */ - public function setFingerprint(?string $fingerprint): void - { - $this->fingerprint = $fingerprint; - } - - /** - * Returns Customer Id. - * **Required** The ID of a customer created using the Customers API to be associated with the card. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * **Required** The ID of a customer created using the Customers API to be associated with the card. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * **Required** The ID of a customer created using the Customers API to be associated with the card. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Merchant Id. - * The ID of the merchant associated with the card. - */ - public function getMerchantId(): ?string - { - return $this->merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the merchant associated with the card. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Reference Id. - * An optional user-defined reference ID that associates this card with - * another entity in an external system. For example, a customer ID from an - * external customer management system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional user-defined reference ID that associates this card with - * another entity in an external system. For example, a customer ID from an - * external customer management system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional user-defined reference ID that associates this card with - * another entity in an external system. For example, a customer ID from an - * external customer management system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Enabled. - * Indicates whether or not a card can be used for payments. - */ - public function getEnabled(): ?bool - { - return $this->enabled; - } - - /** - * Sets Enabled. - * Indicates whether or not a card can be used for payments. - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled = $enabled; - } - - /** - * Returns Card Type. - * Indicates a card's type, such as `CREDIT` or `DEBIT`. - */ - public function getCardType(): ?string - { - return $this->cardType; - } - - /** - * Sets Card Type. - * Indicates a card's type, such as `CREDIT` or `DEBIT`. - * - * @maps card_type - */ - public function setCardType(?string $cardType): void - { - $this->cardType = $cardType; - } - - /** - * Returns Prepaid Type. - * Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. - */ - public function getPrepaidType(): ?string - { - return $this->prepaidType; - } - - /** - * Sets Prepaid Type. - * Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. - * - * @maps prepaid_type - */ - public function setPrepaidType(?string $prepaidType): void - { - $this->prepaidType = $prepaidType; - } - - /** - * Returns Bin. - * The first six digits of the card number, known as the Bank Identification Number (BIN). Only the - * Payments API - * returns this field. - */ - public function getBin(): ?string - { - return $this->bin; - } - - /** - * Sets Bin. - * The first six digits of the card number, known as the Bank Identification Number (BIN). Only the - * Payments API - * returns this field. - * - * @maps bin - */ - public function setBin(?string $bin): void - { - $this->bin = $bin; - } - - /** - * Returns Version. - * Current version number of the card. Increments with each card update. Requests to update an - * existing Card object will be rejected unless the version in the request matches the current - * version for the Card. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Current version number of the card. Increments with each card update. Requests to update an - * existing Card object will be rejected unless the version in the request matches the current - * version for the Card. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Card Co Brand. - * Indicates the brand for a co-branded card. - */ - public function getCardCoBrand(): ?string - { - return $this->cardCoBrand; - } - - /** - * Sets Card Co Brand. - * Indicates the brand for a co-branded card. - * - * @maps card_co_brand - */ - public function setCardCoBrand(?string $cardCoBrand): void - { - $this->cardCoBrand = $cardCoBrand; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->cardBrand)) { - $json['card_brand'] = $this->cardBrand; - } - if (isset($this->last4)) { - $json['last_4'] = $this->last4; - } - if (!empty($this->expMonth)) { - $json['exp_month'] = $this->expMonth['value']; - } - if (!empty($this->expYear)) { - $json['exp_year'] = $this->expYear['value']; - } - if (!empty($this->cardholderName)) { - $json['cardholder_name'] = $this->cardholderName['value']; - } - if (isset($this->billingAddress)) { - $json['billing_address'] = $this->billingAddress; - } - if (isset($this->fingerprint)) { - $json['fingerprint'] = $this->fingerprint; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (isset($this->merchantId)) { - $json['merchant_id'] = $this->merchantId; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->enabled)) { - $json['enabled'] = $this->enabled; - } - if (isset($this->cardType)) { - $json['card_type'] = $this->cardType; - } - if (isset($this->prepaidType)) { - $json['prepaid_type'] = $this->prepaidType; - } - if (isset($this->bin)) { - $json['bin'] = $this->bin; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->cardCoBrand)) { - $json['card_co_brand'] = $this->cardCoBrand; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CardBrand.php b/src/Models/CardBrand.php deleted file mode 100644 index 85337077..00000000 --- a/src/Models/CardBrand.php +++ /dev/null @@ -1,39 +0,0 @@ -status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or - * FAILED. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or - * FAILED. - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Returns Entry Method. - * The method used to enter the card's details for the payment. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - */ - public function getEntryMethod(): ?string - { - if (count($this->entryMethod) == 0) { - return null; - } - return $this->entryMethod['value']; - } - - /** - * Sets Entry Method. - * The method used to enter the card's details for the payment. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - * - * @maps entry_method - */ - public function setEntryMethod(?string $entryMethod): void - { - $this->entryMethod['value'] = $entryMethod; - } - - /** - * Unsets Entry Method. - * The method used to enter the card's details for the payment. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - */ - public function unsetEntryMethod(): void - { - $this->entryMethod = []; - } - - /** - * Returns Cvv Status. - * The status code returned from the Card Verification Value (CVV) check. The code can be - * `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. - */ - public function getCvvStatus(): ?string - { - if (count($this->cvvStatus) == 0) { - return null; - } - return $this->cvvStatus['value']; - } - - /** - * Sets Cvv Status. - * The status code returned from the Card Verification Value (CVV) check. The code can be - * `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. - * - * @maps cvv_status - */ - public function setCvvStatus(?string $cvvStatus): void - { - $this->cvvStatus['value'] = $cvvStatus; - } - - /** - * Unsets Cvv Status. - * The status code returned from the Card Verification Value (CVV) check. The code can be - * `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. - */ - public function unsetCvvStatus(): void - { - $this->cvvStatus = []; - } - - /** - * Returns Avs Status. - * The status code returned from the Address Verification System (AVS) check. The code can be - * `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. - */ - public function getAvsStatus(): ?string - { - if (count($this->avsStatus) == 0) { - return null; - } - return $this->avsStatus['value']; - } - - /** - * Sets Avs Status. - * The status code returned from the Address Verification System (AVS) check. The code can be - * `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. - * - * @maps avs_status - */ - public function setAvsStatus(?string $avsStatus): void - { - $this->avsStatus['value'] = $avsStatus; - } - - /** - * Unsets Avs Status. - * The status code returned from the Address Verification System (AVS) check. The code can be - * `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. - */ - public function unsetAvsStatus(): void - { - $this->avsStatus = []; - } - - /** - * Returns Auth Result Code. - * The status code returned by the card issuer that describes the payment's - * authorization status. - */ - public function getAuthResultCode(): ?string - { - if (count($this->authResultCode) == 0) { - return null; - } - return $this->authResultCode['value']; - } - - /** - * Sets Auth Result Code. - * The status code returned by the card issuer that describes the payment's - * authorization status. - * - * @maps auth_result_code - */ - public function setAuthResultCode(?string $authResultCode): void - { - $this->authResultCode['value'] = $authResultCode; - } - - /** - * Unsets Auth Result Code. - * The status code returned by the card issuer that describes the payment's - * authorization status. - */ - public function unsetAuthResultCode(): void - { - $this->authResultCode = []; - } - - /** - * Returns Application Identifier. - * For EMV payments, the application ID identifies the EMV application used for the payment. - */ - public function getApplicationIdentifier(): ?string - { - if (count($this->applicationIdentifier) == 0) { - return null; - } - return $this->applicationIdentifier['value']; - } - - /** - * Sets Application Identifier. - * For EMV payments, the application ID identifies the EMV application used for the payment. - * - * @maps application_identifier - */ - public function setApplicationIdentifier(?string $applicationIdentifier): void - { - $this->applicationIdentifier['value'] = $applicationIdentifier; - } - - /** - * Unsets Application Identifier. - * For EMV payments, the application ID identifies the EMV application used for the payment. - */ - public function unsetApplicationIdentifier(): void - { - $this->applicationIdentifier = []; - } - - /** - * Returns Application Name. - * For EMV payments, the human-readable name of the EMV application used for the payment. - */ - public function getApplicationName(): ?string - { - if (count($this->applicationName) == 0) { - return null; - } - return $this->applicationName['value']; - } - - /** - * Sets Application Name. - * For EMV payments, the human-readable name of the EMV application used for the payment. - * - * @maps application_name - */ - public function setApplicationName(?string $applicationName): void - { - $this->applicationName['value'] = $applicationName; - } - - /** - * Unsets Application Name. - * For EMV payments, the human-readable name of the EMV application used for the payment. - */ - public function unsetApplicationName(): void - { - $this->applicationName = []; - } - - /** - * Returns Application Cryptogram. - * For EMV payments, the cryptogram generated for the payment. - */ - public function getApplicationCryptogram(): ?string - { - if (count($this->applicationCryptogram) == 0) { - return null; - } - return $this->applicationCryptogram['value']; - } - - /** - * Sets Application Cryptogram. - * For EMV payments, the cryptogram generated for the payment. - * - * @maps application_cryptogram - */ - public function setApplicationCryptogram(?string $applicationCryptogram): void - { - $this->applicationCryptogram['value'] = $applicationCryptogram; - } - - /** - * Unsets Application Cryptogram. - * For EMV payments, the cryptogram generated for the payment. - */ - public function unsetApplicationCryptogram(): void - { - $this->applicationCryptogram = []; - } - - /** - * Returns Verification Method. - * For EMV payments, the method used to verify the cardholder's identity. The method can be - * `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. - */ - public function getVerificationMethod(): ?string - { - if (count($this->verificationMethod) == 0) { - return null; - } - return $this->verificationMethod['value']; - } - - /** - * Sets Verification Method. - * For EMV payments, the method used to verify the cardholder's identity. The method can be - * `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. - * - * @maps verification_method - */ - public function setVerificationMethod(?string $verificationMethod): void - { - $this->verificationMethod['value'] = $verificationMethod; - } - - /** - * Unsets Verification Method. - * For EMV payments, the method used to verify the cardholder's identity. The method can be - * `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. - */ - public function unsetVerificationMethod(): void - { - $this->verificationMethod = []; - } - - /** - * Returns Verification Results. - * For EMV payments, the results of the cardholder verification. The result can be - * `SUCCESS`, `FAILURE`, or `UNKNOWN`. - */ - public function getVerificationResults(): ?string - { - if (count($this->verificationResults) == 0) { - return null; - } - return $this->verificationResults['value']; - } - - /** - * Sets Verification Results. - * For EMV payments, the results of the cardholder verification. The result can be - * `SUCCESS`, `FAILURE`, or `UNKNOWN`. - * - * @maps verification_results - */ - public function setVerificationResults(?string $verificationResults): void - { - $this->verificationResults['value'] = $verificationResults; - } - - /** - * Unsets Verification Results. - * For EMV payments, the results of the cardholder verification. The result can be - * `SUCCESS`, `FAILURE`, or `UNKNOWN`. - */ - public function unsetVerificationResults(): void - { - $this->verificationResults = []; - } - - /** - * Returns Statement Description. - * The statement description sent to the card networks. - * - * Note: The actual statement description varies and is likely to be truncated and appended with - * additional information on a per issuer basis. - */ - public function getStatementDescription(): ?string - { - if (count($this->statementDescription) == 0) { - return null; - } - return $this->statementDescription['value']; - } - - /** - * Sets Statement Description. - * The statement description sent to the card networks. - * - * Note: The actual statement description varies and is likely to be truncated and appended with - * additional information on a per issuer basis. - * - * @maps statement_description - */ - public function setStatementDescription(?string $statementDescription): void - { - $this->statementDescription['value'] = $statementDescription; - } - - /** - * Unsets Statement Description. - * The statement description sent to the card networks. - * - * Note: The actual statement description varies and is likely to be truncated and appended with - * additional information on a per issuer basis. - */ - public function unsetStatementDescription(): void - { - $this->statementDescription = []; - } - - /** - * Returns Device Details. - * Details about the device that took the payment. - */ - public function getDeviceDetails(): ?DeviceDetails - { - return $this->deviceDetails; - } - - /** - * Sets Device Details. - * Details about the device that took the payment. - * - * @maps device_details - */ - public function setDeviceDetails(?DeviceDetails $deviceDetails): void - { - $this->deviceDetails = $deviceDetails; - } - - /** - * Returns Card Payment Timeline. - * The timeline for card payments. - */ - public function getCardPaymentTimeline(): ?CardPaymentTimeline - { - return $this->cardPaymentTimeline; - } - - /** - * Sets Card Payment Timeline. - * The timeline for card payments. - * - * @maps card_payment_timeline - */ - public function setCardPaymentTimeline(?CardPaymentTimeline $cardPaymentTimeline): void - { - $this->cardPaymentTimeline = $cardPaymentTimeline; - } - - /** - * Returns Refund Requires Card Presence. - * Whether the card must be physically present for the payment to - * be refunded. If set to `true`, the card must be present. - */ - public function getRefundRequiresCardPresence(): ?bool - { - if (count($this->refundRequiresCardPresence) == 0) { - return null; - } - return $this->refundRequiresCardPresence['value']; - } - - /** - * Sets Refund Requires Card Presence. - * Whether the card must be physically present for the payment to - * be refunded. If set to `true`, the card must be present. - * - * @maps refund_requires_card_presence - */ - public function setRefundRequiresCardPresence(?bool $refundRequiresCardPresence): void - { - $this->refundRequiresCardPresence['value'] = $refundRequiresCardPresence; - } - - /** - * Unsets Refund Requires Card Presence. - * Whether the card must be physically present for the payment to - * be refunded. If set to `true`, the card must be present. - */ - public function unsetRefundRequiresCardPresence(): void - { - $this->refundRequiresCardPresence = []; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - if (count($this->errors) == 0) { - return null; - } - return $this->errors['value']; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors['value'] = $errors; - } - - /** - * Unsets Errors. - * Information about errors encountered during the request. - */ - public function unsetErrors(): void - { - $this->errors = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - if (!empty($this->entryMethod)) { - $json['entry_method'] = $this->entryMethod['value']; - } - if (!empty($this->cvvStatus)) { - $json['cvv_status'] = $this->cvvStatus['value']; - } - if (!empty($this->avsStatus)) { - $json['avs_status'] = $this->avsStatus['value']; - } - if (!empty($this->authResultCode)) { - $json['auth_result_code'] = $this->authResultCode['value']; - } - if (!empty($this->applicationIdentifier)) { - $json['application_identifier'] = $this->applicationIdentifier['value']; - } - if (!empty($this->applicationName)) { - $json['application_name'] = $this->applicationName['value']; - } - if (!empty($this->applicationCryptogram)) { - $json['application_cryptogram'] = $this->applicationCryptogram['value']; - } - if (!empty($this->verificationMethod)) { - $json['verification_method'] = $this->verificationMethod['value']; - } - if (!empty($this->verificationResults)) { - $json['verification_results'] = $this->verificationResults['value']; - } - if (!empty($this->statementDescription)) { - $json['statement_description'] = $this->statementDescription['value']; - } - if (isset($this->deviceDetails)) { - $json['device_details'] = $this->deviceDetails; - } - if (isset($this->cardPaymentTimeline)) { - $json['card_payment_timeline'] = $this->cardPaymentTimeline; - } - if (!empty($this->refundRequiresCardPresence)) { - $json['refund_requires_card_presence'] = $this->refundRequiresCardPresence['value']; - } - if (!empty($this->errors)) { - $json['errors'] = $this->errors['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CardPaymentTimeline.php b/src/Models/CardPaymentTimeline.php deleted file mode 100644 index e480654d..00000000 --- a/src/Models/CardPaymentTimeline.php +++ /dev/null @@ -1,152 +0,0 @@ -authorizedAt) == 0) { - return null; - } - return $this->authorizedAt['value']; - } - - /** - * Sets Authorized At. - * The timestamp when the payment was authorized, in RFC 3339 format. - * - * @maps authorized_at - */ - public function setAuthorizedAt(?string $authorizedAt): void - { - $this->authorizedAt['value'] = $authorizedAt; - } - - /** - * Unsets Authorized At. - * The timestamp when the payment was authorized, in RFC 3339 format. - */ - public function unsetAuthorizedAt(): void - { - $this->authorizedAt = []; - } - - /** - * Returns Captured At. - * The timestamp when the payment was captured, in RFC 3339 format. - */ - public function getCapturedAt(): ?string - { - if (count($this->capturedAt) == 0) { - return null; - } - return $this->capturedAt['value']; - } - - /** - * Sets Captured At. - * The timestamp when the payment was captured, in RFC 3339 format. - * - * @maps captured_at - */ - public function setCapturedAt(?string $capturedAt): void - { - $this->capturedAt['value'] = $capturedAt; - } - - /** - * Unsets Captured At. - * The timestamp when the payment was captured, in RFC 3339 format. - */ - public function unsetCapturedAt(): void - { - $this->capturedAt = []; - } - - /** - * Returns Voided At. - * The timestamp when the payment was voided, in RFC 3339 format. - */ - public function getVoidedAt(): ?string - { - if (count($this->voidedAt) == 0) { - return null; - } - return $this->voidedAt['value']; - } - - /** - * Sets Voided At. - * The timestamp when the payment was voided, in RFC 3339 format. - * - * @maps voided_at - */ - public function setVoidedAt(?string $voidedAt): void - { - $this->voidedAt['value'] = $voidedAt; - } - - /** - * Unsets Voided At. - * The timestamp when the payment was voided, in RFC 3339 format. - */ - public function unsetVoidedAt(): void - { - $this->voidedAt = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->authorizedAt)) { - $json['authorized_at'] = $this->authorizedAt['value']; - } - if (!empty($this->capturedAt)) { - $json['captured_at'] = $this->capturedAt['value']; - } - if (!empty($this->voidedAt)) { - $json['voided_at'] = $this->voidedAt['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CardPrepaidType.php b/src/Models/CardPrepaidType.php deleted file mode 100644 index d28a7b21..00000000 --- a/src/Models/CardPrepaidType.php +++ /dev/null @@ -1,17 +0,0 @@ -buyerFullName) == 0) { - return null; - } - return $this->buyerFullName['value']; - } - - /** - * Sets Buyer Full Name. - * The name of the Cash App account holder. - * - * @maps buyer_full_name - */ - public function setBuyerFullName(?string $buyerFullName): void - { - $this->buyerFullName['value'] = $buyerFullName; - } - - /** - * Unsets Buyer Full Name. - * The name of the Cash App account holder. - */ - public function unsetBuyerFullName(): void - { - $this->buyerFullName = []; - } - - /** - * Returns Buyer Country Code. - * The country of the Cash App account holder, in ISO 3166-1-alpha-2 format. - * - * For possible values, see [Country](entity:Country). - */ - public function getBuyerCountryCode(): ?string - { - if (count($this->buyerCountryCode) == 0) { - return null; - } - return $this->buyerCountryCode['value']; - } - - /** - * Sets Buyer Country Code. - * The country of the Cash App account holder, in ISO 3166-1-alpha-2 format. - * - * For possible values, see [Country](entity:Country). - * - * @maps buyer_country_code - */ - public function setBuyerCountryCode(?string $buyerCountryCode): void - { - $this->buyerCountryCode['value'] = $buyerCountryCode; - } - - /** - * Unsets Buyer Country Code. - * The country of the Cash App account holder, in ISO 3166-1-alpha-2 format. - * - * For possible values, see [Country](entity:Country). - */ - public function unsetBuyerCountryCode(): void - { - $this->buyerCountryCode = []; - } - - /** - * Returns Buyer Cashtag. - * $Cashtag of the Cash App account holder. - */ - public function getBuyerCashtag(): ?string - { - return $this->buyerCashtag; - } - - /** - * Sets Buyer Cashtag. - * $Cashtag of the Cash App account holder. - * - * @maps buyer_cashtag - */ - public function setBuyerCashtag(?string $buyerCashtag): void - { - $this->buyerCashtag = $buyerCashtag; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->buyerFullName)) { - $json['buyer_full_name'] = $this->buyerFullName['value']; - } - if (!empty($this->buyerCountryCode)) { - $json['buyer_country_code'] = $this->buyerCountryCode['value']; - } - if (isset($this->buyerCashtag)) { - $json['buyer_cashtag'] = $this->buyerCashtag; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CashDrawerDevice.php b/src/Models/CashDrawerDevice.php deleted file mode 100644 index 8dfa14e7..00000000 --- a/src/Models/CashDrawerDevice.php +++ /dev/null @@ -1,97 +0,0 @@ -id; - } - - /** - * Sets Id. - * The device Square-issued ID - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The device merchant-specified name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The device merchant-specified name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The device merchant-specified name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CashDrawerEventType.php b/src/Models/CashDrawerEventType.php deleted file mode 100644 index 6819de5a..00000000 --- a/src/Models/CashDrawerEventType.php +++ /dev/null @@ -1,75 +0,0 @@ -id; - } - - /** - * Sets Id. - * The shift unique ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns State. - * The current state of a cash drawer shift. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The current state of a cash drawer shift. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Opened At. - * The time when the shift began, in ISO 8601 format. - */ - public function getOpenedAt(): ?string - { - if (count($this->openedAt) == 0) { - return null; - } - return $this->openedAt['value']; - } - - /** - * Sets Opened At. - * The time when the shift began, in ISO 8601 format. - * - * @maps opened_at - */ - public function setOpenedAt(?string $openedAt): void - { - $this->openedAt['value'] = $openedAt; - } - - /** - * Unsets Opened At. - * The time when the shift began, in ISO 8601 format. - */ - public function unsetOpenedAt(): void - { - $this->openedAt = []; - } - - /** - * Returns Ended At. - * The time when the shift ended, in ISO 8601 format. - */ - public function getEndedAt(): ?string - { - if (count($this->endedAt) == 0) { - return null; - } - return $this->endedAt['value']; - } - - /** - * Sets Ended At. - * The time when the shift ended, in ISO 8601 format. - * - * @maps ended_at - */ - public function setEndedAt(?string $endedAt): void - { - $this->endedAt['value'] = $endedAt; - } - - /** - * Unsets Ended At. - * The time when the shift ended, in ISO 8601 format. - */ - public function unsetEndedAt(): void - { - $this->endedAt = []; - } - - /** - * Returns Closed At. - * The time when the shift was closed, in ISO 8601 format. - */ - public function getClosedAt(): ?string - { - if (count($this->closedAt) == 0) { - return null; - } - return $this->closedAt['value']; - } - - /** - * Sets Closed At. - * The time when the shift was closed, in ISO 8601 format. - * - * @maps closed_at - */ - public function setClosedAt(?string $closedAt): void - { - $this->closedAt['value'] = $closedAt; - } - - /** - * Unsets Closed At. - * The time when the shift was closed, in ISO 8601 format. - */ - public function unsetClosedAt(): void - { - $this->closedAt = []; - } - - /** - * Returns Description. - * The free-form text description of a cash drawer by an employee. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The free-form text description of a cash drawer by an employee. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The free-form text description of a cash drawer by an employee. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Opened Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getOpenedCashMoney(): ?Money - { - return $this->openedCashMoney; - } - - /** - * Sets Opened Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps opened_cash_money - */ - public function setOpenedCashMoney(?Money $openedCashMoney): void - { - $this->openedCashMoney = $openedCashMoney; - } - - /** - * Returns Cash Payment Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCashPaymentMoney(): ?Money - { - return $this->cashPaymentMoney; - } - - /** - * Sets Cash Payment Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps cash_payment_money - */ - public function setCashPaymentMoney(?Money $cashPaymentMoney): void - { - $this->cashPaymentMoney = $cashPaymentMoney; - } - - /** - * Returns Cash Refunds Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCashRefundsMoney(): ?Money - { - return $this->cashRefundsMoney; - } - - /** - * Sets Cash Refunds Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps cash_refunds_money - */ - public function setCashRefundsMoney(?Money $cashRefundsMoney): void - { - $this->cashRefundsMoney = $cashRefundsMoney; - } - - /** - * Returns Cash Paid in Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCashPaidInMoney(): ?Money - { - return $this->cashPaidInMoney; - } - - /** - * Sets Cash Paid in Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps cash_paid_in_money - */ - public function setCashPaidInMoney(?Money $cashPaidInMoney): void - { - $this->cashPaidInMoney = $cashPaidInMoney; - } - - /** - * Returns Cash Paid Out Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCashPaidOutMoney(): ?Money - { - return $this->cashPaidOutMoney; - } - - /** - * Sets Cash Paid Out Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps cash_paid_out_money - */ - public function setCashPaidOutMoney(?Money $cashPaidOutMoney): void - { - $this->cashPaidOutMoney = $cashPaidOutMoney; - } - - /** - * Returns Expected Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getExpectedCashMoney(): ?Money - { - return $this->expectedCashMoney; - } - - /** - * Sets Expected Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps expected_cash_money - */ - public function setExpectedCashMoney(?Money $expectedCashMoney): void - { - $this->expectedCashMoney = $expectedCashMoney; - } - - /** - * Returns Closed Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getClosedCashMoney(): ?Money - { - return $this->closedCashMoney; - } - - /** - * Sets Closed Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps closed_cash_money - */ - public function setClosedCashMoney(?Money $closedCashMoney): void - { - $this->closedCashMoney = $closedCashMoney; - } - - /** - * Returns Device. - */ - public function getDevice(): ?CashDrawerDevice - { - return $this->device; - } - - /** - * Sets Device. - * - * @maps device - */ - public function setDevice(?CashDrawerDevice $device): void - { - $this->device = $device; - } - - /** - * Returns Created At. - * The shift start time in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The shift start time in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The shift updated at time in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The shift updated at time in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Location Id. - * The ID of the location the cash drawer shift belongs to. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location the cash drawer shift belongs to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Team Member Ids. - * The IDs of all team members that were logged into Square Point of Sale at any - * point while the cash drawer shift was open. - * - * @return string[]|null - */ - public function getTeamMemberIds(): ?array - { - return $this->teamMemberIds; - } - - /** - * Sets Team Member Ids. - * The IDs of all team members that were logged into Square Point of Sale at any - * point while the cash drawer shift was open. - * - * @maps team_member_ids - * - * @param string[]|null $teamMemberIds - */ - public function setTeamMemberIds(?array $teamMemberIds): void - { - $this->teamMemberIds = $teamMemberIds; - } - - /** - * Returns Opening Team Member Id. - * The ID of the team member that started the cash drawer shift. - */ - public function getOpeningTeamMemberId(): ?string - { - return $this->openingTeamMemberId; - } - - /** - * Sets Opening Team Member Id. - * The ID of the team member that started the cash drawer shift. - * - * @maps opening_team_member_id - */ - public function setOpeningTeamMemberId(?string $openingTeamMemberId): void - { - $this->openingTeamMemberId = $openingTeamMemberId; - } - - /** - * Returns Ending Team Member Id. - * The ID of the team member that ended the cash drawer shift. - */ - public function getEndingTeamMemberId(): ?string - { - return $this->endingTeamMemberId; - } - - /** - * Sets Ending Team Member Id. - * The ID of the team member that ended the cash drawer shift. - * - * @maps ending_team_member_id - */ - public function setEndingTeamMemberId(?string $endingTeamMemberId): void - { - $this->endingTeamMemberId = $endingTeamMemberId; - } - - /** - * Returns Closing Team Member Id. - * The ID of the team member that closed the cash drawer shift by auditing - * the cash drawer contents. - */ - public function getClosingTeamMemberId(): ?string - { - return $this->closingTeamMemberId; - } - - /** - * Sets Closing Team Member Id. - * The ID of the team member that closed the cash drawer shift by auditing - * the cash drawer contents. - * - * @maps closing_team_member_id - */ - public function setClosingTeamMemberId(?string $closingTeamMemberId): void - { - $this->closingTeamMemberId = $closingTeamMemberId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->openedAt)) { - $json['opened_at'] = $this->openedAt['value']; - } - if (!empty($this->endedAt)) { - $json['ended_at'] = $this->endedAt['value']; - } - if (!empty($this->closedAt)) { - $json['closed_at'] = $this->closedAt['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->openedCashMoney)) { - $json['opened_cash_money'] = $this->openedCashMoney; - } - if (isset($this->cashPaymentMoney)) { - $json['cash_payment_money'] = $this->cashPaymentMoney; - } - if (isset($this->cashRefundsMoney)) { - $json['cash_refunds_money'] = $this->cashRefundsMoney; - } - if (isset($this->cashPaidInMoney)) { - $json['cash_paid_in_money'] = $this->cashPaidInMoney; - } - if (isset($this->cashPaidOutMoney)) { - $json['cash_paid_out_money'] = $this->cashPaidOutMoney; - } - if (isset($this->expectedCashMoney)) { - $json['expected_cash_money'] = $this->expectedCashMoney; - } - if (isset($this->closedCashMoney)) { - $json['closed_cash_money'] = $this->closedCashMoney; - } - if (isset($this->device)) { - $json['device'] = $this->device; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->teamMemberIds)) { - $json['team_member_ids'] = $this->teamMemberIds; - } - if (isset($this->openingTeamMemberId)) { - $json['opening_team_member_id'] = $this->openingTeamMemberId; - } - if (isset($this->endingTeamMemberId)) { - $json['ending_team_member_id'] = $this->endingTeamMemberId; - } - if (isset($this->closingTeamMemberId)) { - $json['closing_team_member_id'] = $this->closingTeamMemberId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CashDrawerShiftEvent.php b/src/Models/CashDrawerShiftEvent.php deleted file mode 100644 index e1c09056..00000000 --- a/src/Models/CashDrawerShiftEvent.php +++ /dev/null @@ -1,228 +0,0 @@ -id; - } - - /** - * Sets Id. - * The unique ID of the event. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Event Type. - * The types of events on a CashDrawerShift. - * Each event type represents an employee action on the actual cash drawer - * represented by a CashDrawerShift. - */ - public function getEventType(): ?string - { - return $this->eventType; - } - - /** - * Sets Event Type. - * The types of events on a CashDrawerShift. - * Each event type represents an employee action on the actual cash drawer - * represented by a CashDrawerShift. - * - * @maps event_type - */ - public function setEventType(?string $eventType): void - { - $this->eventType = $eventType; - } - - /** - * Returns Event Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getEventMoney(): ?Money - { - return $this->eventMoney; - } - - /** - * Sets Event Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps event_money - */ - public function setEventMoney(?Money $eventMoney): void - { - $this->eventMoney = $eventMoney; - } - - /** - * Returns Created At. - * The event time in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The event time in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Description. - * An optional description of the event, entered by the employee that - * created the event. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * An optional description of the event, entered by the employee that - * created the event. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * An optional description of the event, entered by the employee that - * created the event. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Team Member Id. - * The ID of the team member that created the event. - */ - public function getTeamMemberId(): ?string - { - return $this->teamMemberId; - } - - /** - * Sets Team Member Id. - * The ID of the team member that created the event. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->eventType)) { - $json['event_type'] = $this->eventType; - } - if (isset($this->eventMoney)) { - $json['event_money'] = $this->eventMoney; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CashDrawerShiftState.php b/src/Models/CashDrawerShiftState.php deleted file mode 100644 index 3810b461..00000000 --- a/src/Models/CashDrawerShiftState.php +++ /dev/null @@ -1,27 +0,0 @@ -id; - } - - /** - * Sets Id. - * The shift unique ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns State. - * The current state of a cash drawer shift. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The current state of a cash drawer shift. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Opened At. - * The shift start time in ISO 8601 format. - */ - public function getOpenedAt(): ?string - { - if (count($this->openedAt) == 0) { - return null; - } - return $this->openedAt['value']; - } - - /** - * Sets Opened At. - * The shift start time in ISO 8601 format. - * - * @maps opened_at - */ - public function setOpenedAt(?string $openedAt): void - { - $this->openedAt['value'] = $openedAt; - } - - /** - * Unsets Opened At. - * The shift start time in ISO 8601 format. - */ - public function unsetOpenedAt(): void - { - $this->openedAt = []; - } - - /** - * Returns Ended At. - * The shift end time in ISO 8601 format. - */ - public function getEndedAt(): ?string - { - if (count($this->endedAt) == 0) { - return null; - } - return $this->endedAt['value']; - } - - /** - * Sets Ended At. - * The shift end time in ISO 8601 format. - * - * @maps ended_at - */ - public function setEndedAt(?string $endedAt): void - { - $this->endedAt['value'] = $endedAt; - } - - /** - * Unsets Ended At. - * The shift end time in ISO 8601 format. - */ - public function unsetEndedAt(): void - { - $this->endedAt = []; - } - - /** - * Returns Closed At. - * The shift close time in ISO 8601 format. - */ - public function getClosedAt(): ?string - { - if (count($this->closedAt) == 0) { - return null; - } - return $this->closedAt['value']; - } - - /** - * Sets Closed At. - * The shift close time in ISO 8601 format. - * - * @maps closed_at - */ - public function setClosedAt(?string $closedAt): void - { - $this->closedAt['value'] = $closedAt; - } - - /** - * Unsets Closed At. - * The shift close time in ISO 8601 format. - */ - public function unsetClosedAt(): void - { - $this->closedAt = []; - } - - /** - * Returns Description. - * An employee free-text description of a cash drawer shift. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * An employee free-text description of a cash drawer shift. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * An employee free-text description of a cash drawer shift. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Opened Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getOpenedCashMoney(): ?Money - { - return $this->openedCashMoney; - } - - /** - * Sets Opened Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps opened_cash_money - */ - public function setOpenedCashMoney(?Money $openedCashMoney): void - { - $this->openedCashMoney = $openedCashMoney; - } - - /** - * Returns Expected Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getExpectedCashMoney(): ?Money - { - return $this->expectedCashMoney; - } - - /** - * Sets Expected Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps expected_cash_money - */ - public function setExpectedCashMoney(?Money $expectedCashMoney): void - { - $this->expectedCashMoney = $expectedCashMoney; - } - - /** - * Returns Closed Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getClosedCashMoney(): ?Money - { - return $this->closedCashMoney; - } - - /** - * Sets Closed Cash Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps closed_cash_money - */ - public function setClosedCashMoney(?Money $closedCashMoney): void - { - $this->closedCashMoney = $closedCashMoney; - } - - /** - * Returns Created At. - * The shift start time in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The shift start time in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The shift updated at time in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The shift updated at time in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Location Id. - * The ID of the location the cash drawer shift belongs to. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location the cash drawer shift belongs to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->openedAt)) { - $json['opened_at'] = $this->openedAt['value']; - } - if (!empty($this->endedAt)) { - $json['ended_at'] = $this->endedAt['value']; - } - if (!empty($this->closedAt)) { - $json['closed_at'] = $this->closedAt['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->openedCashMoney)) { - $json['opened_cash_money'] = $this->openedCashMoney; - } - if (isset($this->expectedCashMoney)) { - $json['expected_cash_money'] = $this->expectedCashMoney; - } - if (isset($this->closedCashMoney)) { - $json['closed_cash_money'] = $this->closedCashMoney; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CashPaymentDetails.php b/src/Models/CashPaymentDetails.php deleted file mode 100644 index a784b64a..00000000 --- a/src/Models/CashPaymentDetails.php +++ /dev/null @@ -1,121 +0,0 @@ -buyerSuppliedMoney = $buyerSuppliedMoney; - } - - /** - * Returns Buyer Supplied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBuyerSuppliedMoney(): Money - { - return $this->buyerSuppliedMoney; - } - - /** - * Sets Buyer Supplied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps buyer_supplied_money - */ - public function setBuyerSuppliedMoney(Money $buyerSuppliedMoney): void - { - $this->buyerSuppliedMoney = $buyerSuppliedMoney; - } - - /** - * Returns Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getChangeBackMoney(): ?Money - { - return $this->changeBackMoney; - } - - /** - * Sets Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps change_back_money - */ - public function setChangeBackMoney(?Money $changeBackMoney): void - { - $this->changeBackMoney = $changeBackMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['buyer_supplied_money'] = $this->buyerSuppliedMoney; - if (isset($this->changeBackMoney)) { - $json['change_back_money'] = $this->changeBackMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogAvailabilityPeriod.php b/src/Models/CatalogAvailabilityPeriod.php deleted file mode 100644 index f5d7ffcb..00000000 --- a/src/Models/CatalogAvailabilityPeriod.php +++ /dev/null @@ -1,152 +0,0 @@ -startLocalTime) == 0) { - return null; - } - return $this->startLocalTime['value']; - } - - /** - * Sets Start Local Time. - * The start time of an availability period, specified in local time using partial-time - * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - * - * @maps start_local_time - */ - public function setStartLocalTime(?string $startLocalTime): void - { - $this->startLocalTime['value'] = $startLocalTime; - } - - /** - * Unsets Start Local Time. - * The start time of an availability period, specified in local time using partial-time - * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function unsetStartLocalTime(): void - { - $this->startLocalTime = []; - } - - /** - * Returns End Local Time. - * The end time of an availability period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function getEndLocalTime(): ?string - { - if (count($this->endLocalTime) == 0) { - return null; - } - return $this->endLocalTime['value']; - } - - /** - * Sets End Local Time. - * The end time of an availability period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - * - * @maps end_local_time - */ - public function setEndLocalTime(?string $endLocalTime): void - { - $this->endLocalTime['value'] = $endLocalTime; - } - - /** - * Unsets End Local Time. - * The end time of an availability period, specified in local time using partial-time - * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. - * Note that the seconds value is always :00, but it is appended for conformance to the RFC. - */ - public function unsetEndLocalTime(): void - { - $this->endLocalTime = []; - } - - /** - * Returns Day of Week. - * Indicates the specific day of the week. - */ - public function getDayOfWeek(): ?string - { - return $this->dayOfWeek; - } - - /** - * Sets Day of Week. - * Indicates the specific day of the week. - * - * @maps day_of_week - */ - public function setDayOfWeek(?string $dayOfWeek): void - { - $this->dayOfWeek = $dayOfWeek; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->startLocalTime)) { - $json['start_local_time'] = $this->startLocalTime['value']; - } - if (!empty($this->endLocalTime)) { - $json['end_local_time'] = $this->endLocalTime['value']; - } - if (isset($this->dayOfWeek)) { - $json['day_of_week'] = $this->dayOfWeek; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCategory.php b/src/Models/CatalogCategory.php deleted file mode 100644 index b984f901..00000000 --- a/src/Models/CatalogCategory.php +++ /dev/null @@ -1,465 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The category name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The category name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Image Ids. - * The IDs of images associated with this `CatalogCategory` instance. - * Currently these images are not displayed by Square, but are free to be displayed in 3rd party - * applications. - * - * @return string[]|null - */ - public function getImageIds(): ?array - { - if (count($this->imageIds) == 0) { - return null; - } - return $this->imageIds['value']; - } - - /** - * Sets Image Ids. - * The IDs of images associated with this `CatalogCategory` instance. - * Currently these images are not displayed by Square, but are free to be displayed in 3rd party - * applications. - * - * @maps image_ids - * - * @param string[]|null $imageIds - */ - public function setImageIds(?array $imageIds): void - { - $this->imageIds['value'] = $imageIds; - } - - /** - * Unsets Image Ids. - * The IDs of images associated with this `CatalogCategory` instance. - * Currently these images are not displayed by Square, but are free to be displayed in 3rd party - * applications. - */ - public function unsetImageIds(): void - { - $this->imageIds = []; - } - - /** - * Returns Category Type. - * Indicates the type of a category. - */ - public function getCategoryType(): ?string - { - return $this->categoryType; - } - - /** - * Sets Category Type. - * Indicates the type of a category. - * - * @maps category_type - */ - public function setCategoryType(?string $categoryType): void - { - $this->categoryType = $categoryType; - } - - /** - * Returns Parent Category. - * A category that can be assigned to an item or a parent category that can be assigned - * to another category. For example, a clothing category can be assigned to a t-shirt item or - * be made as the parent category to the pants category. - */ - public function getParentCategory(): ?CatalogObjectCategory - { - return $this->parentCategory; - } - - /** - * Sets Parent Category. - * A category that can be assigned to an item or a parent category that can be assigned - * to another category. For example, a clothing category can be assigned to a t-shirt item or - * be made as the parent category to the pants category. - * - * @maps parent_category - */ - public function setParentCategory(?CatalogObjectCategory $parentCategory): void - { - $this->parentCategory = $parentCategory; - } - - /** - * Returns Is Top Level. - * Indicates whether a category is a top level category, which does not have any parent_category. - */ - public function getIsTopLevel(): ?bool - { - if (count($this->isTopLevel) == 0) { - return null; - } - return $this->isTopLevel['value']; - } - - /** - * Sets Is Top Level. - * Indicates whether a category is a top level category, which does not have any parent_category. - * - * @maps is_top_level - */ - public function setIsTopLevel(?bool $isTopLevel): void - { - $this->isTopLevel['value'] = $isTopLevel; - } - - /** - * Unsets Is Top Level. - * Indicates whether a category is a top level category, which does not have any parent_category. - */ - public function unsetIsTopLevel(): void - { - $this->isTopLevel = []; - } - - /** - * Returns Channels. - * A list of IDs representing channels, such as a Square Online site, where the category can be made - * visible. - * - * @return string[]|null - */ - public function getChannels(): ?array - { - if (count($this->channels) == 0) { - return null; - } - return $this->channels['value']; - } - - /** - * Sets Channels. - * A list of IDs representing channels, such as a Square Online site, where the category can be made - * visible. - * - * @maps channels - * - * @param string[]|null $channels - */ - public function setChannels(?array $channels): void - { - $this->channels['value'] = $channels; - } - - /** - * Unsets Channels. - * A list of IDs representing channels, such as a Square Online site, where the category can be made - * visible. - */ - public function unsetChannels(): void - { - $this->channels = []; - } - - /** - * Returns Availability Period Ids. - * The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. - * - * @return string[]|null - */ - public function getAvailabilityPeriodIds(): ?array - { - if (count($this->availabilityPeriodIds) == 0) { - return null; - } - return $this->availabilityPeriodIds['value']; - } - - /** - * Sets Availability Period Ids. - * The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. - * - * @maps availability_period_ids - * - * @param string[]|null $availabilityPeriodIds - */ - public function setAvailabilityPeriodIds(?array $availabilityPeriodIds): void - { - $this->availabilityPeriodIds['value'] = $availabilityPeriodIds; - } - - /** - * Unsets Availability Period Ids. - * The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. - */ - public function unsetAvailabilityPeriodIds(): void - { - $this->availabilityPeriodIds = []; - } - - /** - * Returns Online Visibility. - * Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square - * Online sites. - */ - public function getOnlineVisibility(): ?bool - { - if (count($this->onlineVisibility) == 0) { - return null; - } - return $this->onlineVisibility['value']; - } - - /** - * Sets Online Visibility. - * Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square - * Online sites. - * - * @maps online_visibility - */ - public function setOnlineVisibility(?bool $onlineVisibility): void - { - $this->onlineVisibility['value'] = $onlineVisibility; - } - - /** - * Unsets Online Visibility. - * Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square - * Online sites. - */ - public function unsetOnlineVisibility(): void - { - $this->onlineVisibility = []; - } - - /** - * Returns Root Category. - * The top-level category in a category hierarchy. - */ - public function getRootCategory(): ?string - { - return $this->rootCategory; - } - - /** - * Sets Root Category. - * The top-level category in a category hierarchy. - * - * @maps root_category - */ - public function setRootCategory(?string $rootCategory): void - { - $this->rootCategory = $rootCategory; - } - - /** - * Returns Ecom Seo Data. - * SEO data for for a seller's Square Online store. - */ - public function getEcomSeoData(): ?CatalogEcomSeoData - { - return $this->ecomSeoData; - } - - /** - * Sets Ecom Seo Data. - * SEO data for for a seller's Square Online store. - * - * @maps ecom_seo_data - */ - public function setEcomSeoData(?CatalogEcomSeoData $ecomSeoData): void - { - $this->ecomSeoData = $ecomSeoData; - } - - /** - * Returns Path to Root. - * The path from the category to its root category. The first node of the path is the parent of the - * category - * and the last is the root category. The path is empty if the category is a root category. - * - * @return CategoryPathToRootNode[]|null - */ - public function getPathToRoot(): ?array - { - if (count($this->pathToRoot) == 0) { - return null; - } - return $this->pathToRoot['value']; - } - - /** - * Sets Path to Root. - * The path from the category to its root category. The first node of the path is the parent of the - * category - * and the last is the root category. The path is empty if the category is a root category. - * - * @maps path_to_root - * - * @param CategoryPathToRootNode[]|null $pathToRoot - */ - public function setPathToRoot(?array $pathToRoot): void - { - $this->pathToRoot['value'] = $pathToRoot; - } - - /** - * Unsets Path to Root. - * The path from the category to its root category. The first node of the path is the parent of the - * category - * and the last is the root category. The path is empty if the category is a root category. - */ - public function unsetPathToRoot(): void - { - $this->pathToRoot = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->imageIds)) { - $json['image_ids'] = $this->imageIds['value']; - } - if (isset($this->categoryType)) { - $json['category_type'] = $this->categoryType; - } - if (isset($this->parentCategory)) { - $json['parent_category'] = $this->parentCategory; - } - if (!empty($this->isTopLevel)) { - $json['is_top_level'] = $this->isTopLevel['value']; - } - if (!empty($this->channels)) { - $json['channels'] = $this->channels['value']; - } - if (!empty($this->availabilityPeriodIds)) { - $json['availability_period_ids'] = $this->availabilityPeriodIds['value']; - } - if (!empty($this->onlineVisibility)) { - $json['online_visibility'] = $this->onlineVisibility['value']; - } - if (isset($this->rootCategory)) { - $json['root_category'] = $this->rootCategory; - } - if (isset($this->ecomSeoData)) { - $json['ecom_seo_data'] = $this->ecomSeoData; - } - if (!empty($this->pathToRoot)) { - $json['path_to_root'] = $this->pathToRoot['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCategoryType.php b/src/Models/CatalogCategoryType.php deleted file mode 100644 index 80c2ed66..00000000 --- a/src/Models/CatalogCategoryType.php +++ /dev/null @@ -1,26 +0,0 @@ -type = $type; - $this->name = $name; - $this->allowedObjectTypes = $allowedObjectTypes; - } - - /** - * Returns Type. - * Defines the possible types for a custom attribute. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Defines the possible types for a custom attribute. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Name. - * The name of this definition for API and seller-facing UI purposes. - * The name must be unique within the (merchant, application) pair. Required. - * May not be empty and may not exceed 255 characters. Can be modified after creation. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of this definition for API and seller-facing UI purposes. - * The name must be unique within the (merchant, application) pair. Required. - * May not be empty and may not exceed 255 characters. Can be modified after creation. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Description. - * Seller-oriented description of the meaning of this Custom Attribute, - * any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * Seller-oriented description of the meaning of this Custom Attribute, - * any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * Seller-oriented description of the meaning of this Custom Attribute, - * any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Source Application. - * Represents information about the application used to generate a change. - */ - public function getSourceApplication(): ?SourceApplication - { - return $this->sourceApplication; - } - - /** - * Sets Source Application. - * Represents information about the application used to generate a change. - * - * @maps source_application - */ - public function setSourceApplication(?SourceApplication $sourceApplication): void - { - $this->sourceApplication = $sourceApplication; - } - - /** - * Returns Allowed Object Types. - * The set of `CatalogObject` types that this custom atttribute may be applied to. - * Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. - * At least one type must be included. - * See [CatalogObjectType](#type-catalogobjecttype) for possible values - * - * @return string[] - */ - public function getAllowedObjectTypes(): array - { - return $this->allowedObjectTypes; - } - - /** - * Sets Allowed Object Types. - * The set of `CatalogObject` types that this custom atttribute may be applied to. - * Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. - * At least one type must be included. - * See [CatalogObjectType](#type-catalogobjecttype) for possible values - * - * @required - * @maps allowed_object_types - * - * @param string[] $allowedObjectTypes - */ - public function setAllowedObjectTypes(array $allowedObjectTypes): void - { - $this->allowedObjectTypes = $allowedObjectTypes; - } - - /** - * Returns Seller Visibility. - * Defines the visibility of a custom attribute to sellers in Square - * client applications, Square APIs or in Square UIs (including Square Point - * of Sale applications and Square Dashboard). - */ - public function getSellerVisibility(): ?string - { - return $this->sellerVisibility; - } - - /** - * Sets Seller Visibility. - * Defines the visibility of a custom attribute to sellers in Square - * client applications, Square APIs or in Square UIs (including Square Point - * of Sale applications and Square Dashboard). - * - * @maps seller_visibility - */ - public function setSellerVisibility(?string $sellerVisibility): void - { - $this->sellerVisibility = $sellerVisibility; - } - - /** - * Returns App Visibility. - * Defines the visibility of a custom attribute to applications other than their - * creating application. - */ - public function getAppVisibility(): ?string - { - return $this->appVisibility; - } - - /** - * Sets App Visibility. - * Defines the visibility of a custom attribute to applications other than their - * creating application. - * - * @maps app_visibility - */ - public function setAppVisibility(?string $appVisibility): void - { - $this->appVisibility = $appVisibility; - } - - /** - * Returns String Config. - * Configuration associated with Custom Attribute Definitions of type `STRING`. - */ - public function getStringConfig(): ?CatalogCustomAttributeDefinitionStringConfig - { - return $this->stringConfig; - } - - /** - * Sets String Config. - * Configuration associated with Custom Attribute Definitions of type `STRING`. - * - * @maps string_config - */ - public function setStringConfig(?CatalogCustomAttributeDefinitionStringConfig $stringConfig): void - { - $this->stringConfig = $stringConfig; - } - - /** - * Returns Number Config. - */ - public function getNumberConfig(): ?CatalogCustomAttributeDefinitionNumberConfig - { - return $this->numberConfig; - } - - /** - * Sets Number Config. - * - * @maps number_config - */ - public function setNumberConfig(?CatalogCustomAttributeDefinitionNumberConfig $numberConfig): void - { - $this->numberConfig = $numberConfig; - } - - /** - * Returns Selection Config. - * Configuration associated with `SELECTION`-type custom attribute definitions. - */ - public function getSelectionConfig(): ?CatalogCustomAttributeDefinitionSelectionConfig - { - return $this->selectionConfig; - } - - /** - * Sets Selection Config. - * Configuration associated with `SELECTION`-type custom attribute definitions. - * - * @maps selection_config - */ - public function setSelectionConfig(?CatalogCustomAttributeDefinitionSelectionConfig $selectionConfig): void - { - $this->selectionConfig = $selectionConfig; - } - - /** - * Returns Custom Attribute Usage Count. - * The number of custom attributes that reference this - * custom attribute definition. Set by the server in response to a ListCatalog - * request with `include_counts` set to `true`. If the actual count is greater - * than 100, `custom_attribute_usage_count` will be set to `100`. - */ - public function getCustomAttributeUsageCount(): ?int - { - return $this->customAttributeUsageCount; - } - - /** - * Sets Custom Attribute Usage Count. - * The number of custom attributes that reference this - * custom attribute definition. Set by the server in response to a ListCatalog - * request with `include_counts` set to `true`. If the actual count is greater - * than 100, `custom_attribute_usage_count` will be set to `100`. - * - * @maps custom_attribute_usage_count - */ - public function setCustomAttributeUsageCount(?int $customAttributeUsageCount): void - { - $this->customAttributeUsageCount = $customAttributeUsageCount; - } - - /** - * Returns Key. - * The name of the desired custom attribute key that can be used to access - * the custom attribute value on catalog objects. Cannot be modified after the - * custom attribute definition has been created. - * Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`. - */ - public function getKey(): ?string - { - if (count($this->key) == 0) { - return null; - } - return $this->key['value']; - } - - /** - * Sets Key. - * The name of the desired custom attribute key that can be used to access - * the custom attribute value on catalog objects. Cannot be modified after the - * custom attribute definition has been created. - * Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key['value'] = $key; - } - - /** - * Unsets Key. - * The name of the desired custom attribute key that can be used to access - * the custom attribute value on catalog objects. Cannot be modified after the - * custom attribute definition has been created. - * Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`. - */ - public function unsetKey(): void - { - $this->key = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['name'] = $this->name; - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->sourceApplication)) { - $json['source_application'] = $this->sourceApplication; - } - $json['allowed_object_types'] = $this->allowedObjectTypes; - if (isset($this->sellerVisibility)) { - $json['seller_visibility'] = $this->sellerVisibility; - } - if (isset($this->appVisibility)) { - $json['app_visibility'] = $this->appVisibility; - } - if (isset($this->stringConfig)) { - $json['string_config'] = $this->stringConfig; - } - if (isset($this->numberConfig)) { - $json['number_config'] = $this->numberConfig; - } - if (isset($this->selectionConfig)) { - $json['selection_config'] = $this->selectionConfig; - } - if (isset($this->customAttributeUsageCount)) { - $json['custom_attribute_usage_count'] = $this->customAttributeUsageCount; - } - if (!empty($this->key)) { - $json['key'] = $this->key['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCustomAttributeDefinitionAppVisibility.php b/src/Models/CatalogCustomAttributeDefinitionAppVisibility.php deleted file mode 100644 index 0d408729..00000000 --- a/src/Models/CatalogCustomAttributeDefinitionAppVisibility.php +++ /dev/null @@ -1,29 +0,0 @@ -precision) == 0) { - return null; - } - return $this->precision['value']; - } - - /** - * Sets Precision. - * An integer between 0 and 5 that represents the maximum number of - * positions allowed after the decimal in number custom attribute values - * For example: - * - * - if the precision is 0, the quantity can be 1, 2, 3, etc. - * - if the precision is 1, the quantity can be 0.1, 0.2, etc. - * - if the precision is 2, the quantity can be 0.01, 0.12, etc. - * - * Default: 5 - * - * @maps precision - */ - public function setPrecision(?int $precision): void - { - $this->precision['value'] = $precision; - } - - /** - * Unsets Precision. - * An integer between 0 and 5 that represents the maximum number of - * positions allowed after the decimal in number custom attribute values - * For example: - * - * - if the precision is 0, the quantity can be 1, 2, 3, etc. - * - if the precision is 1, the quantity can be 0.1, 0.2, etc. - * - if the precision is 2, the quantity can be 0.01, 0.12, etc. - * - * Default: 5 - */ - public function unsetPrecision(): void - { - $this->precision = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->precision)) { - $json['precision'] = $this->precision['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCustomAttributeDefinitionSelectionConfig.php b/src/Models/CatalogCustomAttributeDefinitionSelectionConfig.php deleted file mode 100644 index 75a67543..00000000 --- a/src/Models/CatalogCustomAttributeDefinitionSelectionConfig.php +++ /dev/null @@ -1,131 +0,0 @@ -maxAllowedSelections) == 0) { - return null; - } - return $this->maxAllowedSelections['value']; - } - - /** - * Sets Max Allowed Selections. - * The maximum number of selections that can be set. The maximum value for this - * attribute is 100. The default value is 1. The value can be modified, but changing the value will - * not - * affect existing custom attribute values on objects. Clients need to - * handle custom attributes with more selected values than allowed by this limit. - * - * @maps max_allowed_selections - */ - public function setMaxAllowedSelections(?int $maxAllowedSelections): void - { - $this->maxAllowedSelections['value'] = $maxAllowedSelections; - } - - /** - * Unsets Max Allowed Selections. - * The maximum number of selections that can be set. The maximum value for this - * attribute is 100. The default value is 1. The value can be modified, but changing the value will - * not - * affect existing custom attribute values on objects. Clients need to - * handle custom attributes with more selected values than allowed by this limit. - */ - public function unsetMaxAllowedSelections(): void - { - $this->maxAllowedSelections = []; - } - - /** - * Returns Allowed Selections. - * The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100 - * selections can be defined. Can be modified. - * - * @return CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[]|null - */ - public function getAllowedSelections(): ?array - { - if (count($this->allowedSelections) == 0) { - return null; - } - return $this->allowedSelections['value']; - } - - /** - * Sets Allowed Selections. - * The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100 - * selections can be defined. Can be modified. - * - * @maps allowed_selections - * - * @param CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[]|null $allowedSelections - */ - public function setAllowedSelections(?array $allowedSelections): void - { - $this->allowedSelections['value'] = $allowedSelections; - } - - /** - * Unsets Allowed Selections. - * The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100 - * selections can be defined. Can be modified. - */ - public function unsetAllowedSelections(): void - { - $this->allowedSelections = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->maxAllowedSelections)) { - $json['max_allowed_selections'] = $this->maxAllowedSelections['value']; - } - if (!empty($this->allowedSelections)) { - $json['allowed_selections'] = $this->allowedSelections['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php b/src/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php deleted file mode 100644 index 97a26b8c..00000000 --- a/src/Models/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php +++ /dev/null @@ -1,107 +0,0 @@ -name = $name; - } - - /** - * Returns Uid. - * Unique ID set by Square. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * Unique ID set by Square. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * Unique ID set by Square. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Name. - * Selection name, unique within `allowed_selections`. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * Selection name, unique within `allowed_selections`. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['name'] = $this->name; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCustomAttributeDefinitionSellerVisibility.php b/src/Models/CatalogCustomAttributeDefinitionSellerVisibility.php deleted file mode 100644 index 166932fb..00000000 --- a/src/Models/CatalogCustomAttributeDefinitionSellerVisibility.php +++ /dev/null @@ -1,25 +0,0 @@ -enforceUniqueness) == 0) { - return null; - } - return $this->enforceUniqueness['value']; - } - - /** - * Sets Enforce Uniqueness. - * If true, each Custom Attribute instance associated with this Custom Attribute - * Definition must have a unique value within the seller's catalog. For - * example, this may be used for a value like a SKU that should not be - * duplicated within a seller's catalog. May not be modified after the - * definition has been created. - * - * @maps enforce_uniqueness - */ - public function setEnforceUniqueness(?bool $enforceUniqueness): void - { - $this->enforceUniqueness['value'] = $enforceUniqueness; - } - - /** - * Unsets Enforce Uniqueness. - * If true, each Custom Attribute instance associated with this Custom Attribute - * Definition must have a unique value within the seller's catalog. For - * example, this may be used for a value like a SKU that should not be - * duplicated within a seller's catalog. May not be modified after the - * definition has been created. - */ - public function unsetEnforceUniqueness(): void - { - $this->enforceUniqueness = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->enforceUniqueness)) { - $json['enforce_uniqueness'] = $this->enforceUniqueness['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogCustomAttributeDefinitionType.php b/src/Models/CatalogCustomAttributeDefinitionType.php deleted file mode 100644 index 94592551..00000000 --- a/src/Models/CatalogCustomAttributeDefinitionType.php +++ /dev/null @@ -1,31 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the custom attribute. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the custom attribute. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns String Value. - * The string value of the custom attribute. Populated if `type` = `STRING`. - */ - public function getStringValue(): ?string - { - if (count($this->stringValue) == 0) { - return null; - } - return $this->stringValue['value']; - } - - /** - * Sets String Value. - * The string value of the custom attribute. Populated if `type` = `STRING`. - * - * @maps string_value - */ - public function setStringValue(?string $stringValue): void - { - $this->stringValue['value'] = $stringValue; - } - - /** - * Unsets String Value. - * The string value of the custom attribute. Populated if `type` = `STRING`. - */ - public function unsetStringValue(): void - { - $this->stringValue = []; - } - - /** - * Returns Custom Attribute Definition Id. - * The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value - * belongs to. - */ - public function getCustomAttributeDefinitionId(): ?string - { - return $this->customAttributeDefinitionId; - } - - /** - * Sets Custom Attribute Definition Id. - * The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value - * belongs to. - * - * @maps custom_attribute_definition_id - */ - public function setCustomAttributeDefinitionId(?string $customAttributeDefinitionId): void - { - $this->customAttributeDefinitionId = $customAttributeDefinitionId; - } - - /** - * Returns Type. - * Defines the possible types for a custom attribute. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Defines the possible types for a custom attribute. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Number Value. - * Populated if `type` = `NUMBER`. Contains a string - * representation of a decimal number, using a `.` as the decimal separator. - */ - public function getNumberValue(): ?string - { - if (count($this->numberValue) == 0) { - return null; - } - return $this->numberValue['value']; - } - - /** - * Sets Number Value. - * Populated if `type` = `NUMBER`. Contains a string - * representation of a decimal number, using a `.` as the decimal separator. - * - * @maps number_value - */ - public function setNumberValue(?string $numberValue): void - { - $this->numberValue['value'] = $numberValue; - } - - /** - * Unsets Number Value. - * Populated if `type` = `NUMBER`. Contains a string - * representation of a decimal number, using a `.` as the decimal separator. - */ - public function unsetNumberValue(): void - { - $this->numberValue = []; - } - - /** - * Returns Boolean Value. - * A `true` or `false` value. Populated if `type` = `BOOLEAN`. - */ - public function getBooleanValue(): ?bool - { - if (count($this->booleanValue) == 0) { - return null; - } - return $this->booleanValue['value']; - } - - /** - * Sets Boolean Value. - * A `true` or `false` value. Populated if `type` = `BOOLEAN`. - * - * @maps boolean_value - */ - public function setBooleanValue(?bool $booleanValue): void - { - $this->booleanValue['value'] = $booleanValue; - } - - /** - * Unsets Boolean Value. - * A `true` or `false` value. Populated if `type` = `BOOLEAN`. - */ - public function unsetBooleanValue(): void - { - $this->booleanValue = []; - } - - /** - * Returns Selection Uid Values. - * One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. - * - * @return string[]|null - */ - public function getSelectionUidValues(): ?array - { - if (count($this->selectionUidValues) == 0) { - return null; - } - return $this->selectionUidValues['value']; - } - - /** - * Sets Selection Uid Values. - * One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. - * - * @maps selection_uid_values - * - * @param string[]|null $selectionUidValues - */ - public function setSelectionUidValues(?array $selectionUidValues): void - { - $this->selectionUidValues['value'] = $selectionUidValues; - } - - /** - * Unsets Selection Uid Values. - * One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. - */ - public function unsetSelectionUidValues(): void - { - $this->selectionUidValues = []; - } - - /** - * Returns Key. - * If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this - * key is prefixed by the defining application ID. - * For example, if the CatalogCustomAttributeDefinition has a key attribute of "cocoa_brand" and the - * defining application ID is "abcd1234", this key is "abcd1234:cocoa_brand" - * when the application making the request is different from the application defining the custom - * attribute definition. Otherwise, the key is simply "cocoa_brand". - */ - public function getKey(): ?string - { - return $this->key; - } - - /** - * Sets Key. - * If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this - * key is prefixed by the defining application ID. - * For example, if the CatalogCustomAttributeDefinition has a key attribute of "cocoa_brand" and the - * defining application ID is "abcd1234", this key is "abcd1234:cocoa_brand" - * when the application making the request is different from the application defining the custom - * attribute definition. Otherwise, the key is simply "cocoa_brand". - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->stringValue)) { - $json['string_value'] = $this->stringValue['value']; - } - if (isset($this->customAttributeDefinitionId)) { - $json['custom_attribute_definition_id'] = $this->customAttributeDefinitionId; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->numberValue)) { - $json['number_value'] = $this->numberValue['value']; - } - if (!empty($this->booleanValue)) { - $json['boolean_value'] = $this->booleanValue['value']; - } - if (!empty($this->selectionUidValues)) { - $json['selection_uid_values'] = $this->selectionUidValues['value']; - } - if (isset($this->key)) { - $json['key'] = $this->key; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogDiscount.php b/src/Models/CatalogDiscount.php deleted file mode 100644 index 7edcc4af..00000000 --- a/src/Models/CatalogDiscount.php +++ /dev/null @@ -1,353 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The discount name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The discount name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Discount Type. - * How to apply a CatalogDiscount to a CatalogItem. - */ - public function getDiscountType(): ?string - { - return $this->discountType; - } - - /** - * Sets Discount Type. - * How to apply a CatalogDiscount to a CatalogItem. - * - * @maps discount_type - */ - public function setDiscountType(?string $discountType): void - { - $this->discountType = $discountType; - } - - /** - * Returns Percentage. - * The percentage of the discount as a string representation of a decimal number, using a `.` as the - * decimal - * separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of - * `0` if `discount_type` - * is `VARIABLE_PERCENTAGE`. - * - * Do not use this field for amount-based or variable discounts. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the discount as a string representation of a decimal number, using a `.` as the - * decimal - * separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of - * `0` if `discount_type` - * is `VARIABLE_PERCENTAGE`. - * - * Do not use this field for amount-based or variable discounts. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the discount as a string representation of a decimal number, using a `.` as the - * decimal - * separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of - * `0` if `discount_type` - * is `VARIABLE_PERCENTAGE`. - * - * Do not use this field for amount-based or variable discounts. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Pin Required. - * Indicates whether a mobile staff member needs to enter their PIN to apply the - * discount to a payment in the Square Point of Sale app. - */ - public function getPinRequired(): ?bool - { - if (count($this->pinRequired) == 0) { - return null; - } - return $this->pinRequired['value']; - } - - /** - * Sets Pin Required. - * Indicates whether a mobile staff member needs to enter their PIN to apply the - * discount to a payment in the Square Point of Sale app. - * - * @maps pin_required - */ - public function setPinRequired(?bool $pinRequired): void - { - $this->pinRequired['value'] = $pinRequired; - } - - /** - * Unsets Pin Required. - * Indicates whether a mobile staff member needs to enter their PIN to apply the - * discount to a payment in the Square Point of Sale app. - */ - public function unsetPinRequired(): void - { - $this->pinRequired = []; - } - - /** - * Returns Label Color. - * The color of the discount display label in the Square Point of Sale app. This must be a valid hex - * color code. - */ - public function getLabelColor(): ?string - { - if (count($this->labelColor) == 0) { - return null; - } - return $this->labelColor['value']; - } - - /** - * Sets Label Color. - * The color of the discount display label in the Square Point of Sale app. This must be a valid hex - * color code. - * - * @maps label_color - */ - public function setLabelColor(?string $labelColor): void - { - $this->labelColor['value'] = $labelColor; - } - - /** - * Unsets Label Color. - * The color of the discount display label in the Square Point of Sale app. This must be a valid hex - * color code. - */ - public function unsetLabelColor(): void - { - $this->labelColor = []; - } - - /** - * Returns Modify Tax Basis. - */ - public function getModifyTaxBasis(): ?string - { - return $this->modifyTaxBasis; - } - - /** - * Sets Modify Tax Basis. - * - * @maps modify_tax_basis - */ - public function setModifyTaxBasis(?string $modifyTaxBasis): void - { - $this->modifyTaxBasis = $modifyTaxBasis; - } - - /** - * Returns Maximum Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMaximumAmountMoney(): ?Money - { - return $this->maximumAmountMoney; - } - - /** - * Sets Maximum Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps maximum_amount_money - */ - public function setMaximumAmountMoney(?Money $maximumAmountMoney): void - { - $this->maximumAmountMoney = $maximumAmountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->discountType)) { - $json['discount_type'] = $this->discountType; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (!empty($this->pinRequired)) { - $json['pin_required'] = $this->pinRequired['value']; - } - if (!empty($this->labelColor)) { - $json['label_color'] = $this->labelColor['value']; - } - if (isset($this->modifyTaxBasis)) { - $json['modify_tax_basis'] = $this->modifyTaxBasis; - } - if (isset($this->maximumAmountMoney)) { - $json['maximum_amount_money'] = $this->maximumAmountMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogDiscountModifyTaxBasis.php b/src/Models/CatalogDiscountModifyTaxBasis.php deleted file mode 100644 index cbc0d5f8..00000000 --- a/src/Models/CatalogDiscountModifyTaxBasis.php +++ /dev/null @@ -1,18 +0,0 @@ -pageTitle) == 0) { - return null; - } - return $this->pageTitle['value']; - } - - /** - * Sets Page Title. - * The SEO title used for the Square Online store. - * - * @maps page_title - */ - public function setPageTitle(?string $pageTitle): void - { - $this->pageTitle['value'] = $pageTitle; - } - - /** - * Unsets Page Title. - * The SEO title used for the Square Online store. - */ - public function unsetPageTitle(): void - { - $this->pageTitle = []; - } - - /** - * Returns Page Description. - * The SEO description used for the Square Online store. - */ - public function getPageDescription(): ?string - { - if (count($this->pageDescription) == 0) { - return null; - } - return $this->pageDescription['value']; - } - - /** - * Sets Page Description. - * The SEO description used for the Square Online store. - * - * @maps page_description - */ - public function setPageDescription(?string $pageDescription): void - { - $this->pageDescription['value'] = $pageDescription; - } - - /** - * Unsets Page Description. - * The SEO description used for the Square Online store. - */ - public function unsetPageDescription(): void - { - $this->pageDescription = []; - } - - /** - * Returns Permalink. - * The SEO permalink used for the Square Online store. - */ - public function getPermalink(): ?string - { - if (count($this->permalink) == 0) { - return null; - } - return $this->permalink['value']; - } - - /** - * Sets Permalink. - * The SEO permalink used for the Square Online store. - * - * @maps permalink - */ - public function setPermalink(?string $permalink): void - { - $this->permalink['value'] = $permalink; - } - - /** - * Unsets Permalink. - * The SEO permalink used for the Square Online store. - */ - public function unsetPermalink(): void - { - $this->permalink = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->pageTitle)) { - $json['page_title'] = $this->pageTitle['value']; - } - if (!empty($this->pageDescription)) { - $json['page_description'] = $this->pageDescription['value']; - } - if (!empty($this->permalink)) { - $json['permalink'] = $this->permalink['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogIdMapping.php b/src/Models/CatalogIdMapping.php deleted file mode 100644 index 43192133..00000000 --- a/src/Models/CatalogIdMapping.php +++ /dev/null @@ -1,122 +0,0 @@ -clientObjectId) == 0) { - return null; - } - return $this->clientObjectId['value']; - } - - /** - * Sets Client Object Id. - * The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. - * - * @maps client_object_id - */ - public function setClientObjectId(?string $clientObjectId): void - { - $this->clientObjectId['value'] = $clientObjectId; - } - - /** - * Unsets Client Object Id. - * The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. - */ - public function unsetClientObjectId(): void - { - $this->clientObjectId = []; - } - - /** - * Returns Object Id. - * The permanent ID for the CatalogObject created by the server. - */ - public function getObjectId(): ?string - { - if (count($this->objectId) == 0) { - return null; - } - return $this->objectId['value']; - } - - /** - * Sets Object Id. - * The permanent ID for the CatalogObject created by the server. - * - * @maps object_id - */ - public function setObjectId(?string $objectId): void - { - $this->objectId['value'] = $objectId; - } - - /** - * Unsets Object Id. - * The permanent ID for the CatalogObject created by the server. - */ - public function unsetObjectId(): void - { - $this->objectId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->clientObjectId)) { - $json['client_object_id'] = $this->clientObjectId['value']; - } - if (!empty($this->objectId)) { - $json['object_id'] = $this->objectId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogImage.php b/src/Models/CatalogImage.php deleted file mode 100644 index f7471368..00000000 --- a/src/Models/CatalogImage.php +++ /dev/null @@ -1,221 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The internal name to identify this image in calls to the Square API. - * This is a searchable attribute for use in applicable query filters - * using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). - * It is not unique and should not be shown in a buyer facing context. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The internal name to identify this image in calls to the Square API. - * This is a searchable attribute for use in applicable query filters - * using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). - * It is not unique and should not be shown in a buyer facing context. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Url. - * The URL of this image, generated by Square after an image is uploaded - * using the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. - * To modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field. - */ - public function getUrl(): ?string - { - if (count($this->url) == 0) { - return null; - } - return $this->url['value']; - } - - /** - * Sets Url. - * The URL of this image, generated by Square after an image is uploaded - * using the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. - * To modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field. - * - * @maps url - */ - public function setUrl(?string $url): void - { - $this->url['value'] = $url; - } - - /** - * Unsets Url. - * The URL of this image, generated by Square after an image is uploaded - * using the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. - * To modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field. - */ - public function unsetUrl(): void - { - $this->url = []; - } - - /** - * Returns Caption. - * A caption that describes what is shown in the image. Displayed in the - * Square Online Store. This is a searchable attribute for use in applicable query filters - * using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). - */ - public function getCaption(): ?string - { - if (count($this->caption) == 0) { - return null; - } - return $this->caption['value']; - } - - /** - * Sets Caption. - * A caption that describes what is shown in the image. Displayed in the - * Square Online Store. This is a searchable attribute for use in applicable query filters - * using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). - * - * @maps caption - */ - public function setCaption(?string $caption): void - { - $this->caption['value'] = $caption; - } - - /** - * Unsets Caption. - * A caption that describes what is shown in the image. Displayed in the - * Square Online Store. This is a searchable attribute for use in applicable query filters - * using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). - */ - public function unsetCaption(): void - { - $this->caption = []; - } - - /** - * Returns Photo Studio Order Id. - * The immutable order ID for this image object created by the Photo Studio service in Square Online - * Store. - */ - public function getPhotoStudioOrderId(): ?string - { - if (count($this->photoStudioOrderId) == 0) { - return null; - } - return $this->photoStudioOrderId['value']; - } - - /** - * Sets Photo Studio Order Id. - * The immutable order ID for this image object created by the Photo Studio service in Square Online - * Store. - * - * @maps photo_studio_order_id - */ - public function setPhotoStudioOrderId(?string $photoStudioOrderId): void - { - $this->photoStudioOrderId['value'] = $photoStudioOrderId; - } - - /** - * Unsets Photo Studio Order Id. - * The immutable order ID for this image object created by the Photo Studio service in Square Online - * Store. - */ - public function unsetPhotoStudioOrderId(): void - { - $this->photoStudioOrderId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->url)) { - $json['url'] = $this->url['value']; - } - if (!empty($this->caption)) { - $json['caption'] = $this->caption['value']; - } - if (!empty($this->photoStudioOrderId)) { - $json['photo_studio_order_id'] = $this->photoStudioOrderId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogInfoResponse.php b/src/Models/CatalogInfoResponse.php deleted file mode 100644 index 5c5292a1..00000000 --- a/src/Models/CatalogInfoResponse.php +++ /dev/null @@ -1,115 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Limits. - */ - public function getLimits(): ?CatalogInfoResponseLimits - { - return $this->limits; - } - - /** - * Sets Limits. - * - * @maps limits - */ - public function setLimits(?CatalogInfoResponseLimits $limits): void - { - $this->limits = $limits; - } - - /** - * Returns Standard Unit Description Group. - * Group of standard measurement units. - */ - public function getStandardUnitDescriptionGroup(): ?StandardUnitDescriptionGroup - { - return $this->standardUnitDescriptionGroup; - } - - /** - * Sets Standard Unit Description Group. - * Group of standard measurement units. - * - * @maps standard_unit_description_group - */ - public function setStandardUnitDescriptionGroup(?StandardUnitDescriptionGroup $standardUnitDescriptionGroup): void - { - $this->standardUnitDescriptionGroup = $standardUnitDescriptionGroup; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->limits)) { - $json['limits'] = $this->limits; - } - if (isset($this->standardUnitDescriptionGroup)) { - $json['standard_unit_description_group'] = $this->standardUnitDescriptionGroup; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogInfoResponseLimits.php b/src/Models/CatalogInfoResponseLimits.php deleted file mode 100644 index 448e2017..00000000 --- a/src/Models/CatalogInfoResponseLimits.php +++ /dev/null @@ -1,515 +0,0 @@ -batchUpsertMaxObjectsPerBatch) == 0) { - return null; - } - return $this->batchUpsertMaxObjectsPerBatch['value']; - } - - /** - * Sets Batch Upsert Max Objects Per Batch. - * The maximum number of objects that may appear within a single batch in a - * `/v2/catalog/batch-upsert` request. - * - * @maps batch_upsert_max_objects_per_batch - */ - public function setBatchUpsertMaxObjectsPerBatch(?int $batchUpsertMaxObjectsPerBatch): void - { - $this->batchUpsertMaxObjectsPerBatch['value'] = $batchUpsertMaxObjectsPerBatch; - } - - /** - * Unsets Batch Upsert Max Objects Per Batch. - * The maximum number of objects that may appear within a single batch in a - * `/v2/catalog/batch-upsert` request. - */ - public function unsetBatchUpsertMaxObjectsPerBatch(): void - { - $this->batchUpsertMaxObjectsPerBatch = []; - } - - /** - * Returns Batch Upsert Max Total Objects. - * The maximum number of objects that may appear across all batches in a - * `/v2/catalog/batch-upsert` request. - */ - public function getBatchUpsertMaxTotalObjects(): ?int - { - if (count($this->batchUpsertMaxTotalObjects) == 0) { - return null; - } - return $this->batchUpsertMaxTotalObjects['value']; - } - - /** - * Sets Batch Upsert Max Total Objects. - * The maximum number of objects that may appear across all batches in a - * `/v2/catalog/batch-upsert` request. - * - * @maps batch_upsert_max_total_objects - */ - public function setBatchUpsertMaxTotalObjects(?int $batchUpsertMaxTotalObjects): void - { - $this->batchUpsertMaxTotalObjects['value'] = $batchUpsertMaxTotalObjects; - } - - /** - * Unsets Batch Upsert Max Total Objects. - * The maximum number of objects that may appear across all batches in a - * `/v2/catalog/batch-upsert` request. - */ - public function unsetBatchUpsertMaxTotalObjects(): void - { - $this->batchUpsertMaxTotalObjects = []; - } - - /** - * Returns Batch Retrieve Max Object Ids. - * The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve` - * request. - */ - public function getBatchRetrieveMaxObjectIds(): ?int - { - if (count($this->batchRetrieveMaxObjectIds) == 0) { - return null; - } - return $this->batchRetrieveMaxObjectIds['value']; - } - - /** - * Sets Batch Retrieve Max Object Ids. - * The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve` - * request. - * - * @maps batch_retrieve_max_object_ids - */ - public function setBatchRetrieveMaxObjectIds(?int $batchRetrieveMaxObjectIds): void - { - $this->batchRetrieveMaxObjectIds['value'] = $batchRetrieveMaxObjectIds; - } - - /** - * Unsets Batch Retrieve Max Object Ids. - * The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve` - * request. - */ - public function unsetBatchRetrieveMaxObjectIds(): void - { - $this->batchRetrieveMaxObjectIds = []; - } - - /** - * Returns Search Max Page Limit. - * The maximum number of results that may be returned in a page of a - * `/v2/catalog/search` response. - */ - public function getSearchMaxPageLimit(): ?int - { - if (count($this->searchMaxPageLimit) == 0) { - return null; - } - return $this->searchMaxPageLimit['value']; - } - - /** - * Sets Search Max Page Limit. - * The maximum number of results that may be returned in a page of a - * `/v2/catalog/search` response. - * - * @maps search_max_page_limit - */ - public function setSearchMaxPageLimit(?int $searchMaxPageLimit): void - { - $this->searchMaxPageLimit['value'] = $searchMaxPageLimit; - } - - /** - * Unsets Search Max Page Limit. - * The maximum number of results that may be returned in a page of a - * `/v2/catalog/search` response. - */ - public function unsetSearchMaxPageLimit(): void - { - $this->searchMaxPageLimit = []; - } - - /** - * Returns Batch Delete Max Object Ids. - * The maximum number of object IDs that may be included in a single - * `/v2/catalog/batch-delete` request. - */ - public function getBatchDeleteMaxObjectIds(): ?int - { - if (count($this->batchDeleteMaxObjectIds) == 0) { - return null; - } - return $this->batchDeleteMaxObjectIds['value']; - } - - /** - * Sets Batch Delete Max Object Ids. - * The maximum number of object IDs that may be included in a single - * `/v2/catalog/batch-delete` request. - * - * @maps batch_delete_max_object_ids - */ - public function setBatchDeleteMaxObjectIds(?int $batchDeleteMaxObjectIds): void - { - $this->batchDeleteMaxObjectIds['value'] = $batchDeleteMaxObjectIds; - } - - /** - * Unsets Batch Delete Max Object Ids. - * The maximum number of object IDs that may be included in a single - * `/v2/catalog/batch-delete` request. - */ - public function unsetBatchDeleteMaxObjectIds(): void - { - $this->batchDeleteMaxObjectIds = []; - } - - /** - * Returns Update Item Taxes Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function getUpdateItemTaxesMaxItemIds(): ?int - { - if (count($this->updateItemTaxesMaxItemIds) == 0) { - return null; - } - return $this->updateItemTaxesMaxItemIds['value']; - } - - /** - * Sets Update Item Taxes Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-taxes` request. - * - * @maps update_item_taxes_max_item_ids - */ - public function setUpdateItemTaxesMaxItemIds(?int $updateItemTaxesMaxItemIds): void - { - $this->updateItemTaxesMaxItemIds['value'] = $updateItemTaxesMaxItemIds; - } - - /** - * Unsets Update Item Taxes Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function unsetUpdateItemTaxesMaxItemIds(): void - { - $this->updateItemTaxesMaxItemIds = []; - } - - /** - * Returns Update Item Taxes Max Taxes to Enable. - * The maximum number of tax IDs to be enabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function getUpdateItemTaxesMaxTaxesToEnable(): ?int - { - if (count($this->updateItemTaxesMaxTaxesToEnable) == 0) { - return null; - } - return $this->updateItemTaxesMaxTaxesToEnable['value']; - } - - /** - * Sets Update Item Taxes Max Taxes to Enable. - * The maximum number of tax IDs to be enabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - * - * @maps update_item_taxes_max_taxes_to_enable - */ - public function setUpdateItemTaxesMaxTaxesToEnable(?int $updateItemTaxesMaxTaxesToEnable): void - { - $this->updateItemTaxesMaxTaxesToEnable['value'] = $updateItemTaxesMaxTaxesToEnable; - } - - /** - * Unsets Update Item Taxes Max Taxes to Enable. - * The maximum number of tax IDs to be enabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function unsetUpdateItemTaxesMaxTaxesToEnable(): void - { - $this->updateItemTaxesMaxTaxesToEnable = []; - } - - /** - * Returns Update Item Taxes Max Taxes to Disable. - * The maximum number of tax IDs to be disabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function getUpdateItemTaxesMaxTaxesToDisable(): ?int - { - if (count($this->updateItemTaxesMaxTaxesToDisable) == 0) { - return null; - } - return $this->updateItemTaxesMaxTaxesToDisable['value']; - } - - /** - * Sets Update Item Taxes Max Taxes to Disable. - * The maximum number of tax IDs to be disabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - * - * @maps update_item_taxes_max_taxes_to_disable - */ - public function setUpdateItemTaxesMaxTaxesToDisable(?int $updateItemTaxesMaxTaxesToDisable): void - { - $this->updateItemTaxesMaxTaxesToDisable['value'] = $updateItemTaxesMaxTaxesToDisable; - } - - /** - * Unsets Update Item Taxes Max Taxes to Disable. - * The maximum number of tax IDs to be disabled that may be included in a single - * `/v2/catalog/update-item-taxes` request. - */ - public function unsetUpdateItemTaxesMaxTaxesToDisable(): void - { - $this->updateItemTaxesMaxTaxesToDisable = []; - } - - /** - * Returns Update Item Modifier Lists Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-modifier-lists` request. - */ - public function getUpdateItemModifierListsMaxItemIds(): ?int - { - if (count($this->updateItemModifierListsMaxItemIds) == 0) { - return null; - } - return $this->updateItemModifierListsMaxItemIds['value']; - } - - /** - * Sets Update Item Modifier Lists Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-modifier-lists` request. - * - * @maps update_item_modifier_lists_max_item_ids - */ - public function setUpdateItemModifierListsMaxItemIds(?int $updateItemModifierListsMaxItemIds): void - { - $this->updateItemModifierListsMaxItemIds['value'] = $updateItemModifierListsMaxItemIds; - } - - /** - * Unsets Update Item Modifier Lists Max Item Ids. - * The maximum number of item IDs that may be included in a single - * `/v2/catalog/update-item-modifier-lists` request. - */ - public function unsetUpdateItemModifierListsMaxItemIds(): void - { - $this->updateItemModifierListsMaxItemIds = []; - } - - /** - * Returns Update Item Modifier Lists Max Modifier Lists to Enable. - * The maximum number of modifier list IDs to be enabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - */ - public function getUpdateItemModifierListsMaxModifierListsToEnable(): ?int - { - if (count($this->updateItemModifierListsMaxModifierListsToEnable) == 0) { - return null; - } - return $this->updateItemModifierListsMaxModifierListsToEnable['value']; - } - - /** - * Sets Update Item Modifier Lists Max Modifier Lists to Enable. - * The maximum number of modifier list IDs to be enabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - * - * @maps update_item_modifier_lists_max_modifier_lists_to_enable - */ - public function setUpdateItemModifierListsMaxModifierListsToEnable( - ?int $updateItemModifierListsMaxModifierListsToEnable - ): void { - $this->updateItemModifierListsMaxModifierListsToEnable['value'] = - $updateItemModifierListsMaxModifierListsToEnable; - } - - /** - * Unsets Update Item Modifier Lists Max Modifier Lists to Enable. - * The maximum number of modifier list IDs to be enabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - */ - public function unsetUpdateItemModifierListsMaxModifierListsToEnable(): void - { - $this->updateItemModifierListsMaxModifierListsToEnable = []; - } - - /** - * Returns Update Item Modifier Lists Max Modifier Lists to Disable. - * The maximum number of modifier list IDs to be disabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - */ - public function getUpdateItemModifierListsMaxModifierListsToDisable(): ?int - { - if (count($this->updateItemModifierListsMaxModifierListsToDisable) == 0) { - return null; - } - return $this->updateItemModifierListsMaxModifierListsToDisable['value']; - } - - /** - * Sets Update Item Modifier Lists Max Modifier Lists to Disable. - * The maximum number of modifier list IDs to be disabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - * - * @maps update_item_modifier_lists_max_modifier_lists_to_disable - */ - public function setUpdateItemModifierListsMaxModifierListsToDisable( - ?int $updateItemModifierListsMaxModifierListsToDisable - ): void { - $this->updateItemModifierListsMaxModifierListsToDisable['value'] = - $updateItemModifierListsMaxModifierListsToDisable; - } - - /** - * Unsets Update Item Modifier Lists Max Modifier Lists to Disable. - * The maximum number of modifier list IDs to be disabled that may be included in - * a single `/v2/catalog/update-item-modifier-lists` request. - */ - public function unsetUpdateItemModifierListsMaxModifierListsToDisable(): void - { - $this->updateItemModifierListsMaxModifierListsToDisable = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->batchUpsertMaxObjectsPerBatch)) { - $json['batch_upsert_max_objects_per_batch'] = - $this->batchUpsertMaxObjectsPerBatch['value']; - } - if (!empty($this->batchUpsertMaxTotalObjects)) { - $json['batch_upsert_max_total_objects'] = - $this->batchUpsertMaxTotalObjects['value']; - } - if (!empty($this->batchRetrieveMaxObjectIds)) { - $json['batch_retrieve_max_object_ids'] = - $this->batchRetrieveMaxObjectIds['value']; - } - if (!empty($this->searchMaxPageLimit)) { - $json['search_max_page_limit'] = $this->searchMaxPageLimit['value']; - } - if (!empty($this->batchDeleteMaxObjectIds)) { - $json['batch_delete_max_object_ids'] = $this->batchDeleteMaxObjectIds['value']; - } - if (!empty($this->updateItemTaxesMaxItemIds)) { - $json['update_item_taxes_max_item_ids'] = - $this->updateItemTaxesMaxItemIds['value']; - } - if (!empty($this->updateItemTaxesMaxTaxesToEnable)) { - $json['update_item_taxes_max_taxes_to_enable'] = - $this->updateItemTaxesMaxTaxesToEnable['value']; - } - if (!empty($this->updateItemTaxesMaxTaxesToDisable)) { - $json['update_item_taxes_max_taxes_to_disable'] = - $this->updateItemTaxesMaxTaxesToDisable['value']; - } - if (!empty($this->updateItemModifierListsMaxItemIds)) { - $json['update_item_modifier_lists_max_item_ids'] = - $this->updateItemModifierListsMaxItemIds['value']; - } - if (!empty($this->updateItemModifierListsMaxModifierListsToEnable)) { - $json['update_item_modifier_lists_max_modifier_lists_to_enable'] = - $this->updateItemModifierListsMaxModifierListsToEnable['value']; - } - if (!empty($this->updateItemModifierListsMaxModifierListsToDisable)) { - $json['update_item_modifier_lists_max_modifier_lists_to_disable'] = - $this->updateItemModifierListsMaxModifierListsToDisable['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItem.php b/src/Models/CatalogItem.php deleted file mode 100644 index 7af3b6bf..00000000 --- a/src/Models/CatalogItem.php +++ /dev/null @@ -1,1205 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The item's name. This is a searchable attribute for use in applicable query filters, its value must - * not be empty, and the length is of Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The item's name. This is a searchable attribute for use in applicable query filters, its value must - * not be empty, and the length is of Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Description. - * The item's description. This is a searchable attribute for use in applicable query filters, and its - * value length is of Unicode code points. - * - * Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use - * `description_html` to set the description - * of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field - * values are kept in sync. If you try to - * set the both fields, the `description_html` text value overwrites the `description` value. Updates - * in one field are also reflected in the other, - * except for when you use an early version before Square API 2022-07-20 and `description_html` is set - * to blank, setting the `description` value to null - * does not nullify `description_html`. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The item's description. This is a searchable attribute for use in applicable query filters, and its - * value length is of Unicode code points. - * - * Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use - * `description_html` to set the description - * of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field - * values are kept in sync. If you try to - * set the both fields, the `description_html` text value overwrites the `description` value. Updates - * in one field are also reflected in the other, - * except for when you use an early version before Square API 2022-07-20 and `description_html` is set - * to blank, setting the `description` value to null - * does not nullify `description_html`. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The item's description. This is a searchable attribute for use in applicable query filters, and its - * value length is of Unicode code points. - * - * Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use - * `description_html` to set the description - * of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field - * values are kept in sync. If you try to - * set the both fields, the `description_html` text value overwrites the `description` value. Updates - * in one field are also reflected in the other, - * except for when you use an early version before Square API 2022-07-20 and `description_html` is set - * to blank, setting the `description` value to null - * does not nullify `description_html`. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Abbreviation. - * The text of the item's display label in the Square Point of Sale app. Only up to the first five - * characters of the string are used. - * This attribute is searchable, and its value length is of Unicode code points. - */ - public function getAbbreviation(): ?string - { - if (count($this->abbreviation) == 0) { - return null; - } - return $this->abbreviation['value']; - } - - /** - * Sets Abbreviation. - * The text of the item's display label in the Square Point of Sale app. Only up to the first five - * characters of the string are used. - * This attribute is searchable, and its value length is of Unicode code points. - * - * @maps abbreviation - */ - public function setAbbreviation(?string $abbreviation): void - { - $this->abbreviation['value'] = $abbreviation; - } - - /** - * Unsets Abbreviation. - * The text of the item's display label in the Square Point of Sale app. Only up to the first five - * characters of the string are used. - * This attribute is searchable, and its value length is of Unicode code points. - */ - public function unsetAbbreviation(): void - { - $this->abbreviation = []; - } - - /** - * Returns Label Color. - * The color of the item's display label in the Square Point of Sale app. This must be a valid hex - * color code. - */ - public function getLabelColor(): ?string - { - if (count($this->labelColor) == 0) { - return null; - } - return $this->labelColor['value']; - } - - /** - * Sets Label Color. - * The color of the item's display label in the Square Point of Sale app. This must be a valid hex - * color code. - * - * @maps label_color - */ - public function setLabelColor(?string $labelColor): void - { - $this->labelColor['value'] = $labelColor; - } - - /** - * Unsets Label Color. - * The color of the item's display label in the Square Point of Sale app. This must be a valid hex - * color code. - */ - public function unsetLabelColor(): void - { - $this->labelColor = []; - } - - /** - * Returns Is Taxable. - * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. - */ - public function getIsTaxable(): ?bool - { - if (count($this->isTaxable) == 0) { - return null; - } - return $this->isTaxable['value']; - } - - /** - * Sets Is Taxable. - * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. - * - * @maps is_taxable - */ - public function setIsTaxable(?bool $isTaxable): void - { - $this->isTaxable['value'] = $isTaxable; - } - - /** - * Unsets Is Taxable. - * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. - */ - public function unsetIsTaxable(): void - { - $this->isTaxable = []; - } - - /** - * Returns Available Online. - * If `true`, the item can be added to shipping orders from the merchant's online store. - */ - public function getAvailableOnline(): ?bool - { - if (count($this->availableOnline) == 0) { - return null; - } - return $this->availableOnline['value']; - } - - /** - * Sets Available Online. - * If `true`, the item can be added to shipping orders from the merchant's online store. - * - * @maps available_online - */ - public function setAvailableOnline(?bool $availableOnline): void - { - $this->availableOnline['value'] = $availableOnline; - } - - /** - * Unsets Available Online. - * If `true`, the item can be added to shipping orders from the merchant's online store. - */ - public function unsetAvailableOnline(): void - { - $this->availableOnline = []; - } - - /** - * Returns Available for Pickup. - * If `true`, the item can be added to pickup orders from the merchant's online store. - */ - public function getAvailableForPickup(): ?bool - { - if (count($this->availableForPickup) == 0) { - return null; - } - return $this->availableForPickup['value']; - } - - /** - * Sets Available for Pickup. - * If `true`, the item can be added to pickup orders from the merchant's online store. - * - * @maps available_for_pickup - */ - public function setAvailableForPickup(?bool $availableForPickup): void - { - $this->availableForPickup['value'] = $availableForPickup; - } - - /** - * Unsets Available for Pickup. - * If `true`, the item can be added to pickup orders from the merchant's online store. - */ - public function unsetAvailableForPickup(): void - { - $this->availableForPickup = []; - } - - /** - * Returns Available Electronically. - * If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. - */ - public function getAvailableElectronically(): ?bool - { - if (count($this->availableElectronically) == 0) { - return null; - } - return $this->availableElectronically['value']; - } - - /** - * Sets Available Electronically. - * If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. - * - * @maps available_electronically - */ - public function setAvailableElectronically(?bool $availableElectronically): void - { - $this->availableElectronically['value'] = $availableElectronically; - } - - /** - * Unsets Available Electronically. - * If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. - */ - public function unsetAvailableElectronically(): void - { - $this->availableElectronically = []; - } - - /** - * Returns Category Id. - * The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, - * instead. - */ - public function getCategoryId(): ?string - { - if (count($this->categoryId) == 0) { - return null; - } - return $this->categoryId['value']; - } - - /** - * Sets Category Id. - * The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, - * instead. - * - * @maps category_id - */ - public function setCategoryId(?string $categoryId): void - { - $this->categoryId['value'] = $categoryId; - } - - /** - * Unsets Category Id. - * The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, - * instead. - */ - public function unsetCategoryId(): void - { - $this->categoryId = []; - } - - /** - * Returns Tax Ids. - * A set of IDs indicating the taxes enabled for - * this item. When updating an item, any taxes listed here will be added to the item. - * Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. - * - * @return string[]|null - */ - public function getTaxIds(): ?array - { - if (count($this->taxIds) == 0) { - return null; - } - return $this->taxIds['value']; - } - - /** - * Sets Tax Ids. - * A set of IDs indicating the taxes enabled for - * this item. When updating an item, any taxes listed here will be added to the item. - * Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. - * - * @maps tax_ids - * - * @param string[]|null $taxIds - */ - public function setTaxIds(?array $taxIds): void - { - $this->taxIds['value'] = $taxIds; - } - - /** - * Unsets Tax Ids. - * A set of IDs indicating the taxes enabled for - * this item. When updating an item, any taxes listed here will be added to the item. - * Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. - */ - public function unsetTaxIds(): void - { - $this->taxIds = []; - } - - /** - * Returns Modifier List Info. - * A set of `CatalogItemModifierListInfo` objects - * representing the modifier lists that apply to this item, along with the overrides and min - * and max limits that are specific to this item. Modifier lists - * may also be added to or deleted from an item using `UpdateItemModifierLists`. - * - * @return CatalogItemModifierListInfo[]|null - */ - public function getModifierListInfo(): ?array - { - if (count($this->modifierListInfo) == 0) { - return null; - } - return $this->modifierListInfo['value']; - } - - /** - * Sets Modifier List Info. - * A set of `CatalogItemModifierListInfo` objects - * representing the modifier lists that apply to this item, along with the overrides and min - * and max limits that are specific to this item. Modifier lists - * may also be added to or deleted from an item using `UpdateItemModifierLists`. - * - * @maps modifier_list_info - * - * @param CatalogItemModifierListInfo[]|null $modifierListInfo - */ - public function setModifierListInfo(?array $modifierListInfo): void - { - $this->modifierListInfo['value'] = $modifierListInfo; - } - - /** - * Unsets Modifier List Info. - * A set of `CatalogItemModifierListInfo` objects - * representing the modifier lists that apply to this item, along with the overrides and min - * and max limits that are specific to this item. Modifier lists - * may also be added to or deleted from an item using `UpdateItemModifierLists`. - */ - public function unsetModifierListInfo(): void - { - $this->modifierListInfo = []; - } - - /** - * Returns Variations. - * A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must - * have - * at least one variation. - * - * @return CatalogObject[]|null - */ - public function getVariations(): ?array - { - if (count($this->variations) == 0) { - return null; - } - return $this->variations['value']; - } - - /** - * Sets Variations. - * A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must - * have - * at least one variation. - * - * @maps variations - * - * @param CatalogObject[]|null $variations - */ - public function setVariations(?array $variations): void - { - $this->variations['value'] = $variations; - } - - /** - * Unsets Variations. - * A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must - * have - * at least one variation. - */ - public function unsetVariations(): void - { - $this->variations = []; - } - - /** - * Returns Product Type. - * The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or - * `APPOINTMENTS_SERVICE` items. - */ - public function getProductType(): ?string - { - return $this->productType; - } - - /** - * Sets Product Type. - * The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or - * `APPOINTMENTS_SERVICE` items. - * - * @maps product_type - */ - public function setProductType(?string $productType): void - { - $this->productType = $productType; - } - - /** - * Returns Skip Modifier Screen. - * If `false`, the Square Point of Sale app will present the `CatalogItem`'s - * details screen immediately, allowing the merchant to choose `CatalogModifier`s - * before adding the item to the cart. This is the default behavior. - * - * If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre- - * selected - * modifiers, and merchants can edit modifiers by drilling down onto the item's details. - * - * Third-party clients are encouraged to implement similar behaviors. - */ - public function getSkipModifierScreen(): ?bool - { - if (count($this->skipModifierScreen) == 0) { - return null; - } - return $this->skipModifierScreen['value']; - } - - /** - * Sets Skip Modifier Screen. - * If `false`, the Square Point of Sale app will present the `CatalogItem`'s - * details screen immediately, allowing the merchant to choose `CatalogModifier`s - * before adding the item to the cart. This is the default behavior. - * - * If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre- - * selected - * modifiers, and merchants can edit modifiers by drilling down onto the item's details. - * - * Third-party clients are encouraged to implement similar behaviors. - * - * @maps skip_modifier_screen - */ - public function setSkipModifierScreen(?bool $skipModifierScreen): void - { - $this->skipModifierScreen['value'] = $skipModifierScreen; - } - - /** - * Unsets Skip Modifier Screen. - * If `false`, the Square Point of Sale app will present the `CatalogItem`'s - * details screen immediately, allowing the merchant to choose `CatalogModifier`s - * before adding the item to the cart. This is the default behavior. - * - * If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre- - * selected - * modifiers, and merchants can edit modifiers by drilling down onto the item's details. - * - * Third-party clients are encouraged to implement similar behaviors. - */ - public function unsetSkipModifierScreen(): void - { - $this->skipModifierScreen = []; - } - - /** - * Returns Item Options. - * List of item options IDs for this item. Used to manage and group item - * variations in a specified order. - * - * Maximum: 6 item options. - * - * @return CatalogItemOptionForItem[]|null - */ - public function getItemOptions(): ?array - { - if (count($this->itemOptions) == 0) { - return null; - } - return $this->itemOptions['value']; - } - - /** - * Sets Item Options. - * List of item options IDs for this item. Used to manage and group item - * variations in a specified order. - * - * Maximum: 6 item options. - * - * @maps item_options - * - * @param CatalogItemOptionForItem[]|null $itemOptions - */ - public function setItemOptions(?array $itemOptions): void - { - $this->itemOptions['value'] = $itemOptions; - } - - /** - * Unsets Item Options. - * List of item options IDs for this item. Used to manage and group item - * variations in a specified order. - * - * Maximum: 6 item options. - */ - public function unsetItemOptions(): void - { - $this->itemOptions = []; - } - - /** - * Returns Image Ids. - * The IDs of images associated with this `CatalogItem` instance. - * These images will be shown to customers in Square Online Store. - * The first image will show up as the icon for this item in POS. - * - * @return string[]|null - */ - public function getImageIds(): ?array - { - if (count($this->imageIds) == 0) { - return null; - } - return $this->imageIds['value']; - } - - /** - * Sets Image Ids. - * The IDs of images associated with this `CatalogItem` instance. - * These images will be shown to customers in Square Online Store. - * The first image will show up as the icon for this item in POS. - * - * @maps image_ids - * - * @param string[]|null $imageIds - */ - public function setImageIds(?array $imageIds): void - { - $this->imageIds['value'] = $imageIds; - } - - /** - * Unsets Image Ids. - * The IDs of images associated with this `CatalogItem` instance. - * These images will be shown to customers in Square Online Store. - * The first image will show up as the icon for this item in POS. - */ - public function unsetImageIds(): void - { - $this->imageIds = []; - } - - /** - * Returns Sort Name. - * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, - * the regular `name` field is used for sorting. - * Its value must not be empty. - * - * It is currently supported for sellers of the Japanese locale only. - */ - public function getSortName(): ?string - { - if (count($this->sortName) == 0) { - return null; - } - return $this->sortName['value']; - } - - /** - * Sets Sort Name. - * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, - * the regular `name` field is used for sorting. - * Its value must not be empty. - * - * It is currently supported for sellers of the Japanese locale only. - * - * @maps sort_name - */ - public function setSortName(?string $sortName): void - { - $this->sortName['value'] = $sortName; - } - - /** - * Unsets Sort Name. - * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, - * the regular `name` field is used for sorting. - * Its value must not be empty. - * - * It is currently supported for sellers of the Japanese locale only. - */ - public function unsetSortName(): void - { - $this->sortName = []; - } - - /** - * Returns Categories. - * The list of categories. - * - * @return CatalogObjectCategory[]|null - */ - public function getCategories(): ?array - { - if (count($this->categories) == 0) { - return null; - } - return $this->categories['value']; - } - - /** - * Sets Categories. - * The list of categories. - * - * @maps categories - * - * @param CatalogObjectCategory[]|null $categories - */ - public function setCategories(?array $categories): void - { - $this->categories['value'] = $categories; - } - - /** - * Unsets Categories. - * The list of categories. - */ - public function unsetCategories(): void - { - $this->categories = []; - } - - /** - * Returns Description Html. - * The item's description as expressed in valid HTML elements. The length of this field value, - * including those of HTML tags, - * is of Unicode points. With application query filters, the text values of the HTML elements and - * attributes are searchable. Invalid or - * unsupported HTML elements or attributes are ignored. - * - * Supported HTML elements include: - * - `a`: Link. Supports linking to website URLs, email address, and telephone numbers. - * - `b`, `strong`: Bold text - * - `br`: Line break - * - `code`: Computer code - * - `div`: Section - * - `h1-h6`: Headings - * - `i`, `em`: Italics - * - `li`: List element - * - `ol`: Numbered list - * - `p`: Paragraph - * - `ul`: Bullet list - * - `u`: Underline - * - * - * Supported HTML attributes include: - * - `align`: Alignment of the text content - * - `href`: Link destination - * - `rel`: Relationship between link's target and source - * - `target`: Place to open the linked document - */ - public function getDescriptionHtml(): ?string - { - if (count($this->descriptionHtml) == 0) { - return null; - } - return $this->descriptionHtml['value']; - } - - /** - * Sets Description Html. - * The item's description as expressed in valid HTML elements. The length of this field value, - * including those of HTML tags, - * is of Unicode points. With application query filters, the text values of the HTML elements and - * attributes are searchable. Invalid or - * unsupported HTML elements or attributes are ignored. - * - * Supported HTML elements include: - * - `a`: Link. Supports linking to website URLs, email address, and telephone numbers. - * - `b`, `strong`: Bold text - * - `br`: Line break - * - `code`: Computer code - * - `div`: Section - * - `h1-h6`: Headings - * - `i`, `em`: Italics - * - `li`: List element - * - `ol`: Numbered list - * - `p`: Paragraph - * - `ul`: Bullet list - * - `u`: Underline - * - * - * Supported HTML attributes include: - * - `align`: Alignment of the text content - * - `href`: Link destination - * - `rel`: Relationship between link's target and source - * - `target`: Place to open the linked document - * - * @maps description_html - */ - public function setDescriptionHtml(?string $descriptionHtml): void - { - $this->descriptionHtml['value'] = $descriptionHtml; - } - - /** - * Unsets Description Html. - * The item's description as expressed in valid HTML elements. The length of this field value, - * including those of HTML tags, - * is of Unicode points. With application query filters, the text values of the HTML elements and - * attributes are searchable. Invalid or - * unsupported HTML elements or attributes are ignored. - * - * Supported HTML elements include: - * - `a`: Link. Supports linking to website URLs, email address, and telephone numbers. - * - `b`, `strong`: Bold text - * - `br`: Line break - * - `code`: Computer code - * - `div`: Section - * - `h1-h6`: Headings - * - `i`, `em`: Italics - * - `li`: List element - * - `ol`: Numbered list - * - `p`: Paragraph - * - `ul`: Bullet list - * - `u`: Underline - * - * - * Supported HTML attributes include: - * - `align`: Alignment of the text content - * - `href`: Link destination - * - `rel`: Relationship between link's target and source - * - `target`: Place to open the linked document - */ - public function unsetDescriptionHtml(): void - { - $this->descriptionHtml = []; - } - - /** - * Returns Description Plaintext. - * A server-generated plaintext version of the `description_html` field, without formatting tags. - */ - public function getDescriptionPlaintext(): ?string - { - return $this->descriptionPlaintext; - } - - /** - * Sets Description Plaintext. - * A server-generated plaintext version of the `description_html` field, without formatting tags. - * - * @maps description_plaintext - */ - public function setDescriptionPlaintext(?string $descriptionPlaintext): void - { - $this->descriptionPlaintext = $descriptionPlaintext; - } - - /** - * Returns Channels. - * A list of IDs representing channels, such as a Square Online site, where the item can be made - * visible or available. - * - * @return string[]|null - */ - public function getChannels(): ?array - { - if (count($this->channels) == 0) { - return null; - } - return $this->channels['value']; - } - - /** - * Sets Channels. - * A list of IDs representing channels, such as a Square Online site, where the item can be made - * visible or available. - * - * @maps channels - * - * @param string[]|null $channels - */ - public function setChannels(?array $channels): void - { - $this->channels['value'] = $channels; - } - - /** - * Unsets Channels. - * A list of IDs representing channels, such as a Square Online site, where the item can be made - * visible or available. - */ - public function unsetChannels(): void - { - $this->channels = []; - } - - /** - * Returns Is Archived. - * Indicates whether this item is archived (`true`) or not (`false`). - */ - public function getIsArchived(): ?bool - { - if (count($this->isArchived) == 0) { - return null; - } - return $this->isArchived['value']; - } - - /** - * Sets Is Archived. - * Indicates whether this item is archived (`true`) or not (`false`). - * - * @maps is_archived - */ - public function setIsArchived(?bool $isArchived): void - { - $this->isArchived['value'] = $isArchived; - } - - /** - * Unsets Is Archived. - * Indicates whether this item is archived (`true`) or not (`false`). - */ - public function unsetIsArchived(): void - { - $this->isArchived = []; - } - - /** - * Returns Ecom Seo Data. - * SEO data for for a seller's Square Online store. - */ - public function getEcomSeoData(): ?CatalogEcomSeoData - { - return $this->ecomSeoData; - } - - /** - * Sets Ecom Seo Data. - * SEO data for for a seller's Square Online store. - * - * @maps ecom_seo_data - */ - public function setEcomSeoData(?CatalogEcomSeoData $ecomSeoData): void - { - $this->ecomSeoData = $ecomSeoData; - } - - /** - * Returns Food and Beverage Details. - * The food and beverage-specific details of a `FOOD_AND_BEV` item. - */ - public function getFoodAndBeverageDetails(): ?CatalogItemFoodAndBeverageDetails - { - return $this->foodAndBeverageDetails; - } - - /** - * Sets Food and Beverage Details. - * The food and beverage-specific details of a `FOOD_AND_BEV` item. - * - * @maps food_and_beverage_details - */ - public function setFoodAndBeverageDetails(?CatalogItemFoodAndBeverageDetails $foodAndBeverageDetails): void - { - $this->foodAndBeverageDetails = $foodAndBeverageDetails; - } - - /** - * Returns Reporting Category. - * A category that can be assigned to an item or a parent category that can be assigned - * to another category. For example, a clothing category can be assigned to a t-shirt item or - * be made as the parent category to the pants category. - */ - public function getReportingCategory(): ?CatalogObjectCategory - { - return $this->reportingCategory; - } - - /** - * Sets Reporting Category. - * A category that can be assigned to an item or a parent category that can be assigned - * to another category. For example, a clothing category can be assigned to a t-shirt item or - * be made as the parent category to the pants category. - * - * @maps reporting_category - */ - public function setReportingCategory(?CatalogObjectCategory $reportingCategory): void - { - $this->reportingCategory = $reportingCategory; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (!empty($this->abbreviation)) { - $json['abbreviation'] = $this->abbreviation['value']; - } - if (!empty($this->labelColor)) { - $json['label_color'] = $this->labelColor['value']; - } - if (!empty($this->isTaxable)) { - $json['is_taxable'] = $this->isTaxable['value']; - } - if (!empty($this->availableOnline)) { - $json['available_online'] = $this->availableOnline['value']; - } - if (!empty($this->availableForPickup)) { - $json['available_for_pickup'] = $this->availableForPickup['value']; - } - if (!empty($this->availableElectronically)) { - $json['available_electronically'] = $this->availableElectronically['value']; - } - if (!empty($this->categoryId)) { - $json['category_id'] = $this->categoryId['value']; - } - if (!empty($this->taxIds)) { - $json['tax_ids'] = $this->taxIds['value']; - } - if (!empty($this->modifierListInfo)) { - $json['modifier_list_info'] = $this->modifierListInfo['value']; - } - if (!empty($this->variations)) { - $json['variations'] = $this->variations['value']; - } - if (isset($this->productType)) { - $json['product_type'] = $this->productType; - } - if (!empty($this->skipModifierScreen)) { - $json['skip_modifier_screen'] = $this->skipModifierScreen['value']; - } - if (!empty($this->itemOptions)) { - $json['item_options'] = $this->itemOptions['value']; - } - if (!empty($this->imageIds)) { - $json['image_ids'] = $this->imageIds['value']; - } - if (!empty($this->sortName)) { - $json['sort_name'] = $this->sortName['value']; - } - if (!empty($this->categories)) { - $json['categories'] = $this->categories['value']; - } - if (!empty($this->descriptionHtml)) { - $json['description_html'] = $this->descriptionHtml['value']; - } - if (isset($this->descriptionPlaintext)) { - $json['description_plaintext'] = $this->descriptionPlaintext; - } - if (!empty($this->channels)) { - $json['channels'] = $this->channels['value']; - } - if (!empty($this->isArchived)) { - $json['is_archived'] = $this->isArchived['value']; - } - if (isset($this->ecomSeoData)) { - $json['ecom_seo_data'] = $this->ecomSeoData; - } - if (isset($this->foodAndBeverageDetails)) { - $json['food_and_beverage_details'] = $this->foodAndBeverageDetails; - } - if (isset($this->reportingCategory)) { - $json['reporting_category'] = $this->reportingCategory; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemFoodAndBeverageDetails.php b/src/Models/CatalogItemFoodAndBeverageDetails.php deleted file mode 100644 index 20b3ca21..00000000 --- a/src/Models/CatalogItemFoodAndBeverageDetails.php +++ /dev/null @@ -1,160 +0,0 @@ -calorieCount) == 0) { - return null; - } - return $this->calorieCount['value']; - } - - /** - * Sets Calorie Count. - * The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items. - * - * @maps calorie_count - */ - public function setCalorieCount(?int $calorieCount): void - { - $this->calorieCount['value'] = $calorieCount; - } - - /** - * Unsets Calorie Count. - * The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items. - */ - public function unsetCalorieCount(): void - { - $this->calorieCount = []; - } - - /** - * Returns Dietary Preferences. - * The dietary preferences for the `FOOD_AND_BEV` item. - * - * @return CatalogItemFoodAndBeverageDetailsDietaryPreference[]|null - */ - public function getDietaryPreferences(): ?array - { - if (count($this->dietaryPreferences) == 0) { - return null; - } - return $this->dietaryPreferences['value']; - } - - /** - * Sets Dietary Preferences. - * The dietary preferences for the `FOOD_AND_BEV` item. - * - * @maps dietary_preferences - * - * @param CatalogItemFoodAndBeverageDetailsDietaryPreference[]|null $dietaryPreferences - */ - public function setDietaryPreferences(?array $dietaryPreferences): void - { - $this->dietaryPreferences['value'] = $dietaryPreferences; - } - - /** - * Unsets Dietary Preferences. - * The dietary preferences for the `FOOD_AND_BEV` item. - */ - public function unsetDietaryPreferences(): void - { - $this->dietaryPreferences = []; - } - - /** - * Returns Ingredients. - * The ingredients for the `FOOD_AND_BEV` type item. - * - * @return CatalogItemFoodAndBeverageDetailsIngredient[]|null - */ - public function getIngredients(): ?array - { - if (count($this->ingredients) == 0) { - return null; - } - return $this->ingredients['value']; - } - - /** - * Sets Ingredients. - * The ingredients for the `FOOD_AND_BEV` type item. - * - * @maps ingredients - * - * @param CatalogItemFoodAndBeverageDetailsIngredient[]|null $ingredients - */ - public function setIngredients(?array $ingredients): void - { - $this->ingredients['value'] = $ingredients; - } - - /** - * Unsets Ingredients. - * The ingredients for the `FOOD_AND_BEV` type item. - */ - public function unsetIngredients(): void - { - $this->ingredients = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->calorieCount)) { - $json['calorie_count'] = $this->calorieCount['value']; - } - if (!empty($this->dietaryPreferences)) { - $json['dietary_preferences'] = $this->dietaryPreferences['value']; - } - if (!empty($this->ingredients)) { - $json['ingredients'] = $this->ingredients['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreference.php b/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreference.php deleted file mode 100644 index eacb6bf1..00000000 --- a/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreference.php +++ /dev/null @@ -1,131 +0,0 @@ -type; - } - - /** - * Sets Type. - * The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Standard Name. - * Standard dietary preferences for food and beverage items that are recommended on item creation. - */ - public function getStandardName(): ?string - { - return $this->standardName; - } - - /** - * Sets Standard Name. - * Standard dietary preferences for food and beverage items that are recommended on item creation. - * - * @maps standard_name - */ - public function setStandardName(?string $standardName): void - { - $this->standardName = $standardName; - } - - /** - * Returns Custom Name. - * The name of a user-defined custom dietary preference. This should be null if it's a standard dietary - * preference. - */ - public function getCustomName(): ?string - { - if (count($this->customName) == 0) { - return null; - } - return $this->customName['value']; - } - - /** - * Sets Custom Name. - * The name of a user-defined custom dietary preference. This should be null if it's a standard dietary - * preference. - * - * @maps custom_name - */ - public function setCustomName(?string $customName): void - { - $this->customName['value'] = $customName; - } - - /** - * Unsets Custom Name. - * The name of a user-defined custom dietary preference. This should be null if it's a standard dietary - * preference. - */ - public function unsetCustomName(): void - { - $this->customName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->standardName)) { - $json['standard_name'] = $this->standardName; - } - if (!empty($this->customName)) { - $json['custom_name'] = $this->customName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php b/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php deleted file mode 100644 index 7640fbfb..00000000 --- a/src/Models/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php +++ /dev/null @@ -1,25 +0,0 @@ -type; - } - - /** - * Sets Type. - * The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Standard Name. - * Standard ingredients for food and beverage items that are recommended on item creation. - */ - public function getStandardName(): ?string - { - return $this->standardName; - } - - /** - * Sets Standard Name. - * Standard ingredients for food and beverage items that are recommended on item creation. - * - * @maps standard_name - */ - public function setStandardName(?string $standardName): void - { - $this->standardName = $standardName; - } - - /** - * Returns Custom Name. - * The name of a custom user-defined ingredient. This should be null if it's a standard dietary - * preference. - */ - public function getCustomName(): ?string - { - if (count($this->customName) == 0) { - return null; - } - return $this->customName['value']; - } - - /** - * Sets Custom Name. - * The name of a custom user-defined ingredient. This should be null if it's a standard dietary - * preference. - * - * @maps custom_name - */ - public function setCustomName(?string $customName): void - { - $this->customName['value'] = $customName; - } - - /** - * Unsets Custom Name. - * The name of a custom user-defined ingredient. This should be null if it's a standard dietary - * preference. - */ - public function unsetCustomName(): void - { - $this->customName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->standardName)) { - $json['standard_name'] = $this->standardName; - } - if (!empty($this->customName)) { - $json['custom_name'] = $this->customName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php b/src/Models/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php deleted file mode 100644 index b3fc63c2..00000000 --- a/src/Models/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php +++ /dev/null @@ -1,39 +0,0 @@ -modifierListId = $modifierListId; - } - - /** - * Returns Modifier List Id. - * The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`. - */ - public function getModifierListId(): string - { - return $this->modifierListId; - } - - /** - * Sets Modifier List Id. - * The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`. - * - * @required - * @maps modifier_list_id - */ - public function setModifierListId(string $modifierListId): void - { - $this->modifierListId = $modifierListId; - } - - /** - * Returns Modifier Overrides. - * A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is - * enabled by default. - * - * @return CatalogModifierOverride[]|null - */ - public function getModifierOverrides(): ?array - { - if (count($this->modifierOverrides) == 0) { - return null; - } - return $this->modifierOverrides['value']; - } - - /** - * Sets Modifier Overrides. - * A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is - * enabled by default. - * - * @maps modifier_overrides - * - * @param CatalogModifierOverride[]|null $modifierOverrides - */ - public function setModifierOverrides(?array $modifierOverrides): void - { - $this->modifierOverrides['value'] = $modifierOverrides; - } - - /** - * Unsets Modifier Overrides. - * A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is - * enabled by default. - */ - public function unsetModifierOverrides(): void - { - $this->modifierOverrides = []; - } - - /** - * Returns Min Selected Modifiers. - * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - */ - public function getMinSelectedModifiers(): ?int - { - if (count($this->minSelectedModifiers) == 0) { - return null; - } - return $this->minSelectedModifiers['value']; - } - - /** - * Sets Min Selected Modifiers. - * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - * - * @maps min_selected_modifiers - */ - public function setMinSelectedModifiers(?int $minSelectedModifiers): void - { - $this->minSelectedModifiers['value'] = $minSelectedModifiers; - } - - /** - * Unsets Min Selected Modifiers. - * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - */ - public function unsetMinSelectedModifiers(): void - { - $this->minSelectedModifiers = []; - } - - /** - * Returns Max Selected Modifiers. - * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - */ - public function getMaxSelectedModifiers(): ?int - { - if (count($this->maxSelectedModifiers) == 0) { - return null; - } - return $this->maxSelectedModifiers['value']; - } - - /** - * Sets Max Selected Modifiers. - * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - * - * @maps max_selected_modifiers - */ - public function setMaxSelectedModifiers(?int $maxSelectedModifiers): void - { - $this->maxSelectedModifiers['value'] = $maxSelectedModifiers; - } - - /** - * Unsets Max Selected Modifiers. - * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this - * `CatalogModifierList`. - * The default value is `-1`. - * - * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of - * modifiers of - * the `CatalogModifierList` can be selected from the `CatalogModifierList`. - * - * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo. - * min_selected_modifiers=-1` - * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be - * present in - * and can be selected from the `CatalogModifierList` - */ - public function unsetMaxSelectedModifiers(): void - { - $this->maxSelectedModifiers = []; - } - - /** - * Returns Enabled. - * If `true`, enable this `CatalogModifierList`. The default value is `true`. - */ - public function getEnabled(): ?bool - { - if (count($this->enabled) == 0) { - return null; - } - return $this->enabled['value']; - } - - /** - * Sets Enabled. - * If `true`, enable this `CatalogModifierList`. The default value is `true`. - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled['value'] = $enabled; - } - - /** - * Unsets Enabled. - * If `true`, enable this `CatalogModifierList`. The default value is `true`. - */ - public function unsetEnabled(): void - { - $this->enabled = []; - } - - /** - * Returns Ordinal. - * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list - * applied - * to a `CatalogItem` instance. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list - * applied - * to a `CatalogItem` instance. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list - * applied - * to a `CatalogItem` instance. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['modifier_list_id'] = $this->modifierListId; - if (!empty($this->modifierOverrides)) { - $json['modifier_overrides'] = $this->modifierOverrides['value']; - } - if (!empty($this->minSelectedModifiers)) { - $json['min_selected_modifiers'] = $this->minSelectedModifiers['value']; - } - if (!empty($this->maxSelectedModifiers)) { - $json['max_selected_modifiers'] = $this->maxSelectedModifiers['value']; - } - if (!empty($this->enabled)) { - $json['enabled'] = $this->enabled['value']; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemOption.php b/src/Models/CatalogItemOption.php deleted file mode 100644 index a2b1df67..00000000 --- a/src/Models/CatalogItemOption.php +++ /dev/null @@ -1,251 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The item option's display name for the seller. Must be unique across - * all item options. This is a searchable attribute for use in applicable query filters. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The item option's display name for the seller. Must be unique across - * all item options. This is a searchable attribute for use in applicable query filters. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Display Name. - * The item option's display name for the customer. This is a searchable attribute for use in - * applicable query filters. - */ - public function getDisplayName(): ?string - { - if (count($this->displayName) == 0) { - return null; - } - return $this->displayName['value']; - } - - /** - * Sets Display Name. - * The item option's display name for the customer. This is a searchable attribute for use in - * applicable query filters. - * - * @maps display_name - */ - public function setDisplayName(?string $displayName): void - { - $this->displayName['value'] = $displayName; - } - - /** - * Unsets Display Name. - * The item option's display name for the customer. This is a searchable attribute for use in - * applicable query filters. - */ - public function unsetDisplayName(): void - { - $this->displayName = []; - } - - /** - * Returns Description. - * The item option's human-readable description. Displayed in the Square - * Point of Sale app for the seller and in the Online Store or on receipts for - * the buyer. This is a searchable attribute for use in applicable query filters. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The item option's human-readable description. Displayed in the Square - * Point of Sale app for the seller and in the Online Store or on receipts for - * the buyer. This is a searchable attribute for use in applicable query filters. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The item option's human-readable description. Displayed in the Square - * Point of Sale app for the seller and in the Online Store or on receipts for - * the buyer. This is a searchable attribute for use in applicable query filters. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Show Colors. - * If true, display colors for entries in `values` when present. - */ - public function getShowColors(): ?bool - { - if (count($this->showColors) == 0) { - return null; - } - return $this->showColors['value']; - } - - /** - * Sets Show Colors. - * If true, display colors for entries in `values` when present. - * - * @maps show_colors - */ - public function setShowColors(?bool $showColors): void - { - $this->showColors['value'] = $showColors; - } - - /** - * Unsets Show Colors. - * If true, display colors for entries in `values` when present. - */ - public function unsetShowColors(): void - { - $this->showColors = []; - } - - /** - * Returns Values. - * A list of CatalogObjects containing the - * `CatalogItemOptionValue`s for this item. - * - * @return CatalogObject[]|null - */ - public function getValues(): ?array - { - if (count($this->values) == 0) { - return null; - } - return $this->values['value']; - } - - /** - * Sets Values. - * A list of CatalogObjects containing the - * `CatalogItemOptionValue`s for this item. - * - * @maps values - * - * @param CatalogObject[]|null $values - */ - public function setValues(?array $values): void - { - $this->values['value'] = $values; - } - - /** - * Unsets Values. - * A list of CatalogObjects containing the - * `CatalogItemOptionValue`s for this item. - */ - public function unsetValues(): void - { - $this->values = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->displayName)) { - $json['display_name'] = $this->displayName['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (!empty($this->showColors)) { - $json['show_colors'] = $this->showColors['value']; - } - if (!empty($this->values)) { - $json['values'] = $this->values['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemOptionForItem.php b/src/Models/CatalogItemOptionForItem.php deleted file mode 100644 index 981fd7a8..00000000 --- a/src/Models/CatalogItemOptionForItem.php +++ /dev/null @@ -1,76 +0,0 @@ -itemOptionId) == 0) { - return null; - } - return $this->itemOptionId['value']; - } - - /** - * Sets Item Option Id. - * The unique id of the item option, used to form the dimensions of the item option matrix in a - * specified order. - * - * @maps item_option_id - */ - public function setItemOptionId(?string $itemOptionId): void - { - $this->itemOptionId['value'] = $itemOptionId; - } - - /** - * Unsets Item Option Id. - * The unique id of the item option, used to form the dimensions of the item option matrix in a - * specified order. - */ - public function unsetItemOptionId(): void - { - $this->itemOptionId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemOptionId)) { - $json['item_option_id'] = $this->itemOptionId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemOptionValue.php b/src/Models/CatalogItemOptionValue.php deleted file mode 100644 index cdfd0429..00000000 --- a/src/Models/CatalogItemOptionValue.php +++ /dev/null @@ -1,246 +0,0 @@ -itemOptionId) == 0) { - return null; - } - return $this->itemOptionId['value']; - } - - /** - * Sets Item Option Id. - * Unique ID of the associated item option. - * - * @maps item_option_id - */ - public function setItemOptionId(?string $itemOptionId): void - { - $this->itemOptionId['value'] = $itemOptionId; - } - - /** - * Unsets Item Option Id. - * Unique ID of the associated item option. - */ - public function unsetItemOptionId(): void - { - $this->itemOptionId = []; - } - - /** - * Returns Name. - * Name of this item option value. This is a searchable attribute for use in applicable query filters. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * Name of this item option value. This is a searchable attribute for use in applicable query filters. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * Name of this item option value. This is a searchable attribute for use in applicable query filters. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Description. - * A human-readable description for the option value. This is a searchable attribute for use in - * applicable query filters. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * A human-readable description for the option value. This is a searchable attribute for use in - * applicable query filters. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * A human-readable description for the option value. This is a searchable attribute for use in - * applicable query filters. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Color. - * The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). - * Only displayed if `show_colors` is enabled on the parent `ItemOption`. When - * left unset, `color` defaults to white ("#ffffff") when `show_colors` is - * enabled on the parent `ItemOption`. - */ - public function getColor(): ?string - { - if (count($this->color) == 0) { - return null; - } - return $this->color['value']; - } - - /** - * Sets Color. - * The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). - * Only displayed if `show_colors` is enabled on the parent `ItemOption`. When - * left unset, `color` defaults to white ("#ffffff") when `show_colors` is - * enabled on the parent `ItemOption`. - * - * @maps color - */ - public function setColor(?string $color): void - { - $this->color['value'] = $color; - } - - /** - * Unsets Color. - * The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). - * Only displayed if `show_colors` is enabled on the parent `ItemOption`. When - * left unset, `color` defaults to white ("#ffffff") when `show_colors` is - * enabled on the parent `ItemOption`. - */ - public function unsetColor(): void - { - $this->color = []; - } - - /** - * Returns Ordinal. - * Determines where this option value appears in a list of option values. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * Determines where this option value appears in a list of option values. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * Determines where this option value appears in a list of option values. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemOptionId)) { - $json['item_option_id'] = $this->itemOptionId['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (!empty($this->color)) { - $json['color'] = $this->color['value']; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemOptionValueForItemVariation.php b/src/Models/CatalogItemOptionValueForItemVariation.php deleted file mode 100644 index 8543bf8b..00000000 --- a/src/Models/CatalogItemOptionValueForItemVariation.php +++ /dev/null @@ -1,115 +0,0 @@ -itemOptionId) == 0) { - return null; - } - return $this->itemOptionId['value']; - } - - /** - * Sets Item Option Id. - * The unique id of an item option. - * - * @maps item_option_id - */ - public function setItemOptionId(?string $itemOptionId): void - { - $this->itemOptionId['value'] = $itemOptionId; - } - - /** - * Unsets Item Option Id. - * The unique id of an item option. - */ - public function unsetItemOptionId(): void - { - $this->itemOptionId = []; - } - - /** - * Returns Item Option Value Id. - * The unique id of the selected value for the item option. - */ - public function getItemOptionValueId(): ?string - { - if (count($this->itemOptionValueId) == 0) { - return null; - } - return $this->itemOptionValueId['value']; - } - - /** - * Sets Item Option Value Id. - * The unique id of the selected value for the item option. - * - * @maps item_option_value_id - */ - public function setItemOptionValueId(?string $itemOptionValueId): void - { - $this->itemOptionValueId['value'] = $itemOptionValueId; - } - - /** - * Unsets Item Option Value Id. - * The unique id of the selected value for the item option. - */ - public function unsetItemOptionValueId(): void - { - $this->itemOptionValueId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemOptionId)) { - $json['item_option_id'] = $this->itemOptionId['value']; - } - if (!empty($this->itemOptionValueId)) { - $json['item_option_value_id'] = $this->itemOptionValueId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogItemProductType.php b/src/Models/CatalogItemProductType.php deleted file mode 100644 index 3b78bda4..00000000 --- a/src/Models/CatalogItemProductType.php +++ /dev/null @@ -1,59 +0,0 @@ -itemId) == 0) { - return null; - } - return $this->itemId['value']; - } - - /** - * Sets Item Id. - * The ID of the `CatalogItem` associated with this item variation. - * - * @maps item_id - */ - public function setItemId(?string $itemId): void - { - $this->itemId['value'] = $itemId; - } - - /** - * Unsets Item Id. - * The ID of the `CatalogItem` associated with this item variation. - */ - public function unsetItemId(): void - { - $this->itemId = []; - } - - /** - * Returns Name. - * The item variation's name. This is a searchable attribute for use in applicable query filters. - * - * Its value has a maximum length of 255 Unicode code points. However, when the parent [item](entity: - * CatalogItem) - * uses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can - * be - * longer than 255 Unicode code points. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The item variation's name. This is a searchable attribute for use in applicable query filters. - * - * Its value has a maximum length of 255 Unicode code points. However, when the parent [item](entity: - * CatalogItem) - * uses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can - * be - * longer than 255 Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The item variation's name. This is a searchable attribute for use in applicable query filters. - * - * Its value has a maximum length of 255 Unicode code points. However, when the parent [item](entity: - * CatalogItem) - * uses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can - * be - * longer than 255 Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Sku. - * The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. - */ - public function getSku(): ?string - { - if (count($this->sku) == 0) { - return null; - } - return $this->sku['value']; - } - - /** - * Sets Sku. - * The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. - * - * @maps sku - */ - public function setSku(?string $sku): void - { - $this->sku['value'] = $sku; - } - - /** - * Unsets Sku. - * The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. - */ - public function unsetSku(): void - { - $this->sku = []; - } - - /** - * Returns Upc. - * The universal product code (UPC) of the item variation, if any. This is a searchable attribute for - * use in applicable query filters. - * - * The value of this attribute should be a number of 12-14 digits long. This restriction is enforced - * on the Square Seller Dashboard, - * Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If - * a non-compliant UPC value is assigned - * to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of - * Sale or Retail Point of Sale apps - * unless it is updated to fit the expected format. - */ - public function getUpc(): ?string - { - if (count($this->upc) == 0) { - return null; - } - return $this->upc['value']; - } - - /** - * Sets Upc. - * The universal product code (UPC) of the item variation, if any. This is a searchable attribute for - * use in applicable query filters. - * - * The value of this attribute should be a number of 12-14 digits long. This restriction is enforced - * on the Square Seller Dashboard, - * Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If - * a non-compliant UPC value is assigned - * to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of - * Sale or Retail Point of Sale apps - * unless it is updated to fit the expected format. - * - * @maps upc - */ - public function setUpc(?string $upc): void - { - $this->upc['value'] = $upc; - } - - /** - * Unsets Upc. - * The universal product code (UPC) of the item variation, if any. This is a searchable attribute for - * use in applicable query filters. - * - * The value of this attribute should be a number of 12-14 digits long. This restriction is enforced - * on the Square Seller Dashboard, - * Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If - * a non-compliant UPC value is assigned - * to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of - * Sale or Retail Point of Sale apps - * unless it is updated to fit the expected format. - */ - public function unsetUpc(): void - { - $this->upc = []; - } - - /** - * Returns Ordinal. - * The order in which this item variation should be displayed. This value is read-only. On writes, the - * ordinal - * for each item variation within a parent `CatalogItem` is set according to the item variations's - * position. On reads, the value is not guaranteed to be sequential or unique. - */ - public function getOrdinal(): ?int - { - return $this->ordinal; - } - - /** - * Sets Ordinal. - * The order in which this item variation should be displayed. This value is read-only. On writes, the - * ordinal - * for each item variation within a parent `CatalogItem` is set according to the item variations's - * position. On reads, the value is not guaranteed to be sequential or unique. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal = $ordinal; - } - - /** - * Returns Pricing Type. - * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - */ - public function getPricingType(): ?string - { - return $this->pricingType; - } - - /** - * Sets Pricing Type. - * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - * - * @maps pricing_type - */ - public function setPricingType(?string $pricingType): void - { - $this->pricingType = $pricingType; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): ?Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_money - */ - public function setPriceMoney(?Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Returns Location Overrides. - * Per-location price and inventory overrides. - * - * @return ItemVariationLocationOverrides[]|null - */ - public function getLocationOverrides(): ?array - { - if (count($this->locationOverrides) == 0) { - return null; - } - return $this->locationOverrides['value']; - } - - /** - * Sets Location Overrides. - * Per-location price and inventory overrides. - * - * @maps location_overrides - * - * @param ItemVariationLocationOverrides[]|null $locationOverrides - */ - public function setLocationOverrides(?array $locationOverrides): void - { - $this->locationOverrides['value'] = $locationOverrides; - } - - /** - * Unsets Location Overrides. - * Per-location price and inventory overrides. - */ - public function unsetLocationOverrides(): void - { - $this->locationOverrides = []; - } - - /** - * Returns Track Inventory. - * If `true`, inventory tracking is active for the variation. - */ - public function getTrackInventory(): ?bool - { - if (count($this->trackInventory) == 0) { - return null; - } - return $this->trackInventory['value']; - } - - /** - * Sets Track Inventory. - * If `true`, inventory tracking is active for the variation. - * - * @maps track_inventory - */ - public function setTrackInventory(?bool $trackInventory): void - { - $this->trackInventory['value'] = $trackInventory; - } - - /** - * Unsets Track Inventory. - * If `true`, inventory tracking is active for the variation. - */ - public function unsetTrackInventory(): void - { - $this->trackInventory = []; - } - - /** - * Returns Inventory Alert Type. - * Indicates whether Square should alert the merchant when the inventory quantity of a - * CatalogItemVariation is low. - */ - public function getInventoryAlertType(): ?string - { - return $this->inventoryAlertType; - } - - /** - * Sets Inventory Alert Type. - * Indicates whether Square should alert the merchant when the inventory quantity of a - * CatalogItemVariation is low. - * - * @maps inventory_alert_type - */ - public function setInventoryAlertType(?string $inventoryAlertType): void - { - $this->inventoryAlertType = $inventoryAlertType; - } - - /** - * Returns Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - */ - public function getInventoryAlertThreshold(): ?int - { - if (count($this->inventoryAlertThreshold) == 0) { - return null; - } - return $this->inventoryAlertThreshold['value']; - } - - /** - * Sets Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - * - * @maps inventory_alert_threshold - */ - public function setInventoryAlertThreshold(?int $inventoryAlertThreshold): void - { - $this->inventoryAlertThreshold['value'] = $inventoryAlertThreshold; - } - - /** - * Unsets Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - */ - public function unsetInventoryAlertThreshold(): void - { - $this->inventoryAlertThreshold = []; - } - - /** - * Returns User Data. - * Arbitrary user metadata to associate with the item variation. This attribute value length is of - * Unicode code points. - */ - public function getUserData(): ?string - { - if (count($this->userData) == 0) { - return null; - } - return $this->userData['value']; - } - - /** - * Sets User Data. - * Arbitrary user metadata to associate with the item variation. This attribute value length is of - * Unicode code points. - * - * @maps user_data - */ - public function setUserData(?string $userData): void - { - $this->userData['value'] = $userData; - } - - /** - * Unsets User Data. - * Arbitrary user metadata to associate with the item variation. This attribute value length is of - * Unicode code points. - */ - public function unsetUserData(): void - { - $this->userData = []; - } - - /** - * Returns Service Duration. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For - * example, a 30 minute appointment would have the value `1800000`, which is equal to - * 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). - */ - public function getServiceDuration(): ?int - { - if (count($this->serviceDuration) == 0) { - return null; - } - return $this->serviceDuration['value']; - } - - /** - * Sets Service Duration. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For - * example, a 30 minute appointment would have the value `1800000`, which is equal to - * 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). - * - * @maps service_duration - */ - public function setServiceDuration(?int $serviceDuration): void - { - $this->serviceDuration['value'] = $serviceDuration; - } - - /** - * Unsets Service Duration. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For - * example, a 30 minute appointment would have the value `1800000`, which is equal to - * 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). - */ - public function unsetServiceDuration(): void - { - $this->serviceDuration = []; - } - - /** - * Returns Available for Booking. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. - */ - public function getAvailableForBooking(): ?bool - { - if (count($this->availableForBooking) == 0) { - return null; - } - return $this->availableForBooking['value']; - } - - /** - * Sets Available for Booking. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. - * - * @maps available_for_booking - */ - public function setAvailableForBooking(?bool $availableForBooking): void - { - $this->availableForBooking['value'] = $availableForBooking; - } - - /** - * Unsets Available for Booking. - * If the `CatalogItem` that owns this item variation is of type - * `APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. - */ - public function unsetAvailableForBooking(): void - { - $this->availableForBooking = []; - } - - /** - * Returns Item Option Values. - * List of item option values associated with this item variation. Listed - * in the same order as the item options of the parent item. - * - * @return CatalogItemOptionValueForItemVariation[]|null - */ - public function getItemOptionValues(): ?array - { - if (count($this->itemOptionValues) == 0) { - return null; - } - return $this->itemOptionValues['value']; - } - - /** - * Sets Item Option Values. - * List of item option values associated with this item variation. Listed - * in the same order as the item options of the parent item. - * - * @maps item_option_values - * - * @param CatalogItemOptionValueForItemVariation[]|null $itemOptionValues - */ - public function setItemOptionValues(?array $itemOptionValues): void - { - $this->itemOptionValues['value'] = $itemOptionValues; - } - - /** - * Unsets Item Option Values. - * List of item option values associated with this item variation. Listed - * in the same order as the item options of the parent item. - */ - public function unsetItemOptionValues(): void - { - $this->itemOptionValues = []; - } - - /** - * Returns Measurement Unit Id. - * ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity - * sold of this item variation. If left unset, the item will be sold in - * whole quantities. - */ - public function getMeasurementUnitId(): ?string - { - if (count($this->measurementUnitId) == 0) { - return null; - } - return $this->measurementUnitId['value']; - } - - /** - * Sets Measurement Unit Id. - * ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity - * sold of this item variation. If left unset, the item will be sold in - * whole quantities. - * - * @maps measurement_unit_id - */ - public function setMeasurementUnitId(?string $measurementUnitId): void - { - $this->measurementUnitId['value'] = $measurementUnitId; - } - - /** - * Unsets Measurement Unit Id. - * ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity - * sold of this item variation. If left unset, the item will be sold in - * whole quantities. - */ - public function unsetMeasurementUnitId(): void - { - $this->measurementUnitId = []; - } - - /** - * Returns Sellable. - * Whether this variation can be sold. The inventory count of a sellable variation indicates - * the number of units available for sale. When a variation is both stockable and sellable, - * its sellable inventory count can be smaller than or equal to its stockable count. - */ - public function getSellable(): ?bool - { - if (count($this->sellable) == 0) { - return null; - } - return $this->sellable['value']; - } - - /** - * Sets Sellable. - * Whether this variation can be sold. The inventory count of a sellable variation indicates - * the number of units available for sale. When a variation is both stockable and sellable, - * its sellable inventory count can be smaller than or equal to its stockable count. - * - * @maps sellable - */ - public function setSellable(?bool $sellable): void - { - $this->sellable['value'] = $sellable; - } - - /** - * Unsets Sellable. - * Whether this variation can be sold. The inventory count of a sellable variation indicates - * the number of units available for sale. When a variation is both stockable and sellable, - * its sellable inventory count can be smaller than or equal to its stockable count. - */ - public function unsetSellable(): void - { - $this->sellable = []; - } - - /** - * Returns Stockable. - * Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE). - * When a variation is both stockable and sellable, the inventory count of a stockable variation keeps - * track of the number of units of this variation in stock - * and is not an indicator of the number of units of the variation that can be sold. - */ - public function getStockable(): ?bool - { - if (count($this->stockable) == 0) { - return null; - } - return $this->stockable['value']; - } - - /** - * Sets Stockable. - * Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE). - * When a variation is both stockable and sellable, the inventory count of a stockable variation keeps - * track of the number of units of this variation in stock - * and is not an indicator of the number of units of the variation that can be sold. - * - * @maps stockable - */ - public function setStockable(?bool $stockable): void - { - $this->stockable['value'] = $stockable; - } - - /** - * Unsets Stockable. - * Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE). - * When a variation is both stockable and sellable, the inventory count of a stockable variation keeps - * track of the number of units of this variation in stock - * and is not an indicator of the number of units of the variation that can be sold. - */ - public function unsetStockable(): void - { - $this->stockable = []; - } - - /** - * Returns Image Ids. - * The IDs of images associated with this `CatalogItemVariation` instance. - * These images will be shown to customers in Square Online Store. - * - * @return string[]|null - */ - public function getImageIds(): ?array - { - if (count($this->imageIds) == 0) { - return null; - } - return $this->imageIds['value']; - } - - /** - * Sets Image Ids. - * The IDs of images associated with this `CatalogItemVariation` instance. - * These images will be shown to customers in Square Online Store. - * - * @maps image_ids - * - * @param string[]|null $imageIds - */ - public function setImageIds(?array $imageIds): void - { - $this->imageIds['value'] = $imageIds; - } - - /** - * Unsets Image Ids. - * The IDs of images associated with this `CatalogItemVariation` instance. - * These images will be shown to customers in Square Online Store. - */ - public function unsetImageIds(): void - { - $this->imageIds = []; - } - - /** - * Returns Team Member Ids. - * Tokens of employees that can perform the service represented by this variation. Only valid for - * variations of type `APPOINTMENTS_SERVICE`. - * - * @return string[]|null - */ - public function getTeamMemberIds(): ?array - { - if (count($this->teamMemberIds) == 0) { - return null; - } - return $this->teamMemberIds['value']; - } - - /** - * Sets Team Member Ids. - * Tokens of employees that can perform the service represented by this variation. Only valid for - * variations of type `APPOINTMENTS_SERVICE`. - * - * @maps team_member_ids - * - * @param string[]|null $teamMemberIds - */ - public function setTeamMemberIds(?array $teamMemberIds): void - { - $this->teamMemberIds['value'] = $teamMemberIds; - } - - /** - * Unsets Team Member Ids. - * Tokens of employees that can perform the service represented by this variation. Only valid for - * variations of type `APPOINTMENTS_SERVICE`. - */ - public function unsetTeamMemberIds(): void - { - $this->teamMemberIds = []; - } - - /** - * Returns Stockable Conversion. - * Represents the rule of conversion between a stockable - * [CatalogItemVariation]($m/CatalogItemVariation) - * and a non-stockable sell-by or receive-by `CatalogItemVariation` that - * share the same underlying stock. - */ - public function getStockableConversion(): ?CatalogStockConversion - { - return $this->stockableConversion; - } - - /** - * Sets Stockable Conversion. - * Represents the rule of conversion between a stockable - * [CatalogItemVariation]($m/CatalogItemVariation) - * and a non-stockable sell-by or receive-by `CatalogItemVariation` that - * share the same underlying stock. - * - * @maps stockable_conversion - */ - public function setStockableConversion(?CatalogStockConversion $stockableConversion): void - { - $this->stockableConversion = $stockableConversion; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemId)) { - $json['item_id'] = $this->itemId['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->sku)) { - $json['sku'] = $this->sku['value']; - } - if (!empty($this->upc)) { - $json['upc'] = $this->upc['value']; - } - if (isset($this->ordinal)) { - $json['ordinal'] = $this->ordinal; - } - if (isset($this->pricingType)) { - $json['pricing_type'] = $this->pricingType; - } - if (isset($this->priceMoney)) { - $json['price_money'] = $this->priceMoney; - } - if (!empty($this->locationOverrides)) { - $json['location_overrides'] = $this->locationOverrides['value']; - } - if (!empty($this->trackInventory)) { - $json['track_inventory'] = $this->trackInventory['value']; - } - if (isset($this->inventoryAlertType)) { - $json['inventory_alert_type'] = $this->inventoryAlertType; - } - if (!empty($this->inventoryAlertThreshold)) { - $json['inventory_alert_threshold'] = $this->inventoryAlertThreshold['value']; - } - if (!empty($this->userData)) { - $json['user_data'] = $this->userData['value']; - } - if (!empty($this->serviceDuration)) { - $json['service_duration'] = $this->serviceDuration['value']; - } - if (!empty($this->availableForBooking)) { - $json['available_for_booking'] = $this->availableForBooking['value']; - } - if (!empty($this->itemOptionValues)) { - $json['item_option_values'] = $this->itemOptionValues['value']; - } - if (!empty($this->measurementUnitId)) { - $json['measurement_unit_id'] = $this->measurementUnitId['value']; - } - if (!empty($this->sellable)) { - $json['sellable'] = $this->sellable['value']; - } - if (!empty($this->stockable)) { - $json['stockable'] = $this->stockable['value']; - } - if (!empty($this->imageIds)) { - $json['image_ids'] = $this->imageIds['value']; - } - if (!empty($this->teamMemberIds)) { - $json['team_member_ids'] = $this->teamMemberIds['value']; - } - if (isset($this->stockableConversion)) { - $json['stockable_conversion'] = $this->stockableConversion; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogMeasurementUnit.php b/src/Models/CatalogMeasurementUnit.php deleted file mode 100644 index e0ec9a2a..00000000 --- a/src/Models/CatalogMeasurementUnit.php +++ /dev/null @@ -1,129 +0,0 @@ -measurementUnit; - } - - /** - * Sets Measurement Unit. - * Represents a unit of measurement to use with a quantity, such as ounces - * or inches. Exactly one of the following fields are required: `custom_unit`, - * `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. - * - * @maps measurement_unit - */ - public function setMeasurementUnit(?MeasurementUnit $measurementUnit): void - { - $this->measurementUnit = $measurementUnit; - } - - /** - * Returns Precision. - * An integer between 0 and 5 that represents the maximum number of - * positions allowed after the decimal in quantities measured with this unit. - * For example: - * - * - if the precision is 0, the quantity can be 1, 2, 3, etc. - * - if the precision is 1, the quantity can be 0.1, 0.2, etc. - * - if the precision is 2, the quantity can be 0.01, 0.12, etc. - * - * Default: 3 - */ - public function getPrecision(): ?int - { - if (count($this->precision) == 0) { - return null; - } - return $this->precision['value']; - } - - /** - * Sets Precision. - * An integer between 0 and 5 that represents the maximum number of - * positions allowed after the decimal in quantities measured with this unit. - * For example: - * - * - if the precision is 0, the quantity can be 1, 2, 3, etc. - * - if the precision is 1, the quantity can be 0.1, 0.2, etc. - * - if the precision is 2, the quantity can be 0.01, 0.12, etc. - * - * Default: 3 - * - * @maps precision - */ - public function setPrecision(?int $precision): void - { - $this->precision['value'] = $precision; - } - - /** - * Unsets Precision. - * An integer between 0 and 5 that represents the maximum number of - * positions allowed after the decimal in quantities measured with this unit. - * For example: - * - * - if the precision is 0, the quantity can be 1, 2, 3, etc. - * - if the precision is 1, the quantity can be 0.1, 0.2, etc. - * - if the precision is 2, the quantity can be 0.01, 0.12, etc. - * - * Default: 3 - */ - public function unsetPrecision(): void - { - $this->precision = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->measurementUnit)) { - $json['measurement_unit'] = $this->measurementUnit; - } - if (!empty($this->precision)) { - $json['precision'] = $this->precision['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogModifier.php b/src/Models/CatalogModifier.php deleted file mode 100644 index 55394577..00000000 --- a/src/Models/CatalogModifier.php +++ /dev/null @@ -1,286 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The modifier name. This is a searchable attribute for use in applicable query filters, and its - * value length is of Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The modifier name. This is a searchable attribute for use in applicable query filters, and its - * value length is of Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): ?Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_money - */ - public function setPriceMoney(?Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Returns Ordinal. - * Determines where this `CatalogModifier` appears in the `CatalogModifierList`. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * Determines where this `CatalogModifier` appears in the `CatalogModifierList`. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * Determines where this `CatalogModifier` appears in the `CatalogModifierList`. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Returns Modifier List Id. - * The ID of the `CatalogModifierList` associated with this modifier. - */ - public function getModifierListId(): ?string - { - if (count($this->modifierListId) == 0) { - return null; - } - return $this->modifierListId['value']; - } - - /** - * Sets Modifier List Id. - * The ID of the `CatalogModifierList` associated with this modifier. - * - * @maps modifier_list_id - */ - public function setModifierListId(?string $modifierListId): void - { - $this->modifierListId['value'] = $modifierListId; - } - - /** - * Unsets Modifier List Id. - * The ID of the `CatalogModifierList` associated with this modifier. - */ - public function unsetModifierListId(): void - { - $this->modifierListId = []; - } - - /** - * Returns Location Overrides. - * Location-specific price overrides. - * - * @return ModifierLocationOverrides[]|null - */ - public function getLocationOverrides(): ?array - { - if (count($this->locationOverrides) == 0) { - return null; - } - return $this->locationOverrides['value']; - } - - /** - * Sets Location Overrides. - * Location-specific price overrides. - * - * @maps location_overrides - * - * @param ModifierLocationOverrides[]|null $locationOverrides - */ - public function setLocationOverrides(?array $locationOverrides): void - { - $this->locationOverrides['value'] = $locationOverrides; - } - - /** - * Unsets Location Overrides. - * Location-specific price overrides. - */ - public function unsetLocationOverrides(): void - { - $this->locationOverrides = []; - } - - /** - * Returns Image Id. - * The ID of the image associated with this `CatalogModifier` instance. - * Currently this image is not displayed by Square, but is free to be displayed in 3rd party - * applications. - */ - public function getImageId(): ?string - { - if (count($this->imageId) == 0) { - return null; - } - return $this->imageId['value']; - } - - /** - * Sets Image Id. - * The ID of the image associated with this `CatalogModifier` instance. - * Currently this image is not displayed by Square, but is free to be displayed in 3rd party - * applications. - * - * @maps image_id - */ - public function setImageId(?string $imageId): void - { - $this->imageId['value'] = $imageId; - } - - /** - * Unsets Image Id. - * The ID of the image associated with this `CatalogModifier` instance. - * Currently this image is not displayed by Square, but is free to be displayed in 3rd party - * applications. - */ - public function unsetImageId(): void - { - $this->imageId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->priceMoney)) { - $json['price_money'] = $this->priceMoney; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - if (!empty($this->modifierListId)) { - $json['modifier_list_id'] = $this->modifierListId['value']; - } - if (!empty($this->locationOverrides)) { - $json['location_overrides'] = $this->locationOverrides['value']; - } - if (!empty($this->imageId)) { - $json['image_id'] = $this->imageId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogModifierList.php b/src/Models/CatalogModifierList.php deleted file mode 100644 index 3218cf76..00000000 --- a/src/Models/CatalogModifierList.php +++ /dev/null @@ -1,466 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable - * query filters, and its value length is of - * Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable - * query filters, and its value length is of - * Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Ordinal. - * The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Returns Selection Type. - * Indicates whether a CatalogModifierList supports multiple selections. - */ - public function getSelectionType(): ?string - { - return $this->selectionType; - } - - /** - * Sets Selection Type. - * Indicates whether a CatalogModifierList supports multiple selections. - * - * @maps selection_type - */ - public function setSelectionType(?string $selectionType): void - { - $this->selectionType = $selectionType; - } - - /** - * Returns Modifiers. - * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, - * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list - * is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes: - * ``` - * { - * "id": "{{catalog_modifier_id}}", - * "type": "MODIFIER", - * "modifier_data": {{a CatalogModifier instance>}} - * } - * ``` - * - * @return CatalogObject[]|null - */ - public function getModifiers(): ?array - { - if (count($this->modifiers) == 0) { - return null; - } - return $this->modifiers['value']; - } - - /** - * Sets Modifiers. - * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, - * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list - * is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes: - * ``` - * { - * "id": "{{catalog_modifier_id}}", - * "type": "MODIFIER", - * "modifier_data": {{a CatalogModifier instance>}} - * } - * ``` - * - * @maps modifiers - * - * @param CatalogObject[]|null $modifiers - */ - public function setModifiers(?array $modifiers): void - { - $this->modifiers['value'] = $modifiers; - } - - /** - * Unsets Modifiers. - * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, - * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list - * is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes: - * ``` - * { - * "id": "{{catalog_modifier_id}}", - * "type": "MODIFIER", - * "modifier_data": {{a CatalogModifier instance>}} - * } - * ``` - */ - public function unsetModifiers(): void - { - $this->modifiers = []; - } - - /** - * Returns Image Ids. - * The IDs of images associated with this `CatalogModifierList` instance. - * Currently these images are not displayed on Square products, but may be displayed in 3rd-party - * applications. - * - * @return string[]|null - */ - public function getImageIds(): ?array - { - if (count($this->imageIds) == 0) { - return null; - } - return $this->imageIds['value']; - } - - /** - * Sets Image Ids. - * The IDs of images associated with this `CatalogModifierList` instance. - * Currently these images are not displayed on Square products, but may be displayed in 3rd-party - * applications. - * - * @maps image_ids - * - * @param string[]|null $imageIds - */ - public function setImageIds(?array $imageIds): void - { - $this->imageIds['value'] = $imageIds; - } - - /** - * Unsets Image Ids. - * The IDs of images associated with this `CatalogModifierList` instance. - * Currently these images are not displayed on Square products, but may be displayed in 3rd-party - * applications. - */ - public function unsetImageIds(): void - { - $this->imageIds = []; - } - - /** - * Returns Modifier Type. - * Defines the type of `CatalogModifierList`. - */ - public function getModifierType(): ?string - { - return $this->modifierType; - } - - /** - * Sets Modifier Type. - * Defines the type of `CatalogModifierList`. - * - * @maps modifier_type - */ - public function setModifierType(?string $modifierType): void - { - $this->modifierType = $modifierType; - } - - /** - * Returns Max Length. - * The maximum length, in Unicode points, of the text string of the text-based modifier as represented - * by - * this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - */ - public function getMaxLength(): ?int - { - if (count($this->maxLength) == 0) { - return null; - } - return $this->maxLength['value']; - } - - /** - * Sets Max Length. - * The maximum length, in Unicode points, of the text string of the text-based modifier as represented - * by - * this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - * - * @maps max_length - */ - public function setMaxLength(?int $maxLength): void - { - $this->maxLength['value'] = $maxLength; - } - - /** - * Unsets Max Length. - * The maximum length, in Unicode points, of the text string of the text-based modifier as represented - * by - * this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - */ - public function unsetMaxLength(): void - { - $this->maxLength = []; - } - - /** - * Returns Text Required. - * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based - * modifier - * as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - */ - public function getTextRequired(): ?bool - { - if (count($this->textRequired) == 0) { - return null; - } - return $this->textRequired['value']; - } - - /** - * Sets Text Required. - * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based - * modifier - * as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - * - * @maps text_required - */ - public function setTextRequired(?bool $textRequired): void - { - $this->textRequired['value'] = $textRequired; - } - - /** - * Unsets Text Required. - * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based - * modifier - * as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. - */ - public function unsetTextRequired(): void - { - $this->textRequired = []; - } - - /** - * Returns Internal Name. - * A note for internal use by the business. - * - * For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of - * "Hello, Kitty!" - * is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as - * an instruction for the business to follow. - * - * For non text-based modifiers, this `internal_name` attribute can be - * used to include SKUs, internal codes, or supplemental descriptions for internal use. - */ - public function getInternalName(): ?string - { - if (count($this->internalName) == 0) { - return null; - } - return $this->internalName['value']; - } - - /** - * Sets Internal Name. - * A note for internal use by the business. - * - * For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of - * "Hello, Kitty!" - * is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as - * an instruction for the business to follow. - * - * For non text-based modifiers, this `internal_name` attribute can be - * used to include SKUs, internal codes, or supplemental descriptions for internal use. - * - * @maps internal_name - */ - public function setInternalName(?string $internalName): void - { - $this->internalName['value'] = $internalName; - } - - /** - * Unsets Internal Name. - * A note for internal use by the business. - * - * For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of - * "Hello, Kitty!" - * is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as - * an instruction for the business to follow. - * - * For non text-based modifiers, this `internal_name` attribute can be - * used to include SKUs, internal codes, or supplemental descriptions for internal use. - */ - public function unsetInternalName(): void - { - $this->internalName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - if (isset($this->selectionType)) { - $json['selection_type'] = $this->selectionType; - } - if (!empty($this->modifiers)) { - $json['modifiers'] = $this->modifiers['value']; - } - if (!empty($this->imageIds)) { - $json['image_ids'] = $this->imageIds['value']; - } - if (isset($this->modifierType)) { - $json['modifier_type'] = $this->modifierType; - } - if (!empty($this->maxLength)) { - $json['max_length'] = $this->maxLength['value']; - } - if (!empty($this->textRequired)) { - $json['text_required'] = $this->textRequired['value']; - } - if (!empty($this->internalName)) { - $json['internal_name'] = $this->internalName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogModifierListModifierType.php b/src/Models/CatalogModifierListModifierType.php deleted file mode 100644 index 74623556..00000000 --- a/src/Models/CatalogModifierListModifierType.php +++ /dev/null @@ -1,21 +0,0 @@ -modifierId = $modifierId; - } - - /** - * Returns Modifier Id. - * The ID of the `CatalogModifier` whose default behavior is being overridden. - */ - public function getModifierId(): string - { - return $this->modifierId; - } - - /** - * Sets Modifier Id. - * The ID of the `CatalogModifier` whose default behavior is being overridden. - * - * @required - * @maps modifier_id - */ - public function setModifierId(string $modifierId): void - { - $this->modifierId = $modifierId; - } - - /** - * Returns On by Default. - * If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. - */ - public function getOnByDefault(): ?bool - { - if (count($this->onByDefault) == 0) { - return null; - } - return $this->onByDefault['value']; - } - - /** - * Sets On by Default. - * If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. - * - * @maps on_by_default - */ - public function setOnByDefault(?bool $onByDefault): void - { - $this->onByDefault['value'] = $onByDefault; - } - - /** - * Unsets On by Default. - * If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. - */ - public function unsetOnByDefault(): void - { - $this->onByDefault = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['modifier_id'] = $this->modifierId; - if (!empty($this->onByDefault)) { - $json['on_by_default'] = $this->onByDefault['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogObject.php b/src/Models/CatalogObject.php deleted file mode 100644 index cbb95883..00000000 --- a/src/Models/CatalogObject.php +++ /dev/null @@ -1,1184 +0,0 @@ -`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ -class CatalogObject implements \JsonSerializable -{ - /** - * @var string - */ - private $type; - - /** - * @var string - */ - private $id; - - /** - * @var string|null - */ - private $updatedAt; - - /** - * @var int|null - */ - private $version; - - /** - * @var array - */ - private $isDeleted = []; - - /** - * @var array - */ - private $customAttributeValues = []; - - /** - * @var array - */ - private $catalogV1Ids = []; - - /** - * @var array - */ - private $presentAtAllLocations = []; - - /** - * @var array - */ - private $presentAtLocationIds = []; - - /** - * @var array - */ - private $absentAtLocationIds = []; - - /** - * @var CatalogItem|null - */ - private $itemData; - - /** - * @var CatalogCategory|null - */ - private $categoryData; - - /** - * @var CatalogItemVariation|null - */ - private $itemVariationData; - - /** - * @var CatalogTax|null - */ - private $taxData; - - /** - * @var CatalogDiscount|null - */ - private $discountData; - - /** - * @var CatalogModifierList|null - */ - private $modifierListData; - - /** - * @var CatalogModifier|null - */ - private $modifierData; - - /** - * @var CatalogTimePeriod|null - */ - private $timePeriodData; - - /** - * @var CatalogProductSet|null - */ - private $productSetData; - - /** - * @var CatalogPricingRule|null - */ - private $pricingRuleData; - - /** - * @var CatalogImage|null - */ - private $imageData; - - /** - * @var CatalogMeasurementUnit|null - */ - private $measurementUnitData; - - /** - * @var CatalogSubscriptionPlan|null - */ - private $subscriptionPlanData; - - /** - * @var CatalogItemOption|null - */ - private $itemOptionData; - - /** - * @var CatalogItemOptionValue|null - */ - private $itemOptionValueData; - - /** - * @var CatalogCustomAttributeDefinition|null - */ - private $customAttributeDefinitionData; - - /** - * @var CatalogQuickAmountsSettings|null - */ - private $quickAmountsSettingsData; - - /** - * @var CatalogSubscriptionPlanVariation|null - */ - private $subscriptionPlanVariationData; - - /** - * @var CatalogAvailabilityPeriod|null - */ - private $availabilityPeriodData; - - /** - * @param string $type - * @param string $id - */ - public function __construct(string $type, string $id) - { - $this->type = $type; - $this->id = $id; - } - - /** - * Returns Type. - * Possible types of CatalogObjects returned from the catalog, each - * containing type-specific properties in the `*_data` field corresponding to the specified object type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Possible types of CatalogObjects returned from the catalog, each - * containing type-specific properties in the `*_data` field corresponding to the specified object type. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Id. - * An identifier to reference this object in the catalog. When a new `CatalogObject` - * is inserted, the client should set the id to a temporary identifier starting with - * a "`#`" character. Other objects being inserted or updated within the same request - * may use this identifier to refer to the new object. - * - * When the server receives the new object, it will supply a unique identifier that - * replaces the temporary identifier for all future references. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * An identifier to reference this object in the catalog. When a new `CatalogObject` - * is inserted, the client should set the id to a temporary identifier starting with - * a "`#`" character. Other objects being inserted or updated within the same request - * may use this identifier to refer to the new object. - * - * When the server receives the new object, it will supply a unique identifier that - * replaces the temporary identifier for all future references. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Updated At. - * Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - * would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - * would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Version. - * The version of the object. When updating an object, the version supplied - * must match the version in the database, otherwise the write will be rejected as conflicting. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version of the object. When updating an object, the version supplied - * must match the version in the database, otherwise the write will be rejected as conflicting. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Is Deleted. - * If `true`, the object has been deleted from the database. Must be `false` for new objects - * being inserted. When deleted, the `updated_at` field will equal the deletion time. - */ - public function getIsDeleted(): ?bool - { - if (count($this->isDeleted) == 0) { - return null; - } - return $this->isDeleted['value']; - } - - /** - * Sets Is Deleted. - * If `true`, the object has been deleted from the database. Must be `false` for new objects - * being inserted. When deleted, the `updated_at` field will equal the deletion time. - * - * @maps is_deleted - */ - public function setIsDeleted(?bool $isDeleted): void - { - $this->isDeleted['value'] = $isDeleted; - } - - /** - * Unsets Is Deleted. - * If `true`, the object has been deleted from the database. Must be `false` for new objects - * being inserted. When deleted, the `updated_at` field will equal the deletion time. - */ - public function unsetIsDeleted(): void - { - $this->isDeleted = []; - } - - /** - * Returns Custom Attribute Values. - * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value - * pair - * is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` - * attribute - * value defined in the associated [CatalogCustomAttributeDefinition](entity: - * CatalogCustomAttributeDefinition) - * object defined by the application making the request. - * - * If the `CatalogCustomAttributeDefinition` object is - * defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is - * prefixed by - * the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` - * attribute of - * `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234: - * cocoa_brand"` - * if the application making the request is different from the application defining the custom - * attribute definition. - * Otherwise, the key used in the map is simply `"cocoa_brand"`. - * - * Application-defined custom attributes are set at a global (location-independent) level. - * Custom attribute values are intended to store additional information about a catalog object - * or associations with an entity in another system. Do not use custom attributes - * to store any sensitive information (personally identifiable information, card details, etc.). - * - * @return array|null - */ - public function getCustomAttributeValues(): ?array - { - if (count($this->customAttributeValues) == 0) { - return null; - } - return $this->customAttributeValues['value']; - } - - /** - * Sets Custom Attribute Values. - * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value - * pair - * is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` - * attribute - * value defined in the associated [CatalogCustomAttributeDefinition](entity: - * CatalogCustomAttributeDefinition) - * object defined by the application making the request. - * - * If the `CatalogCustomAttributeDefinition` object is - * defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is - * prefixed by - * the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` - * attribute of - * `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234: - * cocoa_brand"` - * if the application making the request is different from the application defining the custom - * attribute definition. - * Otherwise, the key used in the map is simply `"cocoa_brand"`. - * - * Application-defined custom attributes are set at a global (location-independent) level. - * Custom attribute values are intended to store additional information about a catalog object - * or associations with an entity in another system. Do not use custom attributes - * to store any sensitive information (personally identifiable information, card details, etc.). - * - * @maps custom_attribute_values - * - * @param array|null $customAttributeValues - */ - public function setCustomAttributeValues(?array $customAttributeValues): void - { - $this->customAttributeValues['value'] = $customAttributeValues; - } - - /** - * Unsets Custom Attribute Values. - * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value - * pair - * is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` - * attribute - * value defined in the associated [CatalogCustomAttributeDefinition](entity: - * CatalogCustomAttributeDefinition) - * object defined by the application making the request. - * - * If the `CatalogCustomAttributeDefinition` object is - * defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is - * prefixed by - * the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` - * attribute of - * `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234: - * cocoa_brand"` - * if the application making the request is different from the application defining the custom - * attribute definition. - * Otherwise, the key used in the map is simply `"cocoa_brand"`. - * - * Application-defined custom attributes are set at a global (location-independent) level. - * Custom attribute values are intended to store additional information about a catalog object - * or associations with an entity in another system. Do not use custom attributes - * to store any sensitive information (personally identifiable information, card details, etc.). - */ - public function unsetCustomAttributeValues(): void - { - $this->customAttributeValues = []; - } - - /** - * Returns Catalog V1 Ids. - * The Connect v1 IDs for this object at each location where it is present, where they - * differ from the object's Connect V2 ID. The field will only be present for objects that - * have been created or modified by legacy APIs. - * - * @return CatalogV1Id[]|null - */ - public function getCatalogV1Ids(): ?array - { - if (count($this->catalogV1Ids) == 0) { - return null; - } - return $this->catalogV1Ids['value']; - } - - /** - * Sets Catalog V1 Ids. - * The Connect v1 IDs for this object at each location where it is present, where they - * differ from the object's Connect V2 ID. The field will only be present for objects that - * have been created or modified by legacy APIs. - * - * @maps catalog_v1_ids - * - * @param CatalogV1Id[]|null $catalogV1Ids - */ - public function setCatalogV1Ids(?array $catalogV1Ids): void - { - $this->catalogV1Ids['value'] = $catalogV1Ids; - } - - /** - * Unsets Catalog V1 Ids. - * The Connect v1 IDs for this object at each location where it is present, where they - * differ from the object's Connect V2 ID. The field will only be present for objects that - * have been created or modified by legacy APIs. - */ - public function unsetCatalogV1Ids(): void - { - $this->catalogV1Ids = []; - } - - /** - * Returns Present at All Locations. - * If `true`, this object is present at all locations (including future locations), except where - * specified in - * the `absent_at_location_ids` field. If `false`, this object is not present at any locations - * (including future locations), - * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - */ - public function getPresentAtAllLocations(): ?bool - { - if (count($this->presentAtAllLocations) == 0) { - return null; - } - return $this->presentAtAllLocations['value']; - } - - /** - * Sets Present at All Locations. - * If `true`, this object is present at all locations (including future locations), except where - * specified in - * the `absent_at_location_ids` field. If `false`, this object is not present at any locations - * (including future locations), - * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - * - * @maps present_at_all_locations - */ - public function setPresentAtAllLocations(?bool $presentAtAllLocations): void - { - $this->presentAtAllLocations['value'] = $presentAtAllLocations; - } - - /** - * Unsets Present at All Locations. - * If `true`, this object is present at all locations (including future locations), except where - * specified in - * the `absent_at_location_ids` field. If `false`, this object is not present at any locations - * (including future locations), - * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - */ - public function unsetPresentAtAllLocations(): void - { - $this->presentAtAllLocations = []; - } - - /** - * Returns Present at Location Ids. - * A list of locations where the object is present, even if `present_at_all_locations` is `false`. - * This can include locations that are deactivated. - * - * @return string[]|null - */ - public function getPresentAtLocationIds(): ?array - { - if (count($this->presentAtLocationIds) == 0) { - return null; - } - return $this->presentAtLocationIds['value']; - } - - /** - * Sets Present at Location Ids. - * A list of locations where the object is present, even if `present_at_all_locations` is `false`. - * This can include locations that are deactivated. - * - * @maps present_at_location_ids - * - * @param string[]|null $presentAtLocationIds - */ - public function setPresentAtLocationIds(?array $presentAtLocationIds): void - { - $this->presentAtLocationIds['value'] = $presentAtLocationIds; - } - - /** - * Unsets Present at Location Ids. - * A list of locations where the object is present, even if `present_at_all_locations` is `false`. - * This can include locations that are deactivated. - */ - public function unsetPresentAtLocationIds(): void - { - $this->presentAtLocationIds = []; - } - - /** - * Returns Absent at Location Ids. - * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - * This can include locations that are deactivated. - * - * @return string[]|null - */ - public function getAbsentAtLocationIds(): ?array - { - if (count($this->absentAtLocationIds) == 0) { - return null; - } - return $this->absentAtLocationIds['value']; - } - - /** - * Sets Absent at Location Ids. - * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - * This can include locations that are deactivated. - * - * @maps absent_at_location_ids - * - * @param string[]|null $absentAtLocationIds - */ - public function setAbsentAtLocationIds(?array $absentAtLocationIds): void - { - $this->absentAtLocationIds['value'] = $absentAtLocationIds; - } - - /** - * Unsets Absent at Location Ids. - * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - * This can include locations that are deactivated. - */ - public function unsetAbsentAtLocationIds(): void - { - $this->absentAtLocationIds = []; - } - - /** - * Returns Item Data. - * A [CatalogObject]($m/CatalogObject) instance of the `ITEM` type, also referred to as an item, in the - * catalog. - */ - public function getItemData(): ?CatalogItem - { - return $this->itemData; - } - - /** - * Sets Item Data. - * A [CatalogObject]($m/CatalogObject) instance of the `ITEM` type, also referred to as an item, in the - * catalog. - * - * @maps item_data - */ - public function setItemData(?CatalogItem $itemData): void - { - $this->itemData = $itemData; - } - - /** - * Returns Category Data. - * A category to which a `CatalogItem` instance belongs. - */ - public function getCategoryData(): ?CatalogCategory - { - return $this->categoryData; - } - - /** - * Sets Category Data. - * A category to which a `CatalogItem` instance belongs. - * - * @maps category_data - */ - public function setCategoryData(?CatalogCategory $categoryData): void - { - $this->categoryData = $categoryData; - } - - /** - * Returns Item Variation Data. - * An item variation, representing a product for sale, in the Catalog object model. Each - * [item]($m/CatalogItem) must have at least one - * item variation and can have at most 250 item variations. - * - * An item variation can be sellable, stockable, or both if it has a unit of measure for its count for - * the sold number of the variation, the stocked - * number of the variation, or both. For example, when a variation representing wine is stocked and - * sold by the bottle, the variation is both - * stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot - * be used as a measure of the stocked units. This by-the-glass - * variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at - * any time, the sellable count must be - * converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 - * bottle equals 5 glasses. The Square API exposes - * the `stockable_conversion` property on the variation to specify the conversion. Thus, when two - * glasses of the wine are sold, the sellable count - * decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the - * conversion. - */ - public function getItemVariationData(): ?CatalogItemVariation - { - return $this->itemVariationData; - } - - /** - * Sets Item Variation Data. - * An item variation, representing a product for sale, in the Catalog object model. Each - * [item]($m/CatalogItem) must have at least one - * item variation and can have at most 250 item variations. - * - * An item variation can be sellable, stockable, or both if it has a unit of measure for its count for - * the sold number of the variation, the stocked - * number of the variation, or both. For example, when a variation representing wine is stocked and - * sold by the bottle, the variation is both - * stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot - * be used as a measure of the stocked units. This by-the-glass - * variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at - * any time, the sellable count must be - * converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 - * bottle equals 5 glasses. The Square API exposes - * the `stockable_conversion` property on the variation to specify the conversion. Thus, when two - * glasses of the wine are sold, the sellable count - * decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the - * conversion. - * - * @maps item_variation_data - */ - public function setItemVariationData(?CatalogItemVariation $itemVariationData): void - { - $this->itemVariationData = $itemVariationData; - } - - /** - * Returns Tax Data. - * A tax applicable to an item. - */ - public function getTaxData(): ?CatalogTax - { - return $this->taxData; - } - - /** - * Sets Tax Data. - * A tax applicable to an item. - * - * @maps tax_data - */ - public function setTaxData(?CatalogTax $taxData): void - { - $this->taxData = $taxData; - } - - /** - * Returns Discount Data. - * A discount applicable to items. - */ - public function getDiscountData(): ?CatalogDiscount - { - return $this->discountData; - } - - /** - * Sets Discount Data. - * A discount applicable to items. - * - * @maps discount_data - */ - public function setDiscountData(?CatalogDiscount $discountData): void - { - $this->discountData = $discountData; - } - - /** - * Returns Modifier List Data. - * For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. - * For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the - * buyer-supplied - * text string to be selected for the T-shirt at the time of sale. - * - * For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items - * at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the - * `MODIFIER` type. - * For example, a "Condiments" modifier list applicable to a "Hot Dog" item - * may contain "Ketchup", "Mustard", and "Relish" modifiers. - * - * A non text-based modifier can be applied to the modified item once or multiple times, if the - * `selection_type` field - * is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be - * applied to the item - * only once and the `selection_type` field is always set to `SINGLE`. - */ - public function getModifierListData(): ?CatalogModifierList - { - return $this->modifierListData; - } - - /** - * Sets Modifier List Data. - * For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. - * For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the - * buyer-supplied - * text string to be selected for the T-shirt at the time of sale. - * - * For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items - * at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the - * `MODIFIER` type. - * For example, a "Condiments" modifier list applicable to a "Hot Dog" item - * may contain "Ketchup", "Mustard", and "Relish" modifiers. - * - * A non text-based modifier can be applied to the modified item once or multiple times, if the - * `selection_type` field - * is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be - * applied to the item - * only once and the `selection_type` field is always set to `SINGLE`. - * - * @maps modifier_list_data - */ - public function setModifierListData(?CatalogModifierList $modifierListData): void - { - $this->modifierListData = $modifierListData; - } - - /** - * Returns Modifier Data. - * A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a - * Burger item. - */ - public function getModifierData(): ?CatalogModifier - { - return $this->modifierData; - } - - /** - * Sets Modifier Data. - * A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a - * Burger item. - * - * @maps modifier_data - */ - public function setModifierData(?CatalogModifier $modifierData): void - { - $this->modifierData = $modifierData; - } - - /** - * Returns Time Period Data. - * Represents a time period - either a single period or a repeating period. - */ - public function getTimePeriodData(): ?CatalogTimePeriod - { - return $this->timePeriodData; - } - - /** - * Sets Time Period Data. - * Represents a time period - either a single period or a repeating period. - * - * @maps time_period_data - */ - public function setTimePeriodData(?CatalogTimePeriod $timePeriodData): void - { - $this->timePeriodData = $timePeriodData; - } - - /** - * Returns Product Set Data. - * Represents a collection of catalog objects for the purpose of applying a - * `PricingRule`. Including a catalog object will include all of its subtypes. - * For example, including a category in a product set will include all of its - * items and associated item variations in the product set. Including an item in - * a product set will also include its item variations. - */ - public function getProductSetData(): ?CatalogProductSet - { - return $this->productSetData; - } - - /** - * Sets Product Set Data. - * Represents a collection of catalog objects for the purpose of applying a - * `PricingRule`. Including a catalog object will include all of its subtypes. - * For example, including a category in a product set will include all of its - * items and associated item variations in the product set. Including an item in - * a product set will also include its item variations. - * - * @maps product_set_data - */ - public function setProductSetData(?CatalogProductSet $productSetData): void - { - $this->productSetData = $productSetData; - } - - /** - * Returns Pricing Rule Data. - * Defines how discounts are automatically applied to a set of items that match the pricing rule - * during the active time period. - */ - public function getPricingRuleData(): ?CatalogPricingRule - { - return $this->pricingRuleData; - } - - /** - * Sets Pricing Rule Data. - * Defines how discounts are automatically applied to a set of items that match the pricing rule - * during the active time period. - * - * @maps pricing_rule_data - */ - public function setPricingRuleData(?CatalogPricingRule $pricingRuleData): void - { - $this->pricingRuleData = $pricingRuleData; - } - - /** - * Returns Image Data. - * An image file to use in Square catalogs. It can be associated with - * `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects. - * Only the images on items and item variations are exposed in Dashboard. - * Only the first image on an item is displayed in Square Point of Sale (SPOS). - * Images on items and variations are displayed through Square Online Store. - * Images on other object types are for use by 3rd party application developers. - */ - public function getImageData(): ?CatalogImage - { - return $this->imageData; - } - - /** - * Sets Image Data. - * An image file to use in Square catalogs. It can be associated with - * `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects. - * Only the images on items and item variations are exposed in Dashboard. - * Only the first image on an item is displayed in Square Point of Sale (SPOS). - * Images on items and variations are displayed through Square Online Store. - * Images on other object types are for use by 3rd party application developers. - * - * @maps image_data - */ - public function setImageData(?CatalogImage $imageData): void - { - $this->imageData = $imageData; - } - - /** - * Returns Measurement Unit Data. - * Represents the unit used to measure a `CatalogItemVariation` and - * specifies the precision for decimal quantities. - */ - public function getMeasurementUnitData(): ?CatalogMeasurementUnit - { - return $this->measurementUnitData; - } - - /** - * Sets Measurement Unit Data. - * Represents the unit used to measure a `CatalogItemVariation` and - * specifies the precision for decimal quantities. - * - * @maps measurement_unit_data - */ - public function setMeasurementUnitData(?CatalogMeasurementUnit $measurementUnitData): void - { - $this->measurementUnitData = $measurementUnitData; - } - - /** - * Returns Subscription Plan Data. - * Describes a subscription plan. A subscription plan represents what you want to sell in a - * subscription model, and includes references to each of the associated subscription plan variations. - * For more information, see [Subscription Plans and Variations](https://developer.squareup. - * com/docs/subscriptions-api/plans-and-variations). - */ - public function getSubscriptionPlanData(): ?CatalogSubscriptionPlan - { - return $this->subscriptionPlanData; - } - - /** - * Sets Subscription Plan Data. - * Describes a subscription plan. A subscription plan represents what you want to sell in a - * subscription model, and includes references to each of the associated subscription plan variations. - * For more information, see [Subscription Plans and Variations](https://developer.squareup. - * com/docs/subscriptions-api/plans-and-variations). - * - * @maps subscription_plan_data - */ - public function setSubscriptionPlanData(?CatalogSubscriptionPlan $subscriptionPlanData): void - { - $this->subscriptionPlanData = $subscriptionPlanData; - } - - /** - * Returns Item Option Data. - * A group of variations for a `CatalogItem`. - */ - public function getItemOptionData(): ?CatalogItemOption - { - return $this->itemOptionData; - } - - /** - * Sets Item Option Data. - * A group of variations for a `CatalogItem`. - * - * @maps item_option_data - */ - public function setItemOptionData(?CatalogItemOption $itemOptionData): void - { - $this->itemOptionData = $itemOptionData; - } - - /** - * Returns Item Option Value Data. - * An enumerated value that can link a - * `CatalogItemVariation` to an item option as one of - * its item option values. - */ - public function getItemOptionValueData(): ?CatalogItemOptionValue - { - return $this->itemOptionValueData; - } - - /** - * Sets Item Option Value Data. - * An enumerated value that can link a - * `CatalogItemVariation` to an item option as one of - * its item option values. - * - * @maps item_option_value_data - */ - public function setItemOptionValueData(?CatalogItemOptionValue $itemOptionValueData): void - { - $this->itemOptionValueData = $itemOptionValueData; - } - - /** - * Returns Custom Attribute Definition Data. - * Contains information defining a custom attribute. Custom attributes are - * intended to store additional information about a catalog object or to associate a - * catalog object with an entity in another system. Do not use custom attributes - * to store any sensitive information (personally identifiable information, card details, etc.). - * [Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom- - * attributes) - */ - public function getCustomAttributeDefinitionData(): ?CatalogCustomAttributeDefinition - { - return $this->customAttributeDefinitionData; - } - - /** - * Sets Custom Attribute Definition Data. - * Contains information defining a custom attribute. Custom attributes are - * intended to store additional information about a catalog object or to associate a - * catalog object with an entity in another system. Do not use custom attributes - * to store any sensitive information (personally identifiable information, card details, etc.). - * [Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom- - * attributes) - * - * @maps custom_attribute_definition_data - */ - public function setCustomAttributeDefinitionData( - ?CatalogCustomAttributeDefinition $customAttributeDefinitionData - ): void { - $this->customAttributeDefinitionData = $customAttributeDefinitionData; - } - - /** - * Returns Quick Amounts Settings Data. - * A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. - */ - public function getQuickAmountsSettingsData(): ?CatalogQuickAmountsSettings - { - return $this->quickAmountsSettingsData; - } - - /** - * Sets Quick Amounts Settings Data. - * A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. - * - * @maps quick_amounts_settings_data - */ - public function setQuickAmountsSettingsData(?CatalogQuickAmountsSettings $quickAmountsSettingsData): void - { - $this->quickAmountsSettingsData = $quickAmountsSettingsData; - } - - /** - * Returns Subscription Plan Variation Data. - * Describes a subscription plan variation. A subscription plan variation represents how the - * subscription for a product or service is sold. - * For more information, see [Subscription Plans and Variations](https://developer.squareup. - * com/docs/subscriptions-api/plans-and-variations). - */ - public function getSubscriptionPlanVariationData(): ?CatalogSubscriptionPlanVariation - { - return $this->subscriptionPlanVariationData; - } - - /** - * Sets Subscription Plan Variation Data. - * Describes a subscription plan variation. A subscription plan variation represents how the - * subscription for a product or service is sold. - * For more information, see [Subscription Plans and Variations](https://developer.squareup. - * com/docs/subscriptions-api/plans-and-variations). - * - * @maps subscription_plan_variation_data - */ - public function setSubscriptionPlanVariationData( - ?CatalogSubscriptionPlanVariation $subscriptionPlanVariationData - ): void { - $this->subscriptionPlanVariationData = $subscriptionPlanVariationData; - } - - /** - * Returns Availability Period Data. - * Represents a time period of availability. - */ - public function getAvailabilityPeriodData(): ?CatalogAvailabilityPeriod - { - return $this->availabilityPeriodData; - } - - /** - * Sets Availability Period Data. - * Represents a time period of availability. - * - * @maps availability_period_data - */ - public function setAvailabilityPeriodData(?CatalogAvailabilityPeriod $availabilityPeriodData): void - { - $this->availabilityPeriodData = $availabilityPeriodData; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['id'] = $this->id; - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->isDeleted)) { - $json['is_deleted'] = $this->isDeleted['value']; - } - if (!empty($this->customAttributeValues)) { - $json['custom_attribute_values'] = $this->customAttributeValues['value']; - } - if (!empty($this->catalogV1Ids)) { - $json['catalog_v1_ids'] = $this->catalogV1Ids['value']; - } - if (!empty($this->presentAtAllLocations)) { - $json['present_at_all_locations'] = $this->presentAtAllLocations['value']; - } - if (!empty($this->presentAtLocationIds)) { - $json['present_at_location_ids'] = $this->presentAtLocationIds['value']; - } - if (!empty($this->absentAtLocationIds)) { - $json['absent_at_location_ids'] = $this->absentAtLocationIds['value']; - } - if (isset($this->itemData)) { - $json['item_data'] = $this->itemData; - } - if (isset($this->categoryData)) { - $json['category_data'] = $this->categoryData; - } - if (isset($this->itemVariationData)) { - $json['item_variation_data'] = $this->itemVariationData; - } - if (isset($this->taxData)) { - $json['tax_data'] = $this->taxData; - } - if (isset($this->discountData)) { - $json['discount_data'] = $this->discountData; - } - if (isset($this->modifierListData)) { - $json['modifier_list_data'] = $this->modifierListData; - } - if (isset($this->modifierData)) { - $json['modifier_data'] = $this->modifierData; - } - if (isset($this->timePeriodData)) { - $json['time_period_data'] = $this->timePeriodData; - } - if (isset($this->productSetData)) { - $json['product_set_data'] = $this->productSetData; - } - if (isset($this->pricingRuleData)) { - $json['pricing_rule_data'] = $this->pricingRuleData; - } - if (isset($this->imageData)) { - $json['image_data'] = $this->imageData; - } - if (isset($this->measurementUnitData)) { - $json['measurement_unit_data'] = $this->measurementUnitData; - } - if (isset($this->subscriptionPlanData)) { - $json['subscription_plan_data'] = $this->subscriptionPlanData; - } - if (isset($this->itemOptionData)) { - $json['item_option_data'] = $this->itemOptionData; - } - if (isset($this->itemOptionValueData)) { - $json['item_option_value_data'] = $this->itemOptionValueData; - } - if (isset($this->customAttributeDefinitionData)) { - $json['custom_attribute_definition_data'] = $this->customAttributeDefinitionData; - } - if (isset($this->quickAmountsSettingsData)) { - $json['quick_amounts_settings_data'] = $this->quickAmountsSettingsData; - } - if (isset($this->subscriptionPlanVariationData)) { - $json['subscription_plan_variation_data'] = $this->subscriptionPlanVariationData; - } - if (isset($this->availabilityPeriodData)) { - $json['availability_period_data'] = $this->availabilityPeriodData; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogObjectBatch.php b/src/Models/CatalogObjectBatch.php deleted file mode 100644 index f82f1092..00000000 --- a/src/Models/CatalogObjectBatch.php +++ /dev/null @@ -1,71 +0,0 @@ -objects = $objects; - } - - /** - * Returns Objects. - * A list of CatalogObjects belonging to this batch. - * - * @return CatalogObject[] - */ - public function getObjects(): array - { - return $this->objects; - } - - /** - * Sets Objects. - * A list of CatalogObjects belonging to this batch. - * - * @required - * @maps objects - * - * @param CatalogObject[] $objects - */ - public function setObjects(array $objects): void - { - $this->objects = $objects; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['objects'] = $this->objects; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogObjectCategory.php b/src/Models/CatalogObjectCategory.php deleted file mode 100644 index c6da3283..00000000 --- a/src/Models/CatalogObjectCategory.php +++ /dev/null @@ -1,102 +0,0 @@ -id; - } - - /** - * Sets Id. - * The ID of the object's category. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Ordinal. - * The order of the object within the context of the category. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * The order of the object within the context of the category. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * The order of the object within the context of the category. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogObjectReference.php b/src/Models/CatalogObjectReference.php deleted file mode 100644 index a3cb1af0..00000000 --- a/src/Models/CatalogObjectReference.php +++ /dev/null @@ -1,114 +0,0 @@ -objectId) == 0) { - return null; - } - return $this->objectId['value']; - } - - /** - * Sets Object Id. - * The ID of the referenced object. - * - * @maps object_id - */ - public function setObjectId(?string $objectId): void - { - $this->objectId['value'] = $objectId; - } - - /** - * Unsets Object Id. - * The ID of the referenced object. - */ - public function unsetObjectId(): void - { - $this->objectId = []; - } - - /** - * Returns Catalog Version. - * The version of the object. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the object. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the object. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->objectId)) { - $json['object_id'] = $this->objectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogObjectType.php b/src/Models/CatalogObjectType.php deleted file mode 100644 index 38cc7a16..00000000 --- a/src/Models/CatalogObjectType.php +++ /dev/null @@ -1,152 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * User-defined name for the pricing rule. For example, "Buy one get one - * free" or "10% off". - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * User-defined name for the pricing rule. For example, "Buy one get one - * free" or "10% off". - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Time Period Ids. - * A list of unique IDs for the catalog time periods when - * this pricing rule is in effect. If left unset, the pricing rule is always - * in effect. - * - * @return string[]|null - */ - public function getTimePeriodIds(): ?array - { - if (count($this->timePeriodIds) == 0) { - return null; - } - return $this->timePeriodIds['value']; - } - - /** - * Sets Time Period Ids. - * A list of unique IDs for the catalog time periods when - * this pricing rule is in effect. If left unset, the pricing rule is always - * in effect. - * - * @maps time_period_ids - * - * @param string[]|null $timePeriodIds - */ - public function setTimePeriodIds(?array $timePeriodIds): void - { - $this->timePeriodIds['value'] = $timePeriodIds; - } - - /** - * Unsets Time Period Ids. - * A list of unique IDs for the catalog time periods when - * this pricing rule is in effect. If left unset, the pricing rule is always - * in effect. - */ - public function unsetTimePeriodIds(): void - { - $this->timePeriodIds = []; - } - - /** - * Returns Discount Id. - * Unique ID for the `CatalogDiscount` to take off - * the price of all matched items. - */ - public function getDiscountId(): ?string - { - if (count($this->discountId) == 0) { - return null; - } - return $this->discountId['value']; - } - - /** - * Sets Discount Id. - * Unique ID for the `CatalogDiscount` to take off - * the price of all matched items. - * - * @maps discount_id - */ - public function setDiscountId(?string $discountId): void - { - $this->discountId['value'] = $discountId; - } - - /** - * Unsets Discount Id. - * Unique ID for the `CatalogDiscount` to take off - * the price of all matched items. - */ - public function unsetDiscountId(): void - { - $this->discountId = []; - } - - /** - * Returns Match Products Id. - * Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule - * matches within the entire cart, and can match multiple times. This field will always be set. - */ - public function getMatchProductsId(): ?string - { - if (count($this->matchProductsId) == 0) { - return null; - } - return $this->matchProductsId['value']; - } - - /** - * Sets Match Products Id. - * Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule - * matches within the entire cart, and can match multiple times. This field will always be set. - * - * @maps match_products_id - */ - public function setMatchProductsId(?string $matchProductsId): void - { - $this->matchProductsId['value'] = $matchProductsId; - } - - /** - * Unsets Match Products Id. - * Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule - * matches within the entire cart, and can match multiple times. This field will always be set. - */ - public function unsetMatchProductsId(): void - { - $this->matchProductsId = []; - } - - /** - * Returns Apply Products Id. - * __Deprecated__: Please use the `exclude_products_id` field to apply - * an exclude set instead. Exclude sets allow better control over quantity - * ranges and offer more flexibility for which matched items receive a discount. - * - * `CatalogProductSet` to apply the pricing to. - * An apply rule matches within the subset of the cart that fits the match rules (the match set). - * An apply rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - */ - public function getApplyProductsId(): ?string - { - if (count($this->applyProductsId) == 0) { - return null; - } - return $this->applyProductsId['value']; - } - - /** - * Sets Apply Products Id. - * __Deprecated__: Please use the `exclude_products_id` field to apply - * an exclude set instead. Exclude sets allow better control over quantity - * ranges and offer more flexibility for which matched items receive a discount. - * - * `CatalogProductSet` to apply the pricing to. - * An apply rule matches within the subset of the cart that fits the match rules (the match set). - * An apply rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - * - * @maps apply_products_id - */ - public function setApplyProductsId(?string $applyProductsId): void - { - $this->applyProductsId['value'] = $applyProductsId; - } - - /** - * Unsets Apply Products Id. - * __Deprecated__: Please use the `exclude_products_id` field to apply - * an exclude set instead. Exclude sets allow better control over quantity - * ranges and offer more flexibility for which matched items receive a discount. - * - * `CatalogProductSet` to apply the pricing to. - * An apply rule matches within the subset of the cart that fits the match rules (the match set). - * An apply rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - */ - public function unsetApplyProductsId(): void - { - $this->applyProductsId = []; - } - - /** - * Returns Exclude Products Id. - * `CatalogProductSet` to exclude from the pricing rule. - * An exclude rule matches within the subset of the cart that fits the match rules (the match set). - * An exclude rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - */ - public function getExcludeProductsId(): ?string - { - if (count($this->excludeProductsId) == 0) { - return null; - } - return $this->excludeProductsId['value']; - } - - /** - * Sets Exclude Products Id. - * `CatalogProductSet` to exclude from the pricing rule. - * An exclude rule matches within the subset of the cart that fits the match rules (the match set). - * An exclude rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - * - * @maps exclude_products_id - */ - public function setExcludeProductsId(?string $excludeProductsId): void - { - $this->excludeProductsId['value'] = $excludeProductsId; - } - - /** - * Unsets Exclude Products Id. - * `CatalogProductSet` to exclude from the pricing rule. - * An exclude rule matches within the subset of the cart that fits the match rules (the match set). - * An exclude rule can only match once in the match set. - * If not supplied, the pricing will be applied to all products in the match set. - * Other products retain their base price, or a price generated by other rules. - */ - public function unsetExcludeProductsId(): void - { - $this->excludeProductsId = []; - } - - /** - * Returns Valid From Date. - * Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - */ - public function getValidFromDate(): ?string - { - if (count($this->validFromDate) == 0) { - return null; - } - return $this->validFromDate['value']; - } - - /** - * Sets Valid From Date. - * Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - * - * @maps valid_from_date - */ - public function setValidFromDate(?string $validFromDate): void - { - $this->validFromDate['value'] = $validFromDate; - } - - /** - * Unsets Valid From Date. - * Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - */ - public function unsetValidFromDate(): void - { - $this->validFromDate = []; - } - - /** - * Returns Valid From Local Time. - * Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - */ - public function getValidFromLocalTime(): ?string - { - if (count($this->validFromLocalTime) == 0) { - return null; - } - return $this->validFromLocalTime['value']; - } - - /** - * Sets Valid From Local Time. - * Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - * - * @maps valid_from_local_time - */ - public function setValidFromLocalTime(?string $validFromLocalTime): void - { - $this->validFromLocalTime['value'] = $validFromLocalTime; - } - - /** - * Unsets Valid From Local Time. - * Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - */ - public function unsetValidFromLocalTime(): void - { - $this->validFromLocalTime = []; - } - - /** - * Returns Valid Until Date. - * Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - */ - public function getValidUntilDate(): ?string - { - if (count($this->validUntilDate) == 0) { - return null; - } - return $this->validUntilDate['value']; - } - - /** - * Sets Valid Until Date. - * Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - * - * @maps valid_until_date - */ - public function setValidUntilDate(?string $validUntilDate): void - { - $this->validUntilDate['value'] = $validUntilDate; - } - - /** - * Unsets Valid Until Date. - * Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY- - * MM-DD). - */ - public function unsetValidUntilDate(): void - { - $this->validUntilDate = []; - } - - /** - * Returns Valid Until Local Time. - * Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - */ - public function getValidUntilLocalTime(): ?string - { - if (count($this->validUntilLocalTime) == 0) { - return null; - } - return $this->validUntilLocalTime['value']; - } - - /** - * Sets Valid Until Local Time. - * Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - * - * @maps valid_until_local_time - */ - public function setValidUntilLocalTime(?string $validUntilLocalTime): void - { - $this->validUntilLocalTime['value'] = $validUntilLocalTime; - } - - /** - * Unsets Valid Until Local Time. - * Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial- - * time format - * (HH:MM:SS). Partial seconds will be truncated. - */ - public function unsetValidUntilLocalTime(): void - { - $this->validUntilLocalTime = []; - } - - /** - * Returns Exclude Strategy. - * Indicates which products matched by a CatalogPricingRule - * will be excluded if the pricing rule uses an exclude set. - */ - public function getExcludeStrategy(): ?string - { - return $this->excludeStrategy; - } - - /** - * Sets Exclude Strategy. - * Indicates which products matched by a CatalogPricingRule - * will be excluded if the pricing rule uses an exclude set. - * - * @maps exclude_strategy - */ - public function setExcludeStrategy(?string $excludeStrategy): void - { - $this->excludeStrategy = $excludeStrategy; - } - - /** - * Returns Minimum Order Subtotal Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMinimumOrderSubtotalMoney(): ?Money - { - return $this->minimumOrderSubtotalMoney; - } - - /** - * Sets Minimum Order Subtotal Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps minimum_order_subtotal_money - */ - public function setMinimumOrderSubtotalMoney(?Money $minimumOrderSubtotalMoney): void - { - $this->minimumOrderSubtotalMoney = $minimumOrderSubtotalMoney; - } - - /** - * Returns Customer Group Ids Any. - * A list of IDs of customer groups, the members of which are eligible for discounts specified in this - * pricing rule. - * Notice that a group ID is generated by the Customers API. - * If this field is not set, the specified discount applies to matched products sold to anyone whether - * the buyer - * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified - * discount - * applies only to matched products sold to customers belonging to the specified customer groups. - * - * @return string[]|null - */ - public function getCustomerGroupIdsAny(): ?array - { - if (count($this->customerGroupIdsAny) == 0) { - return null; - } - return $this->customerGroupIdsAny['value']; - } - - /** - * Sets Customer Group Ids Any. - * A list of IDs of customer groups, the members of which are eligible for discounts specified in this - * pricing rule. - * Notice that a group ID is generated by the Customers API. - * If this field is not set, the specified discount applies to matched products sold to anyone whether - * the buyer - * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified - * discount - * applies only to matched products sold to customers belonging to the specified customer groups. - * - * @maps customer_group_ids_any - * - * @param string[]|null $customerGroupIdsAny - */ - public function setCustomerGroupIdsAny(?array $customerGroupIdsAny): void - { - $this->customerGroupIdsAny['value'] = $customerGroupIdsAny; - } - - /** - * Unsets Customer Group Ids Any. - * A list of IDs of customer groups, the members of which are eligible for discounts specified in this - * pricing rule. - * Notice that a group ID is generated by the Customers API. - * If this field is not set, the specified discount applies to matched products sold to anyone whether - * the buyer - * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified - * discount - * applies only to matched products sold to customers belonging to the specified customer groups. - */ - public function unsetCustomerGroupIdsAny(): void - { - $this->customerGroupIdsAny = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->timePeriodIds)) { - $json['time_period_ids'] = $this->timePeriodIds['value']; - } - if (!empty($this->discountId)) { - $json['discount_id'] = $this->discountId['value']; - } - if (!empty($this->matchProductsId)) { - $json['match_products_id'] = $this->matchProductsId['value']; - } - if (!empty($this->applyProductsId)) { - $json['apply_products_id'] = $this->applyProductsId['value']; - } - if (!empty($this->excludeProductsId)) { - $json['exclude_products_id'] = $this->excludeProductsId['value']; - } - if (!empty($this->validFromDate)) { - $json['valid_from_date'] = $this->validFromDate['value']; - } - if (!empty($this->validFromLocalTime)) { - $json['valid_from_local_time'] = $this->validFromLocalTime['value']; - } - if (!empty($this->validUntilDate)) { - $json['valid_until_date'] = $this->validUntilDate['value']; - } - if (!empty($this->validUntilLocalTime)) { - $json['valid_until_local_time'] = $this->validUntilLocalTime['value']; - } - if (isset($this->excludeStrategy)) { - $json['exclude_strategy'] = $this->excludeStrategy; - } - if (isset($this->minimumOrderSubtotalMoney)) { - $json['minimum_order_subtotal_money'] = $this->minimumOrderSubtotalMoney; - } - if (!empty($this->customerGroupIdsAny)) { - $json['customer_group_ids_any'] = $this->customerGroupIdsAny['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogPricingType.php b/src/Models/CatalogPricingType.php deleted file mode 100644 index d901227d..00000000 --- a/src/Models/CatalogPricingType.php +++ /dev/null @@ -1,21 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * User-defined name for the product set. For example, "Clearance Items" - * or "Winter Sale Items". - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * User-defined name for the product set. For example, "Clearance Items" - * or "Winter Sale Items". - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Product Ids Any. - * Unique IDs for any `CatalogObject` included in this product set. Any - * number of these catalog objects can be in an order for a pricing rule to apply. - * - * This can be used with `product_ids_all` in a parent `CatalogProductSet` to - * match groups of products for a bulk discount, such as a discount for an - * entree and side combo. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - * - * @return string[]|null - */ - public function getProductIdsAny(): ?array - { - if (count($this->productIdsAny) == 0) { - return null; - } - return $this->productIdsAny['value']; - } - - /** - * Sets Product Ids Any. - * Unique IDs for any `CatalogObject` included in this product set. Any - * number of these catalog objects can be in an order for a pricing rule to apply. - * - * This can be used with `product_ids_all` in a parent `CatalogProductSet` to - * match groups of products for a bulk discount, such as a discount for an - * entree and side combo. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - * - * @maps product_ids_any - * - * @param string[]|null $productIdsAny - */ - public function setProductIdsAny(?array $productIdsAny): void - { - $this->productIdsAny['value'] = $productIdsAny; - } - - /** - * Unsets Product Ids Any. - * Unique IDs for any `CatalogObject` included in this product set. Any - * number of these catalog objects can be in an order for a pricing rule to apply. - * - * This can be used with `product_ids_all` in a parent `CatalogProductSet` to - * match groups of products for a bulk discount, such as a discount for an - * entree and side combo. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - */ - public function unsetProductIdsAny(): void - { - $this->productIdsAny = []; - } - - /** - * Returns Product Ids All. - * Unique IDs for any `CatalogObject` included in this product set. - * All objects in this set must be included in an order for a pricing rule to apply. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - * - * @return string[]|null - */ - public function getProductIdsAll(): ?array - { - if (count($this->productIdsAll) == 0) { - return null; - } - return $this->productIdsAll['value']; - } - - /** - * Sets Product Ids All. - * Unique IDs for any `CatalogObject` included in this product set. - * All objects in this set must be included in an order for a pricing rule to apply. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - * - * @maps product_ids_all - * - * @param string[]|null $productIdsAll - */ - public function setProductIdsAll(?array $productIdsAll): void - { - $this->productIdsAll['value'] = $productIdsAll; - } - - /** - * Unsets Product Ids All. - * Unique IDs for any `CatalogObject` included in this product set. - * All objects in this set must be included in an order for a pricing rule to apply. - * - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * Max: 500 catalog object IDs. - */ - public function unsetProductIdsAll(): void - { - $this->productIdsAll = []; - } - - /** - * Returns Quantity Exact. - * If set, there must be exactly this many items from `products_any` or `products_all` - * in the cart for the discount to apply. - * - * Cannot be combined with either `quantity_min` or `quantity_max`. - */ - public function getQuantityExact(): ?int - { - if (count($this->quantityExact) == 0) { - return null; - } - return $this->quantityExact['value']; - } - - /** - * Sets Quantity Exact. - * If set, there must be exactly this many items from `products_any` or `products_all` - * in the cart for the discount to apply. - * - * Cannot be combined with either `quantity_min` or `quantity_max`. - * - * @maps quantity_exact - */ - public function setQuantityExact(?int $quantityExact): void - { - $this->quantityExact['value'] = $quantityExact; - } - - /** - * Unsets Quantity Exact. - * If set, there must be exactly this many items from `products_any` or `products_all` - * in the cart for the discount to apply. - * - * Cannot be combined with either `quantity_min` or `quantity_max`. - */ - public function unsetQuantityExact(): void - { - $this->quantityExact = []; - } - - /** - * Returns Quantity Min. - * If set, there must be at least this many items from `products_any` or `products_all` - * in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if - * `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. - */ - public function getQuantityMin(): ?int - { - if (count($this->quantityMin) == 0) { - return null; - } - return $this->quantityMin['value']; - } - - /** - * Sets Quantity Min. - * If set, there must be at least this many items from `products_any` or `products_all` - * in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if - * `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. - * - * @maps quantity_min - */ - public function setQuantityMin(?int $quantityMin): void - { - $this->quantityMin['value'] = $quantityMin; - } - - /** - * Unsets Quantity Min. - * If set, there must be at least this many items from `products_any` or `products_all` - * in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if - * `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. - */ - public function unsetQuantityMin(): void - { - $this->quantityMin = []; - } - - /** - * Returns Quantity Max. - * If set, the pricing rule will apply to a maximum of this many items from - * `products_any` or `products_all`. - */ - public function getQuantityMax(): ?int - { - if (count($this->quantityMax) == 0) { - return null; - } - return $this->quantityMax['value']; - } - - /** - * Sets Quantity Max. - * If set, the pricing rule will apply to a maximum of this many items from - * `products_any` or `products_all`. - * - * @maps quantity_max - */ - public function setQuantityMax(?int $quantityMax): void - { - $this->quantityMax['value'] = $quantityMax; - } - - /** - * Unsets Quantity Max. - * If set, the pricing rule will apply to a maximum of this many items from - * `products_any` or `products_all`. - */ - public function unsetQuantityMax(): void - { - $this->quantityMax = []; - } - - /** - * Returns All Products. - * If set to `true`, the product set will include every item in the catalog. - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - */ - public function getAllProducts(): ?bool - { - if (count($this->allProducts) == 0) { - return null; - } - return $this->allProducts['value']; - } - - /** - * Sets All Products. - * If set to `true`, the product set will include every item in the catalog. - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - * - * @maps all_products - */ - public function setAllProducts(?bool $allProducts): void - { - $this->allProducts['value'] = $allProducts; - } - - /** - * Unsets All Products. - * If set to `true`, the product set will include every item in the catalog. - * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. - */ - public function unsetAllProducts(): void - { - $this->allProducts = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->productIdsAny)) { - $json['product_ids_any'] = $this->productIdsAny['value']; - } - if (!empty($this->productIdsAll)) { - $json['product_ids_all'] = $this->productIdsAll['value']; - } - if (!empty($this->quantityExact)) { - $json['quantity_exact'] = $this->quantityExact['value']; - } - if (!empty($this->quantityMin)) { - $json['quantity_min'] = $this->quantityMin['value']; - } - if (!empty($this->quantityMax)) { - $json['quantity_max'] = $this->quantityMax['value']; - } - if (!empty($this->allProducts)) { - $json['all_products'] = $this->allProducts['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuery.php b/src/Models/CatalogQuery.php deleted file mode 100644 index 352c7275..00000000 --- a/src/Models/CatalogQuery.php +++ /dev/null @@ -1,355 +0,0 @@ -sortedAttributeQuery; - } - - /** - * Sets Sorted Attribute Query. - * The query expression to specify the key to sort search results. - * - * @maps sorted_attribute_query - */ - public function setSortedAttributeQuery(?CatalogQuerySortedAttribute $sortedAttributeQuery): void - { - $this->sortedAttributeQuery = $sortedAttributeQuery; - } - - /** - * Returns Exact Query. - * The query filter to return the search result by exact match of the specified attribute name and - * value. - */ - public function getExactQuery(): ?CatalogQueryExact - { - return $this->exactQuery; - } - - /** - * Sets Exact Query. - * The query filter to return the search result by exact match of the specified attribute name and - * value. - * - * @maps exact_query - */ - public function setExactQuery(?CatalogQueryExact $exactQuery): void - { - $this->exactQuery = $exactQuery; - } - - /** - * Returns Set Query. - * The query filter to return the search result(s) by exact match of the specified `attribute_name` and - * any of - * the `attribute_values`. - */ - public function getSetQuery(): ?CatalogQuerySet - { - return $this->setQuery; - } - - /** - * Sets Set Query. - * The query filter to return the search result(s) by exact match of the specified `attribute_name` and - * any of - * the `attribute_values`. - * - * @maps set_query - */ - public function setSetQuery(?CatalogQuerySet $setQuery): void - { - $this->setQuery = $setQuery; - } - - /** - * Returns Prefix Query. - * The query filter to return the search result whose named attribute values are prefixed by the - * specified attribute value. - */ - public function getPrefixQuery(): ?CatalogQueryPrefix - { - return $this->prefixQuery; - } - - /** - * Sets Prefix Query. - * The query filter to return the search result whose named attribute values are prefixed by the - * specified attribute value. - * - * @maps prefix_query - */ - public function setPrefixQuery(?CatalogQueryPrefix $prefixQuery): void - { - $this->prefixQuery = $prefixQuery; - } - - /** - * Returns Range Query. - * The query filter to return the search result whose named attribute values fall between the specified - * range. - */ - public function getRangeQuery(): ?CatalogQueryRange - { - return $this->rangeQuery; - } - - /** - * Sets Range Query. - * The query filter to return the search result whose named attribute values fall between the specified - * range. - * - * @maps range_query - */ - public function setRangeQuery(?CatalogQueryRange $rangeQuery): void - { - $this->rangeQuery = $rangeQuery; - } - - /** - * Returns Text Query. - * The query filter to return the search result whose searchable attribute values contain all of the - * specified keywords or tokens, independent of the token order or case. - */ - public function getTextQuery(): ?CatalogQueryText - { - return $this->textQuery; - } - - /** - * Sets Text Query. - * The query filter to return the search result whose searchable attribute values contain all of the - * specified keywords or tokens, independent of the token order or case. - * - * @maps text_query - */ - public function setTextQuery(?CatalogQueryText $textQuery): void - { - $this->textQuery = $textQuery; - } - - /** - * Returns Items for Tax Query. - * The query filter to return the items containing the specified tax IDs. - */ - public function getItemsForTaxQuery(): ?CatalogQueryItemsForTax - { - return $this->itemsForTaxQuery; - } - - /** - * Sets Items for Tax Query. - * The query filter to return the items containing the specified tax IDs. - * - * @maps items_for_tax_query - */ - public function setItemsForTaxQuery(?CatalogQueryItemsForTax $itemsForTaxQuery): void - { - $this->itemsForTaxQuery = $itemsForTaxQuery; - } - - /** - * Returns Items for Modifier List Query. - * The query filter to return the items containing the specified modifier list IDs. - */ - public function getItemsForModifierListQuery(): ?CatalogQueryItemsForModifierList - { - return $this->itemsForModifierListQuery; - } - - /** - * Sets Items for Modifier List Query. - * The query filter to return the items containing the specified modifier list IDs. - * - * @maps items_for_modifier_list_query - */ - public function setItemsForModifierListQuery(?CatalogQueryItemsForModifierList $itemsForModifierListQuery): void - { - $this->itemsForModifierListQuery = $itemsForModifierListQuery; - } - - /** - * Returns Items for Item Options Query. - * The query filter to return the items containing the specified item option IDs. - */ - public function getItemsForItemOptionsQuery(): ?CatalogQueryItemsForItemOptions - { - return $this->itemsForItemOptionsQuery; - } - - /** - * Sets Items for Item Options Query. - * The query filter to return the items containing the specified item option IDs. - * - * @maps items_for_item_options_query - */ - public function setItemsForItemOptionsQuery(?CatalogQueryItemsForItemOptions $itemsForItemOptionsQuery): void - { - $this->itemsForItemOptionsQuery = $itemsForItemOptionsQuery; - } - - /** - * Returns Item Variations for Item Option Values Query. - * The query filter to return the item variations containing the specified item option value IDs. - */ - public function getItemVariationsForItemOptionValuesQuery(): ?CatalogQueryItemVariationsForItemOptionValues - { - return $this->itemVariationsForItemOptionValuesQuery; - } - - /** - * Sets Item Variations for Item Option Values Query. - * The query filter to return the item variations containing the specified item option value IDs. - * - * @maps item_variations_for_item_option_values_query - */ - public function setItemVariationsForItemOptionValuesQuery( - ?CatalogQueryItemVariationsForItemOptionValues $itemVariationsForItemOptionValuesQuery - ): void { - $this->itemVariationsForItemOptionValuesQuery = $itemVariationsForItemOptionValuesQuery; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->sortedAttributeQuery)) { - $json['sorted_attribute_query'] = $this->sortedAttributeQuery; - } - if (isset($this->exactQuery)) { - $json['exact_query'] = $this->exactQuery; - } - if (isset($this->setQuery)) { - $json['set_query'] = $this->setQuery; - } - if (isset($this->prefixQuery)) { - $json['prefix_query'] = $this->prefixQuery; - } - if (isset($this->rangeQuery)) { - $json['range_query'] = $this->rangeQuery; - } - if (isset($this->textQuery)) { - $json['text_query'] = $this->textQuery; - } - if (isset($this->itemsForTaxQuery)) { - $json['items_for_tax_query'] = $this->itemsForTaxQuery; - } - if (isset($this->itemsForModifierListQuery)) { - $json['items_for_modifier_list_query'] = $this->itemsForModifierListQuery; - } - if (isset($this->itemsForItemOptionsQuery)) { - $json['items_for_item_options_query'] = $this->itemsForItemOptionsQuery; - } - if (isset($this->itemVariationsForItemOptionValuesQuery)) { - $json['item_variations_for_item_option_values_query'] = $this->itemVariationsForItemOptionValuesQuery; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryExact.php b/src/Models/CatalogQueryExact.php deleted file mode 100644 index 3b8720f9..00000000 --- a/src/Models/CatalogQueryExact.php +++ /dev/null @@ -1,103 +0,0 @@ -attributeName = $attributeName; - $this->attributeValue = $attributeValue; - } - - /** - * Returns Attribute Name. - * The name of the attribute to be searched. Matching of the attribute name is exact. - */ - public function getAttributeName(): string - { - return $this->attributeName; - } - - /** - * Sets Attribute Name. - * The name of the attribute to be searched. Matching of the attribute name is exact. - * - * @required - * @maps attribute_name - */ - public function setAttributeName(string $attributeName): void - { - $this->attributeName = $attributeName; - } - - /** - * Returns Attribute Value. - * The desired value of the search attribute. Matching of the attribute value is case insensitive and - * can be partial. - * For example, if a specified value of "sma", objects with the named attribute value of "Small", - * "small" are both matched. - */ - public function getAttributeValue(): string - { - return $this->attributeValue; - } - - /** - * Sets Attribute Value. - * The desired value of the search attribute. Matching of the attribute value is case insensitive and - * can be partial. - * For example, if a specified value of "sma", objects with the named attribute value of "Small", - * "small" are both matched. - * - * @required - * @maps attribute_value - */ - public function setAttributeValue(string $attributeValue): void - { - $this->attributeValue = $attributeValue; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['attribute_name'] = $this->attributeName; - $json['attribute_value'] = $this->attributeValue; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryItemVariationsForItemOptionValues.php b/src/Models/CatalogQueryItemVariationsForItemOptionValues.php deleted file mode 100644 index d6096ed7..00000000 --- a/src/Models/CatalogQueryItemVariationsForItemOptionValues.php +++ /dev/null @@ -1,82 +0,0 @@ -itemOptionValueIds) == 0) { - return null; - } - return $this->itemOptionValueIds['value']; - } - - /** - * Sets Item Option Value Ids. - * A set of `CatalogItemOptionValue` IDs to be used to find associated - * `CatalogItemVariation`s. All ItemVariations that contain all of the given - * Item Option Values (in any order) will be returned. - * - * @maps item_option_value_ids - * - * @param string[]|null $itemOptionValueIds - */ - public function setItemOptionValueIds(?array $itemOptionValueIds): void - { - $this->itemOptionValueIds['value'] = $itemOptionValueIds; - } - - /** - * Unsets Item Option Value Ids. - * A set of `CatalogItemOptionValue` IDs to be used to find associated - * `CatalogItemVariation`s. All ItemVariations that contain all of the given - * Item Option Values (in any order) will be returned. - */ - public function unsetItemOptionValueIds(): void - { - $this->itemOptionValueIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemOptionValueIds)) { - $json['item_option_value_ids'] = $this->itemOptionValueIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryItemsForItemOptions.php b/src/Models/CatalogQueryItemsForItemOptions.php deleted file mode 100644 index a4eb8ea2..00000000 --- a/src/Models/CatalogQueryItemsForItemOptions.php +++ /dev/null @@ -1,82 +0,0 @@ -itemOptionIds) == 0) { - return null; - } - return $this->itemOptionIds['value']; - } - - /** - * Sets Item Option Ids. - * A set of `CatalogItemOption` IDs to be used to find associated - * `CatalogItem`s. All Items that contain all of the given Item Options (in any order) - * will be returned. - * - * @maps item_option_ids - * - * @param string[]|null $itemOptionIds - */ - public function setItemOptionIds(?array $itemOptionIds): void - { - $this->itemOptionIds['value'] = $itemOptionIds; - } - - /** - * Unsets Item Option Ids. - * A set of `CatalogItemOption` IDs to be used to find associated - * `CatalogItem`s. All Items that contain all of the given Item Options (in any order) - * will be returned. - */ - public function unsetItemOptionIds(): void - { - $this->itemOptionIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->itemOptionIds)) { - $json['item_option_ids'] = $this->itemOptionIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryItemsForModifierList.php b/src/Models/CatalogQueryItemsForModifierList.php deleted file mode 100644 index a02e8d02..00000000 --- a/src/Models/CatalogQueryItemsForModifierList.php +++ /dev/null @@ -1,71 +0,0 @@ -modifierListIds = $modifierListIds; - } - - /** - * Returns Modifier List Ids. - * A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. - * - * @return string[] - */ - public function getModifierListIds(): array - { - return $this->modifierListIds; - } - - /** - * Sets Modifier List Ids. - * A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. - * - * @required - * @maps modifier_list_ids - * - * @param string[] $modifierListIds - */ - public function setModifierListIds(array $modifierListIds): void - { - $this->modifierListIds = $modifierListIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['modifier_list_ids'] = $this->modifierListIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryItemsForTax.php b/src/Models/CatalogQueryItemsForTax.php deleted file mode 100644 index 4373b459..00000000 --- a/src/Models/CatalogQueryItemsForTax.php +++ /dev/null @@ -1,71 +0,0 @@ -taxIds = $taxIds; - } - - /** - * Returns Tax Ids. - * A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. - * - * @return string[] - */ - public function getTaxIds(): array - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. - * - * @required - * @maps tax_ids - * - * @param string[] $taxIds - */ - public function setTaxIds(array $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['tax_ids'] = $this->taxIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryPrefix.php b/src/Models/CatalogQueryPrefix.php deleted file mode 100644 index b58d37ca..00000000 --- a/src/Models/CatalogQueryPrefix.php +++ /dev/null @@ -1,97 +0,0 @@ -attributeName = $attributeName; - $this->attributePrefix = $attributePrefix; - } - - /** - * Returns Attribute Name. - * The name of the attribute to be searched. - */ - public function getAttributeName(): string - { - return $this->attributeName; - } - - /** - * Sets Attribute Name. - * The name of the attribute to be searched. - * - * @required - * @maps attribute_name - */ - public function setAttributeName(string $attributeName): void - { - $this->attributeName = $attributeName; - } - - /** - * Returns Attribute Prefix. - * The desired prefix of the search attribute value. - */ - public function getAttributePrefix(): string - { - return $this->attributePrefix; - } - - /** - * Sets Attribute Prefix. - * The desired prefix of the search attribute value. - * - * @required - * @maps attribute_prefix - */ - public function setAttributePrefix(string $attributePrefix): void - { - $this->attributePrefix = $attributePrefix; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['attribute_name'] = $this->attributeName; - $json['attribute_prefix'] = $this->attributePrefix; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryRange.php b/src/Models/CatalogQueryRange.php deleted file mode 100644 index e8e13983..00000000 --- a/src/Models/CatalogQueryRange.php +++ /dev/null @@ -1,148 +0,0 @@ -attributeName = $attributeName; - } - - /** - * Returns Attribute Name. - * The name of the attribute to be searched. - */ - public function getAttributeName(): string - { - return $this->attributeName; - } - - /** - * Sets Attribute Name. - * The name of the attribute to be searched. - * - * @required - * @maps attribute_name - */ - public function setAttributeName(string $attributeName): void - { - $this->attributeName = $attributeName; - } - - /** - * Returns Attribute Min Value. - * The desired minimum value for the search attribute (inclusive). - */ - public function getAttributeMinValue(): ?int - { - if (count($this->attributeMinValue) == 0) { - return null; - } - return $this->attributeMinValue['value']; - } - - /** - * Sets Attribute Min Value. - * The desired minimum value for the search attribute (inclusive). - * - * @maps attribute_min_value - */ - public function setAttributeMinValue(?int $attributeMinValue): void - { - $this->attributeMinValue['value'] = $attributeMinValue; - } - - /** - * Unsets Attribute Min Value. - * The desired minimum value for the search attribute (inclusive). - */ - public function unsetAttributeMinValue(): void - { - $this->attributeMinValue = []; - } - - /** - * Returns Attribute Max Value. - * The desired maximum value for the search attribute (inclusive). - */ - public function getAttributeMaxValue(): ?int - { - if (count($this->attributeMaxValue) == 0) { - return null; - } - return $this->attributeMaxValue['value']; - } - - /** - * Sets Attribute Max Value. - * The desired maximum value for the search attribute (inclusive). - * - * @maps attribute_max_value - */ - public function setAttributeMaxValue(?int $attributeMaxValue): void - { - $this->attributeMaxValue['value'] = $attributeMaxValue; - } - - /** - * Unsets Attribute Max Value. - * The desired maximum value for the search attribute (inclusive). - */ - public function unsetAttributeMaxValue(): void - { - $this->attributeMaxValue = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['attribute_name'] = $this->attributeName; - if (!empty($this->attributeMinValue)) { - $json['attribute_min_value'] = $this->attributeMinValue['value']; - } - if (!empty($this->attributeMaxValue)) { - $json['attribute_max_value'] = $this->attributeMaxValue['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuerySet.php b/src/Models/CatalogQuerySet.php deleted file mode 100644 index 6b8de411..00000000 --- a/src/Models/CatalogQuerySet.php +++ /dev/null @@ -1,106 +0,0 @@ -attributeName = $attributeName; - $this->attributeValues = $attributeValues; - } - - /** - * Returns Attribute Name. - * The name of the attribute to be searched. Matching of the attribute name is exact. - */ - public function getAttributeName(): string - { - return $this->attributeName; - } - - /** - * Sets Attribute Name. - * The name of the attribute to be searched. Matching of the attribute name is exact. - * - * @required - * @maps attribute_name - */ - public function setAttributeName(string $attributeName): void - { - $this->attributeName = $attributeName; - } - - /** - * Returns Attribute Values. - * The desired values of the search attribute. Matching of the attribute values is exact and case - * insensitive. - * A maximum of 250 values may be searched in a request. - * - * @return string[] - */ - public function getAttributeValues(): array - { - return $this->attributeValues; - } - - /** - * Sets Attribute Values. - * The desired values of the search attribute. Matching of the attribute values is exact and case - * insensitive. - * A maximum of 250 values may be searched in a request. - * - * @required - * @maps attribute_values - * - * @param string[] $attributeValues - */ - public function setAttributeValues(array $attributeValues): void - { - $this->attributeValues = $attributeValues; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['attribute_name'] = $this->attributeName; - $json['attribute_values'] = $this->attributeValues; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuerySortedAttribute.php b/src/Models/CatalogQuerySortedAttribute.php deleted file mode 100644 index d9b3ade7..00000000 --- a/src/Models/CatalogQuerySortedAttribute.php +++ /dev/null @@ -1,141 +0,0 @@ -attributeName = $attributeName; - } - - /** - * Returns Attribute Name. - * The attribute whose value is used as the sort key. - */ - public function getAttributeName(): string - { - return $this->attributeName; - } - - /** - * Sets Attribute Name. - * The attribute whose value is used as the sort key. - * - * @required - * @maps attribute_name - */ - public function setAttributeName(string $attributeName): void - { - $this->attributeName = $attributeName; - } - - /** - * Returns Initial Attribute Value. - * The first attribute value to be returned by the query. Ascending sorts will return only - * objects with this value or greater, while descending sorts will return only objects with this value - * or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts). - */ - public function getInitialAttributeValue(): ?string - { - if (count($this->initialAttributeValue) == 0) { - return null; - } - return $this->initialAttributeValue['value']; - } - - /** - * Sets Initial Attribute Value. - * The first attribute value to be returned by the query. Ascending sorts will return only - * objects with this value or greater, while descending sorts will return only objects with this value - * or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts). - * - * @maps initial_attribute_value - */ - public function setInitialAttributeValue(?string $initialAttributeValue): void - { - $this->initialAttributeValue['value'] = $initialAttributeValue; - } - - /** - * Unsets Initial Attribute Value. - * The first attribute value to be returned by the query. Ascending sorts will return only - * objects with this value or greater, while descending sorts will return only objects with this value - * or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts). - */ - public function unsetInitialAttributeValue(): void - { - $this->initialAttributeValue = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['attribute_name'] = $this->attributeName; - if (!empty($this->initialAttributeValue)) { - $json['initial_attribute_value'] = $this->initialAttributeValue['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQueryText.php b/src/Models/CatalogQueryText.php deleted file mode 100644 index adaf48b9..00000000 --- a/src/Models/CatalogQueryText.php +++ /dev/null @@ -1,72 +0,0 @@ -keywords = $keywords; - } - - /** - * Returns Keywords. - * A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. - * - * @return string[] - */ - public function getKeywords(): array - { - return $this->keywords; - } - - /** - * Sets Keywords. - * A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. - * - * @required - * @maps keywords - * - * @param string[] $keywords - */ - public function setKeywords(array $keywords): void - { - $this->keywords = $keywords; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['keywords'] = $this->keywords; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuickAmount.php b/src/Models/CatalogQuickAmount.php deleted file mode 100644 index e270324d..00000000 --- a/src/Models/CatalogQuickAmount.php +++ /dev/null @@ -1,191 +0,0 @@ -type = $type; - $this->amount = $amount; - } - - /** - * Returns Type. - * Determines the type of a specific Quick Amount. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Determines the type of a specific Quick Amount. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Amount. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmount(): Money - { - return $this->amount; - } - - /** - * Sets Amount. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount - */ - public function setAmount(Money $amount): void - { - $this->amount = $amount; - } - - /** - * Returns Score. - * Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100]. - * MANUAL type amount will always have score = 100. - */ - public function getScore(): ?int - { - if (count($this->score) == 0) { - return null; - } - return $this->score['value']; - } - - /** - * Sets Score. - * Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100]. - * MANUAL type amount will always have score = 100. - * - * @maps score - */ - public function setScore(?int $score): void - { - $this->score['value'] = $score; - } - - /** - * Unsets Score. - * Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100]. - * MANUAL type amount will always have score = 100. - */ - public function unsetScore(): void - { - $this->score = []; - } - - /** - * Returns Ordinal. - * The order in which this Quick Amount should be displayed. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * The order in which this Quick Amount should be displayed. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * The order in which this Quick Amount should be displayed. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['amount'] = $this->amount; - if (!empty($this->score)) { - $json['score'] = $this->score['value']; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuickAmountType.php b/src/Models/CatalogQuickAmountType.php deleted file mode 100644 index 41ce0ca4..00000000 --- a/src/Models/CatalogQuickAmountType.php +++ /dev/null @@ -1,21 +0,0 @@ -option = $option; - } - - /** - * Returns Option. - * Determines a seller's option on Quick Amounts feature. - */ - public function getOption(): string - { - return $this->option; - } - - /** - * Sets Option. - * Determines a seller's option on Quick Amounts feature. - * - * @required - * @maps option - */ - public function setOption(string $option): void - { - $this->option = $option; - } - - /** - * Returns Eligible for Auto Amounts. - * Represents location's eligibility for auto amounts - * The boolean should be consistent with whether there are AUTO amounts in the `amounts`. - */ - public function getEligibleForAutoAmounts(): ?bool - { - if (count($this->eligibleForAutoAmounts) == 0) { - return null; - } - return $this->eligibleForAutoAmounts['value']; - } - - /** - * Sets Eligible for Auto Amounts. - * Represents location's eligibility for auto amounts - * The boolean should be consistent with whether there are AUTO amounts in the `amounts`. - * - * @maps eligible_for_auto_amounts - */ - public function setEligibleForAutoAmounts(?bool $eligibleForAutoAmounts): void - { - $this->eligibleForAutoAmounts['value'] = $eligibleForAutoAmounts; - } - - /** - * Unsets Eligible for Auto Amounts. - * Represents location's eligibility for auto amounts - * The boolean should be consistent with whether there are AUTO amounts in the `amounts`. - */ - public function unsetEligibleForAutoAmounts(): void - { - $this->eligibleForAutoAmounts = []; - } - - /** - * Returns Amounts. - * Represents a set of Quick Amounts at this location. - * - * @return CatalogQuickAmount[]|null - */ - public function getAmounts(): ?array - { - if (count($this->amounts) == 0) { - return null; - } - return $this->amounts['value']; - } - - /** - * Sets Amounts. - * Represents a set of Quick Amounts at this location. - * - * @maps amounts - * - * @param CatalogQuickAmount[]|null $amounts - */ - public function setAmounts(?array $amounts): void - { - $this->amounts['value'] = $amounts; - } - - /** - * Unsets Amounts. - * Represents a set of Quick Amounts at this location. - */ - public function unsetAmounts(): void - { - $this->amounts = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['option'] = $this->option; - if (!empty($this->eligibleForAutoAmounts)) { - $json['eligible_for_auto_amounts'] = $this->eligibleForAutoAmounts['value']; - } - if (!empty($this->amounts)) { - $json['amounts'] = $this->amounts['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogQuickAmountsSettingsOption.php b/src/Models/CatalogQuickAmountsSettingsOption.php deleted file mode 100644 index 21554101..00000000 --- a/src/Models/CatalogQuickAmountsSettingsOption.php +++ /dev/null @@ -1,26 +0,0 @@ -stockableItemVariationId = $stockableItemVariationId; - $this->stockableQuantity = $stockableQuantity; - $this->nonstockableQuantity = $nonstockableQuantity; - } - - /** - * Returns Stockable Item Variation Id. - * References to the stockable [CatalogItemVariation](entity:CatalogItemVariation) - * for this stock conversion. Selling, receiving or recounting the non-stockable - * `CatalogItemVariation` - * defined with a stock conversion results in adjustments of this stockable `CatalogItemVariation`. - * This immutable field must reference a stockable `CatalogItemVariation` - * that shares the parent [CatalogItem](entity:CatalogItem) of the converted `CatalogItemVariation.` - */ - public function getStockableItemVariationId(): string - { - return $this->stockableItemVariationId; - } - - /** - * Sets Stockable Item Variation Id. - * References to the stockable [CatalogItemVariation](entity:CatalogItemVariation) - * for this stock conversion. Selling, receiving or recounting the non-stockable - * `CatalogItemVariation` - * defined with a stock conversion results in adjustments of this stockable `CatalogItemVariation`. - * This immutable field must reference a stockable `CatalogItemVariation` - * that shares the parent [CatalogItem](entity:CatalogItem) of the converted `CatalogItemVariation.` - * - * @required - * @maps stockable_item_variation_id - */ - public function setStockableItemVariationId(string $stockableItemVariationId): void - { - $this->stockableItemVariationId = $stockableItemVariationId; - } - - /** - * Returns Stockable Quantity. - * The quantity of the stockable item variation (as identified by `stockable_item_variation_id`) - * equivalent to the non-stockable item variation quantity (as specified in `nonstockable_quantity`) - * as defined by this stock conversion. It accepts a decimal number in a string format that can take - * up to 10 digits before the decimal point and up to 5 digits after the decimal point. - */ - public function getStockableQuantity(): string - { - return $this->stockableQuantity; - } - - /** - * Sets Stockable Quantity. - * The quantity of the stockable item variation (as identified by `stockable_item_variation_id`) - * equivalent to the non-stockable item variation quantity (as specified in `nonstockable_quantity`) - * as defined by this stock conversion. It accepts a decimal number in a string format that can take - * up to 10 digits before the decimal point and up to 5 digits after the decimal point. - * - * @required - * @maps stockable_quantity - */ - public function setStockableQuantity(string $stockableQuantity): void - { - $this->stockableQuantity = $stockableQuantity; - } - - /** - * Returns Nonstockable Quantity. - * The converted equivalent quantity of the non-stockable [CatalogItemVariation](entity: - * CatalogItemVariation) - * in its measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value - * together - * define the conversion ratio between stockable item variation and the non-stockable item variation. - * It accepts a decimal number in a string format that can take up to 10 digits before the decimal - * point - * and up to 5 digits after the decimal point. - */ - public function getNonstockableQuantity(): string - { - return $this->nonstockableQuantity; - } - - /** - * Sets Nonstockable Quantity. - * The converted equivalent quantity of the non-stockable [CatalogItemVariation](entity: - * CatalogItemVariation) - * in its measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value - * together - * define the conversion ratio between stockable item variation and the non-stockable item variation. - * It accepts a decimal number in a string format that can take up to 10 digits before the decimal - * point - * and up to 5 digits after the decimal point. - * - * @required - * @maps nonstockable_quantity - */ - public function setNonstockableQuantity(string $nonstockableQuantity): void - { - $this->nonstockableQuantity = $nonstockableQuantity; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['stockable_item_variation_id'] = $this->stockableItemVariationId; - $json['stockable_quantity'] = $this->stockableQuantity; - $json['nonstockable_quantity'] = $this->nonstockableQuantity; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogSubscriptionPlan.php b/src/Models/CatalogSubscriptionPlan.php deleted file mode 100644 index 3c933e44..00000000 --- a/src/Models/CatalogSubscriptionPlan.php +++ /dev/null @@ -1,298 +0,0 @@ -name = $name; - } - - /** - * Returns Name. - * The name of the plan. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the plan. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Phases. - * A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this - * plan. - * This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error - * - * @return SubscriptionPhase[]|null - */ - public function getPhases(): ?array - { - if (count($this->phases) == 0) { - return null; - } - return $this->phases['value']; - } - - /** - * Sets Phases. - * A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this - * plan. - * This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error - * - * @maps phases - * - * @param SubscriptionPhase[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases['value'] = $phases; - } - - /** - * Unsets Phases. - * A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this - * plan. - * This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error - */ - public function unsetPhases(): void - { - $this->phases = []; - } - - /** - * Returns Subscription Plan Variations. - * The list of subscription plan variations available for this product - * - * @return CatalogObject[]|null - */ - public function getSubscriptionPlanVariations(): ?array - { - if (count($this->subscriptionPlanVariations) == 0) { - return null; - } - return $this->subscriptionPlanVariations['value']; - } - - /** - * Sets Subscription Plan Variations. - * The list of subscription plan variations available for this product - * - * @maps subscription_plan_variations - * - * @param CatalogObject[]|null $subscriptionPlanVariations - */ - public function setSubscriptionPlanVariations(?array $subscriptionPlanVariations): void - { - $this->subscriptionPlanVariations['value'] = $subscriptionPlanVariations; - } - - /** - * Unsets Subscription Plan Variations. - * The list of subscription plan variations available for this product - */ - public function unsetSubscriptionPlanVariations(): void - { - $this->subscriptionPlanVariations = []; - } - - /** - * Returns Eligible Item Ids. - * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's - * variations. - * - * @return string[]|null - */ - public function getEligibleItemIds(): ?array - { - if (count($this->eligibleItemIds) == 0) { - return null; - } - return $this->eligibleItemIds['value']; - } - - /** - * Sets Eligible Item Ids. - * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's - * variations. - * - * @maps eligible_item_ids - * - * @param string[]|null $eligibleItemIds - */ - public function setEligibleItemIds(?array $eligibleItemIds): void - { - $this->eligibleItemIds['value'] = $eligibleItemIds; - } - - /** - * Unsets Eligible Item Ids. - * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's - * variations. - */ - public function unsetEligibleItemIds(): void - { - $this->eligibleItemIds = []; - } - - /** - * Returns Eligible Category Ids. - * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's - * variations. - * - * @return string[]|null - */ - public function getEligibleCategoryIds(): ?array - { - if (count($this->eligibleCategoryIds) == 0) { - return null; - } - return $this->eligibleCategoryIds['value']; - } - - /** - * Sets Eligible Category Ids. - * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's - * variations. - * - * @maps eligible_category_ids - * - * @param string[]|null $eligibleCategoryIds - */ - public function setEligibleCategoryIds(?array $eligibleCategoryIds): void - { - $this->eligibleCategoryIds['value'] = $eligibleCategoryIds; - } - - /** - * Unsets Eligible Category Ids. - * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's - * variations. - */ - public function unsetEligibleCategoryIds(): void - { - $this->eligibleCategoryIds = []; - } - - /** - * Returns All Items. - * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. - */ - public function getAllItems(): ?bool - { - if (count($this->allItems) == 0) { - return null; - } - return $this->allItems['value']; - } - - /** - * Sets All Items. - * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. - * - * @maps all_items - */ - public function setAllItems(?bool $allItems): void - { - $this->allItems['value'] = $allItems; - } - - /** - * Unsets All Items. - * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. - */ - public function unsetAllItems(): void - { - $this->allItems = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - if (!empty($this->phases)) { - $json['phases'] = $this->phases['value']; - } - if (!empty($this->subscriptionPlanVariations)) { - $json['subscription_plan_variations'] = $this->subscriptionPlanVariations['value']; - } - if (!empty($this->eligibleItemIds)) { - $json['eligible_item_ids'] = $this->eligibleItemIds['value']; - } - if (!empty($this->eligibleCategoryIds)) { - $json['eligible_category_ids'] = $this->eligibleCategoryIds['value']; - } - if (!empty($this->allItems)) { - $json['all_items'] = $this->allItems['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogSubscriptionPlanVariation.php b/src/Models/CatalogSubscriptionPlanVariation.php deleted file mode 100644 index 46477dd3..00000000 --- a/src/Models/CatalogSubscriptionPlanVariation.php +++ /dev/null @@ -1,275 +0,0 @@ -name = $name; - $this->phases = $phases; - } - - /** - * Returns Name. - * The name of the plan variation. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the plan variation. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Phases. - * A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. - * - * @return SubscriptionPhase[] - */ - public function getPhases(): array - { - return $this->phases; - } - - /** - * Sets Phases. - * A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. - * - * @required - * @maps phases - * - * @param SubscriptionPhase[] $phases - */ - public function setPhases(array $phases): void - { - $this->phases = $phases; - } - - /** - * Returns Subscription Plan Id. - * The id of the subscription plan, if there is one. - */ - public function getSubscriptionPlanId(): ?string - { - if (count($this->subscriptionPlanId) == 0) { - return null; - } - return $this->subscriptionPlanId['value']; - } - - /** - * Sets Subscription Plan Id. - * The id of the subscription plan, if there is one. - * - * @maps subscription_plan_id - */ - public function setSubscriptionPlanId(?string $subscriptionPlanId): void - { - $this->subscriptionPlanId['value'] = $subscriptionPlanId; - } - - /** - * Unsets Subscription Plan Id. - * The id of the subscription plan, if there is one. - */ - public function unsetSubscriptionPlanId(): void - { - $this->subscriptionPlanId = []; - } - - /** - * Returns Monthly Billing Anchor Date. - * The day of the month the billing period starts. - */ - public function getMonthlyBillingAnchorDate(): ?int - { - if (count($this->monthlyBillingAnchorDate) == 0) { - return null; - } - return $this->monthlyBillingAnchorDate['value']; - } - - /** - * Sets Monthly Billing Anchor Date. - * The day of the month the billing period starts. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate['value'] = $monthlyBillingAnchorDate; - } - - /** - * Unsets Monthly Billing Anchor Date. - * The day of the month the billing period starts. - */ - public function unsetMonthlyBillingAnchorDate(): void - { - $this->monthlyBillingAnchorDate = []; - } - - /** - * Returns Can Prorate. - * Whether bills for this plan variation can be split for proration. - */ - public function getCanProrate(): ?bool - { - if (count($this->canProrate) == 0) { - return null; - } - return $this->canProrate['value']; - } - - /** - * Sets Can Prorate. - * Whether bills for this plan variation can be split for proration. - * - * @maps can_prorate - */ - public function setCanProrate(?bool $canProrate): void - { - $this->canProrate['value'] = $canProrate; - } - - /** - * Unsets Can Prorate. - * Whether bills for this plan variation can be split for proration. - */ - public function unsetCanProrate(): void - { - $this->canProrate = []; - } - - /** - * Returns Successor Plan Variation Id. - * The ID of a "successor" plan variation to this one. If the field is set, and this object is disabled - * at all - * locations, it indicates that this variation is deprecated and the object identified by the successor - * ID be used in - * its stead. - */ - public function getSuccessorPlanVariationId(): ?string - { - if (count($this->successorPlanVariationId) == 0) { - return null; - } - return $this->successorPlanVariationId['value']; - } - - /** - * Sets Successor Plan Variation Id. - * The ID of a "successor" plan variation to this one. If the field is set, and this object is disabled - * at all - * locations, it indicates that this variation is deprecated and the object identified by the successor - * ID be used in - * its stead. - * - * @maps successor_plan_variation_id - */ - public function setSuccessorPlanVariationId(?string $successorPlanVariationId): void - { - $this->successorPlanVariationId['value'] = $successorPlanVariationId; - } - - /** - * Unsets Successor Plan Variation Id. - * The ID of a "successor" plan variation to this one. If the field is set, and this object is disabled - * at all - * locations, it indicates that this variation is deprecated and the object identified by the successor - * ID be used in - * its stead. - */ - public function unsetSuccessorPlanVariationId(): void - { - $this->successorPlanVariationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - $json['phases'] = $this->phases; - if (!empty($this->subscriptionPlanId)) { - $json['subscription_plan_id'] = $this->subscriptionPlanId['value']; - } - if (!empty($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate['value']; - } - if (!empty($this->canProrate)) { - $json['can_prorate'] = $this->canProrate['value']; - } - if (!empty($this->successorPlanVariationId)) { - $json['successor_plan_variation_id'] = $this->successorPlanVariationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogTax.php b/src/Models/CatalogTax.php deleted file mode 100644 index 4a2144e0..00000000 --- a/src/Models/CatalogTax.php +++ /dev/null @@ -1,309 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The tax's name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The tax's name. This is a searchable attribute for use in applicable query filters, and its value - * length is of Unicode code points. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Calculation Phase. - * When to calculate the taxes due on a cart. - */ - public function getCalculationPhase(): ?string - { - return $this->calculationPhase; - } - - /** - * Sets Calculation Phase. - * When to calculate the taxes due on a cart. - * - * @maps calculation_phase - */ - public function setCalculationPhase(?string $calculationPhase): void - { - $this->calculationPhase = $calculationPhase; - } - - /** - * Returns Inclusion Type. - * Whether to the tax amount should be additional to or included in the CatalogItem price. - */ - public function getInclusionType(): ?string - { - return $this->inclusionType; - } - - /** - * Sets Inclusion Type. - * Whether to the tax amount should be additional to or included in the CatalogItem price. - * - * @maps inclusion_type - */ - public function setInclusionType(?string $inclusionType): void - { - $this->inclusionType = $inclusionType; - } - - /** - * Returns Percentage. - * The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a - * `'%'` sign. - * A value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of - * the location or a tax consultant. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a - * `'%'` sign. - * A value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of - * the location or a tax consultant. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a - * `'%'` sign. - * A value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of - * the location or a tax consultant. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Applies to Custom Amounts. - * If `true`, the fee applies to custom amounts entered into the Square Point of Sale - * app that are not associated with a particular `CatalogItem`. - */ - public function getAppliesToCustomAmounts(): ?bool - { - if (count($this->appliesToCustomAmounts) == 0) { - return null; - } - return $this->appliesToCustomAmounts['value']; - } - - /** - * Sets Applies to Custom Amounts. - * If `true`, the fee applies to custom amounts entered into the Square Point of Sale - * app that are not associated with a particular `CatalogItem`. - * - * @maps applies_to_custom_amounts - */ - public function setAppliesToCustomAmounts(?bool $appliesToCustomAmounts): void - { - $this->appliesToCustomAmounts['value'] = $appliesToCustomAmounts; - } - - /** - * Unsets Applies to Custom Amounts. - * If `true`, the fee applies to custom amounts entered into the Square Point of Sale - * app that are not associated with a particular `CatalogItem`. - */ - public function unsetAppliesToCustomAmounts(): void - { - $this->appliesToCustomAmounts = []; - } - - /** - * Returns Enabled. - * A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of - * Sale app or not (`false`). - */ - public function getEnabled(): ?bool - { - if (count($this->enabled) == 0) { - return null; - } - return $this->enabled['value']; - } - - /** - * Sets Enabled. - * A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of - * Sale app or not (`false`). - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled['value'] = $enabled; - } - - /** - * Unsets Enabled. - * A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of - * Sale app or not (`false`). - */ - public function unsetEnabled(): void - { - $this->enabled = []; - } - - /** - * Returns Applies to Product Set Id. - * The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product - * set. - */ - public function getAppliesToProductSetId(): ?string - { - if (count($this->appliesToProductSetId) == 0) { - return null; - } - return $this->appliesToProductSetId['value']; - } - - /** - * Sets Applies to Product Set Id. - * The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product - * set. - * - * @maps applies_to_product_set_id - */ - public function setAppliesToProductSetId(?string $appliesToProductSetId): void - { - $this->appliesToProductSetId['value'] = $appliesToProductSetId; - } - - /** - * Unsets Applies to Product Set Id. - * The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product - * set. - */ - public function unsetAppliesToProductSetId(): void - { - $this->appliesToProductSetId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->calculationPhase)) { - $json['calculation_phase'] = $this->calculationPhase; - } - if (isset($this->inclusionType)) { - $json['inclusion_type'] = $this->inclusionType; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (!empty($this->appliesToCustomAmounts)) { - $json['applies_to_custom_amounts'] = $this->appliesToCustomAmounts['value']; - } - if (!empty($this->enabled)) { - $json['enabled'] = $this->enabled['value']; - } - if (!empty($this->appliesToProductSetId)) { - $json['applies_to_product_set_id'] = $this->appliesToProductSetId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogTimePeriod.php b/src/Models/CatalogTimePeriod.php deleted file mode 100644 index 1920927c..00000000 --- a/src/Models/CatalogTimePeriod.php +++ /dev/null @@ -1,114 +0,0 @@ -event) == 0) { - return null; - } - return $this->event['value']; - } - - /** - * Sets Event. - * An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which - * specifies the name, timing, duration and recurrence of this time period. - * - * Example: - * - * ``` - * DTSTART:20190707T180000 - * DURATION:P2H - * RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR - * ``` - * - * Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported. - * `DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT` - * and `END:VEVENT` is not required in the request. The response will always - * include them. - * - * @maps event - */ - public function setEvent(?string $event): void - { - $this->event['value'] = $event; - } - - /** - * Unsets Event. - * An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which - * specifies the name, timing, duration and recurrence of this time period. - * - * Example: - * - * ``` - * DTSTART:20190707T180000 - * DURATION:P2H - * RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR - * ``` - * - * Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported. - * `DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT` - * and `END:VEVENT` is not required in the request. The response will always - * include them. - */ - public function unsetEvent(): void - { - $this->event = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->event)) { - $json['event'] = $this->event['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CatalogV1Id.php b/src/Models/CatalogV1Id.php deleted file mode 100644 index db3121f6..00000000 --- a/src/Models/CatalogV1Id.php +++ /dev/null @@ -1,115 +0,0 @@ -catalogV1Id) == 0) { - return null; - } - return $this->catalogV1Id['value']; - } - - /** - * Sets Catalog V1 Id. - * The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 - * object ID. - * - * @maps catalog_v1_id - */ - public function setCatalogV1Id(?string $catalogV1Id): void - { - $this->catalogV1Id['value'] = $catalogV1Id; - } - - /** - * Unsets Catalog V1 Id. - * The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 - * object ID. - */ - public function unsetCatalogV1Id(): void - { - $this->catalogV1Id = []; - } - - /** - * Returns Location Id. - * The ID of the `Location` this Connect V1 ID is associated with. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the `Location` this Connect V1 ID is associated with. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the `Location` this Connect V1 ID is associated with. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->catalogV1Id)) { - $json['catalog_v1_id'] = $this->catalogV1Id['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CategoryPathToRootNode.php b/src/Models/CategoryPathToRootNode.php deleted file mode 100644 index 6ff909bf..00000000 --- a/src/Models/CategoryPathToRootNode.php +++ /dev/null @@ -1,112 +0,0 @@ -categoryId) == 0) { - return null; - } - return $this->categoryId['value']; - } - - /** - * Sets Category Id. - * The category's ID. - * - * @maps category_id - */ - public function setCategoryId(?string $categoryId): void - { - $this->categoryId['value'] = $categoryId; - } - - /** - * Unsets Category Id. - * The category's ID. - */ - public function unsetCategoryId(): void - { - $this->categoryId = []; - } - - /** - * Returns Category Name. - * The category's name. - */ - public function getCategoryName(): ?string - { - if (count($this->categoryName) == 0) { - return null; - } - return $this->categoryName['value']; - } - - /** - * Sets Category Name. - * The category's name. - * - * @maps category_name - */ - public function setCategoryName(?string $categoryName): void - { - $this->categoryName['value'] = $categoryName; - } - - /** - * Unsets Category Name. - * The category's name. - */ - public function unsetCategoryName(): void - { - $this->categoryName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->categoryId)) { - $json['category_id'] = $this->categoryId['value']; - } - if (!empty($this->categoryName)) { - $json['category_name'] = $this->categoryName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ChangeBillingAnchorDateRequest.php b/src/Models/ChangeBillingAnchorDateRequest.php deleted file mode 100644 index 024e8ead..00000000 --- a/src/Models/ChangeBillingAnchorDateRequest.php +++ /dev/null @@ -1,125 +0,0 @@ -monthlyBillingAnchorDate) == 0) { - return null; - } - return $this->monthlyBillingAnchorDate['value']; - } - - /** - * Sets Monthly Billing Anchor Date. - * The anchor day for the billing cycle. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate['value'] = $monthlyBillingAnchorDate; - } - - /** - * Unsets Monthly Billing Anchor Date. - * The anchor day for the billing cycle. - */ - public function unsetMonthlyBillingAnchorDate(): void - { - $this->monthlyBillingAnchorDate = []; - } - - /** - * Returns Effective Date. - * The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes - * place on the subscription. - * - * When this date is unspecified or falls within the current billing cycle, the billing anchor date - * is changed immediately. - */ - public function getEffectiveDate(): ?string - { - if (count($this->effectiveDate) == 0) { - return null; - } - return $this->effectiveDate['value']; - } - - /** - * Sets Effective Date. - * The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes - * place on the subscription. - * - * When this date is unspecified or falls within the current billing cycle, the billing anchor date - * is changed immediately. - * - * @maps effective_date - */ - public function setEffectiveDate(?string $effectiveDate): void - { - $this->effectiveDate['value'] = $effectiveDate; - } - - /** - * Unsets Effective Date. - * The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes - * place on the subscription. - * - * When this date is unspecified or falls within the current billing cycle, the billing anchor date - * is changed immediately. - */ - public function unsetEffectiveDate(): void - { - $this->effectiveDate = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate['value']; - } - if (!empty($this->effectiveDate)) { - $json['effective_date'] = $this->effectiveDate['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ChangeBillingAnchorDateResponse.php b/src/Models/ChangeBillingAnchorDateResponse.php deleted file mode 100644 index a0a6342f..00000000 --- a/src/Models/ChangeBillingAnchorDateResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Returns Actions. - * A list of a single billing anchor date change for the subscription. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - return $this->actions; - } - - /** - * Sets Actions. - * A list of a single billing anchor date change for the subscription. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions = $actions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - if (isset($this->actions)) { - $json['actions'] = $this->actions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ChangeTiming.php b/src/Models/ChangeTiming.php deleted file mode 100644 index 48bbbc15..00000000 --- a/src/Models/ChangeTiming.php +++ /dev/null @@ -1,21 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this - * transaction among transactions you've created. - * - * If you're unsure whether a particular transaction succeeded, - * you can reattempt it with the same idempotency key without - * worrying about double-charging the buyer. - * - * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more - * information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this - * transaction among transactions you've created. - * - * If you're unsure whether a particular transaction succeeded, - * you can reattempt it with the same idempotency key without - * worrying about double-charging the buyer. - * - * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more - * information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Card Nonce. - * A payment token generated from the [Card.tokenize()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Card#Card.tokenize) that represents the card - * to charge. - * - * The application that provides a payment token to this endpoint must be the - * _same application_ that generated the payment token with the Web Payments SDK. - * Otherwise, the nonce is invalid. - * - * Do not provide a value for this field if you provide a value for - * `customer_card_id`. - */ - public function getCardNonce(): ?string - { - if (count($this->cardNonce) == 0) { - return null; - } - return $this->cardNonce['value']; - } - - /** - * Sets Card Nonce. - * A payment token generated from the [Card.tokenize()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Card#Card.tokenize) that represents the card - * to charge. - * - * The application that provides a payment token to this endpoint must be the - * _same application_ that generated the payment token with the Web Payments SDK. - * Otherwise, the nonce is invalid. - * - * Do not provide a value for this field if you provide a value for - * `customer_card_id`. - * - * @maps card_nonce - */ - public function setCardNonce(?string $cardNonce): void - { - $this->cardNonce['value'] = $cardNonce; - } - - /** - * Unsets Card Nonce. - * A payment token generated from the [Card.tokenize()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Card#Card.tokenize) that represents the card - * to charge. - * - * The application that provides a payment token to this endpoint must be the - * _same application_ that generated the payment token with the Web Payments SDK. - * Otherwise, the nonce is invalid. - * - * Do not provide a value for this field if you provide a value for - * `customer_card_id`. - */ - public function unsetCardNonce(): void - { - $this->cardNonce = []; - } - - /** - * Returns Customer Card Id. - * The ID of the customer card on file to charge. Do - * not provide a value for this field if you provide a value for `card_nonce`. - * - * If you provide this value, you _must_ also provide a value for - * `customer_id`. - */ - public function getCustomerCardId(): ?string - { - if (count($this->customerCardId) == 0) { - return null; - } - return $this->customerCardId['value']; - } - - /** - * Sets Customer Card Id. - * The ID of the customer card on file to charge. Do - * not provide a value for this field if you provide a value for `card_nonce`. - * - * If you provide this value, you _must_ also provide a value for - * `customer_id`. - * - * @maps customer_card_id - */ - public function setCustomerCardId(?string $customerCardId): void - { - $this->customerCardId['value'] = $customerCardId; - } - - /** - * Unsets Customer Card Id. - * The ID of the customer card on file to charge. Do - * not provide a value for this field if you provide a value for `card_nonce`. - * - * If you provide this value, you _must_ also provide a value for - * `customer_id`. - */ - public function unsetCustomerCardId(): void - { - $this->customerCardId = []; - } - - /** - * Returns Delay Capture. - * If `true`, the request will only perform an Auth on the provided - * card. You can then later perform either a Capture (with the - * [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint) or a Void - * (with the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint). - * - * Default value: `false` - */ - public function getDelayCapture(): ?bool - { - if (count($this->delayCapture) == 0) { - return null; - } - return $this->delayCapture['value']; - } - - /** - * Sets Delay Capture. - * If `true`, the request will only perform an Auth on the provided - * card. You can then later perform either a Capture (with the - * [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint) or a Void - * (with the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint). - * - * Default value: `false` - * - * @maps delay_capture - */ - public function setDelayCapture(?bool $delayCapture): void - { - $this->delayCapture['value'] = $delayCapture; - } - - /** - * Unsets Delay Capture. - * If `true`, the request will only perform an Auth on the provided - * card. You can then later perform either a Capture (with the - * [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint) or a Void - * (with the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint). - * - * Default value: `false` - */ - public function unsetDelayCapture(): void - { - $this->delayCapture = []; - } - - /** - * Returns Reference Id. - * An optional ID you can associate with the transaction for your own - * purposes (such as to associate the transaction with an entity ID in your - * own database). - * - * This value cannot exceed 40 characters. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional ID you can associate with the transaction for your own - * purposes (such as to associate the transaction with an entity ID in your - * own database). - * - * This value cannot exceed 40 characters. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional ID you can associate with the transaction for your own - * purposes (such as to associate the transaction with an entity ID in your - * own database). - * - * This value cannot exceed 40 characters. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * An optional note to associate with the transaction. - * - * This value cannot exceed 60 characters. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * An optional note to associate with the transaction. - * - * This value cannot exceed 60 characters. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * An optional note to associate with the transaction. - * - * This value cannot exceed 60 characters. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Customer Id. - * The ID of the customer to associate this transaction with. This field - * is required if you provide a value for `customer_card_id`, and optional - * otherwise. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the customer to associate this transaction with. This field - * is required if you provide a value for `customer_card_id`, and optional - * otherwise. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the customer to associate this transaction with. This field - * is required if you provide a value for `customer_card_id`, and optional - * otherwise. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBillingAddress(): ?Address - { - return $this->billingAddress; - } - - /** - * Sets Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps billing_address - */ - public function setBillingAddress(?Address $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * Returns Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getShippingAddress(): ?Address - { - return $this->shippingAddress; - } - - /** - * Sets Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps shipping_address - */ - public function setShippingAddress(?Address $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * Returns Buyer Email Address. - * The buyer's email address, if available. This value is optional, - * but this transaction is ineligible for chargeback protection if it is not - * provided. - */ - public function getBuyerEmailAddress(): ?string - { - if (count($this->buyerEmailAddress) == 0) { - return null; - } - return $this->buyerEmailAddress['value']; - } - - /** - * Sets Buyer Email Address. - * The buyer's email address, if available. This value is optional, - * but this transaction is ineligible for chargeback protection if it is not - * provided. - * - * @maps buyer_email_address - */ - public function setBuyerEmailAddress(?string $buyerEmailAddress): void - { - $this->buyerEmailAddress['value'] = $buyerEmailAddress; - } - - /** - * Unsets Buyer Email Address. - * The buyer's email address, if available. This value is optional, - * but this transaction is ineligible for chargeback protection if it is not - * provided. - */ - public function unsetBuyerEmailAddress(): void - { - $this->buyerEmailAddress = []; - } - - /** - * Returns Order Id. - * The ID of the order to associate with this transaction. - * - * If you provide this value, the `amount_money` value of your request must - * __exactly match__ the value of the order's `total_money` field. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the order to associate with this transaction. - * - * If you provide this value, the `amount_money` value of your request must - * __exactly match__ the value of the order's `total_money` field. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the order to associate with this transaction. - * - * If you provide this value, the `amount_money` value of your request must - * __exactly match__ the value of the order's `total_money` field. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Additional Recipients. - * The basic primitive of multi-party transaction. The value is optional. - * The transaction facilitated by you can be split from here. - * - * If you provide this value, the `amount_money` value in your additional_recipients - * must not be more than 90% of the `amount_money` value in the charge request. - * The `location_id` must be the valid location of the app owner merchant. - * - * This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. - * - * This field is currently not supported in sandbox. - * - * @return ChargeRequestAdditionalRecipient[]|null - */ - public function getAdditionalRecipients(): ?array - { - if (count($this->additionalRecipients) == 0) { - return null; - } - return $this->additionalRecipients['value']; - } - - /** - * Sets Additional Recipients. - * The basic primitive of multi-party transaction. The value is optional. - * The transaction facilitated by you can be split from here. - * - * If you provide this value, the `amount_money` value in your additional_recipients - * must not be more than 90% of the `amount_money` value in the charge request. - * The `location_id` must be the valid location of the app owner merchant. - * - * This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. - * - * This field is currently not supported in sandbox. - * - * @maps additional_recipients - * - * @param ChargeRequestAdditionalRecipient[]|null $additionalRecipients - */ - public function setAdditionalRecipients(?array $additionalRecipients): void - { - $this->additionalRecipients['value'] = $additionalRecipients; - } - - /** - * Unsets Additional Recipients. - * The basic primitive of multi-party transaction. The value is optional. - * The transaction facilitated by you can be split from here. - * - * If you provide this value, the `amount_money` value in your additional_recipients - * must not be more than 90% of the `amount_money` value in the charge request. - * The `location_id` must be the valid location of the app owner merchant. - * - * This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. - * - * This field is currently not supported in sandbox. - */ - public function unsetAdditionalRecipients(): void - { - $this->additionalRecipients = []; - } - - /** - * Returns Verification Token. - * A token generated by SqPaymentForm's verifyBuyer() that represents - * customer's device info and 3ds challenge result. - */ - public function getVerificationToken(): ?string - { - if (count($this->verificationToken) == 0) { - return null; - } - return $this->verificationToken['value']; - } - - /** - * Sets Verification Token. - * A token generated by SqPaymentForm's verifyBuyer() that represents - * customer's device info and 3ds challenge result. - * - * @maps verification_token - */ - public function setVerificationToken(?string $verificationToken): void - { - $this->verificationToken['value'] = $verificationToken; - } - - /** - * Unsets Verification Token. - * A token generated by SqPaymentForm's verifyBuyer() that represents - * customer's device info and 3ds challenge result. - */ - public function unsetVerificationToken(): void - { - $this->verificationToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['amount_money'] = $this->amountMoney; - if (!empty($this->cardNonce)) { - $json['card_nonce'] = $this->cardNonce['value']; - } - if (!empty($this->customerCardId)) { - $json['customer_card_id'] = $this->customerCardId['value']; - } - if (!empty($this->delayCapture)) { - $json['delay_capture'] = $this->delayCapture['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (isset($this->billingAddress)) { - $json['billing_address'] = $this->billingAddress; - } - if (isset($this->shippingAddress)) { - $json['shipping_address'] = $this->shippingAddress; - } - if (!empty($this->buyerEmailAddress)) { - $json['buyer_email_address'] = $this->buyerEmailAddress['value']; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (!empty($this->additionalRecipients)) { - $json['additional_recipients'] = $this->additionalRecipients['value']; - } - if (!empty($this->verificationToken)) { - $json['verification_token'] = $this->verificationToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ChargeRequestAdditionalRecipient.php b/src/Models/ChargeRequestAdditionalRecipient.php deleted file mode 100644 index 8b5f0d9c..00000000 --- a/src/Models/ChargeRequestAdditionalRecipient.php +++ /dev/null @@ -1,138 +0,0 @@ -locationId = $locationId; - $this->description = $description; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Location Id. - * The location ID for a recipient (other than the merchant) receiving a portion of the tender. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location ID for a recipient (other than the merchant) receiving a portion of the tender. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Description. - * The description of the additional recipient. - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Sets Description. - * The description of the additional recipient. - * - * @required - * @maps description - */ - public function setDescription(string $description): void - { - $this->description = $description; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - $json['description'] = $this->description; - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ChargeResponse.php b/src/Models/ChargeResponse.php deleted file mode 100644 index ff525a04..00000000 --- a/src/Models/ChargeResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Transaction. - * Represents a transaction processed with Square, either with the - * Connect API or with Square Point of Sale. - * - * The `tenders` field of this object lists all methods of payment used to pay in - * the transaction. - */ - public function getTransaction(): ?Transaction - { - return $this->transaction; - } - - /** - * Sets Transaction. - * Represents a transaction processed with Square, either with the - * Connect API or with Square Point of Sale. - * - * The `tenders` field of this object lists all methods of payment used to pay in - * the transaction. - * - * @maps transaction - */ - public function setTransaction(?Transaction $transaction): void - { - $this->transaction = $transaction; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->transaction)) { - $json['transaction'] = $this->transaction; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Checkout.php b/src/Models/Checkout.php deleted file mode 100644 index 1373f39d..00000000 --- a/src/Models/Checkout.php +++ /dev/null @@ -1,484 +0,0 @@ -id; - } - - /** - * Sets Id. - * ID generated by Square Checkout when a new checkout is requested. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Checkout Page Url. - * The URL that the buyer's browser should be redirected to after the - * checkout is completed. - */ - public function getCheckoutPageUrl(): ?string - { - if (count($this->checkoutPageUrl) == 0) { - return null; - } - return $this->checkoutPageUrl['value']; - } - - /** - * Sets Checkout Page Url. - * The URL that the buyer's browser should be redirected to after the - * checkout is completed. - * - * @maps checkout_page_url - */ - public function setCheckoutPageUrl(?string $checkoutPageUrl): void - { - $this->checkoutPageUrl['value'] = $checkoutPageUrl; - } - - /** - * Unsets Checkout Page Url. - * The URL that the buyer's browser should be redirected to after the - * checkout is completed. - */ - public function unsetCheckoutPageUrl(): void - { - $this->checkoutPageUrl = []; - } - - /** - * Returns Ask for Shipping Address. - * If `true`, Square Checkout will collect shipping information on your - * behalf and store that information with the transaction information in your - * Square Dashboard. - * - * Default: `false`. - */ - public function getAskForShippingAddress(): ?bool - { - if (count($this->askForShippingAddress) == 0) { - return null; - } - return $this->askForShippingAddress['value']; - } - - /** - * Sets Ask for Shipping Address. - * If `true`, Square Checkout will collect shipping information on your - * behalf and store that information with the transaction information in your - * Square Dashboard. - * - * Default: `false`. - * - * @maps ask_for_shipping_address - */ - public function setAskForShippingAddress(?bool $askForShippingAddress): void - { - $this->askForShippingAddress['value'] = $askForShippingAddress; - } - - /** - * Unsets Ask for Shipping Address. - * If `true`, Square Checkout will collect shipping information on your - * behalf and store that information with the transaction information in your - * Square Dashboard. - * - * Default: `false`. - */ - public function unsetAskForShippingAddress(): void - { - $this->askForShippingAddress = []; - } - - /** - * Returns Merchant Support Email. - * The email address to display on the Square Checkout confirmation page - * and confirmation email that the buyer can use to contact the merchant. - * - * If this value is not set, the confirmation page and email will display the - * primary email address associated with the merchant's Square account. - * - * Default: none; only exists if explicitly set. - */ - public function getMerchantSupportEmail(): ?string - { - if (count($this->merchantSupportEmail) == 0) { - return null; - } - return $this->merchantSupportEmail['value']; - } - - /** - * Sets Merchant Support Email. - * The email address to display on the Square Checkout confirmation page - * and confirmation email that the buyer can use to contact the merchant. - * - * If this value is not set, the confirmation page and email will display the - * primary email address associated with the merchant's Square account. - * - * Default: none; only exists if explicitly set. - * - * @maps merchant_support_email - */ - public function setMerchantSupportEmail(?string $merchantSupportEmail): void - { - $this->merchantSupportEmail['value'] = $merchantSupportEmail; - } - - /** - * Unsets Merchant Support Email. - * The email address to display on the Square Checkout confirmation page - * and confirmation email that the buyer can use to contact the merchant. - * - * If this value is not set, the confirmation page and email will display the - * primary email address associated with the merchant's Square account. - * - * Default: none; only exists if explicitly set. - */ - public function unsetMerchantSupportEmail(): void - { - $this->merchantSupportEmail = []; - } - - /** - * Returns Pre Populate Buyer Email. - * If provided, the buyer's email is pre-populated on the checkout page - * as an editable text field. - * - * Default: none; only exists if explicitly set. - */ - public function getPrePopulateBuyerEmail(): ?string - { - if (count($this->prePopulateBuyerEmail) == 0) { - return null; - } - return $this->prePopulateBuyerEmail['value']; - } - - /** - * Sets Pre Populate Buyer Email. - * If provided, the buyer's email is pre-populated on the checkout page - * as an editable text field. - * - * Default: none; only exists if explicitly set. - * - * @maps pre_populate_buyer_email - */ - public function setPrePopulateBuyerEmail(?string $prePopulateBuyerEmail): void - { - $this->prePopulateBuyerEmail['value'] = $prePopulateBuyerEmail; - } - - /** - * Unsets Pre Populate Buyer Email. - * If provided, the buyer's email is pre-populated on the checkout page - * as an editable text field. - * - * Default: none; only exists if explicitly set. - */ - public function unsetPrePopulateBuyerEmail(): void - { - $this->prePopulateBuyerEmail = []; - } - - /** - * Returns Pre Populate Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getPrePopulateShippingAddress(): ?Address - { - return $this->prePopulateShippingAddress; - } - - /** - * Sets Pre Populate Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps pre_populate_shipping_address - */ - public function setPrePopulateShippingAddress(?Address $prePopulateShippingAddress): void - { - $this->prePopulateShippingAddress = $prePopulateShippingAddress; - } - - /** - * Returns Redirect Url. - * The URL to redirect to after checkout is completed with `checkoutId`, - * Square's `orderId`, `transactionId`, and `referenceId` appended as URL - * parameters. For example, if the provided redirect_url is - * `http://www.example.com/order-complete`, a successful transaction redirects - * the customer to: - * - *
http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&
-     * referenceId=xxxxxx&transactionId=xxxxxx
- * - * If you do not provide a redirect URL, Square Checkout will display an order - * confirmation page on your behalf; however Square strongly recommends that - * you provide a redirect URL so you can verify the transaction results and - * finalize the order through your existing/normal confirmation workflow. - */ - public function getRedirectUrl(): ?string - { - if (count($this->redirectUrl) == 0) { - return null; - } - return $this->redirectUrl['value']; - } - - /** - * Sets Redirect Url. - * The URL to redirect to after checkout is completed with `checkoutId`, - * Square's `orderId`, `transactionId`, and `referenceId` appended as URL - * parameters. For example, if the provided redirect_url is - * `http://www.example.com/order-complete`, a successful transaction redirects - * the customer to: - * - *
http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&
-     * referenceId=xxxxxx&transactionId=xxxxxx
- * - * If you do not provide a redirect URL, Square Checkout will display an order - * confirmation page on your behalf; however Square strongly recommends that - * you provide a redirect URL so you can verify the transaction results and - * finalize the order through your existing/normal confirmation workflow. - * - * @maps redirect_url - */ - public function setRedirectUrl(?string $redirectUrl): void - { - $this->redirectUrl['value'] = $redirectUrl; - } - - /** - * Unsets Redirect Url. - * The URL to redirect to after checkout is completed with `checkoutId`, - * Square's `orderId`, `transactionId`, and `referenceId` appended as URL - * parameters. For example, if the provided redirect_url is - * `http://www.example.com/order-complete`, a successful transaction redirects - * the customer to: - * - *
http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&
-     * referenceId=xxxxxx&transactionId=xxxxxx
- * - * If you do not provide a redirect URL, Square Checkout will display an order - * confirmation page on your behalf; however Square strongly recommends that - * you provide a redirect URL so you can verify the transaction results and - * finalize the order through your existing/normal confirmation workflow. - */ - public function unsetRedirectUrl(): void - { - $this->redirectUrl = []; - } - - /** - * Returns Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - */ - public function getOrder(): ?Order - { - return $this->order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Created At. - * The time when the checkout was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the checkout was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this checkout. - * For example, fees assessed on the purchase by a third party integration. - * - * @return AdditionalRecipient[]|null - */ - public function getAdditionalRecipients(): ?array - { - if (count($this->additionalRecipients) == 0) { - return null; - } - return $this->additionalRecipients['value']; - } - - /** - * Sets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this checkout. - * For example, fees assessed on the purchase by a third party integration. - * - * @maps additional_recipients - * - * @param AdditionalRecipient[]|null $additionalRecipients - */ - public function setAdditionalRecipients(?array $additionalRecipients): void - { - $this->additionalRecipients['value'] = $additionalRecipients; - } - - /** - * Unsets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this checkout. - * For example, fees assessed on the purchase by a third party integration. - */ - public function unsetAdditionalRecipients(): void - { - $this->additionalRecipients = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->checkoutPageUrl)) { - $json['checkout_page_url'] = $this->checkoutPageUrl['value']; - } - if (!empty($this->askForShippingAddress)) { - $json['ask_for_shipping_address'] = $this->askForShippingAddress['value']; - } - if (!empty($this->merchantSupportEmail)) { - $json['merchant_support_email'] = $this->merchantSupportEmail['value']; - } - if (!empty($this->prePopulateBuyerEmail)) { - $json['pre_populate_buyer_email'] = $this->prePopulateBuyerEmail['value']; - } - if (isset($this->prePopulateShippingAddress)) { - $json['pre_populate_shipping_address'] = $this->prePopulateShippingAddress; - } - if (!empty($this->redirectUrl)) { - $json['redirect_url'] = $this->redirectUrl['value']; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->additionalRecipients)) { - $json['additional_recipients'] = $this->additionalRecipients['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutLocationSettings.php b/src/Models/CheckoutLocationSettings.php deleted file mode 100644 index 14e61b64..00000000 --- a/src/Models/CheckoutLocationSettings.php +++ /dev/null @@ -1,268 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location that these settings apply to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location that these settings apply to. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Customer Notes Enabled. - * Indicates whether customers are allowed to leave notes at checkout. - */ - public function getCustomerNotesEnabled(): ?bool - { - if (count($this->customerNotesEnabled) == 0) { - return null; - } - return $this->customerNotesEnabled['value']; - } - - /** - * Sets Customer Notes Enabled. - * Indicates whether customers are allowed to leave notes at checkout. - * - * @maps customer_notes_enabled - */ - public function setCustomerNotesEnabled(?bool $customerNotesEnabled): void - { - $this->customerNotesEnabled['value'] = $customerNotesEnabled; - } - - /** - * Unsets Customer Notes Enabled. - * Indicates whether customers are allowed to leave notes at checkout. - */ - public function unsetCustomerNotesEnabled(): void - { - $this->customerNotesEnabled = []; - } - - /** - * Returns Policies. - * Policy information is displayed at the bottom of the checkout pages. - * You can set a maximum of two policies. - * - * @return CheckoutLocationSettingsPolicy[]|null - */ - public function getPolicies(): ?array - { - if (count($this->policies) == 0) { - return null; - } - return $this->policies['value']; - } - - /** - * Sets Policies. - * Policy information is displayed at the bottom of the checkout pages. - * You can set a maximum of two policies. - * - * @maps policies - * - * @param CheckoutLocationSettingsPolicy[]|null $policies - */ - public function setPolicies(?array $policies): void - { - $this->policies['value'] = $policies; - } - - /** - * Unsets Policies. - * Policy information is displayed at the bottom of the checkout pages. - * You can set a maximum of two policies. - */ - public function unsetPolicies(): void - { - $this->policies = []; - } - - /** - * Returns Branding. - */ - public function getBranding(): ?CheckoutLocationSettingsBranding - { - return $this->branding; - } - - /** - * Sets Branding. - * - * @maps branding - */ - public function setBranding(?CheckoutLocationSettingsBranding $branding): void - { - $this->branding = $branding; - } - - /** - * Returns Tipping. - */ - public function getTipping(): ?CheckoutLocationSettingsTipping - { - return $this->tipping; - } - - /** - * Sets Tipping. - * - * @maps tipping - */ - public function setTipping(?CheckoutLocationSettingsTipping $tipping): void - { - $this->tipping = $tipping; - } - - /** - * Returns Coupons. - */ - public function getCoupons(): ?CheckoutLocationSettingsCoupons - { - return $this->coupons; - } - - /** - * Sets Coupons. - * - * @maps coupons - */ - public function setCoupons(?CheckoutLocationSettingsCoupons $coupons): void - { - $this->coupons = $coupons; - } - - /** - * Returns Updated At. - * The timestamp when the settings were last updated, in RFC 3339 format. - * Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: - * UTC: 2020-01-26T02:25:34Z - * Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the settings were last updated, in RFC 3339 format. - * Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: - * UTC: 2020-01-26T02:25:34Z - * Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->customerNotesEnabled)) { - $json['customer_notes_enabled'] = $this->customerNotesEnabled['value']; - } - if (!empty($this->policies)) { - $json['policies'] = $this->policies['value']; - } - if (isset($this->branding)) { - $json['branding'] = $this->branding; - } - if (isset($this->tipping)) { - $json['tipping'] = $this->tipping; - } - if (isset($this->coupons)) { - $json['coupons'] = $this->coupons; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutLocationSettingsBranding.php b/src/Models/CheckoutLocationSettingsBranding.php deleted file mode 100644 index 6bc66006..00000000 --- a/src/Models/CheckoutLocationSettingsBranding.php +++ /dev/null @@ -1,121 +0,0 @@ -headerType; - } - - /** - * Sets Header Type. - * - * @maps header_type - */ - public function setHeaderType(?string $headerType): void - { - $this->headerType = $headerType; - } - - /** - * Returns Button Color. - * The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF"). - */ - public function getButtonColor(): ?string - { - if (count($this->buttonColor) == 0) { - return null; - } - return $this->buttonColor['value']; - } - - /** - * Sets Button Color. - * The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF"). - * - * @maps button_color - */ - public function setButtonColor(?string $buttonColor): void - { - $this->buttonColor['value'] = $buttonColor; - } - - /** - * Unsets Button Color. - * The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF"). - */ - public function unsetButtonColor(): void - { - $this->buttonColor = []; - } - - /** - * Returns Button Shape. - */ - public function getButtonShape(): ?string - { - return $this->buttonShape; - } - - /** - * Sets Button Shape. - * - * @maps button_shape - */ - public function setButtonShape(?string $buttonShape): void - { - $this->buttonShape = $buttonShape; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->headerType)) { - $json['header_type'] = $this->headerType; - } - if (!empty($this->buttonColor)) { - $json['button_color'] = $this->buttonColor['value']; - } - if (isset($this->buttonShape)) { - $json['button_shape'] = $this->buttonShape; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutLocationSettingsBrandingButtonShape.php b/src/Models/CheckoutLocationSettingsBrandingButtonShape.php deleted file mode 100644 index 4d82c619..00000000 --- a/src/Models/CheckoutLocationSettingsBrandingButtonShape.php +++ /dev/null @@ -1,14 +0,0 @@ -enabled) == 0) { - return null; - } - return $this->enabled['value']; - } - - /** - * Sets Enabled. - * Indicates whether coupons are enabled for this location. - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled['value'] = $enabled; - } - - /** - * Unsets Enabled. - * Indicates whether coupons are enabled for this location. - */ - public function unsetEnabled(): void - { - $this->enabled = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->enabled)) { - $json['enabled'] = $this->enabled['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutLocationSettingsPolicy.php b/src/Models/CheckoutLocationSettingsPolicy.php deleted file mode 100644 index acea7a9e..00000000 --- a/src/Models/CheckoutLocationSettingsPolicy.php +++ /dev/null @@ -1,155 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID to identify the policy when making changes. You must set the UID for policy updates, but - * it’s optional when setting new policies. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID to identify the policy when making changes. You must set the UID for policy updates, but - * it’s optional when setting new policies. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Title. - * The title of the policy. This is required when setting the description, though you can update it in - * a different request. - */ - public function getTitle(): ?string - { - if (count($this->title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The title of the policy. This is required when setting the description, though you can update it in - * a different request. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The title of the policy. This is required when setting the description, though you can update it in - * a different request. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Description. - * The description of the policy. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The description of the policy. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The description of the policy. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutLocationSettingsTipping.php b/src/Models/CheckoutLocationSettingsTipping.php deleted file mode 100644 index db83d62b..00000000 --- a/src/Models/CheckoutLocationSettingsTipping.php +++ /dev/null @@ -1,252 +0,0 @@ -percentages) == 0) { - return null; - } - return $this->percentages['value']; - } - - /** - * Sets Percentages. - * Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, - * this only applies to transactions totaling $10 or more. - * - * @maps percentages - * - * @param int[]|null $percentages - */ - public function setPercentages(?array $percentages): void - { - $this->percentages['value'] = $percentages; - } - - /** - * Unsets Percentages. - * Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, - * this only applies to transactions totaling $10 or more. - */ - public function unsetPercentages(): void - { - $this->percentages = []; - } - - /** - * Returns Smart Tipping Enabled. - * Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows: - * If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3. - * If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. - * You can set custom percentage amounts with the `percentages` field. - */ - public function getSmartTippingEnabled(): ?bool - { - if (count($this->smartTippingEnabled) == 0) { - return null; - } - return $this->smartTippingEnabled['value']; - } - - /** - * Sets Smart Tipping Enabled. - * Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows: - * If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3. - * If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. - * You can set custom percentage amounts with the `percentages` field. - * - * @maps smart_tipping_enabled - */ - public function setSmartTippingEnabled(?bool $smartTippingEnabled): void - { - $this->smartTippingEnabled['value'] = $smartTippingEnabled; - } - - /** - * Unsets Smart Tipping Enabled. - * Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows: - * If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3. - * If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. - * You can set custom percentage amounts with the `percentages` field. - */ - public function unsetSmartTippingEnabled(): void - { - $this->smartTippingEnabled = []; - } - - /** - * Returns Default Percent. - * Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only - * applies to transactions totaling $10 or more. - */ - public function getDefaultPercent(): ?int - { - if (count($this->defaultPercent) == 0) { - return null; - } - return $this->defaultPercent['value']; - } - - /** - * Sets Default Percent. - * Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only - * applies to transactions totaling $10 or more. - * - * @maps default_percent - */ - public function setDefaultPercent(?int $defaultPercent): void - { - $this->defaultPercent['value'] = $defaultPercent; - } - - /** - * Unsets Default Percent. - * Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only - * applies to transactions totaling $10 or more. - */ - public function unsetDefaultPercent(): void - { - $this->defaultPercent = []; - } - - /** - * Returns Smart Tips. - * Show the Smart Tip Amounts for this location. - * - * @return Money[]|null - */ - public function getSmartTips(): ?array - { - if (count($this->smartTips) == 0) { - return null; - } - return $this->smartTips['value']; - } - - /** - * Sets Smart Tips. - * Show the Smart Tip Amounts for this location. - * - * @maps smart_tips - * - * @param Money[]|null $smartTips - */ - public function setSmartTips(?array $smartTips): void - { - $this->smartTips['value'] = $smartTips; - } - - /** - * Unsets Smart Tips. - * Show the Smart Tip Amounts for this location. - */ - public function unsetSmartTips(): void - { - $this->smartTips = []; - } - - /** - * Returns Default Smart Tip. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getDefaultSmartTip(): ?Money - { - return $this->defaultSmartTip; - } - - /** - * Sets Default Smart Tip. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps default_smart_tip - */ - public function setDefaultSmartTip(?Money $defaultSmartTip): void - { - $this->defaultSmartTip = $defaultSmartTip; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->percentages)) { - $json['percentages'] = $this->percentages['value']; - } - if (!empty($this->smartTippingEnabled)) { - $json['smart_tipping_enabled'] = $this->smartTippingEnabled['value']; - } - if (!empty($this->defaultPercent)) { - $json['default_percent'] = $this->defaultPercent['value']; - } - if (!empty($this->smartTips)) { - $json['smart_tips'] = $this->smartTips['value']; - } - if (isset($this->defaultSmartTip)) { - $json['default_smart_tip'] = $this->defaultSmartTip; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutMerchantSettings.php b/src/Models/CheckoutMerchantSettings.php deleted file mode 100644 index 08e46a02..00000000 --- a/src/Models/CheckoutMerchantSettings.php +++ /dev/null @@ -1,89 +0,0 @@ -paymentMethods; - } - - /** - * Sets Payment Methods. - * - * @maps payment_methods - */ - public function setPaymentMethods(?CheckoutMerchantSettingsPaymentMethods $paymentMethods): void - { - $this->paymentMethods = $paymentMethods; - } - - /** - * Returns Updated At. - * The timestamp when the settings were last updated, in RFC 3339 format. - * Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: - * UTC: 2020-01-26T02:25:34Z - * Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the settings were last updated, in RFC 3339 format. - * Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: - * UTC: 2020-01-26T02:25:34Z - * Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->paymentMethods)) { - $json['payment_methods'] = $this->paymentMethods; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutMerchantSettingsPaymentMethods.php b/src/Models/CheckoutMerchantSettingsPaymentMethods.php deleted file mode 100644 index f3d6c348..00000000 --- a/src/Models/CheckoutMerchantSettingsPaymentMethods.php +++ /dev/null @@ -1,142 +0,0 @@ -applePay; - } - - /** - * Sets Apple Pay. - * The settings allowed for a payment method. - * - * @maps apple_pay - */ - public function setApplePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $applePay): void - { - $this->applePay = $applePay; - } - - /** - * Returns Google Pay. - * The settings allowed for a payment method. - */ - public function getGooglePay(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod - { - return $this->googlePay; - } - - /** - * Sets Google Pay. - * The settings allowed for a payment method. - * - * @maps google_pay - */ - public function setGooglePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $googlePay): void - { - $this->googlePay = $googlePay; - } - - /** - * Returns Cash App. - * The settings allowed for a payment method. - */ - public function getCashApp(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod - { - return $this->cashApp; - } - - /** - * Sets Cash App. - * The settings allowed for a payment method. - * - * @maps cash_app - */ - public function setCashApp(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $cashApp): void - { - $this->cashApp = $cashApp; - } - - /** - * Returns Afterpay Clearpay. - * The settings allowed for AfterpayClearpay. - */ - public function getAfterpayClearpay(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay - { - return $this->afterpayClearpay; - } - - /** - * Sets Afterpay Clearpay. - * The settings allowed for AfterpayClearpay. - * - * @maps afterpay_clearpay - */ - public function setAfterpayClearpay( - ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay $afterpayClearpay - ): void { - $this->afterpayClearpay = $afterpayClearpay; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->applePay)) { - $json['apple_pay'] = $this->applePay; - } - if (isset($this->googlePay)) { - $json['google_pay'] = $this->googlePay; - } - if (isset($this->cashApp)) { - $json['cash_app'] = $this->cashApp; - } - if (isset($this->afterpayClearpay)) { - $json['afterpay_clearpay'] = $this->afterpayClearpay; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php b/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php deleted file mode 100644 index cb052f02..00000000 --- a/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php +++ /dev/null @@ -1,118 +0,0 @@ -orderEligibilityRange; - } - - /** - * Sets Order Eligibility Range. - * A range of purchase price that qualifies. - * - * @maps order_eligibility_range - */ - public function setOrderEligibilityRange( - ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $orderEligibilityRange - ): void { - $this->orderEligibilityRange = $orderEligibilityRange; - } - - /** - * Returns Item Eligibility Range. - * A range of purchase price that qualifies. - */ - public function getItemEligibilityRange(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange - { - return $this->itemEligibilityRange; - } - - /** - * Sets Item Eligibility Range. - * A range of purchase price that qualifies. - * - * @maps item_eligibility_range - */ - public function setItemEligibilityRange( - ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $itemEligibilityRange - ): void { - $this->itemEligibilityRange = $itemEligibilityRange; - } - - /** - * Returns Enabled. - * Indicates whether the payment method is enabled for the account. - */ - public function getEnabled(): ?bool - { - return $this->enabled; - } - - /** - * Sets Enabled. - * Indicates whether the payment method is enabled for the account. - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled = $enabled; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orderEligibilityRange)) { - $json['order_eligibility_range'] = $this->orderEligibilityRange; - } - if (isset($this->itemEligibilityRange)) { - $json['item_eligibility_range'] = $this->itemEligibilityRange; - } - if (isset($this->enabled)) { - $json['enabled'] = $this->enabled; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php b/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php deleted file mode 100644 index d65f6108..00000000 --- a/src/Models/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php +++ /dev/null @@ -1,120 +0,0 @@ -min = $min; - $this->max = $max; - } - - /** - * Returns Min. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMin(): Money - { - return $this->min; - } - - /** - * Sets Min. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps min - */ - public function setMin(Money $min): void - { - $this->min = $min; - } - - /** - * Returns Max. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMax(): Money - { - return $this->max; - } - - /** - * Sets Max. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps max - */ - public function setMax(Money $max): void - { - $this->max = $max; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['min'] = $this->min; - $json['max'] = $this->max; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php b/src/Models/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php deleted file mode 100644 index aa0b5b47..00000000 --- a/src/Models/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php +++ /dev/null @@ -1,72 +0,0 @@ -enabled) == 0) { - return null; - } - return $this->enabled['value']; - } - - /** - * Sets Enabled. - * Indicates whether the payment method is enabled for the account. - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled['value'] = $enabled; - } - - /** - * Unsets Enabled. - * Indicates whether the payment method is enabled for the account. - */ - public function unsetEnabled(): void - { - $this->enabled = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->enabled)) { - $json['enabled'] = $this->enabled['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutOptions.php b/src/Models/CheckoutOptions.php deleted file mode 100644 index d2156e20..00000000 --- a/src/Models/CheckoutOptions.php +++ /dev/null @@ -1,457 +0,0 @@ -allowTipping) == 0) { - return null; - } - return $this->allowTipping['value']; - } - - /** - * Sets Allow Tipping. - * Indicates whether the payment allows tipping. - * - * @maps allow_tipping - */ - public function setAllowTipping(?bool $allowTipping): void - { - $this->allowTipping['value'] = $allowTipping; - } - - /** - * Unsets Allow Tipping. - * Indicates whether the payment allows tipping. - */ - public function unsetAllowTipping(): void - { - $this->allowTipping = []; - } - - /** - * Returns Custom Fields. - * The custom fields requesting information from the buyer. - * - * @return CustomField[]|null - */ - public function getCustomFields(): ?array - { - if (count($this->customFields) == 0) { - return null; - } - return $this->customFields['value']; - } - - /** - * Sets Custom Fields. - * The custom fields requesting information from the buyer. - * - * @maps custom_fields - * - * @param CustomField[]|null $customFields - */ - public function setCustomFields(?array $customFields): void - { - $this->customFields['value'] = $customFields; - } - - /** - * Unsets Custom Fields. - * The custom fields requesting information from the buyer. - */ - public function unsetCustomFields(): void - { - $this->customFields = []; - } - - /** - * Returns Subscription Plan Id. - * The ID of the subscription plan for the buyer to pay and subscribe. - * For more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout- - * api/subscription-plan-checkout). - */ - public function getSubscriptionPlanId(): ?string - { - if (count($this->subscriptionPlanId) == 0) { - return null; - } - return $this->subscriptionPlanId['value']; - } - - /** - * Sets Subscription Plan Id. - * The ID of the subscription plan for the buyer to pay and subscribe. - * For more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout- - * api/subscription-plan-checkout). - * - * @maps subscription_plan_id - */ - public function setSubscriptionPlanId(?string $subscriptionPlanId): void - { - $this->subscriptionPlanId['value'] = $subscriptionPlanId; - } - - /** - * Unsets Subscription Plan Id. - * The ID of the subscription plan for the buyer to pay and subscribe. - * For more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout- - * api/subscription-plan-checkout). - */ - public function unsetSubscriptionPlanId(): void - { - $this->subscriptionPlanId = []; - } - - /** - * Returns Redirect Url. - * The confirmation page URL to redirect the buyer to after Square processes the payment. - */ - public function getRedirectUrl(): ?string - { - if (count($this->redirectUrl) == 0) { - return null; - } - return $this->redirectUrl['value']; - } - - /** - * Sets Redirect Url. - * The confirmation page URL to redirect the buyer to after Square processes the payment. - * - * @maps redirect_url - */ - public function setRedirectUrl(?string $redirectUrl): void - { - $this->redirectUrl['value'] = $redirectUrl; - } - - /** - * Unsets Redirect Url. - * The confirmation page URL to redirect the buyer to after Square processes the payment. - */ - public function unsetRedirectUrl(): void - { - $this->redirectUrl = []; - } - - /** - * Returns Merchant Support Email. - * The email address that buyers can use to contact the seller. - */ - public function getMerchantSupportEmail(): ?string - { - if (count($this->merchantSupportEmail) == 0) { - return null; - } - return $this->merchantSupportEmail['value']; - } - - /** - * Sets Merchant Support Email. - * The email address that buyers can use to contact the seller. - * - * @maps merchant_support_email - */ - public function setMerchantSupportEmail(?string $merchantSupportEmail): void - { - $this->merchantSupportEmail['value'] = $merchantSupportEmail; - } - - /** - * Unsets Merchant Support Email. - * The email address that buyers can use to contact the seller. - */ - public function unsetMerchantSupportEmail(): void - { - $this->merchantSupportEmail = []; - } - - /** - * Returns Ask for Shipping Address. - * Indicates whether to include the address fields in the payment form. - */ - public function getAskForShippingAddress(): ?bool - { - if (count($this->askForShippingAddress) == 0) { - return null; - } - return $this->askForShippingAddress['value']; - } - - /** - * Sets Ask for Shipping Address. - * Indicates whether to include the address fields in the payment form. - * - * @maps ask_for_shipping_address - */ - public function setAskForShippingAddress(?bool $askForShippingAddress): void - { - $this->askForShippingAddress['value'] = $askForShippingAddress; - } - - /** - * Unsets Ask for Shipping Address. - * Indicates whether to include the address fields in the payment form. - */ - public function unsetAskForShippingAddress(): void - { - $this->askForShippingAddress = []; - } - - /** - * Returns Accepted Payment Methods. - */ - public function getAcceptedPaymentMethods(): ?AcceptedPaymentMethods - { - return $this->acceptedPaymentMethods; - } - - /** - * Sets Accepted Payment Methods. - * - * @maps accepted_payment_methods - */ - public function setAcceptedPaymentMethods(?AcceptedPaymentMethods $acceptedPaymentMethods): void - { - $this->acceptedPaymentMethods = $acceptedPaymentMethods; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Shipping Fee. - */ - public function getShippingFee(): ?ShippingFee - { - return $this->shippingFee; - } - - /** - * Sets Shipping Fee. - * - * @maps shipping_fee - */ - public function setShippingFee(?ShippingFee $shippingFee): void - { - $this->shippingFee = $shippingFee; - } - - /** - * Returns Enable Coupon. - * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing - * coupon in the payment form. - */ - public function getEnableCoupon(): ?bool - { - if (count($this->enableCoupon) == 0) { - return null; - } - return $this->enableCoupon['value']; - } - - /** - * Sets Enable Coupon. - * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing - * coupon in the payment form. - * - * @maps enable_coupon - */ - public function setEnableCoupon(?bool $enableCoupon): void - { - $this->enableCoupon['value'] = $enableCoupon; - } - - /** - * Unsets Enable Coupon. - * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing - * coupon in the payment form. - */ - public function unsetEnableCoupon(): void - { - $this->enableCoupon = []; - } - - /** - * Returns Enable Loyalty. - * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem - * rewards in the payment form, or both. - */ - public function getEnableLoyalty(): ?bool - { - if (count($this->enableLoyalty) == 0) { - return null; - } - return $this->enableLoyalty['value']; - } - - /** - * Sets Enable Loyalty. - * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem - * rewards in the payment form, or both. - * - * @maps enable_loyalty - */ - public function setEnableLoyalty(?bool $enableLoyalty): void - { - $this->enableLoyalty['value'] = $enableLoyalty; - } - - /** - * Unsets Enable Loyalty. - * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem - * rewards in the payment form, or both. - */ - public function unsetEnableLoyalty(): void - { - $this->enableLoyalty = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->allowTipping)) { - $json['allow_tipping'] = $this->allowTipping['value']; - } - if (!empty($this->customFields)) { - $json['custom_fields'] = $this->customFields['value']; - } - if (!empty($this->subscriptionPlanId)) { - $json['subscription_plan_id'] = $this->subscriptionPlanId['value']; - } - if (!empty($this->redirectUrl)) { - $json['redirect_url'] = $this->redirectUrl['value']; - } - if (!empty($this->merchantSupportEmail)) { - $json['merchant_support_email'] = $this->merchantSupportEmail['value']; - } - if (!empty($this->askForShippingAddress)) { - $json['ask_for_shipping_address'] = $this->askForShippingAddress['value']; - } - if (isset($this->acceptedPaymentMethods)) { - $json['accepted_payment_methods'] = $this->acceptedPaymentMethods; - } - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (isset($this->shippingFee)) { - $json['shipping_fee'] = $this->shippingFee; - } - if (!empty($this->enableCoupon)) { - $json['enable_coupon'] = $this->enableCoupon['value']; - } - if (!empty($this->enableLoyalty)) { - $json['enable_loyalty'] = $this->enableLoyalty['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CheckoutOptionsPaymentType.php b/src/Models/CheckoutOptionsPaymentType.php deleted file mode 100644 index 59d17043..00000000 --- a/src/Models/CheckoutOptionsPaymentType.php +++ /dev/null @@ -1,51 +0,0 @@ -emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * Email address on the buyer's Clearpay account. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * Email address on the buyer's Clearpay account. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CloneOrderRequest.php b/src/Models/CloneOrderRequest.php deleted file mode 100644 index cb86d5d0..00000000 --- a/src/Models/CloneOrderRequest.php +++ /dev/null @@ -1,166 +0,0 @@ -orderId = $orderId; - } - - /** - * Returns Order Id. - * The ID of the order to clone. - */ - public function getOrderId(): string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the order to clone. - * - * @required - * @maps order_id - */ - public function setOrderId(string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Returns Version. - * An optional order version for concurrency protection. - * - * If a version is provided, it must match the latest stored version of the order to clone. - * If a version is not provided, the API clones the latest version. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * An optional order version for concurrency protection. - * - * If a version is provided, it must match the latest stored version of the order to clone. - * If a version is not provided, the API clones the latest version. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this clone request. - * - * If you are unsure whether a particular order was cloned successfully, - * you can reattempt the call with the same idempotency key without - * worrying about creating duplicate cloned orders. - * The originally cloned order is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this clone request. - * - * If you are unsure whether a particular order was cloned successfully, - * you can reattempt the call with the same idempotency key without - * worrying about creating duplicate cloned orders. - * The originally cloned order is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A value you specify that uniquely identifies this clone request. - * - * If you are unsure whether a particular order was cloned successfully, - * you can reattempt the call with the same idempotency key without - * worrying about creating duplicate cloned orders. - * The originally cloned order is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['order_id'] = $this->orderId; - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CloneOrderResponse.php b/src/Models/CloneOrderResponse.php deleted file mode 100644 index 73f07b06..00000000 --- a/src/Models/CloneOrderResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CollectedData.php b/src/Models/CollectedData.php deleted file mode 100644 index 56fbf5e7..00000000 --- a/src/Models/CollectedData.php +++ /dev/null @@ -1,57 +0,0 @@ -inputText; - } - - /** - * Sets Input Text. - * The buyer's input text. - * - * @maps input_text - */ - public function setInputText(?string $inputText): void - { - $this->inputText = $inputText; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->inputText)) { - $json['input_text'] = $this->inputText; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CompletePaymentRequest.php b/src/Models/CompletePaymentRequest.php deleted file mode 100644 index 61b0dfd0..00000000 --- a/src/Models/CompletePaymentRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -versionToken) == 0) { - return null; - } - return $this->versionToken['value']; - } - - /** - * Sets Version Token. - * Used for optimistic concurrency. This opaque token identifies the current `Payment` - * version that the caller expects. If the server has a different version of the Payment, - * the update fails and a response with a VERSION_MISMATCH error is returned. - * - * @maps version_token - */ - public function setVersionToken(?string $versionToken): void - { - $this->versionToken['value'] = $versionToken; - } - - /** - * Unsets Version Token. - * Used for optimistic concurrency. This opaque token identifies the current `Payment` - * version that the caller expects. If the server has a different version of the Payment, - * the update fails and a response with a VERSION_MISMATCH error is returned. - */ - public function unsetVersionToken(): void - { - $this->versionToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->versionToken)) { - $json['version_token'] = $this->versionToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CompletePaymentResponse.php b/src/Models/CompletePaymentResponse.php deleted file mode 100644 index 85535969..00000000 --- a/src/Models/CompletePaymentResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Component.php b/src/Models/Component.php deleted file mode 100644 index db7d1d7e..00000000 --- a/src/Models/Component.php +++ /dev/null @@ -1,197 +0,0 @@ -type = $type; - } - - /** - * Returns Type. - * An enum for ComponentType. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * An enum for ComponentType. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Application Details. - */ - public function getApplicationDetails(): ?DeviceComponentDetailsApplicationDetails - { - return $this->applicationDetails; - } - - /** - * Sets Application Details. - * - * @maps application_details - */ - public function setApplicationDetails(?DeviceComponentDetailsApplicationDetails $applicationDetails): void - { - $this->applicationDetails = $applicationDetails; - } - - /** - * Returns Card Reader Details. - */ - public function getCardReaderDetails(): ?DeviceComponentDetailsCardReaderDetails - { - return $this->cardReaderDetails; - } - - /** - * Sets Card Reader Details. - * - * @maps card_reader_details - */ - public function setCardReaderDetails(?DeviceComponentDetailsCardReaderDetails $cardReaderDetails): void - { - $this->cardReaderDetails = $cardReaderDetails; - } - - /** - * Returns Battery Details. - */ - public function getBatteryDetails(): ?DeviceComponentDetailsBatteryDetails - { - return $this->batteryDetails; - } - - /** - * Sets Battery Details. - * - * @maps battery_details - */ - public function setBatteryDetails(?DeviceComponentDetailsBatteryDetails $batteryDetails): void - { - $this->batteryDetails = $batteryDetails; - } - - /** - * Returns Wifi Details. - */ - public function getWifiDetails(): ?DeviceComponentDetailsWiFiDetails - { - return $this->wifiDetails; - } - - /** - * Sets Wifi Details. - * - * @maps wifi_details - */ - public function setWifiDetails(?DeviceComponentDetailsWiFiDetails $wifiDetails): void - { - $this->wifiDetails = $wifiDetails; - } - - /** - * Returns Ethernet Details. - */ - public function getEthernetDetails(): ?DeviceComponentDetailsEthernetDetails - { - return $this->ethernetDetails; - } - - /** - * Sets Ethernet Details. - * - * @maps ethernet_details - */ - public function setEthernetDetails(?DeviceComponentDetailsEthernetDetails $ethernetDetails): void - { - $this->ethernetDetails = $ethernetDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - if (isset($this->applicationDetails)) { - $json['application_details'] = $this->applicationDetails; - } - if (isset($this->cardReaderDetails)) { - $json['card_reader_details'] = $this->cardReaderDetails; - } - if (isset($this->batteryDetails)) { - $json['battery_details'] = $this->batteryDetails; - } - if (isset($this->wifiDetails)) { - $json['wifi_details'] = $this->wifiDetails; - } - if (isset($this->ethernetDetails)) { - $json['ethernet_details'] = $this->ethernetDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ComponentComponentType.php b/src/Models/ComponentComponentType.php deleted file mode 100644 index 33557301..00000000 --- a/src/Models/ComponentComponentType.php +++ /dev/null @@ -1,23 +0,0 @@ -hasAgreed; - } - - /** - * Sets Has Agreed. - * The buyer's decision to the displayed terms. - * - * @maps has_agreed - */ - public function setHasAgreed(?bool $hasAgreed): void - { - $this->hasAgreed = $hasAgreed; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->hasAgreed)) { - $json['has_agreed'] = $this->hasAgreed; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ConfirmationOptions.php b/src/Models/ConfirmationOptions.php deleted file mode 100644 index 38efa792..00000000 --- a/src/Models/ConfirmationOptions.php +++ /dev/null @@ -1,188 +0,0 @@ -title = $title; - $this->body = $body; - $this->agreeButtonText = $agreeButtonText; - } - - /** - * Returns Title. - * The title text to display in the confirmation screen flow on the Terminal. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text to display in the confirmation screen flow on the Terminal. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Returns Body. - * The agreement details to display in the confirmation flow on the Terminal. - */ - public function getBody(): string - { - return $this->body; - } - - /** - * Sets Body. - * The agreement details to display in the confirmation flow on the Terminal. - * - * @required - * @maps body - */ - public function setBody(string $body): void - { - $this->body = $body; - } - - /** - * Returns Agree Button Text. - * The button text to display indicating the customer agrees to the displayed terms. - */ - public function getAgreeButtonText(): string - { - return $this->agreeButtonText; - } - - /** - * Sets Agree Button Text. - * The button text to display indicating the customer agrees to the displayed terms. - * - * @required - * @maps agree_button_text - */ - public function setAgreeButtonText(string $agreeButtonText): void - { - $this->agreeButtonText = $agreeButtonText; - } - - /** - * Returns Disagree Button Text. - * The button text to display indicating the customer does not agree to the displayed terms. - */ - public function getDisagreeButtonText(): ?string - { - if (count($this->disagreeButtonText) == 0) { - return null; - } - return $this->disagreeButtonText['value']; - } - - /** - * Sets Disagree Button Text. - * The button text to display indicating the customer does not agree to the displayed terms. - * - * @maps disagree_button_text - */ - public function setDisagreeButtonText(?string $disagreeButtonText): void - { - $this->disagreeButtonText['value'] = $disagreeButtonText; - } - - /** - * Unsets Disagree Button Text. - * The button text to display indicating the customer does not agree to the displayed terms. - */ - public function unsetDisagreeButtonText(): void - { - $this->disagreeButtonText = []; - } - - /** - * Returns Decision. - */ - public function getDecision(): ?ConfirmationDecision - { - return $this->decision; - } - - /** - * Sets Decision. - * - * @maps decision - */ - public function setDecision(?ConfirmationDecision $decision): void - { - $this->decision = $decision; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json['body'] = $this->body; - $json['agree_button_text'] = $this->agreeButtonText; - if (!empty($this->disagreeButtonText)) { - $json['disagree_button_text'] = $this->disagreeButtonText['value']; - } - if (isset($this->decision)) { - $json['decision'] = $this->decision; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Coordinates.php b/src/Models/Coordinates.php deleted file mode 100644 index 27cab95f..00000000 --- a/src/Models/Coordinates.php +++ /dev/null @@ -1,112 +0,0 @@ -latitude) == 0) { - return null; - } - return $this->latitude['value']; - } - - /** - * Sets Latitude. - * The latitude of the coordinate expressed in degrees. - * - * @maps latitude - */ - public function setLatitude(?float $latitude): void - { - $this->latitude['value'] = $latitude; - } - - /** - * Unsets Latitude. - * The latitude of the coordinate expressed in degrees. - */ - public function unsetLatitude(): void - { - $this->latitude = []; - } - - /** - * Returns Longitude. - * The longitude of the coordinate expressed in degrees. - */ - public function getLongitude(): ?float - { - if (count($this->longitude) == 0) { - return null; - } - return $this->longitude['value']; - } - - /** - * Sets Longitude. - * The longitude of the coordinate expressed in degrees. - * - * @maps longitude - */ - public function setLongitude(?float $longitude): void - { - $this->longitude['value'] = $longitude; - } - - /** - * Unsets Longitude. - * The longitude of the coordinate expressed in degrees. - */ - public function unsetLongitude(): void - { - $this->longitude = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->latitude)) { - $json['latitude'] = $this->latitude['value']; - } - if (!empty($this->longitude)) { - $json['longitude'] = $this->longitude['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Country.php b/src/Models/Country.php deleted file mode 100644 index 046a34b7..00000000 --- a/src/Models/Country.php +++ /dev/null @@ -1,1262 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateBookingCustomAttributeDefinitionResponse.php b/src/Models/CreateBookingCustomAttributeDefinitionResponse.php deleted file mode 100644 index a6459d4d..00000000 --- a/src/Models/CreateBookingCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateBookingRequest.php b/src/Models/CreateBookingRequest.php deleted file mode 100644 index d6154704..00000000 --- a/src/Models/CreateBookingRequest.php +++ /dev/null @@ -1,96 +0,0 @@ -booking = $booking; - } - - /** - * Returns Idempotency Key. - * A unique key to make this request an idempotent operation. - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique key to make this request an idempotent operation. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - */ - public function getBooking(): Booking - { - return $this->booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @required - * @maps booking - */ - public function setBooking(Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['booking'] = $this->booking; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateBookingResponse.php b/src/Models/CreateBookingResponse.php deleted file mode 100644 index 096aa775..00000000 --- a/src/Models/CreateBookingResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @maps booking - */ - public function setBooking(?Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->booking)) { - $json['booking'] = $this->booking; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateBreakTypeRequest.php b/src/Models/CreateBreakTypeRequest.php deleted file mode 100644 index 2e153843..00000000 --- a/src/Models/CreateBreakTypeRequest.php +++ /dev/null @@ -1,97 +0,0 @@ -breakType = $breakType; - } - - /** - * Returns Idempotency Key. - * A unique string value to ensure the idempotency of the operation. - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string value to ensure the idempotency of the operation. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - */ - public function getBreakType(): BreakType - { - return $this->breakType; - } - - /** - * Sets Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - * - * @required - * @maps break_type - */ - public function setBreakType(BreakType $breakType): void - { - $this->breakType = $breakType; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['break_type'] = $this->breakType; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateBreakTypeResponse.php b/src/Models/CreateBreakTypeResponse.php deleted file mode 100644 index 95de8056..00000000 --- a/src/Models/CreateBreakTypeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -breakType; - } - - /** - * Sets Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - * - * @maps break_type - */ - public function setBreakType(?BreakType $breakType): void - { - $this->breakType = $breakType; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->breakType)) { - $json['break_type'] = $this->breakType; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCardRequest.php b/src/Models/CreateCardRequest.php deleted file mode 100644 index ddfee84d..00000000 --- a/src/Models/CreateCardRequest.php +++ /dev/null @@ -1,180 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->sourceId = $sourceId; - $this->card = $card; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this CreateCard request. Keys can be - * any valid string and must be unique for every request. - * - * Max: 45 characters - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this CreateCard request. Keys can be - * any valid string and must be unique for every request. - * - * Max: 45 characters - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Source Id. - * The ID of the source which represents the card information to be stored. This can be a card nonce or - * a payment id. - */ - public function getSourceId(): string - { - return $this->sourceId; - } - - /** - * Sets Source Id. - * The ID of the source which represents the card information to be stored. This can be a card nonce or - * a payment id. - * - * @required - * @maps source_id - */ - public function setSourceId(string $sourceId): void - { - $this->sourceId = $sourceId; - } - - /** - * Returns Verification Token. - * An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - * - * See the [SCA Overview](https://developer.squareup.com/docs/sca-overview). - */ - public function getVerificationToken(): ?string - { - return $this->verificationToken; - } - - /** - * Sets Verification Token. - * An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - * - * See the [SCA Overview](https://developer.squareup.com/docs/sca-overview). - * - * @maps verification_token - */ - public function setVerificationToken(?string $verificationToken): void - { - $this->verificationToken = $verificationToken; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @required - * @maps card - */ - public function setCard(Card $card): void - { - $this->card = $card; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['source_id'] = $this->sourceId; - if (isset($this->verificationToken)) { - $json['verification_token'] = $this->verificationToken; - } - $json['card'] = $this->card; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCardResponse.php b/src/Models/CreateCardResponse.php deleted file mode 100644 index f56ce269..00000000 --- a/src/Models/CreateCardResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors resulting from the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCatalogImageRequest.php b/src/Models/CreateCatalogImageRequest.php deleted file mode 100644 index 891e1a72..00000000 --- a/src/Models/CreateCatalogImageRequest.php +++ /dev/null @@ -1,203 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->image = $image; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this CreateCatalogImage request. - * Keys can be any valid string but must be unique for every CreateCatalogImage request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this CreateCatalogImage request. - * Keys can be any valid string but must be unique for every CreateCatalogImage request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Object Id. - * Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this - * field empty to create unattached images, for example if you are building an integration - * where an image can be attached to catalog items at a later time. - */ - public function getObjectId(): ?string - { - return $this->objectId; - } - - /** - * Sets Object Id. - * Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this - * field empty to create unattached images, for example if you are building an integration - * where an image can be attached to catalog items at a later time. - * - * @maps object_id - */ - public function setObjectId(?string $objectId): void - { - $this->objectId = $objectId; - } - - /** - * Returns Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getImage(): CatalogObject - { - return $this->image; - } - - /** - * Sets Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @required - * @maps image - */ - public function setImage(CatalogObject $image): void - { - $this->image = $image; - } - - /** - * Returns Is Primary. - * If this is set to `true`, the image created will be the primary, or first image of the object - * referenced by `object_id`. - * If the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will - * replace the primary image. - * If this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will - * be appended to the list of `image_ids` on the object. - * - * With Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective - * default value is `true`. - */ - public function getIsPrimary(): ?bool - { - return $this->isPrimary; - } - - /** - * Sets Is Primary. - * If this is set to `true`, the image created will be the primary, or first image of the object - * referenced by `object_id`. - * If the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will - * replace the primary image. - * If this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will - * be appended to the list of `image_ids` on the object. - * - * With Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective - * default value is `true`. - * - * @maps is_primary - */ - public function setIsPrimary(?bool $isPrimary): void - { - $this->isPrimary = $isPrimary; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->objectId)) { - $json['object_id'] = $this->objectId; - } - $json['image'] = $this->image; - if (isset($this->isPrimary)) { - $json['is_primary'] = $this->isPrimary; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCatalogImageResponse.php b/src/Models/CreateCatalogImageResponse.php deleted file mode 100644 index 8db6fb83..00000000 --- a/src/Models/CreateCatalogImageResponse.php +++ /dev/null @@ -1,115 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getImage(): ?CatalogObject - { - return $this->image; - } - - /** - * Sets Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @maps image - */ - public function setImage(?CatalogObject $image): void - { - $this->image = $image; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->image)) { - $json['image'] = $this->image; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCheckoutRequest.php b/src/Models/CreateCheckoutRequest.php deleted file mode 100644 index 41968aee..00000000 --- a/src/Models/CreateCheckoutRequest.php +++ /dev/null @@ -1,395 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->order = $order; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this checkout among others you have created. It can be - * any valid string but must be unique for every order sent to Square Checkout for a given location ID. - * - * The idempotency key is used to avoid processing the same order more than once. If you are - * unsure whether a particular checkout was created successfully, you can attempt it again with - * the same idempotency key and all the same other parameters without worrying about creating - * duplicates. - * - * You should use a random number/string generator native to the language - * you are working in to generate strings for your idempotency keys. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this checkout among others you have created. It can be - * any valid string but must be unique for every order sent to Square Checkout for a given location ID. - * - * The idempotency key is used to avoid processing the same order more than once. If you are - * unsure whether a particular checkout was created successfully, you can attempt it again with - * the same idempotency key and all the same other parameters without worrying about creating - * duplicates. - * - * You should use a random number/string generator native to the language - * you are working in to generate strings for your idempotency keys. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Order. - */ - public function getOrder(): CreateOrderRequest - { - return $this->order; - } - - /** - * Sets Order. - * - * @required - * @maps order - */ - public function setOrder(CreateOrderRequest $order): void - { - $this->order = $order; - } - - /** - * Returns Ask for Shipping Address. - * If `true`, Square Checkout collects shipping information on your behalf and stores - * that information with the transaction information in the Square Seller Dashboard. - * - * Default: `false`. - */ - public function getAskForShippingAddress(): ?bool - { - return $this->askForShippingAddress; - } - - /** - * Sets Ask for Shipping Address. - * If `true`, Square Checkout collects shipping information on your behalf and stores - * that information with the transaction information in the Square Seller Dashboard. - * - * Default: `false`. - * - * @maps ask_for_shipping_address - */ - public function setAskForShippingAddress(?bool $askForShippingAddress): void - { - $this->askForShippingAddress = $askForShippingAddress; - } - - /** - * Returns Merchant Support Email. - * The email address to display on the Square Checkout confirmation page - * and confirmation email that the buyer can use to contact the seller. - * - * If this value is not set, the confirmation page and email display the - * primary email address associated with the seller's Square account. - * - * Default: none; only exists if explicitly set. - */ - public function getMerchantSupportEmail(): ?string - { - return $this->merchantSupportEmail; - } - - /** - * Sets Merchant Support Email. - * The email address to display on the Square Checkout confirmation page - * and confirmation email that the buyer can use to contact the seller. - * - * If this value is not set, the confirmation page and email display the - * primary email address associated with the seller's Square account. - * - * Default: none; only exists if explicitly set. - * - * @maps merchant_support_email - */ - public function setMerchantSupportEmail(?string $merchantSupportEmail): void - { - $this->merchantSupportEmail = $merchantSupportEmail; - } - - /** - * Returns Pre Populate Buyer Email. - * If provided, the buyer's email is prepopulated on the checkout page - * as an editable text field. - * - * Default: none; only exists if explicitly set. - */ - public function getPrePopulateBuyerEmail(): ?string - { - return $this->prePopulateBuyerEmail; - } - - /** - * Sets Pre Populate Buyer Email. - * If provided, the buyer's email is prepopulated on the checkout page - * as an editable text field. - * - * Default: none; only exists if explicitly set. - * - * @maps pre_populate_buyer_email - */ - public function setPrePopulateBuyerEmail(?string $prePopulateBuyerEmail): void - { - $this->prePopulateBuyerEmail = $prePopulateBuyerEmail; - } - - /** - * Returns Pre Populate Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getPrePopulateShippingAddress(): ?Address - { - return $this->prePopulateShippingAddress; - } - - /** - * Sets Pre Populate Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps pre_populate_shipping_address - */ - public function setPrePopulateShippingAddress(?Address $prePopulateShippingAddress): void - { - $this->prePopulateShippingAddress = $prePopulateShippingAddress; - } - - /** - * Returns Redirect Url. - * The URL to redirect to after the checkout is completed with `checkoutId`, - * `transactionId`, and `referenceId` appended as URL parameters. For example, - * if the provided redirect URL is `http://www.example.com/order-complete`, a - * successful transaction redirects the customer to: - * - * `http://www.example.com/order-complete?checkoutId=xxxxxx&referenceId=xxxxxx& - * transactionId=xxxxxx` - * - * If you do not provide a redirect URL, Square Checkout displays an order - * confirmation page on your behalf; however, it is strongly recommended that - * you provide a redirect URL so you can verify the transaction results and - * finalize the order through your existing/normal confirmation workflow. - * - * Default: none; only exists if explicitly set. - */ - public function getRedirectUrl(): ?string - { - return $this->redirectUrl; - } - - /** - * Sets Redirect Url. - * The URL to redirect to after the checkout is completed with `checkoutId`, - * `transactionId`, and `referenceId` appended as URL parameters. For example, - * if the provided redirect URL is `http://www.example.com/order-complete`, a - * successful transaction redirects the customer to: - * - * `http://www.example.com/order-complete?checkoutId=xxxxxx&referenceId=xxxxxx& - * transactionId=xxxxxx` - * - * If you do not provide a redirect URL, Square Checkout displays an order - * confirmation page on your behalf; however, it is strongly recommended that - * you provide a redirect URL so you can verify the transaction results and - * finalize the order through your existing/normal confirmation workflow. - * - * Default: none; only exists if explicitly set. - * - * @maps redirect_url - */ - public function setRedirectUrl(?string $redirectUrl): void - { - $this->redirectUrl = $redirectUrl; - } - - /** - * Returns Additional Recipients. - * The basic primitive of a multi-party transaction. The value is optional. - * The transaction facilitated by you can be split from here. - * - * If you provide this value, the `amount_money` value in your `additional_recipients` field - * cannot be more than 90% of the `total_money` calculated by Square for your order. - * The `location_id` must be a valid seller location where the checkout is occurring. - * - * This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. - * - * This field is currently not supported in the Square Sandbox. - * - * @return ChargeRequestAdditionalRecipient[]|null - */ - public function getAdditionalRecipients(): ?array - { - return $this->additionalRecipients; - } - - /** - * Sets Additional Recipients. - * The basic primitive of a multi-party transaction. The value is optional. - * The transaction facilitated by you can be split from here. - * - * If you provide this value, the `amount_money` value in your `additional_recipients` field - * cannot be more than 90% of the `total_money` calculated by Square for your order. - * The `location_id` must be a valid seller location where the checkout is occurring. - * - * This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. - * - * This field is currently not supported in the Square Sandbox. - * - * @maps additional_recipients - * - * @param ChargeRequestAdditionalRecipient[]|null $additionalRecipients - */ - public function setAdditionalRecipients(?array $additionalRecipients): void - { - $this->additionalRecipients = $additionalRecipients; - } - - /** - * Returns Note. - * An optional note to associate with the `checkout` object. - * - * This value cannot exceed 60 characters. - */ - public function getNote(): ?string - { - return $this->note; - } - - /** - * Sets Note. - * An optional note to associate with the `checkout` object. - * - * This value cannot exceed 60 characters. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note = $note; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['order'] = $this->order; - if (isset($this->askForShippingAddress)) { - $json['ask_for_shipping_address'] = $this->askForShippingAddress; - } - if (isset($this->merchantSupportEmail)) { - $json['merchant_support_email'] = $this->merchantSupportEmail; - } - if (isset($this->prePopulateBuyerEmail)) { - $json['pre_populate_buyer_email'] = $this->prePopulateBuyerEmail; - } - if (isset($this->prePopulateShippingAddress)) { - $json['pre_populate_shipping_address'] = $this->prePopulateShippingAddress; - } - if (isset($this->redirectUrl)) { - $json['redirect_url'] = $this->redirectUrl; - } - if (isset($this->additionalRecipients)) { - $json['additional_recipients'] = $this->additionalRecipients; - } - if (isset($this->note)) { - $json['note'] = $this->note; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCheckoutResponse.php b/src/Models/CreateCheckoutResponse.php deleted file mode 100644 index ab062a9b..00000000 --- a/src/Models/CreateCheckoutResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -checkout; - } - - /** - * Sets Checkout. - * Square Checkout lets merchants accept online payments for supported - * payment types using a checkout workflow hosted on squareup.com. - * - * @maps checkout - */ - public function setCheckout(?Checkout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->checkout)) { - $json['checkout'] = $this->checkout; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerCardRequest.php b/src/Models/CreateCustomerCardRequest.php deleted file mode 100644 index dcf3d8b4..00000000 --- a/src/Models/CreateCustomerCardRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -cardNonce = $cardNonce; - } - - /** - * Returns Card Nonce. - * A card nonce representing the credit card to link to the customer. - * - * Card nonces are generated by the Square payment form when customers enter - * their card information. For more information, see - * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web- - * payments/take-card-payment). - * - * __NOTE:__ Card nonces generated by digital wallets (such as Apple Pay) - * cannot be used to create a customer card. - */ - public function getCardNonce(): string - { - return $this->cardNonce; - } - - /** - * Sets Card Nonce. - * A card nonce representing the credit card to link to the customer. - * - * Card nonces are generated by the Square payment form when customers enter - * their card information. For more information, see - * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web- - * payments/take-card-payment). - * - * __NOTE:__ Card nonces generated by digital wallets (such as Apple Pay) - * cannot be used to create a customer card. - * - * @required - * @maps card_nonce - */ - public function setCardNonce(string $cardNonce): void - { - $this->cardNonce = $cardNonce; - } - - /** - * Returns Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBillingAddress(): ?Address - { - return $this->billingAddress; - } - - /** - * Sets Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps billing_address - */ - public function setBillingAddress(?Address $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * Returns Cardholder Name. - * The full name printed on the credit card. - */ - public function getCardholderName(): ?string - { - return $this->cardholderName; - } - - /** - * Sets Cardholder Name. - * The full name printed on the credit card. - * - * @maps cardholder_name - */ - public function setCardholderName(?string $cardholderName): void - { - $this->cardholderName = $cardholderName; - } - - /** - * Returns Verification Token. - * An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - */ - public function getVerificationToken(): ?string - { - return $this->verificationToken; - } - - /** - * Sets Verification Token. - * An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - * - * @maps verification_token - */ - public function setVerificationToken(?string $verificationToken): void - { - $this->verificationToken = $verificationToken; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['card_nonce'] = $this->cardNonce; - if (isset($this->billingAddress)) { - $json['billing_address'] = $this->billingAddress; - } - if (isset($this->cardholderName)) { - $json['cardholder_name'] = $this->cardholderName; - } - if (isset($this->verificationToken)) { - $json['verification_token'] = $this->verificationToken; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerCardResponse.php b/src/Models/CreateCustomerCardResponse.php deleted file mode 100644 index ee541fd8..00000000 --- a/src/Models/CreateCustomerCardResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerCustomAttributeDefinitionRequest.php b/src/Models/CreateCustomerCustomAttributeDefinitionRequest.php deleted file mode 100644 index 55429056..00000000 --- a/src/Models/CreateCustomerCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerCustomAttributeDefinitionResponse.php b/src/Models/CreateCustomerCustomAttributeDefinitionResponse.php deleted file mode 100644 index 1180a5c8..00000000 --- a/src/Models/CreateCustomerCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerGroupRequest.php b/src/Models/CreateCustomerGroupRequest.php deleted file mode 100644 index 13eef1b7..00000000 --- a/src/Models/CreateCustomerGroupRequest.php +++ /dev/null @@ -1,104 +0,0 @@ -group = $group; - } - - /** - * Returns Idempotency Key. - * The idempotency key for the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * The idempotency key for the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - */ - public function getGroup(): CustomerGroup - { - return $this->group; - } - - /** - * Sets Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - * - * @required - * @maps group - */ - public function setGroup(CustomerGroup $group): void - { - $this->group = $group; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['group'] = $this->group; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerGroupResponse.php b/src/Models/CreateCustomerGroupResponse.php deleted file mode 100644 index 2fde7045..00000000 --- a/src/Models/CreateCustomerGroupResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - */ - public function getGroup(): ?CustomerGroup - { - return $this->group; - } - - /** - * Sets Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - * - * @maps group - */ - public function setGroup(?CustomerGroup $group): void - { - $this->group = $group; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->group)) { - $json['group'] = $this->group; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerRequest.php b/src/Models/CreateCustomerRequest.php deleted file mode 100644 index b4195b67..00000000 --- a/src/Models/CreateCustomerRequest.php +++ /dev/null @@ -1,421 +0,0 @@ -idempotencyKey; - } - - /** - * Sets Idempotency Key. - * The idempotency key for the request. For more information, see - * [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - */ - public function getGivenName(): ?string - { - return $this->givenName; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName = $givenName; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - */ - public function getFamilyName(): ?string - { - return $this->familyName; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName = $familyName; - } - - /** - * Returns Company Name. - * A business name associated with the customer profile. - * - * The maximum length for this value is 500 characters. - */ - public function getCompanyName(): ?string - { - return $this->companyName; - } - - /** - * Sets Company Name. - * A business name associated with the customer profile. - * - * The maximum length for this value is 500 characters. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName = $companyName; - } - - /** - * Returns Nickname. - * A nickname for the customer profile. - * - * The maximum length for this value is 100 characters. - */ - public function getNickname(): ?string - { - return $this->nickname; - } - - /** - * Sets Nickname. - * A nickname for the customer profile. - * - * The maximum length for this value is 100 characters. - * - * @maps nickname - */ - public function setNickname(?string $nickname): void - { - $this->nickname = $nickname; - } - - /** - * Returns Email Address. - * The email address associated with the customer profile. - * - * The maximum length for this value is 254 characters. - */ - public function getEmailAddress(): ?string - { - return $this->emailAddress; - } - - /** - * Sets Email Address. - * The email address associated with the customer profile. - * - * The maximum length for this value is 254 characters. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress = $emailAddress; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The phone number associated with the customer profile. The phone number must be valid and can - * contain - * 9–16 digits, with an optional `+` prefix and country code. For more information, see - * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function getPhoneNumber(): ?string - { - return $this->phoneNumber; - } - - /** - * Sets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid and can - * contain - * 9–16 digits, with an optional `+` prefix and country code. For more information, see - * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber = $phoneNumber; - } - - /** - * Returns Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * The maximum length for this value is 100 characters. - */ - public function getReferenceId(): ?string - { - return $this->referenceId; - } - - /** - * Sets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * The maximum length for this value is 100 characters. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId = $referenceId; - } - - /** - * Returns Note. - * A custom note associated with the customer profile. - */ - public function getNote(): ?string - { - return $this->note; - } - - /** - * Sets Note. - * A custom note associated with the customer profile. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note = $note; - } - - /** - * Returns Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, - * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in - * `YYYY-MM-DD` - * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. - */ - public function getBirthday(): ?string - { - return $this->birthday; - } - - /** - * Sets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, - * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in - * `YYYY-MM-DD` - * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. - * - * @maps birthday - */ - public function setBirthday(?string $birthday): void - { - $this->birthday = $birthday; - } - - /** - * Returns Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - */ - public function getTaxIds(): ?CustomerTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?CustomerTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - if (isset($this->givenName)) { - $json['given_name'] = $this->givenName; - } - if (isset($this->familyName)) { - $json['family_name'] = $this->familyName; - } - if (isset($this->companyName)) { - $json['company_name'] = $this->companyName; - } - if (isset($this->nickname)) { - $json['nickname'] = $this->nickname; - } - if (isset($this->emailAddress)) { - $json['email_address'] = $this->emailAddress; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (isset($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber; - } - if (isset($this->referenceId)) { - $json['reference_id'] = $this->referenceId; - } - if (isset($this->note)) { - $json['note'] = $this->note; - } - if (isset($this->birthday)) { - $json['birthday'] = $this->birthday; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCustomerResponse.php b/src/Models/CreateCustomerResponse.php deleted file mode 100644 index bf06dd65..00000000 --- a/src/Models/CreateCustomerResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - */ - public function getCustomer(): ?Customer - { - return $this->customer; - } - - /** - * Sets Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - * - * @maps customer - */ - public function setCustomer(?Customer $customer): void - { - $this->customer = $customer; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->customer)) { - $json['customer'] = $this->customer; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDeviceCodeRequest.php b/src/Models/CreateDeviceCodeRequest.php deleted file mode 100644 index fd089a3b..00000000 --- a/src/Models/CreateDeviceCodeRequest.php +++ /dev/null @@ -1,99 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->deviceCode = $deviceCode; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this CreateDeviceCode request. Keys can - * be any valid string but must be unique for every CreateDeviceCode request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this CreateDeviceCode request. Keys can - * be any valid string but must be unique for every CreateDeviceCode request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Device Code. - */ - public function getDeviceCode(): DeviceCode - { - return $this->deviceCode; - } - - /** - * Sets Device Code. - * - * @required - * @maps device_code - */ - public function setDeviceCode(DeviceCode $deviceCode): void - { - $this->deviceCode = $deviceCode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['device_code'] = $this->deviceCode; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDeviceCodeResponse.php b/src/Models/CreateDeviceCodeResponse.php deleted file mode 100644 index c6b26c83..00000000 --- a/src/Models/CreateDeviceCodeResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Device Code. - */ - public function getDeviceCode(): ?DeviceCode - { - return $this->deviceCode; - } - - /** - * Sets Device Code. - * - * @maps device_code - */ - public function setDeviceCode(?DeviceCode $deviceCode): void - { - $this->deviceCode = $deviceCode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->deviceCode)) { - $json['device_code'] = $this->deviceCode; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDisputeEvidenceFileRequest.php b/src/Models/CreateDisputeEvidenceFileRequest.php deleted file mode 100644 index 6d49a294..00000000 --- a/src/Models/CreateDisputeEvidenceFileRequest.php +++ /dev/null @@ -1,127 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A unique key identifying the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/working-with-apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique key identifying the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/working-with-apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Evidence Type. - * The type of the dispute evidence. - */ - public function getEvidenceType(): ?string - { - return $this->evidenceType; - } - - /** - * Sets Evidence Type. - * The type of the dispute evidence. - * - * @maps evidence_type - */ - public function setEvidenceType(?string $evidenceType): void - { - $this->evidenceType = $evidenceType; - } - - /** - * Returns Content Type. - * The MIME type of the uploaded file. - * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. - */ - public function getContentType(): ?string - { - return $this->contentType; - } - - /** - * Sets Content Type. - * The MIME type of the uploaded file. - * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. - * - * @maps content_type - */ - public function setContentType(?string $contentType): void - { - $this->contentType = $contentType; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->evidenceType)) { - $json['evidence_type'] = $this->evidenceType; - } - if (isset($this->contentType)) { - $json['content_type'] = $this->contentType; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDisputeEvidenceFileResponse.php b/src/Models/CreateDisputeEvidenceFileResponse.php deleted file mode 100644 index ef45c539..00000000 --- a/src/Models/CreateDisputeEvidenceFileResponse.php +++ /dev/null @@ -1,90 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Evidence. - */ - public function getEvidence(): ?DisputeEvidence - { - return $this->evidence; - } - - /** - * Sets Evidence. - * - * @maps evidence - */ - public function setEvidence(?DisputeEvidence $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDisputeEvidenceTextRequest.php b/src/Models/CreateDisputeEvidenceTextRequest.php deleted file mode 100644 index b4e95ec6..00000000 --- a/src/Models/CreateDisputeEvidenceTextRequest.php +++ /dev/null @@ -1,126 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->evidenceText = $evidenceText; - } - - /** - * Returns Idempotency Key. - * A unique key identifying the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/working-with-apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique key identifying the request. For more information, see [Idempotency](https://developer. - * squareup.com/docs/working-with-apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Evidence Type. - * The type of the dispute evidence. - */ - public function getEvidenceType(): ?string - { - return $this->evidenceType; - } - - /** - * Sets Evidence Type. - * The type of the dispute evidence. - * - * @maps evidence_type - */ - public function setEvidenceType(?string $evidenceType): void - { - $this->evidenceType = $evidenceType; - } - - /** - * Returns Evidence Text. - * The evidence string. - */ - public function getEvidenceText(): string - { - return $this->evidenceText; - } - - /** - * Sets Evidence Text. - * The evidence string. - * - * @required - * @maps evidence_text - */ - public function setEvidenceText(string $evidenceText): void - { - $this->evidenceText = $evidenceText; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->evidenceType)) { - $json['evidence_type'] = $this->evidenceType; - } - $json['evidence_text'] = $this->evidenceText; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateDisputeEvidenceTextResponse.php b/src/Models/CreateDisputeEvidenceTextResponse.php deleted file mode 100644 index aab1a4f4..00000000 --- a/src/Models/CreateDisputeEvidenceTextResponse.php +++ /dev/null @@ -1,90 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Evidence. - */ - public function getEvidence(): ?DisputeEvidence - { - return $this->evidence; - } - - /** - * Sets Evidence. - * - * @maps evidence - */ - public function setEvidence(?DisputeEvidence $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateGiftCardActivityRequest.php b/src/Models/CreateGiftCardActivityRequest.php deleted file mode 100644 index cde1323e..00000000 --- a/src/Models/CreateGiftCardActivityRequest.php +++ /dev/null @@ -1,102 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->giftCardActivity = $giftCardActivity; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the `CreateGiftCardActivity` request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `CreateGiftCardActivity` request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Gift Card Activity. - * Represents an action performed on a [gift card]($m/GiftCard) that affects its state or balance. - * A gift card activity contains information about a specific activity type. For example, a `REDEEM` - * activity - * includes a `redeem_activity_details` field that contains information about the redemption. - */ - public function getGiftCardActivity(): GiftCardActivity - { - return $this->giftCardActivity; - } - - /** - * Sets Gift Card Activity. - * Represents an action performed on a [gift card]($m/GiftCard) that affects its state or balance. - * A gift card activity contains information about a specific activity type. For example, a `REDEEM` - * activity - * includes a `redeem_activity_details` field that contains information about the redemption. - * - * @required - * @maps gift_card_activity - */ - public function setGiftCardActivity(GiftCardActivity $giftCardActivity): void - { - $this->giftCardActivity = $giftCardActivity; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['gift_card_activity'] = $this->giftCardActivity; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateGiftCardActivityResponse.php b/src/Models/CreateGiftCardActivityResponse.php deleted file mode 100644 index fd5fffcb..00000000 --- a/src/Models/CreateGiftCardActivityResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card Activity. - * Represents an action performed on a [gift card]($m/GiftCard) that affects its state or balance. - * A gift card activity contains information about a specific activity type. For example, a `REDEEM` - * activity - * includes a `redeem_activity_details` field that contains information about the redemption. - */ - public function getGiftCardActivity(): ?GiftCardActivity - { - return $this->giftCardActivity; - } - - /** - * Sets Gift Card Activity. - * Represents an action performed on a [gift card]($m/GiftCard) that affects its state or balance. - * A gift card activity contains information about a specific activity type. For example, a `REDEEM` - * activity - * includes a `redeem_activity_details` field that contains information about the redemption. - * - * @maps gift_card_activity - */ - public function setGiftCardActivity(?GiftCardActivity $giftCardActivity): void - { - $this->giftCardActivity = $giftCardActivity; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCardActivity)) { - $json['gift_card_activity'] = $this->giftCardActivity; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateGiftCardRequest.php b/src/Models/CreateGiftCardRequest.php deleted file mode 100644 index 0a6265ea..00000000 --- a/src/Models/CreateGiftCardRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->locationId = $locationId; - $this->giftCard = $giftCard; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Location Id. - * The ID of the [location](entity:Location) where the gift card should be registered for - * reporting purposes. Gift cards can be redeemed at any of the seller's locations. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the [location](entity:Location) where the gift card should be registered for - * reporting purposes. Gift cards can be redeemed at any of the seller's locations. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @required - * @maps gift_card - */ - public function setGiftCard(GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['location_id'] = $this->locationId; - $json['gift_card'] = $this->giftCard; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateGiftCardResponse.php b/src/Models/CreateGiftCardResponse.php deleted file mode 100644 index 564b1662..00000000 --- a/src/Models/CreateGiftCardResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateInvoiceAttachmentRequest.php b/src/Models/CreateInvoiceAttachmentRequest.php deleted file mode 100644 index 1544ead0..00000000 --- a/src/Models/CreateInvoiceAttachmentRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `CreateInvoiceAttachment` request. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Description. - * The description of the attachment to display on the invoice. - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * Sets Description. - * The description of the attachment to display on the invoice. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description = $description; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - if (isset($this->description)) { - $json['description'] = $this->description; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateInvoiceAttachmentResponse.php b/src/Models/CreateInvoiceAttachmentResponse.php deleted file mode 100644 index 24b71440..00000000 --- a/src/Models/CreateInvoiceAttachmentResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -attachment; - } - - /** - * Sets Attachment. - * Represents a file attached to an [invoice]($m/Invoice). - * - * @maps attachment - */ - public function setAttachment(?InvoiceAttachment $attachment): void - { - $this->attachment = $attachment; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->attachment)) { - $json['attachment'] = $this->attachment; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateInvoiceRequest.php b/src/Models/CreateInvoiceRequest.php deleted file mode 100644 index 03223050..00000000 --- a/src/Models/CreateInvoiceRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -invoice = $invoice; - } - - /** - * Returns Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - */ - public function getInvoice(): Invoice - { - return $this->invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @required - * @maps invoice - */ - public function setInvoice(Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the `CreateInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `CreateInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['invoice'] = $this->invoice; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateInvoiceResponse.php b/src/Models/CreateInvoiceResponse.php deleted file mode 100644 index 10653c69..00000000 --- a/src/Models/CreateInvoiceResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @maps invoice - */ - public function setInvoice(?Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoice)) { - $json['invoice'] = $this->invoice; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateJobRequest.php b/src/Models/CreateJobRequest.php deleted file mode 100644 index 5ab981b9..00000000 --- a/src/Models/CreateJobRequest.php +++ /dev/null @@ -1,104 +0,0 @@ -job = $job; - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - */ - public function getJob(): Job - { - return $this->job; - } - - /** - * Sets Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - * - * @required - * @maps job - */ - public function setJob(Job $job): void - { - $this->job = $job; - } - - /** - * Returns Idempotency Key. - * A unique identifier for the `CreateJob` request. Keys can be any valid string, - * but must be unique for each request. For more information, see - * [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for the `CreateJob` request. Keys can be any valid string, - * but must be unique for each request. For more information, see - * [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['job'] = $this->job; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateJobResponse.php b/src/Models/CreateJobResponse.php deleted file mode 100644 index f466684b..00000000 --- a/src/Models/CreateJobResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -job; - } - - /** - * Sets Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - * - * @maps job - */ - public function setJob(?Job $job): void - { - $this->job = $job; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->job)) { - $json['job'] = $this->job; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLocationCustomAttributeDefinitionRequest.php b/src/Models/CreateLocationCustomAttributeDefinitionRequest.php deleted file mode 100644 index 3f041a0c..00000000 --- a/src/Models/CreateLocationCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLocationCustomAttributeDefinitionResponse.php b/src/Models/CreateLocationCustomAttributeDefinitionResponse.php deleted file mode 100644 index 5eba3526..00000000 --- a/src/Models/CreateLocationCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLocationRequest.php b/src/Models/CreateLocationRequest.php deleted file mode 100644 index f90507aa..00000000 --- a/src/Models/CreateLocationRequest.php +++ /dev/null @@ -1,60 +0,0 @@ -location; - } - - /** - * Sets Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - * - * @maps location - */ - public function setLocation(?Location $location): void - { - $this->location = $location; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->location)) { - $json['location'] = $this->location; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLocationResponse.php b/src/Models/CreateLocationResponse.php deleted file mode 100644 index f746093a..00000000 --- a/src/Models/CreateLocationResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) - * encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - */ - public function getLocation(): ?Location - { - return $this->location; - } - - /** - * Sets Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - * - * @maps location - */ - public function setLocation(?Location $location): void - { - $this->location = $location; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->location)) { - $json['location'] = $this->location; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyAccountRequest.php b/src/Models/CreateLoyaltyAccountRequest.php deleted file mode 100644 index b9e6169c..00000000 --- a/src/Models/CreateLoyaltyAccountRequest.php +++ /dev/null @@ -1,102 +0,0 @@ -loyaltyAccount = $loyaltyAccount; - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - */ - public function getLoyaltyAccount(): LoyaltyAccount - { - return $this->loyaltyAccount; - } - - /** - * Sets Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - * - * @required - * @maps loyalty_account - */ - public function setLoyaltyAccount(LoyaltyAccount $loyaltyAccount): void - { - $this->loyaltyAccount = $loyaltyAccount; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateLoyaltyAccount` request. - * Keys can be any valid string, but must be unique for every request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateLoyaltyAccount` request. - * Keys can be any valid string, but must be unique for every request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_account'] = $this->loyaltyAccount; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyAccountResponse.php b/src/Models/CreateLoyaltyAccountResponse.php deleted file mode 100644 index 0271906a..00000000 --- a/src/Models/CreateLoyaltyAccountResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - */ - public function getLoyaltyAccount(): ?LoyaltyAccount - { - return $this->loyaltyAccount; - } - - /** - * Sets Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - * - * @maps loyalty_account - */ - public function setLoyaltyAccount(?LoyaltyAccount $loyaltyAccount): void - { - $this->loyaltyAccount = $loyaltyAccount; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyAccount)) { - $json['loyalty_account'] = $this->loyaltyAccount; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyPromotionRequest.php b/src/Models/CreateLoyaltyPromotionRequest.php deleted file mode 100644 index 340ae123..00000000 --- a/src/Models/CreateLoyaltyPromotionRequest.php +++ /dev/null @@ -1,104 +0,0 @@ -loyaltyPromotion = $loyaltyPromotion; - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - */ - public function getLoyaltyPromotion(): LoyaltyPromotion - { - return $this->loyaltyPromotion; - } - - /** - * Sets Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - * - * @required - * @maps loyalty_promotion - */ - public function setLoyaltyPromotion(LoyaltyPromotion $loyaltyPromotion): void - { - $this->loyaltyPromotion = $loyaltyPromotion; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, which is used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, which is used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_promotion'] = $this->loyaltyPromotion; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyPromotionResponse.php b/src/Models/CreateLoyaltyPromotionResponse.php deleted file mode 100644 index e9a24b5f..00000000 --- a/src/Models/CreateLoyaltyPromotionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - */ - public function getLoyaltyPromotion(): ?LoyaltyPromotion - { - return $this->loyaltyPromotion; - } - - /** - * Sets Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - * - * @maps loyalty_promotion - */ - public function setLoyaltyPromotion(?LoyaltyPromotion $loyaltyPromotion): void - { - $this->loyaltyPromotion = $loyaltyPromotion; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyPromotion)) { - $json['loyalty_promotion'] = $this->loyaltyPromotion; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyRewardRequest.php b/src/Models/CreateLoyaltyRewardRequest.php deleted file mode 100644 index 403a0347..00000000 --- a/src/Models/CreateLoyaltyRewardRequest.php +++ /dev/null @@ -1,104 +0,0 @@ -reward = $reward; - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - */ - public function getReward(): LoyaltyReward - { - return $this->reward; - } - - /** - * Sets Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - * - * @required - * @maps reward - */ - public function setReward(LoyaltyReward $reward): void - { - $this->reward = $reward; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateLoyaltyReward` request. - * Keys can be any valid string, but must be unique for every request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateLoyaltyReward` request. - * Keys can be any valid string, but must be unique for every request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reward'] = $this->reward; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateLoyaltyRewardResponse.php b/src/Models/CreateLoyaltyRewardResponse.php deleted file mode 100644 index fe5a959f..00000000 --- a/src/Models/CreateLoyaltyRewardResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - */ - public function getReward(): ?LoyaltyReward - { - return $this->reward; - } - - /** - * Sets Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - * - * @maps reward - */ - public function setReward(?LoyaltyReward $reward): void - { - $this->reward = $reward; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->reward)) { - $json['reward'] = $this->reward; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateMerchantCustomAttributeDefinitionRequest.php b/src/Models/CreateMerchantCustomAttributeDefinitionRequest.php deleted file mode 100644 index 645efed1..00000000 --- a/src/Models/CreateMerchantCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateMerchantCustomAttributeDefinitionResponse.php b/src/Models/CreateMerchantCustomAttributeDefinitionResponse.php deleted file mode 100644 index 03f61c70..00000000 --- a/src/Models/CreateMerchantCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateMobileAuthorizationCodeRequest.php b/src/Models/CreateMobileAuthorizationCodeRequest.php deleted file mode 100644 index 6da8abcb..00000000 --- a/src/Models/CreateMobileAuthorizationCodeRequest.php +++ /dev/null @@ -1,61 +0,0 @@ -locationId; - } - - /** - * Sets Location Id. - * The Square location ID that the authorization code should be tied to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateMobileAuthorizationCodeResponse.php b/src/Models/CreateMobileAuthorizationCodeResponse.php deleted file mode 100644 index 5dbdbe9f..00000000 --- a/src/Models/CreateMobileAuthorizationCodeResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -authorizationCode; - } - - /** - * Sets Authorization Code. - * The generated authorization code that connects a mobile application instance - * to a Square account. - * - * @maps authorization_code - */ - public function setAuthorizationCode(?string $authorizationCode): void - { - $this->authorizationCode = $authorizationCode; - } - - /** - * Returns Expires At. - * The timestamp when `authorization_code` expires, in - * [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getExpiresAt(): ?string - { - return $this->expiresAt; - } - - /** - * Sets Expires At. - * The timestamp when `authorization_code` expires, in - * [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt = $expiresAt; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->authorizationCode)) { - $json['authorization_code'] = $this->authorizationCode; - } - if (isset($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateOrderCustomAttributeDefinitionRequest.php b/src/Models/CreateOrderCustomAttributeDefinitionRequest.php deleted file mode 100644 index 84945466..00000000 --- a/src/Models/CreateOrderCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateOrderCustomAttributeDefinitionResponse.php b/src/Models/CreateOrderCustomAttributeDefinitionResponse.php deleted file mode 100644 index 5c120713..00000000 --- a/src/Models/CreateOrderCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateOrderRequest.php b/src/Models/CreateOrderRequest.php deleted file mode 100644 index aa0eca74..00000000 --- a/src/Models/CreateOrderRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this - * order among orders you have created. - * - * If you are unsure whether a particular order was created successfully, - * you can try it again with the same idempotency key without - * worrying about creating duplicate orders. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this - * order among orders you have created. - * - * If you are unsure whether a particular order was created successfully, - * you can try it again with the same idempotency key without - * worrying about creating duplicate orders. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateOrderResponse.php b/src/Models/CreateOrderResponse.php deleted file mode 100644 index e7d0ba2e..00000000 --- a/src/Models/CreateOrderResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreatePaymentLinkRequest.php b/src/Models/CreatePaymentLinkRequest.php deleted file mode 100644 index f3fcebea..00000000 --- a/src/Models/CreatePaymentLinkRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreatePaymentLinkRequest` request. - * If you do not provide a unique string (or provide an empty string as the value), - * the endpoint treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Description. - * A description of the payment link. You provide this optional description that is useful in your - * application context. It is not used anywhere. - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * Sets Description. - * A description of the payment link. You provide this optional description that is useful in your - * application context. It is not used anywhere. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description = $description; - } - - /** - * Returns Quick Pay. - * Describes an ad hoc item and price to generate a quick pay checkout link. - * For more information, - * see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). - */ - public function getQuickPay(): ?QuickPay - { - return $this->quickPay; - } - - /** - * Sets Quick Pay. - * Describes an ad hoc item and price to generate a quick pay checkout link. - * For more information, - * see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). - * - * @maps quick_pay - */ - public function setQuickPay(?QuickPay $quickPay): void - { - $this->quickPay = $quickPay; - } - - /** - * Returns Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - */ - public function getOrder(): ?Order - { - return $this->order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Checkout Options. - */ - public function getCheckoutOptions(): ?CheckoutOptions - { - return $this->checkoutOptions; - } - - /** - * Sets Checkout Options. - * - * @maps checkout_options - */ - public function setCheckoutOptions(?CheckoutOptions $checkoutOptions): void - { - $this->checkoutOptions = $checkoutOptions; - } - - /** - * Returns Pre Populated Data. - * Describes buyer data to prepopulate in the payment form. - * For more information, - * see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional- - * checkout-configurations). - */ - public function getPrePopulatedData(): ?PrePopulatedData - { - return $this->prePopulatedData; - } - - /** - * Sets Pre Populated Data. - * Describes buyer data to prepopulate in the payment form. - * For more information, - * see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional- - * checkout-configurations). - * - * @maps pre_populated_data - */ - public function setPrePopulatedData(?PrePopulatedData $prePopulatedData): void - { - $this->prePopulatedData = $prePopulatedData; - } - - /** - * Returns Payment Note. - * A note for the payment. After processing the payment, Square adds this note to the resulting - * `Payment`. - */ - public function getPaymentNote(): ?string - { - return $this->paymentNote; - } - - /** - * Sets Payment Note. - * A note for the payment. After processing the payment, Square adds this note to the resulting - * `Payment`. - * - * @maps payment_note - */ - public function setPaymentNote(?string $paymentNote): void - { - $this->paymentNote = $paymentNote; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - if (isset($this->description)) { - $json['description'] = $this->description; - } - if (isset($this->quickPay)) { - $json['quick_pay'] = $this->quickPay; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->checkoutOptions)) { - $json['checkout_options'] = $this->checkoutOptions; - } - if (isset($this->prePopulatedData)) { - $json['pre_populated_data'] = $this->prePopulatedData; - } - if (isset($this->paymentNote)) { - $json['payment_note'] = $this->paymentNote; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreatePaymentLinkResponse.php b/src/Models/CreatePaymentLinkResponse.php deleted file mode 100644 index 2a4423b5..00000000 --- a/src/Models/CreatePaymentLinkResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment Link. - */ - public function getPaymentLink(): ?PaymentLink - { - return $this->paymentLink; - } - - /** - * Sets Payment Link. - * - * @maps payment_link - */ - public function setPaymentLink(?PaymentLink $paymentLink): void - { - $this->paymentLink = $paymentLink; - } - - /** - * Returns Related Resources. - */ - public function getRelatedResources(): ?PaymentLinkRelatedResources - { - return $this->relatedResources; - } - - /** - * Sets Related Resources. - * - * @maps related_resources - */ - public function setRelatedResources(?PaymentLinkRelatedResources $relatedResources): void - { - $this->relatedResources = $relatedResources; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->paymentLink)) { - $json['payment_link'] = $this->paymentLink; - } - if (isset($this->relatedResources)) { - $json['related_resources'] = $this->relatedResources; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreatePaymentRequest.php b/src/Models/CreatePaymentRequest.php deleted file mode 100644 index d45f663d..00000000 --- a/src/Models/CreatePaymentRequest.php +++ /dev/null @@ -1,943 +0,0 @@ -sourceId = $sourceId; - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Source Id. - * The ID for the source of funds for this payment. - * This could be a payment token generated by the Web Payments SDK for any of its - * [supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment- - * methods), - * including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment - * that the seller received outside of Square, specify either "CASH" or "EXTERNAL". - * For more information, see - * [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - */ - public function getSourceId(): string - { - return $this->sourceId; - } - - /** - * Sets Source Id. - * The ID for the source of funds for this payment. - * This could be a payment token generated by the Web Payments SDK for any of its - * [supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment- - * methods), - * including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment - * that the seller received outside of Square, specify either "CASH" or "EXTERNAL". - * For more information, see - * [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - * - * @required - * @maps source_id - */ - public function setSourceId(string $sourceId): void - { - $this->sourceId = $sourceId; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreatePayment` request. Keys can be any valid string - * but must be unique for every `CreatePayment` request. - * - * Note: The number of allowed characters might be less than the stated maximum, if multi-byte - * characters are used. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreatePayment` request. Keys can be any valid string - * but must be unique for every `CreatePayment` request. - * - * Note: The number of allowed characters might be less than the stated maximum, if multi-byte - * characters are used. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTipMoney(): ?Money - { - return $this->tipMoney; - } - - /** - * Sets Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tip_money - */ - public function setTipMoney(?Money $tipMoney): void - { - $this->tipMoney = $tipMoney; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Delay Duration. - * The duration of time after the payment's creation when Square automatically - * either completes or cancels the payment depending on the `delay_action` field value. - * For more information, see - * [Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/delayed-capture#time-threshold). - * - * This parameter should be specified as a time duration, in RFC 3339 format. - * - * Note: This feature is only supported for card payments. This parameter can only be set for a - * delayed - * capture payment (`autocomplete=false`). - * - * Default: - * - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - */ - public function getDelayDuration(): ?string - { - return $this->delayDuration; - } - - /** - * Sets Delay Duration. - * The duration of time after the payment's creation when Square automatically - * either completes or cancels the payment depending on the `delay_action` field value. - * For more information, see - * [Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/delayed-capture#time-threshold). - * - * This parameter should be specified as a time duration, in RFC 3339 format. - * - * Note: This feature is only supported for card payments. This parameter can only be set for a - * delayed - * capture payment (`autocomplete=false`). - * - * Default: - * - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - * - * @maps delay_duration - */ - public function setDelayDuration(?string $delayDuration): void - { - $this->delayDuration = $delayDuration; - } - - /** - * Returns Delay Action. - * The action to be applied to the payment when the `delay_duration` has elapsed. The action must be - * CANCEL or COMPLETE. For more information, see - * [Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/delayed-capture#time-threshold). - * - * Default: CANCEL - */ - public function getDelayAction(): ?string - { - return $this->delayAction; - } - - /** - * Sets Delay Action. - * The action to be applied to the payment when the `delay_duration` has elapsed. The action must be - * CANCEL or COMPLETE. For more information, see - * [Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/delayed-capture#time-threshold). - * - * Default: CANCEL - * - * @maps delay_action - */ - public function setDelayAction(?string $delayAction): void - { - $this->delayAction = $delayAction; - } - - /** - * Returns Autocomplete. - * If set to `true`, this payment will be completed when possible. If - * set to `false`, this payment is held in an approved state until either - * explicitly completed (captured) or canceled (voided). For more information, see - * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments#delayed-capture-of-a-card-payment). - * - * Default: true - */ - public function getAutocomplete(): ?bool - { - return $this->autocomplete; - } - - /** - * Sets Autocomplete. - * If set to `true`, this payment will be completed when possible. If - * set to `false`, this payment is held in an approved state until either - * explicitly completed (captured) or canceled (voided). For more information, see - * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments#delayed-capture-of-a-card-payment). - * - * Default: true - * - * @maps autocomplete - */ - public function setAutocomplete(?bool $autocomplete): void - { - $this->autocomplete = $autocomplete; - } - - /** - * Returns Order Id. - * Associates a previously created order with this payment. - */ - public function getOrderId(): ?string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * Associates a previously created order with this payment. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Returns Customer Id. - * The [Customer](entity:Customer) ID of the customer associated with the payment. - * - * This is required if the `source_id` refers to a card on file created using the Cards API. - */ - public function getCustomerId(): ?string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The [Customer](entity:Customer) ID of the customer associated with the payment. - * - * This is required if the `source_id` refers to a card on file created using the Cards API. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Location Id. - * The location ID to associate with the payment. If not specified, the [main location](https: - * //developer.squareup.com/docs/locations-api#about-the-main-location) is - * used. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location ID to associate with the payment. If not specified, the [main location](https: - * //developer.squareup.com/docs/locations-api#about-the-main-location) is - * used. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Team Member Id. - * An optional [TeamMember](entity:TeamMember) ID to associate with - * this payment. - */ - public function getTeamMemberId(): ?string - { - return $this->teamMemberId; - } - - /** - * Sets Team Member Id. - * An optional [TeamMember](entity:TeamMember) ID to associate with - * this payment. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Returns Reference Id. - * A user-defined ID to associate with the payment. - * - * You can use this field to associate the payment to an entity in an external system - * (for example, you might specify an order ID that is generated by a third-party shopping cart). - */ - public function getReferenceId(): ?string - { - return $this->referenceId; - } - - /** - * Sets Reference Id. - * A user-defined ID to associate with the payment. - * - * You can use this field to associate the payment to an entity in an external system - * (for example, you might specify an order ID that is generated by a third-party shopping cart). - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId = $referenceId; - } - - /** - * Returns Verification Token. - * An identifying token generated by [payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - * - * For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview). - */ - public function getVerificationToken(): ?string - { - return $this->verificationToken; - } - - /** - * Sets Verification Token. - * An identifying token generated by [payments.verifyBuyer()](https://developer.squareup. - * com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). - * Verification tokens encapsulate customer device information and 3-D Secure - * challenge results to indicate that Square has verified the buyer identity. - * - * For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview). - * - * @maps verification_token - */ - public function setVerificationToken(?string $verificationToken): void - { - $this->verificationToken = $verificationToken; - } - - /** - * Returns Accept Partial Authorization. - * If set to `true` and charging a Square Gift Card, a payment might be returned with - * `amount_money` equal to less than what was requested. For example, a request for $20 when charging - * a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose - * to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card - * payment. This field cannot be `true` when `autocomplete = true`. - * - * For more information, see - * [Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take- - * payments#partial-payment-gift-card). - * - * Default: false - */ - public function getAcceptPartialAuthorization(): ?bool - { - return $this->acceptPartialAuthorization; - } - - /** - * Sets Accept Partial Authorization. - * If set to `true` and charging a Square Gift Card, a payment might be returned with - * `amount_money` equal to less than what was requested. For example, a request for $20 when charging - * a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose - * to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card - * payment. This field cannot be `true` when `autocomplete = true`. - * - * For more information, see - * [Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take- - * payments#partial-payment-gift-card). - * - * Default: false - * - * @maps accept_partial_authorization - */ - public function setAcceptPartialAuthorization(?bool $acceptPartialAuthorization): void - { - $this->acceptPartialAuthorization = $acceptPartialAuthorization; - } - - /** - * Returns Buyer Email Address. - * The buyer's email address. - */ - public function getBuyerEmailAddress(): ?string - { - return $this->buyerEmailAddress; - } - - /** - * Sets Buyer Email Address. - * The buyer's email address. - * - * @maps buyer_email_address - */ - public function setBuyerEmailAddress(?string $buyerEmailAddress): void - { - $this->buyerEmailAddress = $buyerEmailAddress; - } - - /** - * Returns Buyer Phone Number. - * The buyer's phone number. - * Must follow the following format: - * 1. A leading + symbol (followed by a country code) - * 2. The phone number can contain spaces and the special characters `(` , `)` , `-` , and `.`. - * Alphabetical characters aren't allowed. - * 3. The phone number must contain between 9 and 16 digits. - */ - public function getBuyerPhoneNumber(): ?string - { - return $this->buyerPhoneNumber; - } - - /** - * Sets Buyer Phone Number. - * The buyer's phone number. - * Must follow the following format: - * 1. A leading + symbol (followed by a country code) - * 2. The phone number can contain spaces and the special characters `(` , `)` , `-` , and `.`. - * Alphabetical characters aren't allowed. - * 3. The phone number must contain between 9 and 16 digits. - * - * @maps buyer_phone_number - */ - public function setBuyerPhoneNumber(?string $buyerPhoneNumber): void - { - $this->buyerPhoneNumber = $buyerPhoneNumber; - } - - /** - * Returns Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBillingAddress(): ?Address - { - return $this->billingAddress; - } - - /** - * Sets Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps billing_address - */ - public function setBillingAddress(?Address $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * Returns Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getShippingAddress(): ?Address - { - return $this->shippingAddress; - } - - /** - * Sets Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps shipping_address - */ - public function setShippingAddress(?Address $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * Returns Note. - * An optional note to be entered by the developer when creating a payment. - */ - public function getNote(): ?string - { - return $this->note; - } - - /** - * Sets Note. - * An optional note to be entered by the developer when creating a payment. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note = $note; - } - - /** - * Returns Statement Description Identifier. - * Optional additional payment information to include on the customer's card statement - * as part of the statement description. This can be, for example, an invoice number, ticket number, - * or short description that uniquely identifies the purchase. - * - * Note that the `statement_description_identifier` might get truncated on the statement description - * to fit the required information including the Square identifier (SQ *) and name of the - * seller taking the payment. - */ - public function getStatementDescriptionIdentifier(): ?string - { - return $this->statementDescriptionIdentifier; - } - - /** - * Sets Statement Description Identifier. - * Optional additional payment information to include on the customer's card statement - * as part of the statement description. This can be, for example, an invoice number, ticket number, - * or short description that uniquely identifies the purchase. - * - * Note that the `statement_description_identifier` might get truncated on the statement description - * to fit the required information including the Square identifier (SQ *) and name of the - * seller taking the payment. - * - * @maps statement_description_identifier - */ - public function setStatementDescriptionIdentifier(?string $statementDescriptionIdentifier): void - { - $this->statementDescriptionIdentifier = $statementDescriptionIdentifier; - } - - /** - * Returns Cash Details. - * Stores details about a cash payment. Contains only non-confidential information. For more - * information, see - * [Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). - */ - public function getCashDetails(): ?CashPaymentDetails - { - return $this->cashDetails; - } - - /** - * Sets Cash Details. - * Stores details about a cash payment. Contains only non-confidential information. For more - * information, see - * [Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). - * - * @maps cash_details - */ - public function setCashDetails(?CashPaymentDetails $cashDetails): void - { - $this->cashDetails = $cashDetails; - } - - /** - * Returns External Details. - * Stores details about an external payment. Contains only non-confidential information. - * For more information, see - * [Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external- - * payments). - */ - public function getExternalDetails(): ?ExternalPaymentDetails - { - return $this->externalDetails; - } - - /** - * Sets External Details. - * Stores details about an external payment. Contains only non-confidential information. - * For more information, see - * [Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external- - * payments). - * - * @maps external_details - */ - public function setExternalDetails(?ExternalPaymentDetails $externalDetails): void - { - $this->externalDetails = $externalDetails; - } - - /** - * Returns Customer Details. - * Details about the customer making the payment. - */ - public function getCustomerDetails(): ?CustomerDetails - { - return $this->customerDetails; - } - - /** - * Sets Customer Details. - * Details about the customer making the payment. - * - * @maps customer_details - */ - public function setCustomerDetails(?CustomerDetails $customerDetails): void - { - $this->customerDetails = $customerDetails; - } - - /** - * Returns Offline Payment Details. - * Details specific to offline payments. - */ - public function getOfflinePaymentDetails(): ?OfflinePaymentDetails - { - return $this->offlinePaymentDetails; - } - - /** - * Sets Offline Payment Details. - * Details specific to offline payments. - * - * @maps offline_payment_details - */ - public function setOfflinePaymentDetails(?OfflinePaymentDetails $offlinePaymentDetails): void - { - $this->offlinePaymentDetails = $offlinePaymentDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['source_id'] = $this->sourceId; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->tipMoney)) { - $json['tip_money'] = $this->tipMoney; - } - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (isset($this->delayDuration)) { - $json['delay_duration'] = $this->delayDuration; - } - if (isset($this->delayAction)) { - $json['delay_action'] = $this->delayAction; - } - if (isset($this->autocomplete)) { - $json['autocomplete'] = $this->autocomplete; - } - if (isset($this->orderId)) { - $json['order_id'] = $this->orderId; - } - if (isset($this->customerId)) { - $json['customer_id'] = $this->customerId; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId; - } - if (isset($this->referenceId)) { - $json['reference_id'] = $this->referenceId; - } - if (isset($this->verificationToken)) { - $json['verification_token'] = $this->verificationToken; - } - if (isset($this->acceptPartialAuthorization)) { - $json['accept_partial_authorization'] = $this->acceptPartialAuthorization; - } - if (isset($this->buyerEmailAddress)) { - $json['buyer_email_address'] = $this->buyerEmailAddress; - } - if (isset($this->buyerPhoneNumber)) { - $json['buyer_phone_number'] = $this->buyerPhoneNumber; - } - if (isset($this->billingAddress)) { - $json['billing_address'] = $this->billingAddress; - } - if (isset($this->shippingAddress)) { - $json['shipping_address'] = $this->shippingAddress; - } - if (isset($this->note)) { - $json['note'] = $this->note; - } - if (isset($this->statementDescriptionIdentifier)) { - $json['statement_description_identifier'] = $this->statementDescriptionIdentifier; - } - if (isset($this->cashDetails)) { - $json['cash_details'] = $this->cashDetails; - } - if (isset($this->externalDetails)) { - $json['external_details'] = $this->externalDetails; - } - if (isset($this->customerDetails)) { - $json['customer_details'] = $this->customerDetails; - } - if (isset($this->offlinePaymentDetails)) { - $json['offline_payment_details'] = $this->offlinePaymentDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreatePaymentResponse.php b/src/Models/CreatePaymentResponse.php deleted file mode 100644 index c73395fc..00000000 --- a/src/Models/CreatePaymentResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateRefundRequest.php b/src/Models/CreateRefundRequest.php deleted file mode 100644 index cd295e2a..00000000 --- a/src/Models/CreateRefundRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->tenderId = $tenderId; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this - * refund among refunds you've created for the tender. - * - * If you're unsure whether a particular refund succeeded, - * you can reattempt it with the same idempotency key without - * worrying about duplicating the refund. - * - * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more - * information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this - * refund among refunds you've created for the tender. - * - * If you're unsure whether a particular refund succeeded, - * you can reattempt it with the same idempotency key without - * worrying about duplicating the refund. - * - * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more - * information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Tender Id. - * The ID of the tender to refund. - * - * A [`Transaction`](entity:Transaction) has one or more `tenders` (i.e., methods - * of payment) associated with it, and you refund each tender separately with - * the Connect API. - */ - public function getTenderId(): string - { - return $this->tenderId; - } - - /** - * Sets Tender Id. - * The ID of the tender to refund. - * - * A [`Transaction`](entity:Transaction) has one or more `tenders` (i.e., methods - * of payment) associated with it, and you refund each tender separately with - * the Connect API. - * - * @required - * @maps tender_id - */ - public function setTenderId(string $tenderId): void - { - $this->tenderId = $tenderId; - } - - /** - * Returns Reason. - * A description of the reason for the refund. - * - * Default value: `Refund via API` - */ - public function getReason(): ?string - { - return $this->reason; - } - - /** - * Sets Reason. - * A description of the reason for the refund. - * - * Default value: `Refund via API` - * - * @maps reason - */ - public function setReason(?string $reason): void - { - $this->reason = $reason; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['tender_id'] = $this->tenderId; - if (isset($this->reason)) { - $json['reason'] = $this->reason; - } - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateRefundResponse.php b/src/Models/CreateRefundResponse.php deleted file mode 100644 index 253ae0ce..00000000 --- a/src/Models/CreateRefundResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a refund processed for a Square transaction. - */ - public function getRefund(): ?Refund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a refund processed for a Square transaction. - * - * @maps refund - */ - public function setRefund(?Refund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateShiftRequest.php b/src/Models/CreateShiftRequest.php deleted file mode 100644 index f982b9b4..00000000 --- a/src/Models/CreateShiftRequest.php +++ /dev/null @@ -1,99 +0,0 @@ -shift = $shift; - } - - /** - * Returns Idempotency Key. - * A unique string value to ensure the idempotency of the operation. - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string value to ensure the idempotency of the operation. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - */ - public function getShift(): Shift - { - return $this->shift; - } - - /** - * Sets Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - * - * @required - * @maps shift - */ - public function setShift(Shift $shift): void - { - $this->shift = $shift; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['shift'] = $this->shift; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateShiftResponse.php b/src/Models/CreateShiftResponse.php deleted file mode 100644 index fab210b3..00000000 --- a/src/Models/CreateShiftResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -shift; - } - - /** - * Sets Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - * - * @maps shift - */ - public function setShift(?Shift $shift): void - { - $this->shift = $shift; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->shift)) { - $json['shift'] = $this->shift; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateSubscriptionRequest.php b/src/Models/CreateSubscriptionRequest.php deleted file mode 100644 index b4a6f425..00000000 --- a/src/Models/CreateSubscriptionRequest.php +++ /dev/null @@ -1,479 +0,0 @@ -locationId = $locationId; - $this->customerId = $customerId; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateSubscription` request. - * If you do not provide a unique string (or provide an empty string as the value), - * the endpoint treats each request as independent. - * - * For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common- - * api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateSubscription` request. - * If you do not provide a unique string (or provide an empty string as the value), - * the endpoint treats each request as independent. - * - * For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common- - * api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Location Id. - * The ID of the location the subscription is associated with. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location the subscription is associated with. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Plan Variation Id. - * The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions- - * api/plans-and-variations#plan-variations) created using the Catalog API. - */ - public function getPlanVariationId(): ?string - { - return $this->planVariationId; - } - - /** - * Sets Plan Variation Id. - * The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions- - * api/plans-and-variations#plan-variations) created using the Catalog API. - * - * @maps plan_variation_id - */ - public function setPlanVariationId(?string $planVariationId): void - { - $this->planVariationId = $planVariationId; - } - - /** - * Returns Customer Id. - * The ID of the [customer](entity:Customer) subscribing to the subscription plan variation. - */ - public function getCustomerId(): string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the [customer](entity:Customer) subscribing to the subscription plan variation. - * - * @required - * @maps customer_id - */ - public function setCustomerId(string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Start Date. - * The `YYYY-MM-DD`-formatted date to start the subscription. - * If it is unspecified, the subscription starts immediately. - */ - public function getStartDate(): ?string - { - return $this->startDate; - } - - /** - * Sets Start Date. - * The `YYYY-MM-DD`-formatted date to start the subscription. - * If it is unspecified, the subscription starts immediately. - * - * @maps start_date - */ - public function setStartDate(?string $startDate): void - { - $this->startDate = $startDate; - } - - /** - * Returns Canceled Date. - * The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. - * - * This date overrides the cancellation date set in the plan variation configuration. - * If the cancellation date is earlier than the end date of a subscription cycle, the subscription - * stops - * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled - * cycle. - * - * When the subscription plan of the newly created subscription has a fixed number of cycles and the - * `canceled_date` - * occurs before the subscription plan expires, the specified `canceled_date` sets the date when the - * subscription - * stops through the end of the last cycle. - */ - public function getCanceledDate(): ?string - { - return $this->canceledDate; - } - - /** - * Sets Canceled Date. - * The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. - * - * This date overrides the cancellation date set in the plan variation configuration. - * If the cancellation date is earlier than the end date of a subscription cycle, the subscription - * stops - * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled - * cycle. - * - * When the subscription plan of the newly created subscription has a fixed number of cycles and the - * `canceled_date` - * occurs before the subscription plan expires, the specified `canceled_date` sets the date when the - * subscription - * stops through the end of the last cycle. - * - * @maps canceled_date - */ - public function setCanceledDate(?string $canceledDate): void - { - $this->canceledDate = $canceledDate; - } - - /** - * Returns Tax Percentage. - * The tax to add when billing the subscription. - * The percentage is expressed in decimal form, using a `'.'` as the decimal - * separator and without a `'%'` sign. For example, a value of 7.5 - * corresponds to 7.5%. - */ - public function getTaxPercentage(): ?string - { - return $this->taxPercentage; - } - - /** - * Sets Tax Percentage. - * The tax to add when billing the subscription. - * The percentage is expressed in decimal form, using a `'.'` as the decimal - * separator and without a `'%'` sign. For example, a value of 7.5 - * corresponds to 7.5%. - * - * @maps tax_percentage - */ - public function setTaxPercentage(?string $taxPercentage): void - { - $this->taxPercentage = $taxPercentage; - } - - /** - * Returns Price Override Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceOverrideMoney(): ?Money - { - return $this->priceOverrideMoney; - } - - /** - * Sets Price Override Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_override_money - */ - public function setPriceOverrideMoney(?Money $priceOverrideMoney): void - { - $this->priceOverrideMoney = $priceOverrideMoney; - } - - /** - * Returns Card Id. - * The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge. - * If it is not specified, the subscriber receives an invoice via email with a link to pay for their - * subscription. - */ - public function getCardId(): ?string - { - return $this->cardId; - } - - /** - * Sets Card Id. - * The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge. - * If it is not specified, the subscriber receives an invoice via email with a link to pay for their - * subscription. - * - * @maps card_id - */ - public function setCardId(?string $cardId): void - { - $this->cardId = $cardId; - } - - /** - * Returns Timezone. - * The timezone that is used in date calculations for the subscription. If unset, defaults to - * the location timezone. If a timezone is not configured for the location, defaults to - * "America/New_York". - * Format: the IANA Timezone Database identifier for the location timezone. For - * a list of time zones, see [List of tz database time zones](https://en.wikipedia. - * org/wiki/List_of_tz_database_time_zones). - */ - public function getTimezone(): ?string - { - return $this->timezone; - } - - /** - * Sets Timezone. - * The timezone that is used in date calculations for the subscription. If unset, defaults to - * the location timezone. If a timezone is not configured for the location, defaults to - * "America/New_York". - * Format: the IANA Timezone Database identifier for the location timezone. For - * a list of time zones, see [List of tz database time zones](https://en.wikipedia. - * org/wiki/List_of_tz_database_time_zones). - * - * @maps timezone - */ - public function setTimezone(?string $timezone): void - { - $this->timezone = $timezone; - } - - /** - * Returns Source. - * The origination details of the subscription. - */ - public function getSource(): ?SubscriptionSource - { - return $this->source; - } - - /** - * Sets Source. - * The origination details of the subscription. - * - * @maps source - */ - public function setSource(?SubscriptionSource $source): void - { - $this->source = $source; - } - - /** - * Returns Monthly Billing Anchor Date. - * The day-of-the-month to change the billing date to. - */ - public function getMonthlyBillingAnchorDate(): ?int - { - return $this->monthlyBillingAnchorDate; - } - - /** - * Sets Monthly Billing Anchor Date. - * The day-of-the-month to change the billing date to. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate = $monthlyBillingAnchorDate; - } - - /** - * Returns Phases. - * array of phases for this subscription - * - * @return Phase[]|null - */ - public function getPhases(): ?array - { - return $this->phases; - } - - /** - * Sets Phases. - * array of phases for this subscription - * - * @maps phases - * - * @param Phase[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases = $phases; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['location_id'] = $this->locationId; - if (isset($this->planVariationId)) { - $json['plan_variation_id'] = $this->planVariationId; - } - $json['customer_id'] = $this->customerId; - if (isset($this->startDate)) { - $json['start_date'] = $this->startDate; - } - if (isset($this->canceledDate)) { - $json['canceled_date'] = $this->canceledDate; - } - if (isset($this->taxPercentage)) { - $json['tax_percentage'] = $this->taxPercentage; - } - if (isset($this->priceOverrideMoney)) { - $json['price_override_money'] = $this->priceOverrideMoney; - } - if (isset($this->cardId)) { - $json['card_id'] = $this->cardId; - } - if (isset($this->timezone)) { - $json['timezone'] = $this->timezone; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (isset($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate; - } - if (isset($this->phases)) { - $json['phases'] = $this->phases; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateSubscriptionResponse.php b/src/Models/CreateSubscriptionResponse.php deleted file mode 100644 index 61195a14..00000000 --- a/src/Models/CreateSubscriptionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTeamMemberRequest.php b/src/Models/CreateTeamMemberRequest.php deleted file mode 100644 index 26c74ced..00000000 --- a/src/Models/CreateTeamMemberRequest.php +++ /dev/null @@ -1,98 +0,0 @@ -idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateTeamMember` request. - * Keys can be any valid string, but must be unique for every request. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * The minimum length is 1 and the maximum length is 45. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Team Member. - * A record representing an individual team member for a business. - */ - public function getTeamMember(): ?TeamMember - { - return $this->teamMember; - } - - /** - * Sets Team Member. - * A record representing an individual team member for a business. - * - * @maps team_member - */ - public function setTeamMember(?TeamMember $teamMember): void - { - $this->teamMember = $teamMember; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - if (isset($this->teamMember)) { - $json['team_member'] = $this->teamMember; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTeamMemberResponse.php b/src/Models/CreateTeamMemberResponse.php deleted file mode 100644 index ab997de4..00000000 --- a/src/Models/CreateTeamMemberResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -teamMember; - } - - /** - * Sets Team Member. - * A record representing an individual team member for a business. - * - * @maps team_member - */ - public function setTeamMember(?TeamMember $teamMember): void - { - $this->teamMember = $teamMember; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMember)) { - $json['team_member'] = $this->teamMember; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalActionRequest.php b/src/Models/CreateTerminalActionRequest.php deleted file mode 100644 index bf72ce0a..00000000 --- a/src/Models/CreateTerminalActionRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->action = $action; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateAction` request. Keys can be any valid string - * but must be unique for every `CreateAction` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more - * information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateAction` request. Keys can be any valid string - * but must be unique for every `CreateAction` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more - * information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Action. - * Represents an action processed by the Square Terminal. - */ - public function getAction(): TerminalAction - { - return $this->action; - } - - /** - * Sets Action. - * Represents an action processed by the Square Terminal. - * - * @required - * @maps action - */ - public function setAction(TerminalAction $action): void - { - $this->action = $action; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['action'] = $this->action; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalActionResponse.php b/src/Models/CreateTerminalActionResponse.php deleted file mode 100644 index 4da9094a..00000000 --- a/src/Models/CreateTerminalActionResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Action. - * Represents an action processed by the Square Terminal. - */ - public function getAction(): ?TerminalAction - { - return $this->action; - } - - /** - * Sets Action. - * Represents an action processed by the Square Terminal. - * - * @maps action - */ - public function setAction(?TerminalAction $action): void - { - $this->action = $action; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->action)) { - $json['action'] = $this->action; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalCheckoutRequest.php b/src/Models/CreateTerminalCheckoutRequest.php deleted file mode 100644 index ea338005..00000000 --- a/src/Models/CreateTerminalCheckoutRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->checkout = $checkout; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateCheckout` request. Keys can be any valid string but - * must be unique for every `CreateCheckout` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateCheckout` request. Keys can be any valid string but - * must be unique for every `CreateCheckout` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Checkout. - * Represents a checkout processed by the Square Terminal. - */ - public function getCheckout(): TerminalCheckout - { - return $this->checkout; - } - - /** - * Sets Checkout. - * Represents a checkout processed by the Square Terminal. - * - * @required - * @maps checkout - */ - public function setCheckout(TerminalCheckout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['checkout'] = $this->checkout; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalCheckoutResponse.php b/src/Models/CreateTerminalCheckoutResponse.php deleted file mode 100644 index 39145ca9..00000000 --- a/src/Models/CreateTerminalCheckoutResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Checkout. - * Represents a checkout processed by the Square Terminal. - */ - public function getCheckout(): ?TerminalCheckout - { - return $this->checkout; - } - - /** - * Sets Checkout. - * Represents a checkout processed by the Square Terminal. - * - * @maps checkout - */ - public function setCheckout(?TerminalCheckout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->checkout)) { - $json['checkout'] = $this->checkout; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalRefundRequest.php b/src/Models/CreateTerminalRefundRequest.php deleted file mode 100644 index f7ce98d8..00000000 --- a/src/Models/CreateTerminalRefundRequest.php +++ /dev/null @@ -1,102 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `CreateRefund` request. Keys can be any valid string but - * must be unique for every `CreateRefund` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `CreateRefund` request. Keys can be any valid string but - * must be unique for every `CreateRefund` request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - */ - public function getRefund(): ?TerminalRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - * - * @maps refund - */ - public function setRefund(?TerminalRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateTerminalRefundResponse.php b/src/Models/CreateTerminalRefundResponse.php deleted file mode 100644 index 2c7c89ba..00000000 --- a/src/Models/CreateTerminalRefundResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - */ - public function getRefund(): ?TerminalRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - * - * @maps refund - */ - public function setRefund(?TerminalRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateVendorRequest.php b/src/Models/CreateVendorRequest.php deleted file mode 100644 index a0806993..00000000 --- a/src/Models/CreateVendorRequest.php +++ /dev/null @@ -1,107 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint: - * Vendors-CreateVendor) call idempotent. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint: - * Vendors-CreateVendor) call idempotent. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Vendor. - * Represents a supplier to a seller. - */ - public function getVendor(): ?Vendor - { - return $this->vendor; - } - - /** - * Sets Vendor. - * Represents a supplier to a seller. - * - * @maps vendor - */ - public function setVendor(?Vendor $vendor): void - { - $this->vendor = $vendor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->vendor)) { - $json['vendor'] = $this->vendor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateVendorResponse.php b/src/Models/CreateVendorResponse.php deleted file mode 100644 index 5f28cd42..00000000 --- a/src/Models/CreateVendorResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered when the request fails. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Vendor. - * Represents a supplier to a seller. - */ - public function getVendor(): ?Vendor - { - return $this->vendor; - } - - /** - * Sets Vendor. - * Represents a supplier to a seller. - * - * @maps vendor - */ - public function setVendor(?Vendor $vendor): void - { - $this->vendor = $vendor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->vendor)) { - $json['vendor'] = $this->vendor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateWebhookSubscriptionRequest.php b/src/Models/CreateWebhookSubscriptionRequest.php deleted file mode 100644 index a406fa30..00000000 --- a/src/Models/CreateWebhookSubscriptionRequest.php +++ /dev/null @@ -1,99 +0,0 @@ -subscription = $subscription; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions- - * CreateWebhookSubscription) request. - */ - public function getIdempotencyKey(): ?string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions- - * CreateWebhookSubscription) request. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - */ - public function getSubscription(): WebhookSubscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @required - * @maps subscription - */ - public function setSubscription(WebhookSubscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey; - } - $json['subscription'] = $this->subscription; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateWebhookSubscriptionResponse.php b/src/Models/CreateWebhookSubscriptionResponse.php deleted file mode 100644 index b1f179e8..00000000 --- a/src/Models/CreateWebhookSubscriptionResponse.php +++ /dev/null @@ -1,100 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - */ - public function getSubscription(): ?WebhookSubscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @maps subscription - */ - public function setSubscription(?WebhookSubscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Currency.php b/src/Models/Currency.php deleted file mode 100644 index f209df85..00000000 --- a/src/Models/Currency.php +++ /dev/null @@ -1,927 +0,0 @@ -key) == 0) { - return null; - } - return $this->key['value']; - } - - /** - * Sets Key. - * The identifier - * of the custom attribute definition and its corresponding custom attributes. This value - * can be a simple key, which is the key that is provided when the custom attribute definition - * is created, or a qualified key, if the requesting - * application is not the definition owner. The qualified key consists of the application ID - * of the custom attribute definition owner - * followed by the simple key that was provided when the definition was created. It has the - * format application_id:simple key. - * - * The value for a simple key can contain up to 60 alphanumeric characters, periods (.), - * underscores (_), and hyphens (-). - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key['value'] = $key; - } - - /** - * Unsets Key. - * The identifier - * of the custom attribute definition and its corresponding custom attributes. This value - * can be a simple key, which is the key that is provided when the custom attribute definition - * is created, or a qualified key, if the requesting - * application is not the definition owner. The qualified key consists of the application ID - * of the custom attribute definition owner - * followed by the simple key that was provided when the definition was created. It has the - * format application_id:simple key. - * - * The value for a simple key can contain up to 60 alphanumeric characters, periods (.), - * underscores (_), and hyphens (-). - */ - public function unsetKey(): void - { - $this->key = []; - } - - /** - * Returns Value. - * The value assigned to the custom attribute. It is validated against the custom - * attribute definition's schema on write operations. For more information about custom - * attribute values, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - * - * @return mixed - */ - public function getValue() - { - if (count($this->value) == 0) { - return null; - } - return $this->value['value']; - } - - /** - * Sets Value. - * The value assigned to the custom attribute. It is validated against the custom - * attribute definition's schema on write operations. For more information about custom - * attribute values, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - * - * @maps value - * - * @param mixed $value - */ - public function setValue($value): void - { - $this->value['value'] = $value; - } - - /** - * Unsets Value. - * The value assigned to the custom attribute. It is validated against the custom - * attribute definition's schema on write operations. For more information about custom - * attribute values, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - */ - public function unsetValue(): void - { - $this->value = []; - } - - /** - * Returns Version. - * Read only. The current version of the custom attribute. This field is incremented when the custom - * attribute is changed. - * When updating an existing custom attribute value, you can provide this field - * and specify the current version of the custom attribute to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency). - * This field can also be used to enforce strong consistency for reads. For more information about - * strong consistency for reads, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Read only. The current version of the custom attribute. This field is incremented when the custom - * attribute is changed. - * When updating an existing custom attribute value, you can provide this field - * and specify the current version of the custom attribute to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency). - * This field can also be used to enforce strong consistency for reads. For more information about - * strong consistency for reads, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Visibility. - * The level of permission that a seller or other applications requires to - * view this custom attribute definition. - * The `Visibility` field controls who can read and write the custom attribute values - * and custom attribute definition. - */ - public function getVisibility(): ?string - { - return $this->visibility; - } - - /** - * Sets Visibility. - * The level of permission that a seller or other applications requires to - * view this custom attribute definition. - * The `Visibility` field controls who can read and write the custom attribute values - * and custom attribute definition. - * - * @maps visibility - */ - public function setVisibility(?string $visibility): void - { - $this->visibility = $visibility; - } - - /** - * Returns Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getDefinition(): ?CustomAttributeDefinition - { - return $this->definition; - } - - /** - * Sets Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps definition - */ - public function setDefinition(?CustomAttributeDefinition $definition): void - { - $this->definition = $definition; - } - - /** - * Returns Updated At. - * The timestamp that indicates when the custom attribute was created or was most recently - * updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp that indicates when the custom attribute was created or was most recently - * updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Created At. - * The timestamp that indicates when the custom attribute was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp that indicates when the custom attribute was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->key)) { - $json['key'] = $this->key['value']; - } - if (!empty($this->value)) { - $json['value'] = $this->value['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->visibility)) { - $json['visibility'] = $this->visibility; - } - if (isset($this->definition)) { - $json['definition'] = $this->definition; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomAttributeDefinition.php b/src/Models/CustomAttributeDefinition.php deleted file mode 100644 index acedc915..00000000 --- a/src/Models/CustomAttributeDefinition.php +++ /dev/null @@ -1,407 +0,0 @@ -key) == 0) { - return null; - } - return $this->key['value']; - } - - /** - * Sets Key. - * The identifier - * of the custom attribute definition and its corresponding custom attributes. This value - * can be a simple key, which is the key that is provided when the custom attribute definition - * is created, or a qualified key, if the requesting - * application is not the definition owner. The qualified key consists of the application ID - * of the custom attribute definition owner - * followed by the simple key that was provided when the definition was created. It has the - * format application_id:simple key. - * - * The value for a simple key can contain up to 60 alphanumeric characters, periods (.), - * underscores (_), and hyphens (-). - * - * This field can not be changed - * after the custom attribute definition is created. This field is required when creating - * a definition and must be unique per application, seller, and resource type. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key['value'] = $key; - } - - /** - * Unsets Key. - * The identifier - * of the custom attribute definition and its corresponding custom attributes. This value - * can be a simple key, which is the key that is provided when the custom attribute definition - * is created, or a qualified key, if the requesting - * application is not the definition owner. The qualified key consists of the application ID - * of the custom attribute definition owner - * followed by the simple key that was provided when the definition was created. It has the - * format application_id:simple key. - * - * The value for a simple key can contain up to 60 alphanumeric characters, periods (.), - * underscores (_), and hyphens (-). - * - * This field can not be changed - * after the custom attribute definition is created. This field is required when creating - * a definition and must be unique per application, seller, and resource type. - */ - public function unsetKey(): void - { - $this->key = []; - } - - /** - * Returns Schema. - * The JSON schema for the custom attribute definition, which determines the data type of the - * corresponding custom attributes. For more information, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). This field is required when creating a definition. - * - * @return mixed - */ - public function getSchema() - { - if (count($this->schema) == 0) { - return null; - } - return $this->schema['value']; - } - - /** - * Sets Schema. - * The JSON schema for the custom attribute definition, which determines the data type of the - * corresponding custom attributes. For more information, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). This field is required when creating a definition. - * - * @maps schema - * - * @param mixed $schema - */ - public function setSchema($schema): void - { - $this->schema['value'] = $schema; - } - - /** - * Unsets Schema. - * The JSON schema for the custom attribute definition, which determines the data type of the - * corresponding custom attributes. For more information, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). This field is required when creating a definition. - */ - public function unsetSchema(): void - { - $this->schema = []; - } - - /** - * Returns Name. - * The name of the custom attribute definition for API and seller-facing UI purposes. The name must - * be unique within the seller and application pair. This field is required if the - * `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the custom attribute definition for API and seller-facing UI purposes. The name must - * be unique within the seller and application pair. This field is required if the - * `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the custom attribute definition for API and seller-facing UI purposes. The name must - * be unique within the seller and application pair. This field is required if the - * `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Description. - * Seller-oriented description of the custom attribute definition, including any constraints - * that the seller should observe. May be displayed as a tooltip in Square UIs. This field is - * required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * Seller-oriented description of the custom attribute definition, including any constraints - * that the seller should observe. May be displayed as a tooltip in Square UIs. This field is - * required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * Seller-oriented description of the custom attribute definition, including any constraints - * that the seller should observe. May be displayed as a tooltip in Square UIs. This field is - * required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Visibility. - * The level of permission that a seller or other applications requires to - * view this custom attribute definition. - * The `Visibility` field controls who can read and write the custom attribute values - * and custom attribute definition. - */ - public function getVisibility(): ?string - { - return $this->visibility; - } - - /** - * Sets Visibility. - * The level of permission that a seller or other applications requires to - * view this custom attribute definition. - * The `Visibility` field controls who can read and write the custom attribute values - * and custom attribute definition. - * - * @maps visibility - */ - public function setVisibility(?string $visibility): void - { - $this->visibility = $visibility; - } - - /** - * Returns Version. - * Read only. The current version of the custom attribute definition. - * The value is incremented each time the custom attribute definition is updated. - * When updating a custom attribute definition, you can provide this field - * and specify the current version of the custom attribute definition to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency). - * - * On writes, this field must be set to the latest version. Stale writes are rejected. - * - * This field can also be used to enforce strong consistency for reads. For more information about - * strong consistency for reads, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Read only. The current version of the custom attribute definition. - * The value is incremented each time the custom attribute definition is updated. - * When updating a custom attribute definition, you can provide this field - * and specify the current version of the custom attribute definition to enable - * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency). - * - * On writes, this field must be set to the latest version. Stale writes are rejected. - * - * This field can also be used to enforce strong consistency for reads. For more information about - * strong consistency for reads, - * see [Custom Attributes Overview](https://developer.squareup. - * com/docs/devtools/customattributes/overview). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Updated At. - * The timestamp that indicates when the custom attribute definition was created or most recently - * updated, - * in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp that indicates when the custom attribute definition was created or most recently - * updated, - * in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Created At. - * The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->key)) { - $json['key'] = $this->key['value']; - } - if (!empty($this->schema)) { - $json['schema'] = ApiHelper::decodeJson($this->schema['value'], 'schema'); - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->visibility)) { - $json['visibility'] = $this->visibility; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomAttributeDefinitionVisibility.php b/src/Models/CustomAttributeDefinitionVisibility.php deleted file mode 100644 index af34bee6..00000000 --- a/src/Models/CustomAttributeDefinitionVisibility.php +++ /dev/null @@ -1,33 +0,0 @@ -customAttributeDefinitionId) == 0) { - return null; - } - return $this->customAttributeDefinitionId['value']; - } - - /** - * Sets Custom Attribute Definition Id. - * A query expression to filter items or item variations by matching their custom attributes' - * `custom_attribute_definition_id` property value against the the specified id. - * Exactly one of `custom_attribute_definition_id` or `key` must be specified. - * - * @maps custom_attribute_definition_id - */ - public function setCustomAttributeDefinitionId(?string $customAttributeDefinitionId): void - { - $this->customAttributeDefinitionId['value'] = $customAttributeDefinitionId; - } - - /** - * Unsets Custom Attribute Definition Id. - * A query expression to filter items or item variations by matching their custom attributes' - * `custom_attribute_definition_id` property value against the the specified id. - * Exactly one of `custom_attribute_definition_id` or `key` must be specified. - */ - public function unsetCustomAttributeDefinitionId(): void - { - $this->customAttributeDefinitionId = []; - } - - /** - * Returns Key. - * A query expression to filter items or item variations by matching their custom attributes' - * `key` property value against the specified key. - * Exactly one of `custom_attribute_definition_id` or `key` must be specified. - */ - public function getKey(): ?string - { - if (count($this->key) == 0) { - return null; - } - return $this->key['value']; - } - - /** - * Sets Key. - * A query expression to filter items or item variations by matching their custom attributes' - * `key` property value against the specified key. - * Exactly one of `custom_attribute_definition_id` or `key` must be specified. - * - * @maps key - */ - public function setKey(?string $key): void - { - $this->key['value'] = $key; - } - - /** - * Unsets Key. - * A query expression to filter items or item variations by matching their custom attributes' - * `key` property value against the specified key. - * Exactly one of `custom_attribute_definition_id` or `key` must be specified. - */ - public function unsetKey(): void - { - $this->key = []; - } - - /** - * Returns String Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `string_value` property value against the specified text. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - */ - public function getStringFilter(): ?string - { - if (count($this->stringFilter) == 0) { - return null; - } - return $this->stringFilter['value']; - } - - /** - * Sets String Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `string_value` property value against the specified text. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - * - * @maps string_filter - */ - public function setStringFilter(?string $stringFilter): void - { - $this->stringFilter['value'] = $stringFilter; - } - - /** - * Unsets String Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `string_value` property value against the specified text. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - */ - public function unsetStringFilter(): void - { - $this->stringFilter = []; - } - - /** - * Returns Number Filter. - * The range of a number value between the specified lower and upper bounds. - */ - public function getNumberFilter(): ?Range - { - return $this->numberFilter; - } - - /** - * Sets Number Filter. - * The range of a number value between the specified lower and upper bounds. - * - * @maps number_filter - */ - public function setNumberFilter(?Range $numberFilter): void - { - $this->numberFilter = $numberFilter; - } - - /** - * Returns Selection Uids Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `selection_uid_values` values against the specified selection uids. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - * - * @return string[]|null - */ - public function getSelectionUidsFilter(): ?array - { - if (count($this->selectionUidsFilter) == 0) { - return null; - } - return $this->selectionUidsFilter['value']; - } - - /** - * Sets Selection Uids Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `selection_uid_values` values against the specified selection uids. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - * - * @maps selection_uids_filter - * - * @param string[]|null $selectionUidsFilter - */ - public function setSelectionUidsFilter(?array $selectionUidsFilter): void - { - $this->selectionUidsFilter['value'] = $selectionUidsFilter; - } - - /** - * Unsets Selection Uids Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `selection_uid_values` values against the specified selection uids. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - */ - public function unsetSelectionUidsFilter(): void - { - $this->selectionUidsFilter = []; - } - - /** - * Returns Bool Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `boolean_value` property values against the specified Boolean expression. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - */ - public function getBoolFilter(): ?bool - { - if (count($this->boolFilter) == 0) { - return null; - } - return $this->boolFilter['value']; - } - - /** - * Sets Bool Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `boolean_value` property values against the specified Boolean expression. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - * - * @maps bool_filter - */ - public function setBoolFilter(?bool $boolFilter): void - { - $this->boolFilter['value'] = $boolFilter; - } - - /** - * Unsets Bool Filter. - * A query expression to filter items or item variations by matching their custom attributes' - * `boolean_value` property values against the specified Boolean expression. - * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be - * specified. - */ - public function unsetBoolFilter(): void - { - $this->boolFilter = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customAttributeDefinitionId)) { - $json['custom_attribute_definition_id'] = $this->customAttributeDefinitionId['value']; - } - if (!empty($this->key)) { - $json['key'] = $this->key['value']; - } - if (!empty($this->stringFilter)) { - $json['string_filter'] = $this->stringFilter['value']; - } - if (isset($this->numberFilter)) { - $json['number_filter'] = $this->numberFilter; - } - if (!empty($this->selectionUidsFilter)) { - $json['selection_uids_filter'] = $this->selectionUidsFilter['value']; - } - if (!empty($this->boolFilter)) { - $json['bool_filter'] = $this->boolFilter['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomField.php b/src/Models/CustomField.php deleted file mode 100644 index 6b545ba8..00000000 --- a/src/Models/CustomField.php +++ /dev/null @@ -1,71 +0,0 @@ -title = $title; - } - - /** - * Returns Title. - * The title of the custom field. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title of the custom field. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Customer.php b/src/Models/Customer.php deleted file mode 100644 index a21a1b17..00000000 --- a/src/Models/Customer.php +++ /dev/null @@ -1,800 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique Square-assigned ID for the customer profile. - * - * If you need this ID for an API request, use the ID returned when you created the customer profile or - * call the [SearchCustomers](api-endpoint:Customers-SearchCustomers) - * or [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Created At. - * The timestamp when the customer profile was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the customer profile was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the customer profile was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the customer profile was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Cards. - * Payment details of the credit, debit, and gift cards stored on file for the customer profile. - * - * DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling - * [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file) - * or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the - * `customer_id` query parameter. - * For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what- - * it-does#migrate-customer-cards). - * - * @return Card[]|null - */ - public function getCards(): ?array - { - if (count($this->cards) == 0) { - return null; - } - return $this->cards['value']; - } - - /** - * Sets Cards. - * Payment details of the credit, debit, and gift cards stored on file for the customer profile. - * - * DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling - * [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file) - * or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the - * `customer_id` query parameter. - * For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what- - * it-does#migrate-customer-cards). - * - * @maps cards - * - * @param Card[]|null $cards - */ - public function setCards(?array $cards): void - { - $this->cards['value'] = $cards; - } - - /** - * Unsets Cards. - * Payment details of the credit, debit, and gift cards stored on file for the customer profile. - * - * DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling - * [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file) - * or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the - * `customer_id` query parameter. - * For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what- - * it-does#migrate-customer-cards). - */ - public function unsetCards(): void - { - $this->cards = []; - } - - /** - * Returns Given Name. - * The given name (that is, the first name) associated with the customer profile. - */ - public function getGivenName(): ?string - { - if (count($this->givenName) == 0) { - return null; - } - return $this->givenName['value']; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName['value'] = $givenName; - } - - /** - * Unsets Given Name. - * The given name (that is, the first name) associated with the customer profile. - */ - public function unsetGivenName(): void - { - $this->givenName = []; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function getFamilyName(): ?string - { - if (count($this->familyName) == 0) { - return null; - } - return $this->familyName['value']; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName['value'] = $familyName; - } - - /** - * Unsets Family Name. - * The family name (that is, the last name) associated with the customer profile. - */ - public function unsetFamilyName(): void - { - $this->familyName = []; - } - - /** - * Returns Nickname. - * A nickname for the customer profile. - */ - public function getNickname(): ?string - { - if (count($this->nickname) == 0) { - return null; - } - return $this->nickname['value']; - } - - /** - * Sets Nickname. - * A nickname for the customer profile. - * - * @maps nickname - */ - public function setNickname(?string $nickname): void - { - $this->nickname['value'] = $nickname; - } - - /** - * Unsets Nickname. - * A nickname for the customer profile. - */ - public function unsetNickname(): void - { - $this->nickname = []; - } - - /** - * Returns Company Name. - * A business name associated with the customer profile. - */ - public function getCompanyName(): ?string - { - if (count($this->companyName) == 0) { - return null; - } - return $this->companyName['value']; - } - - /** - * Sets Company Name. - * A business name associated with the customer profile. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName['value'] = $companyName; - } - - /** - * Unsets Company Name. - * A business name associated with the customer profile. - */ - public function unsetCompanyName(): void - { - $this->companyName = []; - } - - /** - * Returns Email Address. - * The email address associated with the customer profile. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address associated with the customer profile. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address associated with the customer profile. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The phone number associated with the customer profile. - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number associated with the customer profile. - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number associated with the customer profile. - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09- - * 21` - * represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year). - */ - public function getBirthday(): ?string - { - if (count($this->birthday) == 0) { - return null; - } - return $this->birthday['value']; - } - - /** - * Sets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09- - * 21` - * represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year). - * - * @maps birthday - */ - public function setBirthday(?string $birthday): void - { - $this->birthday['value'] = $birthday; - } - - /** - * Unsets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09- - * 21` - * represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year). - */ - public function unsetBirthday(): void - { - $this->birthday = []; - } - - /** - * Returns Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * A custom note associated with the customer profile. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A custom note associated with the customer profile. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A custom note associated with the customer profile. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Preferences. - * Represents communication preferences for the customer profile. - */ - public function getPreferences(): ?CustomerPreferences - { - return $this->preferences; - } - - /** - * Sets Preferences. - * Represents communication preferences for the customer profile. - * - * @maps preferences - */ - public function setPreferences(?CustomerPreferences $preferences): void - { - $this->preferences = $preferences; - } - - /** - * Returns Creation Source. - * Indicates the method used to create the customer profile. - */ - public function getCreationSource(): ?string - { - return $this->creationSource; - } - - /** - * Sets Creation Source. - * Indicates the method used to create the customer profile. - * - * @maps creation_source - */ - public function setCreationSource(?string $creationSource): void - { - $this->creationSource = $creationSource; - } - - /** - * Returns Group Ids. - * The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. - * - * @return string[]|null - */ - public function getGroupIds(): ?array - { - if (count($this->groupIds) == 0) { - return null; - } - return $this->groupIds['value']; - } - - /** - * Sets Group Ids. - * The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. - * - * @maps group_ids - * - * @param string[]|null $groupIds - */ - public function setGroupIds(?array $groupIds): void - { - $this->groupIds['value'] = $groupIds; - } - - /** - * Unsets Group Ids. - * The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. - */ - public function unsetGroupIds(): void - { - $this->groupIds = []; - } - - /** - * Returns Segment Ids. - * The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. - * - * @return string[]|null - */ - public function getSegmentIds(): ?array - { - if (count($this->segmentIds) == 0) { - return null; - } - return $this->segmentIds['value']; - } - - /** - * Sets Segment Ids. - * The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. - * - * @maps segment_ids - * - * @param string[]|null $segmentIds - */ - public function setSegmentIds(?array $segmentIds): void - { - $this->segmentIds['value'] = $segmentIds; - } - - /** - * Unsets Segment Ids. - * The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. - */ - public function unsetSegmentIds(): void - { - $this->segmentIds = []; - } - - /** - * Returns Version. - * The Square-assigned version number of the customer profile. The version number is incremented each - * time an update is committed to the customer profile, except for changes to customer segment - * membership and cards on file. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The Square-assigned version number of the customer profile. The version number is incremented each - * time an update is committed to the customer profile, except for changes to customer segment - * membership and cards on file. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - */ - public function getTaxIds(): ?CustomerTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?CustomerTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->cards)) { - $json['cards'] = $this->cards['value']; - } - if (!empty($this->givenName)) { - $json['given_name'] = $this->givenName['value']; - } - if (!empty($this->familyName)) { - $json['family_name'] = $this->familyName['value']; - } - if (!empty($this->nickname)) { - $json['nickname'] = $this->nickname['value']; - } - if (!empty($this->companyName)) { - $json['company_name'] = $this->companyName['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->birthday)) { - $json['birthday'] = $this->birthday['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (isset($this->preferences)) { - $json['preferences'] = $this->preferences; - } - if (isset($this->creationSource)) { - $json['creation_source'] = $this->creationSource; - } - if (!empty($this->groupIds)) { - $json['group_ids'] = $this->groupIds['value']; - } - if (!empty($this->segmentIds)) { - $json['segment_ids'] = $this->segmentIds['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerAddressFilter.php b/src/Models/CustomerAddressFilter.php deleted file mode 100644 index 4b9ae307..00000000 --- a/src/Models/CustomerAddressFilter.php +++ /dev/null @@ -1,96 +0,0 @@ -postalCode; - } - - /** - * Sets Postal Code. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps postal_code - */ - public function setPostalCode(?CustomerTextFilter $postalCode): void - { - $this->postalCode = $postalCode; - } - - /** - * Returns Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - */ - public function getCountry(): ?string - { - return $this->country; - } - - /** - * Sets Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - * - * @maps country - */ - public function setCountry(?string $country): void - { - $this->country = $country; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->postalCode)) { - $json['postal_code'] = $this->postalCode; - } - if (isset($this->country)) { - $json['country'] = $this->country; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerCreationSource.php b/src/Models/CustomerCreationSource.php deleted file mode 100644 index 8037bdcf..00000000 --- a/src/Models/CustomerCreationSource.php +++ /dev/null @@ -1,126 +0,0 @@ -values) == 0) { - return null; - } - return $this->values['value']; - } - - /** - * Sets Values. - * The list of creation sources used as filtering criteria. - * See [CustomerCreationSource](#type-customercreationsource) for possible values - * - * @maps values - * - * @param string[]|null $values - */ - public function setValues(?array $values): void - { - $this->values['value'] = $values; - } - - /** - * Unsets Values. - * The list of creation sources used as filtering criteria. - * See [CustomerCreationSource](#type-customercreationsource) for possible values - */ - public function unsetValues(): void - { - $this->values = []; - } - - /** - * Returns Rule. - * Indicates whether customers should be included in, or excluded from, - * the result set when they match the filtering criteria. - */ - public function getRule(): ?string - { - return $this->rule; - } - - /** - * Sets Rule. - * Indicates whether customers should be included in, or excluded from, - * the result set when they match the filtering criteria. - * - * @maps rule - */ - public function setRule(?string $rule): void - { - $this->rule = $rule; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->values)) { - $json['values'] = $this->values['value']; - } - if (isset($this->rule)) { - $json['rule'] = $this->rule; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerCustomAttributeFilter.php b/src/Models/CustomerCustomAttributeFilter.php deleted file mode 100644 index 2d8eb4aa..00000000 --- a/src/Models/CustomerCustomAttributeFilter.php +++ /dev/null @@ -1,143 +0,0 @@ -key = $key; - } - - /** - * Returns Key. - * The `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier - * of the custom attribute - * (and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom - * Attributes API](api:CustomerCustomAttributes). - */ - public function getKey(): string - { - return $this->key; - } - - /** - * Sets Key. - * The `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier - * of the custom attribute - * (and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom - * Attributes API](api:CustomerCustomAttributes). - * - * @required - * @maps key - */ - public function setKey(string $key): void - { - $this->key = $key; - } - - /** - * Returns Filter. - * A type-specific filter used in a [custom attribute filter]($m/CustomerCustomAttributeFilter) to - * search based on the value - * of a customer-related [custom attribute]($m/CustomAttribute). - */ - public function getFilter(): ?CustomerCustomAttributeFilterValue - { - return $this->filter; - } - - /** - * Sets Filter. - * A type-specific filter used in a [custom attribute filter]($m/CustomerCustomAttributeFilter) to - * search based on the value - * of a customer-related [custom attribute]($m/CustomAttribute). - * - * @maps filter - */ - public function setFilter(?CustomerCustomAttributeFilterValue $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getUpdatedAt(): ?TimeRange - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps updated_at - */ - public function setUpdatedAt(?TimeRange $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['key'] = $this->key; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerCustomAttributeFilterValue.php b/src/Models/CustomerCustomAttributeFilterValue.php deleted file mode 100644 index 6dae5eae..00000000 --- a/src/Models/CustomerCustomAttributeFilterValue.php +++ /dev/null @@ -1,302 +0,0 @@ -email; - } - - /** - * Sets Email. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps email - */ - public function setEmail(?CustomerTextFilter $email): void - { - $this->email = $email; - } - - /** - * Returns Phone. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - */ - public function getPhone(): ?CustomerTextFilter - { - return $this->phone; - } - - /** - * Sets Phone. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps phone - */ - public function setPhone(?CustomerTextFilter $phone): void - { - $this->phone = $phone; - } - - /** - * Returns Text. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - */ - public function getText(): ?CustomerTextFilter - { - return $this->text; - } - - /** - * Sets Text. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps text - */ - public function setText(?CustomerTextFilter $text): void - { - $this->text = $text; - } - - /** - * Returns Selection. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - */ - public function getSelection(): ?FilterValue - { - return $this->selection; - } - - /** - * Sets Selection. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - * - * @maps selection - */ - public function setSelection(?FilterValue $selection): void - { - $this->selection = $selection; - } - - /** - * Returns Date. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getDate(): ?TimeRange - { - return $this->date; - } - - /** - * Sets Date. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps date - */ - public function setDate(?TimeRange $date): void - { - $this->date = $date; - } - - /** - * Returns Number. - * Specifies a decimal number range. - */ - public function getNumber(): ?FloatNumberRange - { - return $this->number; - } - - /** - * Sets Number. - * Specifies a decimal number range. - * - * @maps number - */ - public function setNumber(?FloatNumberRange $number): void - { - $this->number = $number; - } - - /** - * Returns Boolean. - * A filter for a query based on the value of a `Boolean`-type custom attribute. - */ - public function getBoolean(): ?bool - { - if (count($this->boolean) == 0) { - return null; - } - return $this->boolean['value']; - } - - /** - * Sets Boolean. - * A filter for a query based on the value of a `Boolean`-type custom attribute. - * - * @maps boolean - */ - public function setBoolean(?bool $boolean): void - { - $this->boolean['value'] = $boolean; - } - - /** - * Unsets Boolean. - * A filter for a query based on the value of a `Boolean`-type custom attribute. - */ - public function unsetBoolean(): void - { - $this->boolean = []; - } - - /** - * Returns Address. - * The customer address filter. This filter is used in a - * [CustomerCustomAttributeFilterValue]($m/CustomerCustomAttributeFilterValue) filter when - * searching by an `Address`-type custom attribute. - */ - public function getAddress(): ?CustomerAddressFilter - { - return $this->address; - } - - /** - * Sets Address. - * The customer address filter. This filter is used in a - * [CustomerCustomAttributeFilterValue]($m/CustomerCustomAttributeFilterValue) filter when - * searching by an `Address`-type custom attribute. - * - * @maps address - */ - public function setAddress(?CustomerAddressFilter $address): void - { - $this->address = $address; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->email)) { - $json['email'] = $this->email; - } - if (isset($this->phone)) { - $json['phone'] = $this->phone; - } - if (isset($this->text)) { - $json['text'] = $this->text; - } - if (isset($this->selection)) { - $json['selection'] = $this->selection; - } - if (isset($this->date)) { - $json['date'] = $this->date; - } - if (isset($this->number)) { - $json['number'] = $this->number; - } - if (!empty($this->boolean)) { - $json['boolean'] = $this->boolean['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerCustomAttributeFilters.php b/src/Models/CustomerCustomAttributeFilters.php deleted file mode 100644 index d4bcbb9a..00000000 --- a/src/Models/CustomerCustomAttributeFilters.php +++ /dev/null @@ -1,90 +0,0 @@ -filters) == 0) { - return null; - } - return $this->filters['value']; - } - - /** - * Sets Filters. - * The custom attribute filters. Each filter must specify `key` and include the `filter` field with a - * type-specific filter, - * the `updated_at` field, or both. The provided keys must be unique within the list of custom - * attribute filters. - * - * @maps filters - * - * @param CustomerCustomAttributeFilter[]|null $filters - */ - public function setFilters(?array $filters): void - { - $this->filters['value'] = $filters; - } - - /** - * Unsets Filters. - * The custom attribute filters. Each filter must specify `key` and include the `filter` field with a - * type-specific filter, - * the `updated_at` field, or both. The provided keys must be unique within the list of custom - * attribute filters. - */ - public function unsetFilters(): void - { - $this->filters = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->filters)) { - $json['filters'] = $this->filters['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerDetails.php b/src/Models/CustomerDetails.php deleted file mode 100644 index 6bccddcf..00000000 --- a/src/Models/CustomerDetails.php +++ /dev/null @@ -1,115 +0,0 @@ -customerInitiated) == 0) { - return null; - } - return $this->customerInitiated['value']; - } - - /** - * Sets Customer Initiated. - * Indicates whether the customer initiated the payment. - * - * @maps customer_initiated - */ - public function setCustomerInitiated(?bool $customerInitiated): void - { - $this->customerInitiated['value'] = $customerInitiated; - } - - /** - * Unsets Customer Initiated. - * Indicates whether the customer initiated the payment. - */ - public function unsetCustomerInitiated(): void - { - $this->customerInitiated = []; - } - - /** - * Returns Seller Keyed In. - * Indicates that the seller keyed in payment details on behalf of the customer. - * This is used to flag a payment as Mail Order / Telephone Order (MOTO). - */ - public function getSellerKeyedIn(): ?bool - { - if (count($this->sellerKeyedIn) == 0) { - return null; - } - return $this->sellerKeyedIn['value']; - } - - /** - * Sets Seller Keyed In. - * Indicates that the seller keyed in payment details on behalf of the customer. - * This is used to flag a payment as Mail Order / Telephone Order (MOTO). - * - * @maps seller_keyed_in - */ - public function setSellerKeyedIn(?bool $sellerKeyedIn): void - { - $this->sellerKeyedIn['value'] = $sellerKeyedIn; - } - - /** - * Unsets Seller Keyed In. - * Indicates that the seller keyed in payment details on behalf of the customer. - * This is used to flag a payment as Mail Order / Telephone Order (MOTO). - */ - public function unsetSellerKeyedIn(): void - { - $this->sellerKeyedIn = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerInitiated)) { - $json['customer_initiated'] = $this->customerInitiated['value']; - } - if (!empty($this->sellerKeyedIn)) { - $json['seller_keyed_in'] = $this->sellerKeyedIn['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerFilter.php b/src/Models/CustomerFilter.php deleted file mode 100644 index 48cdfb11..00000000 --- a/src/Models/CustomerFilter.php +++ /dev/null @@ -1,345 +0,0 @@ -creationSource; - } - - /** - * Sets Creation Source. - * The creation source filter. - * - * If one or more creation sources are set, customer profiles are included in, - * or excluded from, the result if they match at least one of the filter criteria. - * - * @maps creation_source - */ - public function setCreationSource(?CustomerCreationSourceFilter $creationSource): void - { - $this->creationSource = $creationSource; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): ?TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getUpdatedAt(): ?TimeRange - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps updated_at - */ - public function setUpdatedAt(?TimeRange $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Email Address. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - */ - public function getEmailAddress(): ?CustomerTextFilter - { - return $this->emailAddress; - } - - /** - * Sets Email Address. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps email_address - */ - public function setEmailAddress(?CustomerTextFilter $emailAddress): void - { - $this->emailAddress = $emailAddress; - } - - /** - * Returns Phone Number. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - */ - public function getPhoneNumber(): ?CustomerTextFilter - { - return $this->phoneNumber; - } - - /** - * Sets Phone Number. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps phone_number - */ - public function setPhoneNumber(?CustomerTextFilter $phoneNumber): void - { - $this->phoneNumber = $phoneNumber; - } - - /** - * Returns Reference Id. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - */ - public function getReferenceId(): ?CustomerTextFilter - { - return $this->referenceId; - } - - /** - * Sets Reference Id. - * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on the customer attributes, - * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. - * - * @maps reference_id - */ - public function setReferenceId(?CustomerTextFilter $referenceId): void - { - $this->referenceId = $referenceId; - } - - /** - * Returns Group Ids. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - */ - public function getGroupIds(): ?FilterValue - { - return $this->groupIds; - } - - /** - * Sets Group Ids. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - * - * @maps group_ids - */ - public function setGroupIds(?FilterValue $groupIds): void - { - $this->groupIds = $groupIds; - } - - /** - * Returns Custom Attribute. - * The custom attribute filters in a set of [customer filters]($m/CustomerFilter) used in a search - * query. Use this filter - * to search based on [custom attributes]($m/CustomAttribute) that are assigned to customer profiles. - * For more information, see - * [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search- - * customers#search-by-custom-attribute). - */ - public function getCustomAttribute(): ?CustomerCustomAttributeFilters - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * The custom attribute filters in a set of [customer filters]($m/CustomerFilter) used in a search - * query. Use this filter - * to search based on [custom attributes]($m/CustomAttribute) that are assigned to customer profiles. - * For more information, see - * [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search- - * customers#search-by-custom-attribute). - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomerCustomAttributeFilters $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Segment Ids. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - */ - public function getSegmentIds(): ?FilterValue - { - return $this->segmentIds; - } - - /** - * Sets Segment Ids. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - * - * @maps segment_ids - */ - public function setSegmentIds(?FilterValue $segmentIds): void - { - $this->segmentIds = $segmentIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->creationSource)) { - $json['creation_source'] = $this->creationSource; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->emailAddress)) { - $json['email_address'] = $this->emailAddress; - } - if (isset($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber; - } - if (isset($this->referenceId)) { - $json['reference_id'] = $this->referenceId; - } - if (isset($this->groupIds)) { - $json['group_ids'] = $this->groupIds; - } - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->segmentIds)) { - $json['segment_ids'] = $this->segmentIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php deleted file mode 100644 index 36ecaa71..00000000 --- a/src/Models/CustomerGroup.php +++ /dev/null @@ -1,154 +0,0 @@ -name = $name; - } - - /** - * Returns Id. - * A unique Square-generated ID for the customer group. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A unique Square-generated ID for the customer group. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of the customer group. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the customer group. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Created At. - * The timestamp when the customer group was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the customer group was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the customer group was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the customer group was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['name'] = $this->name; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerInclusionExclusion.php b/src/Models/CustomerInclusionExclusion.php deleted file mode 100644 index deb61cac..00000000 --- a/src/Models/CustomerInclusionExclusion.php +++ /dev/null @@ -1,24 +0,0 @@ -emailUnsubscribed) == 0) { - return null; - } - return $this->emailUnsubscribed['value']; - } - - /** - * Sets Email Unsubscribed. - * Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` - * means that the customer chose to opt out of email marketing from the current Square seller or from - * all Square sellers. This value is read-only from the Customers API. - * - * @maps email_unsubscribed - */ - public function setEmailUnsubscribed(?bool $emailUnsubscribed): void - { - $this->emailUnsubscribed['value'] = $emailUnsubscribed; - } - - /** - * Unsets Email Unsubscribed. - * Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` - * means that the customer chose to opt out of email marketing from the current Square seller or from - * all Square sellers. This value is read-only from the Customers API. - */ - public function unsetEmailUnsubscribed(): void - { - $this->emailUnsubscribed = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->emailUnsubscribed)) { - $json['email_unsubscribed'] = $this->emailUnsubscribed['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerQuery.php b/src/Models/CustomerQuery.php deleted file mode 100644 index 51fe22c0..00000000 --- a/src/Models/CustomerQuery.php +++ /dev/null @@ -1,93 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Represents the filtering criteria in a [search query]($m/CustomerQuery) that defines how to filter - * customer profiles returned in [SearchCustomers]($e/Customers/SearchCustomers) results. - * - * @maps filter - */ - public function setFilter(?CustomerFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Represents the sorting criteria in a [search query]($m/CustomerQuery) that defines how to sort - * customer profiles returned in [SearchCustomers]($e/Customers/SearchCustomers) results. - */ - public function getSort(): ?CustomerSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Represents the sorting criteria in a [search query]($m/CustomerQuery) that defines how to sort - * customer profiles returned in [SearchCustomers]($e/Customers/SearchCustomers) results. - * - * @maps sort - */ - public function setSort(?CustomerSort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerSegment.php b/src/Models/CustomerSegment.php deleted file mode 100644 index bb59ad6b..00000000 --- a/src/Models/CustomerSegment.php +++ /dev/null @@ -1,154 +0,0 @@ -name = $name; - } - - /** - * Returns Id. - * A unique Square-generated ID for the segment. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A unique Square-generated ID for the segment. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of the segment. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the segment. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Created At. - * The timestamp when the segment was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the segment was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the segment was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the segment was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['name'] = $this->name; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerSort.php b/src/Models/CustomerSort.php deleted file mode 100644 index d3d7a9ef..00000000 --- a/src/Models/CustomerSort.php +++ /dev/null @@ -1,89 +0,0 @@ -field; - } - - /** - * Sets Field. - * Specifies customer attributes as the sort key to customer profiles returned from a search. - * - * @maps field - */ - public function setField(?string $field): void - { - $this->field = $field; - } - - /** - * Returns Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getOrder(): ?string - { - return $this->order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->field)) { - $json['field'] = $this->field; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerSortField.php b/src/Models/CustomerSortField.php deleted file mode 100644 index 66dd8d6f..00000000 --- a/src/Models/CustomerSortField.php +++ /dev/null @@ -1,25 +0,0 @@ -euVat) == 0) { - return null; - } - return $this->euVat['value']; - } - - /** - * Sets Eu Vat. - * The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain - * alphanumeric characters only. - * - * @maps eu_vat - */ - public function setEuVat(?string $euVat): void - { - $this->euVat['value'] = $euVat; - } - - /** - * Unsets Eu Vat. - * The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain - * alphanumeric characters only. - */ - public function unsetEuVat(): void - { - $this->euVat = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->euVat)) { - $json['eu_vat'] = $this->euVat['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CustomerTextFilter.php b/src/Models/CustomerTextFilter.php deleted file mode 100644 index 3ff1f95a..00000000 --- a/src/Models/CustomerTextFilter.php +++ /dev/null @@ -1,123 +0,0 @@ -exact) == 0) { - return null; - } - return $this->exact['value']; - } - - /** - * Sets Exact. - * Use the exact filter to select customers whose attributes match exactly the specified query. - * - * @maps exact - */ - public function setExact(?string $exact): void - { - $this->exact['value'] = $exact; - } - - /** - * Unsets Exact. - * Use the exact filter to select customers whose attributes match exactly the specified query. - */ - public function unsetExact(): void - { - $this->exact = []; - } - - /** - * Returns Fuzzy. - * Use the fuzzy filter to select customers whose attributes match the specified query - * in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then - * each query token must be matched somewhere in the searched attribute. For single token queries, - * this is effectively the same behavior as a partial match operation. - */ - public function getFuzzy(): ?string - { - if (count($this->fuzzy) == 0) { - return null; - } - return $this->fuzzy['value']; - } - - /** - * Sets Fuzzy. - * Use the fuzzy filter to select customers whose attributes match the specified query - * in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then - * each query token must be matched somewhere in the searched attribute. For single token queries, - * this is effectively the same behavior as a partial match operation. - * - * @maps fuzzy - */ - public function setFuzzy(?string $fuzzy): void - { - $this->fuzzy['value'] = $fuzzy; - } - - /** - * Unsets Fuzzy. - * Use the fuzzy filter to select customers whose attributes match the specified query - * in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then - * each query token must be matched somewhere in the searched attribute. For single token queries, - * this is effectively the same behavior as a partial match operation. - */ - public function unsetFuzzy(): void - { - $this->fuzzy = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->exact)) { - $json['exact'] = $this->exact['value']; - } - if (!empty($this->fuzzy)) { - $json['fuzzy'] = $this->fuzzy['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DataCollectionOptions.php b/src/Models/DataCollectionOptions.php deleted file mode 100644 index 005eecfd..00000000 --- a/src/Models/DataCollectionOptions.php +++ /dev/null @@ -1,150 +0,0 @@ -title = $title; - $this->body = $body; - $this->inputType = $inputType; - } - - /** - * Returns Title. - * The title text to display in the data collection flow on the Terminal. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text to display in the data collection flow on the Terminal. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Returns Body. - * The body text to display under the title in the data collection screen flow on the - * Terminal. - */ - public function getBody(): string - { - return $this->body; - } - - /** - * Sets Body. - * The body text to display under the title in the data collection screen flow on the - * Terminal. - * - * @required - * @maps body - */ - public function setBody(string $body): void - { - $this->body = $body; - } - - /** - * Returns Input Type. - * Describes the input type of the data. - */ - public function getInputType(): string - { - return $this->inputType; - } - - /** - * Sets Input Type. - * Describes the input type of the data. - * - * @required - * @maps input_type - */ - public function setInputType(string $inputType): void - { - $this->inputType = $inputType; - } - - /** - * Returns Collected Data. - */ - public function getCollectedData(): ?CollectedData - { - return $this->collectedData; - } - - /** - * Sets Collected Data. - * - * @maps collected_data - */ - public function setCollectedData(?CollectedData $collectedData): void - { - $this->collectedData = $collectedData; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json['body'] = $this->body; - $json['input_type'] = $this->inputType; - if (isset($this->collectedData)) { - $json['collected_data'] = $this->collectedData; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DataCollectionOptionsInputType.php b/src/Models/DataCollectionOptionsInputType.php deleted file mode 100644 index 605f948a..00000000 --- a/src/Models/DataCollectionOptionsInputType.php +++ /dev/null @@ -1,23 +0,0 @@ -startDate) == 0) { - return null; - } - return $this->startDate['value']; - } - - /** - * Sets Start Date. - * A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601 - * extended format for calendar dates. - * The beginning of a date range (inclusive). - * - * @maps start_date - */ - public function setStartDate(?string $startDate): void - { - $this->startDate['value'] = $startDate; - } - - /** - * Unsets Start Date. - * A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601 - * extended format for calendar dates. - * The beginning of a date range (inclusive). - */ - public function unsetStartDate(): void - { - $this->startDate = []; - } - - /** - * Returns End Date. - * A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601 - * extended format for calendar dates. - * The end of a date range (inclusive). - */ - public function getEndDate(): ?string - { - if (count($this->endDate) == 0) { - return null; - } - return $this->endDate['value']; - } - - /** - * Sets End Date. - * A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601 - * extended format for calendar dates. - * The end of a date range (inclusive). - * - * @maps end_date - */ - public function setEndDate(?string $endDate): void - { - $this->endDate['value'] = $endDate; - } - - /** - * Unsets End Date. - * A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601 - * extended format for calendar dates. - * The end of a date range (inclusive). - */ - public function unsetEndDate(): void - { - $this->endDate = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->startDate)) { - $json['start_date'] = $this->startDate['value']; - } - if (!empty($this->endDate)) { - $json['end_date'] = $this->endDate['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DayOfWeek.php b/src/Models/DayOfWeek.php deleted file mode 100644 index c7e7314e..00000000 --- a/src/Models/DayOfWeek.php +++ /dev/null @@ -1,46 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteBookingCustomAttributeResponse.php b/src/Models/DeleteBookingCustomAttributeResponse.php deleted file mode 100644 index 1aebcdb4..00000000 --- a/src/Models/DeleteBookingCustomAttributeResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteBreakTypeResponse.php b/src/Models/DeleteBreakTypeResponse.php deleted file mode 100644 index 9cb5d0b4..00000000 --- a/src/Models/DeleteBreakTypeResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCatalogObjectResponse.php b/src/Models/DeleteCatalogObjectResponse.php deleted file mode 100644 index a80af571..00000000 --- a/src/Models/DeleteCatalogObjectResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Deleted Object Ids. - * The IDs of all catalog objects deleted by this request. - * Multiple IDs may be returned when associated objects are also deleted, for example - * a catalog item variation will be deleted (and its ID included in this field) - * when its parent catalog item is deleted. - * - * @return string[]|null - */ - public function getDeletedObjectIds(): ?array - { - return $this->deletedObjectIds; - } - - /** - * Sets Deleted Object Ids. - * The IDs of all catalog objects deleted by this request. - * Multiple IDs may be returned when associated objects are also deleted, for example - * a catalog item variation will be deleted (and its ID included in this field) - * when its parent catalog item is deleted. - * - * @maps deleted_object_ids - * - * @param string[]|null $deletedObjectIds - */ - public function setDeletedObjectIds(?array $deletedObjectIds): void - { - $this->deletedObjectIds = $deletedObjectIds; - } - - /** - * Returns Deleted At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - */ - public function getDeletedAt(): ?string - { - return $this->deletedAt; - } - - /** - * Sets Deleted At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - * - * @maps deleted_at - */ - public function setDeletedAt(?string $deletedAt): void - { - $this->deletedAt = $deletedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->deletedObjectIds)) { - $json['deleted_object_ids'] = $this->deletedObjectIds; - } - if (isset($this->deletedAt)) { - $json['deleted_at'] = $this->deletedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerCardResponse.php b/src/Models/DeleteCustomerCardResponse.php deleted file mode 100644 index d964b398..00000000 --- a/src/Models/DeleteCustomerCardResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerCustomAttributeDefinitionResponse.php b/src/Models/DeleteCustomerCustomAttributeDefinitionResponse.php deleted file mode 100644 index 8ded7ed7..00000000 --- a/src/Models/DeleteCustomerCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerCustomAttributeResponse.php b/src/Models/DeleteCustomerCustomAttributeResponse.php deleted file mode 100644 index 0a283852..00000000 --- a/src/Models/DeleteCustomerCustomAttributeResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerGroupResponse.php b/src/Models/DeleteCustomerGroupResponse.php deleted file mode 100644 index f07d05d5..00000000 --- a/src/Models/DeleteCustomerGroupResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerRequest.php b/src/Models/DeleteCustomerRequest.php deleted file mode 100644 index 3f114231..00000000 --- a/src/Models/DeleteCustomerRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -version; - } - - /** - * Sets Version. - * The current version of the customer profile. - * - * As a best practice, you should include this parameter to enable [optimistic concurrency](https: - * //developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For - * more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers- - * api/use-the-api/keep-records#delete-customer-profile). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteCustomerResponse.php b/src/Models/DeleteCustomerResponse.php deleted file mode 100644 index 8dfbeb59..00000000 --- a/src/Models/DeleteCustomerResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteDisputeEvidenceResponse.php b/src/Models/DeleteDisputeEvidenceResponse.php deleted file mode 100644 index fdf64fbd..00000000 --- a/src/Models/DeleteDisputeEvidenceResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteInvoiceAttachmentResponse.php b/src/Models/DeleteInvoiceAttachmentResponse.php deleted file mode 100644 index 41b58522..00000000 --- a/src/Models/DeleteInvoiceAttachmentResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteInvoiceRequest.php b/src/Models/DeleteInvoiceRequest.php deleted file mode 100644 index b9f95ddb..00000000 --- a/src/Models/DeleteInvoiceRequest.php +++ /dev/null @@ -1,64 +0,0 @@ -version; - } - - /** - * Sets Version. - * The version of the [invoice](entity:Invoice) to delete. - * If you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or - * [ListInvoices](api-endpoint:Invoices-ListInvoices). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteInvoiceResponse.php b/src/Models/DeleteInvoiceResponse.php deleted file mode 100644 index 9898a7c6..00000000 --- a/src/Models/DeleteInvoiceResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteLocationCustomAttributeDefinitionResponse.php b/src/Models/DeleteLocationCustomAttributeDefinitionResponse.php deleted file mode 100644 index 1ee7e950..00000000 --- a/src/Models/DeleteLocationCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteLocationCustomAttributeResponse.php b/src/Models/DeleteLocationCustomAttributeResponse.php deleted file mode 100644 index 4e6759ed..00000000 --- a/src/Models/DeleteLocationCustomAttributeResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteLoyaltyRewardResponse.php b/src/Models/DeleteLoyaltyRewardResponse.php deleted file mode 100644 index 967de44c..00000000 --- a/src/Models/DeleteLoyaltyRewardResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteMerchantCustomAttributeDefinitionResponse.php b/src/Models/DeleteMerchantCustomAttributeDefinitionResponse.php deleted file mode 100644 index f395bea9..00000000 --- a/src/Models/DeleteMerchantCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteMerchantCustomAttributeResponse.php b/src/Models/DeleteMerchantCustomAttributeResponse.php deleted file mode 100644 index 15c00424..00000000 --- a/src/Models/DeleteMerchantCustomAttributeResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteOrderCustomAttributeDefinitionResponse.php b/src/Models/DeleteOrderCustomAttributeDefinitionResponse.php deleted file mode 100644 index c8cb7d5a..00000000 --- a/src/Models/DeleteOrderCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteOrderCustomAttributeResponse.php b/src/Models/DeleteOrderCustomAttributeResponse.php deleted file mode 100644 index c9f1f415..00000000 --- a/src/Models/DeleteOrderCustomAttributeResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeletePaymentLinkResponse.php b/src/Models/DeletePaymentLinkResponse.php deleted file mode 100644 index 17192673..00000000 --- a/src/Models/DeletePaymentLinkResponse.php +++ /dev/null @@ -1,117 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Id. - * The ID of the link that is deleted. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The ID of the link that is deleted. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Cancelled Order Id. - * The ID of the order that is canceled. When a payment link is deleted, Square updates the - * the `state` (of the order that the checkout link created) to CANCELED. - */ - public function getCancelledOrderId(): ?string - { - return $this->cancelledOrderId; - } - - /** - * Sets Cancelled Order Id. - * The ID of the order that is canceled. When a payment link is deleted, Square updates the - * the `state` (of the order that the checkout link created) to CANCELED. - * - * @maps cancelled_order_id - */ - public function setCancelledOrderId(?string $cancelledOrderId): void - { - $this->cancelledOrderId = $cancelledOrderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->cancelledOrderId)) { - $json['cancelled_order_id'] = $this->cancelledOrderId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteShiftResponse.php b/src/Models/DeleteShiftResponse.php deleted file mode 100644 index 0b42c5c1..00000000 --- a/src/Models/DeleteShiftResponse.php +++ /dev/null @@ -1,65 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteSnippetResponse.php b/src/Models/DeleteSnippetResponse.php deleted file mode 100644 index 29c182b5..00000000 --- a/src/Models/DeleteSnippetResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteSubscriptionActionResponse.php b/src/Models/DeleteSubscriptionActionResponse.php deleted file mode 100644 index 7a275568..00000000 --- a/src/Models/DeleteSubscriptionActionResponse.php +++ /dev/null @@ -1,100 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeleteWebhookSubscriptionResponse.php b/src/Models/DeleteWebhookSubscriptionResponse.php deleted file mode 100644 index d89067b2..00000000 --- a/src/Models/DeleteWebhookSubscriptionResponse.php +++ /dev/null @@ -1,66 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeprecatedCreateDisputeEvidenceFileRequest.php b/src/Models/DeprecatedCreateDisputeEvidenceFileRequest.php deleted file mode 100644 index 71fe1e53..00000000 --- a/src/Models/DeprecatedCreateDisputeEvidenceFileRequest.php +++ /dev/null @@ -1,140 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working- - * with-apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working- - * with-apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Evidence Type. - * The type of the dispute evidence. - */ - public function getEvidenceType(): ?string - { - return $this->evidenceType; - } - - /** - * Sets Evidence Type. - * The type of the dispute evidence. - * - * @maps evidence_type - */ - public function setEvidenceType(?string $evidenceType): void - { - $this->evidenceType = $evidenceType; - } - - /** - * Returns Content Type. - * The MIME type of the uploaded file. - * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. - */ - public function getContentType(): ?string - { - if (count($this->contentType) == 0) { - return null; - } - return $this->contentType['value']; - } - - /** - * Sets Content Type. - * The MIME type of the uploaded file. - * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. - * - * @maps content_type - */ - public function setContentType(?string $contentType): void - { - $this->contentType['value'] = $contentType; - } - - /** - * Unsets Content Type. - * The MIME type of the uploaded file. - * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. - */ - public function unsetContentType(): void - { - $this->contentType = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->evidenceType)) { - $json['evidence_type'] = $this->evidenceType; - } - if (!empty($this->contentType)) { - $json['content_type'] = $this->contentType['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeprecatedCreateDisputeEvidenceFileResponse.php b/src/Models/DeprecatedCreateDisputeEvidenceFileResponse.php deleted file mode 100644 index 360fb542..00000000 --- a/src/Models/DeprecatedCreateDisputeEvidenceFileResponse.php +++ /dev/null @@ -1,90 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Evidence. - */ - public function getEvidence(): ?DisputeEvidence - { - return $this->evidence; - } - - /** - * Sets Evidence. - * - * @maps evidence - */ - public function setEvidence(?DisputeEvidence $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeprecatedCreateDisputeEvidenceTextRequest.php b/src/Models/DeprecatedCreateDisputeEvidenceTextRequest.php deleted file mode 100644 index 3bec6df9..00000000 --- a/src/Models/DeprecatedCreateDisputeEvidenceTextRequest.php +++ /dev/null @@ -1,126 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->evidenceText = $evidenceText; - } - - /** - * Returns Idempotency Key. - * The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working- - * with-apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working- - * with-apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Evidence Type. - * The type of the dispute evidence. - */ - public function getEvidenceType(): ?string - { - return $this->evidenceType; - } - - /** - * Sets Evidence Type. - * The type of the dispute evidence. - * - * @maps evidence_type - */ - public function setEvidenceType(?string $evidenceType): void - { - $this->evidenceType = $evidenceType; - } - - /** - * Returns Evidence Text. - * The evidence string. - */ - public function getEvidenceText(): string - { - return $this->evidenceText; - } - - /** - * Sets Evidence Text. - * The evidence string. - * - * @required - * @maps evidence_text - */ - public function setEvidenceText(string $evidenceText): void - { - $this->evidenceText = $evidenceText; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (isset($this->evidenceType)) { - $json['evidence_type'] = $this->evidenceType; - } - $json['evidence_text'] = $this->evidenceText; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeprecatedCreateDisputeEvidenceTextResponse.php b/src/Models/DeprecatedCreateDisputeEvidenceTextResponse.php deleted file mode 100644 index 45d6b287..00000000 --- a/src/Models/DeprecatedCreateDisputeEvidenceTextResponse.php +++ /dev/null @@ -1,90 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Evidence. - */ - public function getEvidence(): ?DisputeEvidence - { - return $this->evidence; - } - - /** - * Sets Evidence. - * - * @maps evidence - */ - public function setEvidence(?DisputeEvidence $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Destination.php b/src/Models/Destination.php deleted file mode 100644 index 2a270d0e..00000000 --- a/src/Models/Destination.php +++ /dev/null @@ -1,88 +0,0 @@ -type; - } - - /** - * Sets Type. - * List of possible destinations against which a payout can be made. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Id. - * Square issued unique ID (also known as the instrument ID) associated with this destination. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * Square issued unique ID (also known as the instrument ID) associated with this destination. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DestinationDetails.php b/src/Models/DestinationDetails.php deleted file mode 100644 index 61836b74..00000000 --- a/src/Models/DestinationDetails.php +++ /dev/null @@ -1,114 +0,0 @@ -cardDetails; - } - - /** - * Sets Card Details. - * - * @maps card_details - */ - public function setCardDetails(?DestinationDetailsCardRefundDetails $cardDetails): void - { - $this->cardDetails = $cardDetails; - } - - /** - * Returns Cash Details. - * Stores details about a cash refund. Contains only non-confidential information. - */ - public function getCashDetails(): ?DestinationDetailsCashRefundDetails - { - return $this->cashDetails; - } - - /** - * Sets Cash Details. - * Stores details about a cash refund. Contains only non-confidential information. - * - * @maps cash_details - */ - public function setCashDetails(?DestinationDetailsCashRefundDetails $cashDetails): void - { - $this->cashDetails = $cashDetails; - } - - /** - * Returns External Details. - * Stores details about an external refund. Contains only non-confidential information. - */ - public function getExternalDetails(): ?DestinationDetailsExternalRefundDetails - { - return $this->externalDetails; - } - - /** - * Sets External Details. - * Stores details about an external refund. Contains only non-confidential information. - * - * @maps external_details - */ - public function setExternalDetails(?DestinationDetailsExternalRefundDetails $externalDetails): void - { - $this->externalDetails = $externalDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cardDetails)) { - $json['card_details'] = $this->cardDetails; - } - if (isset($this->cashDetails)) { - $json['cash_details'] = $this->cashDetails; - } - if (isset($this->externalDetails)) { - $json['external_details'] = $this->externalDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DestinationDetailsCardRefundDetails.php b/src/Models/DestinationDetailsCardRefundDetails.php deleted file mode 100644 index 1d2b191a..00000000 --- a/src/Models/DestinationDetailsCardRefundDetails.php +++ /dev/null @@ -1,142 +0,0 @@ -card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Returns Entry Method. - * The method used to enter the card's details for the refund. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - */ - public function getEntryMethod(): ?string - { - if (count($this->entryMethod) == 0) { - return null; - } - return $this->entryMethod['value']; - } - - /** - * Sets Entry Method. - * The method used to enter the card's details for the refund. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - * - * @maps entry_method - */ - public function setEntryMethod(?string $entryMethod): void - { - $this->entryMethod['value'] = $entryMethod; - } - - /** - * Unsets Entry Method. - * The method used to enter the card's details for the refund. The method can be - * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. - */ - public function unsetEntryMethod(): void - { - $this->entryMethod = []; - } - - /** - * Returns Auth Result Code. - * The authorization code provided by the issuer when a refund is approved. - */ - public function getAuthResultCode(): ?string - { - if (count($this->authResultCode) == 0) { - return null; - } - return $this->authResultCode['value']; - } - - /** - * Sets Auth Result Code. - * The authorization code provided by the issuer when a refund is approved. - * - * @maps auth_result_code - */ - public function setAuthResultCode(?string $authResultCode): void - { - $this->authResultCode['value'] = $authResultCode; - } - - /** - * Unsets Auth Result Code. - * The authorization code provided by the issuer when a refund is approved. - */ - public function unsetAuthResultCode(): void - { - $this->authResultCode = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->card)) { - $json['card'] = $this->card; - } - if (!empty($this->entryMethod)) { - $json['entry_method'] = $this->entryMethod['value']; - } - if (!empty($this->authResultCode)) { - $json['auth_result_code'] = $this->authResultCode['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DestinationDetailsCashRefundDetails.php b/src/Models/DestinationDetailsCashRefundDetails.php deleted file mode 100644 index 90f1460a..00000000 --- a/src/Models/DestinationDetailsCashRefundDetails.php +++ /dev/null @@ -1,119 +0,0 @@ -sellerSuppliedMoney = $sellerSuppliedMoney; - } - - /** - * Returns Seller Supplied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getSellerSuppliedMoney(): Money - { - return $this->sellerSuppliedMoney; - } - - /** - * Sets Seller Supplied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps seller_supplied_money - */ - public function setSellerSuppliedMoney(Money $sellerSuppliedMoney): void - { - $this->sellerSuppliedMoney = $sellerSuppliedMoney; - } - - /** - * Returns Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getChangeBackMoney(): ?Money - { - return $this->changeBackMoney; - } - - /** - * Sets Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps change_back_money - */ - public function setChangeBackMoney(?Money $changeBackMoney): void - { - $this->changeBackMoney = $changeBackMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['seller_supplied_money'] = $this->sellerSuppliedMoney; - if (isset($this->changeBackMoney)) { - $json['change_back_money'] = $this->changeBackMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DestinationDetailsExternalRefundDetails.php b/src/Models/DestinationDetailsExternalRefundDetails.php deleted file mode 100644 index 636d4954..00000000 --- a/src/Models/DestinationDetailsExternalRefundDetails.php +++ /dev/null @@ -1,164 +0,0 @@ -type = $type; - $this->source = $source; - } - - /** - * Returns Type. - * The type of external refund the seller paid to the buyer. It can be one of the - * following: - * - CHECK - Refunded using a physical check. - * - BANK_TRANSFER - Refunded using external bank transfer. - * - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. - * - CRYPTO - Refunded using a crypto currency. - * - SQUARE_CASH - Refunded using Square Cash App. - * - SOCIAL - Refunded using peer-to-peer payment applications. - * - EXTERNAL - A third-party application gathered this refund outside of Square. - * - EMONEY - Refunded using an E-money provider. - * - CARD - A credit or debit card that Square does not support. - * - STORED_BALANCE - Use for house accounts, store credit, and so forth. - * - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals - * - OTHER - A type not listed here. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * The type of external refund the seller paid to the buyer. It can be one of the - * following: - * - CHECK - Refunded using a physical check. - * - BANK_TRANSFER - Refunded using external bank transfer. - * - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. - * - CRYPTO - Refunded using a crypto currency. - * - SQUARE_CASH - Refunded using Square Cash App. - * - SOCIAL - Refunded using peer-to-peer payment applications. - * - EXTERNAL - A third-party application gathered this refund outside of Square. - * - EMONEY - Refunded using an E-money provider. - * - CARD - A credit or debit card that Square does not support. - * - STORED_BALANCE - Use for house accounts, store credit, and so forth. - * - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals - * - OTHER - A type not listed here. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Source. - * A description of the external refund source. For example, - * "Food Delivery Service". - */ - public function getSource(): string - { - return $this->source; - } - - /** - * Sets Source. - * A description of the external refund source. For example, - * "Food Delivery Service". - * - * @required - * @maps source - */ - public function setSource(string $source): void - { - $this->source = $source; - } - - /** - * Returns Source Id. - * An ID to associate the refund to its originating source. - */ - public function getSourceId(): ?string - { - if (count($this->sourceId) == 0) { - return null; - } - return $this->sourceId['value']; - } - - /** - * Sets Source Id. - * An ID to associate the refund to its originating source. - * - * @maps source_id - */ - public function setSourceId(?string $sourceId): void - { - $this->sourceId['value'] = $sourceId; - } - - /** - * Unsets Source Id. - * An ID to associate the refund to its originating source. - */ - public function unsetSourceId(): void - { - $this->sourceId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['source'] = $this->source; - if (!empty($this->sourceId)) { - $json['source_id'] = $this->sourceId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DestinationType.php b/src/Models/DestinationType.php deleted file mode 100644 index a106ca42..00000000 --- a/src/Models/DestinationType.php +++ /dev/null @@ -1,28 +0,0 @@ -attributes = $attributes; - } - - /** - * Returns Id. - * A synthetic identifier for the device. The identifier includes a standardized prefix and - * is otherwise an opaque id generated from key device fields. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A synthetic identifier for the device. The identifier includes a standardized prefix and - * is otherwise an opaque id generated from key device fields. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Attributes. - */ - public function getAttributes(): DeviceAttributes - { - return $this->attributes; - } - - /** - * Sets Attributes. - * - * @required - * @maps attributes - */ - public function setAttributes(DeviceAttributes $attributes): void - { - $this->attributes = $attributes; - } - - /** - * Returns Components. - * A list of components applicable to the device. - * - * @return Component[]|null - */ - public function getComponents(): ?array - { - if (count($this->components) == 0) { - return null; - } - return $this->components['value']; - } - - /** - * Sets Components. - * A list of components applicable to the device. - * - * @maps components - * - * @param Component[]|null $components - */ - public function setComponents(?array $components): void - { - $this->components['value'] = $components; - } - - /** - * Unsets Components. - * A list of components applicable to the device. - */ - public function unsetComponents(): void - { - $this->components = []; - } - - /** - * Returns Status. - */ - public function getStatus(): ?DeviceStatus - { - return $this->status; - } - - /** - * Sets Status. - * - * @maps status - */ - public function setStatus(?DeviceStatus $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['attributes'] = $this->attributes; - if (!empty($this->components)) { - $json['components'] = $this->components['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceAttributes.php b/src/Models/DeviceAttributes.php deleted file mode 100644 index 29bbc8dd..00000000 --- a/src/Models/DeviceAttributes.php +++ /dev/null @@ -1,311 +0,0 @@ -manufacturer = $manufacturer; - } - - /** - * Returns Type. - * An enum identifier of the device type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * An enum identifier of the device type. - * - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Manufacturer. - * The maker of the device. - */ - public function getManufacturer(): string - { - return $this->manufacturer; - } - - /** - * Sets Manufacturer. - * The maker of the device. - * - * @required - * @maps manufacturer - */ - public function setManufacturer(string $manufacturer): void - { - $this->manufacturer = $manufacturer; - } - - /** - * Returns Model. - * The specific model of the device. - */ - public function getModel(): ?string - { - if (count($this->model) == 0) { - return null; - } - return $this->model['value']; - } - - /** - * Sets Model. - * The specific model of the device. - * - * @maps model - */ - public function setModel(?string $model): void - { - $this->model['value'] = $model; - } - - /** - * Unsets Model. - * The specific model of the device. - */ - public function unsetModel(): void - { - $this->model = []; - } - - /** - * Returns Name. - * A seller-specified name for the device. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * A seller-specified name for the device. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * A seller-specified name for the device. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Manufacturers Id. - * The manufacturer-supplied identifier for the device (where available). In many cases, - * this identifier will be a serial number. - */ - public function getManufacturersId(): ?string - { - if (count($this->manufacturersId) == 0) { - return null; - } - return $this->manufacturersId['value']; - } - - /** - * Sets Manufacturers Id. - * The manufacturer-supplied identifier for the device (where available). In many cases, - * this identifier will be a serial number. - * - * @maps manufacturers_id - */ - public function setManufacturersId(?string $manufacturersId): void - { - $this->manufacturersId['value'] = $manufacturersId; - } - - /** - * Unsets Manufacturers Id. - * The manufacturer-supplied identifier for the device (where available). In many cases, - * this identifier will be a serial number. - */ - public function unsetManufacturersId(): void - { - $this->manufacturersId = []; - } - - /** - * Returns Updated At. - * The RFC 3339-formatted value of the most recent update to the device information. - * (Could represent any field update on the device.) - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The RFC 3339-formatted value of the most recent update to the device information. - * (Could represent any field update on the device.) - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Version. - * The current version of software installed on the device. - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * Sets Version. - * The current version of software installed on the device. - * - * @maps version - */ - public function setVersion(?string $version): void - { - $this->version = $version; - } - - /** - * Returns Merchant Token. - * The merchant_token identifying the merchant controlling the device. - */ - public function getMerchantToken(): ?string - { - if (count($this->merchantToken) == 0) { - return null; - } - return $this->merchantToken['value']; - } - - /** - * Sets Merchant Token. - * The merchant_token identifying the merchant controlling the device. - * - * @maps merchant_token - */ - public function setMerchantToken(?string $merchantToken): void - { - $this->merchantToken['value'] = $merchantToken; - } - - /** - * Unsets Merchant Token. - * The merchant_token identifying the merchant controlling the device. - */ - public function unsetMerchantToken(): void - { - $this->merchantToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['manufacturer'] = $this->manufacturer; - if (!empty($this->model)) { - $json['model'] = $this->model['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->manufacturersId)) { - $json['manufacturers_id'] = $this->manufacturersId['value']; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->merchantToken)) { - $json['merchant_token'] = $this->merchantToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceAttributesDeviceType.php b/src/Models/DeviceAttributesDeviceType.php deleted file mode 100644 index e70481f7..00000000 --- a/src/Models/DeviceAttributesDeviceType.php +++ /dev/null @@ -1,13 +0,0 @@ -deviceId = $deviceId; - } - - /** - * Returns Device Id. - * The unique ID of the device intended for this `TerminalCheckout`. - * A list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint. - * Match a `DeviceCode.device_id` value with `device_id` to get the associated device code. - */ - public function getDeviceId(): string - { - return $this->deviceId; - } - - /** - * Sets Device Id. - * The unique ID of the device intended for this `TerminalCheckout`. - * A list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint. - * Match a `DeviceCode.device_id` value with `device_id` to get the associated device code. - * - * @required - * @maps device_id - */ - public function setDeviceId(string $deviceId): void - { - $this->deviceId = $deviceId; - } - - /** - * Returns Skip Receipt Screen. - * Instructs the device to skip the receipt screen. Defaults to false. - */ - public function getSkipReceiptScreen(): ?bool - { - if (count($this->skipReceiptScreen) == 0) { - return null; - } - return $this->skipReceiptScreen['value']; - } - - /** - * Sets Skip Receipt Screen. - * Instructs the device to skip the receipt screen. Defaults to false. - * - * @maps skip_receipt_screen - */ - public function setSkipReceiptScreen(?bool $skipReceiptScreen): void - { - $this->skipReceiptScreen['value'] = $skipReceiptScreen; - } - - /** - * Unsets Skip Receipt Screen. - * Instructs the device to skip the receipt screen. Defaults to false. - */ - public function unsetSkipReceiptScreen(): void - { - $this->skipReceiptScreen = []; - } - - /** - * Returns Collect Signature. - * Indicates that signature collection is desired during checkout. Defaults to false. - */ - public function getCollectSignature(): ?bool - { - if (count($this->collectSignature) == 0) { - return null; - } - return $this->collectSignature['value']; - } - - /** - * Sets Collect Signature. - * Indicates that signature collection is desired during checkout. Defaults to false. - * - * @maps collect_signature - */ - public function setCollectSignature(?bool $collectSignature): void - { - $this->collectSignature['value'] = $collectSignature; - } - - /** - * Unsets Collect Signature. - * Indicates that signature collection is desired during checkout. Defaults to false. - */ - public function unsetCollectSignature(): void - { - $this->collectSignature = []; - } - - /** - * Returns Tip Settings. - */ - public function getTipSettings(): ?TipSettings - { - return $this->tipSettings; - } - - /** - * Sets Tip Settings. - * - * @maps tip_settings - */ - public function setTipSettings(?TipSettings $tipSettings): void - { - $this->tipSettings = $tipSettings; - } - - /** - * Returns Show Itemized Cart. - * Show the itemization screen prior to taking a payment. This field is only meaningful when the - * checkout includes an order ID. Defaults to true. - */ - public function getShowItemizedCart(): ?bool - { - if (count($this->showItemizedCart) == 0) { - return null; - } - return $this->showItemizedCart['value']; - } - - /** - * Sets Show Itemized Cart. - * Show the itemization screen prior to taking a payment. This field is only meaningful when the - * checkout includes an order ID. Defaults to true. - * - * @maps show_itemized_cart - */ - public function setShowItemizedCart(?bool $showItemizedCart): void - { - $this->showItemizedCart['value'] = $showItemizedCart; - } - - /** - * Unsets Show Itemized Cart. - * Show the itemization screen prior to taking a payment. This field is only meaningful when the - * checkout includes an order ID. Defaults to true. - */ - public function unsetShowItemizedCart(): void - { - $this->showItemizedCart = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['device_id'] = $this->deviceId; - if (!empty($this->skipReceiptScreen)) { - $json['skip_receipt_screen'] = $this->skipReceiptScreen['value']; - } - if (!empty($this->collectSignature)) { - $json['collect_signature'] = $this->collectSignature['value']; - } - if (isset($this->tipSettings)) { - $json['tip_settings'] = $this->tipSettings; - } - if (!empty($this->showItemizedCart)) { - $json['show_itemized_cart'] = $this->showItemizedCart['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceCode.php b/src/Models/DeviceCode.php deleted file mode 100644 index b9724dd9..00000000 --- a/src/Models/DeviceCode.php +++ /dev/null @@ -1,357 +0,0 @@ -id; - } - - /** - * Sets Id. - * The unique id for this device code. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * An optional user-defined name for the device code. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * An optional user-defined name for the device code. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * An optional user-defined name for the device code. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Code. - * The unique code that can be used to login. - */ - public function getCode(): ?string - { - return $this->code; - } - - /** - * Sets Code. - * The unique code that can be used to login. - * - * @maps code - */ - public function setCode(?string $code): void - { - $this->code = $code; - } - - /** - * Returns Device Id. - * The unique id of the device that used this code. Populated when the device is paired up. - */ - public function getDeviceId(): ?string - { - return $this->deviceId; - } - - /** - * Sets Device Id. - * The unique id of the device that used this code. Populated when the device is paired up. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId = $deviceId; - } - - /** - * Returns Product Type. - */ - public function getProductType(): string - { - return $this->productType; - } - - /** - * Sets Product Type. - * - * @maps product_type - */ - public function setProductType(string $productType): void - { - $this->productType = $productType; - } - - /** - * Returns Location Id. - * The location assigned to this code. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location assigned to this code. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location assigned to this code. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Status. - * DeviceCode.Status enum. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * DeviceCode.Status enum. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Pair By. - * When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. - */ - public function getPairBy(): ?string - { - return $this->pairBy; - } - - /** - * Sets Pair By. - * When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. - * - * @maps pair_by - */ - public function setPairBy(?string $pairBy): void - { - $this->pairBy = $pairBy; - } - - /** - * Returns Created At. - * When this DeviceCode was created. Timestamp in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * When this DeviceCode was created. Timestamp in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Status Changed At. - * When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. - */ - public function getStatusChangedAt(): ?string - { - return $this->statusChangedAt; - } - - /** - * Sets Status Changed At. - * When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. - * - * @maps status_changed_at - */ - public function setStatusChangedAt(?string $statusChangedAt): void - { - $this->statusChangedAt = $statusChangedAt; - } - - /** - * Returns Paired At. - * When this DeviceCode was paired. Timestamp in RFC 3339 format. - */ - public function getPairedAt(): ?string - { - return $this->pairedAt; - } - - /** - * Sets Paired At. - * When this DeviceCode was paired. Timestamp in RFC 3339 format. - * - * @maps paired_at - */ - public function setPairedAt(?string $pairedAt): void - { - $this->pairedAt = $pairedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->code)) { - $json['code'] = $this->code; - } - if (isset($this->deviceId)) { - $json['device_id'] = $this->deviceId; - } - $json['product_type'] = $this->productType; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->pairBy)) { - $json['pair_by'] = $this->pairBy; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->statusChangedAt)) { - $json['status_changed_at'] = $this->statusChangedAt; - } - if (isset($this->pairedAt)) { - $json['paired_at'] = $this->pairedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceCodeStatus.php b/src/Models/DeviceCodeStatus.php deleted file mode 100644 index 69344f8b..00000000 --- a/src/Models/DeviceCodeStatus.php +++ /dev/null @@ -1,31 +0,0 @@ -applicationType; - } - - /** - * Sets Application Type. - * - * @maps application_type - */ - public function setApplicationType(?string $applicationType): void - { - $this->applicationType = $applicationType; - } - - /** - * Returns Version. - * The version of the application. - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * Sets Version. - * The version of the application. - * - * @maps version - */ - public function setVersion(?string $version): void - { - $this->version = $version; - } - - /** - * Returns Session Location. - * The location_id of the session for the application. - */ - public function getSessionLocation(): ?string - { - if (count($this->sessionLocation) == 0) { - return null; - } - return $this->sessionLocation['value']; - } - - /** - * Sets Session Location. - * The location_id of the session for the application. - * - * @maps session_location - */ - public function setSessionLocation(?string $sessionLocation): void - { - $this->sessionLocation['value'] = $sessionLocation; - } - - /** - * Unsets Session Location. - * The location_id of the session for the application. - */ - public function unsetSessionLocation(): void - { - $this->sessionLocation = []; - } - - /** - * Returns Device Code Id. - * The id of the device code that was used to log in to the device. - */ - public function getDeviceCodeId(): ?string - { - if (count($this->deviceCodeId) == 0) { - return null; - } - return $this->deviceCodeId['value']; - } - - /** - * Sets Device Code Id. - * The id of the device code that was used to log in to the device. - * - * @maps device_code_id - */ - public function setDeviceCodeId(?string $deviceCodeId): void - { - $this->deviceCodeId['value'] = $deviceCodeId; - } - - /** - * Unsets Device Code Id. - * The id of the device code that was used to log in to the device. - */ - public function unsetDeviceCodeId(): void - { - $this->deviceCodeId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->applicationType)) { - $json['application_type'] = $this->applicationType; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->sessionLocation)) { - $json['session_location'] = $this->sessionLocation['value']; - } - if (!empty($this->deviceCodeId)) { - $json['device_code_id'] = $this->deviceCodeId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsBatteryDetails.php b/src/Models/DeviceComponentDetailsBatteryDetails.php deleted file mode 100644 index e33651da..00000000 --- a/src/Models/DeviceComponentDetailsBatteryDetails.php +++ /dev/null @@ -1,97 +0,0 @@ -visiblePercent) == 0) { - return null; - } - return $this->visiblePercent['value']; - } - - /** - * Sets Visible Percent. - * The battery charge percentage as displayed on the device. - * - * @maps visible_percent - */ - public function setVisiblePercent(?int $visiblePercent): void - { - $this->visiblePercent['value'] = $visiblePercent; - } - - /** - * Unsets Visible Percent. - * The battery charge percentage as displayed on the device. - */ - public function unsetVisiblePercent(): void - { - $this->visiblePercent = []; - } - - /** - * Returns External Power. - * An enum for ExternalPower. - */ - public function getExternalPower(): ?string - { - return $this->externalPower; - } - - /** - * Sets External Power. - * An enum for ExternalPower. - * - * @maps external_power - */ - public function setExternalPower(?string $externalPower): void - { - $this->externalPower = $externalPower; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->visiblePercent)) { - $json['visible_percent'] = $this->visiblePercent['value']; - } - if (isset($this->externalPower)) { - $json['external_power'] = $this->externalPower; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsCardReaderDetails.php b/src/Models/DeviceComponentDetailsCardReaderDetails.php deleted file mode 100644 index 92a7beaa..00000000 --- a/src/Models/DeviceComponentDetailsCardReaderDetails.php +++ /dev/null @@ -1,57 +0,0 @@ -version; - } - - /** - * Sets Version. - * The version of the card reader. - * - * @maps version - */ - public function setVersion(?string $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsEthernetDetails.php b/src/Models/DeviceComponentDetailsEthernetDetails.php deleted file mode 100644 index fa266e0e..00000000 --- a/src/Models/DeviceComponentDetailsEthernetDetails.php +++ /dev/null @@ -1,109 +0,0 @@ -active) == 0) { - return null; - } - return $this->active['value']; - } - - /** - * Sets Active. - * A boolean to represent whether the Ethernet interface is currently active. - * - * @maps active - */ - public function setActive(?bool $active): void - { - $this->active['value'] = $active; - } - - /** - * Unsets Active. - * A boolean to represent whether the Ethernet interface is currently active. - */ - public function unsetActive(): void - { - $this->active = []; - } - - /** - * Returns Ip Address V4. - * The string representation of the device’s IPv4 address. - */ - public function getIpAddressV4(): ?string - { - if (count($this->ipAddressV4) == 0) { - return null; - } - return $this->ipAddressV4['value']; - } - - /** - * Sets Ip Address V4. - * The string representation of the device’s IPv4 address. - * - * @maps ip_address_v4 - */ - public function setIpAddressV4(?string $ipAddressV4): void - { - $this->ipAddressV4['value'] = $ipAddressV4; - } - - /** - * Unsets Ip Address V4. - * The string representation of the device’s IPv4 address. - */ - public function unsetIpAddressV4(): void - { - $this->ipAddressV4 = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->active)) { - $json['active'] = $this->active['value']; - } - if (!empty($this->ipAddressV4)) { - $json['ip_address_v4'] = $this->ipAddressV4['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsExternalPower.php b/src/Models/DeviceComponentDetailsExternalPower.php deleted file mode 100644 index a5995bbc..00000000 --- a/src/Models/DeviceComponentDetailsExternalPower.php +++ /dev/null @@ -1,31 +0,0 @@ -value) == 0) { - return null; - } - return $this->value['value']; - } - - /** - * Sets Value. - * - * @maps value - */ - public function setValue(?int $value): void - { - $this->value['value'] = $value; - } - - /** - * Unsets Value. - */ - public function unsetValue(): void - { - $this->value = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->value)) { - $json['value'] = $this->value['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsNetworkInterfaceDetails.php b/src/Models/DeviceComponentDetailsNetworkInterfaceDetails.php deleted file mode 100644 index 0655d54c..00000000 --- a/src/Models/DeviceComponentDetailsNetworkInterfaceDetails.php +++ /dev/null @@ -1,69 +0,0 @@ -ipAddressV4) == 0) { - return null; - } - return $this->ipAddressV4['value']; - } - - /** - * Sets Ip Address V4. - * The string representation of the device’s IPv4 address. - * - * @maps ip_address_v4 - */ - public function setIpAddressV4(?string $ipAddressV4): void - { - $this->ipAddressV4['value'] = $ipAddressV4; - } - - /** - * Unsets Ip Address V4. - * The string representation of the device’s IPv4 address. - */ - public function unsetIpAddressV4(): void - { - $this->ipAddressV4 = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->ipAddressV4)) { - $json['ip_address_v4'] = $this->ipAddressV4['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceComponentDetailsWiFiDetails.php b/src/Models/DeviceComponentDetailsWiFiDetails.php deleted file mode 100644 index 04713da0..00000000 --- a/src/Models/DeviceComponentDetailsWiFiDetails.php +++ /dev/null @@ -1,220 +0,0 @@ -active) == 0) { - return null; - } - return $this->active['value']; - } - - /** - * Sets Active. - * A boolean to represent whether the WiFI interface is currently active. - * - * @maps active - */ - public function setActive(?bool $active): void - { - $this->active['value'] = $active; - } - - /** - * Unsets Active. - * A boolean to represent whether the WiFI interface is currently active. - */ - public function unsetActive(): void - { - $this->active = []; - } - - /** - * Returns Ssid. - * The name of the connected WIFI network. - */ - public function getSsid(): ?string - { - if (count($this->ssid) == 0) { - return null; - } - return $this->ssid['value']; - } - - /** - * Sets Ssid. - * The name of the connected WIFI network. - * - * @maps ssid - */ - public function setSsid(?string $ssid): void - { - $this->ssid['value'] = $ssid; - } - - /** - * Unsets Ssid. - * The name of the connected WIFI network. - */ - public function unsetSsid(): void - { - $this->ssid = []; - } - - /** - * Returns Ip Address V4. - * The string representation of the device’s IPv4 address. - */ - public function getIpAddressV4(): ?string - { - if (count($this->ipAddressV4) == 0) { - return null; - } - return $this->ipAddressV4['value']; - } - - /** - * Sets Ip Address V4. - * The string representation of the device’s IPv4 address. - * - * @maps ip_address_v4 - */ - public function setIpAddressV4(?string $ipAddressV4): void - { - $this->ipAddressV4['value'] = $ipAddressV4; - } - - /** - * Unsets Ip Address V4. - * The string representation of the device’s IPv4 address. - */ - public function unsetIpAddressV4(): void - { - $this->ipAddressV4 = []; - } - - /** - * Returns Secure Connection. - * The security protocol for a secure connection (e.g. WPA2). None provided if the connection - * is unsecured. - */ - public function getSecureConnection(): ?string - { - if (count($this->secureConnection) == 0) { - return null; - } - return $this->secureConnection['value']; - } - - /** - * Sets Secure Connection. - * The security protocol for a secure connection (e.g. WPA2). None provided if the connection - * is unsecured. - * - * @maps secure_connection - */ - public function setSecureConnection(?string $secureConnection): void - { - $this->secureConnection['value'] = $secureConnection; - } - - /** - * Unsets Secure Connection. - * The security protocol for a secure connection (e.g. WPA2). None provided if the connection - * is unsecured. - */ - public function unsetSecureConnection(): void - { - $this->secureConnection = []; - } - - /** - * Returns Signal Strength. - * A value qualified by unit of measure. - */ - public function getSignalStrength(): ?DeviceComponentDetailsMeasurement - { - return $this->signalStrength; - } - - /** - * Sets Signal Strength. - * A value qualified by unit of measure. - * - * @maps signal_strength - */ - public function setSignalStrength(?DeviceComponentDetailsMeasurement $signalStrength): void - { - $this->signalStrength = $signalStrength; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->active)) { - $json['active'] = $this->active['value']; - } - if (!empty($this->ssid)) { - $json['ssid'] = $this->ssid['value']; - } - if (!empty($this->ipAddressV4)) { - $json['ip_address_v4'] = $this->ipAddressV4['value']; - } - if (!empty($this->secureConnection)) { - $json['secure_connection'] = $this->secureConnection['value']; - } - if (isset($this->signalStrength)) { - $json['signal_strength'] = $this->signalStrength; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceDetails.php b/src/Models/DeviceDetails.php deleted file mode 100644 index dab5b86e..00000000 --- a/src/Models/DeviceDetails.php +++ /dev/null @@ -1,152 +0,0 @@ -deviceId) == 0) { - return null; - } - return $this->deviceId['value']; - } - - /** - * Sets Device Id. - * The Square-issued ID of the device. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId['value'] = $deviceId; - } - - /** - * Unsets Device Id. - * The Square-issued ID of the device. - */ - public function unsetDeviceId(): void - { - $this->deviceId = []; - } - - /** - * Returns Device Installation Id. - * The Square-issued installation ID for the device. - */ - public function getDeviceInstallationId(): ?string - { - if (count($this->deviceInstallationId) == 0) { - return null; - } - return $this->deviceInstallationId['value']; - } - - /** - * Sets Device Installation Id. - * The Square-issued installation ID for the device. - * - * @maps device_installation_id - */ - public function setDeviceInstallationId(?string $deviceInstallationId): void - { - $this->deviceInstallationId['value'] = $deviceInstallationId; - } - - /** - * Unsets Device Installation Id. - * The Square-issued installation ID for the device. - */ - public function unsetDeviceInstallationId(): void - { - $this->deviceInstallationId = []; - } - - /** - * Returns Device Name. - * The name of the device set by the seller. - */ - public function getDeviceName(): ?string - { - if (count($this->deviceName) == 0) { - return null; - } - return $this->deviceName['value']; - } - - /** - * Sets Device Name. - * The name of the device set by the seller. - * - * @maps device_name - */ - public function setDeviceName(?string $deviceName): void - { - $this->deviceName['value'] = $deviceName; - } - - /** - * Unsets Device Name. - * The name of the device set by the seller. - */ - public function unsetDeviceName(): void - { - $this->deviceName = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; - } - if (!empty($this->deviceInstallationId)) { - $json['device_installation_id'] = $this->deviceInstallationId['value']; - } - if (!empty($this->deviceName)) { - $json['device_name'] = $this->deviceName['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceMetadata.php b/src/Models/DeviceMetadata.php deleted file mode 100644 index bf903e47..00000000 --- a/src/Models/DeviceMetadata.php +++ /dev/null @@ -1,521 +0,0 @@ -batteryPercentage) == 0) { - return null; - } - return $this->batteryPercentage['value']; - } - - /** - * Sets Battery Percentage. - * The Terminal’s remaining battery percentage, between 1-100. - * - * @maps battery_percentage - */ - public function setBatteryPercentage(?string $batteryPercentage): void - { - $this->batteryPercentage['value'] = $batteryPercentage; - } - - /** - * Unsets Battery Percentage. - * The Terminal’s remaining battery percentage, between 1-100. - */ - public function unsetBatteryPercentage(): void - { - $this->batteryPercentage = []; - } - - /** - * Returns Charging State. - * The current charging state of the Terminal. - * Options: `CHARGING`, `NOT_CHARGING` - */ - public function getChargingState(): ?string - { - if (count($this->chargingState) == 0) { - return null; - } - return $this->chargingState['value']; - } - - /** - * Sets Charging State. - * The current charging state of the Terminal. - * Options: `CHARGING`, `NOT_CHARGING` - * - * @maps charging_state - */ - public function setChargingState(?string $chargingState): void - { - $this->chargingState['value'] = $chargingState; - } - - /** - * Unsets Charging State. - * The current charging state of the Terminal. - * Options: `CHARGING`, `NOT_CHARGING` - */ - public function unsetChargingState(): void - { - $this->chargingState = []; - } - - /** - * Returns Location Id. - * The ID of the Square seller business location associated with the Terminal. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the Square seller business location associated with the Terminal. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the Square seller business location associated with the Terminal. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Merchant Id. - * The ID of the Square merchant account that is currently signed-in to the Terminal. - */ - public function getMerchantId(): ?string - { - if (count($this->merchantId) == 0) { - return null; - } - return $this->merchantId['value']; - } - - /** - * Sets Merchant Id. - * The ID of the Square merchant account that is currently signed-in to the Terminal. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId['value'] = $merchantId; - } - - /** - * Unsets Merchant Id. - * The ID of the Square merchant account that is currently signed-in to the Terminal. - */ - public function unsetMerchantId(): void - { - $this->merchantId = []; - } - - /** - * Returns Network Connection Type. - * The Terminal’s current network connection type. - * Options: `WIFI`, `ETHERNET` - */ - public function getNetworkConnectionType(): ?string - { - if (count($this->networkConnectionType) == 0) { - return null; - } - return $this->networkConnectionType['value']; - } - - /** - * Sets Network Connection Type. - * The Terminal’s current network connection type. - * Options: `WIFI`, `ETHERNET` - * - * @maps network_connection_type - */ - public function setNetworkConnectionType(?string $networkConnectionType): void - { - $this->networkConnectionType['value'] = $networkConnectionType; - } - - /** - * Unsets Network Connection Type. - * The Terminal’s current network connection type. - * Options: `WIFI`, `ETHERNET` - */ - public function unsetNetworkConnectionType(): void - { - $this->networkConnectionType = []; - } - - /** - * Returns Payment Region. - * The country in which the Terminal is authorized to take payments. - */ - public function getPaymentRegion(): ?string - { - if (count($this->paymentRegion) == 0) { - return null; - } - return $this->paymentRegion['value']; - } - - /** - * Sets Payment Region. - * The country in which the Terminal is authorized to take payments. - * - * @maps payment_region - */ - public function setPaymentRegion(?string $paymentRegion): void - { - $this->paymentRegion['value'] = $paymentRegion; - } - - /** - * Unsets Payment Region. - * The country in which the Terminal is authorized to take payments. - */ - public function unsetPaymentRegion(): void - { - $this->paymentRegion = []; - } - - /** - * Returns Serial Number. - * The unique identifier assigned to the Terminal, which can be found on the lower back - * of the device. - */ - public function getSerialNumber(): ?string - { - if (count($this->serialNumber) == 0) { - return null; - } - return $this->serialNumber['value']; - } - - /** - * Sets Serial Number. - * The unique identifier assigned to the Terminal, which can be found on the lower back - * of the device. - * - * @maps serial_number - */ - public function setSerialNumber(?string $serialNumber): void - { - $this->serialNumber['value'] = $serialNumber; - } - - /** - * Unsets Serial Number. - * The unique identifier assigned to the Terminal, which can be found on the lower back - * of the device. - */ - public function unsetSerialNumber(): void - { - $this->serialNumber = []; - } - - /** - * Returns Os Version. - * The current version of the Terminal’s operating system. - */ - public function getOsVersion(): ?string - { - if (count($this->osVersion) == 0) { - return null; - } - return $this->osVersion['value']; - } - - /** - * Sets Os Version. - * The current version of the Terminal’s operating system. - * - * @maps os_version - */ - public function setOsVersion(?string $osVersion): void - { - $this->osVersion['value'] = $osVersion; - } - - /** - * Unsets Os Version. - * The current version of the Terminal’s operating system. - */ - public function unsetOsVersion(): void - { - $this->osVersion = []; - } - - /** - * Returns App Version. - * The current version of the application running on the Terminal. - */ - public function getAppVersion(): ?string - { - if (count($this->appVersion) == 0) { - return null; - } - return $this->appVersion['value']; - } - - /** - * Sets App Version. - * The current version of the application running on the Terminal. - * - * @maps app_version - */ - public function setAppVersion(?string $appVersion): void - { - $this->appVersion['value'] = $appVersion; - } - - /** - * Unsets App Version. - * The current version of the application running on the Terminal. - */ - public function unsetAppVersion(): void - { - $this->appVersion = []; - } - - /** - * Returns Wifi Network Name. - * The name of the Wi-Fi network to which the Terminal is connected. - */ - public function getWifiNetworkName(): ?string - { - if (count($this->wifiNetworkName) == 0) { - return null; - } - return $this->wifiNetworkName['value']; - } - - /** - * Sets Wifi Network Name. - * The name of the Wi-Fi network to which the Terminal is connected. - * - * @maps wifi_network_name - */ - public function setWifiNetworkName(?string $wifiNetworkName): void - { - $this->wifiNetworkName['value'] = $wifiNetworkName; - } - - /** - * Unsets Wifi Network Name. - * The name of the Wi-Fi network to which the Terminal is connected. - */ - public function unsetWifiNetworkName(): void - { - $this->wifiNetworkName = []; - } - - /** - * Returns Wifi Network Strength. - * The signal strength of the Wi-FI network connection. - * Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` - */ - public function getWifiNetworkStrength(): ?string - { - if (count($this->wifiNetworkStrength) == 0) { - return null; - } - return $this->wifiNetworkStrength['value']; - } - - /** - * Sets Wifi Network Strength. - * The signal strength of the Wi-FI network connection. - * Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` - * - * @maps wifi_network_strength - */ - public function setWifiNetworkStrength(?string $wifiNetworkStrength): void - { - $this->wifiNetworkStrength['value'] = $wifiNetworkStrength; - } - - /** - * Unsets Wifi Network Strength. - * The signal strength of the Wi-FI network connection. - * Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` - */ - public function unsetWifiNetworkStrength(): void - { - $this->wifiNetworkStrength = []; - } - - /** - * Returns Ip Address. - * The IP address of the Terminal. - */ - public function getIpAddress(): ?string - { - if (count($this->ipAddress) == 0) { - return null; - } - return $this->ipAddress['value']; - } - - /** - * Sets Ip Address. - * The IP address of the Terminal. - * - * @maps ip_address - */ - public function setIpAddress(?string $ipAddress): void - { - $this->ipAddress['value'] = $ipAddress; - } - - /** - * Unsets Ip Address. - * The IP address of the Terminal. - */ - public function unsetIpAddress(): void - { - $this->ipAddress = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->batteryPercentage)) { - $json['battery_percentage'] = $this->batteryPercentage['value']; - } - if (!empty($this->chargingState)) { - $json['charging_state'] = $this->chargingState['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->merchantId)) { - $json['merchant_id'] = $this->merchantId['value']; - } - if (!empty($this->networkConnectionType)) { - $json['network_connection_type'] = $this->networkConnectionType['value']; - } - if (!empty($this->paymentRegion)) { - $json['payment_region'] = $this->paymentRegion['value']; - } - if (!empty($this->serialNumber)) { - $json['serial_number'] = $this->serialNumber['value']; - } - if (!empty($this->osVersion)) { - $json['os_version'] = $this->osVersion['value']; - } - if (!empty($this->appVersion)) { - $json['app_version'] = $this->appVersion['value']; - } - if (!empty($this->wifiNetworkName)) { - $json['wifi_network_name'] = $this->wifiNetworkName['value']; - } - if (!empty($this->wifiNetworkStrength)) { - $json['wifi_network_strength'] = $this->wifiNetworkStrength['value']; - } - if (!empty($this->ipAddress)) { - $json['ip_address'] = $this->ipAddress['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceStatus.php b/src/Models/DeviceStatus.php deleted file mode 100644 index c1796aff..00000000 --- a/src/Models/DeviceStatus.php +++ /dev/null @@ -1,55 +0,0 @@ -category; - } - - /** - * Sets Category. - * - * @maps category - */ - public function setCategory(?string $category): void - { - $this->category = $category; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->category)) { - $json['category'] = $this->category; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DeviceStatusCategory.php b/src/Models/DeviceStatusCategory.php deleted file mode 100644 index 363b770a..00000000 --- a/src/Models/DeviceStatusCategory.php +++ /dev/null @@ -1,14 +0,0 @@ -status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or - * `FAILED`. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or - * `FAILED`. - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Returns Brand. - * The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`, - * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`. - */ - public function getBrand(): ?string - { - if (count($this->brand) == 0) { - return null; - } - return $this->brand['value']; - } - - /** - * Sets Brand. - * The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`, - * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`. - * - * @maps brand - */ - public function setBrand(?string $brand): void - { - $this->brand['value'] = $brand; - } - - /** - * Unsets Brand. - * The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`, - * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`. - */ - public function unsetBrand(): void - { - $this->brand = []; - } - - /** - * Returns Cash App Details. - * Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. - */ - public function getCashAppDetails(): ?CashAppDetails - { - return $this->cashAppDetails; - } - - /** - * Sets Cash App Details. - * Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. - * - * @maps cash_app_details - */ - public function setCashAppDetails(?CashAppDetails $cashAppDetails): void - { - $this->cashAppDetails = $cashAppDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - if (!empty($this->brand)) { - $json['brand'] = $this->brand['value']; - } - if (isset($this->cashAppDetails)) { - $json['cash_app_details'] = $this->cashAppDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DisableCardResponse.php b/src/Models/DisableCardResponse.php deleted file mode 100644 index 177133fd..00000000 --- a/src/Models/DisableCardResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DisableEventsResponse.php b/src/Models/DisableEventsResponse.php deleted file mode 100644 index d075b0b9..00000000 --- a/src/Models/DisableEventsResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DismissTerminalActionResponse.php b/src/Models/DismissTerminalActionResponse.php deleted file mode 100644 index 94988a23..00000000 --- a/src/Models/DismissTerminalActionResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Action. - * Represents an action processed by the Square Terminal. - */ - public function getAction(): ?TerminalAction - { - return $this->action; - } - - /** - * Sets Action. - * Represents an action processed by the Square Terminal. - * - * @maps action - */ - public function setAction(?TerminalAction $action): void - { - $this->action = $action; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->action)) { - $json['action'] = $this->action; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DismissTerminalCheckoutResponse.php b/src/Models/DismissTerminalCheckoutResponse.php deleted file mode 100644 index f228aab8..00000000 --- a/src/Models/DismissTerminalCheckoutResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Checkout. - * Represents a checkout processed by the Square Terminal. - */ - public function getCheckout(): ?TerminalCheckout - { - return $this->checkout; - } - - /** - * Sets Checkout. - * Represents a checkout processed by the Square Terminal. - * - * @maps checkout - */ - public function setCheckout(?TerminalCheckout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->checkout)) { - $json['checkout'] = $this->checkout; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DismissTerminalRefundResponse.php b/src/Models/DismissTerminalRefundResponse.php deleted file mode 100644 index c7572313..00000000 --- a/src/Models/DismissTerminalRefundResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - */ - public function getRefund(): ?TerminalRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - * - * @maps refund - */ - public function setRefund(?TerminalRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Dispute.php b/src/Models/Dispute.php deleted file mode 100644 index 38c35201..00000000 --- a/src/Models/Dispute.php +++ /dev/null @@ -1,586 +0,0 @@ -disputeId) == 0) { - return null; - } - return $this->disputeId['value']; - } - - /** - * Sets Dispute Id. - * The unique ID for this `Dispute`, generated by Square. - * - * @maps dispute_id - */ - public function setDisputeId(?string $disputeId): void - { - $this->disputeId['value'] = $disputeId; - } - - /** - * Unsets Dispute Id. - * The unique ID for this `Dispute`, generated by Square. - */ - public function unsetDisputeId(): void - { - $this->disputeId = []; - } - - /** - * Returns Id. - * The unique ID for this `Dispute`, generated by Square. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The unique ID for this `Dispute`, generated by Square. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reason. - * The list of possible reasons why a cardholder might initiate a - * dispute with their bank. - */ - public function getReason(): ?string - { - return $this->reason; - } - - /** - * Sets Reason. - * The list of possible reasons why a cardholder might initiate a - * dispute with their bank. - * - * @maps reason - */ - public function setReason(?string $reason): void - { - $this->reason = $reason; - } - - /** - * Returns State. - * The list of possible dispute states. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The list of possible dispute states. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Due At. - * The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer. - * squareup.com/docs/build-basics/common-data-types/working-with-dates). - */ - public function getDueAt(): ?string - { - if (count($this->dueAt) == 0) { - return null; - } - return $this->dueAt['value']; - } - - /** - * Sets Due At. - * The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer. - * squareup.com/docs/build-basics/common-data-types/working-with-dates). - * - * @maps due_at - */ - public function setDueAt(?string $dueAt): void - { - $this->dueAt['value'] = $dueAt; - } - - /** - * Unsets Due At. - * The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer. - * squareup.com/docs/build-basics/common-data-types/working-with-dates). - */ - public function unsetDueAt(): void - { - $this->dueAt = []; - } - - /** - * Returns Disputed Payment. - * The payment the cardholder disputed. - */ - public function getDisputedPayment(): ?DisputedPayment - { - return $this->disputedPayment; - } - - /** - * Sets Disputed Payment. - * The payment the cardholder disputed. - * - * @maps disputed_payment - */ - public function setDisputedPayment(?DisputedPayment $disputedPayment): void - { - $this->disputedPayment = $disputedPayment; - } - - /** - * Returns Evidence Ids. - * The IDs of the evidence associated with the dispute. - * - * @return string[]|null - */ - public function getEvidenceIds(): ?array - { - if (count($this->evidenceIds) == 0) { - return null; - } - return $this->evidenceIds['value']; - } - - /** - * Sets Evidence Ids. - * The IDs of the evidence associated with the dispute. - * - * @maps evidence_ids - * - * @param string[]|null $evidenceIds - */ - public function setEvidenceIds(?array $evidenceIds): void - { - $this->evidenceIds['value'] = $evidenceIds; - } - - /** - * Unsets Evidence Ids. - * The IDs of the evidence associated with the dispute. - */ - public function unsetEvidenceIds(): void - { - $this->evidenceIds = []; - } - - /** - * Returns Card Brand. - * Indicates a card's brand, such as `VISA` or `MASTERCARD`. - */ - public function getCardBrand(): ?string - { - return $this->cardBrand; - } - - /** - * Sets Card Brand. - * Indicates a card's brand, such as `VISA` or `MASTERCARD`. - * - * @maps card_brand - */ - public function setCardBrand(?string $cardBrand): void - { - $this->cardBrand = $cardBrand; - } - - /** - * Returns Created At. - * The timestamp when the dispute was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the dispute was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the dispute was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the dispute was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Brand Dispute Id. - * The ID of the dispute in the card brand system, generated by the card brand. - */ - public function getBrandDisputeId(): ?string - { - if (count($this->brandDisputeId) == 0) { - return null; - } - return $this->brandDisputeId['value']; - } - - /** - * Sets Brand Dispute Id. - * The ID of the dispute in the card brand system, generated by the card brand. - * - * @maps brand_dispute_id - */ - public function setBrandDisputeId(?string $brandDisputeId): void - { - $this->brandDisputeId['value'] = $brandDisputeId; - } - - /** - * Unsets Brand Dispute Id. - * The ID of the dispute in the card brand system, generated by the card brand. - */ - public function unsetBrandDisputeId(): void - { - $this->brandDisputeId = []; - } - - /** - * Returns Reported Date. - * The timestamp when the dispute was reported, in RFC 3339 format. - */ - public function getReportedDate(): ?string - { - if (count($this->reportedDate) == 0) { - return null; - } - return $this->reportedDate['value']; - } - - /** - * Sets Reported Date. - * The timestamp when the dispute was reported, in RFC 3339 format. - * - * @maps reported_date - */ - public function setReportedDate(?string $reportedDate): void - { - $this->reportedDate['value'] = $reportedDate; - } - - /** - * Unsets Reported Date. - * The timestamp when the dispute was reported, in RFC 3339 format. - */ - public function unsetReportedDate(): void - { - $this->reportedDate = []; - } - - /** - * Returns Reported At. - * The timestamp when the dispute was reported, in RFC 3339 format. - */ - public function getReportedAt(): ?string - { - if (count($this->reportedAt) == 0) { - return null; - } - return $this->reportedAt['value']; - } - - /** - * Sets Reported At. - * The timestamp when the dispute was reported, in RFC 3339 format. - * - * @maps reported_at - */ - public function setReportedAt(?string $reportedAt): void - { - $this->reportedAt['value'] = $reportedAt; - } - - /** - * Unsets Reported At. - * The timestamp when the dispute was reported, in RFC 3339 format. - */ - public function unsetReportedAt(): void - { - $this->reportedAt = []; - } - - /** - * Returns Version. - * The current version of the `Dispute`. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the `Dispute`. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The ID of the location where the dispute originated. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location where the dispute originated. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location where the dispute originated. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->disputeId)) { - $json['dispute_id'] = $this->disputeId['value']; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->reason)) { - $json['reason'] = $this->reason; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->dueAt)) { - $json['due_at'] = $this->dueAt['value']; - } - if (isset($this->disputedPayment)) { - $json['disputed_payment'] = $this->disputedPayment; - } - if (!empty($this->evidenceIds)) { - $json['evidence_ids'] = $this->evidenceIds['value']; - } - if (isset($this->cardBrand)) { - $json['card_brand'] = $this->cardBrand; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->brandDisputeId)) { - $json['brand_dispute_id'] = $this->brandDisputeId['value']; - } - if (!empty($this->reportedDate)) { - $json['reported_date'] = $this->reportedDate['value']; - } - if (!empty($this->reportedAt)) { - $json['reported_at'] = $this->reportedAt['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DisputeEvidence.php b/src/Models/DisputeEvidence.php deleted file mode 100644 index 3105efa7..00000000 --- a/src/Models/DisputeEvidence.php +++ /dev/null @@ -1,273 +0,0 @@ -evidenceId) == 0) { - return null; - } - return $this->evidenceId['value']; - } - - /** - * Sets Evidence Id. - * The Square-generated ID of the evidence. - * - * @maps evidence_id - */ - public function setEvidenceId(?string $evidenceId): void - { - $this->evidenceId['value'] = $evidenceId; - } - - /** - * Unsets Evidence Id. - * The Square-generated ID of the evidence. - */ - public function unsetEvidenceId(): void - { - $this->evidenceId = []; - } - - /** - * Returns Id. - * The Square-generated ID of the evidence. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-generated ID of the evidence. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Dispute Id. - * The ID of the dispute the evidence is associated with. - */ - public function getDisputeId(): ?string - { - if (count($this->disputeId) == 0) { - return null; - } - return $this->disputeId['value']; - } - - /** - * Sets Dispute Id. - * The ID of the dispute the evidence is associated with. - * - * @maps dispute_id - */ - public function setDisputeId(?string $disputeId): void - { - $this->disputeId['value'] = $disputeId; - } - - /** - * Unsets Dispute Id. - * The ID of the dispute the evidence is associated with. - */ - public function unsetDisputeId(): void - { - $this->disputeId = []; - } - - /** - * Returns Evidence File. - * A file to be uploaded as dispute evidence. - */ - public function getEvidenceFile(): ?DisputeEvidenceFile - { - return $this->evidenceFile; - } - - /** - * Sets Evidence File. - * A file to be uploaded as dispute evidence. - * - * @maps evidence_file - */ - public function setEvidenceFile(?DisputeEvidenceFile $evidenceFile): void - { - $this->evidenceFile = $evidenceFile; - } - - /** - * Returns Evidence Text. - * Raw text - */ - public function getEvidenceText(): ?string - { - if (count($this->evidenceText) == 0) { - return null; - } - return $this->evidenceText['value']; - } - - /** - * Sets Evidence Text. - * Raw text - * - * @maps evidence_text - */ - public function setEvidenceText(?string $evidenceText): void - { - $this->evidenceText['value'] = $evidenceText; - } - - /** - * Unsets Evidence Text. - * Raw text - */ - public function unsetEvidenceText(): void - { - $this->evidenceText = []; - } - - /** - * Returns Uploaded At. - * The time when the evidence was uploaded, in RFC 3339 format. - */ - public function getUploadedAt(): ?string - { - if (count($this->uploadedAt) == 0) { - return null; - } - return $this->uploadedAt['value']; - } - - /** - * Sets Uploaded At. - * The time when the evidence was uploaded, in RFC 3339 format. - * - * @maps uploaded_at - */ - public function setUploadedAt(?string $uploadedAt): void - { - $this->uploadedAt['value'] = $uploadedAt; - } - - /** - * Unsets Uploaded At. - * The time when the evidence was uploaded, in RFC 3339 format. - */ - public function unsetUploadedAt(): void - { - $this->uploadedAt = []; - } - - /** - * Returns Evidence Type. - * The type of the dispute evidence. - */ - public function getEvidenceType(): ?string - { - return $this->evidenceType; - } - - /** - * Sets Evidence Type. - * The type of the dispute evidence. - * - * @maps evidence_type - */ - public function setEvidenceType(?string $evidenceType): void - { - $this->evidenceType = $evidenceType; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->evidenceId)) { - $json['evidence_id'] = $this->evidenceId['value']; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->disputeId)) { - $json['dispute_id'] = $this->disputeId['value']; - } - if (isset($this->evidenceFile)) { - $json['evidence_file'] = $this->evidenceFile; - } - if (!empty($this->evidenceText)) { - $json['evidence_text'] = $this->evidenceText['value']; - } - if (!empty($this->uploadedAt)) { - $json['uploaded_at'] = $this->uploadedAt['value']; - } - if (isset($this->evidenceType)) { - $json['evidence_type'] = $this->evidenceType; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DisputeEvidenceFile.php b/src/Models/DisputeEvidenceFile.php deleted file mode 100644 index 9cb975a9..00000000 --- a/src/Models/DisputeEvidenceFile.php +++ /dev/null @@ -1,115 +0,0 @@ -filename) == 0) { - return null; - } - return $this->filename['value']; - } - - /** - * Sets Filename. - * The file name including the file extension. For example: "receipt.tiff". - * - * @maps filename - */ - public function setFilename(?string $filename): void - { - $this->filename['value'] = $filename; - } - - /** - * Unsets Filename. - * The file name including the file extension. For example: "receipt.tiff". - */ - public function unsetFilename(): void - { - $this->filename = []; - } - - /** - * Returns Filetype. - * Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or - * image/tiff formats. - */ - public function getFiletype(): ?string - { - if (count($this->filetype) == 0) { - return null; - } - return $this->filetype['value']; - } - - /** - * Sets Filetype. - * Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or - * image/tiff formats. - * - * @maps filetype - */ - public function setFiletype(?string $filetype): void - { - $this->filetype['value'] = $filetype; - } - - /** - * Unsets Filetype. - * Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or - * image/tiff formats. - */ - public function unsetFiletype(): void - { - $this->filetype = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->filename)) { - $json['filename'] = $this->filename['value']; - } - if (!empty($this->filetype)) { - $json['filetype'] = $this->filetype['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/DisputeEvidenceType.php b/src/Models/DisputeEvidenceType.php deleted file mode 100644 index 533e97b1..00000000 --- a/src/Models/DisputeEvidenceType.php +++ /dev/null @@ -1,149 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * Square-generated unique ID of the payment being disputed. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * Square-generated unique ID of the payment being disputed. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EcomVisibility.php b/src/Models/EcomVisibility.php deleted file mode 100644 index b353858f..00000000 --- a/src/Models/EcomVisibility.php +++ /dev/null @@ -1,31 +0,0 @@ -id; - } - - /** - * Sets Id. - * UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns First Name. - * The employee's first name. - */ - public function getFirstName(): ?string - { - if (count($this->firstName) == 0) { - return null; - } - return $this->firstName['value']; - } - - /** - * Sets First Name. - * The employee's first name. - * - * @maps first_name - */ - public function setFirstName(?string $firstName): void - { - $this->firstName['value'] = $firstName; - } - - /** - * Unsets First Name. - * The employee's first name. - */ - public function unsetFirstName(): void - { - $this->firstName = []; - } - - /** - * Returns Last Name. - * The employee's last name. - */ - public function getLastName(): ?string - { - if (count($this->lastName) == 0) { - return null; - } - return $this->lastName['value']; - } - - /** - * Sets Last Name. - * The employee's last name. - * - * @maps last_name - */ - public function setLastName(?string $lastName): void - { - $this->lastName['value'] = $lastName; - } - - /** - * Unsets Last Name. - * The employee's last name. - */ - public function unsetLastName(): void - { - $this->lastName = []; - } - - /** - * Returns Email. - * The employee's email address - */ - public function getEmail(): ?string - { - if (count($this->email) == 0) { - return null; - } - return $this->email['value']; - } - - /** - * Sets Email. - * The employee's email address - * - * @maps email - */ - public function setEmail(?string $email): void - { - $this->email['value'] = $email; - } - - /** - * Unsets Email. - * The employee's email address - */ - public function unsetEmail(): void - { - $this->email = []; - } - - /** - * Returns Phone Number. - * The employee's phone number in E.164 format, i.e. "+12125554250" - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The employee's phone number in E.164 format, i.e. "+12125554250" - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The employee's phone number in E.164 format, i.e. "+12125554250" - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Location Ids. - * A list of location IDs where this employee has access to. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * A list of location IDs where this employee has access to. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * A list of location IDs where this employee has access to. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Status. - * The status of the Employee being retrieved. - * - * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the Employee being retrieved. - * - * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Is Owner. - * Whether this employee is the owner of the merchant. Each merchant - * has one owner employee, and that employee has full authority over - * the account. - */ - public function getIsOwner(): ?bool - { - if (count($this->isOwner) == 0) { - return null; - } - return $this->isOwner['value']; - } - - /** - * Sets Is Owner. - * Whether this employee is the owner of the merchant. Each merchant - * has one owner employee, and that employee has full authority over - * the account. - * - * @maps is_owner - */ - public function setIsOwner(?bool $isOwner): void - { - $this->isOwner['value'] = $isOwner; - } - - /** - * Unsets Is Owner. - * Whether this employee is the owner of the merchant. Each merchant - * has one owner employee, and that employee has full authority over - * the account. - */ - public function unsetIsOwner(): void - { - $this->isOwner = []; - } - - /** - * Returns Created At. - * A read-only timestamp in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * A read-only timestamp in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * A read-only timestamp in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * A read-only timestamp in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->firstName)) { - $json['first_name'] = $this->firstName['value']; - } - if (!empty($this->lastName)) { - $json['last_name'] = $this->lastName['value']; - } - if (!empty($this->email)) { - $json['email'] = $this->email['value']; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->isOwner)) { - $json['is_owner'] = $this->isOwner['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EmployeeStatus.php b/src/Models/EmployeeStatus.php deleted file mode 100644 index b3047035..00000000 --- a/src/Models/EmployeeStatus.php +++ /dev/null @@ -1,23 +0,0 @@ -id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Employee Id. - * The `Employee` that this wage is assigned to. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The `Employee` that this wage is assigned to. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The `Employee` that this wage is assigned to. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Title. - * The job title that this wage relates to. - */ - public function getTitle(): ?string - { - if (count($this->title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The job title that this wage relates to. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The job title that this wage relates to. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getHourlyRate(): ?Money - { - return $this->hourlyRate; - } - - /** - * Sets Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps hourly_rate - */ - public function setHourlyRate(?Money $hourlyRate): void - { - $this->hourlyRate = $hourlyRate; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (isset($this->hourlyRate)) { - $json['hourly_rate'] = $this->hourlyRate; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EnableEventsResponse.php b/src/Models/EnableEventsResponse.php deleted file mode 100644 index 92d88421..00000000 --- a/src/Models/EnableEventsResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Error.php b/src/Models/Error.php deleted file mode 100644 index 1413b305..00000000 --- a/src/Models/Error.php +++ /dev/null @@ -1,161 +0,0 @@ -category = $category; - $this->code = $code; - } - - /** - * Returns Category. - * Indicates which high-level category of error has occurred during a - * request to the Connect API. - */ - public function getCategory(): string - { - return $this->category; - } - - /** - * Sets Category. - * Indicates which high-level category of error has occurred during a - * request to the Connect API. - * - * @required - * @maps category - */ - public function setCategory(string $category): void - { - $this->category = $category; - } - - /** - * Returns Code. - * Indicates the specific error that occurred during a request to a - * Square API. - */ - public function getCode(): string - { - return $this->code; - } - - /** - * Sets Code. - * Indicates the specific error that occurred during a request to a - * Square API. - * - * @required - * @maps code - */ - public function setCode(string $code): void - { - $this->code = $code; - } - - /** - * Returns Detail. - * A human-readable description of the error for debugging purposes. - */ - public function getDetail(): ?string - { - return $this->detail; - } - - /** - * Sets Detail. - * A human-readable description of the error for debugging purposes. - * - * @maps detail - */ - public function setDetail(?string $detail): void - { - $this->detail = $detail; - } - - /** - * Returns Field. - * The name of the field provided in the original request (if any) that - * the error pertains to. - */ - public function getField(): ?string - { - return $this->field; - } - - /** - * Sets Field. - * The name of the field provided in the original request (if any) that - * the error pertains to. - * - * @maps field - */ - public function setField(?string $field): void - { - $this->field = $field; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['category'] = $this->category; - $json['code'] = $this->code; - if (isset($this->detail)) { - $json['detail'] = $this->detail; - } - if (isset($this->field)) { - $json['field'] = $this->field; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ErrorCategory.php b/src/Models/ErrorCategory.php deleted file mode 100644 index a5c7133d..00000000 --- a/src/Models/ErrorCategory.php +++ /dev/null @@ -1,63 +0,0 @@ -merchantId) == 0) { - return null; - } - return $this->merchantId['value']; - } - - /** - * Sets Merchant Id. - * The ID of the target merchant associated with the event. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId['value'] = $merchantId; - } - - /** - * Unsets Merchant Id. - * The ID of the target merchant associated with the event. - */ - public function unsetMerchantId(): void - { - $this->merchantId = []; - } - - /** - * Returns Location Id. - * The ID of the target location associated with the event. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the target location associated with the event. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the target location associated with the event. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Type. - * The type of event this represents. - */ - public function getType(): ?string - { - if (count($this->type) == 0) { - return null; - } - return $this->type['value']; - } - - /** - * Sets Type. - * The type of event this represents. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type['value'] = $type; - } - - /** - * Unsets Type. - * The type of event this represents. - */ - public function unsetType(): void - { - $this->type = []; - } - - /** - * Returns Event Id. - * A unique ID for the event. - */ - public function getEventId(): ?string - { - if (count($this->eventId) == 0) { - return null; - } - return $this->eventId['value']; - } - - /** - * Sets Event Id. - * A unique ID for the event. - * - * @maps event_id - */ - public function setEventId(?string $eventId): void - { - $this->eventId['value'] = $eventId; - } - - /** - * Unsets Event Id. - * A unique ID for the event. - */ - public function unsetEventId(): void - { - $this->eventId = []; - } - - /** - * Returns Created At. - * Timestamp of when the event was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Timestamp of when the event was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Data. - */ - public function getData(): ?EventData - { - return $this->data; - } - - /** - * Sets Data. - * - * @maps data - */ - public function setData(?EventData $data): void - { - $this->data = $data; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->merchantId)) { - $json['merchant_id'] = $this->merchantId['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->type)) { - $json['type'] = $this->type['value']; - } - if (!empty($this->eventId)) { - $json['event_id'] = $this->eventId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->data)) { - $json['data'] = $this->data; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EventData.php b/src/Models/EventData.php deleted file mode 100644 index fefe9116..00000000 --- a/src/Models/EventData.php +++ /dev/null @@ -1,185 +0,0 @@ -type) == 0) { - return null; - } - return $this->type['value']; - } - - /** - * Sets Type. - * The name of the affected object’s type. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type['value'] = $type; - } - - /** - * Unsets Type. - * The name of the affected object’s type. - */ - public function unsetType(): void - { - $this->type = []; - } - - /** - * Returns Id. - * The ID of the affected object. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The ID of the affected object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Deleted. - * This is true if the affected object has been deleted; otherwise, it's absent. - */ - public function getDeleted(): ?bool - { - if (count($this->deleted) == 0) { - return null; - } - return $this->deleted['value']; - } - - /** - * Sets Deleted. - * This is true if the affected object has been deleted; otherwise, it's absent. - * - * @maps deleted - */ - public function setDeleted(?bool $deleted): void - { - $this->deleted['value'] = $deleted; - } - - /** - * Unsets Deleted. - * This is true if the affected object has been deleted; otherwise, it's absent. - */ - public function unsetDeleted(): void - { - $this->deleted = []; - } - - /** - * Returns Object. - * An object containing fields and values relevant to the event. It is absent if the affected object - * has been deleted. - * - * @return mixed - */ - public function getObject() - { - if (count($this->object) == 0) { - return null; - } - return $this->object['value']; - } - - /** - * Sets Object. - * An object containing fields and values relevant to the event. It is absent if the affected object - * has been deleted. - * - * @maps object - * - * @param mixed $object - */ - public function setObject($object): void - { - $this->object['value'] = $object; - } - - /** - * Unsets Object. - * An object containing fields and values relevant to the event. It is absent if the affected object - * has been deleted. - */ - public function unsetObject(): void - { - $this->object = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->type)) { - $json['type'] = $this->type['value']; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->deleted)) { - $json['deleted'] = $this->deleted['value']; - } - if (!empty($this->object)) { - $json['object'] = ApiHelper::decodeJson($this->object['value'], 'object'); - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EventMetadata.php b/src/Models/EventMetadata.php deleted file mode 100644 index 64a52702..00000000 --- a/src/Models/EventMetadata.php +++ /dev/null @@ -1,115 +0,0 @@ -eventId) == 0) { - return null; - } - return $this->eventId['value']; - } - - /** - * Sets Event Id. - * A unique ID for the event. - * - * @maps event_id - */ - public function setEventId(?string $eventId): void - { - $this->eventId['value'] = $eventId; - } - - /** - * Unsets Event Id. - * A unique ID for the event. - */ - public function unsetEventId(): void - { - $this->eventId = []; - } - - /** - * Returns Api Version. - * The API version of the event. This corresponds to the default API version of the developer - * application at the time when the event was created. - */ - public function getApiVersion(): ?string - { - if (count($this->apiVersion) == 0) { - return null; - } - return $this->apiVersion['value']; - } - - /** - * Sets Api Version. - * The API version of the event. This corresponds to the default API version of the developer - * application at the time when the event was created. - * - * @maps api_version - */ - public function setApiVersion(?string $apiVersion): void - { - $this->apiVersion['value'] = $apiVersion; - } - - /** - * Unsets Api Version. - * The API version of the event. This corresponds to the default API version of the developer - * application at the time when the event was created. - */ - public function unsetApiVersion(): void - { - $this->apiVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->eventId)) { - $json['event_id'] = $this->eventId['value']; - } - if (!empty($this->apiVersion)) { - $json['api_version'] = $this->apiVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/EventTypeMetadata.php b/src/Models/EventTypeMetadata.php deleted file mode 100644 index a5ba26ee..00000000 --- a/src/Models/EventTypeMetadata.php +++ /dev/null @@ -1,116 +0,0 @@ -eventType; - } - - /** - * Sets Event Type. - * The event type. - * - * @maps event_type - */ - public function setEventType(?string $eventType): void - { - $this->eventType = $eventType; - } - - /** - * Returns Api Version Introduced. - * The API version at which the event type was introduced. - */ - public function getApiVersionIntroduced(): ?string - { - return $this->apiVersionIntroduced; - } - - /** - * Sets Api Version Introduced. - * The API version at which the event type was introduced. - * - * @maps api_version_introduced - */ - public function setApiVersionIntroduced(?string $apiVersionIntroduced): void - { - $this->apiVersionIntroduced = $apiVersionIntroduced; - } - - /** - * Returns Release Status. - * The release status of the event type. - */ - public function getReleaseStatus(): ?string - { - return $this->releaseStatus; - } - - /** - * Sets Release Status. - * The release status of the event type. - * - * @maps release_status - */ - public function setReleaseStatus(?string $releaseStatus): void - { - $this->releaseStatus = $releaseStatus; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->eventType)) { - $json['event_type'] = $this->eventType; - } - if (isset($this->apiVersionIntroduced)) { - $json['api_version_introduced'] = $this->apiVersionIntroduced; - } - if (isset($this->releaseStatus)) { - $json['release_status'] = $this->releaseStatus; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ExcludeStrategy.php b/src/Models/ExcludeStrategy.php deleted file mode 100644 index 7fae3864..00000000 --- a/src/Models/ExcludeStrategy.php +++ /dev/null @@ -1,30 +0,0 @@ -type = $type; - $this->source = $source; - } - - /** - * Returns Type. - * The type of external payment the seller received. It can be one of the following: - * - CHECK - Paid using a physical check. - * - BANK_TRANSFER - Paid using external bank transfer. - * - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. - * - CRYPTO - Paid using a crypto currency. - * - SQUARE_CASH - Paid using Square Cash App. - * - SOCIAL - Paid using peer-to-peer payment applications. - * - EXTERNAL - A third-party application gathered this payment outside of Square. - * - EMONEY - Paid using an E-money provider. - * - CARD - A credit or debit card that Square does not support. - * - STORED_BALANCE - Use for house accounts, store credit, and so forth. - * - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals - * - OTHER - A type not listed here. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * The type of external payment the seller received. It can be one of the following: - * - CHECK - Paid using a physical check. - * - BANK_TRANSFER - Paid using external bank transfer. - * - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. - * - CRYPTO - Paid using a crypto currency. - * - SQUARE_CASH - Paid using Square Cash App. - * - SOCIAL - Paid using peer-to-peer payment applications. - * - EXTERNAL - A third-party application gathered this payment outside of Square. - * - EMONEY - Paid using an E-money provider. - * - CARD - A credit or debit card that Square does not support. - * - STORED_BALANCE - Use for house accounts, store credit, and so forth. - * - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals - * - OTHER - A type not listed here. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Source. - * A description of the external payment source. For example, - * "Food Delivery Service". - */ - public function getSource(): string - { - return $this->source; - } - - /** - * Sets Source. - * A description of the external payment source. For example, - * "Food Delivery Service". - * - * @required - * @maps source - */ - public function setSource(string $source): void - { - $this->source = $source; - } - - /** - * Returns Source Id. - * An ID to associate the payment to its originating source. - */ - public function getSourceId(): ?string - { - if (count($this->sourceId) == 0) { - return null; - } - return $this->sourceId['value']; - } - - /** - * Sets Source Id. - * An ID to associate the payment to its originating source. - * - * @maps source_id - */ - public function setSourceId(?string $sourceId): void - { - $this->sourceId['value'] = $sourceId; - } - - /** - * Unsets Source Id. - * An ID to associate the payment to its originating source. - */ - public function unsetSourceId(): void - { - $this->sourceId = []; - } - - /** - * Returns Source Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getSourceFeeMoney(): ?Money - { - return $this->sourceFeeMoney; - } - - /** - * Sets Source Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps source_fee_money - */ - public function setSourceFeeMoney(?Money $sourceFeeMoney): void - { - $this->sourceFeeMoney = $sourceFeeMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['source'] = $this->source; - if (!empty($this->sourceId)) { - $json['source_id'] = $this->sourceId['value']; - } - if (isset($this->sourceFeeMoney)) { - $json['source_fee_money'] = $this->sourceFeeMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FilterValue.php b/src/Models/FilterValue.php deleted file mode 100644 index 16c95148..00000000 --- a/src/Models/FilterValue.php +++ /dev/null @@ -1,171 +0,0 @@ -all) == 0) { - return null; - } - return $this->all['value']; - } - - /** - * Sets All. - * A list of terms that must be present on the field of the resource. - * - * @maps all - * - * @param string[]|null $all - */ - public function setAll(?array $all): void - { - $this->all['value'] = $all; - } - - /** - * Unsets All. - * A list of terms that must be present on the field of the resource. - */ - public function unsetAll(): void - { - $this->all = []; - } - - /** - * Returns Any. - * A list of terms where at least one of them must be present on the - * field of the resource. - * - * @return string[]|null - */ - public function getAny(): ?array - { - if (count($this->any) == 0) { - return null; - } - return $this->any['value']; - } - - /** - * Sets Any. - * A list of terms where at least one of them must be present on the - * field of the resource. - * - * @maps any - * - * @param string[]|null $any - */ - public function setAny(?array $any): void - { - $this->any['value'] = $any; - } - - /** - * Unsets Any. - * A list of terms where at least one of them must be present on the - * field of the resource. - */ - public function unsetAny(): void - { - $this->any = []; - } - - /** - * Returns None. - * A list of terms that must not be present on the field the resource - * - * @return string[]|null - */ - public function getNone(): ?array - { - if (count($this->none) == 0) { - return null; - } - return $this->none['value']; - } - - /** - * Sets None. - * A list of terms that must not be present on the field the resource - * - * @maps none - * - * @param string[]|null $none - */ - public function setNone(?array $none): void - { - $this->none['value'] = $none; - } - - /** - * Unsets None. - * A list of terms that must not be present on the field the resource - */ - public function unsetNone(): void - { - $this->none = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->all)) { - $json['all'] = $this->all['value']; - } - if (!empty($this->any)) { - $json['any'] = $this->any['value']; - } - if (!empty($this->none)) { - $json['none'] = $this->none['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FloatNumberRange.php b/src/Models/FloatNumberRange.php deleted file mode 100644 index 93158051..00000000 --- a/src/Models/FloatNumberRange.php +++ /dev/null @@ -1,112 +0,0 @@ -startAt) == 0) { - return null; - } - return $this->startAt['value']; - } - - /** - * Sets Start At. - * A decimal value indicating where the range starts. - * - * @maps start_at - */ - public function setStartAt(?string $startAt): void - { - $this->startAt['value'] = $startAt; - } - - /** - * Unsets Start At. - * A decimal value indicating where the range starts. - */ - public function unsetStartAt(): void - { - $this->startAt = []; - } - - /** - * Returns End At. - * A decimal value indicating where the range ends. - */ - public function getEndAt(): ?string - { - if (count($this->endAt) == 0) { - return null; - } - return $this->endAt['value']; - } - - /** - * Sets End At. - * A decimal value indicating where the range ends. - * - * @maps end_at - */ - public function setEndAt(?string $endAt): void - { - $this->endAt['value'] = $endAt; - } - - /** - * Unsets End At. - * A decimal value indicating where the range ends. - */ - public function unsetEndAt(): void - { - $this->endAt = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->startAt)) { - $json['start_at'] = $this->startAt['value']; - } - if (!empty($this->endAt)) { - $json['end_at'] = $this->endAt['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Fulfillment.php b/src/Models/Fulfillment.php deleted file mode 100644 index a7c771ab..00000000 --- a/src/Models/Fulfillment.php +++ /dev/null @@ -1,392 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the fulfillment only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the fulfillment only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Type. - * The type of fulfillment. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * The type of fulfillment. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns State. - * The current state of this fulfillment. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The current state of this fulfillment. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Line Item Application. - * The `line_item_application` describes what order line items this fulfillment applies - * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - */ - public function getLineItemApplication(): ?string - { - return $this->lineItemApplication; - } - - /** - * Sets Line Item Application. - * The `line_item_application` describes what order line items this fulfillment applies - * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - * - * @maps line_item_application - */ - public function setLineItemApplication(?string $lineItemApplication): void - { - $this->lineItemApplication = $lineItemApplication; - } - - /** - * Returns Entries. - * A list of entries pertaining to the fulfillment of an order. Each entry must reference - * a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to - * fulfill. - * - * Multiple entries can reference the same line item `uid`, as long as the total quantity among - * all fulfillment entries referencing a single line item does not exceed the quantity of the - * order's line item itself. - * - * An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, - * `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently - * before order completion. - * - * @return FulfillmentFulfillmentEntry[]|null - */ - public function getEntries(): ?array - { - return $this->entries; - } - - /** - * Sets Entries. - * A list of entries pertaining to the fulfillment of an order. Each entry must reference - * a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to - * fulfill. - * - * Multiple entries can reference the same line item `uid`, as long as the total quantity among - * all fulfillment entries referencing a single line item does not exceed the quantity of the - * order's line item itself. - * - * An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, - * `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently - * before order completion. - * - * @maps entries - * - * @param FulfillmentFulfillmentEntry[]|null $entries - */ - public function setEntries(?array $entries): void - { - $this->entries = $entries; - } - - /** - * Returns Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Pickup Details. - * Contains details necessary to fulfill a pickup order. - */ - public function getPickupDetails(): ?FulfillmentPickupDetails - { - return $this->pickupDetails; - } - - /** - * Sets Pickup Details. - * Contains details necessary to fulfill a pickup order. - * - * @maps pickup_details - */ - public function setPickupDetails(?FulfillmentPickupDetails $pickupDetails): void - { - $this->pickupDetails = $pickupDetails; - } - - /** - * Returns Shipment Details. - * Contains the details necessary to fulfill a shipment order. - */ - public function getShipmentDetails(): ?FulfillmentShipmentDetails - { - return $this->shipmentDetails; - } - - /** - * Sets Shipment Details. - * Contains the details necessary to fulfill a shipment order. - * - * @maps shipment_details - */ - public function setShipmentDetails(?FulfillmentShipmentDetails $shipmentDetails): void - { - $this->shipmentDetails = $shipmentDetails; - } - - /** - * Returns Delivery Details. - * Describes delivery details of an order fulfillment. - */ - public function getDeliveryDetails(): ?FulfillmentDeliveryDetails - { - return $this->deliveryDetails; - } - - /** - * Sets Delivery Details. - * Describes delivery details of an order fulfillment. - * - * @maps delivery_details - */ - public function setDeliveryDetails(?FulfillmentDeliveryDetails $deliveryDetails): void - { - $this->deliveryDetails = $deliveryDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->lineItemApplication)) { - $json['line_item_application'] = $this->lineItemApplication; - } - if (isset($this->entries)) { - $json['entries'] = $this->entries; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->pickupDetails)) { - $json['pickup_details'] = $this->pickupDetails; - } - if (isset($this->shipmentDetails)) { - $json['shipment_details'] = $this->shipmentDetails; - } - if (isset($this->deliveryDetails)) { - $json['delivery_details'] = $this->deliveryDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentDeliveryDetails.php b/src/Models/FulfillmentDeliveryDetails.php deleted file mode 100644 index 385fc1b1..00000000 --- a/src/Models/FulfillmentDeliveryDetails.php +++ /dev/null @@ -1,965 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?FulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Schedule Type. - * The schedule type of the delivery fulfillment. - */ - public function getScheduleType(): ?string - { - return $this->scheduleType; - } - - /** - * Sets Schedule Type. - * The schedule type of the delivery fulfillment. - * - * @maps schedule_type - */ - public function setScheduleType(?string $scheduleType): void - { - $this->scheduleType = $scheduleType; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getDeliverAt(): ?string - { - if (count($this->deliverAt) == 0) { - return null; - } - return $this->deliverAt['value']; - } - - /** - * Sets Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps deliver_at - */ - public function setDeliverAt(?string $deliverAt): void - { - $this->deliverAt['value'] = $deliverAt; - } - - /** - * Unsets Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetDeliverAt(): void - { - $this->deliverAt = []; - } - - /** - * Returns Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getPrepTimeDuration(): ?string - { - if (count($this->prepTimeDuration) == 0) { - return null; - } - return $this->prepTimeDuration['value']; - } - - /** - * Sets Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps prep_time_duration - */ - public function setPrepTimeDuration(?string $prepTimeDuration): void - { - $this->prepTimeDuration['value'] = $prepTimeDuration; - } - - /** - * Unsets Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetPrepTimeDuration(): void - { - $this->prepTimeDuration = []; - } - - /** - * Returns Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getDeliveryWindowDuration(): ?string - { - if (count($this->deliveryWindowDuration) == 0) { - return null; - } - return $this->deliveryWindowDuration['value']; - } - - /** - * Sets Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps delivery_window_duration - */ - public function setDeliveryWindowDuration(?string $deliveryWindowDuration): void - { - $this->deliveryWindowDuration['value'] = $deliveryWindowDuration; - } - - /** - * Unsets Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetDeliveryWindowDuration(): void - { - $this->deliveryWindowDuration = []; - } - - /** - * Returns Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCompletedAt(): ?string - { - if (count($this->completedAt) == 0) { - return null; - } - return $this->completedAt['value']; - } - - /** - * Sets Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps completed_at - */ - public function setCompletedAt(?string $completedAt): void - { - $this->completedAt['value'] = $completedAt; - } - - /** - * Unsets Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCompletedAt(): void - { - $this->completedAt = []; - } - - /** - * Returns In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller started processing the fulfillment. - * This field is automatically set when the fulfillment `state` changes to `RESERVED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getInProgressAt(): ?string - { - return $this->inProgressAt; - } - - /** - * Sets In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller started processing the fulfillment. - * This field is automatically set when the fulfillment `state` changes to `RESERVED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps in_progress_at - */ - public function setInProgressAt(?string $inProgressAt): void - { - $this->inProgressAt = $inProgressAt; - } - - /** - * Returns Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. This field is - * automatically set when the fulfillment `state` changes to `FAILED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getRejectedAt(): ?string - { - return $this->rejectedAt; - } - - /** - * Sets Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. This field is - * automatically set when the fulfillment `state` changes to `FAILED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps rejected_at - */ - public function setRejectedAt(?string $rejectedAt): void - { - $this->rejectedAt = $rejectedAt; - } - - /** - * Returns Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the seller marked the fulfillment as ready for - * courier pickup. This field is automatically set when the fulfillment `state` changes - * to PREPARED. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getReadyAt(): ?string - { - return $this->readyAt; - } - - /** - * Sets Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the seller marked the fulfillment as ready for - * courier pickup. This field is automatically set when the fulfillment `state` changes - * to PREPARED. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps ready_at - */ - public function setReadyAt(?string $readyAt): void - { - $this->readyAt = $readyAt; - } - - /** - * Returns Delivered At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was delivered to the recipient. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getDeliveredAt(): ?string - { - return $this->deliveredAt; - } - - /** - * Sets Delivered At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was delivered to the recipient. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps delivered_at - */ - public function setDeliveredAt(?string $deliveredAt): void - { - $this->deliveredAt = $deliveredAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. This field is automatically - * set when the fulfillment `state` changes to `CANCELED`. - * - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - return $this->canceledAt; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. This field is automatically - * set when the fulfillment `state` changes to `CANCELED`. - * - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt = $canceledAt; - } - - /** - * Returns Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCourierPickupAt(): ?string - { - if (count($this->courierPickupAt) == 0) { - return null; - } - return $this->courierPickupAt['value']; - } - - /** - * Sets Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps courier_pickup_at - */ - public function setCourierPickupAt(?string $courierPickupAt): void - { - $this->courierPickupAt['value'] = $courierPickupAt; - } - - /** - * Unsets Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCourierPickupAt(): void - { - $this->courierPickupAt = []; - } - - /** - * Returns Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getCourierPickupWindowDuration(): ?string - { - if (count($this->courierPickupWindowDuration) == 0) { - return null; - } - return $this->courierPickupWindowDuration['value']; - } - - /** - * Sets Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps courier_pickup_window_duration - */ - public function setCourierPickupWindowDuration(?string $courierPickupWindowDuration): void - { - $this->courierPickupWindowDuration['value'] = $courierPickupWindowDuration; - } - - /** - * Unsets Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetCourierPickupWindowDuration(): void - { - $this->courierPickupWindowDuration = []; - } - - /** - * Returns Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - */ - public function getIsNoContactDelivery(): ?bool - { - if (count($this->isNoContactDelivery) == 0) { - return null; - } - return $this->isNoContactDelivery['value']; - } - - /** - * Sets Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - * - * @maps is_no_contact_delivery - */ - public function setIsNoContactDelivery(?bool $isNoContactDelivery): void - { - $this->isNoContactDelivery['value'] = $isNoContactDelivery; - } - - /** - * Unsets Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - */ - public function unsetIsNoContactDelivery(): void - { - $this->isNoContactDelivery = []; - } - - /** - * Returns Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - */ - public function getDropoffNotes(): ?string - { - if (count($this->dropoffNotes) == 0) { - return null; - } - return $this->dropoffNotes['value']; - } - - /** - * Sets Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - * - * @maps dropoff_notes - */ - public function setDropoffNotes(?string $dropoffNotes): void - { - $this->dropoffNotes['value'] = $dropoffNotes; - } - - /** - * Unsets Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - */ - public function unsetDropoffNotes(): void - { - $this->dropoffNotes = []; - } - - /** - * Returns Courier Provider Name. - * The name of the courier provider. - */ - public function getCourierProviderName(): ?string - { - if (count($this->courierProviderName) == 0) { - return null; - } - return $this->courierProviderName['value']; - } - - /** - * Sets Courier Provider Name. - * The name of the courier provider. - * - * @maps courier_provider_name - */ - public function setCourierProviderName(?string $courierProviderName): void - { - $this->courierProviderName['value'] = $courierProviderName; - } - - /** - * Unsets Courier Provider Name. - * The name of the courier provider. - */ - public function unsetCourierProviderName(): void - { - $this->courierProviderName = []; - } - - /** - * Returns Courier Support Phone Number. - * The support phone number of the courier. - */ - public function getCourierSupportPhoneNumber(): ?string - { - if (count($this->courierSupportPhoneNumber) == 0) { - return null; - } - return $this->courierSupportPhoneNumber['value']; - } - - /** - * Sets Courier Support Phone Number. - * The support phone number of the courier. - * - * @maps courier_support_phone_number - */ - public function setCourierSupportPhoneNumber(?string $courierSupportPhoneNumber): void - { - $this->courierSupportPhoneNumber['value'] = $courierSupportPhoneNumber; - } - - /** - * Unsets Courier Support Phone Number. - * The support phone number of the courier. - */ - public function unsetCourierSupportPhoneNumber(): void - { - $this->courierSupportPhoneNumber = []; - } - - /** - * Returns Square Delivery Id. - * The identifier for the delivery created by Square. - */ - public function getSquareDeliveryId(): ?string - { - if (count($this->squareDeliveryId) == 0) { - return null; - } - return $this->squareDeliveryId['value']; - } - - /** - * Sets Square Delivery Id. - * The identifier for the delivery created by Square. - * - * @maps square_delivery_id - */ - public function setSquareDeliveryId(?string $squareDeliveryId): void - { - $this->squareDeliveryId['value'] = $squareDeliveryId; - } - - /** - * Unsets Square Delivery Id. - * The identifier for the delivery created by Square. - */ - public function unsetSquareDeliveryId(): void - { - $this->squareDeliveryId = []; - } - - /** - * Returns External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - */ - public function getExternalDeliveryId(): ?string - { - if (count($this->externalDeliveryId) == 0) { - return null; - } - return $this->externalDeliveryId['value']; - } - - /** - * Sets External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - * - * @maps external_delivery_id - */ - public function setExternalDeliveryId(?string $externalDeliveryId): void - { - $this->externalDeliveryId['value'] = $externalDeliveryId; - } - - /** - * Unsets External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - */ - public function unsetExternalDeliveryId(): void - { - $this->externalDeliveryId = []; - } - - /** - * Returns Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - */ - public function getManagedDelivery(): ?bool - { - if (count($this->managedDelivery) == 0) { - return null; - } - return $this->managedDelivery['value']; - } - - /** - * Sets Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - * - * @maps managed_delivery - */ - public function setManagedDelivery(?bool $managedDelivery): void - { - $this->managedDelivery['value'] = $managedDelivery; - } - - /** - * Unsets Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - */ - public function unsetManagedDelivery(): void - { - $this->managedDelivery = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (isset($this->scheduleType)) { - $json['schedule_type'] = $this->scheduleType; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (!empty($this->deliverAt)) { - $json['deliver_at'] = $this->deliverAt['value']; - } - if (!empty($this->prepTimeDuration)) { - $json['prep_time_duration'] = $this->prepTimeDuration['value']; - } - if (!empty($this->deliveryWindowDuration)) { - $json['delivery_window_duration'] = $this->deliveryWindowDuration['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->completedAt)) { - $json['completed_at'] = $this->completedAt['value']; - } - if (isset($this->inProgressAt)) { - $json['in_progress_at'] = $this->inProgressAt; - } - if (isset($this->rejectedAt)) { - $json['rejected_at'] = $this->rejectedAt; - } - if (isset($this->readyAt)) { - $json['ready_at'] = $this->readyAt; - } - if (isset($this->deliveredAt)) { - $json['delivered_at'] = $this->deliveredAt; - } - if (isset($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (!empty($this->courierPickupAt)) { - $json['courier_pickup_at'] = $this->courierPickupAt['value']; - } - if (!empty($this->courierPickupWindowDuration)) { - $json['courier_pickup_window_duration'] = $this->courierPickupWindowDuration['value']; - } - if (!empty($this->isNoContactDelivery)) { - $json['is_no_contact_delivery'] = $this->isNoContactDelivery['value']; - } - if (!empty($this->dropoffNotes)) { - $json['dropoff_notes'] = $this->dropoffNotes['value']; - } - if (!empty($this->courierProviderName)) { - $json['courier_provider_name'] = $this->courierProviderName['value']; - } - if (!empty($this->courierSupportPhoneNumber)) { - $json['courier_support_phone_number'] = $this->courierSupportPhoneNumber['value']; - } - if (!empty($this->squareDeliveryId)) { - $json['square_delivery_id'] = $this->squareDeliveryId['value']; - } - if (!empty($this->externalDeliveryId)) { - $json['external_delivery_id'] = $this->externalDeliveryId['value']; - } - if (!empty($this->managedDelivery)) { - $json['managed_delivery'] = $this->managedDelivery['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php b/src/Models/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php deleted file mode 100644 index 57362fa6..00000000 --- a/src/Models/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php +++ /dev/null @@ -1,22 +0,0 @@ -lineItemUid = $lineItemUid; - $this->quantity = $quantity; - } - - /** - * Returns Uid. - * A unique ID that identifies the fulfillment entry only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the fulfillment entry only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the fulfillment entry only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Line Item Uid. - * The `uid` from the order line item. - */ - public function getLineItemUid(): string - { - return $this->lineItemUid; - } - - /** - * Sets Line Item Uid. - * The `uid` from the order line item. - * - * @required - * @maps line_item_uid - */ - public function setLineItemUid(string $lineItemUid): void - { - $this->lineItemUid = $lineItemUid; - } - - /** - * Returns Quantity. - * The quantity of the line item being fulfilled, formatted as a decimal number. - * For example, `"3"`. - * - * Fulfillments for line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - */ - public function getQuantity(): string - { - return $this->quantity; - } - - /** - * Sets Quantity. - * The quantity of the line item being fulfilled, formatted as a decimal number. - * For example, `"3"`. - * - * Fulfillments for line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - * - * @required - * @maps quantity - */ - public function setQuantity(string $quantity): void - { - $this->quantity = $quantity; - } - - /** - * Returns Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['line_item_uid'] = $this->lineItemUid; - $json['quantity'] = $this->quantity; - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentFulfillmentLineItemApplication.php b/src/Models/FulfillmentFulfillmentLineItemApplication.php deleted file mode 100644 index 3f229889..00000000 --- a/src/Models/FulfillmentFulfillmentLineItemApplication.php +++ /dev/null @@ -1,22 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?FulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - */ - public function getExpiresAt(): ?string - { - if (count($this->expiresAt) == 0) { - return null; - } - return $this->expiresAt['value']; - } - - /** - * Sets Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt['value'] = $expiresAt; - } - - /** - * Unsets Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - */ - public function unsetExpiresAt(): void - { - $this->expiresAt = []; - } - - /** - * Returns Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - */ - public function getAutoCompleteDuration(): ?string - { - if (count($this->autoCompleteDuration) == 0) { - return null; - } - return $this->autoCompleteDuration['value']; - } - - /** - * Sets Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - * - * @maps auto_complete_duration - */ - public function setAutoCompleteDuration(?string $autoCompleteDuration): void - { - $this->autoCompleteDuration['value'] = $autoCompleteDuration; - } - - /** - * Unsets Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - */ - public function unsetAutoCompleteDuration(): void - { - $this->autoCompleteDuration = []; - } - - /** - * Returns Schedule Type. - * The schedule type of the pickup fulfillment. - */ - public function getScheduleType(): ?string - { - return $this->scheduleType; - } - - /** - * Sets Schedule Type. - * The schedule type of the pickup fulfillment. - * - * @maps schedule_type - */ - public function setScheduleType(?string $scheduleType): void - { - $this->scheduleType = $scheduleType; - } - - /** - * Returns Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - */ - public function getPickupAt(): ?string - { - if (count($this->pickupAt) == 0) { - return null; - } - return $this->pickupAt['value']; - } - - /** - * Sets Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - * - * @maps pickup_at - */ - public function setPickupAt(?string $pickupAt): void - { - $this->pickupAt['value'] = $pickupAt; - } - - /** - * Unsets Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - */ - public function unsetPickupAt(): void - { - $this->pickupAt = []; - } - - /** - * Returns Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - */ - public function getPickupWindowDuration(): ?string - { - if (count($this->pickupWindowDuration) == 0) { - return null; - } - return $this->pickupWindowDuration['value']; - } - - /** - * Sets Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - * - * @maps pickup_window_duration - */ - public function setPickupWindowDuration(?string $pickupWindowDuration): void - { - $this->pickupWindowDuration['value'] = $pickupWindowDuration; - } - - /** - * Unsets Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - */ - public function unsetPickupWindowDuration(): void - { - $this->pickupWindowDuration = []; - } - - /** - * Returns Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getPrepTimeDuration(): ?string - { - if (count($this->prepTimeDuration) == 0) { - return null; - } - return $this->prepTimeDuration['value']; - } - - /** - * Sets Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps prep_time_duration - */ - public function setPrepTimeDuration(?string $prepTimeDuration): void - { - $this->prepTimeDuration['value'] = $prepTimeDuration; - } - - /** - * Unsets Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetPrepTimeDuration(): void - { - $this->prepTimeDuration = []; - } - - /** - * Returns Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns Accepted At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getAcceptedAt(): ?string - { - return $this->acceptedAt; - } - - /** - * Sets Accepted At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps accepted_at - */ - public function setAcceptedAt(?string $acceptedAt): void - { - $this->acceptedAt = $acceptedAt; - } - - /** - * Returns Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getRejectedAt(): ?string - { - return $this->rejectedAt; - } - - /** - * Sets Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps rejected_at - */ - public function setRejectedAt(?string $rejectedAt): void - { - $this->rejectedAt = $rejectedAt; - } - - /** - * Returns Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getReadyAt(): ?string - { - return $this->readyAt; - } - - /** - * Sets Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps ready_at - */ - public function setReadyAt(?string $readyAt): void - { - $this->readyAt = $readyAt; - } - - /** - * Returns Expired At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getExpiredAt(): ?string - { - return $this->expiredAt; - } - - /** - * Sets Expired At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps expired_at - */ - public function setExpiredAt(?string $expiredAt): void - { - $this->expiredAt = $expiredAt; - } - - /** - * Returns Picked up At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPickedUpAt(): ?string - { - return $this->pickedUpAt; - } - - /** - * Sets Picked up At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps picked_up_at - */ - public function setPickedUpAt(?string $pickedUpAt): void - { - $this->pickedUpAt = $pickedUpAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - return $this->canceledAt; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt = $canceledAt; - } - - /** - * Returns Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - */ - public function getIsCurbsidePickup(): ?bool - { - if (count($this->isCurbsidePickup) == 0) { - return null; - } - return $this->isCurbsidePickup['value']; - } - - /** - * Sets Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - * - * @maps is_curbside_pickup - */ - public function setIsCurbsidePickup(?bool $isCurbsidePickup): void - { - $this->isCurbsidePickup['value'] = $isCurbsidePickup; - } - - /** - * Unsets Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - */ - public function unsetIsCurbsidePickup(): void - { - $this->isCurbsidePickup = []; - } - - /** - * Returns Curbside Pickup Details. - * Specific details for curbside pickup. - */ - public function getCurbsidePickupDetails(): ?FulfillmentPickupDetailsCurbsidePickupDetails - { - return $this->curbsidePickupDetails; - } - - /** - * Sets Curbside Pickup Details. - * Specific details for curbside pickup. - * - * @maps curbside_pickup_details - */ - public function setCurbsidePickupDetails( - ?FulfillmentPickupDetailsCurbsidePickupDetails $curbsidePickupDetails - ): void { - $this->curbsidePickupDetails = $curbsidePickupDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (!empty($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt['value']; - } - if (!empty($this->autoCompleteDuration)) { - $json['auto_complete_duration'] = $this->autoCompleteDuration['value']; - } - if (isset($this->scheduleType)) { - $json['schedule_type'] = $this->scheduleType; - } - if (!empty($this->pickupAt)) { - $json['pickup_at'] = $this->pickupAt['value']; - } - if (!empty($this->pickupWindowDuration)) { - $json['pickup_window_duration'] = $this->pickupWindowDuration['value']; - } - if (!empty($this->prepTimeDuration)) { - $json['prep_time_duration'] = $this->prepTimeDuration['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (isset($this->acceptedAt)) { - $json['accepted_at'] = $this->acceptedAt; - } - if (isset($this->rejectedAt)) { - $json['rejected_at'] = $this->rejectedAt; - } - if (isset($this->readyAt)) { - $json['ready_at'] = $this->readyAt; - } - if (isset($this->expiredAt)) { - $json['expired_at'] = $this->expiredAt; - } - if (isset($this->pickedUpAt)) { - $json['picked_up_at'] = $this->pickedUpAt; - } - if (isset($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (!empty($this->isCurbsidePickup)) { - $json['is_curbside_pickup'] = $this->isCurbsidePickup['value']; - } - if (isset($this->curbsidePickupDetails)) { - $json['curbside_pickup_details'] = $this->curbsidePickupDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentPickupDetailsCurbsidePickupDetails.php b/src/Models/FulfillmentPickupDetailsCurbsidePickupDetails.php deleted file mode 100644 index ba4a67cb..00000000 --- a/src/Models/FulfillmentPickupDetailsCurbsidePickupDetails.php +++ /dev/null @@ -1,121 +0,0 @@ -curbsideDetails) == 0) { - return null; - } - return $this->curbsideDetails['value']; - } - - /** - * Sets Curbside Details. - * Specific details for curbside pickup, such as parking number and vehicle model. - * - * @maps curbside_details - */ - public function setCurbsideDetails(?string $curbsideDetails): void - { - $this->curbsideDetails['value'] = $curbsideDetails; - } - - /** - * Unsets Curbside Details. - * Specific details for curbside pickup, such as parking number and vehicle model. - */ - public function unsetCurbsideDetails(): void - { - $this->curbsideDetails = []; - } - - /** - * Returns Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getBuyerArrivedAt(): ?string - { - if (count($this->buyerArrivedAt) == 0) { - return null; - } - return $this->buyerArrivedAt['value']; - } - - /** - * Sets Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps buyer_arrived_at - */ - public function setBuyerArrivedAt(?string $buyerArrivedAt): void - { - $this->buyerArrivedAt['value'] = $buyerArrivedAt; - } - - /** - * Unsets Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetBuyerArrivedAt(): void - { - $this->buyerArrivedAt = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->curbsideDetails)) { - $json['curbside_details'] = $this->curbsideDetails['value']; - } - if (!empty($this->buyerArrivedAt)) { - $json['buyer_arrived_at'] = $this->buyerArrivedAt['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentPickupDetailsScheduleType.php b/src/Models/FulfillmentPickupDetailsScheduleType.php deleted file mode 100644 index acb16ed2..00000000 --- a/src/Models/FulfillmentPickupDetailsScheduleType.php +++ /dev/null @@ -1,22 +0,0 @@ -customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the customer associated with the fulfillment. - * - * If `customer_id` is provided, the fulfillment recipient's `display_name`, - * `email_address`, and `phone_number` are automatically populated from the - * targeted customer profile. If these fields are set in the request, the request - * values override the information from the customer profile. If the - * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request results in an error. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the customer associated with the fulfillment. - * - * If `customer_id` is provided, the fulfillment recipient's `display_name`, - * `email_address`, and `phone_number` are automatically populated from the - * targeted customer profile. If these fields are set in the request, the request - * values override the information from the customer profile. If the - * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request results in an error. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Display Name. - * The display name of the fulfillment recipient. This field is required. - * - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getDisplayName(): ?string - { - if (count($this->displayName) == 0) { - return null; - } - return $this->displayName['value']; - } - - /** - * Sets Display Name. - * The display name of the fulfillment recipient. This field is required. - * - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps display_name - */ - public function setDisplayName(?string $displayName): void - { - $this->displayName['value'] = $displayName; - } - - /** - * Unsets Display Name. - * The display name of the fulfillment recipient. This field is required. - * - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetDisplayName(): void - { - $this->displayName = []; - } - - /** - * Returns Email Address. - * The email address of the fulfillment recipient. - * - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address of the fulfillment recipient. - * - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address of the fulfillment recipient. - * - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->displayName)) { - $json['display_name'] = $this->displayName['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentShipmentDetails.php b/src/Models/FulfillmentShipmentDetails.php deleted file mode 100644 index 611509eb..00000000 --- a/src/Models/FulfillmentShipmentDetails.php +++ /dev/null @@ -1,603 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?FulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - */ - public function getCarrier(): ?string - { - if (count($this->carrier) == 0) { - return null; - } - return $this->carrier['value']; - } - - /** - * Sets Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - * - * @maps carrier - */ - public function setCarrier(?string $carrier): void - { - $this->carrier['value'] = $carrier; - } - - /** - * Unsets Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - */ - public function unsetCarrier(): void - { - $this->carrier = []; - } - - /** - * Returns Shipping Note. - * A note with additional information for the shipping carrier. - */ - public function getShippingNote(): ?string - { - if (count($this->shippingNote) == 0) { - return null; - } - return $this->shippingNote['value']; - } - - /** - * Sets Shipping Note. - * A note with additional information for the shipping carrier. - * - * @maps shipping_note - */ - public function setShippingNote(?string $shippingNote): void - { - $this->shippingNote['value'] = $shippingNote; - } - - /** - * Unsets Shipping Note. - * A note with additional information for the shipping carrier. - */ - public function unsetShippingNote(): void - { - $this->shippingNote = []; - } - - /** - * Returns Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - */ - public function getShippingType(): ?string - { - if (count($this->shippingType) == 0) { - return null; - } - return $this->shippingType['value']; - } - - /** - * Sets Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - * - * @maps shipping_type - */ - public function setShippingType(?string $shippingType): void - { - $this->shippingType['value'] = $shippingType; - } - - /** - * Unsets Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - */ - public function unsetShippingType(): void - { - $this->shippingType = []; - } - - /** - * Returns Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - */ - public function getTrackingNumber(): ?string - { - if (count($this->trackingNumber) == 0) { - return null; - } - return $this->trackingNumber['value']; - } - - /** - * Sets Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - * - * @maps tracking_number - */ - public function setTrackingNumber(?string $trackingNumber): void - { - $this->trackingNumber['value'] = $trackingNumber; - } - - /** - * Unsets Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - */ - public function unsetTrackingNumber(): void - { - $this->trackingNumber = []; - } - - /** - * Returns Tracking Url. - * A link to the tracking webpage on the carrier's website. - */ - public function getTrackingUrl(): ?string - { - if (count($this->trackingUrl) == 0) { - return null; - } - return $this->trackingUrl['value']; - } - - /** - * Sets Tracking Url. - * A link to the tracking webpage on the carrier's website. - * - * @maps tracking_url - */ - public function setTrackingUrl(?string $trackingUrl): void - { - $this->trackingUrl['value'] = $trackingUrl; - } - - /** - * Unsets Tracking Url. - * A link to the tracking webpage on the carrier's website. - */ - public function unsetTrackingUrl(): void - { - $this->trackingUrl = []; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment was requested. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment was requested. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that - * preparation - * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: - * 33.123Z"). - */ - public function getInProgressAt(): ?string - { - return $this->inProgressAt; - } - - /** - * Sets In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that - * preparation - * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: - * 33.123Z"). - * - * @maps in_progress_at - */ - public function setInProgressAt(?string $inProgressAt): void - { - $this->inProgressAt = $inProgressAt; - } - - /** - * Returns Packaged At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the - * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. - * 123Z"). - */ - public function getPackagedAt(): ?string - { - return $this->packagedAt; - } - - /** - * Sets Packaged At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the - * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. - * 123Z"). - * - * @maps packaged_at - */ - public function setPackagedAt(?string $packagedAt): void - { - $this->packagedAt = $packagedAt; - } - - /** - * Returns Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getExpectedShippedAt(): ?string - { - if (count($this->expectedShippedAt) == 0) { - return null; - } - return $this->expectedShippedAt['value']; - } - - /** - * Sets Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps expected_shipped_at - */ - public function setExpectedShippedAt(?string $expectedShippedAt): void - { - $this->expectedShippedAt['value'] = $expectedShippedAt; - } - - /** - * Unsets Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetExpectedShippedAt(): void - { - $this->expectedShippedAt = []; - } - - /** - * Returns Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that - * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getShippedAt(): ?string - { - return $this->shippedAt; - } - - /** - * Sets Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that - * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps shipped_at - */ - public function setShippedAt(?string $shippedAt): void - { - $this->shippedAt = $shippedAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - if (count($this->canceledAt) == 0) { - return null; - } - return $this->canceledAt['value']; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt['value'] = $canceledAt; - } - - /** - * Unsets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCanceledAt(): void - { - $this->canceledAt = []; - } - - /** - * Returns Cancel Reason. - * A description of why the shipment was canceled. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * A description of why the shipment was canceled. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * A description of why the shipment was canceled. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Failed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getFailedAt(): ?string - { - return $this->failedAt; - } - - /** - * Sets Failed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps failed_at - */ - public function setFailedAt(?string $failedAt): void - { - $this->failedAt = $failedAt; - } - - /** - * Returns Failure Reason. - * A description of why the shipment failed to be completed. - */ - public function getFailureReason(): ?string - { - if (count($this->failureReason) == 0) { - return null; - } - return $this->failureReason['value']; - } - - /** - * Sets Failure Reason. - * A description of why the shipment failed to be completed. - * - * @maps failure_reason - */ - public function setFailureReason(?string $failureReason): void - { - $this->failureReason['value'] = $failureReason; - } - - /** - * Unsets Failure Reason. - * A description of why the shipment failed to be completed. - */ - public function unsetFailureReason(): void - { - $this->failureReason = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (!empty($this->carrier)) { - $json['carrier'] = $this->carrier['value']; - } - if (!empty($this->shippingNote)) { - $json['shipping_note'] = $this->shippingNote['value']; - } - if (!empty($this->shippingType)) { - $json['shipping_type'] = $this->shippingType['value']; - } - if (!empty($this->trackingNumber)) { - $json['tracking_number'] = $this->trackingNumber['value']; - } - if (!empty($this->trackingUrl)) { - $json['tracking_url'] = $this->trackingUrl['value']; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (isset($this->inProgressAt)) { - $json['in_progress_at'] = $this->inProgressAt; - } - if (isset($this->packagedAt)) { - $json['packaged_at'] = $this->packagedAt; - } - if (!empty($this->expectedShippedAt)) { - $json['expected_shipped_at'] = $this->expectedShippedAt['value']; - } - if (isset($this->shippedAt)) { - $json['shipped_at'] = $this->shippedAt; - } - if (!empty($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt['value']; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (isset($this->failedAt)) { - $json['failed_at'] = $this->failedAt; - } - if (!empty($this->failureReason)) { - $json['failure_reason'] = $this->failureReason['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/FulfillmentState.php b/src/Models/FulfillmentState.php deleted file mode 100644 index 67c2fc58..00000000 --- a/src/Models/FulfillmentState.php +++ /dev/null @@ -1,42 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Bank Account. - * Represents a bank account. For more information about - * linking a bank account to a Square account, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - */ - public function getBankAccount(): ?BankAccount - { - return $this->bankAccount; - } - - /** - * Sets Bank Account. - * Represents a bank account. For more information about - * linking a bank account to a Square account, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - * - * @maps bank_account - */ - public function setBankAccount(?BankAccount $bankAccount): void - { - $this->bankAccount = $bankAccount; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->bankAccount)) { - $json['bank_account'] = $this->bankAccount; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetBankAccountResponse.php b/src/Models/GetBankAccountResponse.php deleted file mode 100644 index b7ac78bd..00000000 --- a/src/Models/GetBankAccountResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Bank Account. - * Represents a bank account. For more information about - * linking a bank account to a Square account, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - */ - public function getBankAccount(): ?BankAccount - { - return $this->bankAccount; - } - - /** - * Sets Bank Account. - * Represents a bank account. For more information about - * linking a bank account to a Square account, see - * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). - * - * @maps bank_account - */ - public function setBankAccount(?BankAccount $bankAccount): void - { - $this->bankAccount = $bankAccount; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->bankAccount)) { - $json['bank_account'] = $this->bankAccount; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetBreakTypeResponse.php b/src/Models/GetBreakTypeResponse.php deleted file mode 100644 index 9d4ffbeb..00000000 --- a/src/Models/GetBreakTypeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -breakType; - } - - /** - * Sets Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - * - * @maps break_type - */ - public function setBreakType(?BreakType $breakType): void - { - $this->breakType = $breakType; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->breakType)) { - $json['break_type'] = $this->breakType; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetDeviceCodeResponse.php b/src/Models/GetDeviceCodeResponse.php deleted file mode 100644 index d6abc19e..00000000 --- a/src/Models/GetDeviceCodeResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Device Code. - */ - public function getDeviceCode(): ?DeviceCode - { - return $this->deviceCode; - } - - /** - * Sets Device Code. - * - * @maps device_code - */ - public function setDeviceCode(?DeviceCode $deviceCode): void - { - $this->deviceCode = $deviceCode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->deviceCode)) { - $json['device_code'] = $this->deviceCode; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetDeviceResponse.php b/src/Models/GetDeviceResponse.php deleted file mode 100644 index 2b7bed2b..00000000 --- a/src/Models/GetDeviceResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Device. - */ - public function getDevice(): ?Device - { - return $this->device; - } - - /** - * Sets Device. - * - * @maps device - */ - public function setDevice(?Device $device): void - { - $this->device = $device; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->device)) { - $json['device'] = $this->device; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetEmployeeWageResponse.php b/src/Models/GetEmployeeWageResponse.php deleted file mode 100644 index 30427d09..00000000 --- a/src/Models/GetEmployeeWageResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -employeeWage; - } - - /** - * Sets Employee Wage. - * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` - * property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity: - * TeamMemberWage). - * - * @maps employee_wage - */ - public function setEmployeeWage(?EmployeeWage $employeeWage): void - { - $this->employeeWage = $employeeWage; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->employeeWage)) { - $json['employee_wage'] = $this->employeeWage; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetInvoiceResponse.php b/src/Models/GetInvoiceResponse.php deleted file mode 100644 index 38f0b13d..00000000 --- a/src/Models/GetInvoiceResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @maps invoice - */ - public function setInvoice(?Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoice)) { - $json['invoice'] = $this->invoice; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetPaymentRefundResponse.php b/src/Models/GetPaymentRefundResponse.php deleted file mode 100644 index 157a7136..00000000 --- a/src/Models/GetPaymentRefundResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a refund of a payment made using Square. Contains information about - * the original payment and the amount of money refunded. - */ - public function getRefund(): ?PaymentRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a refund of a payment made using Square. Contains information about - * the original payment and the amount of money refunded. - * - * @maps refund - */ - public function setRefund(?PaymentRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetPaymentResponse.php b/src/Models/GetPaymentResponse.php deleted file mode 100644 index 02055b8d..00000000 --- a/src/Models/GetPaymentResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetPayoutResponse.php b/src/Models/GetPayoutResponse.php deleted file mode 100644 index bc8a1966..00000000 --- a/src/Models/GetPayoutResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -payout; - } - - /** - * Sets Payout. - * An accounting of the amount owed the seller and record of the actual transfer to their - * external bank account or to the Square balance. - * - * @maps payout - */ - public function setPayout(?Payout $payout): void - { - $this->payout = $payout; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->payout)) { - $json['payout'] = $this->payout; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetShiftResponse.php b/src/Models/GetShiftResponse.php deleted file mode 100644 index 0030f3b6..00000000 --- a/src/Models/GetShiftResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -shift; - } - - /** - * Sets Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - * - * @maps shift - */ - public function setShift(?Shift $shift): void - { - $this->shift = $shift; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->shift)) { - $json['shift'] = $this->shift; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetTeamMemberWageResponse.php b/src/Models/GetTeamMemberWageResponse.php deleted file mode 100644 index 6d670c54..00000000 --- a/src/Models/GetTeamMemberWageResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -teamMemberWage; - } - - /** - * Sets Team Member Wage. - * The hourly wage rate that a team member earns on a `Shift` for doing the job - * specified by the `title` property of this object. - * - * @maps team_member_wage - */ - public function setTeamMemberWage(?TeamMemberWage $teamMemberWage): void - { - $this->teamMemberWage = $teamMemberWage; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberWage)) { - $json['team_member_wage'] = $this->teamMemberWage; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetTerminalActionResponse.php b/src/Models/GetTerminalActionResponse.php deleted file mode 100644 index dd2cab4d..00000000 --- a/src/Models/GetTerminalActionResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Action. - * Represents an action processed by the Square Terminal. - */ - public function getAction(): ?TerminalAction - { - return $this->action; - } - - /** - * Sets Action. - * Represents an action processed by the Square Terminal. - * - * @maps action - */ - public function setAction(?TerminalAction $action): void - { - $this->action = $action; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->action)) { - $json['action'] = $this->action; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetTerminalCheckoutResponse.php b/src/Models/GetTerminalCheckoutResponse.php deleted file mode 100644 index b0c42389..00000000 --- a/src/Models/GetTerminalCheckoutResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Checkout. - * Represents a checkout processed by the Square Terminal. - */ - public function getCheckout(): ?TerminalCheckout - { - return $this->checkout; - } - - /** - * Sets Checkout. - * Represents a checkout processed by the Square Terminal. - * - * @maps checkout - */ - public function setCheckout(?TerminalCheckout $checkout): void - { - $this->checkout = $checkout; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->checkout)) { - $json['checkout'] = $this->checkout; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetTerminalRefundResponse.php b/src/Models/GetTerminalRefundResponse.php deleted file mode 100644 index 8ba58fdf..00000000 --- a/src/Models/GetTerminalRefundResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - */ - public function getRefund(): ?TerminalRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit - * network) payment refunds. - * - * @maps refund - */ - public function setRefund(?TerminalRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCard.php b/src/Models/GiftCard.php deleted file mode 100644 index 192f6f35..00000000 --- a/src/Models/GiftCard.php +++ /dev/null @@ -1,304 +0,0 @@ -type = $type; - } - - /** - * Returns Id. - * The Square-assigned ID of the gift card. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the gift card. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Type. - * Indicates the gift card type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates the gift card type. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Gan Source. - * Indicates the source that generated the gift card - * account number (GAN). - */ - public function getGanSource(): ?string - { - return $this->ganSource; - } - - /** - * Sets Gan Source. - * Indicates the source that generated the gift card - * account number (GAN). - * - * @maps gan_source - */ - public function setGanSource(?string $ganSource): void - { - $this->ganSource = $ganSource; - } - - /** - * Returns State. - * Indicates the gift card state. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * Indicates the gift card state. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Balance Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBalanceMoney(): ?Money - { - return $this->balanceMoney; - } - - /** - * Sets Balance Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps balance_money - */ - public function setBalanceMoney(?Money $balanceMoney): void - { - $this->balanceMoney = $balanceMoney; - } - - /** - * Returns Gan. - * The gift card account number (GAN). Buyers can use the GAN to make purchases or check - * the gift card balance. - */ - public function getGan(): ?string - { - if (count($this->gan) == 0) { - return null; - } - return $this->gan['value']; - } - - /** - * Sets Gan. - * The gift card account number (GAN). Buyers can use the GAN to make purchases or check - * the gift card balance. - * - * @maps gan - */ - public function setGan(?string $gan): void - { - $this->gan['value'] = $gan; - } - - /** - * Unsets Gan. - * The gift card account number (GAN). Buyers can use the GAN to make purchases or check - * the gift card balance. - */ - public function unsetGan(): void - { - $this->gan = []; - } - - /** - * Returns Created At. - * The timestamp when the gift card was created, in RFC 3339 format. - * In the case of a digital gift card, it is the time when you create a card - * (using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). - * In the case of a plastic gift card, it is the time when Square associates the card with the - * seller at the time of activation. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the gift card was created, in RFC 3339 format. - * In the case of a digital gift card, it is the time when you create a card - * (using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). - * In the case of a plastic gift card, it is the time when Square associates the card with the - * seller at the time of activation. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. - * - * @return string[]|null - */ - public function getCustomerIds(): ?array - { - return $this->customerIds; - } - - /** - * Sets Customer Ids. - * The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. - * - * @maps customer_ids - * - * @param string[]|null $customerIds - */ - public function setCustomerIds(?array $customerIds): void - { - $this->customerIds = $customerIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['type'] = $this->type; - if (isset($this->ganSource)) { - $json['gan_source'] = $this->ganSource; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->balanceMoney)) { - $json['balance_money'] = $this->balanceMoney; - } - if (!empty($this->gan)) { - $json['gan'] = $this->gan['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->customerIds)) { - $json['customer_ids'] = $this->customerIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivity.php b/src/Models/GiftCardActivity.php deleted file mode 100644 index 018faab0..00000000 --- a/src/Models/GiftCardActivity.php +++ /dev/null @@ -1,715 +0,0 @@ -type = $type; - $this->locationId = $locationId; - } - - /** - * Returns Id. - * The Square-assigned ID of the gift card activity. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the gift card activity. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Type. - * Indicates the type of [gift card activity]($m/GiftCardActivity). - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates the type of [gift card activity]($m/GiftCardActivity). - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Location Id. - * The ID of the [business location](entity:Location) where the activity occurred. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the [business location](entity:Location) where the activity occurred. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Created At. - * The timestamp when the gift card activity was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the gift card activity was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Gift Card Id. - * The gift card ID. When creating a gift card activity, `gift_card_id` is not required if - * `gift_card_gan` is specified. - */ - public function getGiftCardId(): ?string - { - if (count($this->giftCardId) == 0) { - return null; - } - return $this->giftCardId['value']; - } - - /** - * Sets Gift Card Id. - * The gift card ID. When creating a gift card activity, `gift_card_id` is not required if - * `gift_card_gan` is specified. - * - * @maps gift_card_id - */ - public function setGiftCardId(?string $giftCardId): void - { - $this->giftCardId['value'] = $giftCardId; - } - - /** - * Unsets Gift Card Id. - * The gift card ID. When creating a gift card activity, `gift_card_id` is not required if - * `gift_card_gan` is specified. - */ - public function unsetGiftCardId(): void - { - $this->giftCardId = []; - } - - /** - * Returns Gift Card Gan. - * The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` - * is not required if `gift_card_id` is specified. - */ - public function getGiftCardGan(): ?string - { - if (count($this->giftCardGan) == 0) { - return null; - } - return $this->giftCardGan['value']; - } - - /** - * Sets Gift Card Gan. - * The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` - * is not required if `gift_card_id` is specified. - * - * @maps gift_card_gan - */ - public function setGiftCardGan(?string $giftCardGan): void - { - $this->giftCardGan['value'] = $giftCardGan; - } - - /** - * Unsets Gift Card Gan. - * The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` - * is not required if `gift_card_id` is specified. - */ - public function unsetGiftCardGan(): void - { - $this->giftCardGan = []; - } - - /** - * Returns Gift Card Balance Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getGiftCardBalanceMoney(): ?Money - { - return $this->giftCardBalanceMoney; - } - - /** - * Sets Gift Card Balance Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps gift_card_balance_money - */ - public function setGiftCardBalanceMoney(?Money $giftCardBalanceMoney): void - { - $this->giftCardBalanceMoney = $giftCardBalanceMoney; - } - - /** - * Returns Load Activity Details. - * Represents details about a `LOAD` [gift card activity type]($m/GiftCardActivityType). - */ - public function getLoadActivityDetails(): ?GiftCardActivityLoad - { - return $this->loadActivityDetails; - } - - /** - * Sets Load Activity Details. - * Represents details about a `LOAD` [gift card activity type]($m/GiftCardActivityType). - * - * @maps load_activity_details - */ - public function setLoadActivityDetails(?GiftCardActivityLoad $loadActivityDetails): void - { - $this->loadActivityDetails = $loadActivityDetails; - } - - /** - * Returns Activate Activity Details. - * Represents details about an `ACTIVATE` [gift card activity type]($m/GiftCardActivityType). - */ - public function getActivateActivityDetails(): ?GiftCardActivityActivate - { - return $this->activateActivityDetails; - } - - /** - * Sets Activate Activity Details. - * Represents details about an `ACTIVATE` [gift card activity type]($m/GiftCardActivityType). - * - * @maps activate_activity_details - */ - public function setActivateActivityDetails(?GiftCardActivityActivate $activateActivityDetails): void - { - $this->activateActivityDetails = $activateActivityDetails; - } - - /** - * Returns Redeem Activity Details. - * Represents details about a `REDEEM` [gift card activity type]($m/GiftCardActivityType). - */ - public function getRedeemActivityDetails(): ?GiftCardActivityRedeem - { - return $this->redeemActivityDetails; - } - - /** - * Sets Redeem Activity Details. - * Represents details about a `REDEEM` [gift card activity type]($m/GiftCardActivityType). - * - * @maps redeem_activity_details - */ - public function setRedeemActivityDetails(?GiftCardActivityRedeem $redeemActivityDetails): void - { - $this->redeemActivityDetails = $redeemActivityDetails; - } - - /** - * Returns Clear Balance Activity Details. - * Represents details about a `CLEAR_BALANCE` [gift card activity type]($m/GiftCardActivityType). - */ - public function getClearBalanceActivityDetails(): ?GiftCardActivityClearBalance - { - return $this->clearBalanceActivityDetails; - } - - /** - * Sets Clear Balance Activity Details. - * Represents details about a `CLEAR_BALANCE` [gift card activity type]($m/GiftCardActivityType). - * - * @maps clear_balance_activity_details - */ - public function setClearBalanceActivityDetails(?GiftCardActivityClearBalance $clearBalanceActivityDetails): void - { - $this->clearBalanceActivityDetails = $clearBalanceActivityDetails; - } - - /** - * Returns Deactivate Activity Details. - * Represents details about a `DEACTIVATE` [gift card activity type]($m/GiftCardActivityType). - */ - public function getDeactivateActivityDetails(): ?GiftCardActivityDeactivate - { - return $this->deactivateActivityDetails; - } - - /** - * Sets Deactivate Activity Details. - * Represents details about a `DEACTIVATE` [gift card activity type]($m/GiftCardActivityType). - * - * @maps deactivate_activity_details - */ - public function setDeactivateActivityDetails(?GiftCardActivityDeactivate $deactivateActivityDetails): void - { - $this->deactivateActivityDetails = $deactivateActivityDetails; - } - - /** - * Returns Adjust Increment Activity Details. - * Represents details about an `ADJUST_INCREMENT` [gift card activity type]($m/GiftCardActivityType). - */ - public function getAdjustIncrementActivityDetails(): ?GiftCardActivityAdjustIncrement - { - return $this->adjustIncrementActivityDetails; - } - - /** - * Sets Adjust Increment Activity Details. - * Represents details about an `ADJUST_INCREMENT` [gift card activity type]($m/GiftCardActivityType). - * - * @maps adjust_increment_activity_details - */ - public function setAdjustIncrementActivityDetails( - ?GiftCardActivityAdjustIncrement $adjustIncrementActivityDetails - ): void { - $this->adjustIncrementActivityDetails = $adjustIncrementActivityDetails; - } - - /** - * Returns Adjust Decrement Activity Details. - * Represents details about an `ADJUST_DECREMENT` [gift card activity type]($m/GiftCardActivityType). - */ - public function getAdjustDecrementActivityDetails(): ?GiftCardActivityAdjustDecrement - { - return $this->adjustDecrementActivityDetails; - } - - /** - * Sets Adjust Decrement Activity Details. - * Represents details about an `ADJUST_DECREMENT` [gift card activity type]($m/GiftCardActivityType). - * - * @maps adjust_decrement_activity_details - */ - public function setAdjustDecrementActivityDetails( - ?GiftCardActivityAdjustDecrement $adjustDecrementActivityDetails - ): void { - $this->adjustDecrementActivityDetails = $adjustDecrementActivityDetails; - } - - /** - * Returns Refund Activity Details. - * Represents details about a `REFUND` [gift card activity type]($m/GiftCardActivityType). - */ - public function getRefundActivityDetails(): ?GiftCardActivityRefund - { - return $this->refundActivityDetails; - } - - /** - * Sets Refund Activity Details. - * Represents details about a `REFUND` [gift card activity type]($m/GiftCardActivityType). - * - * @maps refund_activity_details - */ - public function setRefundActivityDetails(?GiftCardActivityRefund $refundActivityDetails): void - { - $this->refundActivityDetails = $refundActivityDetails; - } - - /** - * Returns Unlinked Activity Refund Activity Details. - * Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity - * type]($m/GiftCardActivityType). - */ - public function getUnlinkedActivityRefundActivityDetails(): ?GiftCardActivityUnlinkedActivityRefund - { - return $this->unlinkedActivityRefundActivityDetails; - } - - /** - * Sets Unlinked Activity Refund Activity Details. - * Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity - * type]($m/GiftCardActivityType). - * - * @maps unlinked_activity_refund_activity_details - */ - public function setUnlinkedActivityRefundActivityDetails( - ?GiftCardActivityUnlinkedActivityRefund $unlinkedActivityRefundActivityDetails - ): void { - $this->unlinkedActivityRefundActivityDetails = $unlinkedActivityRefundActivityDetails; - } - - /** - * Returns Import Activity Details. - * Represents details about an `IMPORT` [gift card activity type]($m/GiftCardActivityType). - * This activity type is used when Square imports a third-party gift card, in which case the - * `gan_source` of the gift card is set to `OTHER`. - */ - public function getImportActivityDetails(): ?GiftCardActivityImport - { - return $this->importActivityDetails; - } - - /** - * Sets Import Activity Details. - * Represents details about an `IMPORT` [gift card activity type]($m/GiftCardActivityType). - * This activity type is used when Square imports a third-party gift card, in which case the - * `gan_source` of the gift card is set to `OTHER`. - * - * @maps import_activity_details - */ - public function setImportActivityDetails(?GiftCardActivityImport $importActivityDetails): void - { - $this->importActivityDetails = $importActivityDetails; - } - - /** - * Returns Block Activity Details. - * Represents details about a `BLOCK` [gift card activity type]($m/GiftCardActivityType). - */ - public function getBlockActivityDetails(): ?GiftCardActivityBlock - { - return $this->blockActivityDetails; - } - - /** - * Sets Block Activity Details. - * Represents details about a `BLOCK` [gift card activity type]($m/GiftCardActivityType). - * - * @maps block_activity_details - */ - public function setBlockActivityDetails(?GiftCardActivityBlock $blockActivityDetails): void - { - $this->blockActivityDetails = $blockActivityDetails; - } - - /** - * Returns Unblock Activity Details. - * Represents details about an `UNBLOCK` [gift card activity type]($m/GiftCardActivityType). - */ - public function getUnblockActivityDetails(): ?GiftCardActivityUnblock - { - return $this->unblockActivityDetails; - } - - /** - * Sets Unblock Activity Details. - * Represents details about an `UNBLOCK` [gift card activity type]($m/GiftCardActivityType). - * - * @maps unblock_activity_details - */ - public function setUnblockActivityDetails(?GiftCardActivityUnblock $unblockActivityDetails): void - { - $this->unblockActivityDetails = $unblockActivityDetails; - } - - /** - * Returns Import Reversal Activity Details. - * Represents details about an `IMPORT_REVERSAL` [gift card activity type]($m/GiftCardActivityType). - */ - public function getImportReversalActivityDetails(): ?GiftCardActivityImportReversal - { - return $this->importReversalActivityDetails; - } - - /** - * Sets Import Reversal Activity Details. - * Represents details about an `IMPORT_REVERSAL` [gift card activity type]($m/GiftCardActivityType). - * - * @maps import_reversal_activity_details - */ - public function setImportReversalActivityDetails( - ?GiftCardActivityImportReversal $importReversalActivityDetails - ): void { - $this->importReversalActivityDetails = $importReversalActivityDetails; - } - - /** - * Returns Transfer Balance to Activity Details. - * Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type]($m/GiftCardActivityType). - */ - public function getTransferBalanceToActivityDetails(): ?GiftCardActivityTransferBalanceTo - { - return $this->transferBalanceToActivityDetails; - } - - /** - * Sets Transfer Balance to Activity Details. - * Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type]($m/GiftCardActivityType). - * - * @maps transfer_balance_to_activity_details - */ - public function setTransferBalanceToActivityDetails( - ?GiftCardActivityTransferBalanceTo $transferBalanceToActivityDetails - ): void { - $this->transferBalanceToActivityDetails = $transferBalanceToActivityDetails; - } - - /** - * Returns Transfer Balance From Activity Details. - * Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity - * type]($m/GiftCardActivityType). - */ - public function getTransferBalanceFromActivityDetails(): ?GiftCardActivityTransferBalanceFrom - { - return $this->transferBalanceFromActivityDetails; - } - - /** - * Sets Transfer Balance From Activity Details. - * Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity - * type]($m/GiftCardActivityType). - * - * @maps transfer_balance_from_activity_details - */ - public function setTransferBalanceFromActivityDetails( - ?GiftCardActivityTransferBalanceFrom $transferBalanceFromActivityDetails - ): void { - $this->transferBalanceFromActivityDetails = $transferBalanceFromActivityDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['type'] = $this->type; - $json['location_id'] = $this->locationId; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->giftCardId)) { - $json['gift_card_id'] = $this->giftCardId['value']; - } - if (!empty($this->giftCardGan)) { - $json['gift_card_gan'] = $this->giftCardGan['value']; - } - if (isset($this->giftCardBalanceMoney)) { - $json['gift_card_balance_money'] = $this->giftCardBalanceMoney; - } - if (isset($this->loadActivityDetails)) { - $json['load_activity_details'] = $this->loadActivityDetails; - } - if (isset($this->activateActivityDetails)) { - $json['activate_activity_details'] = $this->activateActivityDetails; - } - if (isset($this->redeemActivityDetails)) { - $json['redeem_activity_details'] = $this->redeemActivityDetails; - } - if (isset($this->clearBalanceActivityDetails)) { - $json['clear_balance_activity_details'] = $this->clearBalanceActivityDetails; - } - if (isset($this->deactivateActivityDetails)) { - $json['deactivate_activity_details'] = $this->deactivateActivityDetails; - } - if (isset($this->adjustIncrementActivityDetails)) { - $json['adjust_increment_activity_details'] = $this->adjustIncrementActivityDetails; - } - if (isset($this->adjustDecrementActivityDetails)) { - $json['adjust_decrement_activity_details'] = $this->adjustDecrementActivityDetails; - } - if (isset($this->refundActivityDetails)) { - $json['refund_activity_details'] = $this->refundActivityDetails; - } - if (isset($this->unlinkedActivityRefundActivityDetails)) { - $json['unlinked_activity_refund_activity_details'] = $this->unlinkedActivityRefundActivityDetails; - } - if (isset($this->importActivityDetails)) { - $json['import_activity_details'] = $this->importActivityDetails; - } - if (isset($this->blockActivityDetails)) { - $json['block_activity_details'] = $this->blockActivityDetails; - } - if (isset($this->unblockActivityDetails)) { - $json['unblock_activity_details'] = $this->unblockActivityDetails; - } - if (isset($this->importReversalActivityDetails)) { - $json['import_reversal_activity_details'] = $this->importReversalActivityDetails; - } - if (isset($this->transferBalanceToActivityDetails)) { - $json['transfer_balance_to_activity_details'] = $this->transferBalanceToActivityDetails; - } - if (isset($this->transferBalanceFromActivityDetails)) { - $json['transfer_balance_from_activity_details'] = $this->transferBalanceFromActivityDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityActivate.php b/src/Models/GiftCardActivityActivate.php deleted file mode 100644 index b81de1f7..00000000 --- a/src/Models/GiftCardActivityActivate.php +++ /dev/null @@ -1,293 +0,0 @@ -amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function getLineItemUid(): ?string - { - if (count($this->lineItemUid) == 0) { - return null; - } - return $this->lineItemUid['value']; - } - - /** - * Sets Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * - * @maps line_item_uid - */ - public function setLineItemUid(?string $lineItemUid): void - { - $this->lineItemUid['value'] = $lineItemUid; - } - - /** - * Unsets Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function unsetLineItemUid(): void - { - $this->lineItemUid = []; - } - - /** - * Returns Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to an order or payment. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to an order or payment. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to an order or payment. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the gift card purchase, such as a credit card ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - * - * @return string[]|null - */ - public function getBuyerPaymentInstrumentIds(): ?array - { - if (count($this->buyerPaymentInstrumentIds) == 0) { - return null; - } - return $this->buyerPaymentInstrumentIds['value']; - } - - /** - * Sets Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the gift card purchase, such as a credit card ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - * - * @maps buyer_payment_instrument_ids - * - * @param string[]|null $buyerPaymentInstrumentIds - */ - public function setBuyerPaymentInstrumentIds(?array $buyerPaymentInstrumentIds): void - { - $this->buyerPaymentInstrumentIds['value'] = $buyerPaymentInstrumentIds; - } - - /** - * Unsets Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the gift card purchase, such as a credit card ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - */ - public function unsetBuyerPaymentInstrumentIds(): void - { - $this->buyerPaymentInstrumentIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (!empty($this->lineItemUid)) { - $json['line_item_uid'] = $this->lineItemUid['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->buyerPaymentInstrumentIds)) { - $json['buyer_payment_instrument_ids'] = $this->buyerPaymentInstrumentIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityAdjustDecrement.php b/src/Models/GiftCardActivityAdjustDecrement.php deleted file mode 100644 index 403fc3ce..00000000 --- a/src/Models/GiftCardActivityAdjustDecrement.php +++ /dev/null @@ -1,108 +0,0 @@ -amountMoney = $amountMoney; - $this->reason = $reason; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reason. - * Indicates the reason for deducting money from a [gift card]($m/GiftCard). - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * Indicates the reason for deducting money from a [gift card]($m/GiftCard). - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityAdjustDecrementReason.php b/src/Models/GiftCardActivityAdjustDecrementReason.php deleted file mode 100644 index 0aba02b1..00000000 --- a/src/Models/GiftCardActivityAdjustDecrementReason.php +++ /dev/null @@ -1,33 +0,0 @@ -amountMoney = $amountMoney; - $this->reason = $reason; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reason. - * Indicates the reason for adding money to a [gift card]($m/GiftCard). - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * Indicates the reason for adding money to a [gift card]($m/GiftCard). - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityAdjustIncrementReason.php b/src/Models/GiftCardActivityAdjustIncrementReason.php deleted file mode 100644 index 14e4434f..00000000 --- a/src/Models/GiftCardActivityAdjustIncrementReason.php +++ /dev/null @@ -1,27 +0,0 @@ -reason; - } - - /** - * Sets Reason. - * Indicates the reason for blocking a [gift card]($m/GiftCard). - * - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityBlockReason.php b/src/Models/GiftCardActivityBlockReason.php deleted file mode 100644 index fbf34cc2..00000000 --- a/src/Models/GiftCardActivityBlockReason.php +++ /dev/null @@ -1,16 +0,0 @@ -reason = $reason; - } - - /** - * Returns Reason. - * Indicates the reason for clearing the balance of a [gift card]($m/GiftCard). - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * Indicates the reason for clearing the balance of a [gift card]($m/GiftCard). - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityClearBalanceReason.php b/src/Models/GiftCardActivityClearBalanceReason.php deleted file mode 100644 index 1514d9c0..00000000 --- a/src/Models/GiftCardActivityClearBalanceReason.php +++ /dev/null @@ -1,29 +0,0 @@ -reason = $reason; - } - - /** - * Returns Reason. - * Indicates the reason for deactivating a [gift card]($m/GiftCard). - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * Indicates the reason for deactivating a [gift card]($m/GiftCard). - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityDeactivateReason.php b/src/Models/GiftCardActivityDeactivateReason.php deleted file mode 100644 index bbc04937..00000000 --- a/src/Models/GiftCardActivityDeactivateReason.php +++ /dev/null @@ -1,32 +0,0 @@ -amountMoney = $amountMoney; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityImportReversal.php b/src/Models/GiftCardActivityImportReversal.php deleted file mode 100644 index 4a5f04c0..00000000 --- a/src/Models/GiftCardActivityImportReversal.php +++ /dev/null @@ -1,79 +0,0 @@ -amountMoney = $amountMoney; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityLoad.php b/src/Models/GiftCardActivityLoad.php deleted file mode 100644 index a8af2519..00000000 --- a/src/Models/GiftCardActivityLoad.php +++ /dev/null @@ -1,302 +0,0 @@ -amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID in the - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID in the - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item. - * - * Applications that use the Square Orders API to process orders must specify the order ID in the - * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift - * card. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function getLineItemUid(): ?string - { - if (count($this->lineItemUid) == 0) { - return null; - } - return $this->lineItemUid['value']; - } - - /** - * Sets Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift - * card. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * - * @maps line_item_uid - */ - public function setLineItemUid(?string $lineItemUid): void - { - $this->lineItemUid['value'] = $lineItemUid; - } - - /** - * Unsets Line Item Uid. - * The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift - * card. - * - * Applications that use the Square Orders API to process orders must specify the line item UID - * in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - */ - public function unsetLineItemUid(): void - { - $this->lineItemUid = []; - } - - /** - * Returns Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to - * an order or payment. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to - * an order or payment. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom order processing system can use this field to track information - * related to - * an order or payment. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the order for the additional funds, such as a credit card - * ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - * - * @return string[]|null - */ - public function getBuyerPaymentInstrumentIds(): ?array - { - if (count($this->buyerPaymentInstrumentIds) == 0) { - return null; - } - return $this->buyerPaymentInstrumentIds['value']; - } - - /** - * Sets Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the order for the additional funds, such as a credit card - * ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - * - * @maps buyer_payment_instrument_ids - * - * @param string[]|null $buyerPaymentInstrumentIds - */ - public function setBuyerPaymentInstrumentIds(?array $buyerPaymentInstrumentIds): void - { - $this->buyerPaymentInstrumentIds['value'] = $buyerPaymentInstrumentIds; - } - - /** - * Unsets Buyer Payment Instrument Ids. - * The payment instrument IDs used to process the order for the additional funds, such as a credit card - * ID - * or bank account ID. - * - * Applications that use a custom order processing system must specify payment instrument IDs in - * the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. - * Square uses this information to perform compliance checks. - * - * For applications that use the Square Orders API to process payments, Square has the necessary - * instrument IDs to perform compliance checks. - * - * Each buyer payment instrument ID can contain a maximum of 255 characters. - */ - public function unsetBuyerPaymentInstrumentIds(): void - { - $this->buyerPaymentInstrumentIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (!empty($this->lineItemUid)) { - $json['line_item_uid'] = $this->lineItemUid['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->buyerPaymentInstrumentIds)) { - $json['buyer_payment_instrument_ids'] = $this->buyerPaymentInstrumentIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityRedeem.php b/src/Models/GiftCardActivityRedeem.php deleted file mode 100644 index 83666224..00000000 --- a/src/Models/GiftCardActivityRedeem.php +++ /dev/null @@ -1,192 +0,0 @@ -amountMoney = $amountMoney; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Payment Id. - * The ID of the payment that represents the gift card redemption. Square populates this field - * if the payment was processed by Square. - */ - public function getPaymentId(): ?string - { - return $this->paymentId; - } - - /** - * Sets Payment Id. - * The ID of the payment that represents the gift card redemption. Square populates this field - * if the payment was processed by Square. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId = $paymentId; - } - - /** - * Returns Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom payment processing system can use this field to track information - * related to an order or payment. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom payment processing system can use this field to track information - * related to an order or payment. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * Applications that use a custom payment processing system can use this field to track information - * related to an order or payment. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Status. - * Indicates the status of a [gift card]($m/GiftCard) redemption. This status is relevant only for - * redemptions made from Square products (such as Square Point of Sale) because Square products use a - * two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` - * status. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates the status of a [gift card]($m/GiftCard) redemption. This status is relevant only for - * redemptions made from Square products (such as Square Point of Sale) because Square products use a - * two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` - * status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - if (isset($this->paymentId)) { - $json['payment_id'] = $this->paymentId; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityRedeemStatus.php b/src/Models/GiftCardActivityRedeemStatus.php deleted file mode 100644 index 872b0d33..00000000 --- a/src/Models/GiftCardActivityRedeemStatus.php +++ /dev/null @@ -1,33 +0,0 @@ -redeemActivityId) == 0) { - return null; - } - return $this->redeemActivityId['value']; - } - - /** - * Sets Redeem Activity Id. - * The ID of the refunded `REDEEM` gift card activity. Square populates this field if the - * `payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request - * represents a gift card redemption. - * - * For applications that use a custom payment processing system, this field is required when creating - * a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card. - * - * @maps redeem_activity_id - */ - public function setRedeemActivityId(?string $redeemActivityId): void - { - $this->redeemActivityId['value'] = $redeemActivityId; - } - - /** - * Unsets Redeem Activity Id. - * The ID of the refunded `REDEEM` gift card activity. Square populates this field if the - * `payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request - * represents a gift card redemption. - * - * For applications that use a custom payment processing system, this field is required when creating - * a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card. - */ - public function unsetRedeemActivityId(): void - { - $this->redeemActivityId = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Payment Id. - * The ID of the refunded payment. Square populates this field if the refund is for a - * payment processed by Square. This field matches the `payment_id` in the corresponding - * [RefundPayment](api-endpoint:Refunds-RefundPayment) request. - */ - public function getPaymentId(): ?string - { - return $this->paymentId; - } - - /** - * Sets Payment Id. - * The ID of the refunded payment. Square populates this field if the refund is for a - * payment processed by Square. This field matches the `payment_id` in the corresponding - * [RefundPayment](api-endpoint:Refunds-RefundPayment) request. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId = $paymentId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->redeemActivityId)) { - $json['redeem_activity_id'] = $this->redeemActivityId['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->paymentId)) { - $json['payment_id'] = $this->paymentId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityTransferBalanceFrom.php b/src/Models/GiftCardActivityTransferBalanceFrom.php deleted file mode 100644 index 6aadd4d8..00000000 --- a/src/Models/GiftCardActivityTransferBalanceFrom.php +++ /dev/null @@ -1,109 +0,0 @@ -transferToGiftCardId = $transferToGiftCardId; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Transfer to Gift Card Id. - * The ID of the gift card to which the specified amount was transferred. - */ - public function getTransferToGiftCardId(): string - { - return $this->transferToGiftCardId; - } - - /** - * Sets Transfer to Gift Card Id. - * The ID of the gift card to which the specified amount was transferred. - * - * @required - * @maps transfer_to_gift_card_id - */ - public function setTransferToGiftCardId(string $transferToGiftCardId): void - { - $this->transferToGiftCardId = $transferToGiftCardId; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['transfer_to_gift_card_id'] = $this->transferToGiftCardId; - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityTransferBalanceTo.php b/src/Models/GiftCardActivityTransferBalanceTo.php deleted file mode 100644 index 0c44556d..00000000 --- a/src/Models/GiftCardActivityTransferBalanceTo.php +++ /dev/null @@ -1,108 +0,0 @@ -transferFromGiftCardId = $transferFromGiftCardId; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Transfer From Gift Card Id. - * The ID of the gift card from which the specified amount was transferred. - */ - public function getTransferFromGiftCardId(): string - { - return $this->transferFromGiftCardId; - } - - /** - * Sets Transfer From Gift Card Id. - * The ID of the gift card from which the specified amount was transferred. - * - * @required - * @maps transfer_from_gift_card_id - */ - public function setTransferFromGiftCardId(string $transferFromGiftCardId): void - { - $this->transferFromGiftCardId = $transferFromGiftCardId; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['transfer_from_gift_card_id'] = $this->transferFromGiftCardId; - $json['amount_money'] = $this->amountMoney; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityType.php b/src/Models/GiftCardActivityType.php deleted file mode 100644 index d76a375e..00000000 --- a/src/Models/GiftCardActivityType.php +++ /dev/null @@ -1,103 +0,0 @@ -reason; - } - - /** - * Sets Reason. - * Indicates the reason for unblocking a [gift card]($m/GiftCard). - * - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reason'] = $this->reason; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardActivityUnblockReason.php b/src/Models/GiftCardActivityUnblockReason.php deleted file mode 100644 index 33965124..00000000 --- a/src/Models/GiftCardActivityUnblockReason.php +++ /dev/null @@ -1,16 +0,0 @@ -amountMoney = $amountMoney; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID that associates the gift card activity with an entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Payment Id. - * The ID of the refunded payment. This field is not used starting in Square version 2022-06-16. - */ - public function getPaymentId(): ?string - { - return $this->paymentId; - } - - /** - * Sets Payment Id. - * The ID of the refunded payment. This field is not used starting in Square version 2022-06-16. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId = $paymentId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->paymentId)) { - $json['payment_id'] = $this->paymentId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GiftCardGANSource.php b/src/Models/GiftCardGANSource.php deleted file mode 100644 index ee773bfa..00000000 --- a/src/Models/GiftCardGANSource.php +++ /dev/null @@ -1,25 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID generated by Square for the - * `InventoryAdjustment`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Reference Id. - * An optional ID provided by the application to tie the - * `InventoryAdjustment` to an external - * system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional ID provided by the application to tie the - * `InventoryAdjustment` to an external - * system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional ID provided by the application to tie the - * `InventoryAdjustment` to an external - * system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns From State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getFromState(): ?string - { - return $this->fromState; - } - - /** - * Sets From State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps from_state - */ - public function setFromState(?string $fromState): void - { - $this->fromState = $fromState; - } - - /** - * Returns To State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getToState(): ?string - { - return $this->toState; - } - - /** - * Sets To State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps to_state - */ - public function setToState(?string $toState): void - { - $this->toState = $toState; - } - - /** - * Returns Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function getCatalogObjectType(): ?string - { - if (count($this->catalogObjectType) == 0) { - return null; - } - return $this->catalogObjectType['value']; - } - - /** - * Sets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - * - * @maps catalog_object_type - */ - public function setCatalogObjectType(?string $catalogObjectType): void - { - $this->catalogObjectType['value'] = $catalogObjectType; - } - - /** - * Unsets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function unsetCatalogObjectType(): void - { - $this->catalogObjectType = []; - } - - /** - * Returns Quantity. - * The number of items affected by the adjustment as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The number of items affected by the adjustment as a decimal string. - * Can support up to 5 digits after the decimal point. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The number of items affected by the adjustment as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalPriceMoney(): ?Money - { - return $this->totalPriceMoney; - } - - /** - * Sets Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_price_money - */ - public function setTotalPriceMoney(?Money $totalPriceMoney): void - { - $this->totalPriceMoney = $totalPriceMoney; - } - - /** - * Returns Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - */ - public function getOccurredAt(): ?string - { - if (count($this->occurredAt) == 0) { - return null; - } - return $this->occurredAt['value']; - } - - /** - * Sets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - * - * @maps occurred_at - */ - public function setOccurredAt(?string $occurredAt): void - { - $this->occurredAt['value'] = $occurredAt; - } - - /** - * Unsets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - */ - public function unsetOccurredAt(): void - { - $this->occurredAt = []; - } - - /** - * Returns Created At. - * An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Source. - * Represents information about the application used to generate a change. - */ - public function getSource(): ?SourceApplication - { - return $this->source; - } - - /** - * Sets Source. - * Represents information about the application used to generate a change. - * - * @maps source - */ - public function setSource(?SourceApplication $source): void - { - $this->source = $source; - } - - /** - * Returns Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory adjustment. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory adjustment. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory adjustment. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory adjustment. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory adjustment. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory adjustment. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Transaction Id. - * The Square-generated ID of the [Transaction](entity:Transaction) that - * caused the adjustment. Only relevant for payment-related state - * transitions. - */ - public function getTransactionId(): ?string - { - return $this->transactionId; - } - - /** - * Sets Transaction Id. - * The Square-generated ID of the [Transaction](entity:Transaction) that - * caused the adjustment. Only relevant for payment-related state - * transitions. - * - * @maps transaction_id - */ - public function setTransactionId(?string $transactionId): void - { - $this->transactionId = $transactionId; - } - - /** - * Returns Refund Id. - * The Square-generated ID of the [Refund](entity:Refund) that - * caused the adjustment. Only relevant for refund-related state - * transitions. - */ - public function getRefundId(): ?string - { - return $this->refundId; - } - - /** - * Sets Refund Id. - * The Square-generated ID of the [Refund](entity:Refund) that - * caused the adjustment. Only relevant for refund-related state - * transitions. - * - * @maps refund_id - */ - public function setRefundId(?string $refundId): void - { - $this->refundId = $refundId; - } - - /** - * Returns Purchase Order Id. - * The Square-generated ID of the purchase order that caused the - * adjustment. Only relevant for state transitions from the Square for Retail - * app. - */ - public function getPurchaseOrderId(): ?string - { - return $this->purchaseOrderId; - } - - /** - * Sets Purchase Order Id. - * The Square-generated ID of the purchase order that caused the - * adjustment. Only relevant for state transitions from the Square for Retail - * app. - * - * @maps purchase_order_id - */ - public function setPurchaseOrderId(?string $purchaseOrderId): void - { - $this->purchaseOrderId = $purchaseOrderId; - } - - /** - * Returns Goods Receipt Id. - * The Square-generated ID of the goods receipt that caused the - * adjustment. Only relevant for state transitions from the Square for Retail - * app. - */ - public function getGoodsReceiptId(): ?string - { - return $this->goodsReceiptId; - } - - /** - * Sets Goods Receipt Id. - * The Square-generated ID of the goods receipt that caused the - * adjustment. Only relevant for state transitions from the Square for Retail - * app. - * - * @maps goods_receipt_id - */ - public function setGoodsReceiptId(?string $goodsReceiptId): void - { - $this->goodsReceiptId = $goodsReceiptId; - } - - /** - * Returns Adjustment Group. - */ - public function getAdjustmentGroup(): ?InventoryAdjustmentGroup - { - return $this->adjustmentGroup; - } - - /** - * Sets Adjustment Group. - * - * @maps adjustment_group - */ - public function setAdjustmentGroup(?InventoryAdjustmentGroup $adjustmentGroup): void - { - $this->adjustmentGroup = $adjustmentGroup; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->fromState)) { - $json['from_state'] = $this->fromState; - } - if (isset($this->toState)) { - $json['to_state'] = $this->toState; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogObjectType)) { - $json['catalog_object_type'] = $this->catalogObjectType['value']; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (isset($this->totalPriceMoney)) { - $json['total_price_money'] = $this->totalPriceMoney; - } - if (!empty($this->occurredAt)) { - $json['occurred_at'] = $this->occurredAt['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (isset($this->transactionId)) { - $json['transaction_id'] = $this->transactionId; - } - if (isset($this->refundId)) { - $json['refund_id'] = $this->refundId; - } - if (isset($this->purchaseOrderId)) { - $json['purchase_order_id'] = $this->purchaseOrderId; - } - if (isset($this->goodsReceiptId)) { - $json['goods_receipt_id'] = $this->goodsReceiptId; - } - if (isset($this->adjustmentGroup)) { - $json['adjustment_group'] = $this->adjustmentGroup; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InventoryAdjustmentGroup.php b/src/Models/InventoryAdjustmentGroup.php deleted file mode 100644 index 7ac6d036..00000000 --- a/src/Models/InventoryAdjustmentGroup.php +++ /dev/null @@ -1,143 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID generated by Square for the - * `InventoryAdjustmentGroup`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Root Adjustment Id. - * The inventory adjustment of the composed variation. - */ - public function getRootAdjustmentId(): ?string - { - return $this->rootAdjustmentId; - } - - /** - * Sets Root Adjustment Id. - * The inventory adjustment of the composed variation. - * - * @maps root_adjustment_id - */ - public function setRootAdjustmentId(?string $rootAdjustmentId): void - { - $this->rootAdjustmentId = $rootAdjustmentId; - } - - /** - * Returns From State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getFromState(): ?string - { - return $this->fromState; - } - - /** - * Sets From State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps from_state - */ - public function setFromState(?string $fromState): void - { - $this->fromState = $fromState; - } - - /** - * Returns To State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getToState(): ?string - { - return $this->toState; - } - - /** - * Sets To State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps to_state - */ - public function setToState(?string $toState): void - { - $this->toState = $toState; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->rootAdjustmentId)) { - $json['root_adjustment_id'] = $this->rootAdjustmentId; - } - if (isset($this->fromState)) { - $json['from_state'] = $this->fromState; - } - if (isset($this->toState)) { - $json['to_state'] = $this->toState; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InventoryAlertType.php b/src/Models/InventoryAlertType.php deleted file mode 100644 index 23d5452c..00000000 --- a/src/Models/InventoryAlertType.php +++ /dev/null @@ -1,22 +0,0 @@ -type; - } - - /** - * Sets Type. - * Indicates how the inventory change was applied to a tracked product quantity. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Physical Count. - * Represents the quantity of an item variation that is physically present - * at a specific location, verified by a seller or a seller's employee. For example, - * a physical count might come from an employee counting the item variations on - * hand or from syncing with an external system. - */ - public function getPhysicalCount(): ?InventoryPhysicalCount - { - return $this->physicalCount; - } - - /** - * Sets Physical Count. - * Represents the quantity of an item variation that is physically present - * at a specific location, verified by a seller or a seller's employee. For example, - * a physical count might come from an employee counting the item variations on - * hand or from syncing with an external system. - * - * @maps physical_count - */ - public function setPhysicalCount(?InventoryPhysicalCount $physicalCount): void - { - $this->physicalCount = $physicalCount; - } - - /** - * Returns Adjustment. - * Represents a change in state or quantity of product inventory at a - * particular time and location. - */ - public function getAdjustment(): ?InventoryAdjustment - { - return $this->adjustment; - } - - /** - * Sets Adjustment. - * Represents a change in state or quantity of product inventory at a - * particular time and location. - * - * @maps adjustment - */ - public function setAdjustment(?InventoryAdjustment $adjustment): void - { - $this->adjustment = $adjustment; - } - - /** - * Returns Transfer. - * Represents the transfer of a quantity of product inventory at a - * particular time from one location to another. - */ - public function getTransfer(): ?InventoryTransfer - { - return $this->transfer; - } - - /** - * Sets Transfer. - * Represents the transfer of a quantity of product inventory at a - * particular time from one location to another. - * - * @maps transfer - */ - public function setTransfer(?InventoryTransfer $transfer): void - { - $this->transfer = $transfer; - } - - /** - * Returns Measurement Unit. - * Represents the unit used to measure a `CatalogItemVariation` and - * specifies the precision for decimal quantities. - */ - public function getMeasurementUnit(): ?CatalogMeasurementUnit - { - return $this->measurementUnit; - } - - /** - * Sets Measurement Unit. - * Represents the unit used to measure a `CatalogItemVariation` and - * specifies the precision for decimal quantities. - * - * @maps measurement_unit - */ - public function setMeasurementUnit(?CatalogMeasurementUnit $measurementUnit): void - { - $this->measurementUnit = $measurementUnit; - } - - /** - * Returns Measurement Unit Id. - * The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the - * catalog measurement unit associated with the inventory change. - */ - public function getMeasurementUnitId(): ?string - { - return $this->measurementUnitId; - } - - /** - * Sets Measurement Unit Id. - * The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the - * catalog measurement unit associated with the inventory change. - * - * @maps measurement_unit_id - */ - public function setMeasurementUnitId(?string $measurementUnitId): void - { - $this->measurementUnitId = $measurementUnitId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->physicalCount)) { - $json['physical_count'] = $this->physicalCount; - } - if (isset($this->adjustment)) { - $json['adjustment'] = $this->adjustment; - } - if (isset($this->transfer)) { - $json['transfer'] = $this->transfer; - } - if (isset($this->measurementUnit)) { - $json['measurement_unit'] = $this->measurementUnit; - } - if (isset($this->measurementUnitId)) { - $json['measurement_unit_id'] = $this->measurementUnitId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InventoryChangeType.php b/src/Models/InventoryChangeType.php deleted file mode 100644 index 3321db5e..00000000 --- a/src/Models/InventoryChangeType.php +++ /dev/null @@ -1,27 +0,0 @@ -catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function getCatalogObjectType(): ?string - { - if (count($this->catalogObjectType) == 0) { - return null; - } - return $this->catalogObjectType['value']; - } - - /** - * Sets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - * - * @maps catalog_object_type - */ - public function setCatalogObjectType(?string $catalogObjectType): void - { - $this->catalogObjectType['value'] = $catalogObjectType; - } - - /** - * Unsets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function unsetCatalogObjectType(): void - { - $this->catalogObjectType = []; - } - - /** - * Returns State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Quantity. - * The number of items affected by the estimated count as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The number of items affected by the estimated count as a decimal string. - * Can support up to 5 digits after the decimal point. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The number of items affected by the estimated count as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Calculated At. - * An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment - * affecting - * the estimated count is received. - */ - public function getCalculatedAt(): ?string - { - return $this->calculatedAt; - } - - /** - * Sets Calculated At. - * An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment - * affecting - * the estimated count is received. - * - * @maps calculated_at - */ - public function setCalculatedAt(?string $calculatedAt): void - { - $this->calculatedAt = $calculatedAt; - } - - /** - * Returns Is Estimated. - * Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory - * count will not be present in the response of - * any of these endpoints: [BatchChangeInventory]($e/Inventory/BatchChangeInventory), - * [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChanges), - * [BatchRetrieveInventoryCounts]($e/Inventory/BatchRetrieveInventoryCounts), and - * [RetrieveInventoryChanges]($e/Inventory/RetrieveInventoryChanges). - */ - public function getIsEstimated(): ?bool - { - return $this->isEstimated; - } - - /** - * Sets Is Estimated. - * Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory - * count will not be present in the response of - * any of these endpoints: [BatchChangeInventory]($e/Inventory/BatchChangeInventory), - * [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChanges), - * [BatchRetrieveInventoryCounts]($e/Inventory/BatchRetrieveInventoryCounts), and - * [RetrieveInventoryChanges]($e/Inventory/RetrieveInventoryChanges). - * - * @maps is_estimated - */ - public function setIsEstimated(?bool $isEstimated): void - { - $this->isEstimated = $isEstimated; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogObjectType)) { - $json['catalog_object_type'] = $this->catalogObjectType['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (isset($this->calculatedAt)) { - $json['calculated_at'] = $this->calculatedAt; - } - if (isset($this->isEstimated)) { - $json['is_estimated'] = $this->isEstimated; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InventoryPhysicalCount.php b/src/Models/InventoryPhysicalCount.php deleted file mode 100644 index 2b5f5f97..00000000 --- a/src/Models/InventoryPhysicalCount.php +++ /dev/null @@ -1,514 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique Square-generated ID for the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount). - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Reference Id. - * An optional ID provided by the application to tie the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external - * system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional ID provided by the application to tie the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external - * system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional ID provided by the application to tie the - * [InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external - * system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function getCatalogObjectType(): ?string - { - if (count($this->catalogObjectType) == 0) { - return null; - } - return $this->catalogObjectType['value']; - } - - /** - * Sets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - * - * @maps catalog_object_type - */ - public function setCatalogObjectType(?string $catalogObjectType): void - { - $this->catalogObjectType['value'] = $catalogObjectType; - } - - /** - * Unsets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function unsetCatalogObjectType(): void - { - $this->catalogObjectType = []; - } - - /** - * Returns State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items is being tracked. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Quantity. - * The number of items affected by the physical count as a decimal string. - * The number can support up to 5 digits after the decimal point. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The number of items affected by the physical count as a decimal string. - * The number can support up to 5 digits after the decimal point. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The number of items affected by the physical count as a decimal string. - * The number can support up to 5 digits after the decimal point. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Source. - * Represents information about the application used to generate a change. - */ - public function getSource(): ?SourceApplication - { - return $this->source; - } - - /** - * Sets Source. - * Represents information about the application used to generate a change. - * - * @maps source - */ - public function setSource(?SourceApplication $source): void - { - $this->source = $source; - } - - /** - * Returns Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * physical count. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * physical count. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * physical count. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * physical count. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * physical count. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * physical count. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the physical count was examined. For physical count updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - */ - public function getOccurredAt(): ?string - { - if (count($this->occurredAt) == 0) { - return null; - } - return $this->occurredAt['value']; - } - - /** - * Sets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the physical count was examined. For physical count updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - * - * @maps occurred_at - */ - public function setOccurredAt(?string $occurredAt): void - { - $this->occurredAt['value'] = $occurredAt; - } - - /** - * Unsets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the physical count was examined. For physical count updates, the `occurred_at` - * timestamp cannot be older than 24 hours or in the future relative to the - * time of the request. - */ - public function unsetOccurredAt(): void - { - $this->occurredAt = []; - } - - /** - * Returns Created At. - * An RFC 3339-formatted timestamp that indicates when the physical count is received. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * An RFC 3339-formatted timestamp that indicates when the physical count is received. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogObjectType)) { - $json['catalog_object_type'] = $this->catalogObjectType['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->occurredAt)) { - $json['occurred_at'] = $this->occurredAt['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InventoryState.php b/src/Models/InventoryState.php deleted file mode 100644 index 6bab53b4..00000000 --- a/src/Models/InventoryState.php +++ /dev/null @@ -1,111 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID generated by Square for the - * `InventoryTransfer`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Reference Id. - * An optional ID provided by the application to tie the - * `InventoryTransfer` to an external system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional ID provided by the application to tie the - * `InventoryTransfer` to an external system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional ID provided by the application to tie the - * `InventoryTransfer` to an external system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * Indicates the state of a tracked item quantity in the lifecycle of goods. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns From Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked before the transfer. - */ - public function getFromLocationId(): ?string - { - if (count($this->fromLocationId) == 0) { - return null; - } - return $this->fromLocationId['value']; - } - - /** - * Sets From Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked before the transfer. - * - * @maps from_location_id - */ - public function setFromLocationId(?string $fromLocationId): void - { - $this->fromLocationId['value'] = $fromLocationId; - } - - /** - * Unsets From Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked before the transfer. - */ - public function unsetFromLocationId(): void - { - $this->fromLocationId = []; - } - - /** - * Returns To Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked after the transfer. - */ - public function getToLocationId(): ?string - { - if (count($this->toLocationId) == 0) { - return null; - } - return $this->toLocationId['value']; - } - - /** - * Sets To Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked after the transfer. - * - * @maps to_location_id - */ - public function setToLocationId(?string $toLocationId): void - { - $this->toLocationId['value'] = $toLocationId; - } - - /** - * Unsets To Location Id. - * The Square-generated ID of the [Location](entity:Location) where the related - * quantity of items was tracked after the transfer. - */ - public function unsetToLocationId(): void - { - $this->toLocationId = []; - } - - /** - * Returns Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The Square-generated ID of the - * [CatalogObject](entity:CatalogObject) being tracked. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function getCatalogObjectType(): ?string - { - if (count($this->catalogObjectType) == 0) { - return null; - } - return $this->catalogObjectType['value']; - } - - /** - * Sets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - * - * @maps catalog_object_type - */ - public function setCatalogObjectType(?string $catalogObjectType): void - { - $this->catalogObjectType['value'] = $catalogObjectType; - } - - /** - * Unsets Catalog Object Type. - * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. - * - * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field - * value. - * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the - * Square Restaurants app. - */ - public function unsetCatalogObjectType(): void - { - $this->catalogObjectType = []; - } - - /** - * Returns Quantity. - * The number of items affected by the transfer as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The number of items affected by the transfer as a decimal string. - * Can support up to 5 digits after the decimal point. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The number of items affected by the transfer as a decimal string. - * Can support up to 5 digits after the decimal point. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the transfer took place. For write actions, the `occurred_at` timestamp - * cannot be older than 24 hours or in the future relative to the time of the - * request. - */ - public function getOccurredAt(): ?string - { - if (count($this->occurredAt) == 0) { - return null; - } - return $this->occurredAt['value']; - } - - /** - * Sets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the transfer took place. For write actions, the `occurred_at` timestamp - * cannot be older than 24 hours or in the future relative to the time of the - * request. - * - * @maps occurred_at - */ - public function setOccurredAt(?string $occurredAt): void - { - $this->occurredAt['value'] = $occurredAt; - } - - /** - * Unsets Occurred At. - * A client-generated RFC 3339-formatted timestamp that indicates when - * the transfer took place. For write actions, the `occurred_at` timestamp - * cannot be older than 24 hours or in the future relative to the time of the - * request. - */ - public function unsetOccurredAt(): void - { - $this->occurredAt = []; - } - - /** - * Returns Created At. - * An RFC 3339-formatted timestamp that indicates when Square - * received the transfer request. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * An RFC 3339-formatted timestamp that indicates when Square - * received the transfer request. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Source. - * Represents information about the application used to generate a change. - */ - public function getSource(): ?SourceApplication - { - return $this->source; - } - - /** - * Sets Source. - * Represents information about the application used to generate a change. - * - * @maps source - */ - public function setSource(?SourceApplication $source): void - { - $this->source = $source; - } - - /** - * Returns Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory transfer. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory transfer. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The Square-generated ID of the [Employee](entity:Employee) responsible for the - * inventory transfer. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory transfer. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory transfer. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the - * inventory transfer. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (!empty($this->fromLocationId)) { - $json['from_location_id'] = $this->fromLocationId['value']; - } - if (!empty($this->toLocationId)) { - $json['to_location_id'] = $this->toLocationId['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogObjectType)) { - $json['catalog_object_type'] = $this->catalogObjectType['value']; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (!empty($this->occurredAt)) { - $json['occurred_at'] = $this->occurredAt['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Invoice.php b/src/Models/Invoice.php deleted file mode 100644 index 1114ad2b..00000000 --- a/src/Models/Invoice.php +++ /dev/null @@ -1,1057 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the invoice. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Version. - * The Square-assigned version number, which is incremented each time an update is committed to the - * invoice. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The Square-assigned version number, which is incremented each time an update is committed to the - * invoice. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The ID of the location that this invoice is associated with. - * - * If specified in a `CreateInvoice` request, the value must match the `location_id` of the associated - * order. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location that this invoice is associated with. - * - * If specified in a `CreateInvoice` request, the value must match the `location_id` of the associated - * order. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location that this invoice is associated with. - * - * If specified in a `CreateInvoice` request, the value must match the `location_id` of the associated - * order. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) for which the invoice is created. - * This field is required when creating an invoice, and the order must be in the `OPEN` state. - * - * To view the line items and other information for the associated order, call the - * [RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) for which the invoice is created. - * This field is required when creating an invoice, and the order must be in the `OPEN` state. - * - * To view the line items and other information for the associated order, call the - * [RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the [order](entity:Order) for which the invoice is created. - * This field is required when creating an invoice, and the order must be in the `OPEN` state. - * - * To view the line items and other information for the associated order, call the - * [RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Primary Recipient. - * Represents a snapshot of customer data. This object stores customer data that is displayed on the - * invoice - * and that Square uses to deliver the invoice. - * - * When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile - * and populates - * the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is - * published. - * Square updates the customer ID in response to a merge operation, but does not update other fields. - */ - public function getPrimaryRecipient(): ?InvoiceRecipient - { - return $this->primaryRecipient; - } - - /** - * Sets Primary Recipient. - * Represents a snapshot of customer data. This object stores customer data that is displayed on the - * invoice - * and that Square uses to deliver the invoice. - * - * When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile - * and populates - * the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is - * published. - * Square updates the customer ID in response to a merge operation, but does not update other fields. - * - * @maps primary_recipient - */ - public function setPrimaryRecipient(?InvoiceRecipient $primaryRecipient): void - { - $this->primaryRecipient = $primaryRecipient; - } - - /** - * Returns Payment Requests. - * The payment schedule for the invoice, represented by one or more payment requests that - * define payment settings, such as amount due and due date. An invoice supports the following payment - * request combinations: - * - One balance - * - One deposit with one balance - * - 2–12 installments - * - One deposit with 2–12 installments - * - * This field is required when creating an invoice. It must contain at least one payment request. - * All payment requests for the invoice must equal the total order amount. For more information, see - * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish- - * invoices#payment-requests). - * - * Adding `INSTALLMENT` payment requests to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - * - * @return InvoicePaymentRequest[]|null - */ - public function getPaymentRequests(): ?array - { - if (count($this->paymentRequests) == 0) { - return null; - } - return $this->paymentRequests['value']; - } - - /** - * Sets Payment Requests. - * The payment schedule for the invoice, represented by one or more payment requests that - * define payment settings, such as amount due and due date. An invoice supports the following payment - * request combinations: - * - One balance - * - One deposit with one balance - * - 2–12 installments - * - One deposit with 2–12 installments - * - * This field is required when creating an invoice. It must contain at least one payment request. - * All payment requests for the invoice must equal the total order amount. For more information, see - * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish- - * invoices#payment-requests). - * - * Adding `INSTALLMENT` payment requests to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - * - * @maps payment_requests - * - * @param InvoicePaymentRequest[]|null $paymentRequests - */ - public function setPaymentRequests(?array $paymentRequests): void - { - $this->paymentRequests['value'] = $paymentRequests; - } - - /** - * Unsets Payment Requests. - * The payment schedule for the invoice, represented by one or more payment requests that - * define payment settings, such as amount due and due date. An invoice supports the following payment - * request combinations: - * - One balance - * - One deposit with one balance - * - 2–12 installments - * - One deposit with 2–12 installments - * - * This field is required when creating an invoice. It must contain at least one payment request. - * All payment requests for the invoice must equal the total order amount. For more information, see - * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish- - * invoices#payment-requests). - * - * Adding `INSTALLMENT` payment requests to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - */ - public function unsetPaymentRequests(): void - { - $this->paymentRequests = []; - } - - /** - * Returns Delivery Method. - * Indicates how Square delivers the [invoice]($m/Invoice) to the customer. - */ - public function getDeliveryMethod(): ?string - { - return $this->deliveryMethod; - } - - /** - * Sets Delivery Method. - * Indicates how Square delivers the [invoice]($m/Invoice) to the customer. - * - * @maps delivery_method - */ - public function setDeliveryMethod(?string $deliveryMethod): void - { - $this->deliveryMethod = $deliveryMethod; - } - - /** - * Returns Invoice Number. - * A user-friendly invoice number that is displayed on the invoice. The value is unique within a - * location. - * If not provided when creating an invoice, Square assigns a value. - * It increments from 1 and is padded with zeros making it 7 characters long - * (for example, 0000001 and 0000002). - */ - public function getInvoiceNumber(): ?string - { - if (count($this->invoiceNumber) == 0) { - return null; - } - return $this->invoiceNumber['value']; - } - - /** - * Sets Invoice Number. - * A user-friendly invoice number that is displayed on the invoice. The value is unique within a - * location. - * If not provided when creating an invoice, Square assigns a value. - * It increments from 1 and is padded with zeros making it 7 characters long - * (for example, 0000001 and 0000002). - * - * @maps invoice_number - */ - public function setInvoiceNumber(?string $invoiceNumber): void - { - $this->invoiceNumber['value'] = $invoiceNumber; - } - - /** - * Unsets Invoice Number. - * A user-friendly invoice number that is displayed on the invoice. The value is unique within a - * location. - * If not provided when creating an invoice, Square assigns a value. - * It increments from 1 and is padded with zeros making it 7 characters long - * (for example, 0000001 and 0000002). - */ - public function unsetInvoiceNumber(): void - { - $this->invoiceNumber = []; - } - - /** - * Returns Title. - * The title of the invoice, which is displayed on the invoice. - */ - public function getTitle(): ?string - { - if (count($this->title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The title of the invoice, which is displayed on the invoice. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The title of the invoice, which is displayed on the invoice. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Description. - * The description of the invoice, which is displayed on the invoice. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The description of the invoice, which is displayed on the invoice. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The description of the invoice, which is displayed on the invoice. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Scheduled At. - * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. - * After the invoice is published, Square processes the invoice on the specified date, - * according to the delivery method and payment request settings. - * - * If the field is not set, Square processes the invoice immediately after it is published. - */ - public function getScheduledAt(): ?string - { - if (count($this->scheduledAt) == 0) { - return null; - } - return $this->scheduledAt['value']; - } - - /** - * Sets Scheduled At. - * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. - * After the invoice is published, Square processes the invoice on the specified date, - * according to the delivery method and payment request settings. - * - * If the field is not set, Square processes the invoice immediately after it is published. - * - * @maps scheduled_at - */ - public function setScheduledAt(?string $scheduledAt): void - { - $this->scheduledAt['value'] = $scheduledAt; - } - - /** - * Unsets Scheduled At. - * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. - * After the invoice is published, Square processes the invoice on the specified date, - * according to the delivery method and payment request settings. - * - * If the field is not set, Square processes the invoice immediately after it is published. - */ - public function unsetScheduledAt(): void - { - $this->scheduledAt = []; - } - - /** - * Returns Public Url. - * The URL of the Square-hosted invoice page. - * After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice - * page and returns the page URL in the response. - */ - public function getPublicUrl(): ?string - { - return $this->publicUrl; - } - - /** - * Sets Public Url. - * The URL of the Square-hosted invoice page. - * After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice - * page and returns the page URL in the response. - * - * @maps public_url - */ - public function setPublicUrl(?string $publicUrl): void - { - $this->publicUrl = $publicUrl; - } - - /** - * Returns Next Payment Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getNextPaymentAmountMoney(): ?Money - { - return $this->nextPaymentAmountMoney; - } - - /** - * Sets Next Payment Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps next_payment_amount_money - */ - public function setNextPaymentAmountMoney(?Money $nextPaymentAmountMoney): void - { - $this->nextPaymentAmountMoney = $nextPaymentAmountMoney; - } - - /** - * Returns Status. - * Indicates the status of an invoice. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates the status of an invoice. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Timezone. - * The time zone used to interpret calendar dates on the invoice, such as `due_date`. - * When an invoice is created, this field is set to the `timezone` specified for the seller - * location. The value cannot be changed. - * - * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles - * becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp - * of 2021-03-10T08:00:00Z). - */ - public function getTimezone(): ?string - { - return $this->timezone; - } - - /** - * Sets Timezone. - * The time zone used to interpret calendar dates on the invoice, such as `due_date`. - * When an invoice is created, this field is set to the `timezone` specified for the seller - * location. The value cannot be changed. - * - * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles - * becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp - * of 2021-03-10T08:00:00Z). - * - * @maps timezone - */ - public function setTimezone(?string $timezone): void - { - $this->timezone = $timezone; - } - - /** - * Returns Created At. - * The timestamp when the invoice was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the invoice was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the invoice was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the invoice was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Accepted Payment Methods. - * The payment methods that customers can use to pay an [invoice]($m/Invoice) on the Square-hosted - * invoice payment page. - */ - public function getAcceptedPaymentMethods(): ?InvoiceAcceptedPaymentMethods - { - return $this->acceptedPaymentMethods; - } - - /** - * Sets Accepted Payment Methods. - * The payment methods that customers can use to pay an [invoice]($m/Invoice) on the Square-hosted - * invoice payment page. - * - * @maps accepted_payment_methods - */ - public function setAcceptedPaymentMethods(?InvoiceAcceptedPaymentMethods $acceptedPaymentMethods): void - { - $this->acceptedPaymentMethods = $acceptedPaymentMethods; - } - - /** - * Returns Custom Fields. - * Additional seller-defined fields that are displayed on the invoice. For more information, see - * [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). - * - * Adding custom fields to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - * - * Max: 2 custom fields - * - * @return InvoiceCustomField[]|null - */ - public function getCustomFields(): ?array - { - if (count($this->customFields) == 0) { - return null; - } - return $this->customFields['value']; - } - - /** - * Sets Custom Fields. - * Additional seller-defined fields that are displayed on the invoice. For more information, see - * [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). - * - * Adding custom fields to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - * - * Max: 2 custom fields - * - * @maps custom_fields - * - * @param InvoiceCustomField[]|null $customFields - */ - public function setCustomFields(?array $customFields): void - { - $this->customFields['value'] = $customFields; - } - - /** - * Unsets Custom Fields. - * Additional seller-defined fields that are displayed on the invoice. For more information, see - * [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). - * - * Adding custom fields to an invoice requires an - * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus- - * subscription). - * - * Max: 2 custom fields - */ - public function unsetCustomFields(): void - { - $this->customFields = []; - } - - /** - * Returns Subscription Id. - * The ID of the [subscription](entity:Subscription) associated with the invoice. - * This field is present only on subscription billing invoices. - */ - public function getSubscriptionId(): ?string - { - return $this->subscriptionId; - } - - /** - * Sets Subscription Id. - * The ID of the [subscription](entity:Subscription) associated with the invoice. - * This field is present only on subscription billing invoices. - * - * @maps subscription_id - */ - public function setSubscriptionId(?string $subscriptionId): void - { - $this->subscriptionId = $subscriptionId; - } - - /** - * Returns Sale or Service Date. - * The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format. - * This field can be used to specify a past or future date which is displayed on the invoice. - */ - public function getSaleOrServiceDate(): ?string - { - if (count($this->saleOrServiceDate) == 0) { - return null; - } - return $this->saleOrServiceDate['value']; - } - - /** - * Sets Sale or Service Date. - * The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format. - * This field can be used to specify a past or future date which is displayed on the invoice. - * - * @maps sale_or_service_date - */ - public function setSaleOrServiceDate(?string $saleOrServiceDate): void - { - $this->saleOrServiceDate['value'] = $saleOrServiceDate; - } - - /** - * Unsets Sale or Service Date. - * The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format. - * This field can be used to specify a past or future date which is displayed on the invoice. - */ - public function unsetSaleOrServiceDate(): void - { - $this->saleOrServiceDate = []; - } - - /** - * Returns Payment Conditions. - * **France only.** The payment terms and conditions that are displayed on the invoice. For more - * information, - * see [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment- - * conditions). - * - * For countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code - * and - * "Payment conditions are not supported for this location's country" detail if this field is included - * in `CreateInvoice` or `UpdateInvoice` requests. - */ - public function getPaymentConditions(): ?string - { - if (count($this->paymentConditions) == 0) { - return null; - } - return $this->paymentConditions['value']; - } - - /** - * Sets Payment Conditions. - * **France only.** The payment terms and conditions that are displayed on the invoice. For more - * information, - * see [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment- - * conditions). - * - * For countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code - * and - * "Payment conditions are not supported for this location's country" detail if this field is included - * in `CreateInvoice` or `UpdateInvoice` requests. - * - * @maps payment_conditions - */ - public function setPaymentConditions(?string $paymentConditions): void - { - $this->paymentConditions['value'] = $paymentConditions; - } - - /** - * Unsets Payment Conditions. - * **France only.** The payment terms and conditions that are displayed on the invoice. For more - * information, - * see [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment- - * conditions). - * - * For countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code - * and - * "Payment conditions are not supported for this location's country" detail if this field is included - * in `CreateInvoice` or `UpdateInvoice` requests. - */ - public function unsetPaymentConditions(): void - { - $this->paymentConditions = []; - } - - /** - * Returns Store Payment Method Enabled. - * Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank - * transfer as a - * bank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on - * file__ checkbox on the - * invoice payment page. Stored payment information can be used for future automatic payments. The - * default value is `false`. - */ - public function getStorePaymentMethodEnabled(): ?bool - { - if (count($this->storePaymentMethodEnabled) == 0) { - return null; - } - return $this->storePaymentMethodEnabled['value']; - } - - /** - * Sets Store Payment Method Enabled. - * Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank - * transfer as a - * bank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on - * file__ checkbox on the - * invoice payment page. Stored payment information can be used for future automatic payments. The - * default value is `false`. - * - * @maps store_payment_method_enabled - */ - public function setStorePaymentMethodEnabled(?bool $storePaymentMethodEnabled): void - { - $this->storePaymentMethodEnabled['value'] = $storePaymentMethodEnabled; - } - - /** - * Unsets Store Payment Method Enabled. - * Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank - * transfer as a - * bank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on - * file__ checkbox on the - * invoice payment page. Stored payment information can be used for future automatic payments. The - * default value is `false`. - */ - public function unsetStorePaymentMethodEnabled(): void - { - $this->storePaymentMethodEnabled = []; - } - - /** - * Returns Attachments. - * Metadata about the attachments on the invoice. Invoice attachments are managed using the - * [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and - * [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints. - * - * @return InvoiceAttachment[]|null - */ - public function getAttachments(): ?array - { - return $this->attachments; - } - - /** - * Sets Attachments. - * Metadata about the attachments on the invoice. Invoice attachments are managed using the - * [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and - * [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints. - * - * @maps attachments - * - * @param InvoiceAttachment[]|null $attachments - */ - public function setAttachments(?array $attachments): void - { - $this->attachments = $attachments; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->primaryRecipient)) { - $json['primary_recipient'] = $this->primaryRecipient; - } - if (!empty($this->paymentRequests)) { - $json['payment_requests'] = $this->paymentRequests['value']; - } - if (isset($this->deliveryMethod)) { - $json['delivery_method'] = $this->deliveryMethod; - } - if (!empty($this->invoiceNumber)) { - $json['invoice_number'] = $this->invoiceNumber['value']; - } - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (!empty($this->scheduledAt)) { - $json['scheduled_at'] = $this->scheduledAt['value']; - } - if (isset($this->publicUrl)) { - $json['public_url'] = $this->publicUrl; - } - if (isset($this->nextPaymentAmountMoney)) { - $json['next_payment_amount_money'] = $this->nextPaymentAmountMoney; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->timezone)) { - $json['timezone'] = $this->timezone; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->acceptedPaymentMethods)) { - $json['accepted_payment_methods'] = $this->acceptedPaymentMethods; - } - if (!empty($this->customFields)) { - $json['custom_fields'] = $this->customFields['value']; - } - if (isset($this->subscriptionId)) { - $json['subscription_id'] = $this->subscriptionId; - } - if (!empty($this->saleOrServiceDate)) { - $json['sale_or_service_date'] = $this->saleOrServiceDate['value']; - } - if (!empty($this->paymentConditions)) { - $json['payment_conditions'] = $this->paymentConditions['value']; - } - if (!empty($this->storePaymentMethodEnabled)) { - $json['store_payment_method_enabled'] = $this->storePaymentMethodEnabled['value']; - } - if (isset($this->attachments)) { - $json['attachments'] = $this->attachments; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceAcceptedPaymentMethods.php b/src/Models/InvoiceAcceptedPaymentMethods.php deleted file mode 100644 index 91bea549..00000000 --- a/src/Models/InvoiceAcceptedPaymentMethods.php +++ /dev/null @@ -1,275 +0,0 @@ -card) == 0) { - return null; - } - return $this->card['value']; - } - - /** - * Sets Card. - * Indicates whether credit card or debit card payments are accepted. The default value is `false`. - * - * @maps card - */ - public function setCard(?bool $card): void - { - $this->card['value'] = $card; - } - - /** - * Unsets Card. - * Indicates whether credit card or debit card payments are accepted. The default value is `false`. - */ - public function unsetCard(): void - { - $this->card = []; - } - - /** - * Returns Square Gift Card. - * Indicates whether Square gift card payments are accepted. The default value is `false`. - */ - public function getSquareGiftCard(): ?bool - { - if (count($this->squareGiftCard) == 0) { - return null; - } - return $this->squareGiftCard['value']; - } - - /** - * Sets Square Gift Card. - * Indicates whether Square gift card payments are accepted. The default value is `false`. - * - * @maps square_gift_card - */ - public function setSquareGiftCard(?bool $squareGiftCard): void - { - $this->squareGiftCard['value'] = $squareGiftCard; - } - - /** - * Unsets Square Gift Card. - * Indicates whether Square gift card payments are accepted. The default value is `false`. - */ - public function unsetSquareGiftCard(): void - { - $this->squareGiftCard = []; - } - - /** - * Returns Bank Account. - * Indicates whether ACH bank transfer payments are accepted. The default value is `false`. - */ - public function getBankAccount(): ?bool - { - if (count($this->bankAccount) == 0) { - return null; - } - return $this->bankAccount['value']; - } - - /** - * Sets Bank Account. - * Indicates whether ACH bank transfer payments are accepted. The default value is `false`. - * - * @maps bank_account - */ - public function setBankAccount(?bool $bankAccount): void - { - $this->bankAccount['value'] = $bankAccount; - } - - /** - * Unsets Bank Account. - * Indicates whether ACH bank transfer payments are accepted. The default value is `false`. - */ - public function unsetBankAccount(): void - { - $this->bankAccount = []; - } - - /** - * Returns Buy Now Pay Later. - * Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is - * `false`. - * - * This option is allowed only for invoices that have a single payment request of the `BALANCE` type. - * This payment method is - * supported if the seller account accepts Afterpay payments and the seller location is in a country - * where Afterpay - * invoice payments are supported. As a best practice, consider enabling an additional payment method - * when allowing - * `buy_now_pay_later` payments. For more information, including detailed requirements and processing - * limits, see - * [Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices- - * api/overview#buy-now-pay-later). - */ - public function getBuyNowPayLater(): ?bool - { - if (count($this->buyNowPayLater) == 0) { - return null; - } - return $this->buyNowPayLater['value']; - } - - /** - * Sets Buy Now Pay Later. - * Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is - * `false`. - * - * This option is allowed only for invoices that have a single payment request of the `BALANCE` type. - * This payment method is - * supported if the seller account accepts Afterpay payments and the seller location is in a country - * where Afterpay - * invoice payments are supported. As a best practice, consider enabling an additional payment method - * when allowing - * `buy_now_pay_later` payments. For more information, including detailed requirements and processing - * limits, see - * [Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices- - * api/overview#buy-now-pay-later). - * - * @maps buy_now_pay_later - */ - public function setBuyNowPayLater(?bool $buyNowPayLater): void - { - $this->buyNowPayLater['value'] = $buyNowPayLater; - } - - /** - * Unsets Buy Now Pay Later. - * Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is - * `false`. - * - * This option is allowed only for invoices that have a single payment request of the `BALANCE` type. - * This payment method is - * supported if the seller account accepts Afterpay payments and the seller location is in a country - * where Afterpay - * invoice payments are supported. As a best practice, consider enabling an additional payment method - * when allowing - * `buy_now_pay_later` payments. For more information, including detailed requirements and processing - * limits, see - * [Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices- - * api/overview#buy-now-pay-later). - */ - public function unsetBuyNowPayLater(): void - { - $this->buyNowPayLater = []; - } - - /** - * Returns Cash App Pay. - * Indicates whether Cash App payments are accepted. The default value is `false`. - * - * This payment method is supported only for seller [locations](entity:Location) in the United States. - */ - public function getCashAppPay(): ?bool - { - if (count($this->cashAppPay) == 0) { - return null; - } - return $this->cashAppPay['value']; - } - - /** - * Sets Cash App Pay. - * Indicates whether Cash App payments are accepted. The default value is `false`. - * - * This payment method is supported only for seller [locations](entity:Location) in the United States. - * - * @maps cash_app_pay - */ - public function setCashAppPay(?bool $cashAppPay): void - { - $this->cashAppPay['value'] = $cashAppPay; - } - - /** - * Unsets Cash App Pay. - * Indicates whether Cash App payments are accepted. The default value is `false`. - * - * This payment method is supported only for seller [locations](entity:Location) in the United States. - */ - public function unsetCashAppPay(): void - { - $this->cashAppPay = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->card)) { - $json['card'] = $this->card['value']; - } - if (!empty($this->squareGiftCard)) { - $json['square_gift_card'] = $this->squareGiftCard['value']; - } - if (!empty($this->bankAccount)) { - $json['bank_account'] = $this->bankAccount['value']; - } - if (!empty($this->buyNowPayLater)) { - $json['buy_now_pay_later'] = $this->buyNowPayLater['value']; - } - if (!empty($this->cashAppPay)) { - $json['cash_app_pay'] = $this->cashAppPay['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceAttachment.php b/src/Models/InvoiceAttachment.php deleted file mode 100644 index 06cb4ae2..00000000 --- a/src/Models/InvoiceAttachment.php +++ /dev/null @@ -1,234 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the attachment. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Filename. - * The file name of the attachment, which is displayed on the invoice. - */ - public function getFilename(): ?string - { - return $this->filename; - } - - /** - * Sets Filename. - * The file name of the attachment, which is displayed on the invoice. - * - * @maps filename - */ - public function setFilename(?string $filename): void - { - $this->filename = $filename; - } - - /** - * Returns Description. - * The description of the attachment, which is displayed on the invoice. - * This field maps to the seller-defined **Message** field. - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * Sets Description. - * The description of the attachment, which is displayed on the invoice. - * This field maps to the seller-defined **Message** field. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description = $description; - } - - /** - * Returns Filesize. - * The file size of the attachment in bytes. - */ - public function getFilesize(): ?int - { - return $this->filesize; - } - - /** - * Sets Filesize. - * The file size of the attachment in bytes. - * - * @maps filesize - */ - public function setFilesize(?int $filesize): void - { - $this->filesize = $filesize; - } - - /** - * Returns Hash. - * The MD5 hash that was generated from the file contents. - */ - public function getHash(): ?string - { - return $this->hash; - } - - /** - * Sets Hash. - * The MD5 hash that was generated from the file contents. - * - * @maps hash - */ - public function setHash(?string $hash): void - { - $this->hash = $hash; - } - - /** - * Returns Mime Type. - * The mime type of the attachment. - * The following mime types are supported: - * image/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf. - */ - public function getMimeType(): ?string - { - return $this->mimeType; - } - - /** - * Sets Mime Type. - * The mime type of the attachment. - * The following mime types are supported: - * image/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf. - * - * @maps mime_type - */ - public function setMimeType(?string $mimeType): void - { - $this->mimeType = $mimeType; - } - - /** - * Returns Uploaded At. - * The timestamp when the attachment was uploaded, in RFC 3339 format. - */ - public function getUploadedAt(): ?string - { - return $this->uploadedAt; - } - - /** - * Sets Uploaded At. - * The timestamp when the attachment was uploaded, in RFC 3339 format. - * - * @maps uploaded_at - */ - public function setUploadedAt(?string $uploadedAt): void - { - $this->uploadedAt = $uploadedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->filename)) { - $json['filename'] = $this->filename; - } - if (isset($this->description)) { - $json['description'] = $this->description; - } - if (isset($this->filesize)) { - $json['filesize'] = $this->filesize; - } - if (isset($this->hash)) { - $json['hash'] = $this->hash; - } - if (isset($this->mimeType)) { - $json['mime_type'] = $this->mimeType; - } - if (isset($this->uploadedAt)) { - $json['uploaded_at'] = $this->uploadedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceAutomaticPaymentSource.php b/src/Models/InvoiceAutomaticPaymentSource.php deleted file mode 100644 index 7af4a41f..00000000 --- a/src/Models/InvoiceAutomaticPaymentSource.php +++ /dev/null @@ -1,42 +0,0 @@ -label) == 0) { - return null; - } - return $this->label['value']; - } - - /** - * Sets Label. - * The label or title of the custom field. This field is required for a custom field. - * - * @maps label - */ - public function setLabel(?string $label): void - { - $this->label['value'] = $label; - } - - /** - * Unsets Label. - * The label or title of the custom field. This field is required for a custom field. - */ - public function unsetLabel(): void - { - $this->label = []; - } - - /** - * Returns Value. - * The text of the custom field. If omitted, only the label is rendered. - */ - public function getValue(): ?string - { - if (count($this->value) == 0) { - return null; - } - return $this->value['value']; - } - - /** - * Sets Value. - * The text of the custom field. If omitted, only the label is rendered. - * - * @maps value - */ - public function setValue(?string $value): void - { - $this->value['value'] = $value; - } - - /** - * Unsets Value. - * The text of the custom field. If omitted, only the label is rendered. - */ - public function unsetValue(): void - { - $this->value = []; - } - - /** - * Returns Placement. - * Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF - * copies of the invoice. - */ - public function getPlacement(): ?string - { - return $this->placement; - } - - /** - * Sets Placement. - * Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF - * copies of the invoice. - * - * @maps placement - */ - public function setPlacement(?string $placement): void - { - $this->placement = $placement; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->label)) { - $json['label'] = $this->label['value']; - } - if (!empty($this->value)) { - $json['value'] = $this->value['value']; - } - if (isset($this->placement)) { - $json['placement'] = $this->placement; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceCustomFieldPlacement.php b/src/Models/InvoiceCustomFieldPlacement.php deleted file mode 100644 index 7058c95f..00000000 --- a/src/Models/InvoiceCustomFieldPlacement.php +++ /dev/null @@ -1,22 +0,0 @@ -locationIds = $locationIds; - } - - /** - * Returns Location Ids. - * Limits the search to the specified locations. A location is required. - * In the current implementation, only one location can be specified. - * - * @return string[] - */ - public function getLocationIds(): array - { - return $this->locationIds; - } - - /** - * Sets Location Ids. - * Limits the search to the specified locations. A location is required. - * In the current implementation, only one location can be specified. - * - * @required - * @maps location_ids - * - * @param string[] $locationIds - */ - public function setLocationIds(array $locationIds): void - { - $this->locationIds = $locationIds; - } - - /** - * Returns Customer Ids. - * Limits the search to the specified customers, within the specified locations. - * Specifying a customer is optional. In the current implementation, - * a maximum of one customer can be specified. - * - * @return string[]|null - */ - public function getCustomerIds(): ?array - { - if (count($this->customerIds) == 0) { - return null; - } - return $this->customerIds['value']; - } - - /** - * Sets Customer Ids. - * Limits the search to the specified customers, within the specified locations. - * Specifying a customer is optional. In the current implementation, - * a maximum of one customer can be specified. - * - * @maps customer_ids - * - * @param string[]|null $customerIds - */ - public function setCustomerIds(?array $customerIds): void - { - $this->customerIds['value'] = $customerIds; - } - - /** - * Unsets Customer Ids. - * Limits the search to the specified customers, within the specified locations. - * Specifying a customer is optional. In the current implementation, - * a maximum of one customer can be specified. - */ - public function unsetCustomerIds(): void - { - $this->customerIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_ids'] = $this->locationIds; - if (!empty($this->customerIds)) { - $json['customer_ids'] = $this->customerIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoicePaymentReminder.php b/src/Models/InvoicePaymentReminder.php deleted file mode 100644 index 076f5bf8..00000000 --- a/src/Models/InvoicePaymentReminder.php +++ /dev/null @@ -1,206 +0,0 @@ -uid; - } - - /** - * Sets Uid. - * A Square-assigned ID that uniquely identifies the reminder within the - * `InvoicePaymentRequest`. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid = $uid; - } - - /** - * Returns Relative Scheduled Days. - * The number of days before (a negative number) or after (a positive number) - * the payment request `due_date` when the reminder is sent. For example, -3 indicates that - * the reminder should be sent 3 days before the payment request `due_date`. - */ - public function getRelativeScheduledDays(): ?int - { - if (count($this->relativeScheduledDays) == 0) { - return null; - } - return $this->relativeScheduledDays['value']; - } - - /** - * Sets Relative Scheduled Days. - * The number of days before (a negative number) or after (a positive number) - * the payment request `due_date` when the reminder is sent. For example, -3 indicates that - * the reminder should be sent 3 days before the payment request `due_date`. - * - * @maps relative_scheduled_days - */ - public function setRelativeScheduledDays(?int $relativeScheduledDays): void - { - $this->relativeScheduledDays['value'] = $relativeScheduledDays; - } - - /** - * Unsets Relative Scheduled Days. - * The number of days before (a negative number) or after (a positive number) - * the payment request `due_date` when the reminder is sent. For example, -3 indicates that - * the reminder should be sent 3 days before the payment request `due_date`. - */ - public function unsetRelativeScheduledDays(): void - { - $this->relativeScheduledDays = []; - } - - /** - * Returns Message. - * The reminder message. - */ - public function getMessage(): ?string - { - if (count($this->message) == 0) { - return null; - } - return $this->message['value']; - } - - /** - * Sets Message. - * The reminder message. - * - * @maps message - */ - public function setMessage(?string $message): void - { - $this->message['value'] = $message; - } - - /** - * Unsets Message. - * The reminder message. - */ - public function unsetMessage(): void - { - $this->message = []; - } - - /** - * Returns Status. - * The status of a payment request reminder. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of a payment request reminder. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Sent At. - * If sent, the timestamp when the reminder was sent, in RFC 3339 format. - */ - public function getSentAt(): ?string - { - return $this->sentAt; - } - - /** - * Sets Sent At. - * If sent, the timestamp when the reminder was sent, in RFC 3339 format. - * - * @maps sent_at - */ - public function setSentAt(?string $sentAt): void - { - $this->sentAt = $sentAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->uid)) { - $json['uid'] = $this->uid; - } - if (!empty($this->relativeScheduledDays)) { - $json['relative_scheduled_days'] = $this->relativeScheduledDays['value']; - } - if (!empty($this->message)) { - $json['message'] = $this->message['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->sentAt)) { - $json['sent_at'] = $this->sentAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoicePaymentReminderStatus.php b/src/Models/InvoicePaymentReminderStatus.php deleted file mode 100644 index 122eb192..00000000 --- a/src/Models/InvoicePaymentReminderStatus.php +++ /dev/null @@ -1,35 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * The Square-generated ID of the payment request in an [invoice](entity:Invoice). - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * The Square-generated ID of the payment request in an [invoice](entity:Invoice). - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Request Method. - * Specifies the action for Square to take for processing the invoice. For example, - * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at - * version 2021-01-21. The corresponding `request_method` field is replaced by the - * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. - */ - public function getRequestMethod(): ?string - { - return $this->requestMethod; - } - - /** - * Sets Request Method. - * Specifies the action for Square to take for processing the invoice. For example, - * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at - * version 2021-01-21. The corresponding `request_method` field is replaced by the - * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. - * - * @maps request_method - */ - public function setRequestMethod(?string $requestMethod): void - { - $this->requestMethod = $requestMethod; - } - - /** - * Returns Request Type. - * Indicates the type of the payment request. For more information, see - * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish- - * invoices#payment-requests). - */ - public function getRequestType(): ?string - { - return $this->requestType; - } - - /** - * Sets Request Type. - * Indicates the type of the payment request. For more information, see - * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish- - * invoices#payment-requests). - * - * @maps request_type - */ - public function setRequestType(?string $requestType): void - { - $this->requestType = $requestType; - } - - /** - * Returns Due Date. - * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This - * field - * is required to create a payment request. If an `automatic_payment_source` is defined for the request, - * Square - * charges the payment source on this date. - * - * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a - * `timezone` - * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals - * a UTC - * timestamp of 2021-03-10T08:00:00Z). - */ - public function getDueDate(): ?string - { - if (count($this->dueDate) == 0) { - return null; - } - return $this->dueDate['value']; - } - - /** - * Sets Due Date. - * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This - * field - * is required to create a payment request. If an `automatic_payment_source` is defined for the request, - * Square - * charges the payment source on this date. - * - * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a - * `timezone` - * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals - * a UTC - * timestamp of 2021-03-10T08:00:00Z). - * - * @maps due_date - */ - public function setDueDate(?string $dueDate): void - { - $this->dueDate['value'] = $dueDate; - } - - /** - * Unsets Due Date. - * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This - * field - * is required to create a payment request. If an `automatic_payment_source` is defined for the request, - * Square - * charges the payment source on this date. - * - * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a - * `timezone` - * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals - * a UTC - * timestamp of 2021-03-10T08:00:00Z). - */ - public function unsetDueDate(): void - { - $this->dueDate = []; - } - - /** - * Returns Fixed Amount Requested Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getFixedAmountRequestedMoney(): ?Money - { - return $this->fixedAmountRequestedMoney; - } - - /** - * Sets Fixed Amount Requested Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps fixed_amount_requested_money - */ - public function setFixedAmountRequestedMoney(?Money $fixedAmountRequestedMoney): void - { - $this->fixedAmountRequestedMoney = $fixedAmountRequestedMoney; - } - - /** - * Returns Percentage Requested. - * Specifies the amount for the payment request in percentage: - * - * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. - * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less - * the deposit, if requested. The sum of the `percentage_requested` in all installment - * payment requests must be equal to 100. - * - * You cannot specify this when the payment `request_type` is `BALANCE` or when the - * payment request specifies the `fixed_amount_requested_money` field. - */ - public function getPercentageRequested(): ?string - { - if (count($this->percentageRequested) == 0) { - return null; - } - return $this->percentageRequested['value']; - } - - /** - * Sets Percentage Requested. - * Specifies the amount for the payment request in percentage: - * - * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. - * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less - * the deposit, if requested. The sum of the `percentage_requested` in all installment - * payment requests must be equal to 100. - * - * You cannot specify this when the payment `request_type` is `BALANCE` or when the - * payment request specifies the `fixed_amount_requested_money` field. - * - * @maps percentage_requested - */ - public function setPercentageRequested(?string $percentageRequested): void - { - $this->percentageRequested['value'] = $percentageRequested; - } - - /** - * Unsets Percentage Requested. - * Specifies the amount for the payment request in percentage: - * - * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. - * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less - * the deposit, if requested. The sum of the `percentage_requested` in all installment - * payment requests must be equal to 100. - * - * You cannot specify this when the payment `request_type` is `BALANCE` or when the - * payment request specifies the `fixed_amount_requested_money` field. - */ - public function unsetPercentageRequested(): void - { - $this->percentageRequested = []; - } - - /** - * Returns Tipping Enabled. - * If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) - * provides a place for the customer to pay a tip. - * - * This field is allowed only on the final payment request - * and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. - */ - public function getTippingEnabled(): ?bool - { - if (count($this->tippingEnabled) == 0) { - return null; - } - return $this->tippingEnabled['value']; - } - - /** - * Sets Tipping Enabled. - * If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) - * provides a place for the customer to pay a tip. - * - * This field is allowed only on the final payment request - * and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. - * - * @maps tipping_enabled - */ - public function setTippingEnabled(?bool $tippingEnabled): void - { - $this->tippingEnabled['value'] = $tippingEnabled; - } - - /** - * Unsets Tipping Enabled. - * If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) - * provides a place for the customer to pay a tip. - * - * This field is allowed only on the final payment request - * and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. - */ - public function unsetTippingEnabled(): void - { - $this->tippingEnabled = []; - } - - /** - * Returns Automatic Payment Source. - * Indicates the automatic payment method for an [invoice payment request]($m/InvoicePaymentRequest). - */ - public function getAutomaticPaymentSource(): ?string - { - return $this->automaticPaymentSource; - } - - /** - * Sets Automatic Payment Source. - * Indicates the automatic payment method for an [invoice payment request]($m/InvoicePaymentRequest). - * - * @maps automatic_payment_source - */ - public function setAutomaticPaymentSource(?string $automaticPaymentSource): void - { - $this->automaticPaymentSource = $automaticPaymentSource; - } - - /** - * Returns Card Id. - * The ID of the credit or debit card on file to charge for the payment request. To get the cards on - * file for a customer, - * call [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice - * recipient. - */ - public function getCardId(): ?string - { - if (count($this->cardId) == 0) { - return null; - } - return $this->cardId['value']; - } - - /** - * Sets Card Id. - * The ID of the credit or debit card on file to charge for the payment request. To get the cards on - * file for a customer, - * call [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice - * recipient. - * - * @maps card_id - */ - public function setCardId(?string $cardId): void - { - $this->cardId['value'] = $cardId; - } - - /** - * Unsets Card Id. - * The ID of the credit or debit card on file to charge for the payment request. To get the cards on - * file for a customer, - * call [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice - * recipient. - */ - public function unsetCardId(): void - { - $this->cardId = []; - } - - /** - * Returns Reminders. - * A list of one or more reminders to send for the payment request. - * - * @return InvoicePaymentReminder[]|null - */ - public function getReminders(): ?array - { - if (count($this->reminders) == 0) { - return null; - } - return $this->reminders['value']; - } - - /** - * Sets Reminders. - * A list of one or more reminders to send for the payment request. - * - * @maps reminders - * - * @param InvoicePaymentReminder[]|null $reminders - */ - public function setReminders(?array $reminders): void - { - $this->reminders['value'] = $reminders; - } - - /** - * Unsets Reminders. - * A list of one or more reminders to send for the payment request. - */ - public function unsetReminders(): void - { - $this->reminders = []; - } - - /** - * Returns Computed Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getComputedAmountMoney(): ?Money - { - return $this->computedAmountMoney; - } - - /** - * Sets Computed Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps computed_amount_money - */ - public function setComputedAmountMoney(?Money $computedAmountMoney): void - { - $this->computedAmountMoney = $computedAmountMoney; - } - - /** - * Returns Total Completed Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalCompletedAmountMoney(): ?Money - { - return $this->totalCompletedAmountMoney; - } - - /** - * Sets Total Completed Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_completed_amount_money - */ - public function setTotalCompletedAmountMoney(?Money $totalCompletedAmountMoney): void - { - $this->totalCompletedAmountMoney = $totalCompletedAmountMoney; - } - - /** - * Returns Rounding Adjustment Included Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getRoundingAdjustmentIncludedMoney(): ?Money - { - return $this->roundingAdjustmentIncludedMoney; - } - - /** - * Sets Rounding Adjustment Included Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps rounding_adjustment_included_money - */ - public function setRoundingAdjustmentIncludedMoney(?Money $roundingAdjustmentIncludedMoney): void - { - $this->roundingAdjustmentIncludedMoney = $roundingAdjustmentIncludedMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (isset($this->requestMethod)) { - $json['request_method'] = $this->requestMethod; - } - if (isset($this->requestType)) { - $json['request_type'] = $this->requestType; - } - if (!empty($this->dueDate)) { - $json['due_date'] = $this->dueDate['value']; - } - if (isset($this->fixedAmountRequestedMoney)) { - $json['fixed_amount_requested_money'] = $this->fixedAmountRequestedMoney; - } - if (!empty($this->percentageRequested)) { - $json['percentage_requested'] = $this->percentageRequested['value']; - } - if (!empty($this->tippingEnabled)) { - $json['tipping_enabled'] = $this->tippingEnabled['value']; - } - if (isset($this->automaticPaymentSource)) { - $json['automatic_payment_source'] = $this->automaticPaymentSource; - } - if (!empty($this->cardId)) { - $json['card_id'] = $this->cardId['value']; - } - if (!empty($this->reminders)) { - $json['reminders'] = $this->reminders['value']; - } - if (isset($this->computedAmountMoney)) { - $json['computed_amount_money'] = $this->computedAmountMoney; - } - if (isset($this->totalCompletedAmountMoney)) { - $json['total_completed_amount_money'] = $this->totalCompletedAmountMoney; - } - if (isset($this->roundingAdjustmentIncludedMoney)) { - $json['rounding_adjustment_included_money'] = $this->roundingAdjustmentIncludedMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceQuery.php b/src/Models/InvoiceQuery.php deleted file mode 100644 index fa37ff1a..00000000 --- a/src/Models/InvoiceQuery.php +++ /dev/null @@ -1,95 +0,0 @@ -filter = $filter; - } - - /** - * Returns Filter. - * Describes query filters to apply. - */ - public function getFilter(): InvoiceFilter - { - return $this->filter; - } - - /** - * Sets Filter. - * Describes query filters to apply. - * - * @required - * @maps filter - */ - public function setFilter(InvoiceFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Identifies the sort field and sort order. - */ - public function getSort(): ?InvoiceSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Identifies the sort field and sort order. - * - * @maps sort - */ - public function setSort(?InvoiceSort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['filter'] = $this->filter; - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceRecipient.php b/src/Models/InvoiceRecipient.php deleted file mode 100644 index a89644fa..00000000 --- a/src/Models/InvoiceRecipient.php +++ /dev/null @@ -1,289 +0,0 @@ -customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the customer. This is the customer profile ID that - * you provide when creating a draft invoice. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the customer. This is the customer profile ID that - * you provide when creating a draft invoice. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Given Name. - * The recipient's given (that is, first) name. - */ - public function getGivenName(): ?string - { - return $this->givenName; - } - - /** - * Sets Given Name. - * The recipient's given (that is, first) name. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName = $givenName; - } - - /** - * Returns Family Name. - * The recipient's family (that is, last) name. - */ - public function getFamilyName(): ?string - { - return $this->familyName; - } - - /** - * Sets Family Name. - * The recipient's family (that is, last) name. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName = $familyName; - } - - /** - * Returns Email Address. - * The recipient's email address. - */ - public function getEmailAddress(): ?string - { - return $this->emailAddress; - } - - /** - * Sets Email Address. - * The recipient's email address. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress = $emailAddress; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The recipient's phone number. - */ - public function getPhoneNumber(): ?string - { - return $this->phoneNumber; - } - - /** - * Sets Phone Number. - * The recipient's phone number. - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber = $phoneNumber; - } - - /** - * Returns Company Name. - * The name of the recipient's company. - */ - public function getCompanyName(): ?string - { - return $this->companyName; - } - - /** - * Sets Company Name. - * The name of the recipient's company. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName = $companyName; - } - - /** - * Returns Tax Ids. - * Represents the tax IDs for an invoice recipient. The country of the seller account determines - * whether the corresponding `tax_ids` field is available for the customer. For more information, - * see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient- - * tax-ids). - */ - public function getTaxIds(): ?InvoiceRecipientTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax IDs for an invoice recipient. The country of the seller account determines - * whether the corresponding `tax_ids` field is available for the customer. For more information, - * see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient- - * tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?InvoiceRecipientTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (isset($this->givenName)) { - $json['given_name'] = $this->givenName; - } - if (isset($this->familyName)) { - $json['family_name'] = $this->familyName; - } - if (isset($this->emailAddress)) { - $json['email_address'] = $this->emailAddress; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (isset($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber; - } - if (isset($this->companyName)) { - $json['company_name'] = $this->companyName; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceRecipientTaxIds.php b/src/Models/InvoiceRecipientTaxIds.php deleted file mode 100644 index 9dcd8e04..00000000 --- a/src/Models/InvoiceRecipientTaxIds.php +++ /dev/null @@ -1,63 +0,0 @@ -euVat; - } - - /** - * Sets Eu Vat. - * The EU VAT identification number for the invoice recipient. For example, `IE3426675K`. - * - * @maps eu_vat - */ - public function setEuVat(?string $euVat): void - { - $this->euVat = $euVat; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->euVat)) { - $json['eu_vat'] = $this->euVat; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceRequestMethod.php b/src/Models/InvoiceRequestMethod.php deleted file mode 100644 index 174b6181..00000000 --- a/src/Models/InvoiceRequestMethod.php +++ /dev/null @@ -1,78 +0,0 @@ -field; - } - - /** - * Sets Field. - * The field to use for sorting. - * - * @maps field - */ - public function setField(string $field): void - { - $this->field = $field; - } - - /** - * Returns Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getOrder(): ?string - { - return $this->order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['field'] = $this->field; - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/InvoiceSortField.php b/src/Models/InvoiceSortField.php deleted file mode 100644 index 4b1579c5..00000000 --- a/src/Models/InvoiceSortField.php +++ /dev/null @@ -1,20 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the `Location`. This can include locations that are deactivated. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the `Location`. This can include locations that are deactivated. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): ?Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_money - */ - public function setPriceMoney(?Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Returns Pricing Type. - * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - */ - public function getPricingType(): ?string - { - return $this->pricingType; - } - - /** - * Sets Pricing Type. - * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - * - * @maps pricing_type - */ - public function setPricingType(?string $pricingType): void - { - $this->pricingType = $pricingType; - } - - /** - * Returns Track Inventory. - * If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. - */ - public function getTrackInventory(): ?bool - { - if (count($this->trackInventory) == 0) { - return null; - } - return $this->trackInventory['value']; - } - - /** - * Sets Track Inventory. - * If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. - * - * @maps track_inventory - */ - public function setTrackInventory(?bool $trackInventory): void - { - $this->trackInventory['value'] = $trackInventory; - } - - /** - * Unsets Track Inventory. - * If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. - */ - public function unsetTrackInventory(): void - { - $this->trackInventory = []; - } - - /** - * Returns Inventory Alert Type. - * Indicates whether Square should alert the merchant when the inventory quantity of a - * CatalogItemVariation is low. - */ - public function getInventoryAlertType(): ?string - { - return $this->inventoryAlertType; - } - - /** - * Sets Inventory Alert Type. - * Indicates whether Square should alert the merchant when the inventory quantity of a - * CatalogItemVariation is low. - * - * @maps inventory_alert_type - */ - public function setInventoryAlertType(?string $inventoryAlertType): void - { - $this->inventoryAlertType = $inventoryAlertType; - } - - /** - * Returns Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - */ - public function getInventoryAlertThreshold(): ?int - { - if (count($this->inventoryAlertThreshold) == 0) { - return null; - } - return $this->inventoryAlertThreshold['value']; - } - - /** - * Sets Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - * - * @maps inventory_alert_threshold - */ - public function setInventoryAlertThreshold(?int $inventoryAlertThreshold): void - { - $this->inventoryAlertThreshold['value'] = $inventoryAlertThreshold; - } - - /** - * Unsets Inventory Alert Threshold. - * If the inventory quantity for the variation is less than or equal to this value and - * `inventory_alert_type` - * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. - * - * This value is always an integer. - */ - public function unsetInventoryAlertThreshold(): void - { - $this->inventoryAlertThreshold = []; - } - - /** - * Returns Sold Out. - * Indicates whether the overridden item variation is sold out at the specified location. - * - * When inventory tracking is enabled on the item variation either globally or at the specified - * location, - * the item variation is automatically marked as sold out when its inventory count reaches zero. The - * seller - * can manually set the item variation as sold out even when the inventory count is greater than zero. - * Attempts by an application to set this attribute are ignored. Regardless how the sold-out status is - * set, - * applications should treat its inventory count as zero when this attribute value is `true`. - */ - public function getSoldOut(): ?bool - { - return $this->soldOut; - } - - /** - * Sets Sold Out. - * Indicates whether the overridden item variation is sold out at the specified location. - * - * When inventory tracking is enabled on the item variation either globally or at the specified - * location, - * the item variation is automatically marked as sold out when its inventory count reaches zero. The - * seller - * can manually set the item variation as sold out even when the inventory count is greater than zero. - * Attempts by an application to set this attribute are ignored. Regardless how the sold-out status is - * set, - * applications should treat its inventory count as zero when this attribute value is `true`. - * - * @maps sold_out - */ - public function setSoldOut(?bool $soldOut): void - { - $this->soldOut = $soldOut; - } - - /** - * Returns Sold Out Valid Until. - * The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation - * becomes available again at the specified location. Attempts by an application to set this attribute - * are ignored. - * When the current time is later than this attribute value, the affected item variation is no longer - * sold out. - */ - public function getSoldOutValidUntil(): ?string - { - return $this->soldOutValidUntil; - } - - /** - * Sets Sold Out Valid Until. - * The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation - * becomes available again at the specified location. Attempts by an application to set this attribute - * are ignored. - * When the current time is later than this attribute value, the affected item variation is no longer - * sold out. - * - * @maps sold_out_valid_until - */ - public function setSoldOutValidUntil(?string $soldOutValidUntil): void - { - $this->soldOutValidUntil = $soldOutValidUntil; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->priceMoney)) { - $json['price_money'] = $this->priceMoney; - } - if (isset($this->pricingType)) { - $json['pricing_type'] = $this->pricingType; - } - if (!empty($this->trackInventory)) { - $json['track_inventory'] = $this->trackInventory['value']; - } - if (isset($this->inventoryAlertType)) { - $json['inventory_alert_type'] = $this->inventoryAlertType; - } - if (!empty($this->inventoryAlertThreshold)) { - $json['inventory_alert_threshold'] = $this->inventoryAlertThreshold['value']; - } - if (isset($this->soldOut)) { - $json['sold_out'] = $this->soldOut; - } - if (isset($this->soldOutValidUntil)) { - $json['sold_out_valid_until'] = $this->soldOutValidUntil; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Job.php b/src/Models/Job.php deleted file mode 100644 index b1bb9296..00000000 --- a/src/Models/Job.php +++ /dev/null @@ -1,240 +0,0 @@ -id; - } - - /** - * Sets Id. - * **Read only** The unique Square-assigned ID of the job. If you need a job ID for an API request, - * call [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned when you created the job. - * You can also get job IDs from a team member's wage setting. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Title. - * The title of the job. - */ - public function getTitle(): ?string - { - if (count($this->title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The title of the job. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The title of the job. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Is Tip Eligible. - * Indicates whether team members can earn tips for the job. - */ - public function getIsTipEligible(): ?bool - { - if (count($this->isTipEligible) == 0) { - return null; - } - return $this->isTipEligible['value']; - } - - /** - * Sets Is Tip Eligible. - * Indicates whether team members can earn tips for the job. - * - * @maps is_tip_eligible - */ - public function setIsTipEligible(?bool $isTipEligible): void - { - $this->isTipEligible['value'] = $isTipEligible; - } - - /** - * Unsets Is Tip Eligible. - * Indicates whether team members can earn tips for the job. - */ - public function unsetIsTipEligible(): void - { - $this->isTipEligible = []; - } - - /** - * Returns Created At. - * The timestamp when the job was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the job was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the job was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the job was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Version. - * **Read only** The current version of the job. Include this field in `UpdateJob` requests to enable - * [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic- - * concurrency) - * control and avoid overwrites from concurrent requests. Requests fail if the provided version - * doesn't - * match the server version at the time of the request. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * **Read only** The current version of the job. Include this field in `UpdateJob` requests to enable - * [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic- - * concurrency) - * control and avoid overwrites from concurrent requests. Requests fail if the provided version - * doesn't - * match the server version at the time of the request. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (!empty($this->isTipEligible)) { - $json['is_tip_eligible'] = $this->isTipEligible['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/JobAssignment.php b/src/Models/JobAssignment.php deleted file mode 100644 index 043fd984..00000000 --- a/src/Models/JobAssignment.php +++ /dev/null @@ -1,269 +0,0 @@ -payType = $payType; - } - - /** - * Returns Job Title. - * The title of the job. - */ - public function getJobTitle(): ?string - { - if (count($this->jobTitle) == 0) { - return null; - } - return $this->jobTitle['value']; - } - - /** - * Sets Job Title. - * The title of the job. - * - * @maps job_title - */ - public function setJobTitle(?string $jobTitle): void - { - $this->jobTitle['value'] = $jobTitle; - } - - /** - * Unsets Job Title. - * The title of the job. - */ - public function unsetJobTitle(): void - { - $this->jobTitle = []; - } - - /** - * Returns Pay Type. - * Enumerates the possible pay types that a job can be assigned. - */ - public function getPayType(): string - { - return $this->payType; - } - - /** - * Sets Pay Type. - * Enumerates the possible pay types that a job can be assigned. - * - * @required - * @maps pay_type - */ - public function setPayType(string $payType): void - { - $this->payType = $payType; - } - - /** - * Returns Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getHourlyRate(): ?Money - { - return $this->hourlyRate; - } - - /** - * Sets Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps hourly_rate - */ - public function setHourlyRate(?Money $hourlyRate): void - { - $this->hourlyRate = $hourlyRate; - } - - /** - * Returns Annual Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAnnualRate(): ?Money - { - return $this->annualRate; - } - - /** - * Sets Annual Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps annual_rate - */ - public function setAnnualRate(?Money $annualRate): void - { - $this->annualRate = $annualRate; - } - - /** - * Returns Weekly Hours. - * The planned hours per week for the job. Set if the job `PayType` is `SALARY`. - */ - public function getWeeklyHours(): ?int - { - if (count($this->weeklyHours) == 0) { - return null; - } - return $this->weeklyHours['value']; - } - - /** - * Sets Weekly Hours. - * The planned hours per week for the job. Set if the job `PayType` is `SALARY`. - * - * @maps weekly_hours - */ - public function setWeeklyHours(?int $weeklyHours): void - { - $this->weeklyHours['value'] = $weeklyHours; - } - - /** - * Unsets Weekly Hours. - * The planned hours per week for the job. Set if the job `PayType` is `SALARY`. - */ - public function unsetWeeklyHours(): void - { - $this->weeklyHours = []; - } - - /** - * Returns Job Id. - * The ID of the [job]($m/Job). - */ - public function getJobId(): ?string - { - if (count($this->jobId) == 0) { - return null; - } - return $this->jobId['value']; - } - - /** - * Sets Job Id. - * The ID of the [job]($m/Job). - * - * @maps job_id - */ - public function setJobId(?string $jobId): void - { - $this->jobId['value'] = $jobId; - } - - /** - * Unsets Job Id. - * The ID of the [job]($m/Job). - */ - public function unsetJobId(): void - { - $this->jobId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->jobTitle)) { - $json['job_title'] = $this->jobTitle['value']; - } - $json['pay_type'] = $this->payType; - if (isset($this->hourlyRate)) { - $json['hourly_rate'] = $this->hourlyRate; - } - if (isset($this->annualRate)) { - $json['annual_rate'] = $this->annualRate; - } - if (!empty($this->weeklyHours)) { - $json['weekly_hours'] = $this->weeklyHours['value']; - } - if (!empty($this->jobId)) { - $json['job_id'] = $this->jobId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/JobAssignmentPayType.php b/src/Models/JobAssignmentPayType.php deleted file mode 100644 index 56f2be58..00000000 --- a/src/Models/JobAssignmentPayType.php +++ /dev/null @@ -1,26 +0,0 @@ -customerId = $customerId; - } - - /** - * Returns Customer Id. - * The ID of the customer to link to the gift card. - */ - public function getCustomerId(): string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the customer to link to the gift card. - * - * @required - * @maps customer_id - */ - public function setCustomerId(string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_id'] = $this->customerId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LinkCustomerToGiftCardResponse.php b/src/Models/LinkCustomerToGiftCardResponse.php deleted file mode 100644 index c229581a..00000000 --- a/src/Models/LinkCustomerToGiftCardResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBankAccountsRequest.php b/src/Models/ListBankAccountsRequest.php deleted file mode 100644 index 3299ed33..00000000 --- a/src/Models/ListBankAccountsRequest.php +++ /dev/null @@ -1,177 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor returned by a previous call to this endpoint. - * Use it in the next `ListBankAccounts` request to retrieve the next set - * of results. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor returned by a previous call to this endpoint. - * Use it in the next `ListBankAccounts` request to retrieve the next set - * of results. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * Upper limit on the number of bank accounts to return in the response. - * Currently, 1000 is the largest supported limit. You can specify a limit - * of up to 1000 bank accounts. This is also the default limit. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * Upper limit on the number of bank accounts to return in the response. - * Currently, 1000 is the largest supported limit. You can specify a limit - * of up to 1000 bank accounts. This is also the default limit. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * Upper limit on the number of bank accounts to return in the response. - * Currently, 1000 is the largest supported limit. You can specify a limit - * of up to 1000 bank accounts. This is also the default limit. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Location Id. - * Location ID. You can specify this optional filter - * to retrieve only the linked bank accounts belonging to a specific location. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * Location ID. You can specify this optional filter - * to retrieve only the linked bank accounts belonging to a specific location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * Location ID. You can specify this optional filter - * to retrieve only the linked bank accounts belonging to a specific location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBankAccountsResponse.php b/src/Models/ListBankAccountsResponse.php deleted file mode 100644 index 0a36a7e7..00000000 --- a/src/Models/ListBankAccountsResponse.php +++ /dev/null @@ -1,134 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Bank Accounts. - * List of BankAccounts associated with this account. - * - * @return BankAccount[]|null - */ - public function getBankAccounts(): ?array - { - return $this->bankAccounts; - } - - /** - * Sets Bank Accounts. - * List of BankAccounts associated with this account. - * - * @maps bank_accounts - * - * @param BankAccount[]|null $bankAccounts - */ - public function setBankAccounts(?array $bankAccounts): void - { - $this->bankAccounts = $bankAccounts; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can - * use in a subsequent request to fetch next set of bank accounts. - * If empty, this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can - * use in a subsequent request to fetch next set of bank accounts. - * If empty, this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->bankAccounts)) { - $json['bank_accounts'] = $this->bankAccounts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingCustomAttributeDefinitionsRequest.php b/src/Models/ListBookingCustomAttributeDefinitionsRequest.php deleted file mode 100644 index 613d0bf0..00000000 --- a/src/Models/ListBookingCustomAttributeDefinitionsRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingCustomAttributeDefinitionsResponse.php b/src/Models/ListBookingCustomAttributeDefinitionsResponse.php deleted file mode 100644 index e4a59877..00000000 --- a/src/Models/ListBookingCustomAttributeDefinitionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributeDefinitions; - } - - /** - * Sets Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, - * Square returns an empty object (`{}`). - * - * @maps custom_attribute_definitions - * - * @param CustomAttributeDefinition[]|null $customAttributeDefinitions - */ - public function setCustomAttributeDefinitions(?array $customAttributeDefinitions): void - { - $this->customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinitions)) { - $json['custom_attribute_definitions'] = $this->customAttributeDefinitions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingCustomAttributesRequest.php b/src/Models/ListBookingCustomAttributesRequest.php deleted file mode 100644 index c4a3417a..00000000 --- a/src/Models/ListBookingCustomAttributesRequest.php +++ /dev/null @@ -1,186 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function getWithDefinitions(): ?bool - { - if (count($this->withDefinitions) == 0) { - return null; - } - return $this->withDefinitions['value']; - } - - /** - * Sets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definitions - */ - public function setWithDefinitions(?bool $withDefinitions): void - { - $this->withDefinitions['value'] = $withDefinitions; - } - - /** - * Unsets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinitions(): void - { - $this->withDefinitions = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->withDefinitions)) { - $json['with_definitions'] = $this->withDefinitions['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingCustomAttributesResponse.php b/src/Models/ListBookingCustomAttributesResponse.php deleted file mode 100644 index a1f3fe8c..00000000 --- a/src/Models/ListBookingCustomAttributesResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -customAttributes; - } - - /** - * Sets Custom Attributes. - * The retrieved custom attributes. If `with_definitions` was set to `true` in the request, - * the custom attribute definition is returned in the `definition` field of each custom attribute. - * - * If no custom attributes are found, Square returns an empty object (`{}`). - * - * @maps custom_attributes - * - * @param CustomAttribute[]|null $customAttributes - */ - public function setCustomAttributes(?array $customAttributes): void - { - $this->customAttributes = $customAttributes; - } - - /** - * Returns Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributes)) { - $json['custom_attributes'] = $this->customAttributes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingsRequest.php b/src/Models/ListBookingsRequest.php deleted file mode 100644 index 4f131be7..00000000 --- a/src/Models/ListBookingsRequest.php +++ /dev/null @@ -1,327 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results per page to return in a paged response. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results per page to return in a paged response. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Customer Id. - * The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all - * customers are retrieved. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all - * customers are retrieved. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all - * customers are retrieved. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Team Member Id. - * The team member for whom to retrieve bookings. If this is not set, bookings of all members are - * retrieved. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The team member for whom to retrieve bookings. If this is not set, bookings of all members are - * retrieved. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The team member for whom to retrieve bookings. If this is not set, bookings of all members are - * retrieved. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Location Id. - * The location for which to retrieve bookings. If this is not set, all locations' bookings are - * retrieved. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location for which to retrieve bookings. If this is not set, all locations' bookings are - * retrieved. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location for which to retrieve bookings. If this is not set, all locations' bookings are - * retrieved. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Start at Min. - * The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current - * time is used. - */ - public function getStartAtMin(): ?string - { - if (count($this->startAtMin) == 0) { - return null; - } - return $this->startAtMin['value']; - } - - /** - * Sets Start at Min. - * The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current - * time is used. - * - * @maps start_at_min - */ - public function setStartAtMin(?string $startAtMin): void - { - $this->startAtMin['value'] = $startAtMin; - } - - /** - * Unsets Start at Min. - * The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current - * time is used. - */ - public function unsetStartAtMin(): void - { - $this->startAtMin = []; - } - - /** - * Returns Start at Max. - * The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 - * days after `start_at_min` is used. - */ - public function getStartAtMax(): ?string - { - if (count($this->startAtMax) == 0) { - return null; - } - return $this->startAtMax['value']; - } - - /** - * Sets Start at Max. - * The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 - * days after `start_at_min` is used. - * - * @maps start_at_max - */ - public function setStartAtMax(?string $startAtMax): void - { - $this->startAtMax['value'] = $startAtMax; - } - - /** - * Unsets Start at Max. - * The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 - * days after `start_at_min` is used. - */ - public function unsetStartAtMax(): void - { - $this->startAtMax = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->startAtMin)) { - $json['start_at_min'] = $this->startAtMin['value']; - } - if (!empty($this->startAtMax)) { - $json['start_at_max'] = $this->startAtMax['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBookingsResponse.php b/src/Models/ListBookingsResponse.php deleted file mode 100644 index 57fc4547..00000000 --- a/src/Models/ListBookingsResponse.php +++ /dev/null @@ -1,123 +0,0 @@ -bookings; - } - - /** - * Sets Bookings. - * The list of targeted bookings. - * - * @maps bookings - * - * @param Booking[]|null $bookings - */ - public function setBookings(?array $bookings): void - { - $this->bookings = $bookings; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->bookings)) { - $json['bookings'] = $this->bookings; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBreakTypesRequest.php b/src/Models/ListBreakTypesRequest.php deleted file mode 100644 index acbfb2c0..00000000 --- a/src/Models/ListBreakTypesRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * Filter the returned `BreakType` results to only those that are associated with the - * specified location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * Filter the returned `BreakType` results to only those that are associated with the - * specified location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Limit. - * The maximum number of `BreakType` results to return per page. The number can range between 1 - * and 200. The default is 200. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of `BreakType` results to return per page. The number can range between 1 - * and 200. The default is 200. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of `BreakType` results to return per page. The number can range between 1 - * and 200. The default is 200. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pointer to the next page of `BreakType` results to fetch. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pointer to the next page of `BreakType` results to fetch. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pointer to the next page of `BreakType` results to fetch. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListBreakTypesResponse.php b/src/Models/ListBreakTypesResponse.php deleted file mode 100644 index 2010a751..00000000 --- a/src/Models/ListBreakTypesResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -breakTypes; - } - - /** - * Sets Break Types. - * A page of `BreakType` results. - * - * @maps break_types - * - * @param BreakType[]|null $breakTypes - */ - public function setBreakTypes(?array $breakTypes): void - { - $this->breakTypes = $breakTypes; - } - - /** - * Returns Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `BreakType` results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `BreakType` results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->breakTypes)) { - $json['break_types'] = $this->breakTypes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCardsRequest.php b/src/Models/ListCardsRequest.php deleted file mode 100644 index ec8bd0a4..00000000 --- a/src/Models/ListCardsRequest.php +++ /dev/null @@ -1,239 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Customer Id. - * Limit results to cards associated with the customer supplied. - * By default, all cards owned by the merchant are returned. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * Limit results to cards associated with the customer supplied. - * By default, all cards owned by the merchant are returned. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * Limit results to cards associated with the customer supplied. - * By default, all cards owned by the merchant are returned. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Include Disabled. - * Includes disabled cards. - * By default, all enabled cards owned by the merchant are returned. - */ - public function getIncludeDisabled(): ?bool - { - if (count($this->includeDisabled) == 0) { - return null; - } - return $this->includeDisabled['value']; - } - - /** - * Sets Include Disabled. - * Includes disabled cards. - * By default, all enabled cards owned by the merchant are returned. - * - * @maps include_disabled - */ - public function setIncludeDisabled(?bool $includeDisabled): void - { - $this->includeDisabled['value'] = $includeDisabled; - } - - /** - * Unsets Include Disabled. - * Includes disabled cards. - * By default, all enabled cards owned by the merchant are returned. - */ - public function unsetIncludeDisabled(): void - { - $this->includeDisabled = []; - } - - /** - * Returns Reference Id. - * Limit results to cards associated with the reference_id supplied. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * Limit results to cards associated with the reference_id supplied. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * Limit results to cards associated with the reference_id supplied. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->includeDisabled)) { - $json['include_disabled'] = $this->includeDisabled['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCardsResponse.php b/src/Models/ListCardsResponse.php deleted file mode 100644 index 3e59ee5c..00000000 --- a/src/Models/ListCardsResponse.php +++ /dev/null @@ -1,136 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cards. - * The requested list of `Card`s. - * - * @return Card[]|null - */ - public function getCards(): ?array - { - return $this->cards; - } - - /** - * Sets Cards. - * The requested list of `Card`s. - * - * @maps cards - * - * @param Card[]|null $cards - */ - public function setCards(?array $cards): void - { - $this->cards = $cards; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cards)) { - $json['cards'] = $this->cards; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCashDrawerShiftEventsRequest.php b/src/Models/ListCashDrawerShiftEventsRequest.php deleted file mode 100644 index 93192a75..00000000 --- a/src/Models/ListCashDrawerShiftEventsRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -locationId = $locationId; - } - - /** - * Returns Location Id. - * The ID of the location to list cash drawer shifts for. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location to list cash drawer shifts for. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Limit. - * Number of resources to be returned in a page of results (200 by - * default, 1000 max). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * Number of resources to be returned in a page of results (200 by - * default, 1000 max). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * Number of resources to be returned in a page of results (200 by - * default, 1000 max). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * Opaque cursor for fetching the next page of results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * Opaque cursor for fetching the next page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * Opaque cursor for fetching the next page of results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCashDrawerShiftEventsResponse.php b/src/Models/ListCashDrawerShiftEventsResponse.php deleted file mode 100644 index 911ab8e3..00000000 --- a/src/Models/ListCashDrawerShiftEventsResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * Opaque cursor for fetching the next page. Cursor is not present in - * the last page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cash Drawer Shift Events. - * All of the events (payments, refunds, etc.) for a cash drawer during - * the shift. - * - * @return CashDrawerShiftEvent[]|null - */ - public function getCashDrawerShiftEvents(): ?array - { - return $this->cashDrawerShiftEvents; - } - - /** - * Sets Cash Drawer Shift Events. - * All of the events (payments, refunds, etc.) for a cash drawer during - * the shift. - * - * @maps cash_drawer_shift_events - * - * @param CashDrawerShiftEvent[]|null $cashDrawerShiftEvents - */ - public function setCashDrawerShiftEvents(?array $cashDrawerShiftEvents): void - { - $this->cashDrawerShiftEvents = $cashDrawerShiftEvents; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cashDrawerShiftEvents)) { - $json['cash_drawer_shift_events'] = $this->cashDrawerShiftEvents; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCashDrawerShiftsRequest.php b/src/Models/ListCashDrawerShiftsRequest.php deleted file mode 100644 index 27e789e8..00000000 --- a/src/Models/ListCashDrawerShiftsRequest.php +++ /dev/null @@ -1,255 +0,0 @@ -locationId = $locationId; - } - - /** - * Returns Location Id. - * The ID of the location to query for a list of cash drawer shifts. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location to query for a list of cash drawer shifts. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Begin Time. - * The inclusive start time of the query on opened_at, in ISO 8601 format. - */ - public function getBeginTime(): ?string - { - if (count($this->beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * The inclusive start time of the query on opened_at, in ISO 8601 format. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * The inclusive start time of the query on opened_at, in ISO 8601 format. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * The exclusive end date of the query on opened_at, in ISO 8601 format. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * The exclusive end date of the query on opened_at, in ISO 8601 format. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * The exclusive end date of the query on opened_at, in ISO 8601 format. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Limit. - * Number of cash drawer shift events in a page of results (200 by - * default, 1000 max). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * Number of cash drawer shift events in a page of results (200 by - * default, 1000 max). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * Number of cash drawer shift events in a page of results (200 by - * default, 1000 max). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * Opaque cursor for fetching the next page of results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * Opaque cursor for fetching the next page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * Opaque cursor for fetching the next page of results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCashDrawerShiftsResponse.php b/src/Models/ListCashDrawerShiftsResponse.php deleted file mode 100644 index 6341c28d..00000000 --- a/src/Models/ListCashDrawerShiftsResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * Opaque cursor for fetching the next page of results. Cursor is not - * present in the last page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cash Drawer Shifts. - * A collection of CashDrawerShiftSummary objects for shifts that match - * the query. - * - * @return CashDrawerShiftSummary[]|null - */ - public function getCashDrawerShifts(): ?array - { - return $this->cashDrawerShifts; - } - - /** - * Sets Cash Drawer Shifts. - * A collection of CashDrawerShiftSummary objects for shifts that match - * the query. - * - * @maps cash_drawer_shifts - * - * @param CashDrawerShiftSummary[]|null $cashDrawerShifts - */ - public function setCashDrawerShifts(?array $cashDrawerShifts): void - { - $this->cashDrawerShifts = $cashDrawerShifts; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cashDrawerShifts)) { - $json['cash_drawer_shifts'] = $this->cashDrawerShifts; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCatalogRequest.php b/src/Models/ListCatalogRequest.php deleted file mode 100644 index 4463ee49..00000000 --- a/src/Models/ListCatalogRequest.php +++ /dev/null @@ -1,212 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor returned in the previous response. Leave unset for an initial request. - * The page size is currently set to be 100. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor returned in the previous response. Leave unset for an initial request. - * The page size is currently set to be 100. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Types. - * An optional case-insensitive, comma-separated list of object types to retrieve. - * - * The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example, - * `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - * `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - * - * If this is unspecified, the operation returns objects of all the top level types at the version - * of the Square API used to make the request. Object types that are nested onto other object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - */ - public function getTypes(): ?string - { - if (count($this->types) == 0) { - return null; - } - return $this->types['value']; - } - - /** - * Sets Types. - * An optional case-insensitive, comma-separated list of object types to retrieve. - * - * The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example, - * `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - * `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - * - * If this is unspecified, the operation returns objects of all the top level types at the version - * of the Square API used to make the request. Object types that are nested onto other object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - * - * @maps types - */ - public function setTypes(?string $types): void - { - $this->types['value'] = $types; - } - - /** - * Unsets Types. - * An optional case-insensitive, comma-separated list of object types to retrieve. - * - * The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example, - * `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - * `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - * - * If this is unspecified, the operation returns objects of all the top level types at the version - * of the Square API used to make the request. Object types that are nested onto other object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - */ - public function unsetTypes(): void - { - $this->types = []; - } - - /** - * Returns Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will be from - * the - * current version of the catalog. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will be from - * the - * current version of the catalog. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The specific version of the catalog objects to be included in the response. - * This allows you to retrieve historical versions of objects. The specified version value is matched - * against - * the [CatalogObject]($m/CatalogObject)s' `version` attribute. If not included, results will be from - * the - * current version of the catalog. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->types)) { - $json['types'] = $this->types['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCatalogResponse.php b/src/Models/ListCatalogResponse.php deleted file mode 100644 index 89d541a8..00000000 --- a/src/Models/ListCatalogResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Objects. - * The CatalogObjects returned. - * - * @return CatalogObject[]|null - */ - public function getObjects(): ?array - { - return $this->objects; - } - - /** - * Sets Objects. - * The CatalogObjects returned. - * - * @maps objects - * - * @param CatalogObject[]|null $objects - */ - public function setObjects(?array $objects): void - { - $this->objects = $objects; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->objects)) { - $json['objects'] = $this->objects; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerCustomAttributeDefinitionsRequest.php b/src/Models/ListCustomerCustomAttributeDefinitionsRequest.php deleted file mode 100644 index 5c320ea5..00000000 --- a/src/Models/ListCustomerCustomAttributeDefinitionsRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerCustomAttributeDefinitionsResponse.php b/src/Models/ListCustomerCustomAttributeDefinitionsResponse.php deleted file mode 100644 index 29e1988e..00000000 --- a/src/Models/ListCustomerCustomAttributeDefinitionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributeDefinitions; - } - - /** - * Sets Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, - * Square returns an empty object (`{}`). - * - * @maps custom_attribute_definitions - * - * @param CustomAttributeDefinition[]|null $customAttributeDefinitions - */ - public function setCustomAttributeDefinitions(?array $customAttributeDefinitions): void - { - $this->customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinitions)) { - $json['custom_attribute_definitions'] = $this->customAttributeDefinitions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerCustomAttributesRequest.php b/src/Models/ListCustomerCustomAttributesRequest.php deleted file mode 100644 index 3e0e86e6..00000000 --- a/src/Models/ListCustomerCustomAttributesRequest.php +++ /dev/null @@ -1,186 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function getWithDefinitions(): ?bool - { - if (count($this->withDefinitions) == 0) { - return null; - } - return $this->withDefinitions['value']; - } - - /** - * Sets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definitions - */ - public function setWithDefinitions(?bool $withDefinitions): void - { - $this->withDefinitions['value'] = $withDefinitions; - } - - /** - * Unsets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinitions(): void - { - $this->withDefinitions = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->withDefinitions)) { - $json['with_definitions'] = $this->withDefinitions['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerCustomAttributesResponse.php b/src/Models/ListCustomerCustomAttributesResponse.php deleted file mode 100644 index 078839e1..00000000 --- a/src/Models/ListCustomerCustomAttributesResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -customAttributes; - } - - /** - * Sets Custom Attributes. - * The retrieved custom attributes. If `with_definitions` was set to `true` in the request, - * the custom attribute definition is returned in the `definition` field of each custom attribute. - * - * If no custom attributes are found, Square returns an empty object (`{}`). - * - * @maps custom_attributes - * - * @param CustomAttribute[]|null $customAttributes - */ - public function setCustomAttributes(?array $customAttributes): void - { - $this->customAttributes = $customAttributes; - } - - /** - * Returns Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributes)) { - $json['custom_attributes'] = $this->customAttributes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerGroupsRequest.php b/src/Models/ListCustomerGroupsRequest.php deleted file mode 100644 index 2337a7cf..00000000 --- a/src/Models/ListCustomerGroupsRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 - * VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 - * VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 - * VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerGroupsResponse.php b/src/Models/ListCustomerGroupsResponse.php deleted file mode 100644 index 1f834dac..00000000 --- a/src/Models/ListCustomerGroupsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Groups. - * A list of customer groups belonging to the current seller. - * - * @return CustomerGroup[]|null - */ - public function getGroups(): ?array - { - return $this->groups; - } - - /** - * Sets Groups. - * A list of customer groups belonging to the current seller. - * - * @maps groups - * - * @param CustomerGroup[]|null $groups - */ - public function setGroups(?array $groups): void - { - $this->groups = $groups; - } - - /** - * Returns Cursor. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. This value is present only if the request - * succeeded and additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. This value is present only if the request - * succeeded and additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->groups)) { - $json['groups'] = $this->groups; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerSegmentsRequest.php b/src/Models/ListCustomerSegmentsRequest.php deleted file mode 100644 index ed0a277a..00000000 --- a/src/Models/ListCustomerSegmentsRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by previous calls to `ListCustomerSegments`. - * This cursor is used to retrieve the next set of query results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by previous calls to `ListCustomerSegments`. - * This cursor is used to retrieve the next set of query results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 50. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomerSegmentsResponse.php b/src/Models/ListCustomerSegmentsResponse.php deleted file mode 100644 index 50221ab6..00000000 --- a/src/Models/ListCustomerSegmentsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Segments. - * The list of customer segments belonging to the associated Square account. - * - * @return CustomerSegment[]|null - */ - public function getSegments(): ?array - { - return $this->segments; - } - - /** - * Sets Segments. - * The list of customer segments belonging to the associated Square account. - * - * @maps segments - * - * @param CustomerSegment[]|null $segments - */ - public function setSegments(?array $segments): void - { - $this->segments = $segments; - } - - /** - * Returns Cursor. - * A pagination cursor to be used in subsequent calls to `ListCustomerSegments` - * to retrieve the next set of query results. The cursor is only present if the request succeeded and - * additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor to be used in subsequent calls to `ListCustomerSegments` - * to retrieve the next set of query results. The cursor is only present if the request succeeded and - * additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->segments)) { - $json['segments'] = $this->segments; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomersRequest.php b/src/Models/ListCustomersRequest.php deleted file mode 100644 index 30f04883..00000000 --- a/src/Models/ListCustomersRequest.php +++ /dev/null @@ -1,245 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 100. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 100. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or - * `400 VALUE_TOO_HIGH` error. The default value is 100. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Sort Field. - * Specifies customer attributes as the sort key to customer profiles returned from a search. - */ - public function getSortField(): ?string - { - return $this->sortField; - } - - /** - * Sets Sort Field. - * Specifies customer attributes as the sort key to customer profiles returned from a search. - * - * @maps sort_field - */ - public function setSortField(?string $sortField): void - { - $this->sortField = $sortField; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Count. - * Indicates whether to return the total count of customers in the `count` field of the response. - * - * The default value is `false`. - */ - public function getCount(): ?bool - { - if (count($this->count) == 0) { - return null; - } - return $this->count['value']; - } - - /** - * Sets Count. - * Indicates whether to return the total count of customers in the `count` field of the response. - * - * The default value is `false`. - * - * @maps count - */ - public function setCount(?bool $count): void - { - $this->count['value'] = $count; - } - - /** - * Unsets Count. - * Indicates whether to return the total count of customers in the `count` field of the response. - * - * The default value is `false`. - */ - public function unsetCount(): void - { - $this->count = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (isset($this->sortField)) { - $json['sort_field'] = $this->sortField; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->count)) { - $json['count'] = $this->count['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListCustomersResponse.php b/src/Models/ListCustomersResponse.php deleted file mode 100644 index aaf15fdd..00000000 --- a/src/Models/ListCustomersResponse.php +++ /dev/null @@ -1,179 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Customers. - * The customer profiles associated with the Square account or an empty object (`{}`) if none are found. - * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, - * `email_address`, or - * `phone_number`) are included in the response. - * - * @return Customer[]|null - */ - public function getCustomers(): ?array - { - return $this->customers; - } - - /** - * Sets Customers. - * The customer profiles associated with the Square account or an empty object (`{}`) if none are found. - * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, - * `email_address`, or - * `phone_number`) are included in the response. - * - * @maps customers - * - * @param Customer[]|null $customers - */ - public function setCustomers(?array $customers): void - { - $this->customers = $customers; - } - - /** - * Returns Cursor. - * A pagination cursor to retrieve the next set of results for the - * original query. A cursor is only present if the request succeeded and additional results - * are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor to retrieve the next set of results for the - * original query. A cursor is only present if the request succeeded and additional results - * are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Count. - * The total count of customers associated with the Square account. Only customer profiles with public - * information - * (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This - * field is present - * only if `count` is set to `true` in the request. - */ - public function getCount(): ?int - { - return $this->count; - } - - /** - * Sets Count. - * The total count of customers associated with the Square account. Only customer profiles with public - * information - * (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This - * field is present - * only if `count` is set to `true` in the request. - * - * @maps count - */ - public function setCount(?int $count): void - { - $this->count = $count; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->customers)) { - $json['customers'] = $this->customers; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->count)) { - $json['count'] = $this->count; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDeviceCodesRequest.php b/src/Models/ListDeviceCodesRequest.php deleted file mode 100644 index 02185ece..00000000 --- a/src/Models/ListDeviceCodesRequest.php +++ /dev/null @@ -1,200 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Location Id. - * If specified, only returns DeviceCodes of the specified location. - * Returns DeviceCodes of all locations if empty. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * If specified, only returns DeviceCodes of the specified location. - * Returns DeviceCodes of all locations if empty. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * If specified, only returns DeviceCodes of the specified location. - * Returns DeviceCodes of all locations if empty. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Product Type. - */ - public function getProductType(): ?string - { - return $this->productType; - } - - /** - * Sets Product Type. - * - * @maps product_type - */ - public function setProductType(?string $productType): void - { - $this->productType = $productType; - } - - /** - * Returns Status. - * If specified, returns DeviceCodes with the specified statuses. - * Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - * See [DeviceCodeStatus](#type-devicecodestatus) for possible values - * - * @return string[]|null - */ - public function getStatus(): ?array - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * If specified, returns DeviceCodes with the specified statuses. - * Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - * See [DeviceCodeStatus](#type-devicecodestatus) for possible values - * - * @maps status - * - * @param string[]|null $status - */ - public function setStatus(?array $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * If specified, returns DeviceCodes with the specified statuses. - * Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - * See [DeviceCodeStatus](#type-devicecodestatus) for possible values - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->productType)) { - $json['product_type'] = $this->productType; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDeviceCodesResponse.php b/src/Models/ListDeviceCodesResponse.php deleted file mode 100644 index 8506af99..00000000 --- a/src/Models/ListDeviceCodesResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Device Codes. - * The queried DeviceCode. - * - * @return DeviceCode[]|null - */ - public function getDeviceCodes(): ?array - { - return $this->deviceCodes; - } - - /** - * Sets Device Codes. - * The queried DeviceCode. - * - * @maps device_codes - * - * @param DeviceCode[]|null $deviceCodes - */ - public function setDeviceCodes(?array $deviceCodes): void - { - $this->deviceCodes = $deviceCodes; - } - - /** - * Returns Cursor. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. This value is present only if the request - * succeeded and additional results are available. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. This value is present only if the request - * succeeded and additional results are available. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->deviceCodes)) { - $json['device_codes'] = $this->deviceCodes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDevicesRequest.php b/src/Models/ListDevicesRequest.php deleted file mode 100644 index 4abf686d..00000000 --- a/src/Models/ListDevicesRequest.php +++ /dev/null @@ -1,186 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Limit. - * The number of results to return in a single page. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The number of results to return in a single page. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The number of results to return in a single page. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Location Id. - * If present, only returns devices at the target location. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * If present, only returns devices at the target location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * If present, only returns devices at the target location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDevicesResponse.php b/src/Models/ListDevicesResponse.php deleted file mode 100644 index 4c878308..00000000 --- a/src/Models/ListDevicesResponse.php +++ /dev/null @@ -1,127 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Devices. - * The requested list of `Device` objects. - * - * @return Device[]|null - */ - public function getDevices(): ?array - { - return $this->devices; - } - - /** - * Sets Devices. - * The requested list of `Device` objects. - * - * @maps devices - * - * @param Device[]|null $devices - */ - public function setDevices(?array $devices): void - { - $this->devices = $devices; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->devices)) { - $json['devices'] = $this->devices; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDisputeEvidenceRequest.php b/src/Models/ListDisputeEvidenceRequest.php deleted file mode 100644 index 716f40a6..00000000 --- a/src/Models/ListDisputeEvidenceRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDisputeEvidenceResponse.php b/src/Models/ListDisputeEvidenceResponse.php deleted file mode 100644 index a2031257..00000000 --- a/src/Models/ListDisputeEvidenceResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -evidence; - } - - /** - * Sets Evidence. - * The list of evidence previously uploaded to the specified dispute. - * - * @maps evidence - * - * @param DisputeEvidence[]|null $evidence - */ - public function setEvidence(?array $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. - * If unset, this is the final response. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. - * If unset, this is the final response. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDisputesRequest.php b/src/Models/ListDisputesRequest.php deleted file mode 100644 index 428643b5..00000000 --- a/src/Models/ListDisputesRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns States. - * The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - * See [DisputeState](#type-disputestate) for possible values - * - * @return string[]|null - */ - public function getStates(): ?array - { - if (count($this->states) == 0) { - return null; - } - return $this->states['value']; - } - - /** - * Sets States. - * The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - * See [DisputeState](#type-disputestate) for possible values - * - * @maps states - * - * @param string[]|null $states - */ - public function setStates(?array $states): void - { - $this->states['value'] = $states; - } - - /** - * Unsets States. - * The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - * See [DisputeState](#type-disputestate) for possible values - */ - public function unsetStates(): void - { - $this->states = []; - } - - /** - * Returns Location Id. - * The ID of the location for which to return a list of disputes. - * If not specified, the endpoint returns disputes associated with all locations. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location for which to return a list of disputes. - * If not specified, the endpoint returns disputes associated with all locations. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location for which to return a list of disputes. - * If not specified, the endpoint returns disputes associated with all locations. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->states)) { - $json['states'] = $this->states['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListDisputesResponse.php b/src/Models/ListDisputesResponse.php deleted file mode 100644 index 6e2e96b2..00000000 --- a/src/Models/ListDisputesResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Disputes. - * The list of disputes. - * - * @return Dispute[]|null - */ - public function getDisputes(): ?array - { - return $this->disputes; - } - - /** - * Sets Disputes. - * The list of disputes. - * - * @maps disputes - * - * @param Dispute[]|null $disputes - */ - public function setDisputes(?array $disputes): void - { - $this->disputes = $disputes; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. - * If unset, this is the final response. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. - * If unset, this is the final response. For more information, see [Pagination](https://developer. - * squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->disputes)) { - $json['disputes'] = $this->disputes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEmployeeWagesRequest.php b/src/Models/ListEmployeeWagesRequest.php deleted file mode 100644 index e6687426..00000000 --- a/src/Models/ListEmployeeWagesRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * Filter the returned wages to only those that are associated with the specified employee. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * Filter the returned wages to only those that are associated with the specified employee. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Limit. - * The maximum number of `EmployeeWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of `EmployeeWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of `EmployeeWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEmployeeWagesResponse.php b/src/Models/ListEmployeeWagesResponse.php deleted file mode 100644 index f161ea66..00000000 --- a/src/Models/ListEmployeeWagesResponse.php +++ /dev/null @@ -1,127 +0,0 @@ -employeeWages; - } - - /** - * Sets Employee Wages. - * A page of `EmployeeWage` results. - * - * @maps employee_wages - * - * @param EmployeeWage[]|null $employeeWages - */ - public function setEmployeeWages(?array $employeeWages): void - { - $this->employeeWages = $employeeWages; - } - - /** - * Returns Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `EmployeeWage` results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `EmployeeWage` results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->employeeWages)) { - $json['employee_wages'] = $this->employeeWages; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEmployeesRequest.php b/src/Models/ListEmployeesRequest.php deleted file mode 100644 index 116126ec..00000000 --- a/src/Models/ListEmployeesRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Status. - * The status of the Employee being retrieved. - * - * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the Employee being retrieved. - * - * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Limit. - * The number of employees to be returned on each page. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The number of employees to be returned on each page. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The number of employees to be returned on each page. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The token required to retrieve the specified page of results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The token required to retrieve the specified page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The token required to retrieve the specified page of results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEmployeesResponse.php b/src/Models/ListEmployeesResponse.php deleted file mode 100644 index 184b9350..00000000 --- a/src/Models/ListEmployeesResponse.php +++ /dev/null @@ -1,119 +0,0 @@ -employees; - } - - /** - * Sets Employees. - * - * @maps employees - * - * @param Employee[]|null $employees - */ - public function setEmployees(?array $employees): void - { - $this->employees = $employees; - } - - /** - * Returns Cursor. - * The token to be used to retrieve the next page of results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The token to be used to retrieve the next page of results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->employees)) { - $json['employees'] = $this->employees; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEventTypesRequest.php b/src/Models/ListEventTypesRequest.php deleted file mode 100644 index eb5fa8da..00000000 --- a/src/Models/ListEventTypesRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion) == 0) { - return null; - } - return $this->apiVersion['value']; - } - - /** - * Sets Api Version. - * The API version for which to list event types. Setting this field overrides the default version used - * by the application. - * - * @maps api_version - */ - public function setApiVersion(?string $apiVersion): void - { - $this->apiVersion['value'] = $apiVersion; - } - - /** - * Unsets Api Version. - * The API version for which to list event types. Setting this field overrides the default version used - * by the application. - */ - public function unsetApiVersion(): void - { - $this->apiVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->apiVersion)) { - $json['api_version'] = $this->apiVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListEventTypesResponse.php b/src/Models/ListEventTypesResponse.php deleted file mode 100644 index 137fc9a8..00000000 --- a/src/Models/ListEventTypesResponse.php +++ /dev/null @@ -1,134 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Event Types. - * The list of event types. - * - * @return string[]|null - */ - public function getEventTypes(): ?array - { - return $this->eventTypes; - } - - /** - * Sets Event Types. - * The list of event types. - * - * @maps event_types - * - * @param string[]|null $eventTypes - */ - public function setEventTypes(?array $eventTypes): void - { - $this->eventTypes = $eventTypes; - } - - /** - * Returns Metadata. - * Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity: - * EventTypeMetadata). - * - * @return EventTypeMetadata[]|null - */ - public function getMetadata(): ?array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity: - * EventTypeMetadata). - * - * @maps metadata - * - * @param EventTypeMetadata[]|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->eventTypes)) { - $json['event_types'] = $this->eventTypes; - } - if (isset($this->metadata)) { - $json['metadata'] = $this->metadata; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListGiftCardActivitiesRequest.php b/src/Models/ListGiftCardActivitiesRequest.php deleted file mode 100644 index c16cac2c..00000000 --- a/src/Models/ListGiftCardActivitiesRequest.php +++ /dev/null @@ -1,401 +0,0 @@ -giftCardId) == 0) { - return null; - } - return $this->giftCardId['value']; - } - - /** - * Sets Gift Card Id. - * If a gift card ID is provided, the endpoint returns activities related - * to the specified gift card. Otherwise, the endpoint returns all gift card activities for - * the seller. - * - * @maps gift_card_id - */ - public function setGiftCardId(?string $giftCardId): void - { - $this->giftCardId['value'] = $giftCardId; - } - - /** - * Unsets Gift Card Id. - * If a gift card ID is provided, the endpoint returns activities related - * to the specified gift card. Otherwise, the endpoint returns all gift card activities for - * the seller. - */ - public function unsetGiftCardId(): void - { - $this->giftCardId = []; - } - - /** - * Returns Type. - * If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of - * the specified type. - * Otherwise, the endpoint returns all types of gift card activities. - */ - public function getType(): ?string - { - if (count($this->type) == 0) { - return null; - } - return $this->type['value']; - } - - /** - * Sets Type. - * If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of - * the specified type. - * Otherwise, the endpoint returns all types of gift card activities. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type['value'] = $type; - } - - /** - * Unsets Type. - * If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of - * the specified type. - * Otherwise, the endpoint returns all types of gift card activities. - */ - public function unsetType(): void - { - $this->type = []; - } - - /** - * Returns Location Id. - * If a location ID is provided, the endpoint returns gift card activities for the specified location. - * Otherwise, the endpoint returns gift card activities for all locations. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * If a location ID is provided, the endpoint returns gift card activities for the specified location. - * Otherwise, the endpoint returns gift card activities for all locations. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * If a location ID is provided, the endpoint returns gift card activities for the specified location. - * Otherwise, the endpoint returns gift card activities for all locations. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Begin Time. - * The timestamp for the beginning of the reporting period, in RFC 3339 format. - * This start time is inclusive. The default value is the current time minus one year. - */ - public function getBeginTime(): ?string - { - if (count($this->beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * The timestamp for the beginning of the reporting period, in RFC 3339 format. - * This start time is inclusive. The default value is the current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * The timestamp for the beginning of the reporting period, in RFC 3339 format. - * This start time is inclusive. The default value is the current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * The timestamp for the end of the reporting period, in RFC 3339 format. - * This end time is inclusive. The default value is the current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * The timestamp for the end of the reporting period, in RFC 3339 format. - * This end time is inclusive. The default value is the current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * The timestamp for the end of the reporting period, in RFC 3339 format. - * This end time is inclusive. The default value is the current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Limit. - * If a limit is provided, the endpoint returns the specified number - * of results (or fewer) per page. The maximum value is 100. The default value is 50. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * If a limit is provided, the endpoint returns the specified number - * of results (or fewer) per page. The maximum value is 100. The default value is 50. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * If a limit is provided, the endpoint returns the specified number - * of results (or fewer) per page. The maximum value is 100. The default value is 50. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Sort Order. - * The order in which the endpoint returns the activities, based on `created_at`. - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function getSortOrder(): ?string - { - if (count($this->sortOrder) == 0) { - return null; - } - return $this->sortOrder['value']; - } - - /** - * Sets Sort Order. - * The order in which the endpoint returns the activities, based on `created_at`. - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder['value'] = $sortOrder; - } - - /** - * Unsets Sort Order. - * The order in which the endpoint returns the activities, based on `created_at`. - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function unsetSortOrder(): void - { - $this->sortOrder = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->giftCardId)) { - $json['gift_card_id'] = $this->giftCardId['value']; - } - if (!empty($this->type)) { - $json['type'] = $this->type['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListGiftCardActivitiesResponse.php b/src/Models/ListGiftCardActivitiesResponse.php deleted file mode 100644 index be5e7e0a..00000000 --- a/src/Models/ListGiftCardActivitiesResponse.php +++ /dev/null @@ -1,133 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card Activities. - * The requested gift card activities or an empty object if none are found. - * - * @return GiftCardActivity[]|null - */ - public function getGiftCardActivities(): ?array - { - return $this->giftCardActivities; - } - - /** - * Sets Gift Card Activities. - * The requested gift card activities or an empty object if none are found. - * - * @maps gift_card_activities - * - * @param GiftCardActivity[]|null $giftCardActivities - */ - public function setGiftCardActivities(?array $giftCardActivities): void - { - $this->giftCardActivities = $giftCardActivities; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of activities. If a cursor is not present, this is - * the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of activities. If a cursor is not present, this is - * the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCardActivities)) { - $json['gift_card_activities'] = $this->giftCardActivities; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListGiftCardsRequest.php b/src/Models/ListGiftCardsRequest.php deleted file mode 100644 index 2b1bd210..00000000 --- a/src/Models/ListGiftCardsRequest.php +++ /dev/null @@ -1,266 +0,0 @@ -type) == 0) { - return null; - } - return $this->type['value']; - } - - /** - * Sets Type. - * If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type. - * Otherwise, the endpoint returns gift cards of all types. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type['value'] = $type; - } - - /** - * Unsets Type. - * If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type. - * Otherwise, the endpoint returns gift cards of all types. - */ - public function unsetType(): void - { - $this->type = []; - } - - /** - * Returns State. - * If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the - * specified state. - * Otherwise, the endpoint returns the gift cards of all states. - */ - public function getState(): ?string - { - if (count($this->state) == 0) { - return null; - } - return $this->state['value']; - } - - /** - * Sets State. - * If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the - * specified state. - * Otherwise, the endpoint returns the gift cards of all states. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state['value'] = $state; - } - - /** - * Unsets State. - * If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the - * specified state. - * Otherwise, the endpoint returns the gift cards of all states. - */ - public function unsetState(): void - { - $this->state = []; - } - - /** - * Returns Limit. - * If a limit is provided, the endpoint returns only the specified number of results per page. - * The maximum value is 200. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * If a limit is provided, the endpoint returns only the specified number of results per page. - * The maximum value is 200. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * If a limit is provided, the endpoint returns only the specified number of results per page. - * The maximum value is 200. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Customer Id. - * If a customer ID is provided, the endpoint returns only the gift cards linked to the specified - * customer. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * If a customer ID is provided, the endpoint returns only the gift cards linked to the specified - * customer. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * If a customer ID is provided, the endpoint returns only the gift cards linked to the specified - * customer. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->type)) { - $json['type'] = $this->type['value']; - } - if (!empty($this->state)) { - $json['state'] = $this->state['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListGiftCardsResponse.php b/src/Models/ListGiftCardsResponse.php deleted file mode 100644 index 20bc12b5..00000000 --- a/src/Models/ListGiftCardsResponse.php +++ /dev/null @@ -1,133 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Cards. - * The requested gift cards or an empty object if none are found. - * - * @return GiftCard[]|null - */ - public function getGiftCards(): ?array - { - return $this->giftCards; - } - - /** - * Sets Gift Cards. - * The requested gift cards or an empty object if none are found. - * - * @maps gift_cards - * - * @param GiftCard[]|null $giftCards - */ - public function setGiftCards(?array $giftCards): void - { - $this->giftCards = $giftCards; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of gift cards. If a cursor is not present, this is - * the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of gift cards. If a cursor is not present, this is - * the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCards)) { - $json['gift_cards'] = $this->giftCards; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListInvoicesRequest.php b/src/Models/ListInvoicesRequest.php deleted file mode 100644 index 888683d5..00000000 --- a/src/Models/ListInvoicesRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -locationId = $locationId; - } - - /** - * Returns Location Id. - * The ID of the location for which to list invoices. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location for which to list invoices. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server uses a default limit of 100 invoices. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server uses a default limit of 100 invoices. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server uses a default limit of 100 invoices. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListInvoicesResponse.php b/src/Models/ListInvoicesResponse.php deleted file mode 100644 index ed39a25b..00000000 --- a/src/Models/ListInvoicesResponse.php +++ /dev/null @@ -1,132 +0,0 @@ -invoices; - } - - /** - * Sets Invoices. - * The invoices retrieved. - * - * @maps invoices - * - * @param Invoice[]|null $invoices - */ - public function setInvoices(?array $invoices): void - { - $this->invoices = $invoices; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of invoices. If empty, this is the final - * response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to retrieve the next set of invoices. If empty, this is the final - * response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoices)) { - $json['invoices'] = $this->invoices; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListJobsRequest.php b/src/Models/ListJobsRequest.php deleted file mode 100644 index ce2ef8e6..00000000 --- a/src/Models/ListJobsRequest.php +++ /dev/null @@ -1,78 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor returned by the previous call to this endpoint. Provide this - * cursor to retrieve the next page of results for your original request. For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor returned by the previous call to this endpoint. Provide this - * cursor to retrieve the next page of results for your original request. For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListJobsResponse.php b/src/Models/ListJobsResponse.php deleted file mode 100644 index c6e94b09..00000000 --- a/src/Models/ListJobsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -jobs; - } - - /** - * Sets Jobs. - * The retrieved jobs. A single paged response contains up to 100 jobs. - * - * @maps jobs - * - * @param Job[]|null $jobs - */ - public function setJobs(?array $jobs): void - { - $this->jobs = $jobs; - } - - /** - * Returns Cursor. - * An opaque cursor used to retrieve the next page of results. This field is present only - * if the request succeeded and additional results are available. For more information, see - * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * An opaque cursor used to retrieve the next page of results. This field is present only - * if the request succeeded and additional results are available. For more information, see - * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->jobs)) { - $json['jobs'] = $this->jobs; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationBookingProfilesRequest.php b/src/Models/ListLocationBookingProfilesRequest.php deleted file mode 100644 index 3bfa422b..00000000 --- a/src/Models/ListLocationBookingProfilesRequest.php +++ /dev/null @@ -1,112 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a paged response. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a paged response. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationBookingProfilesResponse.php b/src/Models/ListLocationBookingProfilesResponse.php deleted file mode 100644 index 0fe1a5b6..00000000 --- a/src/Models/ListLocationBookingProfilesResponse.php +++ /dev/null @@ -1,123 +0,0 @@ -locationBookingProfiles; - } - - /** - * Sets Location Booking Profiles. - * The list of a seller's location booking profiles. - * - * @maps location_booking_profiles - * - * @param LocationBookingProfile[]|null $locationBookingProfiles - */ - public function setLocationBookingProfiles(?array $locationBookingProfiles): void - { - $this->locationBookingProfiles = $locationBookingProfiles; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationBookingProfiles)) { - $json['location_booking_profiles'] = $this->locationBookingProfiles; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationCustomAttributeDefinitionsRequest.php b/src/Models/ListLocationCustomAttributeDefinitionsRequest.php deleted file mode 100644 index 4d5a6928..00000000 --- a/src/Models/ListLocationCustomAttributeDefinitionsRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationCustomAttributeDefinitionsResponse.php b/src/Models/ListLocationCustomAttributeDefinitionsResponse.php deleted file mode 100644 index 1ea7d507..00000000 --- a/src/Models/ListLocationCustomAttributeDefinitionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributeDefinitions; - } - - /** - * Sets Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, - * Square returns an empty object (`{}`). - * - * @maps custom_attribute_definitions - * - * @param CustomAttributeDefinition[]|null $customAttributeDefinitions - */ - public function setCustomAttributeDefinitions(?array $customAttributeDefinitions): void - { - $this->customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinitions)) { - $json['custom_attribute_definitions'] = $this->customAttributeDefinitions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationCustomAttributesRequest.php b/src/Models/ListLocationCustomAttributesRequest.php deleted file mode 100644 index 9c123682..00000000 --- a/src/Models/ListLocationCustomAttributesRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function getWithDefinitions(): ?bool - { - if (count($this->withDefinitions) == 0) { - return null; - } - return $this->withDefinitions['value']; - } - - /** - * Sets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definitions - */ - public function setWithDefinitions(?bool $withDefinitions): void - { - $this->withDefinitions['value'] = $withDefinitions; - } - - /** - * Unsets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinitions(): void - { - $this->withDefinitions = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->withDefinitions)) { - $json['with_definitions'] = $this->withDefinitions['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationCustomAttributesResponse.php b/src/Models/ListLocationCustomAttributesResponse.php deleted file mode 100644 index 0250c9c4..00000000 --- a/src/Models/ListLocationCustomAttributesResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributes; - } - - /** - * Sets Custom Attributes. - * The retrieved custom attributes. If `with_definitions` was set to `true` in the request, - * the custom attribute definition is returned in the `definition` field of each custom attribute. - * If no custom attributes are found, Square returns an empty object (`{}`). - * - * @maps custom_attributes - * - * @param CustomAttribute[]|null $customAttributes - */ - public function setCustomAttributes(?array $customAttributes): void - { - $this->customAttributes = $customAttributes; - } - - /** - * Returns Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributes)) { - $json['custom_attributes'] = $this->customAttributes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLocationsResponse.php b/src/Models/ListLocationsResponse.php deleted file mode 100644 index bec2b8b4..00000000 --- a/src/Models/ListLocationsResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Locations. - * The business locations. - * - * @return Location[]|null - */ - public function getLocations(): ?array - { - return $this->locations; - } - - /** - * Sets Locations. - * The business locations. - * - * @maps locations - * - * @param Location[]|null $locations - */ - public function setLocations(?array $locations): void - { - $this->locations = $locations; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->locations)) { - $json['locations'] = $this->locations; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLoyaltyProgramsResponse.php b/src/Models/ListLoyaltyProgramsResponse.php deleted file mode 100644 index e46b583f..00000000 --- a/src/Models/ListLoyaltyProgramsResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Programs. - * A list of `LoyaltyProgram` for the merchant. - * - * @return LoyaltyProgram[]|null - */ - public function getPrograms(): ?array - { - return $this->programs; - } - - /** - * Sets Programs. - * A list of `LoyaltyProgram` for the merchant. - * - * @maps programs - * - * @param LoyaltyProgram[]|null $programs - */ - public function setPrograms(?array $programs): void - { - $this->programs = $programs; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->programs)) { - $json['programs'] = $this->programs; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLoyaltyPromotionsRequest.php b/src/Models/ListLoyaltyPromotionsRequest.php deleted file mode 100644 index 4eae4f83..00000000 --- a/src/Models/ListLoyaltyPromotionsRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -status; - } - - /** - * Sets Status. - * Indicates the status of a [loyalty promotion]($m/LoyaltyPromotion). - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. - * The minimum value is 1 and the maximum value is 30. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. - * The minimum value is 1 and the maximum value is 30. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. - * The minimum value is 1 and the maximum value is 30. The default value is 30. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListLoyaltyPromotionsResponse.php b/src/Models/ListLoyaltyPromotionsResponse.php deleted file mode 100644 index a952d28b..00000000 --- a/src/Models/ListLoyaltyPromotionsResponse.php +++ /dev/null @@ -1,133 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Promotions. - * The retrieved loyalty promotions. - * - * @return LoyaltyPromotion[]|null - */ - public function getLoyaltyPromotions(): ?array - { - return $this->loyaltyPromotions; - } - - /** - * Sets Loyalty Promotions. - * The retrieved loyalty promotions. - * - * @maps loyalty_promotions - * - * @param LoyaltyPromotion[]|null $loyaltyPromotions - */ - public function setLoyaltyPromotions(?array $loyaltyPromotions): void - { - $this->loyaltyPromotions = $loyaltyPromotions; - } - - /** - * Returns Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyPromotions)) { - $json['loyalty_promotions'] = $this->loyaltyPromotions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantCustomAttributeDefinitionsRequest.php b/src/Models/ListMerchantCustomAttributeDefinitionsRequest.php deleted file mode 100644 index 60fb87ca..00000000 --- a/src/Models/ListMerchantCustomAttributeDefinitionsRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantCustomAttributeDefinitionsResponse.php b/src/Models/ListMerchantCustomAttributeDefinitionsResponse.php deleted file mode 100644 index 12c346c5..00000000 --- a/src/Models/ListMerchantCustomAttributeDefinitionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributeDefinitions; - } - - /** - * Sets Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, - * Square returns an empty object (`{}`). - * - * @maps custom_attribute_definitions - * - * @param CustomAttributeDefinition[]|null $customAttributeDefinitions - */ - public function setCustomAttributeDefinitions(?array $customAttributeDefinitions): void - { - $this->customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of - * results for your original request. This field is present only if the request succeeded and - * additional results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinitions)) { - $json['custom_attribute_definitions'] = $this->customAttributeDefinitions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantCustomAttributesRequest.php b/src/Models/ListMerchantCustomAttributesRequest.php deleted file mode 100644 index 3e280968..00000000 --- a/src/Models/ListMerchantCustomAttributesRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. For more - * information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function getWithDefinitions(): ?bool - { - if (count($this->withDefinitions) == 0) { - return null; - } - return $this->withDefinitions['value']; - } - - /** - * Sets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definitions - */ - public function setWithDefinitions(?bool $withDefinitions): void - { - $this->withDefinitions['value'] = $withDefinitions; - } - - /** - * Unsets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinitions(): void - { - $this->withDefinitions = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->withDefinitions)) { - $json['with_definitions'] = $this->withDefinitions['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantCustomAttributesResponse.php b/src/Models/ListMerchantCustomAttributesResponse.php deleted file mode 100644 index 6a99e640..00000000 --- a/src/Models/ListMerchantCustomAttributesResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -customAttributes; - } - - /** - * Sets Custom Attributes. - * The retrieved custom attributes. If `with_definitions` was set to `true` in the request, - * the custom attribute definition is returned in the `definition` field of each custom attribute. - * If no custom attributes are found, Square returns an empty object (`{}`). - * - * @maps custom_attributes - * - * @param CustomAttribute[]|null $customAttributes - */ - public function setCustomAttributes(?array $customAttributes): void - { - $this->customAttributes = $customAttributes; - } - - /** - * Returns Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to use in your next call to this endpoint to retrieve the next page of results - * for your original request. This field is present only if the request succeeded and additional - * results are available. For more information, see [Pagination](https://developer.squareup. - * com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributes)) { - $json['custom_attributes'] = $this->customAttributes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantsRequest.php b/src/Models/ListMerchantsRequest.php deleted file mode 100644 index 447c2046..00000000 --- a/src/Models/ListMerchantsRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor generated by the previous response. - * - * @maps cursor - */ - public function setCursor(?int $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor generated by the previous response. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListMerchantsResponse.php b/src/Models/ListMerchantsResponse.php deleted file mode 100644 index 5b132ec7..00000000 --- a/src/Models/ListMerchantsResponse.php +++ /dev/null @@ -1,124 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Merchant. - * The requested `Merchant` entities. - * - * @return Merchant[]|null - */ - public function getMerchant(): ?array - { - return $this->merchant; - } - - /** - * Sets Merchant. - * The requested `Merchant` entities. - * - * @maps merchant - * - * @param Merchant[]|null $merchant - */ - public function setMerchant(?array $merchant): void - { - $this->merchant = $merchant; - } - - /** - * Returns Cursor. - * If the response is truncated, the cursor to use in next request to fetch next set of objects. - */ - public function getCursor(): ?int - { - return $this->cursor; - } - - /** - * Sets Cursor. - * If the response is truncated, the cursor to use in next request to fetch next set of objects. - * - * @maps cursor - */ - public function setCursor(?int $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->merchant)) { - $json['merchant'] = $this->merchant; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListOrderCustomAttributeDefinitionsRequest.php b/src/Models/ListOrderCustomAttributeDefinitionsRequest.php deleted file mode 100644 index ac78af30..00000000 --- a/src/Models/ListOrderCustomAttributeDefinitionsRequest.php +++ /dev/null @@ -1,166 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListOrderCustomAttributeDefinitionsResponse.php b/src/Models/ListOrderCustomAttributeDefinitionsResponse.php deleted file mode 100644 index 3af3583e..00000000 --- a/src/Models/ListOrderCustomAttributeDefinitionsResponse.php +++ /dev/null @@ -1,141 +0,0 @@ -customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, Square - * returns an empty object (`{}`). - * - * @return CustomAttributeDefinition[] - */ - public function getCustomAttributeDefinitions(): array - { - return $this->customAttributeDefinitions; - } - - /** - * Sets Custom Attribute Definitions. - * The retrieved custom attribute definitions. If no custom attribute definitions are found, Square - * returns an empty object (`{}`). - * - * @required - * @maps custom_attribute_definitions - * - * @param CustomAttributeDefinition[] $customAttributeDefinitions - */ - public function setCustomAttributeDefinitions(array $customAttributeDefinitions): void - { - $this->customAttributeDefinitions = $customAttributeDefinitions; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of results for - * your original request. - * This field is present only if the request succeeded and additional results are available. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of results for - * your original request. - * This field is present only if the request succeeded and additional results are available. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definitions'] = $this->customAttributeDefinitions; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListOrderCustomAttributesRequest.php b/src/Models/ListOrderCustomAttributesRequest.php deleted file mode 100644 index 66148fa4..00000000 --- a/src/Models/ListOrderCustomAttributesRequest.php +++ /dev/null @@ -1,218 +0,0 @@ -visibilityFilter; - } - - /** - * Sets Visibility Filter. - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom - * attribute definitions. - * - * @maps visibility_filter - */ - public function setVisibilityFilter(?string $visibilityFilter): void - { - $this->visibilityFilter = $visibilityFilter; - } - - /** - * Returns Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The cursor returned in the paged response from the previous call to this endpoint. - * Provide this cursor to retrieve the next page of results for your original request. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a single paged response. This limit is advisory. - * The response might contain more or fewer results. The minimum value is 1 and the maximum value is - * 100. - * The default value is 20. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - */ - public function getWithDefinitions(): ?bool - { - if (count($this->withDefinitions) == 0) { - return null; - } - return $this->withDefinitions['value']; - } - - /** - * Sets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - * - * @maps with_definitions - */ - public function setWithDefinitions(?bool $withDefinitions): void - { - $this->withDefinitions['value'] = $withDefinitions; - } - - /** - * Unsets With Definitions. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - */ - public function unsetWithDefinitions(): void - { - $this->withDefinitions = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->visibilityFilter)) { - $json['visibility_filter'] = $this->visibilityFilter; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->withDefinitions)) { - $json['with_definitions'] = $this->withDefinitions['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListOrderCustomAttributesResponse.php b/src/Models/ListOrderCustomAttributesResponse.php deleted file mode 100644 index 3deb679f..00000000 --- a/src/Models/ListOrderCustomAttributesResponse.php +++ /dev/null @@ -1,134 +0,0 @@ -customAttributes; - } - - /** - * Sets Custom Attributes. - * The retrieved custom attributes. If no custom attribute are found, Square returns an empty object - * (`{}`). - * - * @maps custom_attributes - * - * @param CustomAttribute[]|null $customAttributes - */ - public function setCustomAttributes(?array $customAttributes): void - { - $this->customAttributes = $customAttributes; - } - - /** - * Returns Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of results for - * your original request. - * This field is present only if the request succeeded and additional results are available. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The cursor to provide in your next call to this endpoint to retrieve the next page of results for - * your original request. - * This field is present only if the request succeeded and additional results are available. - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributes)) { - $json['custom_attributes'] = $this->customAttributes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentLinksRequest.php b/src/Models/ListPaymentLinksRequest.php deleted file mode 100644 index 5669dc50..00000000 --- a/src/Models/ListPaymentLinksRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * If a cursor is not provided, the endpoint returns the first page of the results. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * A limit on the number of results to return per page. The limit is advisory and - * the implementation might return more or less results. If the supplied limit is negative, zero, or - * greater than the maximum limit of 1000, it is ignored. - * - * Default value: `100` - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * A limit on the number of results to return per page. The limit is advisory and - * the implementation might return more or less results. If the supplied limit is negative, zero, or - * greater than the maximum limit of 1000, it is ignored. - * - * Default value: `100` - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * A limit on the number of results to return per page. The limit is advisory and - * the implementation might return more or less results. If the supplied limit is negative, zero, or - * greater than the maximum limit of 1000, it is ignored. - * - * Default value: `100` - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentLinksResponse.php b/src/Models/ListPaymentLinksResponse.php deleted file mode 100644 index 795c3fa8..00000000 --- a/src/Models/ListPaymentLinksResponse.php +++ /dev/null @@ -1,127 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment Links. - * The list of payment links. - * - * @return PaymentLink[]|null - */ - public function getPaymentLinks(): ?array - { - return $this->paymentLinks; - } - - /** - * Sets Payment Links. - * The list of payment links. - * - * @maps payment_links - * - * @param PaymentLink[]|null $paymentLinks - */ - public function setPaymentLinks(?array $paymentLinks): void - { - $this->paymentLinks = $paymentLinks; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a subsequent request - * to retrieve the next set of gift cards. If a cursor is not present, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a subsequent request - * to retrieve the next set of gift cards. If a cursor is not present, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->paymentLinks)) { - $json['payment_links'] = $this->paymentLinks; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentRefundsRequest.php b/src/Models/ListPaymentRefundsRequest.php deleted file mode 100644 index 624c44fe..00000000 --- a/src/Models/ListPaymentRefundsRequest.php +++ /dev/null @@ -1,436 +0,0 @@ -beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - * format. The range is determined using the `created_at` field for each `PaymentRefund`. - * - * Default: The current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - * format. The range is determined using the `created_at` field for each `PaymentRefund`. - * - * Default: The current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - * format. The range is determined using the `created_at` field for each `PaymentRefund`. - * - * Default: The current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - * format. The range is determined using the `created_at` field for each `PaymentRefund`. - * - * Default: The current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - * format. The range is determined using the `created_at` field for each `PaymentRefund`. - * - * Default: The current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Sort Order. - * The order in which results are listed by `PaymentRefund.created_at`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function getSortOrder(): ?string - { - if (count($this->sortOrder) == 0) { - return null; - } - return $this->sortOrder['value']; - } - - /** - * Sets Sort Order. - * The order in which results are listed by `PaymentRefund.created_at`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder['value'] = $sortOrder; - } - - /** - * Unsets Sort Order. - * The order in which results are listed by `PaymentRefund.created_at`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function unsetSortOrder(): void - { - $this->sortOrder = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Location Id. - * Limit results to the location supplied. By default, results are returned - * for all locations associated with the seller. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * Limit results to the location supplied. By default, results are returned - * for all locations associated with the seller. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * Limit results to the location supplied. By default, results are returned - * for all locations associated with the seller. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Status. - * If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](entity:PaymentRefund). - * - * Default: If omitted, refunds are returned regardless of their status. - */ - public function getStatus(): ?string - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](entity:PaymentRefund). - * - * Default: If omitted, refunds are returned regardless of their status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](entity:PaymentRefund). - * - * Default: If omitted, refunds are returned regardless of their status. - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Returns Source Type. - * If provided, only returns refunds whose payments have the indicated source type. - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. - * For information about these payment source types, see - * [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - * - * Default: If omitted, refunds are returned regardless of the source type. - */ - public function getSourceType(): ?string - { - if (count($this->sourceType) == 0) { - return null; - } - return $this->sourceType['value']; - } - - /** - * Sets Source Type. - * If provided, only returns refunds whose payments have the indicated source type. - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. - * For information about these payment source types, see - * [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - * - * Default: If omitted, refunds are returned regardless of the source type. - * - * @maps source_type - */ - public function setSourceType(?string $sourceType): void - { - $this->sourceType['value'] = $sourceType; - } - - /** - * Unsets Source Type. - * If provided, only returns refunds whose payments have the indicated source type. - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. - * For information about these payment source types, see - * [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - * - * Default: If omitted, refunds are returned regardless of the source type. - */ - public function unsetSourceType(): void - { - $this->sourceType = []; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * - * It is possible to receive fewer results than the specified limit on a given page. - * - * If the supplied value is greater than 100, no more than 100 results are returned. - * - * Default: 100 - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * - * It is possible to receive fewer results than the specified limit on a given page. - * - * If the supplied value is greater than 100, no more than 100 results are returned. - * - * Default: 100 - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to be returned in a single page. - * - * It is possible to receive fewer results than the specified limit on a given page. - * - * If the supplied value is greater than 100, no more than 100 results are returned. - * - * Default: 100 - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (!empty($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - if (!empty($this->sourceType)) { - $json['source_type'] = $this->sourceType['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentRefundsResponse.php b/src/Models/ListPaymentRefundsResponse.php deleted file mode 100644 index 4122b394..00000000 --- a/src/Models/ListPaymentRefundsResponse.php +++ /dev/null @@ -1,134 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refunds. - * The list of requested refunds. - * - * @return PaymentRefund[]|null - */ - public function getRefunds(): ?array - { - return $this->refunds; - } - - /** - * Sets Refunds. - * The list of requested refunds. - * - * @maps refunds - * - * @param PaymentRefund[]|null $refunds - */ - public function setRefunds(?array $refunds): void - { - $this->refunds = $refunds; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refunds)) { - $json['refunds'] = $this->refunds; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentsRequest.php b/src/Models/ListPaymentsRequest.php deleted file mode 100644 index 5e97ef71..00000000 --- a/src/Models/ListPaymentsRequest.php +++ /dev/null @@ -1,711 +0,0 @@ -beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * Indicates the start of the time range to retrieve payments for, in RFC 3339 format. - * The range is determined using the `created_at` field for each Payment. - * Inclusive. Default: The current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * Indicates the start of the time range to retrieve payments for, in RFC 3339 format. - * The range is determined using the `created_at` field for each Payment. - * Inclusive. Default: The current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `created_at` field for each Payment. - * - * Default: The current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `created_at` field for each Payment. - * - * Default: The current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `created_at` field for each Payment. - * - * Default: The current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Sort Order. - * The order in which results are listed by `ListPaymentsRequest.sort_field`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function getSortOrder(): ?string - { - if (count($this->sortOrder) == 0) { - return null; - } - return $this->sortOrder['value']; - } - - /** - * Sets Sort Order. - * The order in which results are listed by `ListPaymentsRequest.sort_field`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder['value'] = $sortOrder; - } - - /** - * Unsets Sort Order. - * The order in which results are listed by `ListPaymentsRequest.sort_field`: - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function unsetSortOrder(): void - { - $this->sortOrder = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Location Id. - * Limit results to the location supplied. By default, results are returned - * for the default (main) location associated with the seller. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * Limit results to the location supplied. By default, results are returned - * for the default (main) location associated with the seller. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * Limit results to the location supplied. By default, results are returned - * for the default (main) location associated with the seller. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Total. - * The exact amount in the `total_money` for a payment. - */ - public function getTotal(): ?int - { - if (count($this->total) == 0) { - return null; - } - return $this->total['value']; - } - - /** - * Sets Total. - * The exact amount in the `total_money` for a payment. - * - * @maps total - */ - public function setTotal(?int $total): void - { - $this->total['value'] = $total; - } - - /** - * Unsets Total. - * The exact amount in the `total_money` for a payment. - */ - public function unsetTotal(): void - { - $this->total = []; - } - - /** - * Returns Last 4. - * The last four digits of a payment card. - */ - public function getLast4(): ?string - { - if (count($this->last4) == 0) { - return null; - } - return $this->last4['value']; - } - - /** - * Sets Last 4. - * The last four digits of a payment card. - * - * @maps last_4 - */ - public function setLast4(?string $last4): void - { - $this->last4['value'] = $last4; - } - - /** - * Unsets Last 4. - * The last four digits of a payment card. - */ - public function unsetLast4(): void - { - $this->last4 = []; - } - - /** - * Returns Card Brand. - * The brand of the payment card (for example, VISA). - */ - public function getCardBrand(): ?string - { - if (count($this->cardBrand) == 0) { - return null; - } - return $this->cardBrand['value']; - } - - /** - * Sets Card Brand. - * The brand of the payment card (for example, VISA). - * - * @maps card_brand - */ - public function setCardBrand(?string $cardBrand): void - { - $this->cardBrand['value'] = $cardBrand; - } - - /** - * Unsets Card Brand. - * The brand of the payment card (for example, VISA). - */ - public function unsetCardBrand(): void - { - $this->cardBrand = []; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * - * Default: `100` - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * - * Default: `100` - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * - * Default: `100` - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Is Offline Payment. - * Whether the payment was taken offline or not. - */ - public function getIsOfflinePayment(): ?bool - { - if (count($this->isOfflinePayment) == 0) { - return null; - } - return $this->isOfflinePayment['value']; - } - - /** - * Sets Is Offline Payment. - * Whether the payment was taken offline or not. - * - * @maps is_offline_payment - */ - public function setIsOfflinePayment(?bool $isOfflinePayment): void - { - $this->isOfflinePayment['value'] = $isOfflinePayment; - } - - /** - * Unsets Is Offline Payment. - * Whether the payment was taken offline or not. - */ - public function unsetIsOfflinePayment(): void - { - $this->isOfflinePayment = []; - } - - /** - * Returns Offline Begin Time. - * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - */ - public function getOfflineBeginTime(): ?string - { - if (count($this->offlineBeginTime) == 0) { - return null; - } - return $this->offlineBeginTime['value']; - } - - /** - * Sets Offline Begin Time. - * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - * - * @maps offline_begin_time - */ - public function setOfflineBeginTime(?string $offlineBeginTime): void - { - $this->offlineBeginTime['value'] = $offlineBeginTime; - } - - /** - * Unsets Offline Begin Time. - * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - */ - public function unsetOfflineBeginTime(): void - { - $this->offlineBeginTime = []; - } - - /** - * Returns Offline End Time. - * Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - */ - public function getOfflineEndTime(): ?string - { - if (count($this->offlineEndTime) == 0) { - return null; - } - return $this->offlineEndTime['value']; - } - - /** - * Sets Offline End Time. - * Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - * - * @maps offline_end_time - */ - public function setOfflineEndTime(?string $offlineEndTime): void - { - $this->offlineEndTime['value'] = $offlineEndTime; - } - - /** - * Unsets Offline End Time. - * Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 - * format for timestamps. The range is determined using the - * `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - * value set in `offline_payment_details.client_created_at` will not be returned. - * - * Default: The current time. - */ - public function unsetOfflineEndTime(): void - { - $this->offlineEndTime = []; - } - - /** - * Returns Updated at Begin Time. - * Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - */ - public function getUpdatedAtBeginTime(): ?string - { - if (count($this->updatedAtBeginTime) == 0) { - return null; - } - return $this->updatedAtBeginTime['value']; - } - - /** - * Sets Updated at Begin Time. - * Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - * - * @maps updated_at_begin_time - */ - public function setUpdatedAtBeginTime(?string $updatedAtBeginTime): void - { - $this->updatedAtBeginTime['value'] = $updatedAtBeginTime; - } - - /** - * Unsets Updated at Begin Time. - * Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - */ - public function unsetUpdatedAtBeginTime(): void - { - $this->updatedAtBeginTime = []; - } - - /** - * Returns Updated at End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - */ - public function getUpdatedAtEndTime(): ?string - { - if (count($this->updatedAtEndTime) == 0) { - return null; - } - return $this->updatedAtEndTime['value']; - } - - /** - * Sets Updated at End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - * - * @maps updated_at_end_time - */ - public function setUpdatedAtEndTime(?string $updatedAtEndTime): void - { - $this->updatedAtEndTime['value'] = $updatedAtEndTime; - } - - /** - * Unsets Updated at End Time. - * Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - * range is determined using the `updated_at` field for each Payment. - */ - public function unsetUpdatedAtEndTime(): void - { - $this->updatedAtEndTime = []; - } - - /** - * Returns Sort Field. - */ - public function getSortField(): ?string - { - return $this->sortField; - } - - /** - * Sets Sort Field. - * - * @maps sort_field - */ - public function setSortField(?string $sortField): void - { - $this->sortField = $sortField; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (!empty($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->total)) { - $json['total'] = $this->total['value']; - } - if (!empty($this->last4)) { - $json['last_4'] = $this->last4['value']; - } - if (!empty($this->cardBrand)) { - $json['card_brand'] = $this->cardBrand['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->isOfflinePayment)) { - $json['is_offline_payment'] = $this->isOfflinePayment['value']; - } - if (!empty($this->offlineBeginTime)) { - $json['offline_begin_time'] = $this->offlineBeginTime['value']; - } - if (!empty($this->offlineEndTime)) { - $json['offline_end_time'] = $this->offlineEndTime['value']; - } - if (!empty($this->updatedAtBeginTime)) { - $json['updated_at_begin_time'] = $this->updatedAtBeginTime['value']; - } - if (!empty($this->updatedAtEndTime)) { - $json['updated_at_end_time'] = $this->updatedAtEndTime['value']; - } - if (isset($this->sortField)) { - $json['sort_field'] = $this->sortField; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPaymentsResponse.php b/src/Models/ListPaymentsResponse.php deleted file mode 100644 index e229a7be..00000000 --- a/src/Models/ListPaymentsResponse.php +++ /dev/null @@ -1,132 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payments. - * The requested list of payments. - * - * @return Payment[]|null - */ - public function getPayments(): ?array - { - return $this->payments; - } - - /** - * Sets Payments. - * The requested list of payments. - * - * @maps payments - * - * @param Payment[]|null $payments - */ - public function setPayments(?array $payments): void - { - $this->payments = $payments; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payments)) { - $json['payments'] = $this->payments; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPayoutEntriesRequest.php b/src/Models/ListPayoutEntriesRequest.php deleted file mode 100644 index 11e2b5ee..00000000 --- a/src/Models/ListPayoutEntriesRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPayoutEntriesResponse.php b/src/Models/ListPayoutEntriesResponse.php deleted file mode 100644 index 3fadf5cf..00000000 --- a/src/Models/ListPayoutEntriesResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -payoutEntries; - } - - /** - * Sets Payout Entries. - * The requested list of payout entries, ordered with the given or default sort order. - * - * @maps payout_entries - * - * @param PayoutEntry[]|null $payoutEntries - */ - public function setPayoutEntries(?array $payoutEntries): void - { - $this->payoutEntries = $payoutEntries; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->payoutEntries)) { - $json['payout_entries'] = $this->payoutEntries; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPayoutsRequest.php b/src/Models/ListPayoutsRequest.php deleted file mode 100644 index 89a694f7..00000000 --- a/src/Models/ListPayoutsRequest.php +++ /dev/null @@ -1,324 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location for which to list the payouts. - * By default, payouts are returned for the default (main) location associated with the seller. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location for which to list the payouts. - * By default, payouts are returned for the default (main) location associated with the seller. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Status. - * Payout status types - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Payout status types - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Begin Time. - * The timestamp for the beginning of the payout creation time, in RFC 3339 format. - * Inclusive. Default: The current time minus one year. - */ - public function getBeginTime(): ?string - { - if (count($this->beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * The timestamp for the beginning of the payout creation time, in RFC 3339 format. - * Inclusive. Default: The current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * The timestamp for the beginning of the payout creation time, in RFC 3339 format. - * Inclusive. Default: The current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * The timestamp for the end of the payout creation time, in RFC 3339 format. - * Default: The current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * The timestamp for the end of the payout creation time, in RFC 3339 format. - * Default: The current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * The timestamp for the end of the payout creation time, in RFC 3339 format. - * Default: The current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * If request parameters change between requests, subsequent results may contain duplicates or missing - * records. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. If the provided value is - * greater than 100, it is ignored and the default value is used instead. - * Default: `100` - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListPayoutsResponse.php b/src/Models/ListPayoutsResponse.php deleted file mode 100644 index a18af4ff..00000000 --- a/src/Models/ListPayoutsResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -payouts; - } - - /** - * Sets Payouts. - * The requested list of payouts. - * - * @maps payouts - * - * @param Payout[]|null $payouts - */ - public function setPayouts(?array $payouts): void - { - $this->payouts = $payouts; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->payouts)) { - $json['payouts'] = $this->payouts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListRefundsRequest.php b/src/Models/ListRefundsRequest.php deleted file mode 100644 index de0a2568..00000000 --- a/src/Models/ListRefundsRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * The beginning of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * The beginning of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListRefundsResponse.php b/src/Models/ListRefundsResponse.php deleted file mode 100644 index ad8095ac..00000000 --- a/src/Models/ListRefundsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refunds. - * An array of refunds that match your query. - * - * @return Refund[]|null - */ - public function getRefunds(): ?array - { - return $this->refunds; - } - - /** - * Sets Refunds. - * An array of refunds that match your query. - * - * @maps refunds - * - * @param Refund[]|null $refunds - */ - public function setRefunds(?array $refunds): void - { - $this->refunds = $refunds; - } - - /** - * Returns Cursor. - * A pagination cursor for retrieving the next set of results, - * if any remain. Provide this value as the `cursor` parameter in a subsequent - * request to this endpoint. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor for retrieving the next set of results, - * if any remain. Provide this value as the `cursor` parameter in a subsequent - * request to this endpoint. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refunds)) { - $json['refunds'] = $this->refunds; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListSitesResponse.php b/src/Models/ListSitesResponse.php deleted file mode 100644 index 1458a2cb..00000000 --- a/src/Models/ListSitesResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Sites. - * The sites that belong to the seller. - * - * @return Site[]|null - */ - public function getSites(): ?array - { - return $this->sites; - } - - /** - * Sets Sites. - * The sites that belong to the seller. - * - * @maps sites - * - * @param Site[]|null $sites - */ - public function setSites(?array $sites): void - { - $this->sites = $sites; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->sites)) { - $json['sites'] = $this->sites; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListSubscriptionEventsRequest.php b/src/Models/ListSubscriptionEventsRequest.php deleted file mode 100644 index fc1a5cd5..00000000 --- a/src/Models/ListSubscriptionEventsRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * When the total number of resulting subscription events exceeds the limit of a paged response, - * specify the cursor returned from a preceding response here to fetch the next set of results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * When the total number of resulting subscription events exceeds the limit of a paged response, - * specify the cursor returned from a preceding response here to fetch the next set of results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Limit. - * The upper limit on the number of subscription events to return - * in a paged response. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The upper limit on the number of subscription events to return - * in a paged response. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The upper limit on the number of subscription events to return - * in a paged response. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListSubscriptionEventsResponse.php b/src/Models/ListSubscriptionEventsResponse.php deleted file mode 100644 index 8b288f8a..00000000 --- a/src/Models/ListSubscriptionEventsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription Events. - * The retrieved subscription events. - * - * @return SubscriptionEvent[]|null - */ - public function getSubscriptionEvents(): ?array - { - return $this->subscriptionEvents; - } - - /** - * Sets Subscription Events. - * The retrieved subscription events. - * - * @maps subscription_events - * - * @param SubscriptionEvent[]|null $subscriptionEvents - */ - public function setSubscriptionEvents(?array $subscriptionEvents): void - { - $this->subscriptionEvents = $subscriptionEvents; - } - - /** - * Returns Cursor. - * When the total number of resulting subscription events exceeds the limit of a paged response, - * the response includes a cursor for you to use in a subsequent request to fetch the next set of - * events. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When the total number of resulting subscription events exceeds the limit of a paged response, - * the response includes a cursor for you to use in a subsequent request to fetch the next set of - * events. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscriptionEvents)) { - $json['subscription_events'] = $this->subscriptionEvents; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTeamMemberBookingProfilesRequest.php b/src/Models/ListTeamMemberBookingProfilesRequest.php deleted file mode 100644 index 72bf8b6c..00000000 --- a/src/Models/ListTeamMemberBookingProfilesRequest.php +++ /dev/null @@ -1,195 +0,0 @@ -bookableOnly) == 0) { - return null; - } - return $this->bookableOnly['value']; - } - - /** - * Sets Bookable Only. - * Indicates whether to include only bookable team members in the returned result (`true`) or not - * (`false`). - * - * @maps bookable_only - */ - public function setBookableOnly(?bool $bookableOnly): void - { - $this->bookableOnly['value'] = $bookableOnly; - } - - /** - * Unsets Bookable Only. - * Indicates whether to include only bookable team members in the returned result (`true`) or not - * (`false`). - */ - public function unsetBookableOnly(): void - { - $this->bookableOnly = []; - } - - /** - * Returns Limit. - * The maximum number of results to return in a paged response. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to return in a paged response. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to return in a paged response. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * The pagination cursor from the preceding response to return the next page of the results. Do not set - * this when retrieving the first page of the results. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Location Id. - * Indicates whether to include only team members enabled at the given location in the returned result. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * Indicates whether to include only team members enabled at the given location in the returned result. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * Indicates whether to include only team members enabled at the given location in the returned result. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->bookableOnly)) { - $json['bookable_only'] = $this->bookableOnly['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTeamMemberBookingProfilesResponse.php b/src/Models/ListTeamMemberBookingProfilesResponse.php deleted file mode 100644 index c9468f14..00000000 --- a/src/Models/ListTeamMemberBookingProfilesResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -teamMemberBookingProfiles; - } - - /** - * Sets Team Member Booking Profiles. - * The list of team member booking profiles. The results are returned in the ascending order of the - * time - * when the team member booking profiles were last updated. Multiple booking profiles updated at the - * same time - * are further sorted in the ascending order of their IDs. - * - * @maps team_member_booking_profiles - * - * @param TeamMemberBookingProfile[]|null $teamMemberBookingProfiles - */ - public function setTeamMemberBookingProfiles(?array $teamMemberBookingProfiles): void - { - $this->teamMemberBookingProfiles = $teamMemberBookingProfiles; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in the subsequent request to get the next page of the results. Stop - * retrieving the next page of the results when the cursor is not set. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberBookingProfiles)) { - $json['team_member_booking_profiles'] = $this->teamMemberBookingProfiles; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTeamMemberWagesRequest.php b/src/Models/ListTeamMemberWagesRequest.php deleted file mode 100644 index 136aa484..00000000 --- a/src/Models/ListTeamMemberWagesRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * Filter the returned wages to only those that are associated with the - * specified team member. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * Filter the returned wages to only those that are associated with the - * specified team member. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Limit. - * The maximum number of `TeamMemberWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of `TeamMemberWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of `TeamMemberWage` results to return per page. The number can range between - * 1 and 200. The default is 200. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pointer to the next page of `EmployeeWage` results to fetch. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTeamMemberWagesResponse.php b/src/Models/ListTeamMemberWagesResponse.php deleted file mode 100644 index ff7d32e7..00000000 --- a/src/Models/ListTeamMemberWagesResponse.php +++ /dev/null @@ -1,127 +0,0 @@ -teamMemberWages; - } - - /** - * Sets Team Member Wages. - * A page of `TeamMemberWage` results. - * - * @maps team_member_wages - * - * @param TeamMemberWage[]|null $teamMemberWages - */ - public function setTeamMemberWages(?array $teamMemberWages): void - { - $this->teamMemberWages = $teamMemberWages; - } - - /** - * Returns Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `TeamMemberWage` results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The value supplied in the subsequent request to fetch the next page - * of `TeamMemberWage` results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberWages)) { - $json['team_member_wages'] = $this->teamMemberWages; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTransactionsRequest.php b/src/Models/ListTransactionsRequest.php deleted file mode 100644 index 771b142e..00000000 --- a/src/Models/ListTransactionsRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -beginTime) == 0) { - return null; - } - return $this->beginTime['value']; - } - - /** - * Sets Begin Time. - * The beginning of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time minus one year. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime['value'] = $beginTime; - } - - /** - * Unsets Begin Time. - * The beginning of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time minus one year. - */ - public function unsetBeginTime(): void - { - $this->beginTime = []; - } - - /** - * Returns End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - */ - public function getEndTime(): ?string - { - if (count($this->endTime) == 0) { - return null; - } - return $this->endTime['value']; - } - - /** - * Sets End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - * - * @maps end_time - */ - public function setEndTime(?string $endTime): void - { - $this->endTime['value'] = $endTime; - } - - /** - * Unsets End Time. - * The end of the requested reporting period, in RFC 3339 format. - * - * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details - * on date inclusivity/exclusivity. - * - * Default value: The current time. - */ - public function unsetEndTime(): void - { - $this->endTime = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->beginTime)) { - $json['begin_time'] = $this->beginTime['value']; - } - if (!empty($this->endTime)) { - $json['end_time'] = $this->endTime['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListTransactionsResponse.php b/src/Models/ListTransactionsResponse.php deleted file mode 100644 index 7486fb10..00000000 --- a/src/Models/ListTransactionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Transactions. - * An array of transactions that match your query. - * - * @return Transaction[]|null - */ - public function getTransactions(): ?array - { - return $this->transactions; - } - - /** - * Sets Transactions. - * An array of transactions that match your query. - * - * @maps transactions - * - * @param Transaction[]|null $transactions - */ - public function setTransactions(?array $transactions): void - { - $this->transactions = $transactions; - } - - /** - * Returns Cursor. - * A pagination cursor for retrieving the next set of results, - * if any remain. Provide this value as the `cursor` parameter in a subsequent - * request to this endpoint. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor for retrieving the next set of results, - * if any remain. Provide this value as the `cursor` parameter in a subsequent - * request to this endpoint. - * - * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->transactions)) { - $json['transactions'] = $this->transactions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWebhookEventTypesRequest.php b/src/Models/ListWebhookEventTypesRequest.php deleted file mode 100644 index 100a9c2d..00000000 --- a/src/Models/ListWebhookEventTypesRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion) == 0) { - return null; - } - return $this->apiVersion['value']; - } - - /** - * Sets Api Version. - * The API version for which to list event types. Setting this field overrides the default version used - * by the application. - * - * @maps api_version - */ - public function setApiVersion(?string $apiVersion): void - { - $this->apiVersion['value'] = $apiVersion; - } - - /** - * Unsets Api Version. - * The API version for which to list event types. Setting this field overrides the default version used - * by the application. - */ - public function unsetApiVersion(): void - { - $this->apiVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->apiVersion)) { - $json['api_version'] = $this->apiVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWebhookEventTypesResponse.php b/src/Models/ListWebhookEventTypesResponse.php deleted file mode 100644 index 924c350f..00000000 --- a/src/Models/ListWebhookEventTypesResponse.php +++ /dev/null @@ -1,134 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Event Types. - * The list of event types. - * - * @return string[]|null - */ - public function getEventTypes(): ?array - { - return $this->eventTypes; - } - - /** - * Sets Event Types. - * The list of event types. - * - * @maps event_types - * - * @param string[]|null $eventTypes - */ - public function setEventTypes(?array $eventTypes): void - { - $this->eventTypes = $eventTypes; - } - - /** - * Returns Metadata. - * Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity: - * EventTypeMetadata). - * - * @return EventTypeMetadata[]|null - */ - public function getMetadata(): ?array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity: - * EventTypeMetadata). - * - * @maps metadata - * - * @param EventTypeMetadata[]|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->eventTypes)) { - $json['event_types'] = $this->eventTypes; - } - if (isset($this->metadata)) { - $json['metadata'] = $this->metadata; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWebhookSubscriptionsRequest.php b/src/Models/ListWebhookSubscriptionsRequest.php deleted file mode 100644 index 15b605c3..00000000 --- a/src/Models/ListWebhookSubscriptionsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Returns Include Disabled. - * Includes disabled [Subscription](entity:WebhookSubscription)s. - * By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - */ - public function getIncludeDisabled(): ?bool - { - if (count($this->includeDisabled) == 0) { - return null; - } - return $this->includeDisabled['value']; - } - - /** - * Sets Include Disabled. - * Includes disabled [Subscription](entity:WebhookSubscription)s. - * By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - * - * @maps include_disabled - */ - public function setIncludeDisabled(?bool $includeDisabled): void - { - $this->includeDisabled['value'] = $includeDisabled; - } - - /** - * Unsets Include Disabled. - * Includes disabled [Subscription](entity:WebhookSubscription)s. - * By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - */ - public function unsetIncludeDisabled(): void - { - $this->includeDisabled = []; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. - * - * Default: 100 - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. - * - * Default: 100 - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of results to be returned in a single page. - * It is possible to receive fewer results than the specified limit on a given page. - * The default value of 100 is also the maximum allowed value. - * - * Default: 100 - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - if (!empty($this->includeDisabled)) { - $json['include_disabled'] = $this->includeDisabled['value']; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWebhookSubscriptionsResponse.php b/src/Models/ListWebhookSubscriptionsResponse.php deleted file mode 100644 index 8087b381..00000000 --- a/src/Models/ListWebhookSubscriptionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscriptions. - * The requested list of [Subscription](entity:WebhookSubscription)s. - * - * @return WebhookSubscription[]|null - */ - public function getSubscriptions(): ?array - { - return $this->subscriptions; - } - - /** - * Sets Subscriptions. - * The requested list of [Subscription](entity:WebhookSubscription)s. - * - * @maps subscriptions - * - * @param WebhookSubscription[]|null $subscriptions - */ - public function setSubscriptions(?array $subscriptions): void - { - $this->subscriptions = $subscriptions; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscriptions)) { - $json['subscriptions'] = $this->subscriptions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWorkweekConfigsRequest.php b/src/Models/ListWorkweekConfigsRequest.php deleted file mode 100644 index c70c1a8f..00000000 --- a/src/Models/ListWorkweekConfigsRequest.php +++ /dev/null @@ -1,112 +0,0 @@ -limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of `WorkweekConfigs` results to return per page. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of `WorkweekConfigs` results to return per page. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Cursor. - * A pointer to the next page of `WorkweekConfig` results to fetch. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pointer to the next page of `WorkweekConfig` results to fetch. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pointer to the next page of `WorkweekConfig` results to fetch. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListWorkweekConfigsResponse.php b/src/Models/ListWorkweekConfigsResponse.php deleted file mode 100644 index 617b983f..00000000 --- a/src/Models/ListWorkweekConfigsResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -workweekConfigs; - } - - /** - * Sets Workweek Configs. - * A page of `WorkweekConfig` results. - * - * @maps workweek_configs - * - * @param WorkweekConfig[]|null $workweekConfigs - */ - public function setWorkweekConfigs(?array $workweekConfigs): void - { - $this->workweekConfigs = $workweekConfigs; - } - - /** - * Returns Cursor. - * The value supplied in the subsequent request to fetch the next page of - * `WorkweekConfig` results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The value supplied in the subsequent request to fetch the next page of - * `WorkweekConfig` results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->workweekConfigs)) { - $json['workweek_configs'] = $this->workweekConfigs; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Location.php b/src/Models/Location.php deleted file mode 100644 index 09dbd36a..00000000 --- a/src/Models/Location.php +++ /dev/null @@ -1,1000 +0,0 @@ -id; - } - - /** - * Sets Id. - * A short generated string of letters and numbers that uniquely identifies this location instance. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of the location. - * This information appears in the Seller Dashboard as the nickname. - * A location name must be unique within a seller account. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the location. - * This information appears in the Seller Dashboard as the nickname. - * A location name must be unique within a seller account. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the location. - * This information appears in the Seller Dashboard as the nickname. - * A location name must be unique within a seller account. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Timezone. - * The [IANA time zone](https://www.iana.org/time-zones) identifier for - * the time zone of the location. For example, `America/Los_Angeles`. - */ - public function getTimezone(): ?string - { - if (count($this->timezone) == 0) { - return null; - } - return $this->timezone['value']; - } - - /** - * Sets Timezone. - * The [IANA time zone](https://www.iana.org/time-zones) identifier for - * the time zone of the location. For example, `America/Los_Angeles`. - * - * @maps timezone - */ - public function setTimezone(?string $timezone): void - { - $this->timezone['value'] = $timezone; - } - - /** - * Unsets Timezone. - * The [IANA time zone](https://www.iana.org/time-zones) identifier for - * the time zone of the location. For example, `America/Los_Angeles`. - */ - public function unsetTimezone(): void - { - $this->timezone = []; - } - - /** - * Returns Capabilities. - * The Square features that are enabled for the location. - * See [LocationCapability](entity:LocationCapability) for possible values. - * See [LocationCapability](#type-locationcapability) for possible values - * - * @return string[]|null - */ - public function getCapabilities(): ?array - { - return $this->capabilities; - } - - /** - * Sets Capabilities. - * The Square features that are enabled for the location. - * See [LocationCapability](entity:LocationCapability) for possible values. - * See [LocationCapability](#type-locationcapability) for possible values - * - * @maps capabilities - * - * @param string[]|null $capabilities - */ - public function setCapabilities(?array $capabilities): void - { - $this->capabilities = $capabilities; - } - - /** - * Returns Status. - * A location's status. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * A location's status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Created At. - * The time when the location was created, in RFC 3339 format. - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build- - * basics/working-with-dates). - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the location was created, in RFC 3339 format. - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build- - * basics/working-with-dates). - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Merchant Id. - * The ID of the merchant that owns the location. - */ - public function getMerchantId(): ?string - { - return $this->merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the merchant that owns the location. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - */ - public function getCountry(): ?string - { - return $this->country; - } - - /** - * Sets Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - * - * @maps country - */ - public function setCountry(?string $country): void - { - $this->country = $country; - } - - /** - * Returns Language Code. - * The language associated with the location, in - * [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). - * For more information, see [Language Preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences). - */ - public function getLanguageCode(): ?string - { - if (count($this->languageCode) == 0) { - return null; - } - return $this->languageCode['value']; - } - - /** - * Sets Language Code. - * The language associated with the location, in - * [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). - * For more information, see [Language Preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences). - * - * @maps language_code - */ - public function setLanguageCode(?string $languageCode): void - { - $this->languageCode['value'] = $languageCode; - } - - /** - * Unsets Language Code. - * The language associated with the location, in - * [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). - * For more information, see [Language Preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences). - */ - public function unsetLanguageCode(): void - { - $this->languageCode = []; - } - - /** - * Returns Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - */ - public function getCurrency(): ?string - { - return $this->currency; - } - - /** - * Sets Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - * - * @maps currency - */ - public function setCurrency(?string $currency): void - { - $this->currency = $currency; - } - - /** - * Returns Phone Number. - * The phone number of the location. For example, `+1 855-700-6000`. - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number of the location. For example, `+1 855-700-6000`. - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number of the location. For example, `+1 855-700-6000`. - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Business Name. - * The name of the location's overall business. This name is present on receipts and other customer- - * facing branding, and can be changed no more than three times in a twelve-month period. - */ - public function getBusinessName(): ?string - { - if (count($this->businessName) == 0) { - return null; - } - return $this->businessName['value']; - } - - /** - * Sets Business Name. - * The name of the location's overall business. This name is present on receipts and other customer- - * facing branding, and can be changed no more than three times in a twelve-month period. - * - * @maps business_name - */ - public function setBusinessName(?string $businessName): void - { - $this->businessName['value'] = $businessName; - } - - /** - * Unsets Business Name. - * The name of the location's overall business. This name is present on receipts and other customer- - * facing branding, and can be changed no more than three times in a twelve-month period. - */ - public function unsetBusinessName(): void - { - $this->businessName = []; - } - - /** - * Returns Type. - * A location's type. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * A location's type. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Website Url. - * The website URL of the location. For example, `https://squareup.com`. - */ - public function getWebsiteUrl(): ?string - { - if (count($this->websiteUrl) == 0) { - return null; - } - return $this->websiteUrl['value']; - } - - /** - * Sets Website Url. - * The website URL of the location. For example, `https://squareup.com`. - * - * @maps website_url - */ - public function setWebsiteUrl(?string $websiteUrl): void - { - $this->websiteUrl['value'] = $websiteUrl; - } - - /** - * Unsets Website Url. - * The website URL of the location. For example, `https://squareup.com`. - */ - public function unsetWebsiteUrl(): void - { - $this->websiteUrl = []; - } - - /** - * Returns Business Hours. - * The hours of operation for a location. - */ - public function getBusinessHours(): ?BusinessHours - { - return $this->businessHours; - } - - /** - * Sets Business Hours. - * The hours of operation for a location. - * - * @maps business_hours - */ - public function setBusinessHours(?BusinessHours $businessHours): void - { - $this->businessHours = $businessHours; - } - - /** - * Returns Business Email. - * The email address of the location. This can be unique to the location and is not always the email - * address for the business owner or administrator. - */ - public function getBusinessEmail(): ?string - { - if (count($this->businessEmail) == 0) { - return null; - } - return $this->businessEmail['value']; - } - - /** - * Sets Business Email. - * The email address of the location. This can be unique to the location and is not always the email - * address for the business owner or administrator. - * - * @maps business_email - */ - public function setBusinessEmail(?string $businessEmail): void - { - $this->businessEmail['value'] = $businessEmail; - } - - /** - * Unsets Business Email. - * The email address of the location. This can be unique to the location and is not always the email - * address for the business owner or administrator. - */ - public function unsetBusinessEmail(): void - { - $this->businessEmail = []; - } - - /** - * Returns Description. - * The description of the location. For example, `Main Street location`. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The description of the location. For example, `Main Street location`. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The description of the location. For example, `Main Street location`. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Twitter Username. - * The Twitter username of the location without the '@' symbol. For example, `Square`. - */ - public function getTwitterUsername(): ?string - { - if (count($this->twitterUsername) == 0) { - return null; - } - return $this->twitterUsername['value']; - } - - /** - * Sets Twitter Username. - * The Twitter username of the location without the '@' symbol. For example, `Square`. - * - * @maps twitter_username - */ - public function setTwitterUsername(?string $twitterUsername): void - { - $this->twitterUsername['value'] = $twitterUsername; - } - - /** - * Unsets Twitter Username. - * The Twitter username of the location without the '@' symbol. For example, `Square`. - */ - public function unsetTwitterUsername(): void - { - $this->twitterUsername = []; - } - - /** - * Returns Instagram Username. - * The Instagram username of the location without the '@' symbol. For example, `square`. - */ - public function getInstagramUsername(): ?string - { - if (count($this->instagramUsername) == 0) { - return null; - } - return $this->instagramUsername['value']; - } - - /** - * Sets Instagram Username. - * The Instagram username of the location without the '@' symbol. For example, `square`. - * - * @maps instagram_username - */ - public function setInstagramUsername(?string $instagramUsername): void - { - $this->instagramUsername['value'] = $instagramUsername; - } - - /** - * Unsets Instagram Username. - * The Instagram username of the location without the '@' symbol. For example, `square`. - */ - public function unsetInstagramUsername(): void - { - $this->instagramUsername = []; - } - - /** - * Returns Facebook Url. - * The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, - * `https://www.facebook.com/square`. - */ - public function getFacebookUrl(): ?string - { - if (count($this->facebookUrl) == 0) { - return null; - } - return $this->facebookUrl['value']; - } - - /** - * Sets Facebook Url. - * The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, - * `https://www.facebook.com/square`. - * - * @maps facebook_url - */ - public function setFacebookUrl(?string $facebookUrl): void - { - $this->facebookUrl['value'] = $facebookUrl; - } - - /** - * Unsets Facebook Url. - * The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, - * `https://www.facebook.com/square`. - */ - public function unsetFacebookUrl(): void - { - $this->facebookUrl = []; - } - - /** - * Returns Coordinates. - * Latitude and longitude coordinates. - */ - public function getCoordinates(): ?Coordinates - { - return $this->coordinates; - } - - /** - * Sets Coordinates. - * Latitude and longitude coordinates. - * - * @maps coordinates - */ - public function setCoordinates(?Coordinates $coordinates): void - { - $this->coordinates = $coordinates; - } - - /** - * Returns Logo Url. - * The URL of the logo image for the location. When configured in the Seller - * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that - * Square generates on behalf of the seller. - * This image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels. - */ - public function getLogoUrl(): ?string - { - return $this->logoUrl; - } - - /** - * Sets Logo Url. - * The URL of the logo image for the location. When configured in the Seller - * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that - * Square generates on behalf of the seller. - * This image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels. - * - * @maps logo_url - */ - public function setLogoUrl(?string $logoUrl): void - { - $this->logoUrl = $logoUrl; - } - - /** - * Returns Pos Background Url. - * The URL of the Point of Sale background image for the location. - */ - public function getPosBackgroundUrl(): ?string - { - return $this->posBackgroundUrl; - } - - /** - * Sets Pos Background Url. - * The URL of the Point of Sale background image for the location. - * - * @maps pos_background_url - */ - public function setPosBackgroundUrl(?string $posBackgroundUrl): void - { - $this->posBackgroundUrl = $posBackgroundUrl; - } - - /** - * Returns Mcc. - * A four-digit number that describes the kind of goods or services sold at the location. - * The [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a- - * merchant-category-code) of the location as standardized by ISO 18245. - * For example, `5045`, for a location that sells computer goods and software. - */ - public function getMcc(): ?string - { - if (count($this->mcc) == 0) { - return null; - } - return $this->mcc['value']; - } - - /** - * Sets Mcc. - * A four-digit number that describes the kind of goods or services sold at the location. - * The [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a- - * merchant-category-code) of the location as standardized by ISO 18245. - * For example, `5045`, for a location that sells computer goods and software. - * - * @maps mcc - */ - public function setMcc(?string $mcc): void - { - $this->mcc['value'] = $mcc; - } - - /** - * Unsets Mcc. - * A four-digit number that describes the kind of goods or services sold at the location. - * The [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a- - * merchant-category-code) of the location as standardized by ISO 18245. - * For example, `5045`, for a location that sells computer goods and software. - */ - public function unsetMcc(): void - { - $this->mcc = []; - } - - /** - * Returns Full Format Logo Url. - * The URL of a full-format logo image for the location. When configured in the Seller - * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that - * Square generates on behalf of the seller. - * This image can be wider than it is tall and should be at least 1280x648 pixels. - */ - public function getFullFormatLogoUrl(): ?string - { - return $this->fullFormatLogoUrl; - } - - /** - * Sets Full Format Logo Url. - * The URL of a full-format logo image for the location. When configured in the Seller - * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that - * Square generates on behalf of the seller. - * This image can be wider than it is tall and should be at least 1280x648 pixels. - * - * @maps full_format_logo_url - */ - public function setFullFormatLogoUrl(?string $fullFormatLogoUrl): void - { - $this->fullFormatLogoUrl = $fullFormatLogoUrl; - } - - /** - * Returns Tax Ids. - * Identifiers for the location used by various governments for tax purposes. - */ - public function getTaxIds(): ?TaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Identifiers for the location used by various governments for tax purposes. - * - * @maps tax_ids - */ - public function setTaxIds(?TaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->timezone)) { - $json['timezone'] = $this->timezone['value']; - } - if (isset($this->capabilities)) { - $json['capabilities'] = $this->capabilities; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->merchantId)) { - $json['merchant_id'] = $this->merchantId; - } - if (isset($this->country)) { - $json['country'] = $this->country; - } - if (!empty($this->languageCode)) { - $json['language_code'] = $this->languageCode['value']; - } - if (isset($this->currency)) { - $json['currency'] = $this->currency; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->businessName)) { - $json['business_name'] = $this->businessName['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->websiteUrl)) { - $json['website_url'] = $this->websiteUrl['value']; - } - if (isset($this->businessHours)) { - $json['business_hours'] = $this->businessHours; - } - if (!empty($this->businessEmail)) { - $json['business_email'] = $this->businessEmail['value']; - } - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (!empty($this->twitterUsername)) { - $json['twitter_username'] = $this->twitterUsername['value']; - } - if (!empty($this->instagramUsername)) { - $json['instagram_username'] = $this->instagramUsername['value']; - } - if (!empty($this->facebookUrl)) { - $json['facebook_url'] = $this->facebookUrl['value']; - } - if (isset($this->coordinates)) { - $json['coordinates'] = $this->coordinates; - } - if (isset($this->logoUrl)) { - $json['logo_url'] = $this->logoUrl; - } - if (isset($this->posBackgroundUrl)) { - $json['pos_background_url'] = $this->posBackgroundUrl; - } - if (!empty($this->mcc)) { - $json['mcc'] = $this->mcc['value']; - } - if (isset($this->fullFormatLogoUrl)) { - $json['full_format_logo_url'] = $this->fullFormatLogoUrl; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LocationBookingProfile.php b/src/Models/LocationBookingProfile.php deleted file mode 100644 index e8c731ca..00000000 --- a/src/Models/LocationBookingProfile.php +++ /dev/null @@ -1,153 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the [location](entity:Location). - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the [location](entity:Location). - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Booking Site Url. - * Url for the online booking site for this location. - */ - public function getBookingSiteUrl(): ?string - { - if (count($this->bookingSiteUrl) == 0) { - return null; - } - return $this->bookingSiteUrl['value']; - } - - /** - * Sets Booking Site Url. - * Url for the online booking site for this location. - * - * @maps booking_site_url - */ - public function setBookingSiteUrl(?string $bookingSiteUrl): void - { - $this->bookingSiteUrl['value'] = $bookingSiteUrl; - } - - /** - * Unsets Booking Site Url. - * Url for the online booking site for this location. - */ - public function unsetBookingSiteUrl(): void - { - $this->bookingSiteUrl = []; - } - - /** - * Returns Online Booking Enabled. - * Indicates whether the location is enabled for online booking. - */ - public function getOnlineBookingEnabled(): ?bool - { - if (count($this->onlineBookingEnabled) == 0) { - return null; - } - return $this->onlineBookingEnabled['value']; - } - - /** - * Sets Online Booking Enabled. - * Indicates whether the location is enabled for online booking. - * - * @maps online_booking_enabled - */ - public function setOnlineBookingEnabled(?bool $onlineBookingEnabled): void - { - $this->onlineBookingEnabled['value'] = $onlineBookingEnabled; - } - - /** - * Unsets Online Booking Enabled. - * Indicates whether the location is enabled for online booking. - */ - public function unsetOnlineBookingEnabled(): void - { - $this->onlineBookingEnabled = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->bookingSiteUrl)) { - $json['booking_site_url'] = $this->bookingSiteUrl['value']; - } - if (!empty($this->onlineBookingEnabled)) { - $json['online_booking_enabled'] = $this->onlineBookingEnabled['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LocationCapability.php b/src/Models/LocationCapability.php deleted file mode 100644 index df5d5dac..00000000 --- a/src/Models/LocationCapability.php +++ /dev/null @@ -1,26 +0,0 @@ -programId = $programId; - } - - /** - * Returns Id. - * The Square-assigned ID of the loyalty account. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the loyalty account. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs. - */ - public function getProgramId(): string - { - return $this->programId; - } - - /** - * Sets Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs. - * - * @required - * @maps program_id - */ - public function setProgramId(string $programId): void - { - $this->programId = $programId; - } - - /** - * Returns Balance. - * The available point balance in the loyalty account. If points are scheduled to expire, they are - * listed in the `expiring_point_deadlines` field. - * - * Your application should be able to handle loyalty accounts that have a negative point balance - * (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of - * a refund or exchange. - */ - public function getBalance(): ?int - { - return $this->balance; - } - - /** - * Sets Balance. - * The available point balance in the loyalty account. If points are scheduled to expire, they are - * listed in the `expiring_point_deadlines` field. - * - * Your application should be able to handle loyalty accounts that have a negative point balance - * (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of - * a refund or exchange. - * - * @maps balance - */ - public function setBalance(?int $balance): void - { - $this->balance = $balance; - } - - /** - * Returns Lifetime Points. - * The total points accrued during the lifetime of the account. - */ - public function getLifetimePoints(): ?int - { - return $this->lifetimePoints; - } - - /** - * Sets Lifetime Points. - * The total points accrued during the lifetime of the account. - * - * @maps lifetime_points - */ - public function setLifetimePoints(?int $lifetimePoints): void - { - $this->lifetimePoints = $lifetimePoints; - } - - /** - * Returns Customer Id. - * The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Enrolled At. - * The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to - * display the **Enrolled On** or **Member Since** date in first-party Square products. - * - * If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's - * first action on their account - * (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square - * populates the field when the buyer agrees to the terms of service in Square Point of Sale. - * - * This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty - * account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp - * in the request can represent a current or previous date and time, but it cannot be set for the - * future. - */ - public function getEnrolledAt(): ?string - { - if (count($this->enrolledAt) == 0) { - return null; - } - return $this->enrolledAt['value']; - } - - /** - * Sets Enrolled At. - * The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to - * display the **Enrolled On** or **Member Since** date in first-party Square products. - * - * If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's - * first action on their account - * (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square - * populates the field when the buyer agrees to the terms of service in Square Point of Sale. - * - * This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty - * account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp - * in the request can represent a current or previous date and time, but it cannot be set for the - * future. - * - * @maps enrolled_at - */ - public function setEnrolledAt(?string $enrolledAt): void - { - $this->enrolledAt['value'] = $enrolledAt; - } - - /** - * Unsets Enrolled At. - * The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to - * display the **Enrolled On** or **Member Since** date in first-party Square products. - * - * If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's - * first action on their account - * (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square - * populates the field when the buyer agrees to the terms of service in Square Point of Sale. - * - * This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty - * account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp - * in the request can represent a current or previous date and time, but it cannot be set for the - * future. - */ - public function unsetEnrolledAt(): void - { - $this->enrolledAt = []; - } - - /** - * Returns Created At. - * The timestamp when the loyalty account was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the loyalty account was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the loyalty account was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the loyalty account was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Mapping. - * Represents the mapping that associates a loyalty account with a buyer. - * - * Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, - * see - * [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). - */ - public function getMapping(): ?LoyaltyAccountMapping - { - return $this->mapping; - } - - /** - * Sets Mapping. - * Represents the mapping that associates a loyalty account with a buyer. - * - * Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, - * see - * [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). - * - * @maps mapping - */ - public function setMapping(?LoyaltyAccountMapping $mapping): void - { - $this->mapping = $mapping; - } - - /** - * Returns Expiring Point Deadlines. - * The schedule for when points expire in the loyalty account balance. This field is present only if - * the account has points that are scheduled to expire. - * - * The total number of points in this field equals the number of points in the `balance` field. - * - * @return LoyaltyAccountExpiringPointDeadline[]|null - */ - public function getExpiringPointDeadlines(): ?array - { - if (count($this->expiringPointDeadlines) == 0) { - return null; - } - return $this->expiringPointDeadlines['value']; - } - - /** - * Sets Expiring Point Deadlines. - * The schedule for when points expire in the loyalty account balance. This field is present only if - * the account has points that are scheduled to expire. - * - * The total number of points in this field equals the number of points in the `balance` field. - * - * @maps expiring_point_deadlines - * - * @param LoyaltyAccountExpiringPointDeadline[]|null $expiringPointDeadlines - */ - public function setExpiringPointDeadlines(?array $expiringPointDeadlines): void - { - $this->expiringPointDeadlines['value'] = $expiringPointDeadlines; - } - - /** - * Unsets Expiring Point Deadlines. - * The schedule for when points expire in the loyalty account balance. This field is present only if - * the account has points that are scheduled to expire. - * - * The total number of points in this field equals the number of points in the `balance` field. - */ - public function unsetExpiringPointDeadlines(): void - { - $this->expiringPointDeadlines = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['program_id'] = $this->programId; - if (isset($this->balance)) { - $json['balance'] = $this->balance; - } - if (isset($this->lifetimePoints)) { - $json['lifetime_points'] = $this->lifetimePoints; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->enrolledAt)) { - $json['enrolled_at'] = $this->enrolledAt['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->mapping)) { - $json['mapping'] = $this->mapping; - } - if (!empty($this->expiringPointDeadlines)) { - $json['expiring_point_deadlines'] = $this->expiringPointDeadlines['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyAccountExpiringPointDeadline.php b/src/Models/LoyaltyAccountExpiringPointDeadline.php deleted file mode 100644 index 195863f6..00000000 --- a/src/Models/LoyaltyAccountExpiringPointDeadline.php +++ /dev/null @@ -1,96 +0,0 @@ -points = $points; - $this->expiresAt = $expiresAt; - } - - /** - * Returns Points. - * The number of points scheduled to expire at the `expires_at` timestamp. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points scheduled to expire at the `expires_at` timestamp. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Returns Expires At. - * The timestamp of when the points are scheduled to expire, in RFC 3339 format. - */ - public function getExpiresAt(): string - { - return $this->expiresAt; - } - - /** - * Sets Expires At. - * The timestamp of when the points are scheduled to expire, in RFC 3339 format. - * - * @required - * @maps expires_at - */ - public function setExpiresAt(string $expiresAt): void - { - $this->expiresAt = $expiresAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['points'] = $this->points; - $json['expires_at'] = $this->expiresAt; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyAccountMapping.php b/src/Models/LoyaltyAccountMapping.php deleted file mode 100644 index 2c3d08d9..00000000 --- a/src/Models/LoyaltyAccountMapping.php +++ /dev/null @@ -1,132 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the mapping. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Created At. - * The timestamp when the mapping was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the mapping was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Phone Number. - * The phone number of the buyer, in E.164 format. For example, "+14155551111". - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number of the buyer, in E.164 format. For example, "+14155551111". - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number of the buyer, in E.164 format. For example, "+14155551111". - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyAccountMappingType.php b/src/Models/LoyaltyAccountMappingType.php deleted file mode 100644 index 632d2a5b..00000000 --- a/src/Models/LoyaltyAccountMappingType.php +++ /dev/null @@ -1,16 +0,0 @@ -id = $id; - $this->type = $type; - $this->createdAt = $createdAt; - $this->loyaltyAccountId = $loyaltyAccountId; - $this->source = $source; - } - - /** - * Returns Id. - * The Square-assigned ID of the loyalty event. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the loyalty event. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Type. - * The type of the loyalty event. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * The type of the loyalty event. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Created At. - * The timestamp when the event was created, in RFC 3339 format. - */ - public function getCreatedAt(): string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the event was created, in RFC 3339 format. - * - * @required - * @maps created_at - */ - public function setCreatedAt(string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Accumulate Points. - * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - */ - public function getAccumulatePoints(): ?LoyaltyEventAccumulatePoints - { - return $this->accumulatePoints; - } - - /** - * Sets Accumulate Points. - * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - * - * @maps accumulate_points - */ - public function setAccumulatePoints(?LoyaltyEventAccumulatePoints $accumulatePoints): void - { - $this->accumulatePoints = $accumulatePoints; - } - - /** - * Returns Create Reward. - * Provides metadata when the event `type` is `CREATE_REWARD`. - */ - public function getCreateReward(): ?LoyaltyEventCreateReward - { - return $this->createReward; - } - - /** - * Sets Create Reward. - * Provides metadata when the event `type` is `CREATE_REWARD`. - * - * @maps create_reward - */ - public function setCreateReward(?LoyaltyEventCreateReward $createReward): void - { - $this->createReward = $createReward; - } - - /** - * Returns Redeem Reward. - * Provides metadata when the event `type` is `REDEEM_REWARD`. - */ - public function getRedeemReward(): ?LoyaltyEventRedeemReward - { - return $this->redeemReward; - } - - /** - * Sets Redeem Reward. - * Provides metadata when the event `type` is `REDEEM_REWARD`. - * - * @maps redeem_reward - */ - public function setRedeemReward(?LoyaltyEventRedeemReward $redeemReward): void - { - $this->redeemReward = $redeemReward; - } - - /** - * Returns Delete Reward. - * Provides metadata when the event `type` is `DELETE_REWARD`. - */ - public function getDeleteReward(): ?LoyaltyEventDeleteReward - { - return $this->deleteReward; - } - - /** - * Sets Delete Reward. - * Provides metadata when the event `type` is `DELETE_REWARD`. - * - * @maps delete_reward - */ - public function setDeleteReward(?LoyaltyEventDeleteReward $deleteReward): void - { - $this->deleteReward = $deleteReward; - } - - /** - * Returns Adjust Points. - * Provides metadata when the event `type` is `ADJUST_POINTS`. - */ - public function getAdjustPoints(): ?LoyaltyEventAdjustPoints - { - return $this->adjustPoints; - } - - /** - * Sets Adjust Points. - * Provides metadata when the event `type` is `ADJUST_POINTS`. - * - * @maps adjust_points - */ - public function setAdjustPoints(?LoyaltyEventAdjustPoints $adjustPoints): void - { - $this->adjustPoints = $adjustPoints; - } - - /** - * Returns Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event. - */ - public function getLoyaltyAccountId(): string - { - return $this->loyaltyAccountId; - } - - /** - * Sets Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event. - * - * @required - * @maps loyalty_account_id - */ - public function setLoyaltyAccountId(string $loyaltyAccountId): void - { - $this->loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Returns Location Id. - * The ID of the [location](entity:Location) where the event occurred. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the [location](entity:Location) where the event occurred. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Source. - * Defines whether the event was generated by the Square Point of Sale. - */ - public function getSource(): string - { - return $this->source; - } - - /** - * Sets Source. - * Defines whether the event was generated by the Square Point of Sale. - * - * @required - * @maps source - */ - public function setSource(string $source): void - { - $this->source = $source; - } - - /** - * Returns Expire Points. - * Provides metadata when the event `type` is `EXPIRE_POINTS`. - */ - public function getExpirePoints(): ?LoyaltyEventExpirePoints - { - return $this->expirePoints; - } - - /** - * Sets Expire Points. - * Provides metadata when the event `type` is `EXPIRE_POINTS`. - * - * @maps expire_points - */ - public function setExpirePoints(?LoyaltyEventExpirePoints $expirePoints): void - { - $this->expirePoints = $expirePoints; - } - - /** - * Returns Other Event. - * Provides metadata when the event `type` is `OTHER`. - */ - public function getOtherEvent(): ?LoyaltyEventOther - { - return $this->otherEvent; - } - - /** - * Sets Other Event. - * Provides metadata when the event `type` is `OTHER`. - * - * @maps other_event - */ - public function setOtherEvent(?LoyaltyEventOther $otherEvent): void - { - $this->otherEvent = $otherEvent; - } - - /** - * Returns Accumulate Promotion Points. - * Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. - */ - public function getAccumulatePromotionPoints(): ?LoyaltyEventAccumulatePromotionPoints - { - return $this->accumulatePromotionPoints; - } - - /** - * Sets Accumulate Promotion Points. - * Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. - * - * @maps accumulate_promotion_points - */ - public function setAccumulatePromotionPoints( - ?LoyaltyEventAccumulatePromotionPoints $accumulatePromotionPoints - ): void { - $this->accumulatePromotionPoints = $accumulatePromotionPoints; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['type'] = $this->type; - $json['created_at'] = $this->createdAt; - if (isset($this->accumulatePoints)) { - $json['accumulate_points'] = $this->accumulatePoints; - } - if (isset($this->createReward)) { - $json['create_reward'] = $this->createReward; - } - if (isset($this->redeemReward)) { - $json['redeem_reward'] = $this->redeemReward; - } - if (isset($this->deleteReward)) { - $json['delete_reward'] = $this->deleteReward; - } - if (isset($this->adjustPoints)) { - $json['adjust_points'] = $this->adjustPoints; - } - $json['loyalty_account_id'] = $this->loyaltyAccountId; - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - $json['source'] = $this->source; - if (isset($this->expirePoints)) { - $json['expire_points'] = $this->expirePoints; - } - if (isset($this->otherEvent)) { - $json['other_event'] = $this->otherEvent; - } - if (isset($this->accumulatePromotionPoints)) { - $json['accumulate_promotion_points'] = $this->accumulatePromotionPoints; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventAccumulatePoints.php b/src/Models/LoyaltyEventAccumulatePoints.php deleted file mode 100644 index 9c031611..00000000 --- a/src/Models/LoyaltyEventAccumulatePoints.php +++ /dev/null @@ -1,143 +0,0 @@ -loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - * - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(?string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Points. - * The number of points accumulated by the event. - */ - public function getPoints(): ?int - { - if (count($this->points) == 0) { - return null; - } - return $this->points['value']; - } - - /** - * Sets Points. - * The number of points accumulated by the event. - * - * @maps points - */ - public function setPoints(?int $points): void - { - $this->points['value'] = $points; - } - - /** - * Unsets Points. - * The number of points accumulated by the event. - */ - public function unsetPoints(): void - { - $this->points = []; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) for which the buyer accumulated the points. - * This field is returned only if the Orders API is used to process orders. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) for which the buyer accumulated the points. - * This field is returned only if the Orders API is used to process orders. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the [order](entity:Order) for which the buyer accumulated the points. - * This field is returned only if the Orders API is used to process orders. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->loyaltyProgramId)) { - $json['loyalty_program_id'] = $this->loyaltyProgramId; - } - if (!empty($this->points)) { - $json['points'] = $this->points['value']; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventAccumulatePromotionPoints.php b/src/Models/LoyaltyEventAccumulatePromotionPoints.php deleted file mode 100644 index ec0a3cb2..00000000 --- a/src/Models/LoyaltyEventAccumulatePromotionPoints.php +++ /dev/null @@ -1,154 +0,0 @@ -points = $points; - $this->orderId = $orderId; - } - - /** - * Returns Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): ?string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - * - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(?string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Loyalty Promotion Id. - * The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion). - */ - public function getLoyaltyPromotionId(): ?string - { - return $this->loyaltyPromotionId; - } - - /** - * Sets Loyalty Promotion Id. - * The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion). - * - * @maps loyalty_promotion_id - */ - public function setLoyaltyPromotionId(?string $loyaltyPromotionId): void - { - $this->loyaltyPromotionId = $loyaltyPromotionId; - } - - /** - * Returns Points. - * The number of points earned by the event. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points earned by the event. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) for which the buyer earned the promotion points. - * Only applications that use the Orders API to process orders can trigger this event. - */ - public function getOrderId(): string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) for which the buyer earned the promotion points. - * Only applications that use the Orders API to process orders can trigger this event. - * - * @required - * @maps order_id - */ - public function setOrderId(string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->loyaltyProgramId)) { - $json['loyalty_program_id'] = $this->loyaltyProgramId; - } - if (isset($this->loyaltyPromotionId)) { - $json['loyalty_promotion_id'] = $this->loyaltyPromotionId; - } - $json['points'] = $this->points; - $json['order_id'] = $this->orderId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventAdjustPoints.php b/src/Models/LoyaltyEventAdjustPoints.php deleted file mode 100644 index d3ad9890..00000000 --- a/src/Models/LoyaltyEventAdjustPoints.php +++ /dev/null @@ -1,135 +0,0 @@ -points = $points; - } - - /** - * Returns Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): ?string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - * - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(?string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Points. - * The number of points added or removed. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points added or removed. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Returns Reason. - * The reason for the adjustment of points. - */ - public function getReason(): ?string - { - if (count($this->reason) == 0) { - return null; - } - return $this->reason['value']; - } - - /** - * Sets Reason. - * The reason for the adjustment of points. - * - * @maps reason - */ - public function setReason(?string $reason): void - { - $this->reason['value'] = $reason; - } - - /** - * Unsets Reason. - * The reason for the adjustment of points. - */ - public function unsetReason(): void - { - $this->reason = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->loyaltyProgramId)) { - $json['loyalty_program_id'] = $this->loyaltyProgramId; - } - $json['points'] = $this->points; - if (!empty($this->reason)) { - $json['reason'] = $this->reason['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventCreateReward.php b/src/Models/LoyaltyEventCreateReward.php deleted file mode 100644 index 2899b7f0..00000000 --- a/src/Models/LoyaltyEventCreateReward.php +++ /dev/null @@ -1,126 +0,0 @@ -loyaltyProgramId = $loyaltyProgramId; - $this->points = $points; - } - - /** - * Returns Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - * - * @required - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Reward Id. - * The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - */ - public function getRewardId(): ?string - { - return $this->rewardId; - } - - /** - * Sets Reward Id. - * The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - * - * @maps reward_id - */ - public function setRewardId(?string $rewardId): void - { - $this->rewardId = $rewardId; - } - - /** - * Returns Points. - * The loyalty points used to create the reward. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The loyalty points used to create the reward. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_program_id'] = $this->loyaltyProgramId; - if (isset($this->rewardId)) { - $json['reward_id'] = $this->rewardId; - } - $json['points'] = $this->points; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventDateTimeFilter.php b/src/Models/LoyaltyEventDateTimeFilter.php deleted file mode 100644 index 44235a7e..00000000 --- a/src/Models/LoyaltyEventDateTimeFilter.php +++ /dev/null @@ -1,75 +0,0 @@ -createdAt = $createdAt; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @required - * @maps created_at - */ - public function setCreatedAt(TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['created_at'] = $this->createdAt; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventDeleteReward.php b/src/Models/LoyaltyEventDeleteReward.php deleted file mode 100644 index 6ec4b251..00000000 --- a/src/Models/LoyaltyEventDeleteReward.php +++ /dev/null @@ -1,126 +0,0 @@ -loyaltyProgramId = $loyaltyProgramId; - $this->points = $points; - } - - /** - * Returns Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - * - * @required - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Reward Id. - * The ID of the deleted [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - */ - public function getRewardId(): ?string - { - return $this->rewardId; - } - - /** - * Sets Reward Id. - * The ID of the deleted [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - * - * @maps reward_id - */ - public function setRewardId(?string $rewardId): void - { - $this->rewardId = $rewardId; - } - - /** - * Returns Points. - * The number of points returned to the loyalty account. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points returned to the loyalty account. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_program_id'] = $this->loyaltyProgramId; - if (isset($this->rewardId)) { - $json['reward_id'] = $this->rewardId; - } - $json['points'] = $this->points; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventExpirePoints.php b/src/Models/LoyaltyEventExpirePoints.php deleted file mode 100644 index 3610ef1d..00000000 --- a/src/Models/LoyaltyEventExpirePoints.php +++ /dev/null @@ -1,96 +0,0 @@ -loyaltyProgramId = $loyaltyProgramId; - $this->points = $points; - } - - /** - * Returns Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - * - * @required - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Points. - * The number of points expired. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points expired. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_program_id'] = $this->loyaltyProgramId; - $json['points'] = $this->points; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventFilter.php b/src/Models/LoyaltyEventFilter.php deleted file mode 100644 index df9a504a..00000000 --- a/src/Models/LoyaltyEventFilter.php +++ /dev/null @@ -1,173 +0,0 @@ -loyaltyAccountFilter; - } - - /** - * Sets Loyalty Account Filter. - * Filter events by loyalty account. - * - * @maps loyalty_account_filter - */ - public function setLoyaltyAccountFilter(?LoyaltyEventLoyaltyAccountFilter $loyaltyAccountFilter): void - { - $this->loyaltyAccountFilter = $loyaltyAccountFilter; - } - - /** - * Returns Type Filter. - * Filter events by event type. - */ - public function getTypeFilter(): ?LoyaltyEventTypeFilter - { - return $this->typeFilter; - } - - /** - * Sets Type Filter. - * Filter events by event type. - * - * @maps type_filter - */ - public function setTypeFilter(?LoyaltyEventTypeFilter $typeFilter): void - { - $this->typeFilter = $typeFilter; - } - - /** - * Returns Date Time Filter. - * Filter events by date time range. - */ - public function getDateTimeFilter(): ?LoyaltyEventDateTimeFilter - { - return $this->dateTimeFilter; - } - - /** - * Sets Date Time Filter. - * Filter events by date time range. - * - * @maps date_time_filter - */ - public function setDateTimeFilter(?LoyaltyEventDateTimeFilter $dateTimeFilter): void - { - $this->dateTimeFilter = $dateTimeFilter; - } - - /** - * Returns Location Filter. - * Filter events by location. - */ - public function getLocationFilter(): ?LoyaltyEventLocationFilter - { - return $this->locationFilter; - } - - /** - * Sets Location Filter. - * Filter events by location. - * - * @maps location_filter - */ - public function setLocationFilter(?LoyaltyEventLocationFilter $locationFilter): void - { - $this->locationFilter = $locationFilter; - } - - /** - * Returns Order Filter. - * Filter events by the order associated with the event. - */ - public function getOrderFilter(): ?LoyaltyEventOrderFilter - { - return $this->orderFilter; - } - - /** - * Sets Order Filter. - * Filter events by the order associated with the event. - * - * @maps order_filter - */ - public function setOrderFilter(?LoyaltyEventOrderFilter $orderFilter): void - { - $this->orderFilter = $orderFilter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->loyaltyAccountFilter)) { - $json['loyalty_account_filter'] = $this->loyaltyAccountFilter; - } - if (isset($this->typeFilter)) { - $json['type_filter'] = $this->typeFilter; - } - if (isset($this->dateTimeFilter)) { - $json['date_time_filter'] = $this->dateTimeFilter; - } - if (isset($this->locationFilter)) { - $json['location_filter'] = $this->locationFilter; - } - if (isset($this->orderFilter)) { - $json['order_filter'] = $this->orderFilter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventLocationFilter.php b/src/Models/LoyaltyEventLocationFilter.php deleted file mode 100644 index 1bdda42e..00000000 --- a/src/Models/LoyaltyEventLocationFilter.php +++ /dev/null @@ -1,75 +0,0 @@ -locationIds = $locationIds; - } - - /** - * Returns Location Ids. - * The [location](entity:Location) IDs for loyalty events to query. - * If multiple values are specified, the endpoint uses - * a logical OR to combine them. - * - * @return string[] - */ - public function getLocationIds(): array - { - return $this->locationIds; - } - - /** - * Sets Location Ids. - * The [location](entity:Location) IDs for loyalty events to query. - * If multiple values are specified, the endpoint uses - * a logical OR to combine them. - * - * @required - * @maps location_ids - * - * @param string[] $locationIds - */ - public function setLocationIds(array $locationIds): void - { - $this->locationIds = $locationIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_ids'] = $this->locationIds; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventLoyaltyAccountFilter.php b/src/Models/LoyaltyEventLoyaltyAccountFilter.php deleted file mode 100644 index 6d7918c3..00000000 --- a/src/Models/LoyaltyEventLoyaltyAccountFilter.php +++ /dev/null @@ -1,67 +0,0 @@ -loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Returns Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events. - */ - public function getLoyaltyAccountId(): string - { - return $this->loyaltyAccountId; - } - - /** - * Sets Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events. - * - * @required - * @maps loyalty_account_id - */ - public function setLoyaltyAccountId(string $loyaltyAccountId): void - { - $this->loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_account_id'] = $this->loyaltyAccountId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventOrderFilter.php b/src/Models/LoyaltyEventOrderFilter.php deleted file mode 100644 index 8f7122bb..00000000 --- a/src/Models/LoyaltyEventOrderFilter.php +++ /dev/null @@ -1,67 +0,0 @@ -orderId = $orderId; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) associated with the event. - */ - public function getOrderId(): string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) associated with the event. - * - * @required - * @maps order_id - */ - public function setOrderId(string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['order_id'] = $this->orderId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventOther.php b/src/Models/LoyaltyEventOther.php deleted file mode 100644 index 064830af..00000000 --- a/src/Models/LoyaltyEventOther.php +++ /dev/null @@ -1,96 +0,0 @@ -loyaltyProgramId = $loyaltyProgramId; - $this->points = $points; - } - - /** - * Returns Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). - * - * @required - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Points. - * The number of points added or removed. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The number of points added or removed. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_program_id'] = $this->loyaltyProgramId; - $json['points'] = $this->points; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventQuery.php b/src/Models/LoyaltyEventQuery.php deleted file mode 100644 index 8e7d0655..00000000 --- a/src/Models/LoyaltyEventQuery.php +++ /dev/null @@ -1,62 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * The filtering criteria. If the request specifies multiple filters, - * the endpoint uses a logical AND to evaluate them. - * - * @maps filter - */ - public function setFilter(?LoyaltyEventFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventRedeemReward.php b/src/Models/LoyaltyEventRedeemReward.php deleted file mode 100644 index cb26ca87..00000000 --- a/src/Models/LoyaltyEventRedeemReward.php +++ /dev/null @@ -1,127 +0,0 @@ -loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - */ - public function getLoyaltyProgramId(): string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram). - * - * @required - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Reward Id. - * The ID of the redeemed [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - */ - public function getRewardId(): ?string - { - return $this->rewardId; - } - - /** - * Sets Reward Id. - * The ID of the redeemed [loyalty reward](entity:LoyaltyReward). - * This field is returned only if the event source is `LOYALTY_API`. - * - * @maps reward_id - */ - public function setRewardId(?string $rewardId): void - { - $this->rewardId = $rewardId; - } - - /** - * Returns Order Id. - * The ID of the [order](entity:Order) that redeemed the reward. - * This field is returned only if the Orders API is used to process orders. - */ - public function getOrderId(): ?string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the [order](entity:Order) that redeemed the reward. - * This field is returned only if the Orders API is used to process orders. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_program_id'] = $this->loyaltyProgramId; - if (isset($this->rewardId)) { - $json['reward_id'] = $this->rewardId; - } - if (isset($this->orderId)) { - $json['order_id'] = $this->orderId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyEventSource.php b/src/Models/LoyaltyEventSource.php deleted file mode 100644 index 0c9044a8..00000000 --- a/src/Models/LoyaltyEventSource.php +++ /dev/null @@ -1,21 +0,0 @@ -types = $types; - } - - /** - * Returns Types. - * The loyalty event types used to filter the result. - * If multiple values are specified, the endpoint uses a - * logical OR to combine them. - * See [LoyaltyEventType](#type-loyaltyeventtype) for possible values - * - * @return string[] - */ - public function getTypes(): array - { - return $this->types; - } - - /** - * Sets Types. - * The loyalty event types used to filter the result. - * If multiple values are specified, the endpoint uses a - * logical OR to combine them. - * See [LoyaltyEventType](#type-loyaltyeventtype) for possible values - * - * @required - * @maps types - * - * @param string[] $types - */ - public function setTypes(array $types): void - { - $this->types = $types; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['types'] = $this->types; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgram.php b/src/Models/LoyaltyProgram.php deleted file mode 100644 index 73df750e..00000000 --- a/src/Models/LoyaltyProgram.php +++ /dev/null @@ -1,348 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the loyalty program. Updates to - * the loyalty program do not modify the identifier. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Status. - * Indicates whether the program is currently active. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates whether the program is currently active. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Reward Tiers. - * The list of rewards for buyers, sorted by ascending points. - * - * @return LoyaltyProgramRewardTier[]|null - */ - public function getRewardTiers(): ?array - { - if (count($this->rewardTiers) == 0) { - return null; - } - return $this->rewardTiers['value']; - } - - /** - * Sets Reward Tiers. - * The list of rewards for buyers, sorted by ascending points. - * - * @maps reward_tiers - * - * @param LoyaltyProgramRewardTier[]|null $rewardTiers - */ - public function setRewardTiers(?array $rewardTiers): void - { - $this->rewardTiers['value'] = $rewardTiers; - } - - /** - * Unsets Reward Tiers. - * The list of rewards for buyers, sorted by ascending points. - */ - public function unsetRewardTiers(): void - { - $this->rewardTiers = []; - } - - /** - * Returns Expiration Policy. - * Describes when the loyalty program expires. - */ - public function getExpirationPolicy(): ?LoyaltyProgramExpirationPolicy - { - return $this->expirationPolicy; - } - - /** - * Sets Expiration Policy. - * Describes when the loyalty program expires. - * - * @maps expiration_policy - */ - public function setExpirationPolicy(?LoyaltyProgramExpirationPolicy $expirationPolicy): void - { - $this->expirationPolicy = $expirationPolicy; - } - - /** - * Returns Terminology. - * Represents the naming used for loyalty points. - */ - public function getTerminology(): ?LoyaltyProgramTerminology - { - return $this->terminology; - } - - /** - * Sets Terminology. - * Represents the naming used for loyalty points. - * - * @maps terminology - */ - public function setTerminology(?LoyaltyProgramTerminology $terminology): void - { - $this->terminology = $terminology; - } - - /** - * Returns Location Ids. - * The [locations](entity:Location) at which the program is active. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The [locations](entity:Location) at which the program is active. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The [locations](entity:Location) at which the program is active. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Created At. - * The timestamp when the program was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the program was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the reward was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the reward was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Accrual Rules. - * Defines how buyers can earn loyalty points from the base loyalty program. - * To check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable - * buyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty- - * ListLoyaltyPromotions). - * - * @return LoyaltyProgramAccrualRule[]|null - */ - public function getAccrualRules(): ?array - { - if (count($this->accrualRules) == 0) { - return null; - } - return $this->accrualRules['value']; - } - - /** - * Sets Accrual Rules. - * Defines how buyers can earn loyalty points from the base loyalty program. - * To check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable - * buyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty- - * ListLoyaltyPromotions). - * - * @maps accrual_rules - * - * @param LoyaltyProgramAccrualRule[]|null $accrualRules - */ - public function setAccrualRules(?array $accrualRules): void - { - $this->accrualRules['value'] = $accrualRules; - } - - /** - * Unsets Accrual Rules. - * Defines how buyers can earn loyalty points from the base loyalty program. - * To check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable - * buyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty- - * ListLoyaltyPromotions). - */ - public function unsetAccrualRules(): void - { - $this->accrualRules = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->rewardTiers)) { - $json['reward_tiers'] = $this->rewardTiers['value']; - } - if (isset($this->expirationPolicy)) { - $json['expiration_policy'] = $this->expirationPolicy; - } - if (isset($this->terminology)) { - $json['terminology'] = $this->terminology; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->accrualRules)) { - $json['accrual_rules'] = $this->accrualRules['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramAccrualRule.php b/src/Models/LoyaltyProgramAccrualRule.php deleted file mode 100644 index db23b51d..00000000 --- a/src/Models/LoyaltyProgramAccrualRule.php +++ /dev/null @@ -1,223 +0,0 @@ -accrualType = $accrualType; - } - - /** - * Returns Accrual Type. - * The type of the accrual rule that defines how buyers can earn points. - */ - public function getAccrualType(): string - { - return $this->accrualType; - } - - /** - * Sets Accrual Type. - * The type of the accrual rule that defines how buyers can earn points. - * - * @required - * @maps accrual_type - */ - public function setAccrualType(string $accrualType): void - { - $this->accrualType = $accrualType; - } - - /** - * Returns Points. - * The number of points that - * buyers earn based on the `accrual_type`. - */ - public function getPoints(): ?int - { - if (count($this->points) == 0) { - return null; - } - return $this->points['value']; - } - - /** - * Sets Points. - * The number of points that - * buyers earn based on the `accrual_type`. - * - * @maps points - */ - public function setPoints(?int $points): void - { - $this->points['value'] = $points; - } - - /** - * Unsets Points. - * The number of points that - * buyers earn based on the `accrual_type`. - */ - public function unsetPoints(): void - { - $this->points = []; - } - - /** - * Returns Visit Data. - * Represents additional data for rules with the `VISIT` accrual type. - */ - public function getVisitData(): ?LoyaltyProgramAccrualRuleVisitData - { - return $this->visitData; - } - - /** - * Sets Visit Data. - * Represents additional data for rules with the `VISIT` accrual type. - * - * @maps visit_data - */ - public function setVisitData(?LoyaltyProgramAccrualRuleVisitData $visitData): void - { - $this->visitData = $visitData; - } - - /** - * Returns Spend Data. - * Represents additional data for rules with the `SPEND` accrual type. - */ - public function getSpendData(): ?LoyaltyProgramAccrualRuleSpendData - { - return $this->spendData; - } - - /** - * Sets Spend Data. - * Represents additional data for rules with the `SPEND` accrual type. - * - * @maps spend_data - */ - public function setSpendData(?LoyaltyProgramAccrualRuleSpendData $spendData): void - { - $this->spendData = $spendData; - } - - /** - * Returns Item Variation Data. - * Represents additional data for rules with the `ITEM_VARIATION` accrual type. - */ - public function getItemVariationData(): ?LoyaltyProgramAccrualRuleItemVariationData - { - return $this->itemVariationData; - } - - /** - * Sets Item Variation Data. - * Represents additional data for rules with the `ITEM_VARIATION` accrual type. - * - * @maps item_variation_data - */ - public function setItemVariationData(?LoyaltyProgramAccrualRuleItemVariationData $itemVariationData): void - { - $this->itemVariationData = $itemVariationData; - } - - /** - * Returns Category Data. - * Represents additional data for rules with the `CATEGORY` accrual type. - */ - public function getCategoryData(): ?LoyaltyProgramAccrualRuleCategoryData - { - return $this->categoryData; - } - - /** - * Sets Category Data. - * Represents additional data for rules with the `CATEGORY` accrual type. - * - * @maps category_data - */ - public function setCategoryData(?LoyaltyProgramAccrualRuleCategoryData $categoryData): void - { - $this->categoryData = $categoryData; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['accrual_type'] = $this->accrualType; - if (!empty($this->points)) { - $json['points'] = $this->points['value']; - } - if (isset($this->visitData)) { - $json['visit_data'] = $this->visitData; - } - if (isset($this->spendData)) { - $json['spend_data'] = $this->spendData; - } - if (isset($this->itemVariationData)) { - $json['item_variation_data'] = $this->itemVariationData; - } - if (isset($this->categoryData)) { - $json['category_data'] = $this->categoryData; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramAccrualRuleCategoryData.php b/src/Models/LoyaltyProgramAccrualRuleCategoryData.php deleted file mode 100644 index 5a83bb06..00000000 --- a/src/Models/LoyaltyProgramAccrualRuleCategoryData.php +++ /dev/null @@ -1,69 +0,0 @@ -categoryId = $categoryId; - } - - /** - * Returns Category Id. - * The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn - * points. - */ - public function getCategoryId(): string - { - return $this->categoryId; - } - - /** - * Sets Category Id. - * The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn - * points. - * - * @required - * @maps category_id - */ - public function setCategoryId(string $categoryId): void - { - $this->categoryId = $categoryId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['category_id'] = $this->categoryId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramAccrualRuleItemVariationData.php b/src/Models/LoyaltyProgramAccrualRuleItemVariationData.php deleted file mode 100644 index 61b376c9..00000000 --- a/src/Models/LoyaltyProgramAccrualRuleItemVariationData.php +++ /dev/null @@ -1,71 +0,0 @@ -itemVariationId = $itemVariationId; - } - - /** - * Returns Item Variation Id. - * The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to - * earn - * points. - */ - public function getItemVariationId(): string - { - return $this->itemVariationId; - } - - /** - * Sets Item Variation Id. - * The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to - * earn - * points. - * - * @required - * @maps item_variation_id - */ - public function setItemVariationId(string $itemVariationId): void - { - $this->itemVariationId = $itemVariationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['item_variation_id'] = $this->itemVariationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramAccrualRuleSpendData.php b/src/Models/LoyaltyProgramAccrualRuleSpendData.php deleted file mode 100644 index 650fbe2f..00000000 --- a/src/Models/LoyaltyProgramAccrualRuleSpendData.php +++ /dev/null @@ -1,220 +0,0 @@ -amountMoney = $amountMoney; - $this->taxMode = $taxMode; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Excluded Category Ids. - * The IDs of any `CATEGORY` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded categories. - * - * @return string[]|null - */ - public function getExcludedCategoryIds(): ?array - { - if (count($this->excludedCategoryIds) == 0) { - return null; - } - return $this->excludedCategoryIds['value']; - } - - /** - * Sets Excluded Category Ids. - * The IDs of any `CATEGORY` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded categories. - * - * @maps excluded_category_ids - * - * @param string[]|null $excludedCategoryIds - */ - public function setExcludedCategoryIds(?array $excludedCategoryIds): void - { - $this->excludedCategoryIds['value'] = $excludedCategoryIds; - } - - /** - * Unsets Excluded Category Ids. - * The IDs of any `CATEGORY` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded categories. - */ - public function unsetExcludedCategoryIds(): void - { - $this->excludedCategoryIds = []; - } - - /** - * Returns Excluded Item Variation Ids. - * The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded item variations. - * - * @return string[]|null - */ - public function getExcludedItemVariationIds(): ?array - { - if (count($this->excludedItemVariationIds) == 0) { - return null; - } - return $this->excludedItemVariationIds['value']; - } - - /** - * Sets Excluded Item Variation Ids. - * The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded item variations. - * - * @maps excluded_item_variation_ids - * - * @param string[]|null $excludedItemVariationIds - */ - public function setExcludedItemVariationIds(?array $excludedItemVariationIds): void - { - $this->excludedItemVariationIds['value'] = $excludedItemVariationIds; - } - - /** - * Unsets Excluded Item Variation Ids. - * The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual. - * - * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - * endpoint to retrieve information about the excluded item variations. - */ - public function unsetExcludedItemVariationIds(): void - { - $this->excludedItemVariationIds = []; - } - - /** - * Returns Tax Mode. - * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points - * accrual. - * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum - * spend requirement. - */ - public function getTaxMode(): string - { - return $this->taxMode; - } - - /** - * Sets Tax Mode. - * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points - * accrual. - * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum - * spend requirement. - * - * @required - * @maps tax_mode - */ - public function setTaxMode(string $taxMode): void - { - $this->taxMode = $taxMode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['amount_money'] = $this->amountMoney; - if (!empty($this->excludedCategoryIds)) { - $json['excluded_category_ids'] = $this->excludedCategoryIds['value']; - } - if (!empty($this->excludedItemVariationIds)) { - $json['excluded_item_variation_ids'] = $this->excludedItemVariationIds['value']; - } - $json['tax_mode'] = $this->taxMode; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramAccrualRuleTaxMode.php b/src/Models/LoyaltyProgramAccrualRuleTaxMode.php deleted file mode 100644 index 8a974f6f..00000000 --- a/src/Models/LoyaltyProgramAccrualRuleTaxMode.php +++ /dev/null @@ -1,24 +0,0 @@ -taxMode = $taxMode; - } - - /** - * Returns Minimum Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMinimumAmountMoney(): ?Money - { - return $this->minimumAmountMoney; - } - - /** - * Sets Minimum Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps minimum_amount_money - */ - public function setMinimumAmountMoney(?Money $minimumAmountMoney): void - { - $this->minimumAmountMoney = $minimumAmountMoney; - } - - /** - * Returns Tax Mode. - * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points - * accrual. - * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum - * spend requirement. - */ - public function getTaxMode(): string - { - return $this->taxMode; - } - - /** - * Sets Tax Mode. - * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points - * accrual. - * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum - * spend requirement. - * - * @required - * @maps tax_mode - */ - public function setTaxMode(string $taxMode): void - { - $this->taxMode = $taxMode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->minimumAmountMoney)) { - $json['minimum_amount_money'] = $this->minimumAmountMoney; - } - $json['tax_mode'] = $this->taxMode; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramExpirationPolicy.php b/src/Models/LoyaltyProgramExpirationPolicy.php deleted file mode 100644 index aaea24de..00000000 --- a/src/Models/LoyaltyProgramExpirationPolicy.php +++ /dev/null @@ -1,73 +0,0 @@ -expirationDuration = $expirationDuration; - } - - /** - * Returns Expiration Duration. - * The number of months before points expire, in `P[n]M` RFC 3339 duration format. For example, a value - * of `P12M` represents a duration of 12 months. - * Points are valid through the last day of the month in which they are scheduled to expire. For - * example, with a `P12M` duration, points earned on July 6, 2020 expire on August 1, 2021. - */ - public function getExpirationDuration(): string - { - return $this->expirationDuration; - } - - /** - * Sets Expiration Duration. - * The number of months before points expire, in `P[n]M` RFC 3339 duration format. For example, a value - * of `P12M` represents a duration of 12 months. - * Points are valid through the last day of the month in which they are scheduled to expire. For - * example, with a `P12M` duration, points earned on July 6, 2020 expire on August 1, 2021. - * - * @required - * @maps expiration_duration - */ - public function setExpirationDuration(string $expirationDuration): void - { - $this->expirationDuration = $expirationDuration; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['expiration_duration'] = $this->expirationDuration; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramRewardDefinition.php b/src/Models/LoyaltyProgramRewardDefinition.php deleted file mode 100644 index f556f2ff..00000000 --- a/src/Models/LoyaltyProgramRewardDefinition.php +++ /dev/null @@ -1,267 +0,0 @@ -scope = $scope; - $this->discountType = $discountType; - } - - /** - * Returns Scope. - * Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - */ - public function getScope(): string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - * - * @required - * @maps scope - */ - public function setScope(string $scope): void - { - $this->scope = $scope; - } - - /** - * Returns Discount Type. - * The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - */ - public function getDiscountType(): string - { - return $this->discountType; - } - - /** - * Sets Discount Type. - * The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - * - * @required - * @maps discount_type - */ - public function setDiscountType(string $discountType): void - { - $this->discountType = $discountType; - } - - /** - * Returns Percentage Discount. - * The fixed percentage of the discount. Present if `discount_type` is `FIXED_PERCENTAGE`. - * For example, a 7.25% off discount will be represented as "7.25". DEPRECATED at version 2020-12-16. - * You can find this - * information in the `discount_data.percentage` field of the `DISCOUNT` catalog object referenced by - * the pricing rule. - */ - public function getPercentageDiscount(): ?string - { - return $this->percentageDiscount; - } - - /** - * Sets Percentage Discount. - * The fixed percentage of the discount. Present if `discount_type` is `FIXED_PERCENTAGE`. - * For example, a 7.25% off discount will be represented as "7.25". DEPRECATED at version 2020-12-16. - * You can find this - * information in the `discount_data.percentage` field of the `DISCOUNT` catalog object referenced by - * the pricing rule. - * - * @maps percentage_discount - */ - public function setPercentageDiscount(?string $percentageDiscount): void - { - $this->percentageDiscount = $percentageDiscount; - } - - /** - * Returns Catalog Object Ids. - * The list of catalog objects to which this reward can be applied. They are either all item-variation - * ids or category ids, depending on the `type` field. - * DEPRECATED at version 2020-12-16. You can find this information in the `product_set_data. - * product_ids_any` field - * of the `PRODUCT_SET` catalog object referenced by the pricing rule. - * - * @return string[]|null - */ - public function getCatalogObjectIds(): ?array - { - return $this->catalogObjectIds; - } - - /** - * Sets Catalog Object Ids. - * The list of catalog objects to which this reward can be applied. They are either all item-variation - * ids or category ids, depending on the `type` field. - * DEPRECATED at version 2020-12-16. You can find this information in the `product_set_data. - * product_ids_any` field - * of the `PRODUCT_SET` catalog object referenced by the pricing rule. - * - * @maps catalog_object_ids - * - * @param string[]|null $catalogObjectIds - */ - public function setCatalogObjectIds(?array $catalogObjectIds): void - { - $this->catalogObjectIds = $catalogObjectIds; - } - - /** - * Returns Fixed Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getFixedDiscountMoney(): ?Money - { - return $this->fixedDiscountMoney; - } - - /** - * Sets Fixed Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps fixed_discount_money - */ - public function setFixedDiscountMoney(?Money $fixedDiscountMoney): void - { - $this->fixedDiscountMoney = $fixedDiscountMoney; - } - - /** - * Returns Max Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMaxDiscountMoney(): ?Money - { - return $this->maxDiscountMoney; - } - - /** - * Sets Max Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps max_discount_money - */ - public function setMaxDiscountMoney(?Money $maxDiscountMoney): void - { - $this->maxDiscountMoney = $maxDiscountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['scope'] = $this->scope; - $json['discount_type'] = $this->discountType; - if (isset($this->percentageDiscount)) { - $json['percentage_discount'] = $this->percentageDiscount; - } - if (isset($this->catalogObjectIds)) { - $json['catalog_object_ids'] = $this->catalogObjectIds; - } - if (isset($this->fixedDiscountMoney)) { - $json['fixed_discount_money'] = $this->fixedDiscountMoney; - } - if (isset($this->maxDiscountMoney)) { - $json['max_discount_money'] = $this->maxDiscountMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramRewardDefinitionScope.php b/src/Models/LoyaltyProgramRewardDefinitionScope.php deleted file mode 100644 index 6a30903d..00000000 --- a/src/Models/LoyaltyProgramRewardDefinitionScope.php +++ /dev/null @@ -1,29 +0,0 @@ -points = $points; - $this->pricingRuleReference = $pricingRuleReference; - } - - /** - * Returns Id. - * The Square-assigned ID of the reward tier. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the reward tier. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Points. - * The points exchanged for the reward tier. - */ - public function getPoints(): int - { - return $this->points; - } - - /** - * Sets Points. - * The points exchanged for the reward tier. - * - * @required - * @maps points - */ - public function setPoints(int $points): void - { - $this->points = $points; - } - - /** - * Returns Name. - * The name of the reward tier. - */ - public function getName(): ?string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the reward tier. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name = $name; - } - - /** - * Returns Definition. - * Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - */ - public function getDefinition(): ?LoyaltyProgramRewardDefinition - { - return $this->definition; - } - - /** - * Sets Definition. - * Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details - * are now defined using a catalog pricing rule and other catalog objects. For more information, see - * [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty- - * rewards#get-discount-details). - * - * @maps definition - */ - public function setDefinition(?LoyaltyProgramRewardDefinition $definition): void - { - $this->definition = $definition; - } - - /** - * Returns Created At. - * The timestamp when the reward tier was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the reward tier was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Pricing Rule Reference. - * A reference to a Catalog object at a specific version. In general this is - * used as an entry point into a graph of catalog objects, where the objects exist - * at a specific version. - */ - public function getPricingRuleReference(): CatalogObjectReference - { - return $this->pricingRuleReference; - } - - /** - * Sets Pricing Rule Reference. - * A reference to a Catalog object at a specific version. In general this is - * used as an entry point into a graph of catalog objects, where the objects exist - * at a specific version. - * - * @required - * @maps pricing_rule_reference - */ - public function setPricingRuleReference(CatalogObjectReference $pricingRuleReference): void - { - $this->pricingRuleReference = $pricingRuleReference; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['points'] = $this->points; - if (isset($this->name)) { - $json['name'] = $this->name; - } - if (isset($this->definition)) { - $json['definition'] = $this->definition; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json['pricing_rule_reference'] = $this->pricingRuleReference; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyProgramStatus.php b/src/Models/LoyaltyProgramStatus.php deleted file mode 100644 index 02711639..00000000 --- a/src/Models/LoyaltyProgramStatus.php +++ /dev/null @@ -1,22 +0,0 @@ -one = $one; - $this->other = $other; - } - - /** - * Returns One. - * A singular unit for a point (for example, 1 point is called 1 star). - */ - public function getOne(): string - { - return $this->one; - } - - /** - * Sets One. - * A singular unit for a point (for example, 1 point is called 1 star). - * - * @required - * @maps one - */ - public function setOne(string $one): void - { - $this->one = $one; - } - - /** - * Returns Other. - * A plural unit for point (for example, 10 points is called 10 stars). - */ - public function getOther(): string - { - return $this->other; - } - - /** - * Sets Other. - * A plural unit for point (for example, 10 points is called 10 stars). - * - * @required - * @maps other - */ - public function setOther(string $other): void - { - $this->other = $other; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['one'] = $this->one; - $json['other'] = $this->other; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotion.php b/src/Models/LoyaltyPromotion.php deleted file mode 100644 index 23da2656..00000000 --- a/src/Models/LoyaltyPromotion.php +++ /dev/null @@ -1,520 +0,0 @@ -name = $name; - $this->incentive = $incentive; - $this->availableTime = $availableTime; - } - - /** - * Returns Id. - * The Square-assigned ID of the promotion. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the promotion. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of the promotion. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the promotion. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Incentive. - * Represents how points for a [loyalty promotion]($m/LoyaltyPromotion) are calculated, - * either by multiplying the points earned from the base program or by adding a specified number - * of points to the points earned from the base program. - */ - public function getIncentive(): LoyaltyPromotionIncentive - { - return $this->incentive; - } - - /** - * Sets Incentive. - * Represents how points for a [loyalty promotion]($m/LoyaltyPromotion) are calculated, - * either by multiplying the points earned from the base program or by adding a specified number - * of points to the points earned from the base program. - * - * @required - * @maps incentive - */ - public function setIncentive(LoyaltyPromotionIncentive $incentive): void - { - $this->incentive = $incentive; - } - - /** - * Returns Available Time. - * Represents scheduling information that determines when purchases can qualify to earn points - * from a [loyalty promotion]($m/LoyaltyPromotion). - */ - public function getAvailableTime(): LoyaltyPromotionAvailableTimeData - { - return $this->availableTime; - } - - /** - * Sets Available Time. - * Represents scheduling information that determines when purchases can qualify to earn points - * from a [loyalty promotion]($m/LoyaltyPromotion). - * - * @required - * @maps available_time - */ - public function setAvailableTime(LoyaltyPromotionAvailableTimeData $availableTime): void - { - $this->availableTime = $availableTime; - } - - /** - * Returns Trigger Limit. - * Represents the number of times a buyer can earn points during a [loyalty - * promotion]($m/LoyaltyPromotion). - * If this field is not set, buyers can trigger the promotion an unlimited number of times to earn - * points during - * the time that the promotion is available. - * - * A purchase that is disqualified from earning points because of this limit might qualify for another - * active promotion. - */ - public function getTriggerLimit(): ?LoyaltyPromotionTriggerLimit - { - return $this->triggerLimit; - } - - /** - * Sets Trigger Limit. - * Represents the number of times a buyer can earn points during a [loyalty - * promotion]($m/LoyaltyPromotion). - * If this field is not set, buyers can trigger the promotion an unlimited number of times to earn - * points during - * the time that the promotion is available. - * - * A purchase that is disqualified from earning points because of this limit might qualify for another - * active promotion. - * - * @maps trigger_limit - */ - public function setTriggerLimit(?LoyaltyPromotionTriggerLimit $triggerLimit): void - { - $this->triggerLimit = $triggerLimit; - } - - /** - * Returns Status. - * Indicates the status of a [loyalty promotion]($m/LoyaltyPromotion). - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates the status of a [loyalty promotion]($m/LoyaltyPromotion). - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Created At. - * The timestamp of when the promotion was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the promotion was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Canceled At. - * The timestamp of when the promotion was canceled, in RFC 3339 format. - */ - public function getCanceledAt(): ?string - { - return $this->canceledAt; - } - - /** - * Sets Canceled At. - * The timestamp of when the promotion was canceled, in RFC 3339 format. - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt = $canceledAt; - } - - /** - * Returns Updated At. - * The timestamp when the promotion was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the promotion was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. - */ - public function getLoyaltyProgramId(): ?string - { - return $this->loyaltyProgramId; - } - - /** - * Sets Loyalty Program Id. - * The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. - * - * @maps loyalty_program_id - */ - public function setLoyaltyProgramId(?string $loyaltyProgramId): void - { - $this->loyaltyProgramId = $loyaltyProgramId; - } - - /** - * Returns Minimum Spend Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getMinimumSpendAmountMoney(): ?Money - { - return $this->minimumSpendAmountMoney; - } - - /** - * Sets Minimum Spend Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps minimum_spend_amount_money - */ - public function setMinimumSpendAmountMoney(?Money $minimumSpendAmountMoney): void - { - $this->minimumSpendAmountMoney = $minimumSpendAmountMoney; - } - - /** - * Returns Qualifying Item Variation Ids. - * The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one of these items to qualify for the promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, - * but not both. - * - * @return string[]|null - */ - public function getQualifyingItemVariationIds(): ?array - { - if (count($this->qualifyingItemVariationIds) == 0) { - return null; - } - return $this->qualifyingItemVariationIds['value']; - } - - /** - * Sets Qualifying Item Variation Ids. - * The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one of these items to qualify for the promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, - * but not both. - * - * @maps qualifying_item_variation_ids - * - * @param string[]|null $qualifyingItemVariationIds - */ - public function setQualifyingItemVariationIds(?array $qualifyingItemVariationIds): void - { - $this->qualifyingItemVariationIds['value'] = $qualifyingItemVariationIds; - } - - /** - * Unsets Qualifying Item Variation Ids. - * The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one of these items to qualify for the promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, - * but not both. - */ - public function unsetQualifyingItemVariationIds(): void - { - $this->qualifyingItemVariationIds = []; - } - - /** - * Returns Qualifying Category Ids. - * The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one item from one of these categories to qualify for the - * promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but - * not both. - * - * @return string[]|null - */ - public function getQualifyingCategoryIds(): ?array - { - if (count($this->qualifyingCategoryIds) == 0) { - return null; - } - return $this->qualifyingCategoryIds['value']; - } - - /** - * Sets Qualifying Category Ids. - * The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one item from one of these categories to qualify for the - * promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but - * not both. - * - * @maps qualifying_category_ids - * - * @param string[]|null $qualifyingCategoryIds - */ - public function setQualifyingCategoryIds(?array $qualifyingCategoryIds): void - { - $this->qualifyingCategoryIds['value'] = $qualifyingCategoryIds; - } - - /** - * Unsets Qualifying Category Ids. - * The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified, - * the purchase must include at least one item from one of these categories to qualify for the - * promotion. - * - * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. - * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. - * - * You can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but - * not both. - */ - public function unsetQualifyingCategoryIds(): void - { - $this->qualifyingCategoryIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['name'] = $this->name; - $json['incentive'] = $this->incentive; - $json['available_time'] = $this->availableTime; - if (isset($this->triggerLimit)) { - $json['trigger_limit'] = $this->triggerLimit; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->loyaltyProgramId)) { - $json['loyalty_program_id'] = $this->loyaltyProgramId; - } - if (isset($this->minimumSpendAmountMoney)) { - $json['minimum_spend_amount_money'] = $this->minimumSpendAmountMoney; - } - if (!empty($this->qualifyingItemVariationIds)) { - $json['qualifying_item_variation_ids'] = $this->qualifyingItemVariationIds['value']; - } - if (!empty($this->qualifyingCategoryIds)) { - $json['qualifying_category_ids'] = $this->qualifyingCategoryIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionAvailableTimeData.php b/src/Models/LoyaltyPromotionAvailableTimeData.php deleted file mode 100644 index 16ec297e..00000000 --- a/src/Models/LoyaltyPromotionAvailableTimeData.php +++ /dev/null @@ -1,154 +0,0 @@ -timePeriods = $timePeriods; - } - - /** - * Returns Start Date. - * The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field - * based on the provided `time_periods`. - */ - public function getStartDate(): ?string - { - return $this->startDate; - } - - /** - * Sets Start Date. - * The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field - * based on the provided `time_periods`. - * - * @maps start_date - */ - public function setStartDate(?string $startDate): void - { - $this->startDate = $startDate; - } - - /** - * Returns End Date. - * The date that the promotion ends, in `YYYY-MM-DD` format. Square populates this field - * based on the provided `time_periods`. If an end date is not specified, an `ACTIVE` promotion - * remains available until it is canceled. - */ - public function getEndDate(): ?string - { - return $this->endDate; - } - - /** - * Sets End Date. - * The date that the promotion ends, in `YYYY-MM-DD` format. Square populates this field - * based on the provided `time_periods`. If an end date is not specified, an `ACTIVE` promotion - * remains available until it is canceled. - * - * @maps end_date - */ - public function setEndDate(?string $endDate): void - { - $this->endDate = $endDate; - } - - /** - * Returns Time Periods. - * A list of [iCalendar (RFC 5545) events](https://tools.ietf.org/html/rfc5545#section-3.6.1) - * (`VEVENT`). Each event represents an available time period per day or days of the week. - * A day can have a maximum of one available time period. - * - * Only `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and `DURATION` are required and - * timestamps must be in local (unzoned) time format. Include `RRULE` to specify recurring promotions, - * an end date (using the `UNTIL` keyword), or both. For more information, see - * [Available time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time). - * - * Note that `BEGIN:VEVENT` and `END:VEVENT` are optional in a `CreateLoyaltyPromotion` request - * but are always included in the response. - * - * @return string[] - */ - public function getTimePeriods(): array - { - return $this->timePeriods; - } - - /** - * Sets Time Periods. - * A list of [iCalendar (RFC 5545) events](https://tools.ietf.org/html/rfc5545#section-3.6.1) - * (`VEVENT`). Each event represents an available time period per day or days of the week. - * A day can have a maximum of one available time period. - * - * Only `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and `DURATION` are required and - * timestamps must be in local (unzoned) time format. Include `RRULE` to specify recurring promotions, - * an end date (using the `UNTIL` keyword), or both. For more information, see - * [Available time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time). - * - * Note that `BEGIN:VEVENT` and `END:VEVENT` are optional in a `CreateLoyaltyPromotion` request - * but are always included in the response. - * - * @required - * @maps time_periods - * - * @param string[] $timePeriods - */ - public function setTimePeriods(array $timePeriods): void - { - $this->timePeriods = $timePeriods; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->startDate)) { - $json['start_date'] = $this->startDate; - } - if (isset($this->endDate)) { - $json['end_date'] = $this->endDate; - } - $json['time_periods'] = $this->timePeriods; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionIncentive.php b/src/Models/LoyaltyPromotionIncentive.php deleted file mode 100644 index 9d4003a2..00000000 --- a/src/Models/LoyaltyPromotionIncentive.php +++ /dev/null @@ -1,131 +0,0 @@ -type = $type; - } - - /** - * Returns Type. - * Indicates the type of points incentive for a [loyalty promotion]($m/LoyaltyPromotion), - * which is used to determine how buyers can earn points from the promotion. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates the type of points incentive for a [loyalty promotion]($m/LoyaltyPromotion), - * which is used to determine how buyers can earn points from the promotion. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Points Multiplier Data. - * Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion - * incentive]($m/LoyaltyPromotionIncentive). - */ - public function getPointsMultiplierData(): ?LoyaltyPromotionIncentivePointsMultiplierData - { - return $this->pointsMultiplierData; - } - - /** - * Sets Points Multiplier Data. - * Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion - * incentive]($m/LoyaltyPromotionIncentive). - * - * @maps points_multiplier_data - */ - public function setPointsMultiplierData(?LoyaltyPromotionIncentivePointsMultiplierData $pointsMultiplierData): void - { - $this->pointsMultiplierData = $pointsMultiplierData; - } - - /** - * Returns Points Addition Data. - * Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion - * incentive]($m/LoyaltyPromotionIncentive). - */ - public function getPointsAdditionData(): ?LoyaltyPromotionIncentivePointsAdditionData - { - return $this->pointsAdditionData; - } - - /** - * Sets Points Addition Data. - * Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion - * incentive]($m/LoyaltyPromotionIncentive). - * - * @maps points_addition_data - */ - public function setPointsAdditionData(?LoyaltyPromotionIncentivePointsAdditionData $pointsAdditionData): void - { - $this->pointsAdditionData = $pointsAdditionData; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - if (isset($this->pointsMultiplierData)) { - $json['points_multiplier_data'] = $this->pointsMultiplierData; - } - if (isset($this->pointsAdditionData)) { - $json['points_addition_data'] = $this->pointsAdditionData; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionIncentivePointsAdditionData.php b/src/Models/LoyaltyPromotionIncentivePointsAdditionData.php deleted file mode 100644 index 943f3766..00000000 --- a/src/Models/LoyaltyPromotionIncentivePointsAdditionData.php +++ /dev/null @@ -1,74 +0,0 @@ -pointsAddition = $pointsAddition; - } - - /** - * Returns Points Addition. - * The number of additional points to earn each time the promotion is triggered. For example, - * suppose a purchase qualifies for 5 points from the base loyalty program. If the purchase also - * qualifies for a `POINTS_ADDITION` promotion incentive with a `points_addition` of 3, the buyer - * earns a total of 8 points (5 program points + 3 promotion points = 8 points). - */ - public function getPointsAddition(): int - { - return $this->pointsAddition; - } - - /** - * Sets Points Addition. - * The number of additional points to earn each time the promotion is triggered. For example, - * suppose a purchase qualifies for 5 points from the base loyalty program. If the purchase also - * qualifies for a `POINTS_ADDITION` promotion incentive with a `points_addition` of 3, the buyer - * earns a total of 8 points (5 program points + 3 promotion points = 8 points). - * - * @required - * @maps points_addition - */ - public function setPointsAddition(int $pointsAddition): void - { - $this->pointsAddition = $pointsAddition; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['points_addition'] = $this->pointsAddition; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionIncentivePointsMultiplierData.php b/src/Models/LoyaltyPromotionIncentivePointsMultiplierData.php deleted file mode 100644 index 1fb19b5b..00000000 --- a/src/Models/LoyaltyPromotionIncentivePointsMultiplierData.php +++ /dev/null @@ -1,194 +0,0 @@ -pointsMultiplier) == 0) { - return null; - } - return $this->pointsMultiplier['value']; - } - - /** - * Sets Points Multiplier. - * The multiplier used to calculate the number of points earned each time the promotion - * is triggered. For example, suppose a purchase qualifies for 5 points from the base loyalty program. - * If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a - * `points_multiplier` - * of 3, the buyer earns a total of 15 points (5 program points x 3 promotion multiplier = 15 points). - * - * DEPRECATED at version 2023-08-16. Replaced by the `multiplier` field. - * - * One of the following is required when specifying a points multiplier: - * - (Recommended) The `multiplier` field. - * - This deprecated `points_multiplier` field. If provided in the request, Square also returns - * `multiplier` - * with the equivalent value. - * - * @maps points_multiplier - */ - public function setPointsMultiplier(?int $pointsMultiplier): void - { - $this->pointsMultiplier['value'] = $pointsMultiplier; - } - - /** - * Unsets Points Multiplier. - * The multiplier used to calculate the number of points earned each time the promotion - * is triggered. For example, suppose a purchase qualifies for 5 points from the base loyalty program. - * If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a - * `points_multiplier` - * of 3, the buyer earns a total of 15 points (5 program points x 3 promotion multiplier = 15 points). - * - * DEPRECATED at version 2023-08-16. Replaced by the `multiplier` field. - * - * One of the following is required when specifying a points multiplier: - * - (Recommended) The `multiplier` field. - * - This deprecated `points_multiplier` field. If provided in the request, Square also returns - * `multiplier` - * with the equivalent value. - */ - public function unsetPointsMultiplier(): void - { - $this->pointsMultiplier = []; - } - - /** - * Returns Multiplier. - * The multiplier used to calculate the number of points earned each time the promotion is triggered, - * specified as a string representation of a decimal. Square supports multipliers up to 10x, with - * three - * point precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from - * the - * base loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive - * with a - * `multiplier` of "1.5", the buyer earns a total of 6 points (4 program points x 1.5 promotion - * multiplier = 6 points). - * Fractional points are dropped. - * - * One of the following is required when specifying a points multiplier: - * - (Recommended) This `multiplier` field. - * - The deprecated `points_multiplier` field. If provided in the request, Square also returns - * `multiplier` - * with the equivalent value. - */ - public function getMultiplier(): ?string - { - if (count($this->multiplier) == 0) { - return null; - } - return $this->multiplier['value']; - } - - /** - * Sets Multiplier. - * The multiplier used to calculate the number of points earned each time the promotion is triggered, - * specified as a string representation of a decimal. Square supports multipliers up to 10x, with - * three - * point precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from - * the - * base loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive - * with a - * `multiplier` of "1.5", the buyer earns a total of 6 points (4 program points x 1.5 promotion - * multiplier = 6 points). - * Fractional points are dropped. - * - * One of the following is required when specifying a points multiplier: - * - (Recommended) This `multiplier` field. - * - The deprecated `points_multiplier` field. If provided in the request, Square also returns - * `multiplier` - * with the equivalent value. - * - * @maps multiplier - */ - public function setMultiplier(?string $multiplier): void - { - $this->multiplier['value'] = $multiplier; - } - - /** - * Unsets Multiplier. - * The multiplier used to calculate the number of points earned each time the promotion is triggered, - * specified as a string representation of a decimal. Square supports multipliers up to 10x, with - * three - * point precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from - * the - * base loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive - * with a - * `multiplier` of "1.5", the buyer earns a total of 6 points (4 program points x 1.5 promotion - * multiplier = 6 points). - * Fractional points are dropped. - * - * One of the following is required when specifying a points multiplier: - * - (Recommended) This `multiplier` field. - * - The deprecated `points_multiplier` field. If provided in the request, Square also returns - * `multiplier` - * with the equivalent value. - */ - public function unsetMultiplier(): void - { - $this->multiplier = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->pointsMultiplier)) { - $json['points_multiplier'] = $this->pointsMultiplier['value']; - } - if (!empty($this->multiplier)) { - $json['multiplier'] = $this->multiplier['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionIncentiveType.php b/src/Models/LoyaltyPromotionIncentiveType.php deleted file mode 100644 index c2742054..00000000 --- a/src/Models/LoyaltyPromotionIncentiveType.php +++ /dev/null @@ -1,24 +0,0 @@ -times = $times; - } - - /** - * Returns Times. - * The maximum number of times a buyer can trigger the promotion during the specified `interval`. - */ - public function getTimes(): int - { - return $this->times; - } - - /** - * Sets Times. - * The maximum number of times a buyer can trigger the promotion during the specified `interval`. - * - * @required - * @maps times - */ - public function setTimes(int $times): void - { - $this->times = $times; - } - - /** - * Returns Interval. - * Indicates the time period that the [trigger limit]($m/LoyaltyPromotionTriggerLimit) applies to, - * which is used to determine the number of times a buyer can earn points for a [loyalty - * promotion]($m/LoyaltyPromotion). - */ - public function getInterval(): ?string - { - return $this->interval; - } - - /** - * Sets Interval. - * Indicates the time period that the [trigger limit]($m/LoyaltyPromotionTriggerLimit) applies to, - * which is used to determine the number of times a buyer can earn points for a [loyalty - * promotion]($m/LoyaltyPromotion). - * - * @maps interval - */ - public function setInterval(?string $interval): void - { - $this->interval = $interval; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['times'] = $this->times; - if (isset($this->interval)) { - $json['interval'] = $this->interval; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyPromotionTriggerLimitInterval.php b/src/Models/LoyaltyPromotionTriggerLimitInterval.php deleted file mode 100644 index 9ffe2797..00000000 --- a/src/Models/LoyaltyPromotionTriggerLimitInterval.php +++ /dev/null @@ -1,28 +0,0 @@ -loyaltyAccountId = $loyaltyAccountId; - $this->rewardTierId = $rewardTierId; - } - - /** - * Returns Id. - * The Square-assigned ID of the loyalty reward. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the loyalty reward. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Status. - * The status of the loyalty reward. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the loyalty reward. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Loyalty Account Id. - * The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs. - */ - public function getLoyaltyAccountId(): string - { - return $this->loyaltyAccountId; - } - - /** - * Sets Loyalty Account Id. - * The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs. - * - * @required - * @maps loyalty_account_id - */ - public function setLoyaltyAccountId(string $loyaltyAccountId): void - { - $this->loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Returns Reward Tier Id. - * The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the - * reward. - */ - public function getRewardTierId(): string - { - return $this->rewardTierId; - } - - /** - * Sets Reward Tier Id. - * The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the - * reward. - * - * @required - * @maps reward_tier_id - */ - public function setRewardTierId(string $rewardTierId): void - { - $this->rewardTierId = $rewardTierId; - } - - /** - * Returns Points. - * The number of loyalty points used for the reward. - */ - public function getPoints(): ?int - { - return $this->points; - } - - /** - * Sets Points. - * The number of loyalty points used for the reward. - * - * @maps points - */ - public function setPoints(?int $points): void - { - $this->points = $points; - } - - /** - * Returns Order Id. - * The Square-assigned ID of the [order](entity:Order) to which the reward is attached. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The Square-assigned ID of the [order](entity:Order) to which the reward is attached. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The Square-assigned ID of the [order](entity:Order) to which the reward is attached. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Created At. - * The timestamp when the reward was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the reward was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the reward was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the reward was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Redeemed At. - * The timestamp when the reward was redeemed, in RFC 3339 format. - */ - public function getRedeemedAt(): ?string - { - return $this->redeemedAt; - } - - /** - * Sets Redeemed At. - * The timestamp when the reward was redeemed, in RFC 3339 format. - * - * @maps redeemed_at - */ - public function setRedeemedAt(?string $redeemedAt): void - { - $this->redeemedAt = $redeemedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json['loyalty_account_id'] = $this->loyaltyAccountId; - $json['reward_tier_id'] = $this->rewardTierId; - if (isset($this->points)) { - $json['points'] = $this->points; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->redeemedAt)) { - $json['redeemed_at'] = $this->redeemedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/LoyaltyRewardStatus.php b/src/Models/LoyaltyRewardStatus.php deleted file mode 100644 index 410954c8..00000000 --- a/src/Models/LoyaltyRewardStatus.php +++ /dev/null @@ -1,26 +0,0 @@ -startAt = $startAt; - $this->breakTypeId = $breakTypeId; - $this->name = $name; - $this->expectedDuration = $expectedDuration; - $this->isPaid = $isPaid; - } - - /** - * Returns Id. - * The UUID for this object. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Start At. - * RFC 3339; follows the same timezone information as `Shift`. Precision up to - * the minute is respected; seconds are truncated. - */ - public function getStartAt(): string - { - return $this->startAt; - } - - /** - * Sets Start At. - * RFC 3339; follows the same timezone information as `Shift`. Precision up to - * the minute is respected; seconds are truncated. - * - * @required - * @maps start_at - */ - public function setStartAt(string $startAt): void - { - $this->startAt = $startAt; - } - - /** - * Returns End At. - * RFC 3339; follows the same timezone information as `Shift`. Precision up to - * the minute is respected; seconds are truncated. - */ - public function getEndAt(): ?string - { - if (count($this->endAt) == 0) { - return null; - } - return $this->endAt['value']; - } - - /** - * Sets End At. - * RFC 3339; follows the same timezone information as `Shift`. Precision up to - * the minute is respected; seconds are truncated. - * - * @maps end_at - */ - public function setEndAt(?string $endAt): void - { - $this->endAt['value'] = $endAt; - } - - /** - * Unsets End At. - * RFC 3339; follows the same timezone information as `Shift`. Precision up to - * the minute is respected; seconds are truncated. - */ - public function unsetEndAt(): void - { - $this->endAt = []; - } - - /** - * Returns Break Type Id. - * The `BreakType` that this `Break` was templated on. - */ - public function getBreakTypeId(): string - { - return $this->breakTypeId; - } - - /** - * Sets Break Type Id. - * The `BreakType` that this `Break` was templated on. - * - * @required - * @maps break_type_id - */ - public function setBreakTypeId(string $breakTypeId): void - { - $this->breakTypeId = $breakTypeId; - } - - /** - * Returns Name. - * A human-readable name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * A human-readable name. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Expected Duration. - * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of - * the break. - */ - public function getExpectedDuration(): string - { - return $this->expectedDuration; - } - - /** - * Sets Expected Duration. - * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of - * the break. - * - * @required - * @maps expected_duration - */ - public function setExpectedDuration(string $expectedDuration): void - { - $this->expectedDuration = $expectedDuration; - } - - /** - * Returns Is Paid. - * Whether this break counts towards time worked for compensation - * purposes. - */ - public function getIsPaid(): bool - { - return $this->isPaid; - } - - /** - * Sets Is Paid. - * Whether this break counts towards time worked for compensation - * purposes. - * - * @required - * @maps is_paid - */ - public function setIsPaid(bool $isPaid): void - { - $this->isPaid = $isPaid; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['start_at'] = $this->startAt; - if (!empty($this->endAt)) { - $json['end_at'] = $this->endAt['value']; - } - $json['break_type_id'] = $this->breakTypeId; - $json['name'] = $this->name; - $json['expected_duration'] = $this->expectedDuration; - $json['is_paid'] = $this->isPaid; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/MeasurementUnit.php b/src/Models/MeasurementUnit.php deleted file mode 100644 index 48467458..00000000 --- a/src/Models/MeasurementUnit.php +++ /dev/null @@ -1,258 +0,0 @@ -customUnit; - } - - /** - * Sets Custom Unit. - * The information needed to define a custom unit, provided by the seller. - * - * @maps custom_unit - */ - public function setCustomUnit(?MeasurementUnitCustom $customUnit): void - { - $this->customUnit = $customUnit; - } - - /** - * Returns Area Unit. - * Unit of area used to measure a quantity. - */ - public function getAreaUnit(): ?string - { - return $this->areaUnit; - } - - /** - * Sets Area Unit. - * Unit of area used to measure a quantity. - * - * @maps area_unit - */ - public function setAreaUnit(?string $areaUnit): void - { - $this->areaUnit = $areaUnit; - } - - /** - * Returns Length Unit. - * The unit of length used to measure a quantity. - */ - public function getLengthUnit(): ?string - { - return $this->lengthUnit; - } - - /** - * Sets Length Unit. - * The unit of length used to measure a quantity. - * - * @maps length_unit - */ - public function setLengthUnit(?string $lengthUnit): void - { - $this->lengthUnit = $lengthUnit; - } - - /** - * Returns Volume Unit. - * The unit of volume used to measure a quantity. - */ - public function getVolumeUnit(): ?string - { - return $this->volumeUnit; - } - - /** - * Sets Volume Unit. - * The unit of volume used to measure a quantity. - * - * @maps volume_unit - */ - public function setVolumeUnit(?string $volumeUnit): void - { - $this->volumeUnit = $volumeUnit; - } - - /** - * Returns Weight Unit. - * Unit of weight used to measure a quantity. - */ - public function getWeightUnit(): ?string - { - return $this->weightUnit; - } - - /** - * Sets Weight Unit. - * Unit of weight used to measure a quantity. - * - * @maps weight_unit - */ - public function setWeightUnit(?string $weightUnit): void - { - $this->weightUnit = $weightUnit; - } - - /** - * Returns Generic Unit. - */ - public function getGenericUnit(): ?string - { - return $this->genericUnit; - } - - /** - * Sets Generic Unit. - * - * @maps generic_unit - */ - public function setGenericUnit(?string $genericUnit): void - { - $this->genericUnit = $genericUnit; - } - - /** - * Returns Time Unit. - * Unit of time used to measure a quantity (a duration). - */ - public function getTimeUnit(): ?string - { - return $this->timeUnit; - } - - /** - * Sets Time Unit. - * Unit of time used to measure a quantity (a duration). - * - * @maps time_unit - */ - public function setTimeUnit(?string $timeUnit): void - { - $this->timeUnit = $timeUnit; - } - - /** - * Returns Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customUnit)) { - $json['custom_unit'] = $this->customUnit; - } - if (isset($this->areaUnit)) { - $json['area_unit'] = $this->areaUnit; - } - if (isset($this->lengthUnit)) { - $json['length_unit'] = $this->lengthUnit; - } - if (isset($this->volumeUnit)) { - $json['volume_unit'] = $this->volumeUnit; - } - if (isset($this->weightUnit)) { - $json['weight_unit'] = $this->weightUnit; - } - if (isset($this->genericUnit)) { - $json['generic_unit'] = $this->genericUnit; - } - if (isset($this->timeUnit)) { - $json['time_unit'] = $this->timeUnit; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/MeasurementUnitArea.php b/src/Models/MeasurementUnitArea.php deleted file mode 100644 index a192dfca..00000000 --- a/src/Models/MeasurementUnitArea.php +++ /dev/null @@ -1,51 +0,0 @@ -name = $name; - $this->abbreviation = $abbreviation; - } - - /** - * Returns Name. - * The name of the custom unit, for example "bushel". - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The name of the custom unit, for example "bushel". - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Abbreviation. - * The abbreviation of the custom unit, such as "bsh" (bushel). This appears - * in the cart for the Point of Sale app, and in reports. - */ - public function getAbbreviation(): string - { - return $this->abbreviation; - } - - /** - * Sets Abbreviation. - * The abbreviation of the custom unit, such as "bsh" (bushel). This appears - * in the cart for the Point of Sale app, and in reports. - * - * @required - * @maps abbreviation - */ - public function setAbbreviation(string $abbreviation): void - { - $this->abbreviation = $abbreviation; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - $json['abbreviation'] = $this->abbreviation; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/MeasurementUnitGeneric.php b/src/Models/MeasurementUnitGeneric.php deleted file mode 100644 index 9010d2c0..00000000 --- a/src/Models/MeasurementUnitGeneric.php +++ /dev/null @@ -1,13 +0,0 @@ -country = $country; - } - - /** - * Returns Id. - * The Square-issued ID of the merchant. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-issued ID of the merchant. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Business Name. - * The name of the merchant's overall business. - */ - public function getBusinessName(): ?string - { - if (count($this->businessName) == 0) { - return null; - } - return $this->businessName['value']; - } - - /** - * Sets Business Name. - * The name of the merchant's overall business. - * - * @maps business_name - */ - public function setBusinessName(?string $businessName): void - { - $this->businessName['value'] = $businessName; - } - - /** - * Unsets Business Name. - * The name of the merchant's overall business. - */ - public function unsetBusinessName(): void - { - $this->businessName = []; - } - - /** - * Returns Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - */ - public function getCountry(): string - { - return $this->country; - } - - /** - * Sets Country. - * Indicates the country associated with another entity, such as a business. - * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). - * - * @required - * @maps country - */ - public function setCountry(string $country): void - { - $this->country = $country; - } - - /** - * Returns Language Code. - * The code indicating the [language preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https: - * //tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`. - */ - public function getLanguageCode(): ?string - { - if (count($this->languageCode) == 0) { - return null; - } - return $this->languageCode['value']; - } - - /** - * Sets Language Code. - * The code indicating the [language preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https: - * //tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`. - * - * @maps language_code - */ - public function setLanguageCode(?string $languageCode): void - { - $this->languageCode['value'] = $languageCode; - } - - /** - * Unsets Language Code. - * The code indicating the [language preferences](https://developer.squareup.com/docs/build- - * basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https: - * //tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`. - */ - public function unsetLanguageCode(): void - { - $this->languageCode = []; - } - - /** - * Returns Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - */ - public function getCurrency(): ?string - { - return $this->currency; - } - - /** - * Sets Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - * - * @maps currency - */ - public function setCurrency(?string $currency): void - { - $this->currency = $currency; - } - - /** - * Returns Status. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Main Location Id. - * The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main- - * location) for this merchant. - */ - public function getMainLocationId(): ?string - { - if (count($this->mainLocationId) == 0) { - return null; - } - return $this->mainLocationId['value']; - } - - /** - * Sets Main Location Id. - * The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main- - * location) for this merchant. - * - * @maps main_location_id - */ - public function setMainLocationId(?string $mainLocationId): void - { - $this->mainLocationId['value'] = $mainLocationId; - } - - /** - * Unsets Main Location Id. - * The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main- - * location) for this merchant. - */ - public function unsetMainLocationId(): void - { - $this->mainLocationId = []; - } - - /** - * Returns Created At. - * The time when the merchant was created, in RFC 3339 format. - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build- - * basics/working-with-dates). - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the merchant was created, in RFC 3339 format. - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build- - * basics/working-with-dates). - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->businessName)) { - $json['business_name'] = $this->businessName['value']; - } - $json['country'] = $this->country; - if (!empty($this->languageCode)) { - $json['language_code'] = $this->languageCode['value']; - } - if (isset($this->currency)) { - $json['currency'] = $this->currency; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->mainLocationId)) { - $json['main_location_id'] = $this->mainLocationId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/MerchantStatus.php b/src/Models/MerchantStatus.php deleted file mode 100644 index 0ee45bc0..00000000 --- a/src/Models/MerchantStatus.php +++ /dev/null @@ -1,19 +0,0 @@ -locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the `Location` object representing the location. This can include a deactivated location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the `Location` object representing the location. This can include a deactivated location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): ?Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_money - */ - public function setPriceMoney(?Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Returns Sold Out. - * Indicates whether the modifier is sold out at the specified location or not. As an example, for - * cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, - * that is sold out. - * The seller can manually set this sold out status. Attempts by an application to set this attribute - * are ignored. - */ - public function getSoldOut(): ?bool - { - return $this->soldOut; - } - - /** - * Sets Sold Out. - * Indicates whether the modifier is sold out at the specified location or not. As an example, for - * cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, - * that is sold out. - * The seller can manually set this sold out status. Attempts by an application to set this attribute - * are ignored. - * - * @maps sold_out - */ - public function setSoldOut(?bool $soldOut): void - { - $this->soldOut = $soldOut; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->priceMoney)) { - $json['price_money'] = $this->priceMoney; - } - if (isset($this->soldOut)) { - $json['sold_out'] = $this->soldOut; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Money.php b/src/Models/Money.php deleted file mode 100644 index 2b0801b1..00000000 --- a/src/Models/Money.php +++ /dev/null @@ -1,117 +0,0 @@ -amount) == 0) { - return null; - } - return $this->amount['value']; - } - - /** - * Sets Amount. - * The amount of money, in the smallest denomination of the currency - * indicated by `currency`. For example, when `currency` is `USD`, `amount` is - * in cents. Monetary amounts can be positive or negative. See the specific - * field description to determine the meaning of the sign in a particular case. - * - * @maps amount - */ - public function setAmount(?int $amount): void - { - $this->amount['value'] = $amount; - } - - /** - * Unsets Amount. - * The amount of money, in the smallest denomination of the currency - * indicated by `currency`. For example, when `currency` is `USD`, `amount` is - * in cents. Monetary amounts can be positive or negative. See the specific - * field description to determine the meaning of the sign in a particular case. - */ - public function unsetAmount(): void - { - $this->amount = []; - } - - /** - * Returns Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - */ - public function getCurrency(): ?string - { - return $this->currency; - } - - /** - * Sets Currency. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - * - * @maps currency - */ - public function setCurrency(?string $currency): void - { - $this->currency = $currency; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->amount)) { - $json['amount'] = $this->amount['value']; - } - if (isset($this->currency)) { - $json['currency'] = $this->currency; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ObtainTokenRequest.php b/src/Models/ObtainTokenRequest.php deleted file mode 100644 index 733ac210..00000000 --- a/src/Models/ObtainTokenRequest.php +++ /dev/null @@ -1,508 +0,0 @@ -clientId = $clientId; - $this->grantType = $grantType; - } - - /** - * Returns Client Id. - * The Square-issued ID of your application, which is available on the **OAuth** page in the - * [Developer Dashboard](https://developer.squareup.com/apps). - */ - public function getClientId(): string - { - return $this->clientId; - } - - /** - * Sets Client Id. - * The Square-issued ID of your application, which is available on the **OAuth** page in the - * [Developer Dashboard](https://developer.squareup.com/apps). - * - * @required - * @maps client_id - */ - public function setClientId(string $clientId): void - { - $this->clientId = $clientId; - } - - /** - * Returns Client Secret. - * The Square-issued application secret for your application, which is available on the **OAuth** page - * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when - * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. - * com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to - * `authorization_code`. - * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE - * flow only requires `client_id`, - * `grant_type`, and `refresh_token`. - */ - public function getClientSecret(): ?string - { - if (count($this->clientSecret) == 0) { - return null; - } - return $this->clientSecret['value']; - } - - /** - * Sets Client Secret. - * The Square-issued application secret for your application, which is available on the **OAuth** page - * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when - * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. - * com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to - * `authorization_code`. - * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE - * flow only requires `client_id`, - * `grant_type`, and `refresh_token`. - * - * @maps client_secret - */ - public function setClientSecret(?string $clientSecret): void - { - $this->clientSecret['value'] = $clientSecret; - } - - /** - * Unsets Client Secret. - * The Square-issued application secret for your application, which is available on the **OAuth** page - * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when - * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. - * com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to - * `authorization_code`. - * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE - * flow only requires `client_id`, - * `grant_type`, and `refresh_token`. - */ - public function unsetClientSecret(): void - { - $this->clientSecret = []; - } - - /** - * Returns Code. - * The authorization code to exchange. - * This code is required if `grant_type` is set to `authorization_code` to indicate that - * the application wants to exchange an authorization code for an OAuth access token. - */ - public function getCode(): ?string - { - if (count($this->code) == 0) { - return null; - } - return $this->code['value']; - } - - /** - * Sets Code. - * The authorization code to exchange. - * This code is required if `grant_type` is set to `authorization_code` to indicate that - * the application wants to exchange an authorization code for an OAuth access token. - * - * @maps code - */ - public function setCode(?string $code): void - { - $this->code['value'] = $code; - } - - /** - * Unsets Code. - * The authorization code to exchange. - * This code is required if `grant_type` is set to `authorization_code` to indicate that - * the application wants to exchange an authorization code for an OAuth access token. - */ - public function unsetCode(): void - { - $this->code = []; - } - - /** - * Returns Redirect Uri. - * The redirect URL assigned on the **OAuth** page for your application in the [Developer - * Dashboard](https://developer.squareup.com/apps). - */ - public function getRedirectUri(): ?string - { - if (count($this->redirectUri) == 0) { - return null; - } - return $this->redirectUri['value']; - } - - /** - * Sets Redirect Uri. - * The redirect URL assigned on the **OAuth** page for your application in the [Developer - * Dashboard](https://developer.squareup.com/apps). - * - * @maps redirect_uri - */ - public function setRedirectUri(?string $redirectUri): void - { - $this->redirectUri['value'] = $redirectUri; - } - - /** - * Unsets Redirect Uri. - * The redirect URL assigned on the **OAuth** page for your application in the [Developer - * Dashboard](https://developer.squareup.com/apps). - */ - public function unsetRedirectUri(): void - { - $this->redirectUri = []; - } - - /** - * Returns Grant Type. - * Specifies the method to request an OAuth access token. - * Valid values are `authorization_code`, `refresh_token`, and `migration_token`. - */ - public function getGrantType(): string - { - return $this->grantType; - } - - /** - * Sets Grant Type. - * Specifies the method to request an OAuth access token. - * Valid values are `authorization_code`, `refresh_token`, and `migration_token`. - * - * @required - * @maps grant_type - */ - public function setGrantType(string $grantType): void - { - $this->grantType = $grantType; - } - - /** - * Returns Refresh Token. - * A valid refresh token for generating a new OAuth access token. - * - * A valid refresh token is required if `grant_type` is set to `refresh_token` - * to indicate that the application wants a replacement for an expired OAuth access token. - */ - public function getRefreshToken(): ?string - { - if (count($this->refreshToken) == 0) { - return null; - } - return $this->refreshToken['value']; - } - - /** - * Sets Refresh Token. - * A valid refresh token for generating a new OAuth access token. - * - * A valid refresh token is required if `grant_type` is set to `refresh_token` - * to indicate that the application wants a replacement for an expired OAuth access token. - * - * @maps refresh_token - */ - public function setRefreshToken(?string $refreshToken): void - { - $this->refreshToken['value'] = $refreshToken; - } - - /** - * Unsets Refresh Token. - * A valid refresh token for generating a new OAuth access token. - * - * A valid refresh token is required if `grant_type` is set to `refresh_token` - * to indicate that the application wants a replacement for an expired OAuth access token. - */ - public function unsetRefreshToken(): void - { - $this->refreshToken = []; - } - - /** - * Returns Migration Token. - * A legacy OAuth access token obtained using a Connect API version prior - * to 2019-03-13. This parameter is required if `grant_type` is set to - * `migration_token` to indicate that the application wants to get a replacement - * OAuth access token. The response also returns a refresh token. - * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup. - * com/docs/oauth-api/migrate-to-refresh-tokens). - */ - public function getMigrationToken(): ?string - { - if (count($this->migrationToken) == 0) { - return null; - } - return $this->migrationToken['value']; - } - - /** - * Sets Migration Token. - * A legacy OAuth access token obtained using a Connect API version prior - * to 2019-03-13. This parameter is required if `grant_type` is set to - * `migration_token` to indicate that the application wants to get a replacement - * OAuth access token. The response also returns a refresh token. - * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup. - * com/docs/oauth-api/migrate-to-refresh-tokens). - * - * @maps migration_token - */ - public function setMigrationToken(?string $migrationToken): void - { - $this->migrationToken['value'] = $migrationToken; - } - - /** - * Unsets Migration Token. - * A legacy OAuth access token obtained using a Connect API version prior - * to 2019-03-13. This parameter is required if `grant_type` is set to - * `migration_token` to indicate that the application wants to get a replacement - * OAuth access token. The response also returns a refresh token. - * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup. - * com/docs/oauth-api/migrate-to-refresh-tokens). - */ - public function unsetMigrationToken(): void - { - $this->migrationToken = []; - } - - /** - * Returns Scopes. - * A JSON list of strings representing the permissions that the application is requesting. - * For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`". - * - * The access token returned in the response is granted the permissions - * that comprise the intersection between the requested list of permissions and those - * that belong to the provided refresh token. - * - * @return string[]|null - */ - public function getScopes(): ?array - { - if (count($this->scopes) == 0) { - return null; - } - return $this->scopes['value']; - } - - /** - * Sets Scopes. - * A JSON list of strings representing the permissions that the application is requesting. - * For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`". - * - * The access token returned in the response is granted the permissions - * that comprise the intersection between the requested list of permissions and those - * that belong to the provided refresh token. - * - * @maps scopes - * - * @param string[]|null $scopes - */ - public function setScopes(?array $scopes): void - { - $this->scopes['value'] = $scopes; - } - - /** - * Unsets Scopes. - * A JSON list of strings representing the permissions that the application is requesting. - * For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`". - * - * The access token returned in the response is granted the permissions - * that comprise the intersection between the requested list of permissions and those - * that belong to the provided refresh token. - */ - public function unsetScopes(): void - { - $this->scopes = []; - } - - /** - * Returns Short Lived. - * A Boolean indicating a request for a short-lived access token. - * - * The short-lived access token returned in the response expires in 24 hours. - */ - public function getShortLived(): ?bool - { - if (count($this->shortLived) == 0) { - return null; - } - return $this->shortLived['value']; - } - - /** - * Sets Short Lived. - * A Boolean indicating a request for a short-lived access token. - * - * The short-lived access token returned in the response expires in 24 hours. - * - * @maps short_lived - */ - public function setShortLived(?bool $shortLived): void - { - $this->shortLived['value'] = $shortLived; - } - - /** - * Unsets Short Lived. - * A Boolean indicating a request for a short-lived access token. - * - * The short-lived access token returned in the response expires in 24 hours. - */ - public function unsetShortLived(): void - { - $this->shortLived = []; - } - - /** - * Returns Code Verifier. - * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The - * `code_verifier` is used to verify against the - * `code_challenge` associated with the `authorization_code`. - */ - public function getCodeVerifier(): ?string - { - if (count($this->codeVerifier) == 0) { - return null; - } - return $this->codeVerifier['value']; - } - - /** - * Sets Code Verifier. - * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The - * `code_verifier` is used to verify against the - * `code_challenge` associated with the `authorization_code`. - * - * @maps code_verifier - */ - public function setCodeVerifier(?string $codeVerifier): void - { - $this->codeVerifier['value'] = $codeVerifier; - } - - /** - * Unsets Code Verifier. - * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The - * `code_verifier` is used to verify against the - * `code_challenge` associated with the `authorization_code`. - */ - public function unsetCodeVerifier(): void - { - $this->codeVerifier = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['client_id'] = $this->clientId; - if (!empty($this->clientSecret)) { - $json['client_secret'] = $this->clientSecret['value']; - } - if (!empty($this->code)) { - $json['code'] = $this->code['value']; - } - if (!empty($this->redirectUri)) { - $json['redirect_uri'] = $this->redirectUri['value']; - } - $json['grant_type'] = $this->grantType; - if (!empty($this->refreshToken)) { - $json['refresh_token'] = $this->refreshToken['value']; - } - if (!empty($this->migrationToken)) { - $json['migration_token'] = $this->migrationToken['value']; - } - if (!empty($this->scopes)) { - $json['scopes'] = $this->scopes['value']; - } - if (!empty($this->shortLived)) { - $json['short_lived'] = $this->shortLived['value']; - } - if (!empty($this->codeVerifier)) { - $json['code_verifier'] = $this->codeVerifier['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ObtainTokenResponse.php b/src/Models/ObtainTokenResponse.php deleted file mode 100644 index 37bd65db..00000000 --- a/src/Models/ObtainTokenResponse.php +++ /dev/null @@ -1,365 +0,0 @@ -accessToken; - } - - /** - * Sets Access Token. - * A valid OAuth access token. - * Provide the access token in a header with every request to Connect API - * endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup. - * com/docs/oauth-api/walkthrough). - * - * @maps access_token - */ - public function setAccessToken(?string $accessToken): void - { - $this->accessToken = $accessToken; - } - - /** - * Returns Token Type. - * This value is always _bearer_. - */ - public function getTokenType(): ?string - { - return $this->tokenType; - } - - /** - * Sets Token Type. - * This value is always _bearer_. - * - * @maps token_type - */ - public function setTokenType(?string $tokenType): void - { - $this->tokenType = $tokenType; - } - - /** - * Returns Expires At. - * The date when the `access_token` expires, in [ISO 8601](http://www.iso. - * org/iso/home/standards/iso8601.htm) format. - */ - public function getExpiresAt(): ?string - { - return $this->expiresAt; - } - - /** - * Sets Expires At. - * The date when the `access_token` expires, in [ISO 8601](http://www.iso. - * org/iso/home/standards/iso8601.htm) format. - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt = $expiresAt; - } - - /** - * Returns Merchant Id. - * The ID of the authorizing merchant's business. - */ - public function getMerchantId(): ?string - { - return $this->merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the authorizing merchant's business. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Subscription Id. - * __LEGACY FIELD__. The ID of a subscription plan the merchant signed up - * for. The ID is only present if the merchant signed up for a subscription plan during authorization. - */ - public function getSubscriptionId(): ?string - { - return $this->subscriptionId; - } - - /** - * Sets Subscription Id. - * __LEGACY FIELD__. The ID of a subscription plan the merchant signed up - * for. The ID is only present if the merchant signed up for a subscription plan during authorization. - * - * @maps subscription_id - */ - public function setSubscriptionId(?string $subscriptionId): void - { - $this->subscriptionId = $subscriptionId; - } - - /** - * Returns Plan Id. - * __LEGACY FIELD__. The ID of the subscription plan the merchant signed - * up for. The ID is only present if the merchant signed up for a subscription plan during - * authorization. - */ - public function getPlanId(): ?string - { - return $this->planId; - } - - /** - * Sets Plan Id. - * __LEGACY FIELD__. The ID of the subscription plan the merchant signed - * up for. The ID is only present if the merchant signed up for a subscription plan during - * authorization. - * - * @maps plan_id - */ - public function setPlanId(?string $planId): void - { - $this->planId = $planId; - } - - /** - * Returns Id Token. - * The OpenID token belonging to this person. This token is only present if the - * OPENID scope is included in the authorization request. - */ - public function getIdToken(): ?string - { - return $this->idToken; - } - - /** - * Sets Id Token. - * The OpenID token belonging to this person. This token is only present if the - * OPENID scope is included in the authorization request. - * - * @maps id_token - */ - public function setIdToken(?string $idToken): void - { - $this->idToken = $idToken; - } - - /** - * Returns Refresh Token. - * A refresh token. - * For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer. - * squareup.com/docs/oauth-api/refresh-revoke-limit-scope). - */ - public function getRefreshToken(): ?string - { - return $this->refreshToken; - } - - /** - * Sets Refresh Token. - * A refresh token. - * For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer. - * squareup.com/docs/oauth-api/refresh-revoke-limit-scope). - * - * @maps refresh_token - */ - public function setRefreshToken(?string $refreshToken): void - { - $this->refreshToken = $refreshToken; - } - - /** - * Returns Short Lived. - * A Boolean indicating that the access token is a short-lived access token. - * The short-lived access token returned in the response expires in 24 hours. - */ - public function getShortLived(): ?bool - { - return $this->shortLived; - } - - /** - * Sets Short Lived. - * A Boolean indicating that the access token is a short-lived access token. - * The short-lived access token returned in the response expires in 24 hours. - * - * @maps short_lived - */ - public function setShortLived(?bool $shortLived): void - { - $this->shortLived = $shortLived; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refresh Token Expires At. - * The date when the `refresh_token` expires, in [ISO 8601](http://www.iso. - * org/iso/home/standards/iso8601.htm) format. - */ - public function getRefreshTokenExpiresAt(): ?string - { - return $this->refreshTokenExpiresAt; - } - - /** - * Sets Refresh Token Expires At. - * The date when the `refresh_token` expires, in [ISO 8601](http://www.iso. - * org/iso/home/standards/iso8601.htm) format. - * - * @maps refresh_token_expires_at - */ - public function setRefreshTokenExpiresAt(?string $refreshTokenExpiresAt): void - { - $this->refreshTokenExpiresAt = $refreshTokenExpiresAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->accessToken)) { - $json['access_token'] = $this->accessToken; - } - if (isset($this->tokenType)) { - $json['token_type'] = $this->tokenType; - } - if (isset($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt; - } - if (isset($this->merchantId)) { - $json['merchant_id'] = $this->merchantId; - } - if (isset($this->subscriptionId)) { - $json['subscription_id'] = $this->subscriptionId; - } - if (isset($this->planId)) { - $json['plan_id'] = $this->planId; - } - if (isset($this->idToken)) { - $json['id_token'] = $this->idToken; - } - if (isset($this->refreshToken)) { - $json['refresh_token'] = $this->refreshToken; - } - if (isset($this->shortLived)) { - $json['short_lived'] = $this->shortLived; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refreshTokenExpiresAt)) { - $json['refresh_token_expires_at'] = $this->refreshTokenExpiresAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OfflinePaymentDetails.php b/src/Models/OfflinePaymentDetails.php deleted file mode 100644 index 28ba052f..00000000 --- a/src/Models/OfflinePaymentDetails.php +++ /dev/null @@ -1,60 +0,0 @@ -clientCreatedAt; - } - - /** - * Sets Client Created At. - * The client-side timestamp of when the offline payment was created, in RFC 3339 format. - * - * @maps client_created_at - */ - public function setClientCreatedAt(?string $clientCreatedAt): void - { - $this->clientCreatedAt = $clientCreatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->clientCreatedAt)) { - $json['client_created_at'] = $this->clientCreatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Order.php b/src/Models/Order.php deleted file mode 100644 index d0797e16..00000000 --- a/src/Models/Order.php +++ /dev/null @@ -1,1295 +0,0 @@ -locationId = $locationId; - } - - /** - * Returns Id. - * The order's unique ID. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The order's unique ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the seller location that this order is associated with. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the seller location that this order is associated with. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Reference Id. - * A client-specified ID to associate an entity in another system - * with this order. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A client-specified ID to associate an entity in another system - * with this order. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A client-specified ID to associate an entity in another system - * with this order. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Source. - * Represents the origination details of an order. - */ - public function getSource(): ?OrderSource - { - return $this->source; - } - - /** - * Sets Source. - * Represents the origination details of an order. - * - * @maps source - */ - public function setSource(?OrderSource $source): void - { - $this->source = $source; - } - - /** - * Returns Customer Id. - * The ID of the [customer]($m/Customer) associated with the order. - * - * You should specify a `customer_id` on the order (or the payment) to ensure that transactions - * are reliably linked to customers. Omitting this field might result in the creation of new - * [instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the [customer]($m/Customer) associated with the order. - * - * You should specify a `customer_id` on the order (or the payment) to ensure that transactions - * are reliably linked to customers. Omitting this field might result in the creation of new - * [instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the [customer]($m/Customer) associated with the order. - * - * You should specify a `customer_id` on the order (or the payment) to ensure that transactions - * are reliably linked to customers. Omitting this field might result in the creation of new - * [instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Line Items. - * The line items included in the order. - * - * @return OrderLineItem[]|null - */ - public function getLineItems(): ?array - { - if (count($this->lineItems) == 0) { - return null; - } - return $this->lineItems['value']; - } - - /** - * Sets Line Items. - * The line items included in the order. - * - * @maps line_items - * - * @param OrderLineItem[]|null $lineItems - */ - public function setLineItems(?array $lineItems): void - { - $this->lineItems['value'] = $lineItems; - } - - /** - * Unsets Line Items. - * The line items included in the order. - */ - public function unsetLineItems(): void - { - $this->lineItems = []; - } - - /** - * Returns Taxes. - * The list of all taxes associated with the order. - * - * Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an - * `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes - * with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item. - * - * On reads, each tax in the list includes the total amount of that tax applied to the order. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated - * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` - * instead. - * - * @return OrderLineItemTax[]|null - */ - public function getTaxes(): ?array - { - if (count($this->taxes) == 0) { - return null; - } - return $this->taxes['value']; - } - - /** - * Sets Taxes. - * The list of all taxes associated with the order. - * - * Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an - * `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes - * with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item. - * - * On reads, each tax in the list includes the total amount of that tax applied to the order. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated - * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` - * instead. - * - * @maps taxes - * - * @param OrderLineItemTax[]|null $taxes - */ - public function setTaxes(?array $taxes): void - { - $this->taxes['value'] = $taxes; - } - - /** - * Unsets Taxes. - * The list of all taxes associated with the order. - * - * Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an - * `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes - * with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item. - * - * On reads, each tax in the list includes the total amount of that tax applied to the order. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated - * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` - * instead. - */ - public function unsetTaxes(): void - { - $this->taxes = []; - } - - /** - * Returns Discounts. - * The list of all discounts associated with the order. - * - * Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, - * an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. - * For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount` - * for every line item. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated - * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` - * instead. - * - * @return OrderLineItemDiscount[]|null - */ - public function getDiscounts(): ?array - { - if (count($this->discounts) == 0) { - return null; - } - return $this->discounts['value']; - } - - /** - * Sets Discounts. - * The list of all discounts associated with the order. - * - * Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, - * an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. - * For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount` - * for every line item. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated - * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` - * instead. - * - * @maps discounts - * - * @param OrderLineItemDiscount[]|null $discounts - */ - public function setDiscounts(?array $discounts): void - { - $this->discounts['value'] = $discounts; - } - - /** - * Unsets Discounts. - * The list of all discounts associated with the order. - * - * Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, - * an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. - * For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount` - * for every line item. - * - * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated - * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` - * instead. - */ - public function unsetDiscounts(): void - { - $this->discounts = []; - } - - /** - * Returns Service Charges. - * A list of service charges applied to the order. - * - * @return OrderServiceCharge[]|null - */ - public function getServiceCharges(): ?array - { - if (count($this->serviceCharges) == 0) { - return null; - } - return $this->serviceCharges['value']; - } - - /** - * Sets Service Charges. - * A list of service charges applied to the order. - * - * @maps service_charges - * - * @param OrderServiceCharge[]|null $serviceCharges - */ - public function setServiceCharges(?array $serviceCharges): void - { - $this->serviceCharges['value'] = $serviceCharges; - } - - /** - * Unsets Service Charges. - * A list of service charges applied to the order. - */ - public function unsetServiceCharges(): void - { - $this->serviceCharges = []; - } - - /** - * Returns Fulfillments. - * Details about order fulfillment. - * - * Orders can only be created with at most one fulfillment. However, orders returned - * by the API might contain multiple fulfillments. - * - * @return Fulfillment[]|null - */ - public function getFulfillments(): ?array - { - if (count($this->fulfillments) == 0) { - return null; - } - return $this->fulfillments['value']; - } - - /** - * Sets Fulfillments. - * Details about order fulfillment. - * - * Orders can only be created with at most one fulfillment. However, orders returned - * by the API might contain multiple fulfillments. - * - * @maps fulfillments - * - * @param Fulfillment[]|null $fulfillments - */ - public function setFulfillments(?array $fulfillments): void - { - $this->fulfillments['value'] = $fulfillments; - } - - /** - * Unsets Fulfillments. - * Details about order fulfillment. - * - * Orders can only be created with at most one fulfillment. However, orders returned - * by the API might contain multiple fulfillments. - */ - public function unsetFulfillments(): void - { - $this->fulfillments = []; - } - - /** - * Returns Returns. - * A collection of items from sale orders being returned in this one. Normally part of an - * itemized return or exchange. There is exactly one `Return` object per sale `Order` being - * referenced. - * - * @return OrderReturn[]|null - */ - public function getReturns(): ?array - { - return $this->returns; - } - - /** - * Sets Returns. - * A collection of items from sale orders being returned in this one. Normally part of an - * itemized return or exchange. There is exactly one `Return` object per sale `Order` being - * referenced. - * - * @maps returns - * - * @param OrderReturn[]|null $returns - */ - public function setReturns(?array $returns): void - { - $this->returns = $returns; - } - - /** - * Returns Return Amounts. - * A collection of various money amounts. - */ - public function getReturnAmounts(): ?OrderMoneyAmounts - { - return $this->returnAmounts; - } - - /** - * Sets Return Amounts. - * A collection of various money amounts. - * - * @maps return_amounts - */ - public function setReturnAmounts(?OrderMoneyAmounts $returnAmounts): void - { - $this->returnAmounts = $returnAmounts; - } - - /** - * Returns Net Amounts. - * A collection of various money amounts. - */ - public function getNetAmounts(): ?OrderMoneyAmounts - { - return $this->netAmounts; - } - - /** - * Sets Net Amounts. - * A collection of various money amounts. - * - * @maps net_amounts - */ - public function setNetAmounts(?OrderMoneyAmounts $netAmounts): void - { - $this->netAmounts = $netAmounts; - } - - /** - * Returns Rounding Adjustment. - * A rounding adjustment of the money being returned. Commonly used to apply cash rounding - * when the minimum unit of the account is smaller than the lowest physical denomination of the - * currency. - */ - public function getRoundingAdjustment(): ?OrderRoundingAdjustment - { - return $this->roundingAdjustment; - } - - /** - * Sets Rounding Adjustment. - * A rounding adjustment of the money being returned. Commonly used to apply cash rounding - * when the minimum unit of the account is smaller than the lowest physical denomination of the - * currency. - * - * @maps rounding_adjustment - */ - public function setRoundingAdjustment(?OrderRoundingAdjustment $roundingAdjustment): void - { - $this->roundingAdjustment = $roundingAdjustment; - } - - /** - * Returns Tenders. - * The tenders that were used to pay for the order. - * - * @return Tender[]|null - */ - public function getTenders(): ?array - { - return $this->tenders; - } - - /** - * Sets Tenders. - * The tenders that were used to pay for the order. - * - * @maps tenders - * - * @param Tender[]|null $tenders - */ - public function setTenders(?array $tenders): void - { - $this->tenders = $tenders; - } - - /** - * Returns Refunds. - * The refunds that are part of this order. - * - * @return Refund[]|null - */ - public function getRefunds(): ?array - { - return $this->refunds; - } - - /** - * Sets Refunds. - * The refunds that are part of this order. - * - * @maps refunds - * - * @param Refund[]|null $refunds - */ - public function setRefunds(?array $refunds): void - { - $this->refunds = $refunds; - } - - /** - * Returns Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Created At. - * The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016- - * 09-04T23:59:33.123Z"). - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016- - * 09-04T23:59:33.123Z"). - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, - * "2016-09-04T23:59:33.123Z"). - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, - * "2016-09-04T23:59:33.123Z"). - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Closed At. - * The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format - * (for example "2016-09-04T23:59:33.123Z"). - */ - public function getClosedAt(): ?string - { - return $this->closedAt; - } - - /** - * Sets Closed At. - * The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format - * (for example "2016-09-04T23:59:33.123Z"). - * - * @maps closed_at - */ - public function setClosedAt(?string $closedAt): void - { - $this->closedAt = $closedAt; - } - - /** - * Returns State. - * The state of the order. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The state of the order. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTaxMoney(): ?Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalDiscountMoney(): ?Money - { - return $this->totalDiscountMoney; - } - - /** - * Sets Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_discount_money - */ - public function setTotalDiscountMoney(?Money $totalDiscountMoney): void - { - $this->totalDiscountMoney = $totalDiscountMoney; - } - - /** - * Returns Total Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTipMoney(): ?Money - { - return $this->totalTipMoney; - } - - /** - * Sets Total Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tip_money - */ - public function setTotalTipMoney(?Money $totalTipMoney): void - { - $this->totalTipMoney = $totalTipMoney; - } - - /** - * Returns Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalServiceChargeMoney(): ?Money - { - return $this->totalServiceChargeMoney; - } - - /** - * Sets Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_service_charge_money - */ - public function setTotalServiceChargeMoney(?Money $totalServiceChargeMoney): void - { - $this->totalServiceChargeMoney = $totalServiceChargeMoney; - } - - /** - * Returns Ticket Name. - * A short-term identifier for the order (such as a customer first name, - * table number, or auto-generated order number that resets daily). - */ - public function getTicketName(): ?string - { - if (count($this->ticketName) == 0) { - return null; - } - return $this->ticketName['value']; - } - - /** - * Sets Ticket Name. - * A short-term identifier for the order (such as a customer first name, - * table number, or auto-generated order number that resets daily). - * - * @maps ticket_name - */ - public function setTicketName(?string $ticketName): void - { - $this->ticketName['value'] = $ticketName; - } - - /** - * Unsets Ticket Name. - * A short-term identifier for the order (such as a customer first name, - * table number, or auto-generated order number that resets daily). - */ - public function unsetTicketName(): void - { - $this->ticketName = []; - } - - /** - * Returns Pricing Options. - * Pricing options for an order. The options affect how the order's price is calculated. - * They can be used, for example, to apply automatic price adjustments that are based on preconfigured - * [pricing rules]($m/CatalogPricingRule). - */ - public function getPricingOptions(): ?OrderPricingOptions - { - return $this->pricingOptions; - } - - /** - * Sets Pricing Options. - * Pricing options for an order. The options affect how the order's price is calculated. - * They can be used, for example, to apply automatic price adjustments that are based on preconfigured - * [pricing rules]($m/CatalogPricingRule). - * - * @maps pricing_options - */ - public function setPricingOptions(?OrderPricingOptions $pricingOptions): void - { - $this->pricingOptions = $pricingOptions; - } - - /** - * Returns Rewards. - * A set-like list of Rewards that have been added to the Order. - * - * @return OrderReward[]|null - */ - public function getRewards(): ?array - { - return $this->rewards; - } - - /** - * Sets Rewards. - * A set-like list of Rewards that have been added to the Order. - * - * @maps rewards - * - * @param OrderReward[]|null $rewards - */ - public function setRewards(?array $rewards): void - { - $this->rewards = $rewards; - } - - /** - * Returns Net Amount Due Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getNetAmountDueMoney(): ?Money - { - return $this->netAmountDueMoney; - } - - /** - * Sets Net Amount Due Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps net_amount_due_money - */ - public function setNetAmountDueMoney(?Money $netAmountDueMoney): void - { - $this->netAmountDueMoney = $netAmountDueMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['location_id'] = $this->locationId; - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->lineItems)) { - $json['line_items'] = $this->lineItems['value']; - } - if (!empty($this->taxes)) { - $json['taxes'] = $this->taxes['value']; - } - if (!empty($this->discounts)) { - $json['discounts'] = $this->discounts['value']; - } - if (!empty($this->serviceCharges)) { - $json['service_charges'] = $this->serviceCharges['value']; - } - if (!empty($this->fulfillments)) { - $json['fulfillments'] = $this->fulfillments['value']; - } - if (isset($this->returns)) { - $json['returns'] = $this->returns; - } - if (isset($this->returnAmounts)) { - $json['return_amounts'] = $this->returnAmounts; - } - if (isset($this->netAmounts)) { - $json['net_amounts'] = $this->netAmounts; - } - if (isset($this->roundingAdjustment)) { - $json['rounding_adjustment'] = $this->roundingAdjustment; - } - if (isset($this->tenders)) { - $json['tenders'] = $this->tenders; - } - if (isset($this->refunds)) { - $json['refunds'] = $this->refunds; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->closedAt)) { - $json['closed_at'] = $this->closedAt; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->totalDiscountMoney)) { - $json['total_discount_money'] = $this->totalDiscountMoney; - } - if (isset($this->totalTipMoney)) { - $json['total_tip_money'] = $this->totalTipMoney; - } - if (isset($this->totalServiceChargeMoney)) { - $json['total_service_charge_money'] = $this->totalServiceChargeMoney; - } - if (!empty($this->ticketName)) { - $json['ticket_name'] = $this->ticketName['value']; - } - if (isset($this->pricingOptions)) { - $json['pricing_options'] = $this->pricingOptions; - } - if (isset($this->rewards)) { - $json['rewards'] = $this->rewards; - } - if (isset($this->netAmountDueMoney)) { - $json['net_amount_due_money'] = $this->netAmountDueMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderCreated.php b/src/Models/OrderCreated.php deleted file mode 100644 index 102740a2..00000000 --- a/src/Models/OrderCreated.php +++ /dev/null @@ -1,203 +0,0 @@ -orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The order's unique ID. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The order's unique ID. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The ID of the seller location that this order is associated with. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the seller location that this order is associated with. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the seller location that this order is associated with. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns State. - * The state of the order. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The state of the order. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Created At. - * The timestamp for when the order was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the order was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderCreatedObject.php b/src/Models/OrderCreatedObject.php deleted file mode 100644 index 263774c2..00000000 --- a/src/Models/OrderCreatedObject.php +++ /dev/null @@ -1,55 +0,0 @@ -orderCreated; - } - - /** - * Sets Order Created. - * - * @maps order_created - */ - public function setOrderCreated(?OrderCreated $orderCreated): void - { - $this->orderCreated = $orderCreated; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orderCreated)) { - $json['order_created'] = $this->orderCreated; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderEntry.php b/src/Models/OrderEntry.php deleted file mode 100644 index 70ecbe3e..00000000 --- a/src/Models/OrderEntry.php +++ /dev/null @@ -1,151 +0,0 @@ -orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the order. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the order. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The location ID the order belongs to. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location ID the order belongs to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location ID the order belongs to. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillment.php b/src/Models/OrderFulfillment.php deleted file mode 100644 index 72b0bd59..00000000 --- a/src/Models/OrderFulfillment.php +++ /dev/null @@ -1,373 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the fulfillment only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the fulfillment only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Type. - * The type of fulfillment. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * The type of fulfillment. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns State. - * The current state of this fulfillment. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The current state of this fulfillment. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Line Item Application. - * The `line_item_application` describes what order line items this fulfillment applies - * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - */ - public function getLineItemApplication(): ?string - { - return $this->lineItemApplication; - } - - /** - * Sets Line Item Application. - * The `line_item_application` describes what order line items this fulfillment applies - * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. - * - * @maps line_item_application - */ - public function setLineItemApplication(?string $lineItemApplication): void - { - $this->lineItemApplication = $lineItemApplication; - } - - /** - * Returns Entries. - * A list of entries pertaining to the fulfillment of an order. Each entry must reference - * a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to - * fulfill. - * Multiple entries can reference the same line item `uid`, as long as the total quantity among - * all fulfillment entries referencing a single line item does not exceed the quantity of the - * order's line item itself. - * An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, - * `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently - * before order completion. - * - * @return OrderFulfillmentFulfillmentEntry[]|null - */ - public function getEntries(): ?array - { - return $this->entries; - } - - /** - * Sets Entries. - * A list of entries pertaining to the fulfillment of an order. Each entry must reference - * a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to - * fulfill. - * Multiple entries can reference the same line item `uid`, as long as the total quantity among - * all fulfillment entries referencing a single line item does not exceed the quantity of the - * order's line item itself. - * An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, - * `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently - * before order completion. - * - * @maps entries - * - * @param OrderFulfillmentFulfillmentEntry[]|null $entries - */ - public function setEntries(?array $entries): void - { - $this->entries = $entries; - } - - /** - * Returns Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this fulfillment. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Pickup Details. - * Contains details necessary to fulfill a pickup order. - */ - public function getPickupDetails(): ?OrderFulfillmentPickupDetails - { - return $this->pickupDetails; - } - - /** - * Sets Pickup Details. - * Contains details necessary to fulfill a pickup order. - * - * @maps pickup_details - */ - public function setPickupDetails(?OrderFulfillmentPickupDetails $pickupDetails): void - { - $this->pickupDetails = $pickupDetails; - } - - /** - * Returns Shipment Details. - * Contains the details necessary to fulfill a shipment order. - */ - public function getShipmentDetails(): ?OrderFulfillmentShipmentDetails - { - return $this->shipmentDetails; - } - - /** - * Sets Shipment Details. - * Contains the details necessary to fulfill a shipment order. - * - * @maps shipment_details - */ - public function setShipmentDetails(?OrderFulfillmentShipmentDetails $shipmentDetails): void - { - $this->shipmentDetails = $shipmentDetails; - } - - /** - * Returns Delivery Details. - * Describes delivery details of an order fulfillment. - */ - public function getDeliveryDetails(): ?OrderFulfillmentDeliveryDetails - { - return $this->deliveryDetails; - } - - /** - * Sets Delivery Details. - * Describes delivery details of an order fulfillment. - * - * @maps delivery_details - */ - public function setDeliveryDetails(?OrderFulfillmentDeliveryDetails $deliveryDetails): void - { - $this->deliveryDetails = $deliveryDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->lineItemApplication)) { - $json['line_item_application'] = $this->lineItemApplication; - } - if (isset($this->entries)) { - $json['entries'] = $this->entries; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->pickupDetails)) { - $json['pickup_details'] = $this->pickupDetails; - } - if (isset($this->shipmentDetails)) { - $json['shipment_details'] = $this->shipmentDetails; - } - if (isset($this->deliveryDetails)) { - $json['delivery_details'] = $this->deliveryDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentDeliveryDetails.php b/src/Models/OrderFulfillmentDeliveryDetails.php deleted file mode 100644 index 72ab286f..00000000 --- a/src/Models/OrderFulfillmentDeliveryDetails.php +++ /dev/null @@ -1,960 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?OrderFulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Schedule Type. - * The schedule type of the delivery fulfillment. - */ - public function getScheduleType(): ?string - { - return $this->scheduleType; - } - - /** - * Sets Schedule Type. - * The schedule type of the delivery fulfillment. - * - * @maps schedule_type - */ - public function setScheduleType(?string $scheduleType): void - { - $this->scheduleType = $scheduleType; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getDeliverAt(): ?string - { - if (count($this->deliverAt) == 0) { - return null; - } - return $this->deliverAt['value']; - } - - /** - * Sets Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps deliver_at - */ - public function setDeliverAt(?string $deliverAt): void - { - $this->deliverAt['value'] = $deliverAt; - } - - /** - * Unsets Deliver At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the - * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). - * - * The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetDeliverAt(): void - { - $this->deliverAt = []; - } - - /** - * Returns Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getPrepTimeDuration(): ?string - { - if (count($this->prepTimeDuration) == 0) { - return null; - } - return $this->prepTimeDuration['value']; - } - - /** - * Sets Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps prep_time_duration - */ - public function setPrepTimeDuration(?string $prepTimeDuration): void - { - $this->prepTimeDuration['value'] = $prepTimeDuration; - } - - /** - * Unsets Prep Time Duration. - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetPrepTimeDuration(): void - { - $this->prepTimeDuration = []; - } - - /** - * Returns Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getDeliveryWindowDuration(): ?string - { - if (count($this->deliveryWindowDuration) == 0) { - return null; - } - return $this->deliveryWindowDuration['value']; - } - - /** - * Sets Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps delivery_window_duration - */ - public function setDeliveryWindowDuration(?string $deliveryWindowDuration): void - { - $this->deliveryWindowDuration['value'] = $deliveryWindowDuration; - } - - /** - * Unsets Delivery Window Duration. - * The time period after `deliver_at` in which to deliver the order. - * Applications can set this field when the fulfillment `state` is - * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state - * such as `COMPLETED`, `CANCELED`, and `FAILED`). - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetDeliveryWindowDuration(): void - { - $this->deliveryWindowDuration = []; - } - - /** - * Returns Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * Provides additional instructions about the delivery fulfillment. - * It is displayed in the Square Point of Sale application and set by the API. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCompletedAt(): ?string - { - if (count($this->completedAt) == 0) { - return null; - } - return $this->completedAt['value']; - } - - /** - * Sets Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps completed_at - */ - public function setCompletedAt(?string $completedAt): void - { - $this->completedAt['value'] = $completedAt; - } - - /** - * Unsets Completed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller completed the fulfillment. - * This field is automatically set when fulfillment `state` changes to `COMPLETED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCompletedAt(): void - { - $this->completedAt = []; - } - - /** - * Returns In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller started processing the fulfillment. - * This field is automatically set when the fulfillment `state` changes to `RESERVED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getInProgressAt(): ?string - { - return $this->inProgressAt; - } - - /** - * Sets In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicates when the seller started processing the fulfillment. - * This field is automatically set when the fulfillment `state` changes to `RESERVED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps in_progress_at - */ - public function setInProgressAt(?string $inProgressAt): void - { - $this->inProgressAt = $inProgressAt; - } - - /** - * Returns Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. This field is - * automatically set when the fulfillment `state` changes to `FAILED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getRejectedAt(): ?string - { - return $this->rejectedAt; - } - - /** - * Sets Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. This field is - * automatically set when the fulfillment `state` changes to `FAILED`. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps rejected_at - */ - public function setRejectedAt(?string $rejectedAt): void - { - $this->rejectedAt = $rejectedAt; - } - - /** - * Returns Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the seller marked the fulfillment as ready for - * courier pickup. This field is automatically set when the fulfillment `state` changes - * to PREPARED. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getReadyAt(): ?string - { - return $this->readyAt; - } - - /** - * Sets Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the seller marked the fulfillment as ready for - * courier pickup. This field is automatically set when the fulfillment `state` changes - * to PREPARED. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps ready_at - */ - public function setReadyAt(?string $readyAt): void - { - $this->readyAt = $readyAt; - } - - /** - * Returns Delivered At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was delivered to the recipient. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getDeliveredAt(): ?string - { - return $this->deliveredAt; - } - - /** - * Sets Delivered At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was delivered to the recipient. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps delivered_at - */ - public function setDeliveredAt(?string $deliveredAt): void - { - $this->deliveredAt = $deliveredAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. This field is automatically - * set when the fulfillment `state` changes to `CANCELED`. - * - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - return $this->canceledAt; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. This field is automatically - * set when the fulfillment `state` changes to `CANCELED`. - * - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt = $canceledAt; - } - - /** - * Returns Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * The delivery cancellation reason. Max length: 100 characters. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCourierPickupAt(): ?string - { - if (count($this->courierPickupAt) == 0) { - return null; - } - return $this->courierPickupAt['value']; - } - - /** - * Sets Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps courier_pickup_at - */ - public function setCourierPickupAt(?string $courierPickupAt): void - { - $this->courierPickupAt['value'] = $courierPickupAt; - } - - /** - * Unsets Courier Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when an order can be picked up by the courier for delivery. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCourierPickupAt(): void - { - $this->courierPickupAt = []; - } - - /** - * Returns Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getCourierPickupWindowDuration(): ?string - { - if (count($this->courierPickupWindowDuration) == 0) { - return null; - } - return $this->courierPickupWindowDuration['value']; - } - - /** - * Sets Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps courier_pickup_window_duration - */ - public function setCourierPickupWindowDuration(?string $courierPickupWindowDuration): void - { - $this->courierPickupWindowDuration['value'] = $courierPickupWindowDuration; - } - - /** - * Unsets Courier Pickup Window Duration. - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetCourierPickupWindowDuration(): void - { - $this->courierPickupWindowDuration = []; - } - - /** - * Returns Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - */ - public function getIsNoContactDelivery(): ?bool - { - if (count($this->isNoContactDelivery) == 0) { - return null; - } - return $this->isNoContactDelivery['value']; - } - - /** - * Sets Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - * - * @maps is_no_contact_delivery - */ - public function setIsNoContactDelivery(?bool $isNoContactDelivery): void - { - $this->isNoContactDelivery['value'] = $isNoContactDelivery; - } - - /** - * Unsets Is No Contact Delivery. - * Whether the delivery is preferred to be no contact. - */ - public function unsetIsNoContactDelivery(): void - { - $this->isNoContactDelivery = []; - } - - /** - * Returns Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - */ - public function getDropoffNotes(): ?string - { - if (count($this->dropoffNotes) == 0) { - return null; - } - return $this->dropoffNotes['value']; - } - - /** - * Sets Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - * - * @maps dropoff_notes - */ - public function setDropoffNotes(?string $dropoffNotes): void - { - $this->dropoffNotes['value'] = $dropoffNotes; - } - - /** - * Unsets Dropoff Notes. - * A note to provide additional instructions about how to deliver the order. - */ - public function unsetDropoffNotes(): void - { - $this->dropoffNotes = []; - } - - /** - * Returns Courier Provider Name. - * The name of the courier provider. - */ - public function getCourierProviderName(): ?string - { - if (count($this->courierProviderName) == 0) { - return null; - } - return $this->courierProviderName['value']; - } - - /** - * Sets Courier Provider Name. - * The name of the courier provider. - * - * @maps courier_provider_name - */ - public function setCourierProviderName(?string $courierProviderName): void - { - $this->courierProviderName['value'] = $courierProviderName; - } - - /** - * Unsets Courier Provider Name. - * The name of the courier provider. - */ - public function unsetCourierProviderName(): void - { - $this->courierProviderName = []; - } - - /** - * Returns Courier Support Phone Number. - * The support phone number of the courier. - */ - public function getCourierSupportPhoneNumber(): ?string - { - if (count($this->courierSupportPhoneNumber) == 0) { - return null; - } - return $this->courierSupportPhoneNumber['value']; - } - - /** - * Sets Courier Support Phone Number. - * The support phone number of the courier. - * - * @maps courier_support_phone_number - */ - public function setCourierSupportPhoneNumber(?string $courierSupportPhoneNumber): void - { - $this->courierSupportPhoneNumber['value'] = $courierSupportPhoneNumber; - } - - /** - * Unsets Courier Support Phone Number. - * The support phone number of the courier. - */ - public function unsetCourierSupportPhoneNumber(): void - { - $this->courierSupportPhoneNumber = []; - } - - /** - * Returns Square Delivery Id. - * The identifier for the delivery created by Square. - */ - public function getSquareDeliveryId(): ?string - { - if (count($this->squareDeliveryId) == 0) { - return null; - } - return $this->squareDeliveryId['value']; - } - - /** - * Sets Square Delivery Id. - * The identifier for the delivery created by Square. - * - * @maps square_delivery_id - */ - public function setSquareDeliveryId(?string $squareDeliveryId): void - { - $this->squareDeliveryId['value'] = $squareDeliveryId; - } - - /** - * Unsets Square Delivery Id. - * The identifier for the delivery created by Square. - */ - public function unsetSquareDeliveryId(): void - { - $this->squareDeliveryId = []; - } - - /** - * Returns External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - */ - public function getExternalDeliveryId(): ?string - { - if (count($this->externalDeliveryId) == 0) { - return null; - } - return $this->externalDeliveryId['value']; - } - - /** - * Sets External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - * - * @maps external_delivery_id - */ - public function setExternalDeliveryId(?string $externalDeliveryId): void - { - $this->externalDeliveryId['value'] = $externalDeliveryId; - } - - /** - * Unsets External Delivery Id. - * The identifier for the delivery created by the third-party courier service. - */ - public function unsetExternalDeliveryId(): void - { - $this->externalDeliveryId = []; - } - - /** - * Returns Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - */ - public function getManagedDelivery(): ?bool - { - if (count($this->managedDelivery) == 0) { - return null; - } - return $this->managedDelivery['value']; - } - - /** - * Sets Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - * - * @maps managed_delivery - */ - public function setManagedDelivery(?bool $managedDelivery): void - { - $this->managedDelivery['value'] = $managedDelivery; - } - - /** - * Unsets Managed Delivery. - * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means - * we may not receive all recipient information for PII purposes. - */ - public function unsetManagedDelivery(): void - { - $this->managedDelivery = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (isset($this->scheduleType)) { - $json['schedule_type'] = $this->scheduleType; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (!empty($this->deliverAt)) { - $json['deliver_at'] = $this->deliverAt['value']; - } - if (!empty($this->prepTimeDuration)) { - $json['prep_time_duration'] = $this->prepTimeDuration['value']; - } - if (!empty($this->deliveryWindowDuration)) { - $json['delivery_window_duration'] = $this->deliveryWindowDuration['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->completedAt)) { - $json['completed_at'] = $this->completedAt['value']; - } - if (isset($this->inProgressAt)) { - $json['in_progress_at'] = $this->inProgressAt; - } - if (isset($this->rejectedAt)) { - $json['rejected_at'] = $this->rejectedAt; - } - if (isset($this->readyAt)) { - $json['ready_at'] = $this->readyAt; - } - if (isset($this->deliveredAt)) { - $json['delivered_at'] = $this->deliveredAt; - } - if (isset($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (!empty($this->courierPickupAt)) { - $json['courier_pickup_at'] = $this->courierPickupAt['value']; - } - if (!empty($this->courierPickupWindowDuration)) { - $json['courier_pickup_window_duration'] = $this->courierPickupWindowDuration['value']; - } - if (!empty($this->isNoContactDelivery)) { - $json['is_no_contact_delivery'] = $this->isNoContactDelivery['value']; - } - if (!empty($this->dropoffNotes)) { - $json['dropoff_notes'] = $this->dropoffNotes['value']; - } - if (!empty($this->courierProviderName)) { - $json['courier_provider_name'] = $this->courierProviderName['value']; - } - if (!empty($this->courierSupportPhoneNumber)) { - $json['courier_support_phone_number'] = $this->courierSupportPhoneNumber['value']; - } - if (!empty($this->squareDeliveryId)) { - $json['square_delivery_id'] = $this->squareDeliveryId['value']; - } - if (!empty($this->externalDeliveryId)) { - $json['external_delivery_id'] = $this->externalDeliveryId['value']; - } - if (!empty($this->managedDelivery)) { - $json['managed_delivery'] = $this->managedDelivery['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentDeliveryDetailsScheduleType.php b/src/Models/OrderFulfillmentDeliveryDetailsScheduleType.php deleted file mode 100644 index 04302984..00000000 --- a/src/Models/OrderFulfillmentDeliveryDetailsScheduleType.php +++ /dev/null @@ -1,22 +0,0 @@ -lineItemUid = $lineItemUid; - $this->quantity = $quantity; - } - - /** - * Returns Uid. - * A unique ID that identifies the fulfillment entry only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the fulfillment entry only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the fulfillment entry only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Line Item Uid. - * The `uid` from the order line item. - */ - public function getLineItemUid(): string - { - return $this->lineItemUid; - } - - /** - * Sets Line Item Uid. - * The `uid` from the order line item. - * - * @required - * @maps line_item_uid - */ - public function setLineItemUid(string $lineItemUid): void - { - $this->lineItemUid = $lineItemUid; - } - - /** - * Returns Quantity. - * The quantity of the line item being fulfilled, formatted as a decimal number. - * For example, `"3"`. - * Fulfillments for line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - */ - public function getQuantity(): string - { - return $this->quantity; - } - - /** - * Sets Quantity. - * The quantity of the line item being fulfilled, formatted as a decimal number. - * For example, `"3"`. - * Fulfillments for line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - * - * @required - * @maps quantity - */ - public function setQuantity(string $quantity): void - { - $this->quantity = $quantity; - } - - /** - * Returns Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this fulfillment entry. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * Values have a maximum length of 255 characters. - * An application can have up to 10 entries per metadata field. - * Entries written by applications are private and can only be read or modified by the same - * application. - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['line_item_uid'] = $this->lineItemUid; - $json['quantity'] = $this->quantity; - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentFulfillmentLineItemApplication.php b/src/Models/OrderFulfillmentFulfillmentLineItemApplication.php deleted file mode 100644 index 98f58b26..00000000 --- a/src/Models/OrderFulfillmentFulfillmentLineItemApplication.php +++ /dev/null @@ -1,22 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?OrderFulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - */ - public function getExpiresAt(): ?string - { - if (count($this->expiresAt) == 0) { - return null; - } - return $this->expiresAt['value']; - } - - /** - * Sets Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt['value'] = $expiresAt; - } - - /** - * Unsets Expires At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment expires if it is not marked in progress. The timestamp must be - * in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set - * up to 7 days in the future. If `expires_at` is not set, any new payments attached to the order - * are automatically completed. - */ - public function unsetExpiresAt(): void - { - $this->expiresAt = []; - } - - /** - * Returns Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - */ - public function getAutoCompleteDuration(): ?string - { - if (count($this->autoCompleteDuration) == 0) { - return null; - } - return $this->autoCompleteDuration['value']; - } - - /** - * Sets Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - * - * @maps auto_complete_duration - */ - public function setAutoCompleteDuration(?string $autoCompleteDuration): void - { - $this->autoCompleteDuration['value'] = $autoCompleteDuration; - } - - /** - * Unsets Auto Complete Duration. - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * If not set, this pickup fulfillment remains in progress until it is canceled or completed. - */ - public function unsetAutoCompleteDuration(): void - { - $this->autoCompleteDuration = []; - } - - /** - * Returns Schedule Type. - * The schedule type of the pickup fulfillment. - */ - public function getScheduleType(): ?string - { - return $this->scheduleType; - } - - /** - * Sets Schedule Type. - * The schedule type of the pickup fulfillment. - * - * @maps schedule_type - */ - public function setScheduleType(?string $scheduleType): void - { - $this->scheduleType = $scheduleType; - } - - /** - * Returns Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - */ - public function getPickupAt(): ?string - { - if (count($this->pickupAt) == 0) { - return null; - } - return $this->pickupAt['value']; - } - - /** - * Sets Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - * - * @maps pickup_at - */ - public function setPickupAt(?string $pickupAt): void - { - $this->pickupAt['value'] = $pickupAt; - } - - /** - * Unsets Pickup At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., - * "2016-09-04T23:59:33.123Z". - * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. - */ - public function unsetPickupAt(): void - { - $this->pickupAt = []; - } - - /** - * Returns Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - */ - public function getPickupWindowDuration(): ?string - { - if (count($this->pickupWindowDuration) == 0) { - return null; - } - return $this->pickupWindowDuration['value']; - } - - /** - * Sets Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - * - * @maps pickup_window_duration - */ - public function setPickupWindowDuration(?string $pickupWindowDuration): void - { - $this->pickupWindowDuration['value'] = $pickupWindowDuration; - } - - /** - * Unsets Pickup Window Duration. - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. - */ - public function unsetPickupWindowDuration(): void - { - $this->pickupWindowDuration = []; - } - - /** - * Returns Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function getPrepTimeDuration(): ?string - { - if (count($this->prepTimeDuration) == 0) { - return null; - } - return $this->prepTimeDuration['value']; - } - - /** - * Sets Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - * - * @maps prep_time_duration - */ - public function setPrepTimeDuration(?string $prepTimeDuration): void - { - $this->prepTimeDuration['value'] = $prepTimeDuration; - } - - /** - * Unsets Prep Time Duration. - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). - */ - public function unsetPrepTimeDuration(): void - { - $this->prepTimeDuration = []; - } - - /** - * Returns Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A note to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale application and set by the API. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns Accepted At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getAcceptedAt(): ?string - { - return $this->acceptedAt; - } - - /** - * Sets Accepted At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps accepted_at - */ - public function setAcceptedAt(?string $acceptedAt): void - { - $this->acceptedAt = $acceptedAt; - } - - /** - * Returns Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getRejectedAt(): ?string - { - return $this->rejectedAt; - } - - /** - * Sets Rejected At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps rejected_at - */ - public function setRejectedAt(?string $rejectedAt): void - { - $this->rejectedAt = $rejectedAt; - } - - /** - * Returns Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getReadyAt(): ?string - { - return $this->readyAt; - } - - /** - * Sets Ready At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps ready_at - */ - public function setReadyAt(?string $readyAt): void - { - $this->readyAt = $readyAt; - } - - /** - * Returns Expired At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getExpiredAt(): ?string - { - return $this->expiredAt; - } - - /** - * Sets Expired At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps expired_at - */ - public function setExpiredAt(?string $expiredAt): void - { - $this->expiredAt = $expiredAt; - } - - /** - * Returns Picked up At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPickedUpAt(): ?string - { - return $this->pickedUpAt; - } - - /** - * Sets Picked up At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps picked_up_at - */ - public function setPickedUpAt(?string $pickedUpAt): void - { - $this->pickedUpAt = $pickedUpAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - return $this->canceledAt; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt = $canceledAt; - } - - /** - * Returns Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * A description of why the pickup was canceled. The maximum length: 100 characters. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - */ - public function getIsCurbsidePickup(): ?bool - { - if (count($this->isCurbsidePickup) == 0) { - return null; - } - return $this->isCurbsidePickup['value']; - } - - /** - * Sets Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - * - * @maps is_curbside_pickup - */ - public function setIsCurbsidePickup(?bool $isCurbsidePickup): void - { - $this->isCurbsidePickup['value'] = $isCurbsidePickup; - } - - /** - * Unsets Is Curbside Pickup. - * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. - */ - public function unsetIsCurbsidePickup(): void - { - $this->isCurbsidePickup = []; - } - - /** - * Returns Curbside Pickup Details. - * Specific details for curbside pickup. - */ - public function getCurbsidePickupDetails(): ?OrderFulfillmentPickupDetailsCurbsidePickupDetails - { - return $this->curbsidePickupDetails; - } - - /** - * Sets Curbside Pickup Details. - * Specific details for curbside pickup. - * - * @maps curbside_pickup_details - */ - public function setCurbsidePickupDetails( - ?OrderFulfillmentPickupDetailsCurbsidePickupDetails $curbsidePickupDetails - ): void { - $this->curbsidePickupDetails = $curbsidePickupDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (!empty($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt['value']; - } - if (!empty($this->autoCompleteDuration)) { - $json['auto_complete_duration'] = $this->autoCompleteDuration['value']; - } - if (isset($this->scheduleType)) { - $json['schedule_type'] = $this->scheduleType; - } - if (!empty($this->pickupAt)) { - $json['pickup_at'] = $this->pickupAt['value']; - } - if (!empty($this->pickupWindowDuration)) { - $json['pickup_window_duration'] = $this->pickupWindowDuration['value']; - } - if (!empty($this->prepTimeDuration)) { - $json['prep_time_duration'] = $this->prepTimeDuration['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (isset($this->acceptedAt)) { - $json['accepted_at'] = $this->acceptedAt; - } - if (isset($this->rejectedAt)) { - $json['rejected_at'] = $this->rejectedAt; - } - if (isset($this->readyAt)) { - $json['ready_at'] = $this->readyAt; - } - if (isset($this->expiredAt)) { - $json['expired_at'] = $this->expiredAt; - } - if (isset($this->pickedUpAt)) { - $json['picked_up_at'] = $this->pickedUpAt; - } - if (isset($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (!empty($this->isCurbsidePickup)) { - $json['is_curbside_pickup'] = $this->isCurbsidePickup['value']; - } - if (isset($this->curbsidePickupDetails)) { - $json['curbside_pickup_details'] = $this->curbsidePickupDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php b/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php deleted file mode 100644 index a81a8db4..00000000 --- a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php +++ /dev/null @@ -1,121 +0,0 @@ -curbsideDetails) == 0) { - return null; - } - return $this->curbsideDetails['value']; - } - - /** - * Sets Curbside Details. - * Specific details for curbside pickup, such as parking number and vehicle model. - * - * @maps curbside_details - */ - public function setCurbsideDetails(?string $curbsideDetails): void - { - $this->curbsideDetails['value'] = $curbsideDetails; - } - - /** - * Unsets Curbside Details. - * Specific details for curbside pickup, such as parking number and vehicle model. - */ - public function unsetCurbsideDetails(): void - { - $this->curbsideDetails = []; - } - - /** - * Returns Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getBuyerArrivedAt(): ?string - { - if (count($this->buyerArrivedAt) == 0) { - return null; - } - return $this->buyerArrivedAt['value']; - } - - /** - * Sets Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps buyer_arrived_at - */ - public function setBuyerArrivedAt(?string $buyerArrivedAt): void - { - $this->buyerArrivedAt['value'] = $buyerArrivedAt; - } - - /** - * Unsets Buyer Arrived At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 - * format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetBuyerArrivedAt(): void - { - $this->buyerArrivedAt = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->curbsideDetails)) { - $json['curbside_details'] = $this->curbsideDetails['value']; - } - if (!empty($this->buyerArrivedAt)) { - $json['buyer_arrived_at'] = $this->buyerArrivedAt['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentPickupDetailsScheduleType.php b/src/Models/OrderFulfillmentPickupDetailsScheduleType.php deleted file mode 100644 index 21430358..00000000 --- a/src/Models/OrderFulfillmentPickupDetailsScheduleType.php +++ /dev/null @@ -1,22 +0,0 @@ -customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The ID of the customer associated with the fulfillment. - * If `customer_id` is provided, the fulfillment recipient's `display_name`, - * `email_address`, and `phone_number` are automatically populated from the - * targeted customer profile. If these fields are set in the request, the request - * values override the information from the customer profile. If the - * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request results in an error. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The ID of the customer associated with the fulfillment. - * If `customer_id` is provided, the fulfillment recipient's `display_name`, - * `email_address`, and `phone_number` are automatically populated from the - * targeted customer profile. If these fields are set in the request, the request - * values override the information from the customer profile. If the - * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request results in an error. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Display Name. - * The display name of the fulfillment recipient. This field is required. - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getDisplayName(): ?string - { - if (count($this->displayName) == 0) { - return null; - } - return $this->displayName['value']; - } - - /** - * Sets Display Name. - * The display name of the fulfillment recipient. This field is required. - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps display_name - */ - public function setDisplayName(?string $displayName): void - { - $this->displayName['value'] = $displayName; - } - - /** - * Unsets Display Name. - * The display name of the fulfillment recipient. This field is required. - * If provided, the display name overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetDisplayName(): void - { - $this->displayName = []; - } - - /** - * Returns Email Address. - * The email address of the fulfillment recipient. - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address of the fulfillment recipient. - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address of the fulfillment recipient. - * If provided, the email address overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number of the fulfillment recipient. This field is required. - * If provided, the phone number overrides the corresponding customer profile value - * indicated by `customer_id`. - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->displayName)) { - $json['display_name'] = $this->displayName['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentShipmentDetails.php b/src/Models/OrderFulfillmentShipmentDetails.php deleted file mode 100644 index 82e715df..00000000 --- a/src/Models/OrderFulfillmentShipmentDetails.php +++ /dev/null @@ -1,603 +0,0 @@ -recipient; - } - - /** - * Sets Recipient. - * Information about the fulfillment recipient. - * - * @maps recipient - */ - public function setRecipient(?OrderFulfillmentRecipient $recipient): void - { - $this->recipient = $recipient; - } - - /** - * Returns Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - */ - public function getCarrier(): ?string - { - if (count($this->carrier) == 0) { - return null; - } - return $this->carrier['value']; - } - - /** - * Sets Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - * - * @maps carrier - */ - public function setCarrier(?string $carrier): void - { - $this->carrier['value'] = $carrier; - } - - /** - * Unsets Carrier. - * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). - */ - public function unsetCarrier(): void - { - $this->carrier = []; - } - - /** - * Returns Shipping Note. - * A note with additional information for the shipping carrier. - */ - public function getShippingNote(): ?string - { - if (count($this->shippingNote) == 0) { - return null; - } - return $this->shippingNote['value']; - } - - /** - * Sets Shipping Note. - * A note with additional information for the shipping carrier. - * - * @maps shipping_note - */ - public function setShippingNote(?string $shippingNote): void - { - $this->shippingNote['value'] = $shippingNote; - } - - /** - * Unsets Shipping Note. - * A note with additional information for the shipping carrier. - */ - public function unsetShippingNote(): void - { - $this->shippingNote = []; - } - - /** - * Returns Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - */ - public function getShippingType(): ?string - { - if (count($this->shippingType) == 0) { - return null; - } - return $this->shippingType['value']; - } - - /** - * Sets Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - * - * @maps shipping_type - */ - public function setShippingType(?string $shippingType): void - { - $this->shippingType['value'] = $shippingType; - } - - /** - * Unsets Shipping Type. - * A description of the type of shipping product purchased from the carrier - * (such as First Class, Priority, or Express). - */ - public function unsetShippingType(): void - { - $this->shippingType = []; - } - - /** - * Returns Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - */ - public function getTrackingNumber(): ?string - { - if (count($this->trackingNumber) == 0) { - return null; - } - return $this->trackingNumber['value']; - } - - /** - * Sets Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - * - * @maps tracking_number - */ - public function setTrackingNumber(?string $trackingNumber): void - { - $this->trackingNumber['value'] = $trackingNumber; - } - - /** - * Unsets Tracking Number. - * The reference number provided by the carrier to track the shipment's progress. - */ - public function unsetTrackingNumber(): void - { - $this->trackingNumber = []; - } - - /** - * Returns Tracking Url. - * A link to the tracking webpage on the carrier's website. - */ - public function getTrackingUrl(): ?string - { - if (count($this->trackingUrl) == 0) { - return null; - } - return $this->trackingUrl['value']; - } - - /** - * Sets Tracking Url. - * A link to the tracking webpage on the carrier's website. - * - * @maps tracking_url - */ - public function setTrackingUrl(?string $trackingUrl): void - { - $this->trackingUrl['value'] = $trackingUrl; - } - - /** - * Unsets Tracking Url. - * A link to the tracking webpage on the carrier's website. - */ - public function unsetTrackingUrl(): void - { - $this->trackingUrl = []; - } - - /** - * Returns Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment was requested. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getPlacedAt(): ?string - { - return $this->placedAt; - } - - /** - * Sets Placed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment was requested. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps placed_at - */ - public function setPlacedAt(?string $placedAt): void - { - $this->placedAt = $placedAt; - } - - /** - * Returns In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that - * preparation - * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: - * 33.123Z"). - */ - public function getInProgressAt(): ?string - { - return $this->inProgressAt; - } - - /** - * Sets In Progress At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that - * preparation - * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: - * 33.123Z"). - * - * @maps in_progress_at - */ - public function setInProgressAt(?string $inProgressAt): void - { - $this->inProgressAt = $inProgressAt; - } - - /** - * Returns Packaged At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the - * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. - * 123Z"). - */ - public function getPackagedAt(): ?string - { - return $this->packagedAt; - } - - /** - * Sets Packaged At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the - * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. - * 123Z"). - * - * @maps packaged_at - */ - public function setPackagedAt(?string $packagedAt): void - { - $this->packagedAt = $packagedAt; - } - - /** - * Returns Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getExpectedShippedAt(): ?string - { - if (count($this->expectedShippedAt) == 0) { - return null; - } - return $this->expectedShippedAt['value']; - } - - /** - * Sets Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps expected_shipped_at - */ - public function setExpectedShippedAt(?string $expectedShippedAt): void - { - $this->expectedShippedAt['value'] = $expectedShippedAt; - } - - /** - * Unsets Expected Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment is expected to be delivered to the shipping carrier. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetExpectedShippedAt(): void - { - $this->expectedShippedAt = []; - } - - /** - * Returns Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that - * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getShippedAt(): ?string - { - return $this->shippedAt; - } - - /** - * Sets Shipped At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that - * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps shipped_at - */ - public function setShippedAt(?string $shippedAt): void - { - $this->shippedAt = $shippedAt; - } - - /** - * Returns Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getCanceledAt(): ?string - { - if (count($this->canceledAt) == 0) { - return null; - } - return $this->canceledAt['value']; - } - - /** - * Sets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps canceled_at - */ - public function setCanceledAt(?string $canceledAt): void - { - $this->canceledAt['value'] = $canceledAt; - } - - /** - * Unsets Canceled At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating the shipment was canceled. - * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - */ - public function unsetCanceledAt(): void - { - $this->canceledAt = []; - } - - /** - * Returns Cancel Reason. - * A description of why the shipment was canceled. - */ - public function getCancelReason(): ?string - { - if (count($this->cancelReason) == 0) { - return null; - } - return $this->cancelReason['value']; - } - - /** - * Sets Cancel Reason. - * A description of why the shipment was canceled. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason['value'] = $cancelReason; - } - - /** - * Unsets Cancel Reason. - * A description of why the shipment was canceled. - */ - public function unsetCancelReason(): void - { - $this->cancelReason = []; - } - - /** - * Returns Failed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - */ - public function getFailedAt(): ?string - { - return $this->failedAt; - } - - /** - * Sets Failed At. - * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) - * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format - * (for example, "2016-09-04T23:59:33.123Z"). - * - * @maps failed_at - */ - public function setFailedAt(?string $failedAt): void - { - $this->failedAt = $failedAt; - } - - /** - * Returns Failure Reason. - * A description of why the shipment failed to be completed. - */ - public function getFailureReason(): ?string - { - if (count($this->failureReason) == 0) { - return null; - } - return $this->failureReason['value']; - } - - /** - * Sets Failure Reason. - * A description of why the shipment failed to be completed. - * - * @maps failure_reason - */ - public function setFailureReason(?string $failureReason): void - { - $this->failureReason['value'] = $failureReason; - } - - /** - * Unsets Failure Reason. - * A description of why the shipment failed to be completed. - */ - public function unsetFailureReason(): void - { - $this->failureReason = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->recipient)) { - $json['recipient'] = $this->recipient; - } - if (!empty($this->carrier)) { - $json['carrier'] = $this->carrier['value']; - } - if (!empty($this->shippingNote)) { - $json['shipping_note'] = $this->shippingNote['value']; - } - if (!empty($this->shippingType)) { - $json['shipping_type'] = $this->shippingType['value']; - } - if (!empty($this->trackingNumber)) { - $json['tracking_number'] = $this->trackingNumber['value']; - } - if (!empty($this->trackingUrl)) { - $json['tracking_url'] = $this->trackingUrl['value']; - } - if (isset($this->placedAt)) { - $json['placed_at'] = $this->placedAt; - } - if (isset($this->inProgressAt)) { - $json['in_progress_at'] = $this->inProgressAt; - } - if (isset($this->packagedAt)) { - $json['packaged_at'] = $this->packagedAt; - } - if (!empty($this->expectedShippedAt)) { - $json['expected_shipped_at'] = $this->expectedShippedAt['value']; - } - if (isset($this->shippedAt)) { - $json['shipped_at'] = $this->shippedAt; - } - if (!empty($this->canceledAt)) { - $json['canceled_at'] = $this->canceledAt['value']; - } - if (!empty($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason['value']; - } - if (isset($this->failedAt)) { - $json['failed_at'] = $this->failedAt; - } - if (!empty($this->failureReason)) { - $json['failure_reason'] = $this->failureReason['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentState.php b/src/Models/OrderFulfillmentState.php deleted file mode 100644 index 2fd40b4c..00000000 --- a/src/Models/OrderFulfillmentState.php +++ /dev/null @@ -1,42 +0,0 @@ -orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The order's unique ID. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The order's unique ID. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The ID of the seller location that this order is associated with. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the seller location that this order is associated with. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the seller location that this order is associated with. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns State. - * The state of the order. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The state of the order. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Created At. - * The timestamp for when the order was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the order was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp for when the order was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp for when the order was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Fulfillment Update. - * The fulfillments that were updated with this version change. - * - * @return OrderFulfillmentUpdatedUpdate[]|null - */ - public function getFulfillmentUpdate(): ?array - { - if (count($this->fulfillmentUpdate) == 0) { - return null; - } - return $this->fulfillmentUpdate['value']; - } - - /** - * Sets Fulfillment Update. - * The fulfillments that were updated with this version change. - * - * @maps fulfillment_update - * - * @param OrderFulfillmentUpdatedUpdate[]|null $fulfillmentUpdate - */ - public function setFulfillmentUpdate(?array $fulfillmentUpdate): void - { - $this->fulfillmentUpdate['value'] = $fulfillmentUpdate; - } - - /** - * Unsets Fulfillment Update. - * The fulfillments that were updated with this version change. - */ - public function unsetFulfillmentUpdate(): void - { - $this->fulfillmentUpdate = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->fulfillmentUpdate)) { - $json['fulfillment_update'] = $this->fulfillmentUpdate['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentUpdatedObject.php b/src/Models/OrderFulfillmentUpdatedObject.php deleted file mode 100644 index 130e8727..00000000 --- a/src/Models/OrderFulfillmentUpdatedObject.php +++ /dev/null @@ -1,55 +0,0 @@ -orderFulfillmentUpdated; - } - - /** - * Sets Order Fulfillment Updated. - * - * @maps order_fulfillment_updated - */ - public function setOrderFulfillmentUpdated(?OrderFulfillmentUpdated $orderFulfillmentUpdated): void - { - $this->orderFulfillmentUpdated = $orderFulfillmentUpdated; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orderFulfillmentUpdated)) { - $json['order_fulfillment_updated'] = $this->orderFulfillmentUpdated; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderFulfillmentUpdatedUpdate.php b/src/Models/OrderFulfillmentUpdatedUpdate.php deleted file mode 100644 index a0e2ea2a..00000000 --- a/src/Models/OrderFulfillmentUpdatedUpdate.php +++ /dev/null @@ -1,128 +0,0 @@ -fulfillmentUid) == 0) { - return null; - } - return $this->fulfillmentUid['value']; - } - - /** - * Sets Fulfillment Uid. - * A unique ID that identifies the fulfillment only within this order. - * - * @maps fulfillment_uid - */ - public function setFulfillmentUid(?string $fulfillmentUid): void - { - $this->fulfillmentUid['value'] = $fulfillmentUid; - } - - /** - * Unsets Fulfillment Uid. - * A unique ID that identifies the fulfillment only within this order. - */ - public function unsetFulfillmentUid(): void - { - $this->fulfillmentUid = []; - } - - /** - * Returns Old State. - * The current state of this fulfillment. - */ - public function getOldState(): ?string - { - return $this->oldState; - } - - /** - * Sets Old State. - * The current state of this fulfillment. - * - * @maps old_state - */ - public function setOldState(?string $oldState): void - { - $this->oldState = $oldState; - } - - /** - * Returns New State. - * The current state of this fulfillment. - */ - public function getNewState(): ?string - { - return $this->newState; - } - - /** - * Sets New State. - * The current state of this fulfillment. - * - * @maps new_state - */ - public function setNewState(?string $newState): void - { - $this->newState = $newState; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->fulfillmentUid)) { - $json['fulfillment_uid'] = $this->fulfillmentUid['value']; - } - if (isset($this->oldState)) { - $json['old_state'] = $this->oldState; - } - if (isset($this->newState)) { - $json['new_state'] = $this->newState; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItem.php b/src/Models/OrderLineItem.php deleted file mode 100644 index 84e502b9..00000000 --- a/src/Models/OrderLineItem.php +++ /dev/null @@ -1,1050 +0,0 @@ -quantity = $quantity; - } - - /** - * Returns Uid. - * A unique ID that identifies the line item only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the line item only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the line item only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Name. - * The name of the line item. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the line item. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the line item. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Quantity. - * The count, or measurement, of a line item being purchased: - * - * If `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an - * item count. For example: `3` apples. - * - * If `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` - * denotes a measurement. For example: `2.25` pounds of broccoli. - * - * For more information, see [Specify item quantity and measurement unit](https://developer.squareup. - * com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit). - * - * Line items with a quantity of `0` are automatically removed - * when paying for or otherwise completing the order. - */ - public function getQuantity(): string - { - return $this->quantity; - } - - /** - * Sets Quantity. - * The count, or measurement, of a line item being purchased: - * - * If `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an - * item count. For example: `3` apples. - * - * If `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` - * denotes a measurement. For example: `2.25` pounds of broccoli. - * - * For more information, see [Specify item quantity and measurement unit](https://developer.squareup. - * com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit). - * - * Line items with a quantity of `0` are automatically removed - * when paying for or otherwise completing the order. - * - * @required - * @maps quantity - */ - public function setQuantity(string $quantity): void - { - $this->quantity = $quantity; - } - - /** - * Returns Quantity Unit. - * Contains the measurement unit for a quantity and a precision that - * specifies the number of digits after the decimal point for decimal quantities. - */ - public function getQuantityUnit(): ?OrderQuantityUnit - { - return $this->quantityUnit; - } - - /** - * Sets Quantity Unit. - * Contains the measurement unit for a quantity and a precision that - * specifies the number of digits after the decimal point for decimal quantities. - * - * @maps quantity_unit - */ - public function setQuantityUnit(?OrderQuantityUnit $quantityUnit): void - { - $this->quantityUnit = $quantityUnit; - } - - /** - * Returns Note. - * An optional note associated with the line item. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * An optional note associated with the line item. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * An optional note associated with the line item. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this line item references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this line item references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this line item references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Variation Name. - * The name of the variation applied to this line item. - */ - public function getVariationName(): ?string - { - if (count($this->variationName) == 0) { - return null; - } - return $this->variationName['value']; - } - - /** - * Sets Variation Name. - * The name of the variation applied to this line item. - * - * @maps variation_name - */ - public function setVariationName(?string $variationName): void - { - $this->variationName['value'] = $variationName; - } - - /** - * Unsets Variation Name. - * The name of the variation applied to this line item. - */ - public function unsetVariationName(): void - { - $this->variationName = []; - } - - /** - * Returns Item Type. - * Represents the line item type. - */ - public function getItemType(): ?string - { - return $this->itemType; - } - - /** - * Sets Item Type. - * Represents the line item type. - * - * @maps item_type - */ - public function setItemType(?string $itemType): void - { - $this->itemType = $itemType; - } - - /** - * Returns Metadata. - * Application-defined data attached to this line item. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this line item. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this line item. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - * - * @return OrderLineItemModifier[]|null - */ - public function getModifiers(): ?array - { - if (count($this->modifiers) == 0) { - return null; - } - return $this->modifiers['value']; - } - - /** - * Sets Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - * - * @maps modifiers - * - * @param OrderLineItemModifier[]|null $modifiers - */ - public function setModifiers(?array $modifiers): void - { - $this->modifiers['value'] = $modifiers; - } - - /** - * Unsets Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - */ - public function unsetModifiers(): void - { - $this->modifiers = []; - } - - /** - * Returns Applied Taxes. - * The list of references to taxes applied to this line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a - * top-level `OrderLineItemTax` applied to the line item. On reads, the - * amount applied is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every line - * item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax` - * records for `LINE_ITEM` scoped taxes must be added in requests for the tax - * to apply to any line items. - * - * To change the amount of a tax, modify the referenced top-level tax. - * - * @return OrderLineItemAppliedTax[]|null - */ - public function getAppliedTaxes(): ?array - { - if (count($this->appliedTaxes) == 0) { - return null; - } - return $this->appliedTaxes['value']; - } - - /** - * Sets Applied Taxes. - * The list of references to taxes applied to this line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a - * top-level `OrderLineItemTax` applied to the line item. On reads, the - * amount applied is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every line - * item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax` - * records for `LINE_ITEM` scoped taxes must be added in requests for the tax - * to apply to any line items. - * - * To change the amount of a tax, modify the referenced top-level tax. - * - * @maps applied_taxes - * - * @param OrderLineItemAppliedTax[]|null $appliedTaxes - */ - public function setAppliedTaxes(?array $appliedTaxes): void - { - $this->appliedTaxes['value'] = $appliedTaxes; - } - - /** - * Unsets Applied Taxes. - * The list of references to taxes applied to this line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a - * top-level `OrderLineItemTax` applied to the line item. On reads, the - * amount applied is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every line - * item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax` - * records for `LINE_ITEM` scoped taxes must be added in requests for the tax - * to apply to any line items. - * - * To change the amount of a tax, modify the referenced top-level tax. - */ - public function unsetAppliedTaxes(): void - { - $this->appliedTaxes = []; - } - - /** - * Returns Applied Discounts. - * The list of references to discounts applied to this line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderLineItemDiscounts` applied to the line item. On reads, the amount - * applied is populated. - * - * An `OrderLineItemAppliedDiscount` is automatically created on every line item for all - * `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records - * for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any - * line items. - * - * To change the amount of a discount, modify the referenced top-level discount. - * - * @return OrderLineItemAppliedDiscount[]|null - */ - public function getAppliedDiscounts(): ?array - { - if (count($this->appliedDiscounts) == 0) { - return null; - } - return $this->appliedDiscounts['value']; - } - - /** - * Sets Applied Discounts. - * The list of references to discounts applied to this line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderLineItemDiscounts` applied to the line item. On reads, the amount - * applied is populated. - * - * An `OrderLineItemAppliedDiscount` is automatically created on every line item for all - * `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records - * for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any - * line items. - * - * To change the amount of a discount, modify the referenced top-level discount. - * - * @maps applied_discounts - * - * @param OrderLineItemAppliedDiscount[]|null $appliedDiscounts - */ - public function setAppliedDiscounts(?array $appliedDiscounts): void - { - $this->appliedDiscounts['value'] = $appliedDiscounts; - } - - /** - * Unsets Applied Discounts. - * The list of references to discounts applied to this line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderLineItemDiscounts` applied to the line item. On reads, the amount - * applied is populated. - * - * An `OrderLineItemAppliedDiscount` is automatically created on every line item for all - * `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records - * for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any - * line items. - * - * To change the amount of a discount, modify the referenced top-level discount. - */ - public function unsetAppliedDiscounts(): void - { - $this->appliedDiscounts = []; - } - - /** - * Returns Applied Service Charges. - * The list of references to service charges applied to this line item. Each - * `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a - * top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is - * populated. - * - * To change the amount of a service charge, modify the referenced top-level service charge. - * - * @return OrderLineItemAppliedServiceCharge[]|null - */ - public function getAppliedServiceCharges(): ?array - { - if (count($this->appliedServiceCharges) == 0) { - return null; - } - return $this->appliedServiceCharges['value']; - } - - /** - * Sets Applied Service Charges. - * The list of references to service charges applied to this line item. Each - * `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a - * top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is - * populated. - * - * To change the amount of a service charge, modify the referenced top-level service charge. - * - * @maps applied_service_charges - * - * @param OrderLineItemAppliedServiceCharge[]|null $appliedServiceCharges - */ - public function setAppliedServiceCharges(?array $appliedServiceCharges): void - { - $this->appliedServiceCharges['value'] = $appliedServiceCharges; - } - - /** - * Unsets Applied Service Charges. - * The list of references to service charges applied to this line item. Each - * `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a - * top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is - * populated. - * - * To change the amount of a service charge, modify the referenced top-level service charge. - */ - public function unsetAppliedServiceCharges(): void - { - $this->appliedServiceCharges = []; - } - - /** - * Returns Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBasePriceMoney(): ?Money - { - return $this->basePriceMoney; - } - - /** - * Sets Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps base_price_money - */ - public function setBasePriceMoney(?Money $basePriceMoney): void - { - $this->basePriceMoney = $basePriceMoney; - } - - /** - * Returns Variation Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getVariationTotalPriceMoney(): ?Money - { - return $this->variationTotalPriceMoney; - } - - /** - * Sets Variation Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps variation_total_price_money - */ - public function setVariationTotalPriceMoney(?Money $variationTotalPriceMoney): void - { - $this->variationTotalPriceMoney = $variationTotalPriceMoney; - } - - /** - * Returns Gross Sales Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getGrossSalesMoney(): ?Money - { - return $this->grossSalesMoney; - } - - /** - * Sets Gross Sales Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps gross_sales_money - */ - public function setGrossSalesMoney(?Money $grossSalesMoney): void - { - $this->grossSalesMoney = $grossSalesMoney; - } - - /** - * Returns Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTaxMoney(): ?Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalDiscountMoney(): ?Money - { - return $this->totalDiscountMoney; - } - - /** - * Sets Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_discount_money - */ - public function setTotalDiscountMoney(?Money $totalDiscountMoney): void - { - $this->totalDiscountMoney = $totalDiscountMoney; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Pricing Blocklists. - * Describes pricing adjustments that are blocked from automatic - * application to a line item. For more information, see - * [Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and- - * discounts). - */ - public function getPricingBlocklists(): ?OrderLineItemPricingBlocklists - { - return $this->pricingBlocklists; - } - - /** - * Sets Pricing Blocklists. - * Describes pricing adjustments that are blocked from automatic - * application to a line item. For more information, see - * [Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and- - * discounts). - * - * @maps pricing_blocklists - */ - public function setPricingBlocklists(?OrderLineItemPricingBlocklists $pricingBlocklists): void - { - $this->pricingBlocklists = $pricingBlocklists; - } - - /** - * Returns Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalServiceChargeMoney(): ?Money - { - return $this->totalServiceChargeMoney; - } - - /** - * Sets Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_service_charge_money - */ - public function setTotalServiceChargeMoney(?Money $totalServiceChargeMoney): void - { - $this->totalServiceChargeMoney = $totalServiceChargeMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json['quantity'] = $this->quantity; - if (isset($this->quantityUnit)) { - $json['quantity_unit'] = $this->quantityUnit; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->variationName)) { - $json['variation_name'] = $this->variationName['value']; - } - if (isset($this->itemType)) { - $json['item_type'] = $this->itemType; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (!empty($this->modifiers)) { - $json['modifiers'] = $this->modifiers['value']; - } - if (!empty($this->appliedTaxes)) { - $json['applied_taxes'] = $this->appliedTaxes['value']; - } - if (!empty($this->appliedDiscounts)) { - $json['applied_discounts'] = $this->appliedDiscounts['value']; - } - if (!empty($this->appliedServiceCharges)) { - $json['applied_service_charges'] = $this->appliedServiceCharges['value']; - } - if (isset($this->basePriceMoney)) { - $json['base_price_money'] = $this->basePriceMoney; - } - if (isset($this->variationTotalPriceMoney)) { - $json['variation_total_price_money'] = $this->variationTotalPriceMoney; - } - if (isset($this->grossSalesMoney)) { - $json['gross_sales_money'] = $this->grossSalesMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->totalDiscountMoney)) { - $json['total_discount_money'] = $this->totalDiscountMoney; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->pricingBlocklists)) { - $json['pricing_blocklists'] = $this->pricingBlocklists; - } - if (isset($this->totalServiceChargeMoney)) { - $json['total_service_charge_money'] = $this->totalServiceChargeMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemAppliedDiscount.php b/src/Models/OrderLineItemAppliedDiscount.php deleted file mode 100644 index b62563de..00000000 --- a/src/Models/OrderLineItemAppliedDiscount.php +++ /dev/null @@ -1,160 +0,0 @@ -discountUid = $discountUid; - } - - /** - * Returns Uid. - * A unique ID that identifies the applied discount only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the applied discount only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the applied discount only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Discount Uid. - * The `uid` of the discount that the applied discount represents. It must - * reference a discount present in the `order.discounts` field. - * - * This field is immutable. To change which discounts apply to a line item, - * you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`. - */ - public function getDiscountUid(): string - { - return $this->discountUid; - } - - /** - * Sets Discount Uid. - * The `uid` of the discount that the applied discount represents. It must - * reference a discount present in the `order.discounts` field. - * - * This field is immutable. To change which discounts apply to a line item, - * you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`. - * - * @required - * @maps discount_uid - */ - public function setDiscountUid(string $discountUid): void - { - $this->discountUid = $discountUid; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['discount_uid'] = $this->discountUid; - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemAppliedServiceCharge.php b/src/Models/OrderLineItemAppliedServiceCharge.php deleted file mode 100644 index d0d2d2e1..00000000 --- a/src/Models/OrderLineItemAppliedServiceCharge.php +++ /dev/null @@ -1,152 +0,0 @@ -serviceChargeUid = $serviceChargeUid; - } - - /** - * Returns Uid. - * A unique ID that identifies the applied service charge only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the applied service charge only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the applied service charge only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Service Charge Uid. - * The `uid` of the service charge that the applied service charge represents. It must - * reference a service charge present in the `order.service_charges` field. - * - * This field is immutable. To change which service charges apply to a line item, - * delete and add a new `OrderLineItemAppliedServiceCharge`. - */ - public function getServiceChargeUid(): string - { - return $this->serviceChargeUid; - } - - /** - * Sets Service Charge Uid. - * The `uid` of the service charge that the applied service charge represents. It must - * reference a service charge present in the `order.service_charges` field. - * - * This field is immutable. To change which service charges apply to a line item, - * delete and add a new `OrderLineItemAppliedServiceCharge`. - * - * @required - * @maps service_charge_uid - */ - public function setServiceChargeUid(string $serviceChargeUid): void - { - $this->serviceChargeUid = $serviceChargeUid; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['service_charge_uid'] = $this->serviceChargeUid; - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemAppliedTax.php b/src/Models/OrderLineItemAppliedTax.php deleted file mode 100644 index df85b896..00000000 --- a/src/Models/OrderLineItemAppliedTax.php +++ /dev/null @@ -1,160 +0,0 @@ -taxUid = $taxUid; - } - - /** - * Returns Uid. - * A unique ID that identifies the applied tax only within this order. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the applied tax only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the applied tax only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Tax Uid. - * The `uid` of the tax for which this applied tax represents. It must reference - * a tax present in the `order.taxes` field. - * - * This field is immutable. To change which taxes apply to a line item, delete and add a new - * `OrderLineItemAppliedTax`. - */ - public function getTaxUid(): string - { - return $this->taxUid; - } - - /** - * Sets Tax Uid. - * The `uid` of the tax for which this applied tax represents. It must reference - * a tax present in the `order.taxes` field. - * - * This field is immutable. To change which taxes apply to a line item, delete and add a new - * `OrderLineItemAppliedTax`. - * - * @required - * @maps tax_uid - */ - public function setTaxUid(string $taxUid): void - { - $this->taxUid = $taxUid; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['tax_uid'] = $this->taxUid; - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemDiscount.php b/src/Models/OrderLineItemDiscount.php deleted file mode 100644 index 845fb16c..00000000 --- a/src/Models/OrderLineItemDiscount.php +++ /dev/null @@ -1,551 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the discount only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the discount only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this discount references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this discount references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this discount references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The discount's name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The discount's name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The discount's name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Type. - * Indicates how the discount is applied to the associated line item or order. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates how the discount is applied to the associated line item or order. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Percentage. - * The percentage of the discount, as a string representation of a decimal number. - * A value of `7.25` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the discount, as a string representation of a decimal number. - * A value of `7.25` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the discount, as a string representation of a decimal number. - * A value of `7.25` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Metadata. - * Application-defined data attached to this discount. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this discount. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this discount. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level discount. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level discount. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Returns Reward Ids. - * The reward IDs corresponding to this discount. The application and - * specification of discounts that have `reward_ids` are completely controlled by the backing - * criteria corresponding to the reward tiers of the rewards that are added to the order - * through the Loyalty API. To manually unapply discounts that are the result of added rewards, - * the rewards must be removed from the order through the Loyalty API. - * - * @return string[]|null - */ - public function getRewardIds(): ?array - { - return $this->rewardIds; - } - - /** - * Sets Reward Ids. - * The reward IDs corresponding to this discount. The application and - * specification of discounts that have `reward_ids` are completely controlled by the backing - * criteria corresponding to the reward tiers of the rewards that are added to the order - * through the Loyalty API. To manually unapply discounts that are the result of added rewards, - * the rewards must be removed from the order through the Loyalty API. - * - * @maps reward_ids - * - * @param string[]|null $rewardIds - */ - public function setRewardIds(?array $rewardIds): void - { - $this->rewardIds = $rewardIds; - } - - /** - * Returns Pricing Rule Id. - * The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied - * automatically to this discount. The specification and application of the discounts, to - * which a `pricing_rule_id` is assigned, are completely controlled by the corresponding - * pricing rule. - */ - public function getPricingRuleId(): ?string - { - return $this->pricingRuleId; - } - - /** - * Sets Pricing Rule Id. - * The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied - * automatically to this discount. The specification and application of the discounts, to - * which a `pricing_rule_id` is assigned, are completely controlled by the corresponding - * pricing rule. - * - * @maps pricing_rule_id - */ - public function setPricingRuleId(?string $pricingRuleId): void - { - $this->pricingRuleId = $pricingRuleId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - if (isset($this->rewardIds)) { - $json['reward_ids'] = $this->rewardIds; - } - if (isset($this->pricingRuleId)) { - $json['pricing_rule_id'] = $this->pricingRuleId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemDiscountScope.php b/src/Models/OrderLineItemDiscountScope.php deleted file mode 100644 index e5b0da14..00000000 --- a/src/Models/OrderLineItemDiscountScope.php +++ /dev/null @@ -1,28 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the modifier only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the modifier only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this modifier references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this modifier references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this modifier references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The name of the item modifier. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the item modifier. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the item modifier. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBasePriceMoney(): ?Money - { - return $this->basePriceMoney; - } - - /** - * Sets Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps base_price_money - */ - public function setBasePriceMoney(?Money $basePriceMoney): void - { - $this->basePriceMoney = $basePriceMoney; - } - - /** - * Returns Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalPriceMoney(): ?Money - { - return $this->totalPriceMoney; - } - - /** - * Sets Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_price_money - */ - public function setTotalPriceMoney(?Money $totalPriceMoney): void - { - $this->totalPriceMoney = $totalPriceMoney; - } - - /** - * Returns Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this order. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (isset($this->basePriceMoney)) { - $json['base_price_money'] = $this->basePriceMoney; - } - if (isset($this->totalPriceMoney)) { - $json['total_price_money'] = $this->totalPriceMoney; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemPricingBlocklists.php b/src/Models/OrderLineItemPricingBlocklists.php deleted file mode 100644 index accb473b..00000000 --- a/src/Models/OrderLineItemPricingBlocklists.php +++ /dev/null @@ -1,135 +0,0 @@ -blockedDiscounts) == 0) { - return null; - } - return $this->blockedDiscounts['value']; - } - - /** - * Sets Blocked Discounts. - * A list of discounts blocked from applying to the line item. - * Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or - * the `discount_catalog_object_id` (for catalog discounts). - * - * @maps blocked_discounts - * - * @param OrderLineItemPricingBlocklistsBlockedDiscount[]|null $blockedDiscounts - */ - public function setBlockedDiscounts(?array $blockedDiscounts): void - { - $this->blockedDiscounts['value'] = $blockedDiscounts; - } - - /** - * Unsets Blocked Discounts. - * A list of discounts blocked from applying to the line item. - * Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or - * the `discount_catalog_object_id` (for catalog discounts). - */ - public function unsetBlockedDiscounts(): void - { - $this->blockedDiscounts = []; - } - - /** - * Returns Blocked Taxes. - * A list of taxes blocked from applying to the line item. - * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or - * the `tax_catalog_object_id` (for catalog taxes). - * - * @return OrderLineItemPricingBlocklistsBlockedTax[]|null - */ - public function getBlockedTaxes(): ?array - { - if (count($this->blockedTaxes) == 0) { - return null; - } - return $this->blockedTaxes['value']; - } - - /** - * Sets Blocked Taxes. - * A list of taxes blocked from applying to the line item. - * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or - * the `tax_catalog_object_id` (for catalog taxes). - * - * @maps blocked_taxes - * - * @param OrderLineItemPricingBlocklistsBlockedTax[]|null $blockedTaxes - */ - public function setBlockedTaxes(?array $blockedTaxes): void - { - $this->blockedTaxes['value'] = $blockedTaxes; - } - - /** - * Unsets Blocked Taxes. - * A list of taxes blocked from applying to the line item. - * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or - * the `tax_catalog_object_id` (for catalog taxes). - */ - public function unsetBlockedTaxes(): void - { - $this->blockedTaxes = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->blockedDiscounts)) { - $json['blocked_discounts'] = $this->blockedDiscounts['value']; - } - if (!empty($this->blockedTaxes)) { - $json['blocked_taxes'] = $this->blockedTaxes['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php b/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php deleted file mode 100644 index ca66b448..00000000 --- a/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php +++ /dev/null @@ -1,162 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID of the `BlockedDiscount` within the order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID of the `BlockedDiscount` within the order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Discount Uid. - * The `uid` of the discount that should be blocked. Use this field to block - * ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field. - */ - public function getDiscountUid(): ?string - { - if (count($this->discountUid) == 0) { - return null; - } - return $this->discountUid['value']; - } - - /** - * Sets Discount Uid. - * The `uid` of the discount that should be blocked. Use this field to block - * ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field. - * - * @maps discount_uid - */ - public function setDiscountUid(?string $discountUid): void - { - $this->discountUid['value'] = $discountUid; - } - - /** - * Unsets Discount Uid. - * The `uid` of the discount that should be blocked. Use this field to block - * ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field. - */ - public function unsetDiscountUid(): void - { - $this->discountUid = []; - } - - /** - * Returns Discount Catalog Object Id. - * The `catalog_object_id` of the discount that should be blocked. - * Use this field to block catalog discounts. For ad hoc discounts, use the - * `discount_uid` field. - */ - public function getDiscountCatalogObjectId(): ?string - { - if (count($this->discountCatalogObjectId) == 0) { - return null; - } - return $this->discountCatalogObjectId['value']; - } - - /** - * Sets Discount Catalog Object Id. - * The `catalog_object_id` of the discount that should be blocked. - * Use this field to block catalog discounts. For ad hoc discounts, use the - * `discount_uid` field. - * - * @maps discount_catalog_object_id - */ - public function setDiscountCatalogObjectId(?string $discountCatalogObjectId): void - { - $this->discountCatalogObjectId['value'] = $discountCatalogObjectId; - } - - /** - * Unsets Discount Catalog Object Id. - * The `catalog_object_id` of the discount that should be blocked. - * Use this field to block catalog discounts. For ad hoc discounts, use the - * `discount_uid` field. - */ - public function unsetDiscountCatalogObjectId(): void - { - $this->discountCatalogObjectId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->discountUid)) { - $json['discount_uid'] = $this->discountUid['value']; - } - if (!empty($this->discountCatalogObjectId)) { - $json['discount_catalog_object_id'] = $this->discountCatalogObjectId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php b/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php deleted file mode 100644 index 103e492b..00000000 --- a/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php +++ /dev/null @@ -1,162 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID of the `BlockedTax` within the order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID of the `BlockedTax` within the order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Tax Uid. - * The `uid` of the tax that should be blocked. Use this field to block - * ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field. - */ - public function getTaxUid(): ?string - { - if (count($this->taxUid) == 0) { - return null; - } - return $this->taxUid['value']; - } - - /** - * Sets Tax Uid. - * The `uid` of the tax that should be blocked. Use this field to block - * ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field. - * - * @maps tax_uid - */ - public function setTaxUid(?string $taxUid): void - { - $this->taxUid['value'] = $taxUid; - } - - /** - * Unsets Tax Uid. - * The `uid` of the tax that should be blocked. Use this field to block - * ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field. - */ - public function unsetTaxUid(): void - { - $this->taxUid = []; - } - - /** - * Returns Tax Catalog Object Id. - * The `catalog_object_id` of the tax that should be blocked. - * Use this field to block catalog taxes. For ad hoc taxes, use the - * `tax_uid` field. - */ - public function getTaxCatalogObjectId(): ?string - { - if (count($this->taxCatalogObjectId) == 0) { - return null; - } - return $this->taxCatalogObjectId['value']; - } - - /** - * Sets Tax Catalog Object Id. - * The `catalog_object_id` of the tax that should be blocked. - * Use this field to block catalog taxes. For ad hoc taxes, use the - * `tax_uid` field. - * - * @maps tax_catalog_object_id - */ - public function setTaxCatalogObjectId(?string $taxCatalogObjectId): void - { - $this->taxCatalogObjectId['value'] = $taxCatalogObjectId; - } - - /** - * Unsets Tax Catalog Object Id. - * The `catalog_object_id` of the tax that should be blocked. - * Use this field to block catalog taxes. For ad hoc taxes, use the - * `tax_uid` field. - */ - public function unsetTaxCatalogObjectId(): void - { - $this->taxCatalogObjectId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->taxUid)) { - $json['tax_uid'] = $this->taxUid['value']; - } - if (!empty($this->taxCatalogObjectId)) { - $json['tax_catalog_object_id'] = $this->taxCatalogObjectId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemTax.php b/src/Models/OrderLineItemTax.php deleted file mode 100644 index d6512389..00000000 --- a/src/Models/OrderLineItemTax.php +++ /dev/null @@ -1,467 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the tax only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the tax only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this tax references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this tax references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this tax references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The tax's name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The tax's name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The tax's name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Type. - * Indicates how the tax is applied to the associated line item or order. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates how the tax is applied to the associated line item or order. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Percentage. - * The percentage of the tax, as a string representation of a decimal - * number. For example, a value of `"7.25"` corresponds to a percentage of - * 7.25%. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the tax, as a string representation of a decimal - * number. For example, a value of `"7.25"` corresponds to a percentage of - * 7.25%. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the tax, as a string representation of a decimal - * number. For example, a value of `"7.25"` corresponds to a percentage of - * 7.25%. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Metadata. - * Application-defined data attached to this tax. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this tax. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this tax. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level tax. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level tax. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Returns Auto Applied. - * Determines whether the tax was automatically applied to the order based on - * the catalog configuration. For an example, see - * [Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes- - * and-discounts/auto-apply-taxes). - */ - public function getAutoApplied(): ?bool - { - return $this->autoApplied; - } - - /** - * Sets Auto Applied. - * Determines whether the tax was automatically applied to the order based on - * the catalog configuration. For an example, see - * [Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes- - * and-discounts/auto-apply-taxes). - * - * @maps auto_applied - */ - public function setAutoApplied(?bool $autoApplied): void - { - $this->autoApplied = $autoApplied; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - if (isset($this->autoApplied)) { - $json['auto_applied'] = $this->autoApplied; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderLineItemTaxScope.php b/src/Models/OrderLineItemTaxScope.php deleted file mode 100644 index ac052ed0..00000000 --- a/src/Models/OrderLineItemTaxScope.php +++ /dev/null @@ -1,28 +0,0 @@ -totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTaxMoney(): ?Money - { - return $this->taxMoney; - } - - /** - * Sets Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tax_money - */ - public function setTaxMoney(?Money $taxMoney): void - { - $this->taxMoney = $taxMoney; - } - - /** - * Returns Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getDiscountMoney(): ?Money - { - return $this->discountMoney; - } - - /** - * Sets Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps discount_money - */ - public function setDiscountMoney(?Money $discountMoney): void - { - $this->discountMoney = $discountMoney; - } - - /** - * Returns Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTipMoney(): ?Money - { - return $this->tipMoney; - } - - /** - * Sets Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tip_money - */ - public function setTipMoney(?Money $tipMoney): void - { - $this->tipMoney = $tipMoney; - } - - /** - * Returns Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getServiceChargeMoney(): ?Money - { - return $this->serviceChargeMoney; - } - - /** - * Sets Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps service_charge_money - */ - public function setServiceChargeMoney(?Money $serviceChargeMoney): void - { - $this->serviceChargeMoney = $serviceChargeMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->taxMoney)) { - $json['tax_money'] = $this->taxMoney; - } - if (isset($this->discountMoney)) { - $json['discount_money'] = $this->discountMoney; - } - if (isset($this->tipMoney)) { - $json['tip_money'] = $this->tipMoney; - } - if (isset($this->serviceChargeMoney)) { - $json['service_charge_money'] = $this->serviceChargeMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderPricingOptions.php b/src/Models/OrderPricingOptions.php deleted file mode 100644 index 9efc678d..00000000 --- a/src/Models/OrderPricingOptions.php +++ /dev/null @@ -1,120 +0,0 @@ -autoApplyDiscounts) == 0) { - return null; - } - return $this->autoApplyDiscounts['value']; - } - - /** - * Sets Auto Apply Discounts. - * The option to determine whether pricing rule-based - * discounts are automatically applied to an order. - * - * @maps auto_apply_discounts - */ - public function setAutoApplyDiscounts(?bool $autoApplyDiscounts): void - { - $this->autoApplyDiscounts['value'] = $autoApplyDiscounts; - } - - /** - * Unsets Auto Apply Discounts. - * The option to determine whether pricing rule-based - * discounts are automatically applied to an order. - */ - public function unsetAutoApplyDiscounts(): void - { - $this->autoApplyDiscounts = []; - } - - /** - * Returns Auto Apply Taxes. - * The option to determine whether rule-based taxes are automatically - * applied to an order when the criteria of the corresponding rules are met. - */ - public function getAutoApplyTaxes(): ?bool - { - if (count($this->autoApplyTaxes) == 0) { - return null; - } - return $this->autoApplyTaxes['value']; - } - - /** - * Sets Auto Apply Taxes. - * The option to determine whether rule-based taxes are automatically - * applied to an order when the criteria of the corresponding rules are met. - * - * @maps auto_apply_taxes - */ - public function setAutoApplyTaxes(?bool $autoApplyTaxes): void - { - $this->autoApplyTaxes['value'] = $autoApplyTaxes; - } - - /** - * Unsets Auto Apply Taxes. - * The option to determine whether rule-based taxes are automatically - * applied to an order when the criteria of the corresponding rules are met. - */ - public function unsetAutoApplyTaxes(): void - { - $this->autoApplyTaxes = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->autoApplyDiscounts)) { - $json['auto_apply_discounts'] = $this->autoApplyDiscounts['value']; - } - if (!empty($this->autoApplyTaxes)) { - $json['auto_apply_taxes'] = $this->autoApplyTaxes['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderQuantityUnit.php b/src/Models/OrderQuantityUnit.php deleted file mode 100644 index 695c79cd..00000000 --- a/src/Models/OrderQuantityUnit.php +++ /dev/null @@ -1,215 +0,0 @@ -measurementUnit; - } - - /** - * Sets Measurement Unit. - * Represents a unit of measurement to use with a quantity, such as ounces - * or inches. Exactly one of the following fields are required: `custom_unit`, - * `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. - * - * @maps measurement_unit - */ - public function setMeasurementUnit(?MeasurementUnit $measurementUnit): void - { - $this->measurementUnit = $measurementUnit; - } - - /** - * Returns Precision. - * For non-integer quantities, represents the number of digits after the decimal point that are - * recorded for this quantity. - * - * For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`. - * - * Min: 0. Max: 5. - */ - public function getPrecision(): ?int - { - if (count($this->precision) == 0) { - return null; - } - return $this->precision['value']; - } - - /** - * Sets Precision. - * For non-integer quantities, represents the number of digits after the decimal point that are - * recorded for this quantity. - * - * For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`. - * - * Min: 0. Max: 5. - * - * @maps precision - */ - public function setPrecision(?int $precision): void - { - $this->precision['value'] = $precision; - } - - /** - * Unsets Precision. - * For non-integer quantities, represents the number of digits after the decimal point that are - * recorded for this quantity. - * - * For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`. - * - * Min: 0. Max: 5. - */ - public function unsetPrecision(): void - { - $this->precision = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing the - * [CatalogMeasurementUnit](entity:CatalogMeasurementUnit). - * - * This field is set when this is a catalog-backed measurement unit. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing the - * [CatalogMeasurementUnit](entity:CatalogMeasurementUnit). - * - * This field is set when this is a catalog-backed measurement unit. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing the - * [CatalogMeasurementUnit](entity:CatalogMeasurementUnit). - * - * This field is set when this is a catalog-backed measurement unit. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this measurement unit references. - * - * This field is set when this is a catalog-backed measurement unit. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this measurement unit references. - * - * This field is set when this is a catalog-backed measurement unit. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this measurement unit references. - * - * This field is set when this is a catalog-backed measurement unit. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->measurementUnit)) { - $json['measurement_unit'] = $this->measurementUnit; - } - if (!empty($this->precision)) { - $json['precision'] = $this->precision['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturn.php b/src/Models/OrderReturn.php deleted file mode 100644 index d7ece5b1..00000000 --- a/src/Models/OrderReturn.php +++ /dev/null @@ -1,380 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the return only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the return only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Order Id. - * An order that contains the original sale of these return line items. This is unset - * for unlinked returns. - */ - public function getSourceOrderId(): ?string - { - if (count($this->sourceOrderId) == 0) { - return null; - } - return $this->sourceOrderId['value']; - } - - /** - * Sets Source Order Id. - * An order that contains the original sale of these return line items. This is unset - * for unlinked returns. - * - * @maps source_order_id - */ - public function setSourceOrderId(?string $sourceOrderId): void - { - $this->sourceOrderId['value'] = $sourceOrderId; - } - - /** - * Unsets Source Order Id. - * An order that contains the original sale of these return line items. This is unset - * for unlinked returns. - */ - public function unsetSourceOrderId(): void - { - $this->sourceOrderId = []; - } - - /** - * Returns Return Line Items. - * A collection of line items that are being returned. - * - * @return OrderReturnLineItem[]|null - */ - public function getReturnLineItems(): ?array - { - if (count($this->returnLineItems) == 0) { - return null; - } - return $this->returnLineItems['value']; - } - - /** - * Sets Return Line Items. - * A collection of line items that are being returned. - * - * @maps return_line_items - * - * @param OrderReturnLineItem[]|null $returnLineItems - */ - public function setReturnLineItems(?array $returnLineItems): void - { - $this->returnLineItems['value'] = $returnLineItems; - } - - /** - * Unsets Return Line Items. - * A collection of line items that are being returned. - */ - public function unsetReturnLineItems(): void - { - $this->returnLineItems = []; - } - - /** - * Returns Return Service Charges. - * A collection of service charges that are being returned. - * - * @return OrderReturnServiceCharge[]|null - */ - public function getReturnServiceCharges(): ?array - { - if (count($this->returnServiceCharges) == 0) { - return null; - } - return $this->returnServiceCharges['value']; - } - - /** - * Sets Return Service Charges. - * A collection of service charges that are being returned. - * - * @maps return_service_charges - * - * @param OrderReturnServiceCharge[]|null $returnServiceCharges - */ - public function setReturnServiceCharges(?array $returnServiceCharges): void - { - $this->returnServiceCharges['value'] = $returnServiceCharges; - } - - /** - * Unsets Return Service Charges. - * A collection of service charges that are being returned. - */ - public function unsetReturnServiceCharges(): void - { - $this->returnServiceCharges = []; - } - - /** - * Returns Return Taxes. - * A collection of references to taxes being returned for an order, including the total - * applied tax amount to be returned. The taxes must reference a top-level tax ID from the source - * order. - * - * @return OrderReturnTax[]|null - */ - public function getReturnTaxes(): ?array - { - return $this->returnTaxes; - } - - /** - * Sets Return Taxes. - * A collection of references to taxes being returned for an order, including the total - * applied tax amount to be returned. The taxes must reference a top-level tax ID from the source - * order. - * - * @maps return_taxes - * - * @param OrderReturnTax[]|null $returnTaxes - */ - public function setReturnTaxes(?array $returnTaxes): void - { - $this->returnTaxes = $returnTaxes; - } - - /** - * Returns Return Discounts. - * A collection of references to discounts being returned for an order, including the total - * applied discount amount to be returned. The discounts must reference a top-level discount ID - * from the source order. - * - * @return OrderReturnDiscount[]|null - */ - public function getReturnDiscounts(): ?array - { - return $this->returnDiscounts; - } - - /** - * Sets Return Discounts. - * A collection of references to discounts being returned for an order, including the total - * applied discount amount to be returned. The discounts must reference a top-level discount ID - * from the source order. - * - * @maps return_discounts - * - * @param OrderReturnDiscount[]|null $returnDiscounts - */ - public function setReturnDiscounts(?array $returnDiscounts): void - { - $this->returnDiscounts = $returnDiscounts; - } - - /** - * Returns Return Tips. - * A collection of references to tips being returned for an order. - * - * @return OrderReturnTip[]|null - */ - public function getReturnTips(): ?array - { - if (count($this->returnTips) == 0) { - return null; - } - return $this->returnTips['value']; - } - - /** - * Sets Return Tips. - * A collection of references to tips being returned for an order. - * - * @maps return_tips - * - * @param OrderReturnTip[]|null $returnTips - */ - public function setReturnTips(?array $returnTips): void - { - $this->returnTips['value'] = $returnTips; - } - - /** - * Unsets Return Tips. - * A collection of references to tips being returned for an order. - */ - public function unsetReturnTips(): void - { - $this->returnTips = []; - } - - /** - * Returns Rounding Adjustment. - * A rounding adjustment of the money being returned. Commonly used to apply cash rounding - * when the minimum unit of the account is smaller than the lowest physical denomination of the - * currency. - */ - public function getRoundingAdjustment(): ?OrderRoundingAdjustment - { - return $this->roundingAdjustment; - } - - /** - * Sets Rounding Adjustment. - * A rounding adjustment of the money being returned. Commonly used to apply cash rounding - * when the minimum unit of the account is smaller than the lowest physical denomination of the - * currency. - * - * @maps rounding_adjustment - */ - public function setRoundingAdjustment(?OrderRoundingAdjustment $roundingAdjustment): void - { - $this->roundingAdjustment = $roundingAdjustment; - } - - /** - * Returns Return Amounts. - * A collection of various money amounts. - */ - public function getReturnAmounts(): ?OrderMoneyAmounts - { - return $this->returnAmounts; - } - - /** - * Sets Return Amounts. - * A collection of various money amounts. - * - * @maps return_amounts - */ - public function setReturnAmounts(?OrderMoneyAmounts $returnAmounts): void - { - $this->returnAmounts = $returnAmounts; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceOrderId)) { - $json['source_order_id'] = $this->sourceOrderId['value']; - } - if (!empty($this->returnLineItems)) { - $json['return_line_items'] = $this->returnLineItems['value']; - } - if (!empty($this->returnServiceCharges)) { - $json['return_service_charges'] = $this->returnServiceCharges['value']; - } - if (isset($this->returnTaxes)) { - $json['return_taxes'] = $this->returnTaxes; - } - if (isset($this->returnDiscounts)) { - $json['return_discounts'] = $this->returnDiscounts; - } - if (!empty($this->returnTips)) { - $json['return_tips'] = $this->returnTips['value']; - } - if (isset($this->roundingAdjustment)) { - $json['rounding_adjustment'] = $this->roundingAdjustment; - } - if (isset($this->returnAmounts)) { - $json['return_amounts'] = $this->returnAmounts; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnDiscount.php b/src/Models/OrderReturnDiscount.php deleted file mode 100644 index a1ad7cf8..00000000 --- a/src/Models/OrderReturnDiscount.php +++ /dev/null @@ -1,422 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the returned discount only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the returned discount only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Discount Uid. - * The discount `uid` from the order that contains the original application of this discount. - */ - public function getSourceDiscountUid(): ?string - { - if (count($this->sourceDiscountUid) == 0) { - return null; - } - return $this->sourceDiscountUid['value']; - } - - /** - * Sets Source Discount Uid. - * The discount `uid` from the order that contains the original application of this discount. - * - * @maps source_discount_uid - */ - public function setSourceDiscountUid(?string $sourceDiscountUid): void - { - $this->sourceDiscountUid['value'] = $sourceDiscountUid; - } - - /** - * Unsets Source Discount Uid. - * The discount `uid` from the order that contains the original application of this discount. - */ - public function unsetSourceDiscountUid(): void - { - $this->sourceDiscountUid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this discount references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this discount references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this discount references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The discount's name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The discount's name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The discount's name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Type. - * Indicates how the discount is applied to the associated line item or order. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates how the discount is applied to the associated line item or order. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * A value of `"7.25"` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * A value of `"7.25"` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * A value of `"7.25"` corresponds to a percentage of 7.25%. - * - * `percentage` is not set for amount-based discounts. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level discount. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level discount. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceDiscountUid)) { - $json['source_discount_uid'] = $this->sourceDiscountUid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnLineItem.php b/src/Models/OrderReturnLineItem.php deleted file mode 100644 index ffdf6467..00000000 --- a/src/Models/OrderReturnLineItem.php +++ /dev/null @@ -1,896 +0,0 @@ -quantity = $quantity; - } - - /** - * Returns Uid. - * A unique ID for this return line-item entry. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID for this return line-item entry. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID for this return line-item entry. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Line Item Uid. - * The `uid` of the line item in the original sale order. - */ - public function getSourceLineItemUid(): ?string - { - if (count($this->sourceLineItemUid) == 0) { - return null; - } - return $this->sourceLineItemUid['value']; - } - - /** - * Sets Source Line Item Uid. - * The `uid` of the line item in the original sale order. - * - * @maps source_line_item_uid - */ - public function setSourceLineItemUid(?string $sourceLineItemUid): void - { - $this->sourceLineItemUid['value'] = $sourceLineItemUid; - } - - /** - * Unsets Source Line Item Uid. - * The `uid` of the line item in the original sale order. - */ - public function unsetSourceLineItemUid(): void - { - $this->sourceLineItemUid = []; - } - - /** - * Returns Name. - * The name of the line item. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the line item. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the line item. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Quantity. - * The quantity returned, formatted as a decimal number. - * For example, `"3"`. - * - * Line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - */ - public function getQuantity(): string - { - return $this->quantity; - } - - /** - * Sets Quantity. - * The quantity returned, formatted as a decimal number. - * For example, `"3"`. - * - * Line items with a `quantity_unit` can have non-integer quantities. - * For example, `"1.70000"`. - * - * @required - * @maps quantity - */ - public function setQuantity(string $quantity): void - { - $this->quantity = $quantity; - } - - /** - * Returns Quantity Unit. - * Contains the measurement unit for a quantity and a precision that - * specifies the number of digits after the decimal point for decimal quantities. - */ - public function getQuantityUnit(): ?OrderQuantityUnit - { - return $this->quantityUnit; - } - - /** - * Sets Quantity Unit. - * Contains the measurement unit for a quantity and a precision that - * specifies the number of digits after the decimal point for decimal quantities. - * - * @maps quantity_unit - */ - public function setQuantityUnit(?OrderQuantityUnit $quantityUnit): void - { - $this->quantityUnit = $quantityUnit; - } - - /** - * Returns Note. - * The note of the return line item. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * The note of the return line item. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * The note of the return line item. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item. - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item. - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item. - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this line item references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this line item references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this line item references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Variation Name. - * The name of the variation applied to this return line item. - */ - public function getVariationName(): ?string - { - if (count($this->variationName) == 0) { - return null; - } - return $this->variationName['value']; - } - - /** - * Sets Variation Name. - * The name of the variation applied to this return line item. - * - * @maps variation_name - */ - public function setVariationName(?string $variationName): void - { - $this->variationName['value'] = $variationName; - } - - /** - * Unsets Variation Name. - * The name of the variation applied to this return line item. - */ - public function unsetVariationName(): void - { - $this->variationName = []; - } - - /** - * Returns Item Type. - * Represents the line item type. - */ - public function getItemType(): ?string - { - return $this->itemType; - } - - /** - * Sets Item Type. - * Represents the line item type. - * - * @maps item_type - */ - public function setItemType(?string $itemType): void - { - $this->itemType = $itemType; - } - - /** - * Returns Return Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - * - * @return OrderReturnLineItemModifier[]|null - */ - public function getReturnModifiers(): ?array - { - if (count($this->returnModifiers) == 0) { - return null; - } - return $this->returnModifiers['value']; - } - - /** - * Sets Return Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - * - * @maps return_modifiers - * - * @param OrderReturnLineItemModifier[]|null $returnModifiers - */ - public function setReturnModifiers(?array $returnModifiers): void - { - $this->returnModifiers['value'] = $returnModifiers; - } - - /** - * Unsets Return Modifiers. - * The [CatalogModifier](entity:CatalogModifier)s applied to this line item. - */ - public function unsetReturnModifiers(): void - { - $this->returnModifiers = []; - } - - /** - * Returns Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the return line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderReturnTax` applied to the return line item. On reads, the applied amount - * is populated. - * - * @return OrderLineItemAppliedTax[]|null - */ - public function getAppliedTaxes(): ?array - { - if (count($this->appliedTaxes) == 0) { - return null; - } - return $this->appliedTaxes['value']; - } - - /** - * Sets Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the return line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderReturnTax` applied to the return line item. On reads, the applied amount - * is populated. - * - * @maps applied_taxes - * - * @param OrderLineItemAppliedTax[]|null $appliedTaxes - */ - public function setAppliedTaxes(?array $appliedTaxes): void - { - $this->appliedTaxes['value'] = $appliedTaxes; - } - - /** - * Unsets Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the return line item. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderReturnTax` applied to the return line item. On reads, the applied amount - * is populated. - */ - public function unsetAppliedTaxes(): void - { - $this->appliedTaxes = []; - } - - /** - * Returns Applied Discounts. - * The list of references to `OrderReturnDiscount` entities applied to the return line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount - * is populated. - * - * @return OrderLineItemAppliedDiscount[]|null - */ - public function getAppliedDiscounts(): ?array - { - if (count($this->appliedDiscounts) == 0) { - return null; - } - return $this->appliedDiscounts['value']; - } - - /** - * Sets Applied Discounts. - * The list of references to `OrderReturnDiscount` entities applied to the return line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount - * is populated. - * - * @maps applied_discounts - * - * @param OrderLineItemAppliedDiscount[]|null $appliedDiscounts - */ - public function setAppliedDiscounts(?array $appliedDiscounts): void - { - $this->appliedDiscounts['value'] = $appliedDiscounts; - } - - /** - * Unsets Applied Discounts. - * The list of references to `OrderReturnDiscount` entities applied to the return line item. Each - * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level - * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount - * is populated. - */ - public function unsetAppliedDiscounts(): void - { - $this->appliedDiscounts = []; - } - - /** - * Returns Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBasePriceMoney(): ?Money - { - return $this->basePriceMoney; - } - - /** - * Sets Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps base_price_money - */ - public function setBasePriceMoney(?Money $basePriceMoney): void - { - $this->basePriceMoney = $basePriceMoney; - } - - /** - * Returns Variation Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getVariationTotalPriceMoney(): ?Money - { - return $this->variationTotalPriceMoney; - } - - /** - * Sets Variation Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps variation_total_price_money - */ - public function setVariationTotalPriceMoney(?Money $variationTotalPriceMoney): void - { - $this->variationTotalPriceMoney = $variationTotalPriceMoney; - } - - /** - * Returns Gross Return Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getGrossReturnMoney(): ?Money - { - return $this->grossReturnMoney; - } - - /** - * Sets Gross Return Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps gross_return_money - */ - public function setGrossReturnMoney(?Money $grossReturnMoney): void - { - $this->grossReturnMoney = $grossReturnMoney; - } - - /** - * Returns Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTaxMoney(): ?Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalDiscountMoney(): ?Money - { - return $this->totalDiscountMoney; - } - - /** - * Sets Total Discount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_discount_money - */ - public function setTotalDiscountMoney(?Money $totalDiscountMoney): void - { - $this->totalDiscountMoney = $totalDiscountMoney; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Applied Service Charges. - * The list of references to `OrderReturnServiceCharge` entities applied to the return - * line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that - * references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line - * item. On reads, the applied amount is populated. - * - * @return OrderLineItemAppliedServiceCharge[]|null - */ - public function getAppliedServiceCharges(): ?array - { - if (count($this->appliedServiceCharges) == 0) { - return null; - } - return $this->appliedServiceCharges['value']; - } - - /** - * Sets Applied Service Charges. - * The list of references to `OrderReturnServiceCharge` entities applied to the return - * line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that - * references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line - * item. On reads, the applied amount is populated. - * - * @maps applied_service_charges - * - * @param OrderLineItemAppliedServiceCharge[]|null $appliedServiceCharges - */ - public function setAppliedServiceCharges(?array $appliedServiceCharges): void - { - $this->appliedServiceCharges['value'] = $appliedServiceCharges; - } - - /** - * Unsets Applied Service Charges. - * The list of references to `OrderReturnServiceCharge` entities applied to the return - * line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that - * references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line - * item. On reads, the applied amount is populated. - */ - public function unsetAppliedServiceCharges(): void - { - $this->appliedServiceCharges = []; - } - - /** - * Returns Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalServiceChargeMoney(): ?Money - { - return $this->totalServiceChargeMoney; - } - - /** - * Sets Total Service Charge Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_service_charge_money - */ - public function setTotalServiceChargeMoney(?Money $totalServiceChargeMoney): void - { - $this->totalServiceChargeMoney = $totalServiceChargeMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceLineItemUid)) { - $json['source_line_item_uid'] = $this->sourceLineItemUid['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json['quantity'] = $this->quantity; - if (isset($this->quantityUnit)) { - $json['quantity_unit'] = $this->quantityUnit; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->variationName)) { - $json['variation_name'] = $this->variationName['value']; - } - if (isset($this->itemType)) { - $json['item_type'] = $this->itemType; - } - if (!empty($this->returnModifiers)) { - $json['return_modifiers'] = $this->returnModifiers['value']; - } - if (!empty($this->appliedTaxes)) { - $json['applied_taxes'] = $this->appliedTaxes['value']; - } - if (!empty($this->appliedDiscounts)) { - $json['applied_discounts'] = $this->appliedDiscounts['value']; - } - if (isset($this->basePriceMoney)) { - $json['base_price_money'] = $this->basePriceMoney; - } - if (isset($this->variationTotalPriceMoney)) { - $json['variation_total_price_money'] = $this->variationTotalPriceMoney; - } - if (isset($this->grossReturnMoney)) { - $json['gross_return_money'] = $this->grossReturnMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->totalDiscountMoney)) { - $json['total_discount_money'] = $this->totalDiscountMoney; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (!empty($this->appliedServiceCharges)) { - $json['applied_service_charges'] = $this->appliedServiceCharges['value']; - } - if (isset($this->totalServiceChargeMoney)) { - $json['total_service_charge_money'] = $this->totalServiceChargeMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnLineItemModifier.php b/src/Models/OrderReturnLineItemModifier.php deleted file mode 100644 index 41872714..00000000 --- a/src/Models/OrderReturnLineItemModifier.php +++ /dev/null @@ -1,373 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the return modifier only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the return modifier only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Modifier Uid. - * The modifier `uid` from the order's line item that contains the - * original sale of this line item modifier. - */ - public function getSourceModifierUid(): ?string - { - if (count($this->sourceModifierUid) == 0) { - return null; - } - return $this->sourceModifierUid['value']; - } - - /** - * Sets Source Modifier Uid. - * The modifier `uid` from the order's line item that contains the - * original sale of this line item modifier. - * - * @maps source_modifier_uid - */ - public function setSourceModifierUid(?string $sourceModifierUid): void - { - $this->sourceModifierUid['value'] = $sourceModifierUid; - } - - /** - * Unsets Source Modifier Uid. - * The modifier `uid` from the order's line item that contains the - * original sale of this line item modifier. - */ - public function unsetSourceModifierUid(): void - { - $this->sourceModifierUid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogModifier](entity:CatalogModifier). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this line item modifier references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this line item modifier references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this line item modifier references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The name of the item modifier. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the item modifier. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the item modifier. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getBasePriceMoney(): ?Money - { - return $this->basePriceMoney; - } - - /** - * Sets Base Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps base_price_money - */ - public function setBasePriceMoney(?Money $basePriceMoney): void - { - $this->basePriceMoney = $basePriceMoney; - } - - /** - * Returns Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalPriceMoney(): ?Money - { - return $this->totalPriceMoney; - } - - /** - * Sets Total Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_price_money - */ - public function setTotalPriceMoney(?Money $totalPriceMoney): void - { - $this->totalPriceMoney = $totalPriceMoney; - } - - /** - * Returns Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - */ - public function getQuantity(): ?string - { - if (count($this->quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - * - * @maps quantity - */ - public function setQuantity(?string $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The quantity of the line item modifier. The modifier quantity can be 0 or more. - * For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders - * this item, the restaurant records the purchase by creating an `Order` object with a line item - * for a burger. The line item includes a line item modifier: the name is cheese and the quantity - * is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses - * the extra cheese option, the modifier quantity increases to 2. If the buyer does not want - * any cheese, the modifier quantity is set to 0. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceModifierUid)) { - $json['source_modifier_uid'] = $this->sourceModifierUid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->basePriceMoney)) { - $json['base_price_money'] = $this->basePriceMoney; - } - if (isset($this->totalPriceMoney)) { - $json['total_price_money'] = $this->totalPriceMoney; - } - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnServiceCharge.php b/src/Models/OrderReturnServiceCharge.php deleted file mode 100644 index 5c0e05cd..00000000 --- a/src/Models/OrderReturnServiceCharge.php +++ /dev/null @@ -1,645 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the return service charge only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the return service charge only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Service Charge Uid. - * The service charge `uid` from the order containing the original - * service charge. `source_service_charge_uid` is `null` for - * unlinked returns. - */ - public function getSourceServiceChargeUid(): ?string - { - if (count($this->sourceServiceChargeUid) == 0) { - return null; - } - return $this->sourceServiceChargeUid['value']; - } - - /** - * Sets Source Service Charge Uid. - * The service charge `uid` from the order containing the original - * service charge. `source_service_charge_uid` is `null` for - * unlinked returns. - * - * @maps source_service_charge_uid - */ - public function setSourceServiceChargeUid(?string $sourceServiceChargeUid): void - { - $this->sourceServiceChargeUid['value'] = $sourceServiceChargeUid; - } - - /** - * Unsets Source Service Charge Uid. - * The service charge `uid` from the order containing the original - * service charge. `source_service_charge_uid` is `null` for - * unlinked returns. - */ - public function unsetSourceServiceChargeUid(): void - { - $this->sourceServiceChargeUid = []; - } - - /** - * Returns Name. - * The name of the service charge. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the service charge. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the service charge. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this service charge references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this service charge references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this service charge references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Percentage. - * The percentage of the service charge, as a string representation of - * a decimal number. For example, a value of `"7.25"` corresponds to a - * percentage of 7.25%. - * - * Either `percentage` or `amount_money` should be set, but not both. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the service charge, as a string representation of - * a decimal number. For example, a value of `"7.25"` corresponds to a - * percentage of 7.25%. - * - * Either `percentage` or `amount_money` should be set, but not both. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the service charge, as a string representation of - * a decimal number. For example, a value of `"7.25"` corresponds to a - * percentage of 7.25%. - * - * Either `percentage` or `amount_money` should be set, but not both. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTaxMoney(): ?Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Calculation Phase. - * Represents a phase in the process of calculating order totals. - * Service charges are applied after the indicated phase. - * - * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- - * api/how-it-works#how-totals-are-calculated) - */ - public function getCalculationPhase(): ?string - { - return $this->calculationPhase; - } - - /** - * Sets Calculation Phase. - * Represents a phase in the process of calculating order totals. - * Service charges are applied after the indicated phase. - * - * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- - * api/how-it-works#how-totals-are-calculated) - * - * @maps calculation_phase - */ - public function setCalculationPhase(?string $calculationPhase): void - { - $this->calculationPhase = $calculationPhase; - } - - /** - * Returns Taxable. - * Indicates whether the surcharge can be taxed. Service charges - * calculated in the `TOTAL_PHASE` cannot be marked as taxable. - */ - public function getTaxable(): ?bool - { - if (count($this->taxable) == 0) { - return null; - } - return $this->taxable['value']; - } - - /** - * Sets Taxable. - * Indicates whether the surcharge can be taxed. Service charges - * calculated in the `TOTAL_PHASE` cannot be marked as taxable. - * - * @maps taxable - */ - public function setTaxable(?bool $taxable): void - { - $this->taxable['value'] = $taxable; - } - - /** - * Unsets Taxable. - * Indicates whether the surcharge can be taxed. Service charges - * calculated in the `TOTAL_PHASE` cannot be marked as taxable. - */ - public function unsetTaxable(): void - { - $this->taxable = []; - } - - /** - * Returns Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the - * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` - * that references the `uid` of a top-level `OrderReturnTax` that is being - * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is - * populated. - * - * @return OrderLineItemAppliedTax[]|null - */ - public function getAppliedTaxes(): ?array - { - if (count($this->appliedTaxes) == 0) { - return null; - } - return $this->appliedTaxes['value']; - } - - /** - * Sets Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the - * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` - * that references the `uid` of a top-level `OrderReturnTax` that is being - * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is - * populated. - * - * @maps applied_taxes - * - * @param OrderLineItemAppliedTax[]|null $appliedTaxes - */ - public function setAppliedTaxes(?array $appliedTaxes): void - { - $this->appliedTaxes['value'] = $appliedTaxes; - } - - /** - * Unsets Applied Taxes. - * The list of references to `OrderReturnTax` entities applied to the - * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` - * that references the `uid` of a top-level `OrderReturnTax` that is being - * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is - * populated. - */ - public function unsetAppliedTaxes(): void - { - $this->appliedTaxes = []; - } - - /** - * Returns Treatment Type. - * Indicates whether the service charge will be treated as a value-holding line item or - * apportioned toward a line item. - */ - public function getTreatmentType(): ?string - { - return $this->treatmentType; - } - - /** - * Sets Treatment Type. - * Indicates whether the service charge will be treated as a value-holding line item or - * apportioned toward a line item. - * - * @maps treatment_type - */ - public function setTreatmentType(?string $treatmentType): void - { - $this->treatmentType = $treatmentType; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level apportioned - * service charge. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level apportioned - * service charge. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceServiceChargeUid)) { - $json['source_service_charge_uid'] = $this->sourceServiceChargeUid['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->calculationPhase)) { - $json['calculation_phase'] = $this->calculationPhase; - } - if (!empty($this->taxable)) { - $json['taxable'] = $this->taxable['value']; - } - if (!empty($this->appliedTaxes)) { - $json['applied_taxes'] = $this->appliedTaxes['value']; - } - if (isset($this->treatmentType)) { - $json['treatment_type'] = $this->treatmentType; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnTax.php b/src/Models/OrderReturnTax.php deleted file mode 100644 index ffa60e40..00000000 --- a/src/Models/OrderReturnTax.php +++ /dev/null @@ -1,375 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the returned tax only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the returned tax only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Source Tax Uid. - * The tax `uid` from the order that contains the original tax charge. - */ - public function getSourceTaxUid(): ?string - { - if (count($this->sourceTaxUid) == 0) { - return null; - } - return $this->sourceTaxUid['value']; - } - - /** - * Sets Source Tax Uid. - * The tax `uid` from the order that contains the original tax charge. - * - * @maps source_tax_uid - */ - public function setSourceTaxUid(?string $sourceTaxUid): void - { - $this->sourceTaxUid['value'] = $sourceTaxUid; - } - - /** - * Unsets Source Tax Uid. - * The tax `uid` from the order that contains the original tax charge. - */ - public function unsetSourceTaxUid(): void - { - $this->sourceTaxUid = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing [CatalogTax](entity:CatalogTax). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this tax references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this tax references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this tax references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Name. - * The tax's name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The tax's name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The tax's name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Type. - * Indicates how the tax is applied to the associated line item or order. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates how the tax is applied to the associated line item or order. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * For example, a value of `"7.25"` corresponds to a percentage of 7.25%. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * For example, a value of `"7.25"` corresponds to a percentage of 7.25%. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The percentage of the tax, as a string representation of a decimal number. - * For example, a value of `"7.25"` corresponds to a percentage of 7.25%. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level tax. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level tax. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->sourceTaxUid)) { - $json['source_tax_uid'] = $this->sourceTaxUid['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReturnTip.php b/src/Models/OrderReturnTip.php deleted file mode 100644 index b5e48809..00000000 --- a/src/Models/OrderReturnTip.php +++ /dev/null @@ -1,192 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the tip only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the tip only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Source Tender Uid. - * The tender `uid` from the order that contains the original application of this tip. - */ - public function getSourceTenderUid(): ?string - { - if (count($this->sourceTenderUid) == 0) { - return null; - } - return $this->sourceTenderUid['value']; - } - - /** - * Sets Source Tender Uid. - * The tender `uid` from the order that contains the original application of this tip. - * - * @maps source_tender_uid - */ - public function setSourceTenderUid(?string $sourceTenderUid): void - { - $this->sourceTenderUid['value'] = $sourceTenderUid; - } - - /** - * Unsets Source Tender Uid. - * The tender `uid` from the order that contains the original application of this tip. - */ - public function unsetSourceTenderUid(): void - { - $this->sourceTenderUid = []; - } - - /** - * Returns Source Tender Id. - * The tender `id` from the order that contains the original application of this tip. - */ - public function getSourceTenderId(): ?string - { - if (count($this->sourceTenderId) == 0) { - return null; - } - return $this->sourceTenderId['value']; - } - - /** - * Sets Source Tender Id. - * The tender `id` from the order that contains the original application of this tip. - * - * @maps source_tender_id - */ - public function setSourceTenderId(?string $sourceTenderId): void - { - $this->sourceTenderId['value'] = $sourceTenderId; - } - - /** - * Unsets Source Tender Id. - * The tender `id` from the order that contains the original application of this tip. - */ - public function unsetSourceTenderId(): void - { - $this->sourceTenderId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (!empty($this->sourceTenderUid)) { - $json['source_tender_uid'] = $this->sourceTenderUid['value']; - } - if (!empty($this->sourceTenderId)) { - $json['source_tender_id'] = $this->sourceTenderId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderReward.php b/src/Models/OrderReward.php deleted file mode 100644 index b5a1761e..00000000 --- a/src/Models/OrderReward.php +++ /dev/null @@ -1,97 +0,0 @@ -id = $id; - $this->rewardTierId = $rewardTierId; - } - - /** - * Returns Id. - * The identifier of the reward. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The identifier of the reward. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Reward Tier Id. - * The identifier of the reward tier corresponding to this reward. - */ - public function getRewardTierId(): string - { - return $this->rewardTierId; - } - - /** - * Sets Reward Tier Id. - * The identifier of the reward tier corresponding to this reward. - * - * @required - * @maps reward_tier_id - */ - public function setRewardTierId(string $rewardTierId): void - { - $this->rewardTierId = $rewardTierId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['reward_tier_id'] = $this->rewardTierId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderRoundingAdjustment.php b/src/Models/OrderRoundingAdjustment.php deleted file mode 100644 index 789ee5e4..00000000 --- a/src/Models/OrderRoundingAdjustment.php +++ /dev/null @@ -1,154 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the rounding adjustment only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the rounding adjustment only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Name. - * The name of the rounding adjustment from the original sale order. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the rounding adjustment from the original sale order. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the rounding adjustment from the original sale order. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderServiceCharge.php b/src/Models/OrderServiceCharge.php deleted file mode 100644 index 2ded4726..00000000 --- a/src/Models/OrderServiceCharge.php +++ /dev/null @@ -1,741 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * A unique ID that identifies the service charge only within this order. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * A unique ID that identifies the service charge only within this order. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Name. - * The name of the service charge. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the service charge. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the service charge. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Catalog Object Id. - * The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject). - */ - public function getCatalogObjectId(): ?string - { - if (count($this->catalogObjectId) == 0) { - return null; - } - return $this->catalogObjectId['value']; - } - - /** - * Sets Catalog Object Id. - * The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject). - * - * @maps catalog_object_id - */ - public function setCatalogObjectId(?string $catalogObjectId): void - { - $this->catalogObjectId['value'] = $catalogObjectId; - } - - /** - * Unsets Catalog Object Id. - * The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject). - */ - public function unsetCatalogObjectId(): void - { - $this->catalogObjectId = []; - } - - /** - * Returns Catalog Version. - * The version of the catalog object that this service charge references. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * The version of the catalog object that this service charge references. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * The version of the catalog object that this service charge references. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Percentage. - * The service charge percentage as a string representation of a - * decimal number. For example, `"7.25"` indicates a service charge of 7.25%. - * - * Exactly 1 of `percentage` or `amount_money` should be set. - */ - public function getPercentage(): ?string - { - if (count($this->percentage) == 0) { - return null; - } - return $this->percentage['value']; - } - - /** - * Sets Percentage. - * The service charge percentage as a string representation of a - * decimal number. For example, `"7.25"` indicates a service charge of 7.25%. - * - * Exactly 1 of `percentage` or `amount_money` should be set. - * - * @maps percentage - */ - public function setPercentage(?string $percentage): void - { - $this->percentage['value'] = $percentage; - } - - /** - * Unsets Percentage. - * The service charge percentage as a string representation of a - * decimal number. For example, `"7.25"` indicates a service charge of 7.25%. - * - * Exactly 1 of `percentage` or `amount_money` should be set. - */ - public function unsetPercentage(): void - { - $this->percentage = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppliedMoney(): ?Money - { - return $this->appliedMoney; - } - - /** - * Sets Applied Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps applied_money - */ - public function setAppliedMoney(?Money $appliedMoney): void - { - $this->appliedMoney = $appliedMoney; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalTaxMoney(): ?Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Calculation Phase. - * Represents a phase in the process of calculating order totals. - * Service charges are applied after the indicated phase. - * - * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- - * api/how-it-works#how-totals-are-calculated) - */ - public function getCalculationPhase(): ?string - { - return $this->calculationPhase; - } - - /** - * Sets Calculation Phase. - * Represents a phase in the process of calculating order totals. - * Service charges are applied after the indicated phase. - * - * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- - * api/how-it-works#how-totals-are-calculated) - * - * @maps calculation_phase - */ - public function setCalculationPhase(?string $calculationPhase): void - { - $this->calculationPhase = $calculationPhase; - } - - /** - * Returns Taxable. - * Indicates whether the service charge can be taxed. If set to `true`, - * order-level taxes automatically apply to the service charge. Note that - * service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. - */ - public function getTaxable(): ?bool - { - if (count($this->taxable) == 0) { - return null; - } - return $this->taxable['value']; - } - - /** - * Sets Taxable. - * Indicates whether the service charge can be taxed. If set to `true`, - * order-level taxes automatically apply to the service charge. Note that - * service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. - * - * @maps taxable - */ - public function setTaxable(?bool $taxable): void - { - $this->taxable['value'] = $taxable; - } - - /** - * Unsets Taxable. - * Indicates whether the service charge can be taxed. If set to `true`, - * order-level taxes automatically apply to the service charge. Note that - * service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. - */ - public function unsetTaxable(): void - { - $this->taxable = []; - } - - /** - * Returns Applied Taxes. - * The list of references to the taxes applied to this service charge. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied - * is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge - * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records - * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable - * service charge. Taxable service charges have the `taxable` field set to `true` and calculated - * in the `SUBTOTAL_PHASE`. - * - * To change the amount of a tax, modify the referenced top-level tax. - * - * @return OrderLineItemAppliedTax[]|null - */ - public function getAppliedTaxes(): ?array - { - if (count($this->appliedTaxes) == 0) { - return null; - } - return $this->appliedTaxes['value']; - } - - /** - * Sets Applied Taxes. - * The list of references to the taxes applied to this service charge. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied - * is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge - * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records - * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable - * service charge. Taxable service charges have the `taxable` field set to `true` and calculated - * in the `SUBTOTAL_PHASE`. - * - * To change the amount of a tax, modify the referenced top-level tax. - * - * @maps applied_taxes - * - * @param OrderLineItemAppliedTax[]|null $appliedTaxes - */ - public function setAppliedTaxes(?array $appliedTaxes): void - { - $this->appliedTaxes['value'] = $appliedTaxes; - } - - /** - * Unsets Applied Taxes. - * The list of references to the taxes applied to this service charge. Each - * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level - * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied - * is populated. - * - * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge - * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records - * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable - * service charge. Taxable service charges have the `taxable` field set to `true` and calculated - * in the `SUBTOTAL_PHASE`. - * - * To change the amount of a tax, modify the referenced top-level tax. - */ - public function unsetAppliedTaxes(): void - { - $this->appliedTaxes = []; - } - - /** - * Returns Metadata. - * Application-defined data attached to this service charge. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @return array|null - */ - public function getMetadata(): ?array - { - if (count($this->metadata) == 0) { - return null; - } - return $this->metadata['value']; - } - - /** - * Sets Metadata. - * Application-defined data attached to this service charge. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - * - * @maps metadata - * - * @param array|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata['value'] = $metadata; - } - - /** - * Unsets Metadata. - * Application-defined data attached to this service charge. Metadata fields are intended - * to store descriptive references or associations with an entity in another system or store brief - * information about the object. Square does not process this field; it only stores and returns it - * in relevant API calls. Do not use metadata to store any sensitive information (such as personally - * identifiable information or card details). - * - * Keys written by applications must be 60 characters or less and must be in the character set - * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed - * with a namespace, separated from the key with a ':' character. - * - * Values have a maximum length of 255 characters. - * - * An application can have up to 10 entries per metadata field. - * - * Entries written by applications are private and can only be read or modified by the same - * application. - * - * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). - */ - public function unsetMetadata(): void - { - $this->metadata = []; - } - - /** - * Returns Type. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Treatment Type. - * Indicates whether the service charge will be treated as a value-holding line item or - * apportioned toward a line item. - */ - public function getTreatmentType(): ?string - { - return $this->treatmentType; - } - - /** - * Sets Treatment Type. - * Indicates whether the service charge will be treated as a value-holding line item or - * apportioned toward a line item. - * - * @maps treatment_type - */ - public function setTreatmentType(?string $treatmentType): void - { - $this->treatmentType = $treatmentType; - } - - /** - * Returns Scope. - * Indicates whether this is a line-item or order-level apportioned - * service charge. - */ - public function getScope(): ?string - { - return $this->scope; - } - - /** - * Sets Scope. - * Indicates whether this is a line-item or order-level apportioned - * service charge. - * - * @maps scope - */ - public function setScope(?string $scope): void - { - $this->scope = $scope; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->catalogObjectId)) { - $json['catalog_object_id'] = $this->catalogObjectId['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->percentage)) { - $json['percentage'] = $this->percentage['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->appliedMoney)) { - $json['applied_money'] = $this->appliedMoney; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->calculationPhase)) { - $json['calculation_phase'] = $this->calculationPhase; - } - if (!empty($this->taxable)) { - $json['taxable'] = $this->taxable['value']; - } - if (!empty($this->appliedTaxes)) { - $json['applied_taxes'] = $this->appliedTaxes['value']; - } - if (!empty($this->metadata)) { - $json['metadata'] = $this->metadata['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->treatmentType)) { - $json['treatment_type'] = $this->treatmentType; - } - if (isset($this->scope)) { - $json['scope'] = $this->scope; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderServiceChargeCalculationPhase.php b/src/Models/OrderServiceChargeCalculationPhase.php deleted file mode 100644 index da0cc194..00000000 --- a/src/Models/OrderServiceChargeCalculationPhase.php +++ /dev/null @@ -1,41 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name used to identify the place (physical or digital) that an order originates. - * If unset, the name defaults to the name of the application that created the order. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name used to identify the place (physical or digital) that an order originates. - * If unset, the name defaults to the name of the application that created the order. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderState.php b/src/Models/OrderState.php deleted file mode 100644 index c8f65554..00000000 --- a/src/Models/OrderState.php +++ /dev/null @@ -1,34 +0,0 @@ -orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The order's unique ID. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The order's unique ID. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is committed to the order. - * Orders that were not created through the API do not include a version number and - * therefore cannot be updated. - * - * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders) - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Location Id. - * The ID of the seller location that this order is associated with. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the seller location that this order is associated with. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the seller location that this order is associated with. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns State. - * The state of the order. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * The state of the order. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Created At. - * The timestamp for when the order was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the order was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp for when the order was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp for when the order was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/OrderUpdatedObject.php b/src/Models/OrderUpdatedObject.php deleted file mode 100644 index 5b515524..00000000 --- a/src/Models/OrderUpdatedObject.php +++ /dev/null @@ -1,55 +0,0 @@ -orderUpdated; - } - - /** - * Sets Order Updated. - * - * @maps order_updated - */ - public function setOrderUpdated(?OrderUpdated $orderUpdated): void - { - $this->orderUpdated = $orderUpdated; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orderUpdated)) { - $json['order_updated'] = $this->orderUpdated; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaginationCursor.php b/src/Models/PaginationCursor.php deleted file mode 100644 index f523ff3a..00000000 --- a/src/Models/PaginationCursor.php +++ /dev/null @@ -1,76 +0,0 @@ -orderValue) == 0) { - return null; - } - return $this->orderValue['value']; - } - - /** - * Sets Order Value. - * The ID of the last resource in the current page. The page can be in an ascending or - * descending order - * - * @maps order_value - */ - public function setOrderValue(?string $orderValue): void - { - $this->orderValue['value'] = $orderValue; - } - - /** - * Unsets Order Value. - * The ID of the last resource in the current page. The page can be in an ascending or - * descending order - */ - public function unsetOrderValue(): void - { - $this->orderValue = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orderValue)) { - $json['order_value'] = $this->orderValue['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PauseSubscriptionRequest.php b/src/Models/PauseSubscriptionRequest.php deleted file mode 100644 index 8f954ca8..00000000 --- a/src/Models/PauseSubscriptionRequest.php +++ /dev/null @@ -1,245 +0,0 @@ -pauseEffectiveDate) == 0) { - return null; - } - return $this->pauseEffectiveDate['value']; - } - - /** - * Sets Pause Effective Date. - * The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription. - * - * When this date is unspecified or falls within the current billing cycle, the subscription is paused - * on the starting date of the next billing cycle. - * - * @maps pause_effective_date - */ - public function setPauseEffectiveDate(?string $pauseEffectiveDate): void - { - $this->pauseEffectiveDate['value'] = $pauseEffectiveDate; - } - - /** - * Unsets Pause Effective Date. - * The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription. - * - * When this date is unspecified or falls within the current billing cycle, the subscription is paused - * on the starting date of the next billing cycle. - */ - public function unsetPauseEffectiveDate(): void - { - $this->pauseEffectiveDate = []; - } - - /** - * Returns Pause Cycle Duration. - * The number of billing cycles the subscription will be paused before it is reactivated. - * - * When this is set, a `RESUME` action is also scheduled to take place on the subscription at - * the end of the specified pause cycle duration. In this case, neither `resume_effective_date` - * nor `resume_change_timing` may be specified. - */ - public function getPauseCycleDuration(): ?int - { - if (count($this->pauseCycleDuration) == 0) { - return null; - } - return $this->pauseCycleDuration['value']; - } - - /** - * Sets Pause Cycle Duration. - * The number of billing cycles the subscription will be paused before it is reactivated. - * - * When this is set, a `RESUME` action is also scheduled to take place on the subscription at - * the end of the specified pause cycle duration. In this case, neither `resume_effective_date` - * nor `resume_change_timing` may be specified. - * - * @maps pause_cycle_duration - */ - public function setPauseCycleDuration(?int $pauseCycleDuration): void - { - $this->pauseCycleDuration['value'] = $pauseCycleDuration; - } - - /** - * Unsets Pause Cycle Duration. - * The number of billing cycles the subscription will be paused before it is reactivated. - * - * When this is set, a `RESUME` action is also scheduled to take place on the subscription at - * the end of the specified pause cycle duration. In this case, neither `resume_effective_date` - * nor `resume_change_timing` may be specified. - */ - public function unsetPauseCycleDuration(): void - { - $this->pauseCycleDuration = []; - } - - /** - * Returns Resume Effective Date. - * The date when the subscription is reactivated by a scheduled `RESUME` action. - * This date must be at least one billing cycle ahead of `pause_effective_date`. - */ - public function getResumeEffectiveDate(): ?string - { - if (count($this->resumeEffectiveDate) == 0) { - return null; - } - return $this->resumeEffectiveDate['value']; - } - - /** - * Sets Resume Effective Date. - * The date when the subscription is reactivated by a scheduled `RESUME` action. - * This date must be at least one billing cycle ahead of `pause_effective_date`. - * - * @maps resume_effective_date - */ - public function setResumeEffectiveDate(?string $resumeEffectiveDate): void - { - $this->resumeEffectiveDate['value'] = $resumeEffectiveDate; - } - - /** - * Unsets Resume Effective Date. - * The date when the subscription is reactivated by a scheduled `RESUME` action. - * This date must be at least one billing cycle ahead of `pause_effective_date`. - */ - public function unsetResumeEffectiveDate(): void - { - $this->resumeEffectiveDate = []; - } - - /** - * Returns Resume Change Timing. - * Supported timings when a pending change, as an action, takes place to a subscription. - */ - public function getResumeChangeTiming(): ?string - { - return $this->resumeChangeTiming; - } - - /** - * Sets Resume Change Timing. - * Supported timings when a pending change, as an action, takes place to a subscription. - * - * @maps resume_change_timing - */ - public function setResumeChangeTiming(?string $resumeChangeTiming): void - { - $this->resumeChangeTiming = $resumeChangeTiming; - } - - /** - * Returns Pause Reason. - * The user-provided reason to pause the subscription. - */ - public function getPauseReason(): ?string - { - if (count($this->pauseReason) == 0) { - return null; - } - return $this->pauseReason['value']; - } - - /** - * Sets Pause Reason. - * The user-provided reason to pause the subscription. - * - * @maps pause_reason - */ - public function setPauseReason(?string $pauseReason): void - { - $this->pauseReason['value'] = $pauseReason; - } - - /** - * Unsets Pause Reason. - * The user-provided reason to pause the subscription. - */ - public function unsetPauseReason(): void - { - $this->pauseReason = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->pauseEffectiveDate)) { - $json['pause_effective_date'] = $this->pauseEffectiveDate['value']; - } - if (!empty($this->pauseCycleDuration)) { - $json['pause_cycle_duration'] = $this->pauseCycleDuration['value']; - } - if (!empty($this->resumeEffectiveDate)) { - $json['resume_effective_date'] = $this->resumeEffectiveDate['value']; - } - if (isset($this->resumeChangeTiming)) { - $json['resume_change_timing'] = $this->resumeChangeTiming; - } - if (!empty($this->pauseReason)) { - $json['pause_reason'] = $this->pauseReason['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PauseSubscriptionResponse.php b/src/Models/PauseSubscriptionResponse.php deleted file mode 100644 index 4479d7f6..00000000 --- a/src/Models/PauseSubscriptionResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Returns Actions. - * The list of a `PAUSE` action and a possible `RESUME` action created by the request. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - return $this->actions; - } - - /** - * Sets Actions. - * The list of a `PAUSE` action and a possible `RESUME` action created by the request. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions = $actions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - if (isset($this->actions)) { - $json['actions'] = $this->actions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PayOrderRequest.php b/src/Models/PayOrderRequest.php deleted file mode 100644 index 32596edd..00000000 --- a/src/Models/PayOrderRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this request among requests you have sent. If - * you are unsure whether a particular payment request was completed successfully, you can reattempt - * it with the same idempotency key without worrying about duplicate payments. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this request among requests you have sent. If - * you are unsure whether a particular payment request was completed successfully, you can reattempt - * it with the same idempotency key without worrying about duplicate payments. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Order Version. - * The version of the order being paid. If not supplied, the latest version will be paid. - */ - public function getOrderVersion(): ?int - { - if (count($this->orderVersion) == 0) { - return null; - } - return $this->orderVersion['value']; - } - - /** - * Sets Order Version. - * The version of the order being paid. If not supplied, the latest version will be paid. - * - * @maps order_version - */ - public function setOrderVersion(?int $orderVersion): void - { - $this->orderVersion['value'] = $orderVersion; - } - - /** - * Unsets Order Version. - * The version of the order being paid. If not supplied, the latest version will be paid. - */ - public function unsetOrderVersion(): void - { - $this->orderVersion = []; - } - - /** - * Returns Payment Ids. - * The IDs of the [payments](entity:Payment) to collect. - * The payment total must match the order total. - * - * @return string[]|null - */ - public function getPaymentIds(): ?array - { - if (count($this->paymentIds) == 0) { - return null; - } - return $this->paymentIds['value']; - } - - /** - * Sets Payment Ids. - * The IDs of the [payments](entity:Payment) to collect. - * The payment total must match the order total. - * - * @maps payment_ids - * - * @param string[]|null $paymentIds - */ - public function setPaymentIds(?array $paymentIds): void - { - $this->paymentIds['value'] = $paymentIds; - } - - /** - * Unsets Payment Ids. - * The IDs of the [payments](entity:Payment) to collect. - * The payment total must match the order total. - */ - public function unsetPaymentIds(): void - { - $this->paymentIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - if (!empty($this->orderVersion)) { - $json['order_version'] = $this->orderVersion['value']; - } - if (!empty($this->paymentIds)) { - $json['payment_ids'] = $this->paymentIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PayOrderResponse.php b/src/Models/PayOrderResponse.php deleted file mode 100644 index 294e9622..00000000 --- a/src/Models/PayOrderResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - */ - public function getOrder(): ?Order - { - return $this->order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Payment.php b/src/Models/Payment.php deleted file mode 100644 index df4a3dff..00000000 --- a/src/Models/Payment.php +++ /dev/null @@ -1,1519 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID for the payment. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Created At. - * The timestamp of when the payment was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the payment was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the payment was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the payment was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTipMoney(): ?Money - { - return $this->tipMoney; - } - - /** - * Sets Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tip_money - */ - public function setTipMoney(?Money $tipMoney): void - { - $this->tipMoney = $tipMoney; - } - - /** - * Returns Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTotalMoney(): ?Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps total_money - */ - public function setTotalMoney(?Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Approved Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getApprovedMoney(): ?Money - { - return $this->approvedMoney; - } - - /** - * Sets Approved Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps approved_money - */ - public function setApprovedMoney(?Money $approvedMoney): void - { - $this->approvedMoney = $approvedMoney; - } - - /** - * Returns Processing Fee. - * The processing fees and fee adjustments assessed by Square for this payment. - * - * @return ProcessingFee[]|null - */ - public function getProcessingFee(): ?array - { - return $this->processingFee; - } - - /** - * Sets Processing Fee. - * The processing fees and fee adjustments assessed by Square for this payment. - * - * @maps processing_fee - * - * @param ProcessingFee[]|null $processingFee - */ - public function setProcessingFee(?array $processingFee): void - { - $this->processingFee = $processingFee; - } - - /** - * Returns Refunded Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getRefundedMoney(): ?Money - { - return $this->refundedMoney; - } - - /** - * Sets Refunded Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps refunded_money - */ - public function setRefundedMoney(?Money $refundedMoney): void - { - $this->refundedMoney = $refundedMoney; - } - - /** - * Returns Status. - * Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Delay Duration. - * The duration of time after the payment's creation when Square automatically applies the - * `delay_action` to the payment. This automatic `delay_action` applies only to payments that - * do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration` - * time period. - * - * This field is specified as a time duration, in RFC 3339 format. - * - * Notes: - * This feature is only supported for card payments. - * - * Default: - * - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - */ - public function getDelayDuration(): ?string - { - return $this->delayDuration; - } - - /** - * Sets Delay Duration. - * The duration of time after the payment's creation when Square automatically applies the - * `delay_action` to the payment. This automatic `delay_action` applies only to payments that - * do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration` - * time period. - * - * This field is specified as a time duration, in RFC 3339 format. - * - * Notes: - * This feature is only supported for card payments. - * - * Default: - * - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - * - * @maps delay_duration - */ - public function setDelayDuration(?string $delayDuration): void - { - $this->delayDuration = $delayDuration; - } - - /** - * Returns Delay Action. - * The action to be applied to the payment when the `delay_duration` has elapsed. - * - * Current values include `CANCEL` and `COMPLETE`. - */ - public function getDelayAction(): ?string - { - if (count($this->delayAction) == 0) { - return null; - } - return $this->delayAction['value']; - } - - /** - * Sets Delay Action. - * The action to be applied to the payment when the `delay_duration` has elapsed. - * - * Current values include `CANCEL` and `COMPLETE`. - * - * @maps delay_action - */ - public function setDelayAction(?string $delayAction): void - { - $this->delayAction['value'] = $delayAction; - } - - /** - * Unsets Delay Action. - * The action to be applied to the payment when the `delay_duration` has elapsed. - * - * Current values include `CANCEL` and `COMPLETE`. - */ - public function unsetDelayAction(): void - { - $this->delayAction = []; - } - - /** - * Returns Delayed Until. - * The read-only timestamp of when the `delay_action` is automatically applied, - * in RFC 3339 format. - * - * Note that this field is calculated by summing the payment's `delay_duration` and `created_at` - * fields. The `created_at` field is generated by Square and might not exactly match the - * time on your local machine. - */ - public function getDelayedUntil(): ?string - { - return $this->delayedUntil; - } - - /** - * Sets Delayed Until. - * The read-only timestamp of when the `delay_action` is automatically applied, - * in RFC 3339 format. - * - * Note that this field is calculated by summing the payment's `delay_duration` and `created_at` - * fields. The `created_at` field is generated by Square and might not exactly match the - * time on your local machine. - * - * @maps delayed_until - */ - public function setDelayedUntil(?string $delayedUntil): void - { - $this->delayedUntil = $delayedUntil; - } - - /** - * Returns Source Type. - * The source type for this payment. - * - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, - * `CASH` and `EXTERNAL`. For information about these payment source types, - * see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - */ - public function getSourceType(): ?string - { - return $this->sourceType; - } - - /** - * Sets Source Type. - * The source type for this payment. - * - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, - * `CASH` and `EXTERNAL`. For information about these payment source types, - * see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - * - * @maps source_type - */ - public function setSourceType(?string $sourceType): void - { - $this->sourceType = $sourceType; - } - - /** - * Returns Card Details. - * Reflects the current status of a card payment. Contains only non-confidential information. - */ - public function getCardDetails(): ?CardPaymentDetails - { - return $this->cardDetails; - } - - /** - * Sets Card Details. - * Reflects the current status of a card payment. Contains only non-confidential information. - * - * @maps card_details - */ - public function setCardDetails(?CardPaymentDetails $cardDetails): void - { - $this->cardDetails = $cardDetails; - } - - /** - * Returns Cash Details. - * Stores details about a cash payment. Contains only non-confidential information. For more - * information, see - * [Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). - */ - public function getCashDetails(): ?CashPaymentDetails - { - return $this->cashDetails; - } - - /** - * Sets Cash Details. - * Stores details about a cash payment. Contains only non-confidential information. For more - * information, see - * [Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). - * - * @maps cash_details - */ - public function setCashDetails(?CashPaymentDetails $cashDetails): void - { - $this->cashDetails = $cashDetails; - } - - /** - * Returns Bank Account Details. - * Additional details about BANK_ACCOUNT type payments. - */ - public function getBankAccountDetails(): ?BankAccountPaymentDetails - { - return $this->bankAccountDetails; - } - - /** - * Sets Bank Account Details. - * Additional details about BANK_ACCOUNT type payments. - * - * @maps bank_account_details - */ - public function setBankAccountDetails(?BankAccountPaymentDetails $bankAccountDetails): void - { - $this->bankAccountDetails = $bankAccountDetails; - } - - /** - * Returns External Details. - * Stores details about an external payment. Contains only non-confidential information. - * For more information, see - * [Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external- - * payments). - */ - public function getExternalDetails(): ?ExternalPaymentDetails - { - return $this->externalDetails; - } - - /** - * Sets External Details. - * Stores details about an external payment. Contains only non-confidential information. - * For more information, see - * [Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external- - * payments). - * - * @maps external_details - */ - public function setExternalDetails(?ExternalPaymentDetails $externalDetails): void - { - $this->externalDetails = $externalDetails; - } - - /** - * Returns Wallet Details. - * Additional details about `WALLET` type payments. Contains only non-confidential information. - */ - public function getWalletDetails(): ?DigitalWalletDetails - { - return $this->walletDetails; - } - - /** - * Sets Wallet Details. - * Additional details about `WALLET` type payments. Contains only non-confidential information. - * - * @maps wallet_details - */ - public function setWalletDetails(?DigitalWalletDetails $walletDetails): void - { - $this->walletDetails = $walletDetails; - } - - /** - * Returns Buy Now Pay Later Details. - * Additional details about a Buy Now Pay Later payment type. - */ - public function getBuyNowPayLaterDetails(): ?BuyNowPayLaterDetails - { - return $this->buyNowPayLaterDetails; - } - - /** - * Sets Buy Now Pay Later Details. - * Additional details about a Buy Now Pay Later payment type. - * - * @maps buy_now_pay_later_details - */ - public function setBuyNowPayLaterDetails(?BuyNowPayLaterDetails $buyNowPayLaterDetails): void - { - $this->buyNowPayLaterDetails = $buyNowPayLaterDetails; - } - - /** - * Returns Square Account Details. - * Additional details about Square Account payments. - */ - public function getSquareAccountDetails(): ?SquareAccountDetails - { - return $this->squareAccountDetails; - } - - /** - * Sets Square Account Details. - * Additional details about Square Account payments. - * - * @maps square_account_details - */ - public function setSquareAccountDetails(?SquareAccountDetails $squareAccountDetails): void - { - $this->squareAccountDetails = $squareAccountDetails; - } - - /** - * Returns Location Id. - * The ID of the location associated with the payment. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location associated with the payment. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Order Id. - * The ID of the order associated with the payment. - */ - public function getOrderId(): ?string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the order associated with the payment. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Returns Reference Id. - * An optional ID that associates the payment with an entity in - * another system. - */ - public function getReferenceId(): ?string - { - return $this->referenceId; - } - - /** - * Sets Reference Id. - * An optional ID that associates the payment with an entity in - * another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId = $referenceId; - } - - /** - * Returns Customer Id. - * The ID of the customer associated with the payment. If the ID is - * not provided in the `CreatePayment` request that was used to create the `Payment`, - * Square may use information in the request - * (such as the billing and shipping address, email address, and payment source) - * to identify a matching customer profile in the Customer Directory. - * If found, the profile ID is used. If a profile is not found, the - * API attempts to create an - * [instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). - * If the API cannot create an - * instant profile (either because the seller has disabled it or the - * seller's region prevents creating it), this field remains unset. Note that - * this process is asynchronous and it may take some time before a - * customer ID is added to the payment. - */ - public function getCustomerId(): ?string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the customer associated with the payment. If the ID is - * not provided in the `CreatePayment` request that was used to create the `Payment`, - * Square may use information in the request - * (such as the billing and shipping address, email address, and payment source) - * to identify a matching customer profile in the Customer Directory. - * If found, the profile ID is used. If a profile is not found, the - * API attempts to create an - * [instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). - * If the API cannot create an - * instant profile (either because the seller has disabled it or the - * seller's region prevents creating it), this field remains unset. Note that - * this process is asynchronous and it may take some time before a - * customer ID is added to the payment. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Employee Id. - * __Deprecated__: Use `Payment.team_member_id` instead. - * - * An optional ID of the employee associated with taking the payment. - */ - public function getEmployeeId(): ?string - { - return $this->employeeId; - } - - /** - * Sets Employee Id. - * __Deprecated__: Use `Payment.team_member_id` instead. - * - * An optional ID of the employee associated with taking the payment. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId = $employeeId; - } - - /** - * Returns Team Member Id. - * An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Refund Ids. - * A list of `refund_id`s identifying refunds for the payment. - * - * @return string[]|null - */ - public function getRefundIds(): ?array - { - return $this->refundIds; - } - - /** - * Sets Refund Ids. - * A list of `refund_id`s identifying refunds for the payment. - * - * @maps refund_ids - * - * @param string[]|null $refundIds - */ - public function setRefundIds(?array $refundIds): void - { - $this->refundIds = $refundIds; - } - - /** - * Returns Risk Evaluation. - * Represents fraud risk information for the associated payment. - * - * When you take a payment through Square's Payments API (using the `CreatePayment` - * endpoint), Square evaluates it and assigns a risk level to the payment. Sellers - * can use this information to determine the course of action (for example, - * provide the goods/services or refund the payment). - */ - public function getRiskEvaluation(): ?RiskEvaluation - { - return $this->riskEvaluation; - } - - /** - * Sets Risk Evaluation. - * Represents fraud risk information for the associated payment. - * - * When you take a payment through Square's Payments API (using the `CreatePayment` - * endpoint), Square evaluates it and assigns a risk level to the payment. Sellers - * can use this information to determine the course of action (for example, - * provide the goods/services or refund the payment). - * - * @maps risk_evaluation - */ - public function setRiskEvaluation(?RiskEvaluation $riskEvaluation): void - { - $this->riskEvaluation = $riskEvaluation; - } - - /** - * Returns Terminal Checkout Id. - * An optional ID for a Terminal checkout that is associated with the payment. - */ - public function getTerminalCheckoutId(): ?string - { - return $this->terminalCheckoutId; - } - - /** - * Sets Terminal Checkout Id. - * An optional ID for a Terminal checkout that is associated with the payment. - * - * @maps terminal_checkout_id - */ - public function setTerminalCheckoutId(?string $terminalCheckoutId): void - { - $this->terminalCheckoutId = $terminalCheckoutId; - } - - /** - * Returns Buyer Email Address. - * The buyer's email address. - */ - public function getBuyerEmailAddress(): ?string - { - return $this->buyerEmailAddress; - } - - /** - * Sets Buyer Email Address. - * The buyer's email address. - * - * @maps buyer_email_address - */ - public function setBuyerEmailAddress(?string $buyerEmailAddress): void - { - $this->buyerEmailAddress = $buyerEmailAddress; - } - - /** - * Returns Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBillingAddress(): ?Address - { - return $this->billingAddress; - } - - /** - * Sets Billing Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps billing_address - */ - public function setBillingAddress(?Address $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * Returns Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getShippingAddress(): ?Address - { - return $this->shippingAddress; - } - - /** - * Sets Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps shipping_address - */ - public function setShippingAddress(?Address $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * Returns Note. - * An optional note to include when creating a payment. - */ - public function getNote(): ?string - { - return $this->note; - } - - /** - * Sets Note. - * An optional note to include when creating a payment. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note = $note; - } - - /** - * Returns Statement Description Identifier. - * Additional payment information that gets added to the customer's card statement - * as part of the statement description. - * - * Note that the `statement_description_identifier` might get truncated on the statement description - * to fit the required information including the Square identifier (SQ *) and the name of the - * seller taking the payment. - */ - public function getStatementDescriptionIdentifier(): ?string - { - return $this->statementDescriptionIdentifier; - } - - /** - * Sets Statement Description Identifier. - * Additional payment information that gets added to the customer's card statement - * as part of the statement description. - * - * Note that the `statement_description_identifier` might get truncated on the statement description - * to fit the required information including the Square identifier (SQ *) and the name of the - * seller taking the payment. - * - * @maps statement_description_identifier - */ - public function setStatementDescriptionIdentifier(?string $statementDescriptionIdentifier): void - { - $this->statementDescriptionIdentifier = $statementDescriptionIdentifier; - } - - /** - * Returns Capabilities. - * Actions that can be performed on this payment: - * - `EDIT_AMOUNT_UP` - The payment amount can be edited up. - * - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. - * - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. - * - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. - * - `EDIT_DELAY_ACTION` - The delay_action can be edited. - * - * @return string[]|null - */ - public function getCapabilities(): ?array - { - return $this->capabilities; - } - - /** - * Sets Capabilities. - * Actions that can be performed on this payment: - * - `EDIT_AMOUNT_UP` - The payment amount can be edited up. - * - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. - * - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. - * - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. - * - `EDIT_DELAY_ACTION` - The delay_action can be edited. - * - * @maps capabilities - * - * @param string[]|null $capabilities - */ - public function setCapabilities(?array $capabilities): void - { - $this->capabilities = $capabilities; - } - - /** - * Returns Receipt Number. - * The payment's receipt number. - * The field is missing if a payment is canceled. - */ - public function getReceiptNumber(): ?string - { - return $this->receiptNumber; - } - - /** - * Sets Receipt Number. - * The payment's receipt number. - * The field is missing if a payment is canceled. - * - * @maps receipt_number - */ - public function setReceiptNumber(?string $receiptNumber): void - { - $this->receiptNumber = $receiptNumber; - } - - /** - * Returns Receipt Url. - * The URL for the payment's receipt. - * The field is only populated for COMPLETED payments. - */ - public function getReceiptUrl(): ?string - { - return $this->receiptUrl; - } - - /** - * Sets Receipt Url. - * The URL for the payment's receipt. - * The field is only populated for COMPLETED payments. - * - * @maps receipt_url - */ - public function setReceiptUrl(?string $receiptUrl): void - { - $this->receiptUrl = $receiptUrl; - } - - /** - * Returns Device Details. - * Details about the device that took the payment. - */ - public function getDeviceDetails(): ?DeviceDetails - { - return $this->deviceDetails; - } - - /** - * Sets Device Details. - * Details about the device that took the payment. - * - * @maps device_details - */ - public function setDeviceDetails(?DeviceDetails $deviceDetails): void - { - $this->deviceDetails = $deviceDetails; - } - - /** - * Returns Application Details. - * Details about the application that took the payment. - */ - public function getApplicationDetails(): ?ApplicationDetails - { - return $this->applicationDetails; - } - - /** - * Sets Application Details. - * Details about the application that took the payment. - * - * @maps application_details - */ - public function setApplicationDetails(?ApplicationDetails $applicationDetails): void - { - $this->applicationDetails = $applicationDetails; - } - - /** - * Returns Is Offline Payment. - * Whether or not this payment was taken offline. - */ - public function getIsOfflinePayment(): ?bool - { - return $this->isOfflinePayment; - } - - /** - * Sets Is Offline Payment. - * Whether or not this payment was taken offline. - * - * @maps is_offline_payment - */ - public function setIsOfflinePayment(?bool $isOfflinePayment): void - { - $this->isOfflinePayment = $isOfflinePayment; - } - - /** - * Returns Offline Payment Details. - * Details specific to offline payments. - */ - public function getOfflinePaymentDetails(): ?OfflinePaymentDetails - { - return $this->offlinePaymentDetails; - } - - /** - * Sets Offline Payment Details. - * Details specific to offline payments. - * - * @maps offline_payment_details - */ - public function setOfflinePaymentDetails(?OfflinePaymentDetails $offlinePaymentDetails): void - { - $this->offlinePaymentDetails = $offlinePaymentDetails; - } - - /** - * Returns Version Token. - * Used for optimistic concurrency. This opaque token identifies a specific version of the - * `Payment` object. - */ - public function getVersionToken(): ?string - { - if (count($this->versionToken) == 0) { - return null; - } - return $this->versionToken['value']; - } - - /** - * Sets Version Token. - * Used for optimistic concurrency. This opaque token identifies a specific version of the - * `Payment` object. - * - * @maps version_token - */ - public function setVersionToken(?string $versionToken): void - { - $this->versionToken['value'] = $versionToken; - } - - /** - * Unsets Version Token. - * Used for optimistic concurrency. This opaque token identifies a specific version of the - * `Payment` object. - */ - public function unsetVersionToken(): void - { - $this->versionToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->tipMoney)) { - $json['tip_money'] = $this->tipMoney; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (isset($this->approvedMoney)) { - $json['approved_money'] = $this->approvedMoney; - } - if (isset($this->processingFee)) { - $json['processing_fee'] = $this->processingFee; - } - if (isset($this->refundedMoney)) { - $json['refunded_money'] = $this->refundedMoney; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->delayDuration)) { - $json['delay_duration'] = $this->delayDuration; - } - if (!empty($this->delayAction)) { - $json['delay_action'] = $this->delayAction['value']; - } - if (isset($this->delayedUntil)) { - $json['delayed_until'] = $this->delayedUntil; - } - if (isset($this->sourceType)) { - $json['source_type'] = $this->sourceType; - } - if (isset($this->cardDetails)) { - $json['card_details'] = $this->cardDetails; - } - if (isset($this->cashDetails)) { - $json['cash_details'] = $this->cashDetails; - } - if (isset($this->bankAccountDetails)) { - $json['bank_account_details'] = $this->bankAccountDetails; - } - if (isset($this->externalDetails)) { - $json['external_details'] = $this->externalDetails; - } - if (isset($this->walletDetails)) { - $json['wallet_details'] = $this->walletDetails; - } - if (isset($this->buyNowPayLaterDetails)) { - $json['buy_now_pay_later_details'] = $this->buyNowPayLaterDetails; - } - if (isset($this->squareAccountDetails)) { - $json['square_account_details'] = $this->squareAccountDetails; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->orderId)) { - $json['order_id'] = $this->orderId; - } - if (isset($this->referenceId)) { - $json['reference_id'] = $this->referenceId; - } - if (isset($this->customerId)) { - $json['customer_id'] = $this->customerId; - } - if (isset($this->employeeId)) { - $json['employee_id'] = $this->employeeId; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (isset($this->refundIds)) { - $json['refund_ids'] = $this->refundIds; - } - if (isset($this->riskEvaluation)) { - $json['risk_evaluation'] = $this->riskEvaluation; - } - if (isset($this->terminalCheckoutId)) { - $json['terminal_checkout_id'] = $this->terminalCheckoutId; - } - if (isset($this->buyerEmailAddress)) { - $json['buyer_email_address'] = $this->buyerEmailAddress; - } - if (isset($this->billingAddress)) { - $json['billing_address'] = $this->billingAddress; - } - if (isset($this->shippingAddress)) { - $json['shipping_address'] = $this->shippingAddress; - } - if (isset($this->note)) { - $json['note'] = $this->note; - } - if (isset($this->statementDescriptionIdentifier)) { - $json['statement_description_identifier'] = $this->statementDescriptionIdentifier; - } - if (isset($this->capabilities)) { - $json['capabilities'] = $this->capabilities; - } - if (isset($this->receiptNumber)) { - $json['receipt_number'] = $this->receiptNumber; - } - if (isset($this->receiptUrl)) { - $json['receipt_url'] = $this->receiptUrl; - } - if (isset($this->deviceDetails)) { - $json['device_details'] = $this->deviceDetails; - } - if (isset($this->applicationDetails)) { - $json['application_details'] = $this->applicationDetails; - } - if (isset($this->isOfflinePayment)) { - $json['is_offline_payment'] = $this->isOfflinePayment; - } - if (isset($this->offlinePaymentDetails)) { - $json['offline_payment_details'] = $this->offlinePaymentDetails; - } - if (!empty($this->versionToken)) { - $json['version_token'] = $this->versionToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityAppFeeRefundDetail.php b/src/Models/PaymentBalanceActivityAppFeeRefundDetail.php deleted file mode 100644 index ac3c65d2..00000000 --- a/src/Models/PaymentBalanceActivityAppFeeRefundDetail.php +++ /dev/null @@ -1,149 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Refund Id. - * The ID of the refund associated with this activity. - */ - public function getRefundId(): ?string - { - if (count($this->refundId) == 0) { - return null; - } - return $this->refundId['value']; - } - - /** - * Sets Refund Id. - * The ID of the refund associated with this activity. - * - * @maps refund_id - */ - public function setRefundId(?string $refundId): void - { - $this->refundId['value'] = $refundId; - } - - /** - * Unsets Refund Id. - * The ID of the refund associated with this activity. - */ - public function unsetRefundId(): void - { - $this->refundId = []; - } - - /** - * Returns Location Id. - * The ID of the location of the merchant associated with the payment refund activity - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location of the merchant associated with the payment refund activity - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location of the merchant associated with the payment refund activity - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->refundId)) { - $json['refund_id'] = $this->refundId['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityAppFeeRevenueDetail.php b/src/Models/PaymentBalanceActivityAppFeeRevenueDetail.php deleted file mode 100644 index f5fb2ef1..00000000 --- a/src/Models/PaymentBalanceActivityAppFeeRevenueDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Location Id. - * The ID of the location of the merchant associated with the payment activity - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the location of the merchant associated with the payment activity - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the location of the merchant associated with the payment activity - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityAutomaticSavingsDetail.php b/src/Models/PaymentBalanceActivityAutomaticSavingsDetail.php deleted file mode 100644 index dbf2c684..00000000 --- a/src/Models/PaymentBalanceActivityAutomaticSavingsDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Payout Id. - * The ID of the payout associated with this activity. - */ - public function getPayoutId(): ?string - { - if (count($this->payoutId) == 0) { - return null; - } - return $this->payoutId['value']; - } - - /** - * Sets Payout Id. - * The ID of the payout associated with this activity. - * - * @maps payout_id - */ - public function setPayoutId(?string $payoutId): void - { - $this->payoutId['value'] = $payoutId; - } - - /** - * Unsets Payout Id. - * The ID of the payout associated with this activity. - */ - public function unsetPayoutId(): void - { - $this->payoutId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->payoutId)) { - $json['payout_id'] = $this->payoutId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityAutomaticSavingsReversedDetail.php b/src/Models/PaymentBalanceActivityAutomaticSavingsReversedDetail.php deleted file mode 100644 index 24e08457..00000000 --- a/src/Models/PaymentBalanceActivityAutomaticSavingsReversedDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Payout Id. - * The ID of the payout associated with this activity. - */ - public function getPayoutId(): ?string - { - if (count($this->payoutId) == 0) { - return null; - } - return $this->payoutId['value']; - } - - /** - * Sets Payout Id. - * The ID of the payout associated with this activity. - * - * @maps payout_id - */ - public function setPayoutId(?string $payoutId): void - { - $this->payoutId['value'] = $payoutId; - } - - /** - * Unsets Payout Id. - * The ID of the payout associated with this activity. - */ - public function unsetPayoutId(): void - { - $this->payoutId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->payoutId)) { - $json['payout_id'] = $this->payoutId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityChargeDetail.php b/src/Models/PaymentBalanceActivityChargeDetail.php deleted file mode 100644 index 271c808c..00000000 --- a/src/Models/PaymentBalanceActivityChargeDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityDepositFeeDetail.php b/src/Models/PaymentBalanceActivityDepositFeeDetail.php deleted file mode 100644 index bb2c103b..00000000 --- a/src/Models/PaymentBalanceActivityDepositFeeDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -payoutId) == 0) { - return null; - } - return $this->payoutId['value']; - } - - /** - * Sets Payout Id. - * The ID of the payout that triggered this deposit fee activity. - * - * @maps payout_id - */ - public function setPayoutId(?string $payoutId): void - { - $this->payoutId['value'] = $payoutId; - } - - /** - * Unsets Payout Id. - * The ID of the payout that triggered this deposit fee activity. - */ - public function unsetPayoutId(): void - { - $this->payoutId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->payoutId)) { - $json['payout_id'] = $this->payoutId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityDepositFeeReversedDetail.php b/src/Models/PaymentBalanceActivityDepositFeeReversedDetail.php deleted file mode 100644 index 5e417a5c..00000000 --- a/src/Models/PaymentBalanceActivityDepositFeeReversedDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -payoutId) == 0) { - return null; - } - return $this->payoutId['value']; - } - - /** - * Sets Payout Id. - * The ID of the payout that triggered this deposit fee activity. - * - * @maps payout_id - */ - public function setPayoutId(?string $payoutId): void - { - $this->payoutId['value'] = $payoutId; - } - - /** - * Unsets Payout Id. - * The ID of the payout that triggered this deposit fee activity. - */ - public function unsetPayoutId(): void - { - $this->payoutId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->payoutId)) { - $json['payout_id'] = $this->payoutId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityDisputeDetail.php b/src/Models/PaymentBalanceActivityDisputeDetail.php deleted file mode 100644 index 1acc2c73..00000000 --- a/src/Models/PaymentBalanceActivityDisputeDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Dispute Id. - * The ID of the dispute associated with this activity. - */ - public function getDisputeId(): ?string - { - if (count($this->disputeId) == 0) { - return null; - } - return $this->disputeId['value']; - } - - /** - * Sets Dispute Id. - * The ID of the dispute associated with this activity. - * - * @maps dispute_id - */ - public function setDisputeId(?string $disputeId): void - { - $this->disputeId['value'] = $disputeId; - } - - /** - * Unsets Dispute Id. - * The ID of the dispute associated with this activity. - */ - public function unsetDisputeId(): void - { - $this->disputeId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->disputeId)) { - $json['dispute_id'] = $this->disputeId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityFeeDetail.php b/src/Models/PaymentBalanceActivityFeeDetail.php deleted file mode 100644 index d343d52a..00000000 --- a/src/Models/PaymentBalanceActivityFeeDetail.php +++ /dev/null @@ -1,78 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity - * This will only be populated when a principal LedgerEntryToken is also populated. - * If the fee is independent (there is no principal LedgerEntryToken) then this will likely not - * be populated. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity - * This will only be populated when a principal LedgerEntryToken is also populated. - * If the fee is independent (there is no principal LedgerEntryToken) then this will likely not - * be populated. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityFreeProcessingDetail.php b/src/Models/PaymentBalanceActivityFreeProcessingDetail.php deleted file mode 100644 index 63eac888..00000000 --- a/src/Models/PaymentBalanceActivityFreeProcessingDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityHoldAdjustmentDetail.php b/src/Models/PaymentBalanceActivityHoldAdjustmentDetail.php deleted file mode 100644 index 731fa42d..00000000 --- a/src/Models/PaymentBalanceActivityHoldAdjustmentDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityOpenDisputeDetail.php b/src/Models/PaymentBalanceActivityOpenDisputeDetail.php deleted file mode 100644 index e7eaca0f..00000000 --- a/src/Models/PaymentBalanceActivityOpenDisputeDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Dispute Id. - * The ID of the dispute associated with this activity. - */ - public function getDisputeId(): ?string - { - if (count($this->disputeId) == 0) { - return null; - } - return $this->disputeId['value']; - } - - /** - * Sets Dispute Id. - * The ID of the dispute associated with this activity. - * - * @maps dispute_id - */ - public function setDisputeId(?string $disputeId): void - { - $this->disputeId['value'] = $disputeId; - } - - /** - * Unsets Dispute Id. - * The ID of the dispute associated with this activity. - */ - public function unsetDisputeId(): void - { - $this->disputeId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->disputeId)) { - $json['dispute_id'] = $this->disputeId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityOtherAdjustmentDetail.php b/src/Models/PaymentBalanceActivityOtherAdjustmentDetail.php deleted file mode 100644 index c63ce8e3..00000000 --- a/src/Models/PaymentBalanceActivityOtherAdjustmentDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityOtherDetail.php b/src/Models/PaymentBalanceActivityOtherDetail.php deleted file mode 100644 index 692baf31..00000000 --- a/src/Models/PaymentBalanceActivityOtherDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityRefundDetail.php b/src/Models/PaymentBalanceActivityRefundDetail.php deleted file mode 100644 index 25b45676..00000000 --- a/src/Models/PaymentBalanceActivityRefundDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Refund Id. - * The ID of the refund associated with this activity. - */ - public function getRefundId(): ?string - { - if (count($this->refundId) == 0) { - return null; - } - return $this->refundId['value']; - } - - /** - * Sets Refund Id. - * The ID of the refund associated with this activity. - * - * @maps refund_id - */ - public function setRefundId(?string $refundId): void - { - $this->refundId['value'] = $refundId; - } - - /** - * Unsets Refund Id. - * The ID of the refund associated with this activity. - */ - public function unsetRefundId(): void - { - $this->refundId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->refundId)) { - $json['refund_id'] = $this->refundId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityReleaseAdjustmentDetail.php b/src/Models/PaymentBalanceActivityReleaseAdjustmentDetail.php deleted file mode 100644 index 3714ad4f..00000000 --- a/src/Models/PaymentBalanceActivityReleaseAdjustmentDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityReserveHoldDetail.php b/src/Models/PaymentBalanceActivityReserveHoldDetail.php deleted file mode 100644 index a3e0b568..00000000 --- a/src/Models/PaymentBalanceActivityReserveHoldDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityReserveReleaseDetail.php b/src/Models/PaymentBalanceActivityReserveReleaseDetail.php deleted file mode 100644 index 7225f995..00000000 --- a/src/Models/PaymentBalanceActivityReserveReleaseDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivitySquareCapitalPaymentDetail.php b/src/Models/PaymentBalanceActivitySquareCapitalPaymentDetail.php deleted file mode 100644 index 853f5ca8..00000000 --- a/src/Models/PaymentBalanceActivitySquareCapitalPaymentDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php b/src/Models/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php deleted file mode 100644 index 739dfe69..00000000 --- a/src/Models/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivitySquarePayrollTransferDetail.php b/src/Models/PaymentBalanceActivitySquarePayrollTransferDetail.php deleted file mode 100644 index 82f92d0d..00000000 --- a/src/Models/PaymentBalanceActivitySquarePayrollTransferDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php b/src/Models/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php deleted file mode 100644 index 6feeaafa..00000000 --- a/src/Models/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityTaxOnFeeDetail.php b/src/Models/PaymentBalanceActivityTaxOnFeeDetail.php deleted file mode 100644 index 8ffa214b..00000000 --- a/src/Models/PaymentBalanceActivityTaxOnFeeDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Tax Rate Description. - * The description of the tax rate being applied. For example: "GST", "HST". - */ - public function getTaxRateDescription(): ?string - { - if (count($this->taxRateDescription) == 0) { - return null; - } - return $this->taxRateDescription['value']; - } - - /** - * Sets Tax Rate Description. - * The description of the tax rate being applied. For example: "GST", "HST". - * - * @maps tax_rate_description - */ - public function setTaxRateDescription(?string $taxRateDescription): void - { - $this->taxRateDescription['value'] = $taxRateDescription; - } - - /** - * Unsets Tax Rate Description. - * The description of the tax rate being applied. For example: "GST", "HST". - */ - public function unsetTaxRateDescription(): void - { - $this->taxRateDescription = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->taxRateDescription)) { - $json['tax_rate_description'] = $this->taxRateDescription['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityThirdPartyFeeDetail.php b/src/Models/PaymentBalanceActivityThirdPartyFeeDetail.php deleted file mode 100644 index e7cf94ca..00000000 --- a/src/Models/PaymentBalanceActivityThirdPartyFeeDetail.php +++ /dev/null @@ -1,69 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentBalanceActivityThirdPartyFeeRefundDetail.php b/src/Models/PaymentBalanceActivityThirdPartyFeeRefundDetail.php deleted file mode 100644 index 52f889a5..00000000 --- a/src/Models/PaymentBalanceActivityThirdPartyFeeRefundDetail.php +++ /dev/null @@ -1,109 +0,0 @@ -paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this activity. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this activity. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Refund Id. - * The public refund id associated with this activity. - */ - public function getRefundId(): ?string - { - if (count($this->refundId) == 0) { - return null; - } - return $this->refundId['value']; - } - - /** - * Sets Refund Id. - * The public refund id associated with this activity. - * - * @maps refund_id - */ - public function setRefundId(?string $refundId): void - { - $this->refundId['value'] = $refundId; - } - - /** - * Unsets Refund Id. - * The public refund id associated with this activity. - */ - public function unsetRefundId(): void - { - $this->refundId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->refundId)) { - $json['refund_id'] = $this->refundId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentLink.php b/src/Models/PaymentLink.php deleted file mode 100644 index 97916c0b..00000000 --- a/src/Models/PaymentLink.php +++ /dev/null @@ -1,380 +0,0 @@ -version = $version; - } - - /** - * Returns Id. - * The Square-assigned ID of the payment link. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID of the payment link. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Version. - * The Square-assigned version number, which is incremented each time an update is committed to the - * payment link. - */ - public function getVersion(): int - { - return $this->version; - } - - /** - * Sets Version. - * The Square-assigned version number, which is incremented each time an update is committed to the - * payment link. - * - * @required - * @maps version - */ - public function setVersion(int $version): void - { - $this->version = $version; - } - - /** - * Returns Description. - * The optional description of the `payment_link` object. - * It is primarily for use by your application and is not used anywhere. - */ - public function getDescription(): ?string - { - if (count($this->description) == 0) { - return null; - } - return $this->description['value']; - } - - /** - * Sets Description. - * The optional description of the `payment_link` object. - * It is primarily for use by your application and is not used anywhere. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description['value'] = $description; - } - - /** - * Unsets Description. - * The optional description of the `payment_link` object. - * It is primarily for use by your application and is not used anywhere. - */ - public function unsetDescription(): void - { - $this->description = []; - } - - /** - * Returns Order Id. - * The ID of the order associated with the payment link. - */ - public function getOrderId(): ?string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The ID of the order associated with the payment link. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Returns Checkout Options. - */ - public function getCheckoutOptions(): ?CheckoutOptions - { - return $this->checkoutOptions; - } - - /** - * Sets Checkout Options. - * - * @maps checkout_options - */ - public function setCheckoutOptions(?CheckoutOptions $checkoutOptions): void - { - $this->checkoutOptions = $checkoutOptions; - } - - /** - * Returns Pre Populated Data. - * Describes buyer data to prepopulate in the payment form. - * For more information, - * see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional- - * checkout-configurations). - */ - public function getPrePopulatedData(): ?PrePopulatedData - { - return $this->prePopulatedData; - } - - /** - * Sets Pre Populated Data. - * Describes buyer data to prepopulate in the payment form. - * For more information, - * see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional- - * checkout-configurations). - * - * @maps pre_populated_data - */ - public function setPrePopulatedData(?PrePopulatedData $prePopulatedData): void - { - $this->prePopulatedData = $prePopulatedData; - } - - /** - * Returns Url. - * The shortened URL of the payment link. - */ - public function getUrl(): ?string - { - return $this->url; - } - - /** - * Sets Url. - * The shortened URL of the payment link. - * - * @maps url - */ - public function setUrl(?string $url): void - { - $this->url = $url; - } - - /** - * Returns Long Url. - * The long URL of the payment link. - */ - public function getLongUrl(): ?string - { - return $this->longUrl; - } - - /** - * Sets Long Url. - * The long URL of the payment link. - * - * @maps long_url - */ - public function setLongUrl(?string $longUrl): void - { - $this->longUrl = $longUrl; - } - - /** - * Returns Created At. - * The timestamp when the payment link was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the payment link was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the payment link was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the payment link was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Payment Note. - * An optional note. After Square processes the payment, this note is added to the - * resulting `Payment`. - */ - public function getPaymentNote(): ?string - { - if (count($this->paymentNote) == 0) { - return null; - } - return $this->paymentNote['value']; - } - - /** - * Sets Payment Note. - * An optional note. After Square processes the payment, this note is added to the - * resulting `Payment`. - * - * @maps payment_note - */ - public function setPaymentNote(?string $paymentNote): void - { - $this->paymentNote['value'] = $paymentNote; - } - - /** - * Unsets Payment Note. - * An optional note. After Square processes the payment, this note is added to the - * resulting `Payment`. - */ - public function unsetPaymentNote(): void - { - $this->paymentNote = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['version'] = $this->version; - if (!empty($this->description)) { - $json['description'] = $this->description['value']; - } - if (isset($this->orderId)) { - $json['order_id'] = $this->orderId; - } - if (isset($this->checkoutOptions)) { - $json['checkout_options'] = $this->checkoutOptions; - } - if (isset($this->prePopulatedData)) { - $json['pre_populated_data'] = $this->prePopulatedData; - } - if (isset($this->url)) { - $json['url'] = $this->url; - } - if (isset($this->longUrl)) { - $json['long_url'] = $this->longUrl; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->paymentNote)) { - $json['payment_note'] = $this->paymentNote['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentLinkRelatedResources.php b/src/Models/PaymentLinkRelatedResources.php deleted file mode 100644 index 26f03ade..00000000 --- a/src/Models/PaymentLinkRelatedResources.php +++ /dev/null @@ -1,117 +0,0 @@ -orders) == 0) { - return null; - } - return $this->orders['value']; - } - - /** - * Sets Orders. - * The order associated with the payment link. - * - * @maps orders - * - * @param Order[]|null $orders - */ - public function setOrders(?array $orders): void - { - $this->orders['value'] = $orders; - } - - /** - * Unsets Orders. - * The order associated with the payment link. - */ - public function unsetOrders(): void - { - $this->orders = []; - } - - /** - * Returns Subscription Plans. - * The subscription plan associated with the payment link. - * - * @return CatalogObject[]|null - */ - public function getSubscriptionPlans(): ?array - { - if (count($this->subscriptionPlans) == 0) { - return null; - } - return $this->subscriptionPlans['value']; - } - - /** - * Sets Subscription Plans. - * The subscription plan associated with the payment link. - * - * @maps subscription_plans - * - * @param CatalogObject[]|null $subscriptionPlans - */ - public function setSubscriptionPlans(?array $subscriptionPlans): void - { - $this->subscriptionPlans['value'] = $subscriptionPlans; - } - - /** - * Unsets Subscription Plans. - * The subscription plan associated with the payment link. - */ - public function unsetSubscriptionPlans(): void - { - $this->subscriptionPlans = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->orders)) { - $json['orders'] = $this->orders['value']; - } - if (!empty($this->subscriptionPlans)) { - $json['subscription_plans'] = $this->subscriptionPlans['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentOptions.php b/src/Models/PaymentOptions.php deleted file mode 100644 index ebcbe015..00000000 --- a/src/Models/PaymentOptions.php +++ /dev/null @@ -1,257 +0,0 @@ -autocomplete) == 0) { - return null; - } - return $this->autocomplete['value']; - } - - /** - * Sets Autocomplete. - * Indicates whether the `Payment` objects created from this `TerminalCheckout` are automatically - * `COMPLETED` or left in an `APPROVED` state for later modification. - * - * @maps autocomplete - */ - public function setAutocomplete(?bool $autocomplete): void - { - $this->autocomplete['value'] = $autocomplete; - } - - /** - * Unsets Autocomplete. - * Indicates whether the `Payment` objects created from this `TerminalCheckout` are automatically - * `COMPLETED` or left in an `APPROVED` state for later modification. - */ - public function unsetAutocomplete(): void - { - $this->autocomplete = []; - } - - /** - * Returns Delay Duration. - * The duration of time after the payment's creation when Square automatically cancels the - * payment. This automatic cancellation applies only to payments that do not reach a terminal state - * (COMPLETED or CANCELED) before the `delay_duration` time period. - * - * This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value - * of 1 minute. - * - * Note: This feature is only supported for card payments. This parameter can only be set for a - * delayed - * capture payment (`autocomplete=false`). - * Default: - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - */ - public function getDelayDuration(): ?string - { - if (count($this->delayDuration) == 0) { - return null; - } - return $this->delayDuration['value']; - } - - /** - * Sets Delay Duration. - * The duration of time after the payment's creation when Square automatically cancels the - * payment. This automatic cancellation applies only to payments that do not reach a terminal state - * (COMPLETED or CANCELED) before the `delay_duration` time period. - * - * This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value - * of 1 minute. - * - * Note: This feature is only supported for card payments. This parameter can only be set for a - * delayed - * capture payment (`autocomplete=false`). - * Default: - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - * - * @maps delay_duration - */ - public function setDelayDuration(?string $delayDuration): void - { - $this->delayDuration['value'] = $delayDuration; - } - - /** - * Unsets Delay Duration. - * The duration of time after the payment's creation when Square automatically cancels the - * payment. This automatic cancellation applies only to payments that do not reach a terminal state - * (COMPLETED or CANCELED) before the `delay_duration` time period. - * - * This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value - * of 1 minute. - * - * Note: This feature is only supported for card payments. This parameter can only be set for a - * delayed - * capture payment (`autocomplete=false`). - * Default: - * - Card-present payments: "PT36H" (36 hours) from the creation time. - * - Card-not-present payments: "P7D" (7 days) from the creation time. - */ - public function unsetDelayDuration(): void - { - $this->delayDuration = []; - } - - /** - * Returns Accept Partial Authorization. - * If set to `true` and charging a Square Gift Card, a payment might be returned with - * `amount_money` equal to less than what was requested. For example, a request for $20 when charging - * a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose - * to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card - * payment. - * - * This field cannot be `true` when `autocomplete = true`. - * This field cannot be `true` when an `order_id` isn't specified. - * - * For more information, see - * [Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/partial-payments-with-gift-cards). - * - * Default: false - */ - public function getAcceptPartialAuthorization(): ?bool - { - if (count($this->acceptPartialAuthorization) == 0) { - return null; - } - return $this->acceptPartialAuthorization['value']; - } - - /** - * Sets Accept Partial Authorization. - * If set to `true` and charging a Square Gift Card, a payment might be returned with - * `amount_money` equal to less than what was requested. For example, a request for $20 when charging - * a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose - * to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card - * payment. - * - * This field cannot be `true` when `autocomplete = true`. - * This field cannot be `true` when an `order_id` isn't specified. - * - * For more information, see - * [Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/partial-payments-with-gift-cards). - * - * Default: false - * - * @maps accept_partial_authorization - */ - public function setAcceptPartialAuthorization(?bool $acceptPartialAuthorization): void - { - $this->acceptPartialAuthorization['value'] = $acceptPartialAuthorization; - } - - /** - * Unsets Accept Partial Authorization. - * If set to `true` and charging a Square Gift Card, a payment might be returned with - * `amount_money` equal to less than what was requested. For example, a request for $20 when charging - * a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose - * to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card - * payment. - * - * This field cannot be `true` when `autocomplete = true`. - * This field cannot be `true` when an `order_id` isn't specified. - * - * For more information, see - * [Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card- - * payments/partial-payments-with-gift-cards). - * - * Default: false - */ - public function unsetAcceptPartialAuthorization(): void - { - $this->acceptPartialAuthorization = []; - } - - /** - * Returns Delay Action. - * Describes the action to be applied to a delayed capture payment when the delay_duration - * has elapsed. - */ - public function getDelayAction(): ?string - { - return $this->delayAction; - } - - /** - * Sets Delay Action. - * Describes the action to be applied to a delayed capture payment when the delay_duration - * has elapsed. - * - * @maps delay_action - */ - public function setDelayAction(?string $delayAction): void - { - $this->delayAction = $delayAction; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->autocomplete)) { - $json['autocomplete'] = $this->autocomplete['value']; - } - if (!empty($this->delayDuration)) { - $json['delay_duration'] = $this->delayDuration['value']; - } - if (!empty($this->acceptPartialAuthorization)) { - $json['accept_partial_authorization'] = $this->acceptPartialAuthorization['value']; - } - if (isset($this->delayAction)) { - $json['delay_action'] = $this->delayAction; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentOptionsDelayAction.php b/src/Models/PaymentOptionsDelayAction.php deleted file mode 100644 index 7a19a56d..00000000 --- a/src/Models/PaymentOptionsDelayAction.php +++ /dev/null @@ -1,24 +0,0 @@ -id = $id; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Id. - * The unique ID for this refund, generated by Square. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The unique ID for this refund, generated by Square. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Status. - * The refund's status: - * - `PENDING` - Awaiting approval. - * - `COMPLETED` - Successfully completed. - * - `REJECTED` - The refund was rejected. - * - `FAILED` - An error occurred. - */ - public function getStatus(): ?string - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * The refund's status: - * - `PENDING` - Awaiting approval. - * - `COMPLETED` - Successfully completed. - * - `REJECTED` - The refund was rejected. - * - `FAILED` - An error occurred. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * The refund's status: - * - `PENDING` - Awaiting approval. - * - `COMPLETED` - Successfully completed. - * - `REJECTED` - The refund was rejected. - * - `FAILED` - An error occurred. - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Returns Location Id. - * The location ID associated with the payment this refund is attached to. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location ID associated with the payment this refund is attached to. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location ID associated with the payment this refund is attached to. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Unlinked. - * Flag indicating whether or not the refund is linked to an existing payment in Square. - */ - public function getUnlinked(): ?bool - { - return $this->unlinked; - } - - /** - * Sets Unlinked. - * Flag indicating whether or not the refund is linked to an existing payment in Square. - * - * @maps unlinked - */ - public function setUnlinked(?bool $unlinked): void - { - $this->unlinked = $unlinked; - } - - /** - * Returns Destination Type. - * The destination type for this refund. - * - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, - * `EXTERNAL`, and `SQUARE_ACCOUNT`. - */ - public function getDestinationType(): ?string - { - if (count($this->destinationType) == 0) { - return null; - } - return $this->destinationType['value']; - } - - /** - * Sets Destination Type. - * The destination type for this refund. - * - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, - * `EXTERNAL`, and `SQUARE_ACCOUNT`. - * - * @maps destination_type - */ - public function setDestinationType(?string $destinationType): void - { - $this->destinationType['value'] = $destinationType; - } - - /** - * Unsets Destination Type. - * The destination type for this refund. - * - * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, - * `EXTERNAL`, and `SQUARE_ACCOUNT`. - */ - public function unsetDestinationType(): void - { - $this->destinationType = []; - } - - /** - * Returns Destination Details. - * Details about a refund's destination. - */ - public function getDestinationDetails(): ?DestinationDetails - { - return $this->destinationDetails; - } - - /** - * Sets Destination Details. - * Details about a refund's destination. - * - * @maps destination_details - */ - public function setDestinationDetails(?DestinationDetails $destinationDetails): void - { - $this->destinationDetails = $destinationDetails; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Processing Fee. - * Processing fees and fee adjustments assessed by Square for this refund. - * - * @return ProcessingFee[]|null - */ - public function getProcessingFee(): ?array - { - if (count($this->processingFee) == 0) { - return null; - } - return $this->processingFee['value']; - } - - /** - * Sets Processing Fee. - * Processing fees and fee adjustments assessed by Square for this refund. - * - * @maps processing_fee - * - * @param ProcessingFee[]|null $processingFee - */ - public function setProcessingFee(?array $processingFee): void - { - $this->processingFee['value'] = $processingFee; - } - - /** - * Unsets Processing Fee. - * Processing fees and fee adjustments assessed by Square for this refund. - */ - public function unsetProcessingFee(): void - { - $this->processingFee = []; - } - - /** - * Returns Payment Id. - * The ID of the payment associated with this refund. - */ - public function getPaymentId(): ?string - { - if (count($this->paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the payment associated with this refund. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the payment associated with this refund. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Order Id. - * The ID of the order associated with the refund. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The ID of the order associated with the refund. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The ID of the order associated with the refund. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Reason. - * The reason for the refund. - */ - public function getReason(): ?string - { - if (count($this->reason) == 0) { - return null; - } - return $this->reason['value']; - } - - /** - * Sets Reason. - * The reason for the refund. - * - * @maps reason - */ - public function setReason(?string $reason): void - { - $this->reason['value'] = $reason; - } - - /** - * Unsets Reason. - * The reason for the refund. - */ - public function unsetReason(): void - { - $this->reason = []; - } - - /** - * Returns Created At. - * The timestamp of when the refund was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the refund was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the refund was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the refund was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Team Member Id. - * An optional ID of the team member associated with taking the payment. - */ - public function getTeamMemberId(): ?string - { - return $this->teamMemberId; - } - - /** - * Sets Team Member Id. - * An optional ID of the team member associated with taking the payment. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Returns Terminal Refund Id. - * An optional ID for a Terminal refund. - */ - public function getTerminalRefundId(): ?string - { - return $this->terminalRefundId; - } - - /** - * Sets Terminal Refund Id. - * An optional ID for a Terminal refund. - * - * @maps terminal_refund_id - */ - public function setTerminalRefundId(?string $terminalRefundId): void - { - $this->terminalRefundId = $terminalRefundId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->unlinked)) { - $json['unlinked'] = $this->unlinked; - } - if (!empty($this->destinationType)) { - $json['destination_type'] = $this->destinationType['value']; - } - if (isset($this->destinationDetails)) { - $json['destination_details'] = $this->destinationDetails; - } - $json['amount_money'] = $this->amountMoney; - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (!empty($this->processingFee)) { - $json['processing_fee'] = $this->processingFee['value']; - } - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (!empty($this->reason)) { - $json['reason'] = $this->reason['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId; - } - if (isset($this->terminalRefundId)) { - $json['terminal_refund_id'] = $this->terminalRefundId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PaymentSortField.php b/src/Models/PaymentSortField.php deleted file mode 100644 index 43f879d3..00000000 --- a/src/Models/PaymentSortField.php +++ /dev/null @@ -1,14 +0,0 @@ -id = $id; - $this->locationId = $locationId; - } - - /** - * Returns Id. - * A unique ID for the payout. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * A unique ID for the payout. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Status. - * Payout status types - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Payout status types - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Location Id. - * The ID of the location associated with the payout. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location associated with the payout. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Created At. - * The timestamp of when the payout was created and submitted for deposit to the seller's banking - * destination, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the payout was created and submitted for deposit to the seller's banking - * destination, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the payout was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the payout was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Destination. - * Information about the destination against which the payout was made. - */ - public function getDestination(): ?Destination - { - return $this->destination; - } - - /** - * Sets Destination. - * Information about the destination against which the payout was made. - * - * @maps destination - */ - public function setDestination(?Destination $destination): void - { - $this->destination = $destination; - } - - /** - * Returns Version. - * The version number, which is incremented each time an update is made to this payout record. - * The version number helps developers receive event notifications or feeds out of order. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version number, which is incremented each time an update is made to this payout record. - * The version number helps developers receive event notifications or feeds out of order. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Type. - * The type of payout: “BATCH” or “SIMPLE”. - * BATCH payouts include a list of payout entries that can be considered settled. - * SIMPLE payouts do not have any payout entries associated with them - * and will show up as one of the payout entries in a future BATCH payout. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * The type of payout: “BATCH” or “SIMPLE”. - * BATCH payouts include a list of payout entries that can be considered settled. - * SIMPLE payouts do not have any payout entries associated with them - * and will show up as one of the payout entries in a future BATCH payout. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Payout Fee. - * A list of transfer fees and any taxes on the fees assessed by Square for this payout. - * - * @return PayoutFee[]|null - */ - public function getPayoutFee(): ?array - { - if (count($this->payoutFee) == 0) { - return null; - } - return $this->payoutFee['value']; - } - - /** - * Sets Payout Fee. - * A list of transfer fees and any taxes on the fees assessed by Square for this payout. - * - * @maps payout_fee - * - * @param PayoutFee[]|null $payoutFee - */ - public function setPayoutFee(?array $payoutFee): void - { - $this->payoutFee['value'] = $payoutFee; - } - - /** - * Unsets Payout Fee. - * A list of transfer fees and any taxes on the fees assessed by Square for this payout. - */ - public function unsetPayoutFee(): void - { - $this->payoutFee = []; - } - - /** - * Returns Arrival Date. - * The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s - * banking destination. - */ - public function getArrivalDate(): ?string - { - if (count($this->arrivalDate) == 0) { - return null; - } - return $this->arrivalDate['value']; - } - - /** - * Sets Arrival Date. - * The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s - * banking destination. - * - * @maps arrival_date - */ - public function setArrivalDate(?string $arrivalDate): void - { - $this->arrivalDate['value'] = $arrivalDate; - } - - /** - * Unsets Arrival Date. - * The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s - * banking destination. - */ - public function unsetArrivalDate(): void - { - $this->arrivalDate = []; - } - - /** - * Returns End to End Id. - * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can - * use this ID to automate the process of reconciling each payout with the corresponding line item on - * the bank statement. - */ - public function getEndToEndId(): ?string - { - if (count($this->endToEndId) == 0) { - return null; - } - return $this->endToEndId['value']; - } - - /** - * Sets End to End Id. - * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can - * use this ID to automate the process of reconciling each payout with the corresponding line item on - * the bank statement. - * - * @maps end_to_end_id - */ - public function setEndToEndId(?string $endToEndId): void - { - $this->endToEndId['value'] = $endToEndId; - } - - /** - * Unsets End to End Id. - * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can - * use this ID to automate the process of reconciling each payout with the corresponding line item on - * the bank statement. - */ - public function unsetEndToEndId(): void - { - $this->endToEndId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json['location_id'] = $this->locationId; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->destination)) { - $json['destination'] = $this->destination; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->payoutFee)) { - $json['payout_fee'] = $this->payoutFee['value']; - } - if (!empty($this->arrivalDate)) { - $json['arrival_date'] = $this->arrivalDate['value']; - } - if (!empty($this->endToEndId)) { - $json['end_to_end_id'] = $this->endToEndId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PayoutEntry.php b/src/Models/PayoutEntry.php deleted file mode 100644 index a28958c3..00000000 --- a/src/Models/PayoutEntry.php +++ /dev/null @@ -1,951 +0,0 @@ -id = $id; - $this->payoutId = $payoutId; - } - - /** - * Returns Id. - * A unique ID for the payout entry. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * A unique ID for the payout entry. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Payout Id. - * The ID of the payout entries’ associated payout. - */ - public function getPayoutId(): string - { - return $this->payoutId; - } - - /** - * Sets Payout Id. - * The ID of the payout entries’ associated payout. - * - * @required - * @maps payout_id - */ - public function setPayoutId(string $payoutId): void - { - $this->payoutId = $payoutId; - } - - /** - * Returns Effective At. - * The timestamp of when the payout entry affected the balance, in RFC 3339 format. - */ - public function getEffectiveAt(): ?string - { - if (count($this->effectiveAt) == 0) { - return null; - } - return $this->effectiveAt['value']; - } - - /** - * Sets Effective At. - * The timestamp of when the payout entry affected the balance, in RFC 3339 format. - * - * @maps effective_at - */ - public function setEffectiveAt(?string $effectiveAt): void - { - $this->effectiveAt['value'] = $effectiveAt; - } - - /** - * Unsets Effective At. - * The timestamp of when the payout entry affected the balance, in RFC 3339 format. - */ - public function unsetEffectiveAt(): void - { - $this->effectiveAt = []; - } - - /** - * Returns Type. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Gross Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getGrossAmountMoney(): ?Money - { - return $this->grossAmountMoney; - } - - /** - * Sets Gross Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps gross_amount_money - */ - public function setGrossAmountMoney(?Money $grossAmountMoney): void - { - $this->grossAmountMoney = $grossAmountMoney; - } - - /** - * Returns Fee Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getFeeAmountMoney(): ?Money - { - return $this->feeAmountMoney; - } - - /** - * Sets Fee Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps fee_amount_money - */ - public function setFeeAmountMoney(?Money $feeAmountMoney): void - { - $this->feeAmountMoney = $feeAmountMoney; - } - - /** - * Returns Net Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getNetAmountMoney(): ?Money - { - return $this->netAmountMoney; - } - - /** - * Sets Net Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps net_amount_money - */ - public function setNetAmountMoney(?Money $netAmountMoney): void - { - $this->netAmountMoney = $netAmountMoney; - } - - /** - * Returns Type App Fee Revenue Details. - */ - public function getTypeAppFeeRevenueDetails(): ?PaymentBalanceActivityAppFeeRevenueDetail - { - return $this->typeAppFeeRevenueDetails; - } - - /** - * Sets Type App Fee Revenue Details. - * - * @maps type_app_fee_revenue_details - */ - public function setTypeAppFeeRevenueDetails( - ?PaymentBalanceActivityAppFeeRevenueDetail $typeAppFeeRevenueDetails - ): void { - $this->typeAppFeeRevenueDetails = $typeAppFeeRevenueDetails; - } - - /** - * Returns Type App Fee Refund Details. - */ - public function getTypeAppFeeRefundDetails(): ?PaymentBalanceActivityAppFeeRefundDetail - { - return $this->typeAppFeeRefundDetails; - } - - /** - * Sets Type App Fee Refund Details. - * - * @maps type_app_fee_refund_details - */ - public function setTypeAppFeeRefundDetails( - ?PaymentBalanceActivityAppFeeRefundDetail $typeAppFeeRefundDetails - ): void { - $this->typeAppFeeRefundDetails = $typeAppFeeRefundDetails; - } - - /** - * Returns Type Automatic Savings Details. - */ - public function getTypeAutomaticSavingsDetails(): ?PaymentBalanceActivityAutomaticSavingsDetail - { - return $this->typeAutomaticSavingsDetails; - } - - /** - * Sets Type Automatic Savings Details. - * - * @maps type_automatic_savings_details - */ - public function setTypeAutomaticSavingsDetails( - ?PaymentBalanceActivityAutomaticSavingsDetail $typeAutomaticSavingsDetails - ): void { - $this->typeAutomaticSavingsDetails = $typeAutomaticSavingsDetails; - } - - /** - * Returns Type Automatic Savings Reversed Details. - */ - public function getTypeAutomaticSavingsReversedDetails(): ?PaymentBalanceActivityAutomaticSavingsReversedDetail - { - return $this->typeAutomaticSavingsReversedDetails; - } - - /** - * Sets Type Automatic Savings Reversed Details. - * - * @maps type_automatic_savings_reversed_details - */ - public function setTypeAutomaticSavingsReversedDetails( - ?PaymentBalanceActivityAutomaticSavingsReversedDetail $typeAutomaticSavingsReversedDetails - ): void { - $this->typeAutomaticSavingsReversedDetails = $typeAutomaticSavingsReversedDetails; - } - - /** - * Returns Type Charge Details. - */ - public function getTypeChargeDetails(): ?PaymentBalanceActivityChargeDetail - { - return $this->typeChargeDetails; - } - - /** - * Sets Type Charge Details. - * - * @maps type_charge_details - */ - public function setTypeChargeDetails(?PaymentBalanceActivityChargeDetail $typeChargeDetails): void - { - $this->typeChargeDetails = $typeChargeDetails; - } - - /** - * Returns Type Deposit Fee Details. - */ - public function getTypeDepositFeeDetails(): ?PaymentBalanceActivityDepositFeeDetail - { - return $this->typeDepositFeeDetails; - } - - /** - * Sets Type Deposit Fee Details. - * - * @maps type_deposit_fee_details - */ - public function setTypeDepositFeeDetails(?PaymentBalanceActivityDepositFeeDetail $typeDepositFeeDetails): void - { - $this->typeDepositFeeDetails = $typeDepositFeeDetails; - } - - /** - * Returns Type Deposit Fee Reversed Details. - */ - public function getTypeDepositFeeReversedDetails(): ?PaymentBalanceActivityDepositFeeReversedDetail - { - return $this->typeDepositFeeReversedDetails; - } - - /** - * Sets Type Deposit Fee Reversed Details. - * - * @maps type_deposit_fee_reversed_details - */ - public function setTypeDepositFeeReversedDetails( - ?PaymentBalanceActivityDepositFeeReversedDetail $typeDepositFeeReversedDetails - ): void { - $this->typeDepositFeeReversedDetails = $typeDepositFeeReversedDetails; - } - - /** - * Returns Type Dispute Details. - */ - public function getTypeDisputeDetails(): ?PaymentBalanceActivityDisputeDetail - { - return $this->typeDisputeDetails; - } - - /** - * Sets Type Dispute Details. - * - * @maps type_dispute_details - */ - public function setTypeDisputeDetails(?PaymentBalanceActivityDisputeDetail $typeDisputeDetails): void - { - $this->typeDisputeDetails = $typeDisputeDetails; - } - - /** - * Returns Type Fee Details. - */ - public function getTypeFeeDetails(): ?PaymentBalanceActivityFeeDetail - { - return $this->typeFeeDetails; - } - - /** - * Sets Type Fee Details. - * - * @maps type_fee_details - */ - public function setTypeFeeDetails(?PaymentBalanceActivityFeeDetail $typeFeeDetails): void - { - $this->typeFeeDetails = $typeFeeDetails; - } - - /** - * Returns Type Free Processing Details. - */ - public function getTypeFreeProcessingDetails(): ?PaymentBalanceActivityFreeProcessingDetail - { - return $this->typeFreeProcessingDetails; - } - - /** - * Sets Type Free Processing Details. - * - * @maps type_free_processing_details - */ - public function setTypeFreeProcessingDetails( - ?PaymentBalanceActivityFreeProcessingDetail $typeFreeProcessingDetails - ): void { - $this->typeFreeProcessingDetails = $typeFreeProcessingDetails; - } - - /** - * Returns Type Hold Adjustment Details. - */ - public function getTypeHoldAdjustmentDetails(): ?PaymentBalanceActivityHoldAdjustmentDetail - { - return $this->typeHoldAdjustmentDetails; - } - - /** - * Sets Type Hold Adjustment Details. - * - * @maps type_hold_adjustment_details - */ - public function setTypeHoldAdjustmentDetails( - ?PaymentBalanceActivityHoldAdjustmentDetail $typeHoldAdjustmentDetails - ): void { - $this->typeHoldAdjustmentDetails = $typeHoldAdjustmentDetails; - } - - /** - * Returns Type Open Dispute Details. - */ - public function getTypeOpenDisputeDetails(): ?PaymentBalanceActivityOpenDisputeDetail - { - return $this->typeOpenDisputeDetails; - } - - /** - * Sets Type Open Dispute Details. - * - * @maps type_open_dispute_details - */ - public function setTypeOpenDisputeDetails(?PaymentBalanceActivityOpenDisputeDetail $typeOpenDisputeDetails): void - { - $this->typeOpenDisputeDetails = $typeOpenDisputeDetails; - } - - /** - * Returns Type Other Details. - */ - public function getTypeOtherDetails(): ?PaymentBalanceActivityOtherDetail - { - return $this->typeOtherDetails; - } - - /** - * Sets Type Other Details. - * - * @maps type_other_details - */ - public function setTypeOtherDetails(?PaymentBalanceActivityOtherDetail $typeOtherDetails): void - { - $this->typeOtherDetails = $typeOtherDetails; - } - - /** - * Returns Type Other Adjustment Details. - */ - public function getTypeOtherAdjustmentDetails(): ?PaymentBalanceActivityOtherAdjustmentDetail - { - return $this->typeOtherAdjustmentDetails; - } - - /** - * Sets Type Other Adjustment Details. - * - * @maps type_other_adjustment_details - */ - public function setTypeOtherAdjustmentDetails( - ?PaymentBalanceActivityOtherAdjustmentDetail $typeOtherAdjustmentDetails - ): void { - $this->typeOtherAdjustmentDetails = $typeOtherAdjustmentDetails; - } - - /** - * Returns Type Refund Details. - */ - public function getTypeRefundDetails(): ?PaymentBalanceActivityRefundDetail - { - return $this->typeRefundDetails; - } - - /** - * Sets Type Refund Details. - * - * @maps type_refund_details - */ - public function setTypeRefundDetails(?PaymentBalanceActivityRefundDetail $typeRefundDetails): void - { - $this->typeRefundDetails = $typeRefundDetails; - } - - /** - * Returns Type Release Adjustment Details. - */ - public function getTypeReleaseAdjustmentDetails(): ?PaymentBalanceActivityReleaseAdjustmentDetail - { - return $this->typeReleaseAdjustmentDetails; - } - - /** - * Sets Type Release Adjustment Details. - * - * @maps type_release_adjustment_details - */ - public function setTypeReleaseAdjustmentDetails( - ?PaymentBalanceActivityReleaseAdjustmentDetail $typeReleaseAdjustmentDetails - ): void { - $this->typeReleaseAdjustmentDetails = $typeReleaseAdjustmentDetails; - } - - /** - * Returns Type Reserve Hold Details. - */ - public function getTypeReserveHoldDetails(): ?PaymentBalanceActivityReserveHoldDetail - { - return $this->typeReserveHoldDetails; - } - - /** - * Sets Type Reserve Hold Details. - * - * @maps type_reserve_hold_details - */ - public function setTypeReserveHoldDetails(?PaymentBalanceActivityReserveHoldDetail $typeReserveHoldDetails): void - { - $this->typeReserveHoldDetails = $typeReserveHoldDetails; - } - - /** - * Returns Type Reserve Release Details. - */ - public function getTypeReserveReleaseDetails(): ?PaymentBalanceActivityReserveReleaseDetail - { - return $this->typeReserveReleaseDetails; - } - - /** - * Sets Type Reserve Release Details. - * - * @maps type_reserve_release_details - */ - public function setTypeReserveReleaseDetails( - ?PaymentBalanceActivityReserveReleaseDetail $typeReserveReleaseDetails - ): void { - $this->typeReserveReleaseDetails = $typeReserveReleaseDetails; - } - - /** - * Returns Type Square Capital Payment Details. - */ - public function getTypeSquareCapitalPaymentDetails(): ?PaymentBalanceActivitySquareCapitalPaymentDetail - { - return $this->typeSquareCapitalPaymentDetails; - } - - /** - * Sets Type Square Capital Payment Details. - * - * @maps type_square_capital_payment_details - */ - public function setTypeSquareCapitalPaymentDetails( - ?PaymentBalanceActivitySquareCapitalPaymentDetail $typeSquareCapitalPaymentDetails - ): void { - $this->typeSquareCapitalPaymentDetails = $typeSquareCapitalPaymentDetails; - } - - /** - * Returns Type Square Capital Reversed Payment Details. - */ - // phpcs:ignore - public function getTypeSquareCapitalReversedPaymentDetails(): ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail - { - return $this->typeSquareCapitalReversedPaymentDetails; - } - - /** - * Sets Type Square Capital Reversed Payment Details. - * - * @maps type_square_capital_reversed_payment_details - */ - public function setTypeSquareCapitalReversedPaymentDetails( - ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $typeSquareCapitalReversedPaymentDetails - ): void { - $this->typeSquareCapitalReversedPaymentDetails = $typeSquareCapitalReversedPaymentDetails; - } - - /** - * Returns Type Tax on Fee Details. - */ - public function getTypeTaxOnFeeDetails(): ?PaymentBalanceActivityTaxOnFeeDetail - { - return $this->typeTaxOnFeeDetails; - } - - /** - * Sets Type Tax on Fee Details. - * - * @maps type_tax_on_fee_details - */ - public function setTypeTaxOnFeeDetails(?PaymentBalanceActivityTaxOnFeeDetail $typeTaxOnFeeDetails): void - { - $this->typeTaxOnFeeDetails = $typeTaxOnFeeDetails; - } - - /** - * Returns Type Third Party Fee Details. - */ - public function getTypeThirdPartyFeeDetails(): ?PaymentBalanceActivityThirdPartyFeeDetail - { - return $this->typeThirdPartyFeeDetails; - } - - /** - * Sets Type Third Party Fee Details. - * - * @maps type_third_party_fee_details - */ - public function setTypeThirdPartyFeeDetails( - ?PaymentBalanceActivityThirdPartyFeeDetail $typeThirdPartyFeeDetails - ): void { - $this->typeThirdPartyFeeDetails = $typeThirdPartyFeeDetails; - } - - /** - * Returns Type Third Party Fee Refund Details. - */ - public function getTypeThirdPartyFeeRefundDetails(): ?PaymentBalanceActivityThirdPartyFeeRefundDetail - { - return $this->typeThirdPartyFeeRefundDetails; - } - - /** - * Sets Type Third Party Fee Refund Details. - * - * @maps type_third_party_fee_refund_details - */ - public function setTypeThirdPartyFeeRefundDetails( - ?PaymentBalanceActivityThirdPartyFeeRefundDetail $typeThirdPartyFeeRefundDetails - ): void { - $this->typeThirdPartyFeeRefundDetails = $typeThirdPartyFeeRefundDetails; - } - - /** - * Returns Type Square Payroll Transfer Details. - */ - public function getTypeSquarePayrollTransferDetails(): ?PaymentBalanceActivitySquarePayrollTransferDetail - { - return $this->typeSquarePayrollTransferDetails; - } - - /** - * Sets Type Square Payroll Transfer Details. - * - * @maps type_square_payroll_transfer_details - */ - public function setTypeSquarePayrollTransferDetails( - ?PaymentBalanceActivitySquarePayrollTransferDetail $typeSquarePayrollTransferDetails - ): void { - $this->typeSquarePayrollTransferDetails = $typeSquarePayrollTransferDetails; - } - - /** - * Returns Type Square Payroll Transfer Reversed Details. - */ - // phpcs:ignore - public function getTypeSquarePayrollTransferReversedDetails(): ?PaymentBalanceActivitySquarePayrollTransferReversedDetail - { - return $this->typeSquarePayrollTransferReversedDetails; - } - - /** - * Sets Type Square Payroll Transfer Reversed Details. - * - * @maps type_square_payroll_transfer_reversed_details - */ - public function setTypeSquarePayrollTransferReversedDetails( - ?PaymentBalanceActivitySquarePayrollTransferReversedDetail $typeSquarePayrollTransferReversedDetails - ): void { - $this->typeSquarePayrollTransferReversedDetails = $typeSquarePayrollTransferReversedDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['payout_id'] = $this->payoutId; - if (!empty($this->effectiveAt)) { - $json['effective_at'] = $this->effectiveAt['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->grossAmountMoney)) { - $json['gross_amount_money'] = $this->grossAmountMoney; - } - if (isset($this->feeAmountMoney)) { - $json['fee_amount_money'] = $this->feeAmountMoney; - } - if (isset($this->netAmountMoney)) { - $json['net_amount_money'] = $this->netAmountMoney; - } - if (isset($this->typeAppFeeRevenueDetails)) { - $json['type_app_fee_revenue_details'] = $this->typeAppFeeRevenueDetails; - } - if (isset($this->typeAppFeeRefundDetails)) { - $json['type_app_fee_refund_details'] = $this->typeAppFeeRefundDetails; - } - if (isset($this->typeAutomaticSavingsDetails)) { - $json['type_automatic_savings_details'] = $this->typeAutomaticSavingsDetails; - } - if (isset($this->typeAutomaticSavingsReversedDetails)) { - $json['type_automatic_savings_reversed_details'] = $this->typeAutomaticSavingsReversedDetails; - } - if (isset($this->typeChargeDetails)) { - $json['type_charge_details'] = $this->typeChargeDetails; - } - if (isset($this->typeDepositFeeDetails)) { - $json['type_deposit_fee_details'] = $this->typeDepositFeeDetails; - } - if (isset($this->typeDepositFeeReversedDetails)) { - $json['type_deposit_fee_reversed_details'] = $this->typeDepositFeeReversedDetails; - } - if (isset($this->typeDisputeDetails)) { - $json['type_dispute_details'] = $this->typeDisputeDetails; - } - if (isset($this->typeFeeDetails)) { - $json['type_fee_details'] = $this->typeFeeDetails; - } - if (isset($this->typeFreeProcessingDetails)) { - $json['type_free_processing_details'] = $this->typeFreeProcessingDetails; - } - if (isset($this->typeHoldAdjustmentDetails)) { - $json['type_hold_adjustment_details'] = $this->typeHoldAdjustmentDetails; - } - if (isset($this->typeOpenDisputeDetails)) { - $json['type_open_dispute_details'] = $this->typeOpenDisputeDetails; - } - if (isset($this->typeOtherDetails)) { - $json['type_other_details'] = $this->typeOtherDetails; - } - if (isset($this->typeOtherAdjustmentDetails)) { - $json['type_other_adjustment_details'] = $this->typeOtherAdjustmentDetails; - } - if (isset($this->typeRefundDetails)) { - $json['type_refund_details'] = $this->typeRefundDetails; - } - if (isset($this->typeReleaseAdjustmentDetails)) { - $json['type_release_adjustment_details'] = $this->typeReleaseAdjustmentDetails; - } - if (isset($this->typeReserveHoldDetails)) { - $json['type_reserve_hold_details'] = $this->typeReserveHoldDetails; - } - if (isset($this->typeReserveReleaseDetails)) { - $json['type_reserve_release_details'] = $this->typeReserveReleaseDetails; - } - if (isset($this->typeSquareCapitalPaymentDetails)) { - $json['type_square_capital_payment_details'] = $this->typeSquareCapitalPaymentDetails; - } - if (isset($this->typeSquareCapitalReversedPaymentDetails)) { - $json['type_square_capital_reversed_payment_details'] = $this->typeSquareCapitalReversedPaymentDetails; - } - if (isset($this->typeTaxOnFeeDetails)) { - $json['type_tax_on_fee_details'] = $this->typeTaxOnFeeDetails; - } - if (isset($this->typeThirdPartyFeeDetails)) { - $json['type_third_party_fee_details'] = $this->typeThirdPartyFeeDetails; - } - if (isset($this->typeThirdPartyFeeRefundDetails)) { - $json['type_third_party_fee_refund_details'] = $this->typeThirdPartyFeeRefundDetails; - } - if (isset($this->typeSquarePayrollTransferDetails)) { - $json['type_square_payroll_transfer_details'] = $this->typeSquarePayrollTransferDetails; - } - if (isset($this->typeSquarePayrollTransferReversedDetails)) { - $json['type_square_payroll_transfer_reversed_details'] = $this->typeSquarePayrollTransferReversedDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PayoutFee.php b/src/Models/PayoutFee.php deleted file mode 100644 index 5a18bb2c..00000000 --- a/src/Models/PayoutFee.php +++ /dev/null @@ -1,140 +0,0 @@ -amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Effective At. - * The timestamp of when the fee takes effect, in RFC 3339 format. - */ - public function getEffectiveAt(): ?string - { - if (count($this->effectiveAt) == 0) { - return null; - } - return $this->effectiveAt['value']; - } - - /** - * Sets Effective At. - * The timestamp of when the fee takes effect, in RFC 3339 format. - * - * @maps effective_at - */ - public function setEffectiveAt(?string $effectiveAt): void - { - $this->effectiveAt['value'] = $effectiveAt; - } - - /** - * Unsets Effective At. - * The timestamp of when the fee takes effect, in RFC 3339 format. - */ - public function unsetEffectiveAt(): void - { - $this->effectiveAt = []; - } - - /** - * Returns Type. - * Represents the type of payout fee that can incur as part of a payout. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Represents the type of payout fee that can incur as part of a payout. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (!empty($this->effectiveAt)) { - $json['effective_at'] = $this->effectiveAt['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PayoutFeeType.php b/src/Models/PayoutFeeType.php deleted file mode 100644 index 910c75b2..00000000 --- a/src/Models/PayoutFeeType.php +++ /dev/null @@ -1,21 +0,0 @@ -uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * id of subscription phase - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * id of subscription phase - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Ordinal. - * index of phase in total subscription plan - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * index of phase in total subscription plan - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * index of phase in total subscription plan - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Returns Order Template Id. - * id of order to be used in billing - */ - public function getOrderTemplateId(): ?string - { - if (count($this->orderTemplateId) == 0) { - return null; - } - return $this->orderTemplateId['value']; - } - - /** - * Sets Order Template Id. - * id of order to be used in billing - * - * @maps order_template_id - */ - public function setOrderTemplateId(?string $orderTemplateId): void - { - $this->orderTemplateId['value'] = $orderTemplateId; - } - - /** - * Unsets Order Template Id. - * id of order to be used in billing - */ - public function unsetOrderTemplateId(): void - { - $this->orderTemplateId = []; - } - - /** - * Returns Plan Phase Uid. - * the uid from the plan's phase in catalog - */ - public function getPlanPhaseUid(): ?string - { - if (count($this->planPhaseUid) == 0) { - return null; - } - return $this->planPhaseUid['value']; - } - - /** - * Sets Plan Phase Uid. - * the uid from the plan's phase in catalog - * - * @maps plan_phase_uid - */ - public function setPlanPhaseUid(?string $planPhaseUid): void - { - $this->planPhaseUid['value'] = $planPhaseUid; - } - - /** - * Unsets Plan Phase Uid. - * the uid from the plan's phase in catalog - */ - public function unsetPlanPhaseUid(): void - { - $this->planPhaseUid = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - if (!empty($this->orderTemplateId)) { - $json['order_template_id'] = $this->orderTemplateId['value']; - } - if (!empty($this->planPhaseUid)) { - $json['plan_phase_uid'] = $this->planPhaseUid['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PhaseInput.php b/src/Models/PhaseInput.php deleted file mode 100644 index 4ebeecc6..00000000 --- a/src/Models/PhaseInput.php +++ /dev/null @@ -1,107 +0,0 @@ -ordinal = $ordinal; - } - - /** - * Returns Ordinal. - * index of phase in total subscription plan - */ - public function getOrdinal(): int - { - return $this->ordinal; - } - - /** - * Sets Ordinal. - * index of phase in total subscription plan - * - * @required - * @maps ordinal - */ - public function setOrdinal(int $ordinal): void - { - $this->ordinal = $ordinal; - } - - /** - * Returns Order Template Id. - * id of order to be used in billing - */ - public function getOrderTemplateId(): ?string - { - if (count($this->orderTemplateId) == 0) { - return null; - } - return $this->orderTemplateId['value']; - } - - /** - * Sets Order Template Id. - * id of order to be used in billing - * - * @maps order_template_id - */ - public function setOrderTemplateId(?string $orderTemplateId): void - { - $this->orderTemplateId['value'] = $orderTemplateId; - } - - /** - * Unsets Order Template Id. - * id of order to be used in billing - */ - public function unsetOrderTemplateId(): void - { - $this->orderTemplateId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['ordinal'] = $this->ordinal; - if (!empty($this->orderTemplateId)) { - $json['order_template_id'] = $this->orderTemplateId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PrePopulatedData.php b/src/Models/PrePopulatedData.php deleted file mode 100644 index 1f53e3b0..00000000 --- a/src/Models/PrePopulatedData.php +++ /dev/null @@ -1,147 +0,0 @@ -buyerEmail) == 0) { - return null; - } - return $this->buyerEmail['value']; - } - - /** - * Sets Buyer Email. - * The buyer email to prepopulate in the payment form. - * - * @maps buyer_email - */ - public function setBuyerEmail(?string $buyerEmail): void - { - $this->buyerEmail['value'] = $buyerEmail; - } - - /** - * Unsets Buyer Email. - * The buyer email to prepopulate in the payment form. - */ - public function unsetBuyerEmail(): void - { - $this->buyerEmail = []; - } - - /** - * Returns Buyer Phone Number. - * The buyer phone number to prepopulate in the payment form. - */ - public function getBuyerPhoneNumber(): ?string - { - if (count($this->buyerPhoneNumber) == 0) { - return null; - } - return $this->buyerPhoneNumber['value']; - } - - /** - * Sets Buyer Phone Number. - * The buyer phone number to prepopulate in the payment form. - * - * @maps buyer_phone_number - */ - public function setBuyerPhoneNumber(?string $buyerPhoneNumber): void - { - $this->buyerPhoneNumber['value'] = $buyerPhoneNumber; - } - - /** - * Unsets Buyer Phone Number. - * The buyer phone number to prepopulate in the payment form. - */ - public function unsetBuyerPhoneNumber(): void - { - $this->buyerPhoneNumber = []; - } - - /** - * Returns Buyer Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getBuyerAddress(): ?Address - { - return $this->buyerAddress; - } - - /** - * Sets Buyer Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps buyer_address - */ - public function setBuyerAddress(?Address $buyerAddress): void - { - $this->buyerAddress = $buyerAddress; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->buyerEmail)) { - $json['buyer_email'] = $this->buyerEmail['value']; - } - if (!empty($this->buyerPhoneNumber)) { - $json['buyer_phone_number'] = $this->buyerPhoneNumber['value']; - } - if (isset($this->buyerAddress)) { - $json['buyer_address'] = $this->buyerAddress; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ProcessingFee.php b/src/Models/ProcessingFee.php deleted file mode 100644 index 19e2ca63..00000000 --- a/src/Models/ProcessingFee.php +++ /dev/null @@ -1,152 +0,0 @@ -effectiveAt) == 0) { - return null; - } - return $this->effectiveAt['value']; - } - - /** - * Sets Effective At. - * The timestamp of when the fee takes effect, in RFC 3339 format. - * - * @maps effective_at - */ - public function setEffectiveAt(?string $effectiveAt): void - { - $this->effectiveAt['value'] = $effectiveAt; - } - - /** - * Unsets Effective At. - * The timestamp of when the fee takes effect, in RFC 3339 format. - */ - public function unsetEffectiveAt(): void - { - $this->effectiveAt = []; - } - - /** - * Returns Type. - * The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. - */ - public function getType(): ?string - { - if (count($this->type) == 0) { - return null; - } - return $this->type['value']; - } - - /** - * Sets Type. - * The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type['value'] = $type; - } - - /** - * Unsets Type. - * The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. - */ - public function unsetType(): void - { - $this->type = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->effectiveAt)) { - $json['effective_at'] = $this->effectiveAt['value']; - } - if (!empty($this->type)) { - $json['type'] = $this->type['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Product.php b/src/Models/Product.php deleted file mode 100644 index 20658643..00000000 --- a/src/Models/Product.php +++ /dev/null @@ -1,61 +0,0 @@ -version = $version; - } - - /** - * Returns Version. - * The version of the [invoice](entity:Invoice) to publish. - * This must match the current version of the invoice; otherwise, the request is rejected. - */ - public function getVersion(): int - { - return $this->version; - } - - /** - * Sets Version. - * The version of the [invoice](entity:Invoice) to publish. - * This must match the current version of the invoice; otherwise, the request is rejected. - * - * @required - * @maps version - */ - public function setVersion(int $version): void - { - $this->version = $version; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the `PublishInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `PublishInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique string that identifies the `PublishInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['version'] = $this->version; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/PublishInvoiceResponse.php b/src/Models/PublishInvoiceResponse.php deleted file mode 100644 index 20c1006a..00000000 --- a/src/Models/PublishInvoiceResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @maps invoice - */ - public function setInvoice(?Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoice)) { - $json['invoice'] = $this->invoice; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/QrCodeOptions.php b/src/Models/QrCodeOptions.php deleted file mode 100644 index 21d9b4ec..00000000 --- a/src/Models/QrCodeOptions.php +++ /dev/null @@ -1,127 +0,0 @@ -title = $title; - $this->body = $body; - $this->barcodeContents = $barcodeContents; - } - - /** - * Returns Title. - * The title text to display in the QR code flow on the Terminal. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text to display in the QR code flow on the Terminal. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Returns Body. - * The body text to display in the QR code flow on the Terminal. - */ - public function getBody(): string - { - return $this->body; - } - - /** - * Sets Body. - * The body text to display in the QR code flow on the Terminal. - * - * @required - * @maps body - */ - public function setBody(string $body): void - { - $this->body = $body; - } - - /** - * Returns Barcode Contents. - * The text representation of the data to show in the QR code - * as UTF8-encoded data. - */ - public function getBarcodeContents(): string - { - return $this->barcodeContents; - } - - /** - * Sets Barcode Contents. - * The text representation of the data to show in the QR code - * as UTF8-encoded data. - * - * @required - * @maps barcode_contents - */ - public function setBarcodeContents(string $barcodeContents): void - { - $this->barcodeContents = $barcodeContents; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json['body'] = $this->body; - $json['barcode_contents'] = $this->barcodeContents; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/QuantityRatio.php b/src/Models/QuantityRatio.php deleted file mode 100644 index 513c20b5..00000000 --- a/src/Models/QuantityRatio.php +++ /dev/null @@ -1,121 +0,0 @@ -quantity) == 0) { - return null; - } - return $this->quantity['value']; - } - - /** - * Sets Quantity. - * The whole or fractional quantity as the numerator. - * - * @maps quantity - */ - public function setQuantity(?int $quantity): void - { - $this->quantity['value'] = $quantity; - } - - /** - * Unsets Quantity. - * The whole or fractional quantity as the numerator. - */ - public function unsetQuantity(): void - { - $this->quantity = []; - } - - /** - * Returns Quantity Denominator. - * The whole or fractional quantity as the denominator. - * With fractional quantity this field is the denominator and quantity is the numerator. - * The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified, - * the quantity ratio is `3` or `3/1`. - */ - public function getQuantityDenominator(): ?int - { - if (count($this->quantityDenominator) == 0) { - return null; - } - return $this->quantityDenominator['value']; - } - - /** - * Sets Quantity Denominator. - * The whole or fractional quantity as the denominator. - * With fractional quantity this field is the denominator and quantity is the numerator. - * The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified, - * the quantity ratio is `3` or `3/1`. - * - * @maps quantity_denominator - */ - public function setQuantityDenominator(?int $quantityDenominator): void - { - $this->quantityDenominator['value'] = $quantityDenominator; - } - - /** - * Unsets Quantity Denominator. - * The whole or fractional quantity as the denominator. - * With fractional quantity this field is the denominator and quantity is the numerator. - * The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified, - * the quantity ratio is `3` or `3/1`. - */ - public function unsetQuantityDenominator(): void - { - $this->quantityDenominator = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->quantity)) { - $json['quantity'] = $this->quantity['value']; - } - if (!empty($this->quantityDenominator)) { - $json['quantity_denominator'] = $this->quantityDenominator['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/QuickPay.php b/src/Models/QuickPay.php deleted file mode 100644 index aebb9371..00000000 --- a/src/Models/QuickPay.php +++ /dev/null @@ -1,139 +0,0 @@ -name = $name; - $this->priceMoney = $priceMoney; - $this->locationId = $locationId; - } - - /** - * Returns Name. - * The ad hoc item name. In the resulting `Order`, this name appears as the line item name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * The ad hoc item name. In the resulting `Order`, this name appears as the line item name. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps price_money - */ - public function setPriceMoney(Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Returns Location Id. - * The ID of the business location the checkout is associated with. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the business location the checkout is associated with. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - $json['price_money'] = $this->priceMoney; - $json['location_id'] = $this->locationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Range.php b/src/Models/Range.php deleted file mode 100644 index cd2fd339..00000000 --- a/src/Models/Range.php +++ /dev/null @@ -1,118 +0,0 @@ -min) == 0) { - return null; - } - return $this->min['value']; - } - - /** - * Sets Min. - * The lower bound of the number range. At least one of `min` or `max` must be specified. - * If unspecified, the results will have no minimum value. - * - * @maps min - */ - public function setMin(?string $min): void - { - $this->min['value'] = $min; - } - - /** - * Unsets Min. - * The lower bound of the number range. At least one of `min` or `max` must be specified. - * If unspecified, the results will have no minimum value. - */ - public function unsetMin(): void - { - $this->min = []; - } - - /** - * Returns Max. - * The upper bound of the number range. At least one of `min` or `max` must be specified. - * If unspecified, the results will have no maximum value. - */ - public function getMax(): ?string - { - if (count($this->max) == 0) { - return null; - } - return $this->max['value']; - } - - /** - * Sets Max. - * The upper bound of the number range. At least one of `min` or `max` must be specified. - * If unspecified, the results will have no maximum value. - * - * @maps max - */ - public function setMax(?string $max): void - { - $this->max['value'] = $max; - } - - /** - * Unsets Max. - * The upper bound of the number range. At least one of `min` or `max` must be specified. - * If unspecified, the results will have no maximum value. - */ - public function unsetMax(): void - { - $this->max = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->min)) { - $json['min'] = $this->min['value']; - } - if (!empty($this->max)) { - $json['max'] = $this->max['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ReceiptOptions.php b/src/Models/ReceiptOptions.php deleted file mode 100644 index c50d1f5c..00000000 --- a/src/Models/ReceiptOptions.php +++ /dev/null @@ -1,156 +0,0 @@ -paymentId = $paymentId; - } - - /** - * Returns Payment Id. - * The reference to the Square payment ID for the receipt. - */ - public function getPaymentId(): string - { - return $this->paymentId; - } - - /** - * Sets Payment Id. - * The reference to the Square payment ID for the receipt. - * - * @required - * @maps payment_id - */ - public function setPaymentId(string $paymentId): void - { - $this->paymentId = $paymentId; - } - - /** - * Returns Print Only. - * Instructs the device to print the receipt without displaying the receipt selection screen. - * Requires `printer_enabled` set to true. - * Defaults to false. - */ - public function getPrintOnly(): ?bool - { - if (count($this->printOnly) == 0) { - return null; - } - return $this->printOnly['value']; - } - - /** - * Sets Print Only. - * Instructs the device to print the receipt without displaying the receipt selection screen. - * Requires `printer_enabled` set to true. - * Defaults to false. - * - * @maps print_only - */ - public function setPrintOnly(?bool $printOnly): void - { - $this->printOnly['value'] = $printOnly; - } - - /** - * Unsets Print Only. - * Instructs the device to print the receipt without displaying the receipt selection screen. - * Requires `printer_enabled` set to true. - * Defaults to false. - */ - public function unsetPrintOnly(): void - { - $this->printOnly = []; - } - - /** - * Returns Is Duplicate. - * Identify the receipt as a reprint rather than an original receipt. - * Defaults to false. - */ - public function getIsDuplicate(): ?bool - { - if (count($this->isDuplicate) == 0) { - return null; - } - return $this->isDuplicate['value']; - } - - /** - * Sets Is Duplicate. - * Identify the receipt as a reprint rather than an original receipt. - * Defaults to false. - * - * @maps is_duplicate - */ - public function setIsDuplicate(?bool $isDuplicate): void - { - $this->isDuplicate['value'] = $isDuplicate; - } - - /** - * Unsets Is Duplicate. - * Identify the receipt as a reprint rather than an original receipt. - * Defaults to false. - */ - public function unsetIsDuplicate(): void - { - $this->isDuplicate = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['payment_id'] = $this->paymentId; - if (!empty($this->printOnly)) { - $json['print_only'] = $this->printOnly['value']; - } - if (!empty($this->isDuplicate)) { - $json['is_duplicate'] = $this->isDuplicate['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RedeemLoyaltyRewardRequest.php b/src/Models/RedeemLoyaltyRewardRequest.php deleted file mode 100644 index 4b0942a7..00000000 --- a/src/Models/RedeemLoyaltyRewardRequest.php +++ /dev/null @@ -1,98 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->locationId = $locationId; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `RedeemLoyaltyReward` request. - * Keys can be any valid string, but must be unique for every request. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `RedeemLoyaltyReward` request. - * Keys can be any valid string, but must be unique for every request. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Location Id. - * The ID of the [location](entity:Location) where the reward is redeemed. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the [location](entity:Location) where the reward is redeemed. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['location_id'] = $this->locationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RedeemLoyaltyRewardResponse.php b/src/Models/RedeemLoyaltyRewardResponse.php deleted file mode 100644 index 6e17a2cd..00000000 --- a/src/Models/RedeemLoyaltyRewardResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - */ - public function getEvent(): ?LoyaltyEvent - { - return $this->event; - } - - /** - * Sets Event. - * Provides information about a loyalty event. - * For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup. - * com/docs/loyalty-api/loyalty-events). - * - * @maps event - */ - public function setEvent(?LoyaltyEvent $event): void - { - $this->event = $event; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->event)) { - $json['event'] = $this->event; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Refund.php b/src/Models/Refund.php deleted file mode 100644 index 8c48734c..00000000 --- a/src/Models/Refund.php +++ /dev/null @@ -1,395 +0,0 @@ -id = $id; - $this->locationId = $locationId; - $this->reason = $reason; - $this->amountMoney = $amountMoney; - $this->status = $status; - } - - /** - * Returns Id. - * The refund's unique ID. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The refund's unique ID. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the refund's associated location. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the refund's associated location. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Transaction Id. - * The ID of the transaction that the refunded tender is part of. - */ - public function getTransactionId(): ?string - { - if (count($this->transactionId) == 0) { - return null; - } - return $this->transactionId['value']; - } - - /** - * Sets Transaction Id. - * The ID of the transaction that the refunded tender is part of. - * - * @maps transaction_id - */ - public function setTransactionId(?string $transactionId): void - { - $this->transactionId['value'] = $transactionId; - } - - /** - * Unsets Transaction Id. - * The ID of the transaction that the refunded tender is part of. - */ - public function unsetTransactionId(): void - { - $this->transactionId = []; - } - - /** - * Returns Tender Id. - * The ID of the refunded tender. - */ - public function getTenderId(): ?string - { - if (count($this->tenderId) == 0) { - return null; - } - return $this->tenderId['value']; - } - - /** - * Sets Tender Id. - * The ID of the refunded tender. - * - * @maps tender_id - */ - public function setTenderId(?string $tenderId): void - { - $this->tenderId['value'] = $tenderId; - } - - /** - * Unsets Tender Id. - * The ID of the refunded tender. - */ - public function unsetTenderId(): void - { - $this->tenderId = []; - } - - /** - * Returns Created At. - * The timestamp for when the refund was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the refund was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Reason. - * The reason for the refund being issued. - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * The reason for the refund being issued. - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Status. - * Indicates a refund's current status. - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * Sets Status. - * Indicates a refund's current status. - * - * @required - * @maps status - */ - public function setStatus(string $status): void - { - $this->status = $status; - } - - /** - * Returns Processing Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getProcessingFeeMoney(): ?Money - { - return $this->processingFeeMoney; - } - - /** - * Sets Processing Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps processing_fee_money - */ - public function setProcessingFeeMoney(?Money $processingFeeMoney): void - { - $this->processingFeeMoney = $processingFeeMoney; - } - - /** - * Returns Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this refund. - * For example, fees assessed on a refund of a purchase by a third party integration. - * - * @return AdditionalRecipient[]|null - */ - public function getAdditionalRecipients(): ?array - { - if (count($this->additionalRecipients) == 0) { - return null; - } - return $this->additionalRecipients['value']; - } - - /** - * Sets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this refund. - * For example, fees assessed on a refund of a purchase by a third party integration. - * - * @maps additional_recipients - * - * @param AdditionalRecipient[]|null $additionalRecipients - */ - public function setAdditionalRecipients(?array $additionalRecipients): void - { - $this->additionalRecipients['value'] = $additionalRecipients; - } - - /** - * Unsets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this refund. - * For example, fees assessed on a refund of a purchase by a third party integration. - */ - public function unsetAdditionalRecipients(): void - { - $this->additionalRecipients = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['location_id'] = $this->locationId; - if (!empty($this->transactionId)) { - $json['transaction_id'] = $this->transactionId['value']; - } - if (!empty($this->tenderId)) { - $json['tender_id'] = $this->tenderId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json['reason'] = $this->reason; - $json['amount_money'] = $this->amountMoney; - $json['status'] = $this->status; - if (isset($this->processingFeeMoney)) { - $json['processing_fee_money'] = $this->processingFeeMoney; - } - if (!empty($this->additionalRecipients)) { - $json['additional_recipients'] = $this->additionalRecipients['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RefundPaymentRequest.php b/src/Models/RefundPaymentRequest.php deleted file mode 100644 index 3f3f5958..00000000 --- a/src/Models/RefundPaymentRequest.php +++ /dev/null @@ -1,592 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->amountMoney = $amountMoney; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `RefundPayment` request. The key can be any valid string - * but must be unique for every `RefundPayment` request. - * - * Keys are limited to a max of 45 characters - however, the number of allowed characters might be - * less than 45, if multi-byte characters are used. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `RefundPayment` request. The key can be any valid string - * but must be unique for every `RefundPayment` request. - * - * Keys are limited to a max of 45 characters - however, the number of allowed characters might be - * less than 45, if multi-byte characters are used. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- - * apis/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Payment Id. - * The unique ID of the payment being refunded. - * Required when unlinked=false, otherwise must not be set. - */ - public function getPaymentId(): ?string - { - if (count($this->paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The unique ID of the payment being refunded. - * Required when unlinked=false, otherwise must not be set. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The unique ID of the payment being refunded. - * Required when unlinked=false, otherwise must not be set. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Destination Id. - * The ID indicating where funds will be refunded to. Required for unlinked refunds. For more - * information, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds- - * api/unlinked-refunds). - * - * For refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds - * will be returned to the original payment source. The field may be specified in order to request - * a cross-method refund to a gift card. For more information, - * see [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund- - * payments#cross-method-refunds-to-gift-cards). - */ - public function getDestinationId(): ?string - { - if (count($this->destinationId) == 0) { - return null; - } - return $this->destinationId['value']; - } - - /** - * Sets Destination Id. - * The ID indicating where funds will be refunded to. Required for unlinked refunds. For more - * information, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds- - * api/unlinked-refunds). - * - * For refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds - * will be returned to the original payment source. The field may be specified in order to request - * a cross-method refund to a gift card. For more information, - * see [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund- - * payments#cross-method-refunds-to-gift-cards). - * - * @maps destination_id - */ - public function setDestinationId(?string $destinationId): void - { - $this->destinationId['value'] = $destinationId; - } - - /** - * Unsets Destination Id. - * The ID indicating where funds will be refunded to. Required for unlinked refunds. For more - * information, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds- - * api/unlinked-refunds). - * - * For refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds - * will be returned to the original payment source. The field may be specified in order to request - * a cross-method refund to a gift card. For more information, - * see [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund- - * payments#cross-method-refunds-to-gift-cards). - */ - public function unsetDestinationId(): void - { - $this->destinationId = []; - } - - /** - * Returns Unlinked. - * Indicates that the refund is not linked to a Square payment. - * If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not - * be provided. - */ - public function getUnlinked(): ?bool - { - if (count($this->unlinked) == 0) { - return null; - } - return $this->unlinked['value']; - } - - /** - * Sets Unlinked. - * Indicates that the refund is not linked to a Square payment. - * If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not - * be provided. - * - * @maps unlinked - */ - public function setUnlinked(?bool $unlinked): void - { - $this->unlinked['value'] = $unlinked; - } - - /** - * Unsets Unlinked. - * Indicates that the refund is not linked to a Square payment. - * If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not - * be provided. - */ - public function unsetUnlinked(): void - { - $this->unlinked = []; - } - - /** - * Returns Location Id. - * The location ID associated with the unlinked refund. - * Required for requests specifying `unlinked=true`. - * Otherwise, if included when `unlinked=false`, will throw an error. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The location ID associated with the unlinked refund. - * Required for requests specifying `unlinked=true`. - * Otherwise, if included when `unlinked=false`, will throw an error. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The location ID associated with the unlinked refund. - * Required for requests specifying `unlinked=true`. - * Otherwise, if included when `unlinked=false`, will throw an error. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Customer Id. - * The [Customer](entity:Customer) ID of the customer associated with the refund. - * This is required if the `destination_id` refers to a card on file created using the Cards - * API. Only allowed when `unlinked=true`. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * The [Customer](entity:Customer) ID of the customer associated with the refund. - * This is required if the `destination_id` refers to a card on file created using the Cards - * API. Only allowed when `unlinked=true`. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * The [Customer](entity:Customer) ID of the customer associated with the refund. - * This is required if the `destination_id` refers to a card on file created using the Cards - * API. Only allowed when `unlinked=true`. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Reason. - * A description of the reason for the refund. - */ - public function getReason(): ?string - { - if (count($this->reason) == 0) { - return null; - } - return $this->reason['value']; - } - - /** - * Sets Reason. - * A description of the reason for the refund. - * - * @maps reason - */ - public function setReason(?string $reason): void - { - $this->reason['value'] = $reason; - } - - /** - * Unsets Reason. - * A description of the reason for the refund. - */ - public function unsetReason(): void - { - $this->reason = []; - } - - /** - * Returns Payment Version Token. - * Used for optimistic concurrency. This opaque token identifies the current `Payment` - * version that the caller expects. If the server has a different version of the Payment, - * the update fails and a response with a VERSION_MISMATCH error is returned. - * If the versions match, or the field is not provided, the refund proceeds as normal. - */ - public function getPaymentVersionToken(): ?string - { - if (count($this->paymentVersionToken) == 0) { - return null; - } - return $this->paymentVersionToken['value']; - } - - /** - * Sets Payment Version Token. - * Used for optimistic concurrency. This opaque token identifies the current `Payment` - * version that the caller expects. If the server has a different version of the Payment, - * the update fails and a response with a VERSION_MISMATCH error is returned. - * If the versions match, or the field is not provided, the refund proceeds as normal. - * - * @maps payment_version_token - */ - public function setPaymentVersionToken(?string $paymentVersionToken): void - { - $this->paymentVersionToken['value'] = $paymentVersionToken; - } - - /** - * Unsets Payment Version Token. - * Used for optimistic concurrency. This opaque token identifies the current `Payment` - * version that the caller expects. If the server has a different version of the Payment, - * the update fails and a response with a VERSION_MISMATCH error is returned. - * If the versions match, or the field is not provided, the refund proceeds as normal. - */ - public function unsetPaymentVersionToken(): void - { - $this->paymentVersionToken = []; - } - - /** - * Returns Team Member Id. - * An optional [TeamMember](entity:TeamMember) ID to associate with this refund. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * An optional [TeamMember](entity:TeamMember) ID to associate with this refund. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * An optional [TeamMember](entity:TeamMember) ID to associate with this refund. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Cash Details. - * Stores details about a cash refund. Contains only non-confidential information. - */ - public function getCashDetails(): ?DestinationDetailsCashRefundDetails - { - return $this->cashDetails; - } - - /** - * Sets Cash Details. - * Stores details about a cash refund. Contains only non-confidential information. - * - * @maps cash_details - */ - public function setCashDetails(?DestinationDetailsCashRefundDetails $cashDetails): void - { - $this->cashDetails = $cashDetails; - } - - /** - * Returns External Details. - * Stores details about an external refund. Contains only non-confidential information. - */ - public function getExternalDetails(): ?DestinationDetailsExternalRefundDetails - { - return $this->externalDetails; - } - - /** - * Sets External Details. - * Stores details about an external refund. Contains only non-confidential information. - * - * @maps external_details - */ - public function setExternalDetails(?DestinationDetailsExternalRefundDetails $externalDetails): void - { - $this->externalDetails = $externalDetails; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['amount_money'] = $this->amountMoney; - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->destinationId)) { - $json['destination_id'] = $this->destinationId['value']; - } - if (!empty($this->unlinked)) { - $json['unlinked'] = $this->unlinked['value']; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (!empty($this->reason)) { - $json['reason'] = $this->reason['value']; - } - if (!empty($this->paymentVersionToken)) { - $json['payment_version_token'] = $this->paymentVersionToken['value']; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (isset($this->cashDetails)) { - $json['cash_details'] = $this->cashDetails; - } - if (isset($this->externalDetails)) { - $json['external_details'] = $this->externalDetails; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RefundPaymentResponse.php b/src/Models/RefundPaymentResponse.php deleted file mode 100644 index 1afb1b39..00000000 --- a/src/Models/RefundPaymentResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refund. - * Represents a refund of a payment made using Square. Contains information about - * the original payment and the amount of money refunded. - */ - public function getRefund(): ?PaymentRefund - { - return $this->refund; - } - - /** - * Sets Refund. - * Represents a refund of a payment made using Square. Contains information about - * the original payment and the amount of money refunded. - * - * @maps refund - */ - public function setRefund(?PaymentRefund $refund): void - { - $this->refund = $refund; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refund)) { - $json['refund'] = $this->refund; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RefundStatus.php b/src/Models/RefundStatus.php deleted file mode 100644 index a9094922..00000000 --- a/src/Models/RefundStatus.php +++ /dev/null @@ -1,31 +0,0 @@ -domainName = $domainName; - } - - /** - * Returns Domain Name. - * A domain name as described in RFC-1034 that will be registered with ApplePay. - */ - public function getDomainName(): string - { - return $this->domainName; - } - - /** - * Sets Domain Name. - * A domain name as described in RFC-1034 that will be registered with ApplePay. - * - * @required - * @maps domain_name - */ - public function setDomainName(string $domainName): void - { - $this->domainName = $domainName; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['domain_name'] = $this->domainName; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RegisterDomainResponse.php b/src/Models/RegisterDomainResponse.php deleted file mode 100644 index f31fc47d..00000000 --- a/src/Models/RegisterDomainResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Status. - * The status of the domain registration. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the domain registration. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RegisterDomainResponseStatus.php b/src/Models/RegisterDomainResponseStatus.php deleted file mode 100644 index 834703c3..00000000 --- a/src/Models/RegisterDomainResponseStatus.php +++ /dev/null @@ -1,21 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ResumeSubscriptionRequest.php b/src/Models/ResumeSubscriptionRequest.php deleted file mode 100644 index bb730e56..00000000 --- a/src/Models/ResumeSubscriptionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -resumeEffectiveDate) == 0) { - return null; - } - return $this->resumeEffectiveDate['value']; - } - - /** - * Sets Resume Effective Date. - * The `YYYY-MM-DD`-formatted date when the subscription reactivated. - * - * @maps resume_effective_date - */ - public function setResumeEffectiveDate(?string $resumeEffectiveDate): void - { - $this->resumeEffectiveDate['value'] = $resumeEffectiveDate; - } - - /** - * Unsets Resume Effective Date. - * The `YYYY-MM-DD`-formatted date when the subscription reactivated. - */ - public function unsetResumeEffectiveDate(): void - { - $this->resumeEffectiveDate = []; - } - - /** - * Returns Resume Change Timing. - * Supported timings when a pending change, as an action, takes place to a subscription. - */ - public function getResumeChangeTiming(): ?string - { - return $this->resumeChangeTiming; - } - - /** - * Sets Resume Change Timing. - * Supported timings when a pending change, as an action, takes place to a subscription. - * - * @maps resume_change_timing - */ - public function setResumeChangeTiming(?string $resumeChangeTiming): void - { - $this->resumeChangeTiming = $resumeChangeTiming; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->resumeEffectiveDate)) { - $json['resume_effective_date'] = $this->resumeEffectiveDate['value']; - } - if (isset($this->resumeChangeTiming)) { - $json['resume_change_timing'] = $this->resumeChangeTiming; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ResumeSubscriptionResponse.php b/src/Models/ResumeSubscriptionResponse.php deleted file mode 100644 index 92a6a239..00000000 --- a/src/Models/ResumeSubscriptionResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Returns Actions. - * A list of `RESUME` actions created by the request and scheduled for the subscription. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - return $this->actions; - } - - /** - * Sets Actions. - * A list of `RESUME` actions created by the request and scheduled for the subscription. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions = $actions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - if (isset($this->actions)) { - $json['actions'] = $this->actions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBookingCustomAttributeDefinitionRequest.php b/src/Models/RetrieveBookingCustomAttributeDefinitionRequest.php deleted file mode 100644 index 692e10b4..00000000 --- a/src/Models/RetrieveBookingCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -version; - } - - /** - * Sets Version. - * The current version of the custom attribute definition, which is used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the request, - * Square returns the specified version or a higher version if one exists. If the specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBookingCustomAttributeDefinitionResponse.php b/src/Models/RetrieveBookingCustomAttributeDefinitionResponse.php deleted file mode 100644 index 8200904a..00000000 --- a/src/Models/RetrieveBookingCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBookingCustomAttributeRequest.php b/src/Models/RetrieveBookingCustomAttributeRequest.php deleted file mode 100644 index 612a5f0d..00000000 --- a/src/Models/RetrieveBookingCustomAttributeRequest.php +++ /dev/null @@ -1,119 +0,0 @@ -withDefinition) == 0) { - return null; - } - return $this->withDefinition['value']; - } - - /** - * Sets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definition - */ - public function setWithDefinition(?bool $withDefinition): void - { - $this->withDefinition['value'] = $withDefinition; - } - - /** - * Unsets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinition(): void - { - $this->withDefinition = []; - } - - /** - * Returns Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->withDefinition)) { - $json['with_definition'] = $this->withDefinition['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBookingCustomAttributeResponse.php b/src/Models/RetrieveBookingCustomAttributeResponse.php deleted file mode 100644 index 804e8552..00000000 --- a/src/Models/RetrieveBookingCustomAttributeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBookingResponse.php b/src/Models/RetrieveBookingResponse.php deleted file mode 100644 index 74374960..00000000 --- a/src/Models/RetrieveBookingResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @maps booking - */ - public function setBooking(?Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->booking)) { - $json['booking'] = $this->booking; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveBusinessBookingProfileResponse.php b/src/Models/RetrieveBusinessBookingProfileResponse.php deleted file mode 100644 index 09e83faf..00000000 --- a/src/Models/RetrieveBusinessBookingProfileResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -businessBookingProfile; - } - - /** - * Sets Business Booking Profile. - * A seller's business booking profile, including booking policy, appointment settings, etc. - * - * @maps business_booking_profile - */ - public function setBusinessBookingProfile(?BusinessBookingProfile $businessBookingProfile): void - { - $this->businessBookingProfile = $businessBookingProfile; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->businessBookingProfile)) { - $json['business_booking_profile'] = $this->businessBookingProfile; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCardResponse.php b/src/Models/RetrieveCardResponse.php deleted file mode 100644 index 699dbbf6..00000000 --- a/src/Models/RetrieveCardResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCashDrawerShiftRequest.php b/src/Models/RetrieveCashDrawerShiftRequest.php deleted file mode 100644 index 0b5618f1..00000000 --- a/src/Models/RetrieveCashDrawerShiftRequest.php +++ /dev/null @@ -1,64 +0,0 @@ -locationId = $locationId; - } - - /** - * Returns Location Id. - * The ID of the location to retrieve cash drawer shifts from. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location to retrieve cash drawer shifts from. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_id'] = $this->locationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCashDrawerShiftResponse.php b/src/Models/RetrieveCashDrawerShiftResponse.php deleted file mode 100644 index 19905656..00000000 --- a/src/Models/RetrieveCashDrawerShiftResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -cashDrawerShift; - } - - /** - * Sets Cash Drawer Shift. - * This model gives the details of a cash drawer shift. - * The cash_payment_money, cash_refund_money, cash_paid_in_money, - * and cash_paid_out_money fields are all computed by summing their respective - * event types. - * - * @maps cash_drawer_shift - */ - public function setCashDrawerShift(?CashDrawerShift $cashDrawerShift): void - { - $this->cashDrawerShift = $cashDrawerShift; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cashDrawerShift)) { - $json['cash_drawer_shift'] = $this->cashDrawerShift; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCatalogObjectRequest.php b/src/Models/RetrieveCatalogObjectRequest.php deleted file mode 100644 index fed540b0..00000000 --- a/src/Models/RetrieveCatalogObjectRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -includeRelatedObjects) == 0) { - return null; - } - return $this->includeRelatedObjects['value']; - } - - /** - * Sets Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by the results in the - * `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - * - * @maps include_related_objects - */ - public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void - { - $this->includeRelatedObjects['value'] = $includeRelatedObjects; - } - - /** - * Unsets Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are defined as any objects referenced by ID by the results in the - * `objects` field - * of the response. These objects are put in the `related_objects` field. Setting this to `true` is - * helpful when the objects are needed for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. For example, - * - * if the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - */ - public function unsetIncludeRelatedObjects(): void - { - $this->includeRelatedObjects = []; - } - - /** - * Returns Catalog Version. - * Requests objects as of a specific version of the catalog. This allows you to retrieve historical - * versions of objects. The value to retrieve a specific version of an object can be found - * in the version field of [CatalogObject]($m/CatalogObject)s. If not included, results will - * be from the current version of the catalog. - */ - public function getCatalogVersion(): ?int - { - if (count($this->catalogVersion) == 0) { - return null; - } - return $this->catalogVersion['value']; - } - - /** - * Sets Catalog Version. - * Requests objects as of a specific version of the catalog. This allows you to retrieve historical - * versions of objects. The value to retrieve a specific version of an object can be found - * in the version field of [CatalogObject]($m/CatalogObject)s. If not included, results will - * be from the current version of the catalog. - * - * @maps catalog_version - */ - public function setCatalogVersion(?int $catalogVersion): void - { - $this->catalogVersion['value'] = $catalogVersion; - } - - /** - * Unsets Catalog Version. - * Requests objects as of a specific version of the catalog. This allows you to retrieve historical - * versions of objects. The value to retrieve a specific version of an object can be found - * in the version field of [CatalogObject]($m/CatalogObject)s. If not included, results will - * be from the current version of the catalog. - */ - public function unsetCatalogVersion(): void - { - $this->catalogVersion = []; - } - - /** - * Returns Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - */ - public function getIncludeCategoryPathToRoot(): ?bool - { - if (count($this->includeCategoryPathToRoot) == 0) { - return null; - } - return $this->includeCategoryPathToRoot['value']; - } - - /** - * Sets Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - * - * @maps include_category_path_to_root - */ - public function setIncludeCategoryPathToRoot(?bool $includeCategoryPathToRoot): void - { - $this->includeCategoryPathToRoot['value'] = $includeCategoryPathToRoot; - } - - /** - * Unsets Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - */ - public function unsetIncludeCategoryPathToRoot(): void - { - $this->includeCategoryPathToRoot = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->includeRelatedObjects)) { - $json['include_related_objects'] = $this->includeRelatedObjects['value']; - } - if (!empty($this->catalogVersion)) { - $json['catalog_version'] = $this->catalogVersion['value']; - } - if (!empty($this->includeCategoryPathToRoot)) { - $json['include_category_path_to_root'] = $this->includeCategoryPathToRoot['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCatalogObjectResponse.php b/src/Models/RetrieveCatalogObjectResponse.php deleted file mode 100644 index def6186c..00000000 --- a/src/Models/RetrieveCatalogObjectResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getObject(): ?CatalogObject - { - return $this->object; - } - - /** - * Sets Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @maps object - */ - public function setObject(?CatalogObject $object): void - { - $this->object = $object; - } - - /** - * Returns Related Objects. - * A list of `CatalogObject`s referenced by the object in the `object` field. - * - * @return CatalogObject[]|null - */ - public function getRelatedObjects(): ?array - { - return $this->relatedObjects; - } - - /** - * Sets Related Objects. - * A list of `CatalogObject`s referenced by the object in the `object` field. - * - * @maps related_objects - * - * @param CatalogObject[]|null $relatedObjects - */ - public function setRelatedObjects(?array $relatedObjects): void - { - $this->relatedObjects = $relatedObjects; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->object)) { - $json['object'] = $this->object; - } - if (isset($this->relatedObjects)) { - $json['related_objects'] = $this->relatedObjects; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerCustomAttributeDefinitionRequest.php b/src/Models/RetrieveCustomerCustomAttributeDefinitionRequest.php deleted file mode 100644 index dd729ec1..00000000 --- a/src/Models/RetrieveCustomerCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -version; - } - - /** - * Sets Version. - * The current version of the custom attribute definition, which is used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the request, - * Square returns the specified version or a higher version if one exists. If the specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerCustomAttributeDefinitionResponse.php b/src/Models/RetrieveCustomerCustomAttributeDefinitionResponse.php deleted file mode 100644 index 8c73996d..00000000 --- a/src/Models/RetrieveCustomerCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerCustomAttributeRequest.php b/src/Models/RetrieveCustomerCustomAttributeRequest.php deleted file mode 100644 index 8a730ae7..00000000 --- a/src/Models/RetrieveCustomerCustomAttributeRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -withDefinition) == 0) { - return null; - } - return $this->withDefinition['value']; - } - - /** - * Sets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definition - */ - public function setWithDefinition(?bool $withDefinition): void - { - $this->withDefinition['value'] = $withDefinition; - } - - /** - * Unsets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinition(): void - { - $this->withDefinition = []; - } - - /** - * Returns Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->withDefinition)) { - $json['with_definition'] = $this->withDefinition['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerCustomAttributeResponse.php b/src/Models/RetrieveCustomerCustomAttributeResponse.php deleted file mode 100644 index 1a3a9a66..00000000 --- a/src/Models/RetrieveCustomerCustomAttributeResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerGroupResponse.php b/src/Models/RetrieveCustomerGroupResponse.php deleted file mode 100644 index 0f398d0a..00000000 --- a/src/Models/RetrieveCustomerGroupResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - */ - public function getGroup(): ?CustomerGroup - { - return $this->group; - } - - /** - * Sets Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - * - * @maps group - */ - public function setGroup(?CustomerGroup $group): void - { - $this->group = $group; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->group)) { - $json['group'] = $this->group; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerResponse.php b/src/Models/RetrieveCustomerResponse.php deleted file mode 100644 index a7e8b638..00000000 --- a/src/Models/RetrieveCustomerResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - */ - public function getCustomer(): ?Customer - { - return $this->customer; - } - - /** - * Sets Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - * - * @maps customer - */ - public function setCustomer(?Customer $customer): void - { - $this->customer = $customer; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->customer)) { - $json['customer'] = $this->customer; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveCustomerSegmentResponse.php b/src/Models/RetrieveCustomerSegmentResponse.php deleted file mode 100644 index 336418ea..00000000 --- a/src/Models/RetrieveCustomerSegmentResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Segment. - * Represents a group of customer profiles that match one or more predefined filter criteria. - * - * Segments (also known as Smart Groups) are defined and created within the Customer Directory in the - * Square Seller Dashboard or Point of Sale. - */ - public function getSegment(): ?CustomerSegment - { - return $this->segment; - } - - /** - * Sets Segment. - * Represents a group of customer profiles that match one or more predefined filter criteria. - * - * Segments (also known as Smart Groups) are defined and created within the Customer Directory in the - * Square Seller Dashboard or Point of Sale. - * - * @maps segment - */ - public function setSegment(?CustomerSegment $segment): void - { - $this->segment = $segment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->segment)) { - $json['segment'] = $this->segment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveDisputeEvidenceResponse.php b/src/Models/RetrieveDisputeEvidenceResponse.php deleted file mode 100644 index 1a67e752..00000000 --- a/src/Models/RetrieveDisputeEvidenceResponse.php +++ /dev/null @@ -1,90 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Evidence. - */ - public function getEvidence(): ?DisputeEvidence - { - return $this->evidence; - } - - /** - * Sets Evidence. - * - * @maps evidence - */ - public function setEvidence(?DisputeEvidence $evidence): void - { - $this->evidence = $evidence; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->evidence)) { - $json['evidence'] = $this->evidence; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveDisputeResponse.php b/src/Models/RetrieveDisputeResponse.php deleted file mode 100644 index 615cdd79..00000000 --- a/src/Models/RetrieveDisputeResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - */ - public function getDispute(): ?Dispute - { - return $this->dispute; - } - - /** - * Sets Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - * - * @maps dispute - */ - public function setDispute(?Dispute $dispute): void - { - $this->dispute = $dispute; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->dispute)) { - $json['dispute'] = $this->dispute; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveEmployeeResponse.php b/src/Models/RetrieveEmployeeResponse.php deleted file mode 100644 index db1808ea..00000000 --- a/src/Models/RetrieveEmployeeResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -employee; - } - - /** - * Sets Employee. - * An employee object that is used by the external API. - * - * DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). - * - * @maps employee - */ - public function setEmployee(?Employee $employee): void - { - $this->employee = $employee; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->employee)) { - $json['employee'] = $this->employee; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveGiftCardFromGANRequest.php b/src/Models/RetrieveGiftCardFromGANRequest.php deleted file mode 100644 index a262c5a7..00000000 --- a/src/Models/RetrieveGiftCardFromGANRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -gan = $gan; - } - - /** - * Returns Gan. - * The gift card account number (GAN) of the gift card to retrieve. - * The maximum length of a GAN is 255 digits to account for third-party GANs that have been imported. - * Square-issued gift cards have 16-digit GANs. - */ - public function getGan(): string - { - return $this->gan; - } - - /** - * Sets Gan. - * The gift card account number (GAN) of the gift card to retrieve. - * The maximum length of a GAN is 255 digits to account for third-party GANs that have been imported. - * Square-issued gift cards have 16-digit GANs. - * - * @required - * @maps gan - */ - public function setGan(string $gan): void - { - $this->gan = $gan; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['gan'] = $this->gan; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveGiftCardFromGANResponse.php b/src/Models/RetrieveGiftCardFromGANResponse.php deleted file mode 100644 index 82af4967..00000000 --- a/src/Models/RetrieveGiftCardFromGANResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveGiftCardFromNonceRequest.php b/src/Models/RetrieveGiftCardFromNonceRequest.php deleted file mode 100644 index 4acc1ddc..00000000 --- a/src/Models/RetrieveGiftCardFromNonceRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -nonce = $nonce; - } - - /** - * Returns Nonce. - * The payment token of the gift card to retrieve. Payment tokens are generated by the - * Web Payments SDK or In-App Payments SDK. - */ - public function getNonce(): string - { - return $this->nonce; - } - - /** - * Sets Nonce. - * The payment token of the gift card to retrieve. Payment tokens are generated by the - * Web Payments SDK or In-App Payments SDK. - * - * @required - * @maps nonce - */ - public function setNonce(string $nonce): void - { - $this->nonce = $nonce; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['nonce'] = $this->nonce; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveGiftCardFromNonceResponse.php b/src/Models/RetrieveGiftCardFromNonceResponse.php deleted file mode 100644 index 39925f37..00000000 --- a/src/Models/RetrieveGiftCardFromNonceResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveGiftCardResponse.php b/src/Models/RetrieveGiftCardResponse.php deleted file mode 100644 index 1b9f2de3..00000000 --- a/src/Models/RetrieveGiftCardResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryAdjustmentResponse.php b/src/Models/RetrieveInventoryAdjustmentResponse.php deleted file mode 100644 index 83e94358..00000000 --- a/src/Models/RetrieveInventoryAdjustmentResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Adjustment. - * Represents a change in state or quantity of product inventory at a - * particular time and location. - */ - public function getAdjustment(): ?InventoryAdjustment - { - return $this->adjustment; - } - - /** - * Sets Adjustment. - * Represents a change in state or quantity of product inventory at a - * particular time and location. - * - * @maps adjustment - */ - public function setAdjustment(?InventoryAdjustment $adjustment): void - { - $this->adjustment = $adjustment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->adjustment)) { - $json['adjustment'] = $this->adjustment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryChangesRequest.php b/src/Models/RetrieveInventoryChangesRequest.php deleted file mode 100644 index 35a7c929..00000000 --- a/src/Models/RetrieveInventoryChangesRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The [Location](entity:Location) IDs to look up as a comma-separated - * list. An empty list queries all locations. - * - * @maps location_ids - */ - public function setLocationIds(?string $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The [Location](entity:Location) IDs to look up as a comma-separated - * list. An empty list queries all locations. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryChangesResponse.php b/src/Models/RetrieveInventoryChangesResponse.php deleted file mode 100644 index d35a4b95..00000000 --- a/src/Models/RetrieveInventoryChangesResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Changes. - * The set of inventory changes for the requested object and locations. - * - * @return InventoryChange[]|null - */ - public function getChanges(): ?array - { - return $this->changes; - } - - /** - * Sets Changes. - * The set of inventory changes for the requested object and locations. - * - * @maps changes - * - * @param InventoryChange[]|null $changes - */ - public function setChanges(?array $changes): void - { - $this->changes = $changes; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->changes)) { - $json['changes'] = $this->changes; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryCountRequest.php b/src/Models/RetrieveInventoryCountRequest.php deleted file mode 100644 index 0ee49337..00000000 --- a/src/Models/RetrieveInventoryCountRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The [Location](entity:Location) IDs to look up as a comma-separated - * list. An empty list queries all locations. - * - * @maps location_ids - */ - public function setLocationIds(?string $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The [Location](entity:Location) IDs to look up as a comma-separated - * list. An empty list queries all locations. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - if (count($this->cursor) == 0) { - return null; - } - return $this->cursor['value']; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor['value'] = $cursor; - } - - /** - * Unsets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function unsetCursor(): void - { - $this->cursor = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->cursor)) { - $json['cursor'] = $this->cursor['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryCountResponse.php b/src/Models/RetrieveInventoryCountResponse.php deleted file mode 100644 index 233646c2..00000000 --- a/src/Models/RetrieveInventoryCountResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Counts. - * The current calculated inventory counts for the requested object and - * locations. - * - * @return InventoryCount[]|null - */ - public function getCounts(): ?array - { - return $this->counts; - } - - /** - * Sets Counts. - * The current calculated inventory counts for the requested object and - * locations. - * - * @maps counts - * - * @param InventoryCount[]|null $counts - */ - public function setCounts(?array $counts): void - { - $this->counts = $counts; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->counts)) { - $json['counts'] = $this->counts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryPhysicalCountResponse.php b/src/Models/RetrieveInventoryPhysicalCountResponse.php deleted file mode 100644 index f22ed226..00000000 --- a/src/Models/RetrieveInventoryPhysicalCountResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Count. - * Represents the quantity of an item variation that is physically present - * at a specific location, verified by a seller or a seller's employee. For example, - * a physical count might come from an employee counting the item variations on - * hand or from syncing with an external system. - */ - public function getCount(): ?InventoryPhysicalCount - { - return $this->count; - } - - /** - * Sets Count. - * Represents the quantity of an item variation that is physically present - * at a specific location, verified by a seller or a seller's employee. For example, - * a physical count might come from an employee counting the item variations on - * hand or from syncing with an external system. - * - * @maps count - */ - public function setCount(?InventoryPhysicalCount $count): void - { - $this->count = $count; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->count)) { - $json['count'] = $this->count; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveInventoryTransferResponse.php b/src/Models/RetrieveInventoryTransferResponse.php deleted file mode 100644 index 748ee7a7..00000000 --- a/src/Models/RetrieveInventoryTransferResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Transfer. - * Represents the transfer of a quantity of product inventory at a - * particular time from one location to another. - */ - public function getTransfer(): ?InventoryTransfer - { - return $this->transfer; - } - - /** - * Sets Transfer. - * Represents the transfer of a quantity of product inventory at a - * particular time from one location to another. - * - * @maps transfer - */ - public function setTransfer(?InventoryTransfer $transfer): void - { - $this->transfer = $transfer; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->transfer)) { - $json['transfer'] = $this->transfer; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveJobResponse.php b/src/Models/RetrieveJobResponse.php deleted file mode 100644 index b33fc1c7..00000000 --- a/src/Models/RetrieveJobResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -job; - } - - /** - * Sets Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - * - * @maps job - */ - public function setJob(?Job $job): void - { - $this->job = $job; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->job)) { - $json['job'] = $this->job; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationBookingProfileResponse.php b/src/Models/RetrieveLocationBookingProfileResponse.php deleted file mode 100644 index e55fba21..00000000 --- a/src/Models/RetrieveLocationBookingProfileResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -locationBookingProfile; - } - - /** - * Sets Location Booking Profile. - * The booking profile of a seller's location, including the location's ID and whether the location is - * enabled for online booking. - * - * @maps location_booking_profile - */ - public function setLocationBookingProfile(?LocationBookingProfile $locationBookingProfile): void - { - $this->locationBookingProfile = $locationBookingProfile; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationBookingProfile)) { - $json['location_booking_profile'] = $this->locationBookingProfile; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationCustomAttributeDefinitionRequest.php b/src/Models/RetrieveLocationCustomAttributeDefinitionRequest.php deleted file mode 100644 index 59c60e4c..00000000 --- a/src/Models/RetrieveLocationCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -version; - } - - /** - * Sets Version. - * The current version of the custom attribute definition, which is used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the request, - * Square returns the specified version or a higher version if one exists. If the specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationCustomAttributeDefinitionResponse.php b/src/Models/RetrieveLocationCustomAttributeDefinitionResponse.php deleted file mode 100644 index 39ed1aa9..00000000 --- a/src/Models/RetrieveLocationCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationCustomAttributeRequest.php b/src/Models/RetrieveLocationCustomAttributeRequest.php deleted file mode 100644 index 3266bd17..00000000 --- a/src/Models/RetrieveLocationCustomAttributeRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -withDefinition) == 0) { - return null; - } - return $this->withDefinition['value']; - } - - /** - * Sets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definition - */ - public function setWithDefinition(?bool $withDefinition): void - { - $this->withDefinition['value'] = $withDefinition; - } - - /** - * Unsets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinition(): void - { - $this->withDefinition = []; - } - - /** - * Returns Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->withDefinition)) { - $json['with_definition'] = $this->withDefinition['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationCustomAttributeResponse.php b/src/Models/RetrieveLocationCustomAttributeResponse.php deleted file mode 100644 index 37d5841a..00000000 --- a/src/Models/RetrieveLocationCustomAttributeResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationResponse.php b/src/Models/RetrieveLocationResponse.php deleted file mode 100644 index 0f729bd1..00000000 --- a/src/Models/RetrieveLocationResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - */ - public function getLocation(): ?Location - { - return $this->location; - } - - /** - * Sets Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - * - * @maps location - */ - public function setLocation(?Location $location): void - { - $this->location = $location; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->location)) { - $json['location'] = $this->location; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLocationSettingsResponse.php b/src/Models/RetrieveLocationSettingsResponse.php deleted file mode 100644 index e4d4d839..00000000 --- a/src/Models/RetrieveLocationSettingsResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Location Settings. - */ - public function getLocationSettings(): ?CheckoutLocationSettings - { - return $this->locationSettings; - } - - /** - * Sets Location Settings. - * - * @maps location_settings - */ - public function setLocationSettings(?CheckoutLocationSettings $locationSettings): void - { - $this->locationSettings = $locationSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->locationSettings)) { - $json['location_settings'] = $this->locationSettings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLoyaltyAccountResponse.php b/src/Models/RetrieveLoyaltyAccountResponse.php deleted file mode 100644 index faa15c6e..00000000 --- a/src/Models/RetrieveLoyaltyAccountResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - */ - public function getLoyaltyAccount(): ?LoyaltyAccount - { - return $this->loyaltyAccount; - } - - /** - * Sets Loyalty Account. - * Describes a loyalty account in a [loyalty program]($m/LoyaltyProgram). For more information, see - * [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty- - * accounts). - * - * @maps loyalty_account - */ - public function setLoyaltyAccount(?LoyaltyAccount $loyaltyAccount): void - { - $this->loyaltyAccount = $loyaltyAccount; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyAccount)) { - $json['loyalty_account'] = $this->loyaltyAccount; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLoyaltyProgramResponse.php b/src/Models/RetrieveLoyaltyProgramResponse.php deleted file mode 100644 index 61d2712d..00000000 --- a/src/Models/RetrieveLoyaltyProgramResponse.php +++ /dev/null @@ -1,102 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Program. - * Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem - * points for rewards. - * Square sellers can have only one loyalty program, which is created and managed from the Seller - * Dashboard. - * For more information, see [Loyalty Program Overview](https://developer.squareup. - * com/docs/loyalty/overview). - */ - public function getProgram(): ?LoyaltyProgram - { - return $this->program; - } - - /** - * Sets Program. - * Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem - * points for rewards. - * Square sellers can have only one loyalty program, which is created and managed from the Seller - * Dashboard. - * For more information, see [Loyalty Program Overview](https://developer.squareup. - * com/docs/loyalty/overview). - * - * @maps program - */ - public function setProgram(?LoyaltyProgram $program): void - { - $this->program = $program; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->program)) { - $json['program'] = $this->program; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLoyaltyPromotionResponse.php b/src/Models/RetrieveLoyaltyPromotionResponse.php deleted file mode 100644 index d7e761a9..00000000 --- a/src/Models/RetrieveLoyaltyPromotionResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - */ - public function getLoyaltyPromotion(): ?LoyaltyPromotion - { - return $this->loyaltyPromotion; - } - - /** - * Sets Loyalty Promotion. - * Represents a promotion for a [loyalty program]($m/LoyaltyProgram). Loyalty promotions enable buyers - * to earn extra points on top of those earned from the base program. - * - * A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - * - * @maps loyalty_promotion - */ - public function setLoyaltyPromotion(?LoyaltyPromotion $loyaltyPromotion): void - { - $this->loyaltyPromotion = $loyaltyPromotion; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyPromotion)) { - $json['loyalty_promotion'] = $this->loyaltyPromotion; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveLoyaltyRewardResponse.php b/src/Models/RetrieveLoyaltyRewardResponse.php deleted file mode 100644 index ec5a0f6f..00000000 --- a/src/Models/RetrieveLoyaltyRewardResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - */ - public function getReward(): ?LoyaltyReward - { - return $this->reward; - } - - /** - * Sets Reward. - * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) - * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. - * For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty- - * api/loyalty-rewards). - * - * @maps reward - */ - public function setReward(?LoyaltyReward $reward): void - { - $this->reward = $reward; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->reward)) { - $json['reward'] = $this->reward; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantCustomAttributeDefinitionRequest.php b/src/Models/RetrieveMerchantCustomAttributeDefinitionRequest.php deleted file mode 100644 index cbd5d146..00000000 --- a/src/Models/RetrieveMerchantCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -version; - } - - /** - * Sets Version. - * The current version of the custom attribute definition, which is used for strongly consistent - * reads to guarantee that you receive the most up-to-date data. When included in the request, - * Square returns the specified version or a higher version if one exists. If the specified version - * is higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantCustomAttributeDefinitionResponse.php b/src/Models/RetrieveMerchantCustomAttributeDefinitionResponse.php deleted file mode 100644 index 2031766c..00000000 --- a/src/Models/RetrieveMerchantCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantCustomAttributeRequest.php b/src/Models/RetrieveMerchantCustomAttributeRequest.php deleted file mode 100644 index 1c6c9202..00000000 --- a/src/Models/RetrieveMerchantCustomAttributeRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -withDefinition) == 0) { - return null; - } - return $this->withDefinition['value']; - } - - /** - * Sets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - * - * @maps with_definition - */ - public function setWithDefinition(?bool $withDefinition): void - { - $this->withDefinition['value'] = $withDefinition; - } - - /** - * Unsets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of - * the custom attribute. Set this parameter to `true` to get the name and description of the custom - * attribute, information about the data type, or other definition details. The default value is - * `false`. - */ - public function unsetWithDefinition(): void - { - $this->withDefinition = []; - } - - /** - * Returns Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the custom attribute, which is used for strongly consistent reads to - * guarantee that you receive the most up-to-date data. When included in the request, Square - * returns the specified version or a higher version if one exists. If the specified version is - * higher than the current version, Square returns a `BAD_REQUEST` error. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->withDefinition)) { - $json['with_definition'] = $this->withDefinition['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantCustomAttributeResponse.php b/src/Models/RetrieveMerchantCustomAttributeResponse.php deleted file mode 100644 index 24f69911..00000000 --- a/src/Models/RetrieveMerchantCustomAttributeResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantResponse.php b/src/Models/RetrieveMerchantResponse.php deleted file mode 100644 index 16e98e4b..00000000 --- a/src/Models/RetrieveMerchantResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Merchant. - * Represents a business that sells with Square. - */ - public function getMerchant(): ?Merchant - { - return $this->merchant; - } - - /** - * Sets Merchant. - * Represents a business that sells with Square. - * - * @maps merchant - */ - public function setMerchant(?Merchant $merchant): void - { - $this->merchant = $merchant; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->merchant)) { - $json['merchant'] = $this->merchant; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveMerchantSettingsResponse.php b/src/Models/RetrieveMerchantSettingsResponse.php deleted file mode 100644 index 1b743759..00000000 --- a/src/Models/RetrieveMerchantSettingsResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Merchant Settings. - */ - public function getMerchantSettings(): ?CheckoutMerchantSettings - { - return $this->merchantSettings; - } - - /** - * Sets Merchant Settings. - * - * @maps merchant_settings - */ - public function setMerchantSettings(?CheckoutMerchantSettings $merchantSettings): void - { - $this->merchantSettings = $merchantSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->merchantSettings)) { - $json['merchant_settings'] = $this->merchantSettings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveOrderCustomAttributeDefinitionRequest.php b/src/Models/RetrieveOrderCustomAttributeDefinitionRequest.php deleted file mode 100644 index 25aa4d1b..00000000 --- a/src/Models/RetrieveOrderCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,64 +0,0 @@ -version; - } - - /** - * Sets Version. - * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control, include this optional field and specify the current version of the custom attribute. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveOrderCustomAttributeDefinitionResponse.php b/src/Models/RetrieveOrderCustomAttributeDefinitionResponse.php deleted file mode 100644 index e4ac9a0f..00000000 --- a/src/Models/RetrieveOrderCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveOrderCustomAttributeRequest.php b/src/Models/RetrieveOrderCustomAttributeRequest.php deleted file mode 100644 index 41187f09..00000000 --- a/src/Models/RetrieveOrderCustomAttributeRequest.php +++ /dev/null @@ -1,116 +0,0 @@ -version; - } - - /** - * Sets Version. - * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/optimistic-concurrency) - * control, include this optional field and specify the current version of the custom attribute. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - */ - public function getWithDefinition(): ?bool - { - if (count($this->withDefinition) == 0) { - return null; - } - return $this->withDefinition['value']; - } - - /** - * Sets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - * - * @maps with_definition - */ - public function setWithDefinition(?bool $withDefinition): void - { - $this->withDefinition['value'] = $withDefinition; - } - - /** - * Unsets With Definition. - * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in - * the `definition` field of each - * custom attribute. Set this parameter to `true` to get the name and description of each custom - * attribute, - * information about the data type, or other definition details. The default value is `false`. - */ - public function unsetWithDefinition(): void - { - $this->withDefinition = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (!empty($this->withDefinition)) { - $json['with_definition'] = $this->withDefinition['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveOrderCustomAttributeResponse.php b/src/Models/RetrieveOrderCustomAttributeResponse.php deleted file mode 100644 index f1b30f5e..00000000 --- a/src/Models/RetrieveOrderCustomAttributeResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveOrderResponse.php b/src/Models/RetrieveOrderResponse.php deleted file mode 100644 index 72568db7..00000000 --- a/src/Models/RetrieveOrderResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrievePaymentLinkResponse.php b/src/Models/RetrievePaymentLinkResponse.php deleted file mode 100644 index 18bfdc26..00000000 --- a/src/Models/RetrievePaymentLinkResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment Link. - */ - public function getPaymentLink(): ?PaymentLink - { - return $this->paymentLink; - } - - /** - * Sets Payment Link. - * - * @maps payment_link - */ - public function setPaymentLink(?PaymentLink $paymentLink): void - { - $this->paymentLink = $paymentLink; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->paymentLink)) { - $json['payment_link'] = $this->paymentLink; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveSnippetResponse.php b/src/Models/RetrieveSnippetResponse.php deleted file mode 100644 index 2631fca4..00000000 --- a/src/Models/RetrieveSnippetResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - */ - public function getSnippet(): ?Snippet - { - return $this->snippet; - } - - /** - * Sets Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - * - * @maps snippet - */ - public function setSnippet(?Snippet $snippet): void - { - $this->snippet = $snippet; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->snippet)) { - $json['snippet'] = $this->snippet; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveSubscriptionRequest.php b/src/Models/RetrieveSubscriptionRequest.php deleted file mode 100644 index fab146e5..00000000 --- a/src/Models/RetrieveSubscriptionRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -include) == 0) { - return null; - } - return $this->include['value']; - } - - /** - * Sets Include. - * A query parameter to specify related information to be included in the response. - * - * The supported query parameter values are: - * - * - `actions`: to include scheduled actions on the targeted subscription. - * - * @maps include - */ - public function setInclude(?string $include): void - { - $this->include['value'] = $include; - } - - /** - * Unsets Include. - * A query parameter to specify related information to be included in the response. - * - * The supported query parameter values are: - * - * - `actions`: to include scheduled actions on the targeted subscription. - */ - public function unsetInclude(): void - { - $this->include = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->include)) { - $json['include'] = $this->include['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveSubscriptionResponse.php b/src/Models/RetrieveSubscriptionResponse.php deleted file mode 100644 index c48299bd..00000000 --- a/src/Models/RetrieveSubscriptionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveTeamMemberBookingProfileResponse.php b/src/Models/RetrieveTeamMemberBookingProfileResponse.php deleted file mode 100644 index d3509703..00000000 --- a/src/Models/RetrieveTeamMemberBookingProfileResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -teamMemberBookingProfile; - } - - /** - * Sets Team Member Booking Profile. - * The booking profile of a seller's team member, including the team member's ID, display name, - * description and whether the team member can be booked as a service provider. - * - * @maps team_member_booking_profile - */ - public function setTeamMemberBookingProfile(?TeamMemberBookingProfile $teamMemberBookingProfile): void - { - $this->teamMemberBookingProfile = $teamMemberBookingProfile; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberBookingProfile)) { - $json['team_member_booking_profile'] = $this->teamMemberBookingProfile; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveTeamMemberResponse.php b/src/Models/RetrieveTeamMemberResponse.php deleted file mode 100644 index e05e93dd..00000000 --- a/src/Models/RetrieveTeamMemberResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -teamMember; - } - - /** - * Sets Team Member. - * A record representing an individual team member for a business. - * - * @maps team_member - */ - public function setTeamMember(?TeamMember $teamMember): void - { - $this->teamMember = $teamMember; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMember)) { - $json['team_member'] = $this->teamMember; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveTokenStatusResponse.php b/src/Models/RetrieveTokenStatusResponse.php deleted file mode 100644 index e3a5a6cf..00000000 --- a/src/Models/RetrieveTokenStatusResponse.php +++ /dev/null @@ -1,185 +0,0 @@ -scopes; - } - - /** - * Sets Scopes. - * The list of scopes associated with an access token. - * - * @maps scopes - * - * @param string[]|null $scopes - */ - public function setScopes(?array $scopes): void - { - $this->scopes = $scopes; - } - - /** - * Returns Expires At. - * The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never - * expires. - */ - public function getExpiresAt(): ?string - { - return $this->expiresAt; - } - - /** - * Sets Expires At. - * The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never - * expires. - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt = $expiresAt; - } - - /** - * Returns Client Id. - * The Square-issued application ID associated with the access token. This is the same application ID - * used to obtain the token. - */ - public function getClientId(): ?string - { - return $this->clientId; - } - - /** - * Sets Client Id. - * The Square-issued application ID associated with the access token. This is the same application ID - * used to obtain the token. - * - * @maps client_id - */ - public function setClientId(?string $clientId): void - { - $this->clientId = $clientId; - } - - /** - * Returns Merchant Id. - * The ID of the authorizing merchant's business. - */ - public function getMerchantId(): ?string - { - return $this->merchantId; - } - - /** - * Sets Merchant Id. - * The ID of the authorizing merchant's business. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId = $merchantId; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->scopes)) { - $json['scopes'] = $this->scopes; - } - if (isset($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt; - } - if (isset($this->clientId)) { - $json['client_id'] = $this->clientId; - } - if (isset($this->merchantId)) { - $json['merchant_id'] = $this->merchantId; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveTransactionResponse.php b/src/Models/RetrieveTransactionResponse.php deleted file mode 100644 index 0426043e..00000000 --- a/src/Models/RetrieveTransactionResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Transaction. - * Represents a transaction processed with Square, either with the - * Connect API or with Square Point of Sale. - * - * The `tenders` field of this object lists all methods of payment used to pay in - * the transaction. - */ - public function getTransaction(): ?Transaction - { - return $this->transaction; - } - - /** - * Sets Transaction. - * Represents a transaction processed with Square, either with the - * Connect API or with Square Point of Sale. - * - * The `tenders` field of this object lists all methods of payment used to pay in - * the transaction. - * - * @maps transaction - */ - public function setTransaction(?Transaction $transaction): void - { - $this->transaction = $transaction; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->transaction)) { - $json['transaction'] = $this->transaction; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveVendorResponse.php b/src/Models/RetrieveVendorResponse.php deleted file mode 100644 index 5b2de130..00000000 --- a/src/Models/RetrieveVendorResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered when the request fails. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Vendor. - * Represents a supplier to a seller. - */ - public function getVendor(): ?Vendor - { - return $this->vendor; - } - - /** - * Sets Vendor. - * Represents a supplier to a seller. - * - * @maps vendor - */ - public function setVendor(?Vendor $vendor): void - { - $this->vendor = $vendor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->vendor)) { - $json['vendor'] = $this->vendor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveWageSettingResponse.php b/src/Models/RetrieveWageSettingResponse.php deleted file mode 100644 index b660413b..00000000 --- a/src/Models/RetrieveWageSettingResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -wageSetting; - } - - /** - * Sets Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - * - * @maps wage_setting - */ - public function setWageSetting(?WageSetting $wageSetting): void - { - $this->wageSetting = $wageSetting; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->wageSetting)) { - $json['wage_setting'] = $this->wageSetting; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RetrieveWebhookSubscriptionResponse.php b/src/Models/RetrieveWebhookSubscriptionResponse.php deleted file mode 100644 index df88f233..00000000 --- a/src/Models/RetrieveWebhookSubscriptionResponse.php +++ /dev/null @@ -1,100 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - */ - public function getSubscription(): ?WebhookSubscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @maps subscription - */ - public function setSubscription(?WebhookSubscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RevokeTokenRequest.php b/src/Models/RevokeTokenRequest.php deleted file mode 100644 index 945d1f38..00000000 --- a/src/Models/RevokeTokenRequest.php +++ /dev/null @@ -1,204 +0,0 @@ -clientId) == 0) { - return null; - } - return $this->clientId['value']; - } - - /** - * Sets Client Id. - * The Square-issued ID for your application, which is available on the **OAuth** page in the - * [Developer Dashboard](https://developer.squareup.com/apps). - * - * @maps client_id - */ - public function setClientId(?string $clientId): void - { - $this->clientId['value'] = $clientId; - } - - /** - * Unsets Client Id. - * The Square-issued ID for your application, which is available on the **OAuth** page in the - * [Developer Dashboard](https://developer.squareup.com/apps). - */ - public function unsetClientId(): void - { - $this->clientId = []; - } - - /** - * Returns Access Token. - * The access token of the merchant whose token you want to revoke. - * Do not provide a value for `merchant_id` if you provide this parameter. - */ - public function getAccessToken(): ?string - { - if (count($this->accessToken) == 0) { - return null; - } - return $this->accessToken['value']; - } - - /** - * Sets Access Token. - * The access token of the merchant whose token you want to revoke. - * Do not provide a value for `merchant_id` if you provide this parameter. - * - * @maps access_token - */ - public function setAccessToken(?string $accessToken): void - { - $this->accessToken['value'] = $accessToken; - } - - /** - * Unsets Access Token. - * The access token of the merchant whose token you want to revoke. - * Do not provide a value for `merchant_id` if you provide this parameter. - */ - public function unsetAccessToken(): void - { - $this->accessToken = []; - } - - /** - * Returns Merchant Id. - * The ID of the merchant whose token you want to revoke. - * Do not provide a value for `access_token` if you provide this parameter. - */ - public function getMerchantId(): ?string - { - if (count($this->merchantId) == 0) { - return null; - } - return $this->merchantId['value']; - } - - /** - * Sets Merchant Id. - * The ID of the merchant whose token you want to revoke. - * Do not provide a value for `access_token` if you provide this parameter. - * - * @maps merchant_id - */ - public function setMerchantId(?string $merchantId): void - { - $this->merchantId['value'] = $merchantId; - } - - /** - * Unsets Merchant Id. - * The ID of the merchant whose token you want to revoke. - * Do not provide a value for `access_token` if you provide this parameter. - */ - public function unsetMerchantId(): void - { - $this->merchantId = []; - } - - /** - * Returns Revoke Only Access Token. - * If `true`, terminate the given single access token, but do not - * terminate the entire authorization. - * Default: `false` - */ - public function getRevokeOnlyAccessToken(): ?bool - { - if (count($this->revokeOnlyAccessToken) == 0) { - return null; - } - return $this->revokeOnlyAccessToken['value']; - } - - /** - * Sets Revoke Only Access Token. - * If `true`, terminate the given single access token, but do not - * terminate the entire authorization. - * Default: `false` - * - * @maps revoke_only_access_token - */ - public function setRevokeOnlyAccessToken(?bool $revokeOnlyAccessToken): void - { - $this->revokeOnlyAccessToken['value'] = $revokeOnlyAccessToken; - } - - /** - * Unsets Revoke Only Access Token. - * If `true`, terminate the given single access token, but do not - * terminate the entire authorization. - * Default: `false` - */ - public function unsetRevokeOnlyAccessToken(): void - { - $this->revokeOnlyAccessToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->clientId)) { - $json['client_id'] = $this->clientId['value']; - } - if (!empty($this->accessToken)) { - $json['access_token'] = $this->accessToken['value']; - } - if (!empty($this->merchantId)) { - $json['merchant_id'] = $this->merchantId['value']; - } - if (!empty($this->revokeOnlyAccessToken)) { - $json['revoke_only_access_token'] = $this->revokeOnlyAccessToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RevokeTokenResponse.php b/src/Models/RevokeTokenResponse.php deleted file mode 100644 index 695729fe..00000000 --- a/src/Models/RevokeTokenResponse.php +++ /dev/null @@ -1,89 +0,0 @@ -success; - } - - /** - * Sets Success. - * If the request is successful, this is `true`. - * - * @maps success - */ - public function setSuccess(?bool $success): void - { - $this->success = $success; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->success)) { - $json['success'] = $this->success; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RiskEvaluation.php b/src/Models/RiskEvaluation.php deleted file mode 100644 index 49f7ff09..00000000 --- a/src/Models/RiskEvaluation.php +++ /dev/null @@ -1,91 +0,0 @@ -createdAt; - } - - /** - * Sets Created At. - * The timestamp when payment risk was evaluated, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Risk Level. - */ - public function getRiskLevel(): ?string - { - return $this->riskLevel; - } - - /** - * Sets Risk Level. - * - * @maps risk_level - */ - public function setRiskLevel(?string $riskLevel): void - { - $this->riskLevel = $riskLevel; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->riskLevel)) { - $json['risk_level'] = $this->riskLevel; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/RiskEvaluationRiskLevel.php b/src/Models/RiskEvaluationRiskLevel.php deleted file mode 100644 index 8d53ba14..00000000 --- a/src/Models/RiskEvaluationRiskLevel.php +++ /dev/null @@ -1,28 +0,0 @@ -customerId = $customerId; - } - - /** - * Returns Customer Id. - * The square-assigned ID of the customer linked to the saved card. - */ - public function getCustomerId(): string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The square-assigned ID of the customer linked to the saved card. - * - * @required - * @maps customer_id - */ - public function setCustomerId(string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Card Id. - * The id of the created card-on-file. - */ - public function getCardId(): ?string - { - return $this->cardId; - } - - /** - * Sets Card Id. - * The id of the created card-on-file. - * - * @maps card_id - */ - public function setCardId(?string $cardId): void - { - $this->cardId = $cardId; - } - - /** - * Returns Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `Card` to another entity in an external system. For example, a customer - * ID generated by a third-party system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `Card` to another entity in an external system. For example, a customer - * ID generated by a third-party system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `Card` to another entity in an external system. For example, a customer - * ID generated by a third-party system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_id'] = $this->customerId; - if (isset($this->cardId)) { - $json['card_id'] = $this->cardId; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchAvailabilityFilter.php b/src/Models/SearchAvailabilityFilter.php deleted file mode 100644 index fdbfb7cf..00000000 --- a/src/Models/SearchAvailabilityFilter.php +++ /dev/null @@ -1,229 +0,0 @@ -startAtRange = $startAtRange; - } - - /** - * Returns Start at Range. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getStartAtRange(): TimeRange - { - return $this->startAtRange; - } - - /** - * Sets Start at Range. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @required - * @maps start_at_range - */ - public function setStartAtRange(TimeRange $startAtRange): void - { - $this->startAtRange = $startAtRange; - } - - /** - * Returns Location Id. - * The query expression to search for buyer-accessible availabilities with their location IDs matching - * the specified location ID. - * This query expression cannot be set if `booking_id` is set. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The query expression to search for buyer-accessible availabilities with their location IDs matching - * the specified location ID. - * This query expression cannot be set if `booking_id` is set. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The query expression to search for buyer-accessible availabilities with their location IDs matching - * the specified location ID. - * This query expression cannot be set if `booking_id` is set. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Segment Filters. - * The query expression to search for buyer-accessible availabilities matching the specified list of - * segment filters. - * If the size of the `segment_filters` list is `n`, the search returns availabilities with `n` - * segments per availability. - * - * This query expression cannot be set if `booking_id` is set. - * - * @return SegmentFilter[]|null - */ - public function getSegmentFilters(): ?array - { - if (count($this->segmentFilters) == 0) { - return null; - } - return $this->segmentFilters['value']; - } - - /** - * Sets Segment Filters. - * The query expression to search for buyer-accessible availabilities matching the specified list of - * segment filters. - * If the size of the `segment_filters` list is `n`, the search returns availabilities with `n` - * segments per availability. - * - * This query expression cannot be set if `booking_id` is set. - * - * @maps segment_filters - * - * @param SegmentFilter[]|null $segmentFilters - */ - public function setSegmentFilters(?array $segmentFilters): void - { - $this->segmentFilters['value'] = $segmentFilters; - } - - /** - * Unsets Segment Filters. - * The query expression to search for buyer-accessible availabilities matching the specified list of - * segment filters. - * If the size of the `segment_filters` list is `n`, the search returns availabilities with `n` - * segments per availability. - * - * This query expression cannot be set if `booking_id` is set. - */ - public function unsetSegmentFilters(): void - { - $this->segmentFilters = []; - } - - /** - * Returns Booking Id. - * The query expression to search for buyer-accessible availabilities for an existing booking by - * matching the specified `booking_id` value. - * This is commonly used to reschedule an appointment. - * If this expression is set, the `location_id` and `segment_filters` expressions cannot be set. - */ - public function getBookingId(): ?string - { - if (count($this->bookingId) == 0) { - return null; - } - return $this->bookingId['value']; - } - - /** - * Sets Booking Id. - * The query expression to search for buyer-accessible availabilities for an existing booking by - * matching the specified `booking_id` value. - * This is commonly used to reschedule an appointment. - * If this expression is set, the `location_id` and `segment_filters` expressions cannot be set. - * - * @maps booking_id - */ - public function setBookingId(?string $bookingId): void - { - $this->bookingId['value'] = $bookingId; - } - - /** - * Unsets Booking Id. - * The query expression to search for buyer-accessible availabilities for an existing booking by - * matching the specified `booking_id` value. - * This is commonly used to reschedule an appointment. - * If this expression is set, the `location_id` and `segment_filters` expressions cannot be set. - */ - public function unsetBookingId(): void - { - $this->bookingId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['start_at_range'] = $this->startAtRange; - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->segmentFilters)) { - $json['segment_filters'] = $this->segmentFilters['value']; - } - if (!empty($this->bookingId)) { - $json['booking_id'] = $this->bookingId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchAvailabilityQuery.php b/src/Models/SearchAvailabilityQuery.php deleted file mode 100644 index 6e20b838..00000000 --- a/src/Models/SearchAvailabilityQuery.php +++ /dev/null @@ -1,67 +0,0 @@ -filter = $filter; - } - - /** - * Returns Filter. - * A query filter to search for buyer-accessible availabilities by. - */ - public function getFilter(): SearchAvailabilityFilter - { - return $this->filter; - } - - /** - * Sets Filter. - * A query filter to search for buyer-accessible availabilities by. - * - * @required - * @maps filter - */ - public function setFilter(SearchAvailabilityFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['filter'] = $this->filter; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchAvailabilityRequest.php b/src/Models/SearchAvailabilityRequest.php deleted file mode 100644 index 94570826..00000000 --- a/src/Models/SearchAvailabilityRequest.php +++ /dev/null @@ -1,64 +0,0 @@ -query = $query; - } - - /** - * Returns Query. - * The query used to search for buyer-accessible availabilities of bookings. - */ - public function getQuery(): SearchAvailabilityQuery - { - return $this->query; - } - - /** - * Sets Query. - * The query used to search for buyer-accessible availabilities of bookings. - * - * @required - * @maps query - */ - public function setQuery(SearchAvailabilityQuery $query): void - { - $this->query = $query; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['query'] = $this->query; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchAvailabilityResponse.php b/src/Models/SearchAvailabilityResponse.php deleted file mode 100644 index 28189367..00000000 --- a/src/Models/SearchAvailabilityResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -availabilities; - } - - /** - * Sets Availabilities. - * List of appointment slots available for booking. - * - * @maps availabilities - * - * @param Availability[]|null $availabilities - */ - public function setAvailabilities(?array $availabilities): void - { - $this->availabilities = $availabilities; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->availabilities)) { - $json['availabilities'] = $this->availabilities; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCatalogItemsRequest.php b/src/Models/SearchCatalogItemsRequest.php deleted file mode 100644 index 14040c35..00000000 --- a/src/Models/SearchCatalogItemsRequest.php +++ /dev/null @@ -1,354 +0,0 @@ -textFilter; - } - - /** - * Sets Text Filter. - * The text filter expression to return items or item variations containing specified text in - * the `name`, `description`, or `abbreviation` attribute value of an item, or in - * the `name`, `sku`, or `upc` attribute value of an item variation. - * - * @maps text_filter - */ - public function setTextFilter(?string $textFilter): void - { - $this->textFilter = $textFilter; - } - - /** - * Returns Category Ids. - * The category id query expression to return items containing the specified category IDs. - * - * @return string[]|null - */ - public function getCategoryIds(): ?array - { - return $this->categoryIds; - } - - /** - * Sets Category Ids. - * The category id query expression to return items containing the specified category IDs. - * - * @maps category_ids - * - * @param string[]|null $categoryIds - */ - public function setCategoryIds(?array $categoryIds): void - { - $this->categoryIds = $categoryIds; - } - - /** - * Returns Stock Levels. - * The stock-level query expression to return item variations with the specified stock levels. - * See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible - * values - * - * @return string[]|null - */ - public function getStockLevels(): ?array - { - return $this->stockLevels; - } - - /** - * Sets Stock Levels. - * The stock-level query expression to return item variations with the specified stock levels. - * See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible - * values - * - * @maps stock_levels - * - * @param string[]|null $stockLevels - */ - public function setStockLevels(?array $stockLevels): void - { - $this->stockLevels = $stockLevels; - } - - /** - * Returns Enabled Location Ids. - * The enabled-location query expression to return items and item variations having specified enabled - * locations. - * - * @return string[]|null - */ - public function getEnabledLocationIds(): ?array - { - return $this->enabledLocationIds; - } - - /** - * Sets Enabled Location Ids. - * The enabled-location query expression to return items and item variations having specified enabled - * locations. - * - * @maps enabled_location_ids - * - * @param string[]|null $enabledLocationIds - */ - public function setEnabledLocationIds(?array $enabledLocationIds): void - { - $this->enabledLocationIds = $enabledLocationIds; - } - - /** - * Returns Cursor. - * The pagination token, returned in the previous response, used to fetch the next batch of pending - * results. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination token, returned in the previous response, used to fetch the next batch of pending - * results. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * The maximum number of results to return per page. The default value is 100. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to return per page. The default value is 100. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Returns Product Types. - * The product types query expression to return items or item variations having the specified product - * types. - * - * @return string[]|null - */ - public function getProductTypes(): ?array - { - return $this->productTypes; - } - - /** - * Sets Product Types. - * The product types query expression to return items or item variations having the specified product - * types. - * - * @maps product_types - * - * @param string[]|null $productTypes - */ - public function setProductTypes(?array $productTypes): void - { - $this->productTypes = $productTypes; - } - - /** - * Returns Custom Attribute Filters. - * The customer-attribute filter to return items or item variations matching the specified - * custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in - * a single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. - * - * @return CustomAttributeFilter[]|null - */ - public function getCustomAttributeFilters(): ?array - { - return $this->customAttributeFilters; - } - - /** - * Sets Custom Attribute Filters. - * The customer-attribute filter to return items or item variations matching the specified - * custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in - * a single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. - * - * @maps custom_attribute_filters - * - * @param CustomAttributeFilter[]|null $customAttributeFilters - */ - public function setCustomAttributeFilters(?array $customAttributeFilters): void - { - $this->customAttributeFilters = $customAttributeFilters; - } - - /** - * Returns Archived State. - * Defines the values for the `archived_state` query expression - * used in [SearchCatalogItems]($e/Catalog/SearchCatalogItems) - * to return the archived, not archived or either type of catalog items. - */ - public function getArchivedState(): ?string - { - return $this->archivedState; - } - - /** - * Sets Archived State. - * Defines the values for the `archived_state` query expression - * used in [SearchCatalogItems]($e/Catalog/SearchCatalogItems) - * to return the archived, not archived or either type of catalog items. - * - * @maps archived_state - */ - public function setArchivedState(?string $archivedState): void - { - $this->archivedState = $archivedState; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->textFilter)) { - $json['text_filter'] = $this->textFilter; - } - if (isset($this->categoryIds)) { - $json['category_ids'] = $this->categoryIds; - } - if (isset($this->stockLevels)) { - $json['stock_levels'] = $this->stockLevels; - } - if (isset($this->enabledLocationIds)) { - $json['enabled_location_ids'] = $this->enabledLocationIds; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - if (isset($this->productTypes)) { - $json['product_types'] = $this->productTypes; - } - if (isset($this->customAttributeFilters)) { - $json['custom_attribute_filters'] = $this->customAttributeFilters; - } - if (isset($this->archivedState)) { - $json['archived_state'] = $this->archivedState; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCatalogItemsRequestStockLevel.php b/src/Models/SearchCatalogItemsRequestStockLevel.php deleted file mode 100644 index add19443..00000000 --- a/src/Models/SearchCatalogItemsRequestStockLevel.php +++ /dev/null @@ -1,21 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Items. - * Returned items matching the specified query expressions. - * - * @return CatalogObject[]|null - */ - public function getItems(): ?array - { - return $this->items; - } - - /** - * Sets Items. - * Returned items matching the specified query expressions. - * - * @maps items - * - * @param CatalogObject[]|null $items - */ - public function setItems(?array $items): void - { - $this->items = $items; - } - - /** - * Returns Cursor. - * Pagination token used in the next request to return more of the search result. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * Pagination token used in the next request to return more of the search result. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Matched Variation Ids. - * Ids of returned item variations matching the specified query expression. - * - * @return string[]|null - */ - public function getMatchedVariationIds(): ?array - { - return $this->matchedVariationIds; - } - - /** - * Sets Matched Variation Ids. - * Ids of returned item variations matching the specified query expression. - * - * @maps matched_variation_ids - * - * @param string[]|null $matchedVariationIds - */ - public function setMatchedVariationIds(?array $matchedVariationIds): void - { - $this->matchedVariationIds = $matchedVariationIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->items)) { - $json['items'] = $this->items; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->matchedVariationIds)) { - $json['matched_variation_ids'] = $this->matchedVariationIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCatalogObjectsRequest.php b/src/Models/SearchCatalogObjectsRequest.php deleted file mode 100644 index 1036e564..00000000 --- a/src/Models/SearchCatalogObjectsRequest.php +++ /dev/null @@ -1,403 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * The pagination cursor returned in the previous response. Leave unset for an initial request. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Object Types. - * The desired set of object types to appear in the search results. - * - * If this is unspecified, the operation returns objects of all the top level types at the version - * of the Square API used to make the request. Object types that are nested onto other object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - * - * Note that if you wish for the query to return objects belonging to nested types (i.e., COMPONENT, - * IMAGE, - * ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of - * interest - * in this field. - * - * @return string[]|null - */ - public function getObjectTypes(): ?array - { - return $this->objectTypes; - } - - /** - * Sets Object Types. - * The desired set of object types to appear in the search results. - * - * If this is unspecified, the operation returns objects of all the top level types at the version - * of the Square API used to make the request. Object types that are nested onto other object types - * are not included in the defaults. - * - * At the current API version the default object types are: - * ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - * PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - * SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - * - * Note that if you wish for the query to return objects belonging to nested types (i.e., COMPONENT, - * IMAGE, - * ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of - * interest - * in this field. - * - * @maps object_types - * - * @param string[]|null $objectTypes - */ - public function setObjectTypes(?array $objectTypes): void - { - $this->objectTypes = $objectTypes; - } - - /** - * Returns Include Deleted Objects. - * If `true`, deleted objects will be included in the results. Deleted objects will have their - * `is_deleted` field set to `true`. - */ - public function getIncludeDeletedObjects(): ?bool - { - return $this->includeDeletedObjects; - } - - /** - * Sets Include Deleted Objects. - * If `true`, deleted objects will be included in the results. Deleted objects will have their - * `is_deleted` field set to `true`. - * - * @maps include_deleted_objects - */ - public function setIncludeDeletedObjects(?bool $includeDeletedObjects): void - { - $this->includeDeletedObjects = $includeDeletedObjects; - } - - /** - * Returns Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are objects that are referenced by object ID by the objects - * in the response. This is helpful if the objects are being fetched for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. - * For example: - * - * If the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - */ - public function getIncludeRelatedObjects(): ?bool - { - return $this->includeRelatedObjects; - } - - /** - * Sets Include Related Objects. - * If `true`, the response will include additional objects that are related to the - * requested objects. Related objects are objects that are referenced by object ID by the objects - * in the response. This is helpful if the objects are being fetched for immediate display to a user. - * This process only goes one level deep. Objects referenced by the related objects will not be - * included. - * For example: - * - * If the `objects` field of the response contains a CatalogItem, its associated - * CatalogCategory objects, CatalogTax objects, CatalogImage objects and - * CatalogModifierLists will be returned in the `related_objects` field of the - * response. If the `objects` field of the response contains a CatalogItemVariation, - * its parent CatalogItem will be returned in the `related_objects` field of - * the response. - * - * Default value: `false` - * - * @maps include_related_objects - */ - public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void - { - $this->includeRelatedObjects = $includeRelatedObjects; - } - - /** - * Returns Begin Time. - * Return objects modified after this [timestamp](https://developer.squareup.com/docs/build- - * basics/working-with-dates), in RFC 3339 - * format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a - * timestamp equal to `begin_time` will not be included in the response. - */ - public function getBeginTime(): ?string - { - return $this->beginTime; - } - - /** - * Sets Begin Time. - * Return objects modified after this [timestamp](https://developer.squareup.com/docs/build- - * basics/working-with-dates), in RFC 3339 - * format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a - * timestamp equal to `begin_time` will not be included in the response. - * - * @maps begin_time - */ - public function setBeginTime(?string $beginTime): void - { - $this->beginTime = $beginTime; - } - - /** - * Returns Query. - * A query composed of one or more different types of filters to narrow the scope of targeted objects - * when calling the `SearchCatalogObjects` endpoint. - * - * Although a query can have multiple filters, only certain query types can be combined per call to - * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects). - * Any combination of the following types may be used together: - * - [exact_query]($m/CatalogQueryExact) - * - [prefix_query]($m/CatalogQueryPrefix) - * - [range_query]($m/CatalogQueryRange) - * - [sorted_attribute_query]($m/CatalogQuerySortedAttribute) - * - [text_query]($m/CatalogQueryText) - * - * All other query types cannot be combined with any others. - * - * When a query filter is based on an attribute, the attribute must be searchable. - * Searchable attributes are listed as follows, along their parent types that can be searched for with - * applicable query filters. - * - * Searchable attribute and objects queryable by searchable attributes: - * - `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, - * `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue` - * - `description`: `CatalogItem`, `CatalogItemOptionValue` - * - `abbreviation`: `CatalogItem` - * - `upc`: `CatalogItemVariation` - * - `sku`: `CatalogItemVariation` - * - `caption`: `CatalogImage` - * - `display_name`: `CatalogItemOption` - * - * For example, to search for [CatalogItem]($m/CatalogItem) objects by searchable attributes, you can - * use - * the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. - */ - public function getQuery(): ?CatalogQuery - { - return $this->query; - } - - /** - * Sets Query. - * A query composed of one or more different types of filters to narrow the scope of targeted objects - * when calling the `SearchCatalogObjects` endpoint. - * - * Although a query can have multiple filters, only certain query types can be combined per call to - * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects). - * Any combination of the following types may be used together: - * - [exact_query]($m/CatalogQueryExact) - * - [prefix_query]($m/CatalogQueryPrefix) - * - [range_query]($m/CatalogQueryRange) - * - [sorted_attribute_query]($m/CatalogQuerySortedAttribute) - * - [text_query]($m/CatalogQueryText) - * - * All other query types cannot be combined with any others. - * - * When a query filter is based on an attribute, the attribute must be searchable. - * Searchable attributes are listed as follows, along their parent types that can be searched for with - * applicable query filters. - * - * Searchable attribute and objects queryable by searchable attributes: - * - `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, - * `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue` - * - `description`: `CatalogItem`, `CatalogItemOptionValue` - * - `abbreviation`: `CatalogItem` - * - `upc`: `CatalogItemVariation` - * - `sku`: `CatalogItemVariation` - * - `caption`: `CatalogImage` - * - `display_name`: `CatalogItemOption` - * - * For example, to search for [CatalogItem]($m/CatalogItem) objects by searchable attributes, you can - * use - * the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. - * - * @maps query - */ - public function setQuery(?CatalogQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * A limit on the number of results to be returned in a single page. The limit is advisory - - * the implementation may return more or fewer results. If the supplied limit is negative, zero, or - * is higher than the maximum limit of 1,000, it will be ignored. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * A limit on the number of results to be returned in a single page. The limit is advisory - - * the implementation may return more or fewer results. If the supplied limit is negative, zero, or - * is higher than the maximum limit of 1,000, it will be ignored. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - */ - public function getIncludeCategoryPathToRoot(): ?bool - { - return $this->includeCategoryPathToRoot; - } - - /** - * Sets Include Category Path to Root. - * Specifies whether or not to include the `path_to_root` list for each returned category instance. The - * `path_to_root` list consists - * of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent - * category of the returned category - * and ends with its root category. If the returned category is a top-level category, the - * `path_to_root` list is empty and is not returned - * in the response payload. - * - * @maps include_category_path_to_root - */ - public function setIncludeCategoryPathToRoot(?bool $includeCategoryPathToRoot): void - { - $this->includeCategoryPathToRoot = $includeCategoryPathToRoot; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->objectTypes)) { - $json['object_types'] = $this->objectTypes; - } - if (isset($this->includeDeletedObjects)) { - $json['include_deleted_objects'] = $this->includeDeletedObjects; - } - if (isset($this->includeRelatedObjects)) { - $json['include_related_objects'] = $this->includeRelatedObjects; - } - if (isset($this->beginTime)) { - $json['begin_time'] = $this->beginTime; - } - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->includeCategoryPathToRoot)) { - $json['include_category_path_to_root'] = $this->includeCategoryPathToRoot; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCatalogObjectsResponse.php b/src/Models/SearchCatalogObjectsResponse.php deleted file mode 100644 index 9068bf0e..00000000 --- a/src/Models/SearchCatalogObjectsResponse.php +++ /dev/null @@ -1,189 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Objects. - * The CatalogObjects returned. - * - * @return CatalogObject[]|null - */ - public function getObjects(): ?array - { - return $this->objects; - } - - /** - * Sets Objects. - * The CatalogObjects returned. - * - * @maps objects - * - * @param CatalogObject[]|null $objects - */ - public function setObjects(?array $objects): void - { - $this->objects = $objects; - } - - /** - * Returns Related Objects. - * A list of CatalogObjects referenced by the objects in the `objects` field. - * - * @return CatalogObject[]|null - */ - public function getRelatedObjects(): ?array - { - return $this->relatedObjects; - } - - /** - * Sets Related Objects. - * A list of CatalogObjects referenced by the objects in the `objects` field. - * - * @maps related_objects - * - * @param CatalogObject[]|null $relatedObjects - */ - public function setRelatedObjects(?array $relatedObjects): void - { - $this->relatedObjects = $relatedObjects; - } - - /** - * Returns Latest Time. - * When the associated product catalog was last updated. Will - * match the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` - * request. - */ - public function getLatestTime(): ?string - { - return $this->latestTime; - } - - /** - * Sets Latest Time. - * When the associated product catalog was last updated. Will - * match the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` - * request. - * - * @maps latest_time - */ - public function setLatestTime(?string $latestTime): void - { - $this->latestTime = $latestTime; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->objects)) { - $json['objects'] = $this->objects; - } - if (isset($this->relatedObjects)) { - $json['related_objects'] = $this->relatedObjects; - } - if (isset($this->latestTime)) { - $json['latest_time'] = $this->latestTime; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCustomersRequest.php b/src/Models/SearchCustomersRequest.php deleted file mode 100644 index 6cdeba7e..00000000 --- a/src/Models/SearchCustomersRequest.php +++ /dev/null @@ -1,173 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * Include the pagination cursor in subsequent calls to this endpoint to retrieve - * the next set of results associated with the original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` - * error. The default value is 100. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to return in a single page. This limit is advisory. The response might - * contain more or fewer results. - * If the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` - * error. The default value is 100. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Query. - * Represents filtering and sorting criteria for a [SearchCustomers]($e/Customers/SearchCustomers) - * request. - */ - public function getQuery(): ?CustomerQuery - { - return $this->query; - } - - /** - * Sets Query. - * Represents filtering and sorting criteria for a [SearchCustomers]($e/Customers/SearchCustomers) - * request. - * - * @maps query - */ - public function setQuery(?CustomerQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Count. - * Indicates whether to return the total count of matching customers in the `count` field of the - * response. - * - * The default value is `false`. - */ - public function getCount(): ?bool - { - return $this->count; - } - - /** - * Sets Count. - * Indicates whether to return the total count of matching customers in the `count` field of the - * response. - * - * The default value is `false`. - * - * @maps count - */ - public function setCount(?bool $count): void - { - $this->count = $count; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->count)) { - $json['count'] = $this->count; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchCustomersResponse.php b/src/Models/SearchCustomersResponse.php deleted file mode 100644 index 6f5a2c43..00000000 --- a/src/Models/SearchCustomersResponse.php +++ /dev/null @@ -1,183 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Customers. - * The customer profiles that match the search query. If any search condition is not met, the result is - * an empty object (`{}`). - * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, - * `email_address`, or `phone_number`) - * are included in the response. - * - * @return Customer[]|null - */ - public function getCustomers(): ?array - { - return $this->customers; - } - - /** - * Sets Customers. - * The customer profiles that match the search query. If any search condition is not met, the result is - * an empty object (`{}`). - * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, - * `email_address`, or `phone_number`) - * are included in the response. - * - * @maps customers - * - * @param Customer[]|null $customers - */ - public function setCustomers(?array $customers): void - { - $this->customers = $customers; - } - - /** - * Returns Cursor. - * A pagination cursor that can be used during subsequent calls - * to `SearchCustomers` to retrieve the next set of results associated - * with the original query. Pagination cursors are only present when - * a request succeeds and additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor that can be used during subsequent calls - * to `SearchCustomers` to retrieve the next set of results associated - * with the original query. Pagination cursors are only present when - * a request succeeds and additional results are available. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Count. - * The total count of customers associated with the Square account that match the search query. Only - * customer profiles with - * public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) - * are counted. This field is - * present only if `count` is set to `true` in the request. - */ - public function getCount(): ?int - { - return $this->count; - } - - /** - * Sets Count. - * The total count of customers associated with the Square account that match the search query. Only - * customer profiles with - * public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) - * are counted. This field is - * present only if `count` is set to `true` in the request. - * - * @maps count - */ - public function setCount(?int $count): void - { - $this->count = $count; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->customers)) { - $json['customers'] = $this->customers; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->count)) { - $json['count'] = $this->count; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsFilter.php b/src/Models/SearchEventsFilter.php deleted file mode 100644 index f48cfb6e..00000000 --- a/src/Models/SearchEventsFilter.php +++ /dev/null @@ -1,200 +0,0 @@ -eventTypes) == 0) { - return null; - } - return $this->eventTypes['value']; - } - - /** - * Sets Event Types. - * Filter events by event types. - * - * @maps event_types - * - * @param string[]|null $eventTypes - */ - public function setEventTypes(?array $eventTypes): void - { - $this->eventTypes['value'] = $eventTypes; - } - - /** - * Unsets Event Types. - * Filter events by event types. - */ - public function unsetEventTypes(): void - { - $this->eventTypes = []; - } - - /** - * Returns Merchant Ids. - * Filter events by merchant. - * - * @return string[]|null - */ - public function getMerchantIds(): ?array - { - if (count($this->merchantIds) == 0) { - return null; - } - return $this->merchantIds['value']; - } - - /** - * Sets Merchant Ids. - * Filter events by merchant. - * - * @maps merchant_ids - * - * @param string[]|null $merchantIds - */ - public function setMerchantIds(?array $merchantIds): void - { - $this->merchantIds['value'] = $merchantIds; - } - - /** - * Unsets Merchant Ids. - * Filter events by merchant. - */ - public function unsetMerchantIds(): void - { - $this->merchantIds = []; - } - - /** - * Returns Location Ids. - * Filter events by location. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * Filter events by location. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * Filter events by location. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): ?TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->eventTypes)) { - $json['event_types'] = $this->eventTypes['value']; - } - if (!empty($this->merchantIds)) { - $json['merchant_ids'] = $this->merchantIds['value']; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsQuery.php b/src/Models/SearchEventsQuery.php deleted file mode 100644 index 98625c14..00000000 --- a/src/Models/SearchEventsQuery.php +++ /dev/null @@ -1,88 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Criteria to filter events by. - * - * @maps filter - */ - public function setFilter(?SearchEventsFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Criteria to sort events by. - */ - public function getSort(): ?SearchEventsSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Criteria to sort events by. - * - * @maps sort - */ - public function setSort(?SearchEventsSort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsRequest.php b/src/Models/SearchEventsRequest.php deleted file mode 100644 index d5cd0863..00000000 --- a/src/Models/SearchEventsRequest.php +++ /dev/null @@ -1,136 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve - * the next set of events for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * The maximum number of events to return in a single page. The response might contain fewer events. - * The default value is 100, which is also the maximum allowed value. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * Default: 100 - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of events to return in a single page. The response might contain fewer events. - * The default value is 100, which is also the maximum allowed value. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * Default: 100 - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Query. - * Contains query criteria for the search. - */ - public function getQuery(): ?SearchEventsQuery - { - return $this->query; - } - - /** - * Sets Query. - * Contains query criteria for the search. - * - * @maps query - */ - public function setQuery(?SearchEventsQuery $query): void - { - $this->query = $query; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->query)) { - $json['query'] = $this->query; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsResponse.php b/src/Models/SearchEventsResponse.php deleted file mode 100644 index 18e8c695..00000000 --- a/src/Models/SearchEventsResponse.php +++ /dev/null @@ -1,168 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Events. - * The list of [Event](entity:Event)s returned by the search. - * - * @return Event[]|null - */ - public function getEvents(): ?array - { - return $this->events; - } - - /** - * Sets Events. - * The list of [Event](entity:Event)s returned by the search. - * - * @maps events - * - * @param Event[]|null $events - */ - public function setEvents(?array $events): void - { - $this->events = $events; - } - - /** - * Returns Metadata. - * Contains the metadata of an event. For more information, see [Event](entity:Event). - * - * @return EventMetadata[]|null - */ - public function getMetadata(): ?array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * Contains the metadata of an event. For more information, see [Event](entity:Event). - * - * @maps metadata - * - * @param EventMetadata[]|null $metadata - */ - public function setMetadata(?array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch - * the next set of events. If empty, this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch - * the next set of events. If empty, this is the final response. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->events)) { - $json['events'] = $this->events; - } - if (isset($this->metadata)) { - $json['metadata'] = $this->metadata; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsSort.php b/src/Models/SearchEventsSort.php deleted file mode 100644 index d2036f2c..00000000 --- a/src/Models/SearchEventsSort.php +++ /dev/null @@ -1,88 +0,0 @@ -field; - } - - /** - * Sets Field. - * Specifies the sort key for events returned from a search. - * - * @maps field - */ - public function setField(?string $field): void - { - $this->field = $field; - } - - /** - * Returns Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getOrder(): ?string - { - return $this->order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->field)) { - $json['field'] = $this->field; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchEventsSortField.php b/src/Models/SearchEventsSortField.php deleted file mode 100644 index 165e9f85..00000000 --- a/src/Models/SearchEventsSortField.php +++ /dev/null @@ -1,17 +0,0 @@ -query = $query; - } - - /** - * Returns Query. - * Describes query criteria for searching invoices. - */ - public function getQuery(): InvoiceQuery - { - return $this->query; - } - - /** - * Sets Query. - * Describes query criteria for searching invoices. - * - * @required - * @maps query - */ - public function setQuery(InvoiceQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server uses a default limit of 100 invoices. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server uses a default limit of 100 invoices. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['query'] = $this->query; - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchInvoicesResponse.php b/src/Models/SearchInvoicesResponse.php deleted file mode 100644 index b985f5ba..00000000 --- a/src/Models/SearchInvoicesResponse.php +++ /dev/null @@ -1,132 +0,0 @@ -invoices; - } - - /** - * Sets Invoices. - * The list of invoices returned by the search. - * - * @maps invoices - * - * @param Invoice[]|null $invoices - */ - public function setInvoices(?array $invoices): void - { - $this->invoices = $invoices; - } - - /** - * Returns Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to fetch the next set of invoices. If empty, this is the final - * response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to fetch the next set of invoices. If empty, this is the final - * response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoices)) { - $json['invoices'] = $this->invoices; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyAccountsRequest.php b/src/Models/SearchLoyaltyAccountsRequest.php deleted file mode 100644 index b1c1e07b..00000000 --- a/src/Models/SearchLoyaltyAccountsRequest.php +++ /dev/null @@ -1,126 +0,0 @@ -query; - } - - /** - * Sets Query. - * The search criteria for the loyalty accounts. - * - * @maps query - */ - public function setQuery(?SearchLoyaltyAccountsRequestLoyaltyAccountQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of results to include in the response. The default value is 30. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to include in the response. The default value is 30. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to - * this endpoint. Provide this to retrieve the next set of - * results for the original query. - * - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to - * this endpoint. Provide this to retrieve the next set of - * results for the original query. - * - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php b/src/Models/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php deleted file mode 100644 index 3d22d076..00000000 --- a/src/Models/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php +++ /dev/null @@ -1,144 +0,0 @@ -mappings) == 0) { - return null; - } - return $this->mappings['value']; - } - - /** - * Sets Mappings. - * The set of mappings to use in the loyalty account search. - * - * This cannot be combined with `customer_ids`. - * - * Max: 30 mappings - * - * @maps mappings - * - * @param LoyaltyAccountMapping[]|null $mappings - */ - public function setMappings(?array $mappings): void - { - $this->mappings['value'] = $mappings; - } - - /** - * Unsets Mappings. - * The set of mappings to use in the loyalty account search. - * - * This cannot be combined with `customer_ids`. - * - * Max: 30 mappings - */ - public function unsetMappings(): void - { - $this->mappings = []; - } - - /** - * Returns Customer Ids. - * The set of customer IDs to use in the loyalty account search. - * - * This cannot be combined with `mappings`. - * - * Max: 30 customer IDs - * - * @return string[]|null - */ - public function getCustomerIds(): ?array - { - if (count($this->customerIds) == 0) { - return null; - } - return $this->customerIds['value']; - } - - /** - * Sets Customer Ids. - * The set of customer IDs to use in the loyalty account search. - * - * This cannot be combined with `mappings`. - * - * Max: 30 customer IDs - * - * @maps customer_ids - * - * @param string[]|null $customerIds - */ - public function setCustomerIds(?array $customerIds): void - { - $this->customerIds['value'] = $customerIds; - } - - /** - * Unsets Customer Ids. - * The set of customer IDs to use in the loyalty account search. - * - * This cannot be combined with `mappings`. - * - * Max: 30 customer IDs - */ - public function unsetCustomerIds(): void - { - $this->customerIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->mappings)) { - $json['mappings'] = $this->mappings['value']; - } - if (!empty($this->customerIds)) { - $json['customer_ids'] = $this->customerIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyAccountsResponse.php b/src/Models/SearchLoyaltyAccountsResponse.php deleted file mode 100644 index 87c7979e..00000000 --- a/src/Models/SearchLoyaltyAccountsResponse.php +++ /dev/null @@ -1,132 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Loyalty Accounts. - * The loyalty accounts that met the search criteria, - * in order of creation date. - * - * @return LoyaltyAccount[]|null - */ - public function getLoyaltyAccounts(): ?array - { - return $this->loyaltyAccounts; - } - - /** - * Sets Loyalty Accounts. - * The loyalty accounts that met the search criteria, - * in order of creation date. - * - * @maps loyalty_accounts - * - * @param LoyaltyAccount[]|null $loyaltyAccounts - */ - public function setLoyaltyAccounts(?array $loyaltyAccounts): void - { - $this->loyaltyAccounts = $loyaltyAccounts; - } - - /** - * Returns Cursor. - * The pagination cursor to use in a subsequent - * request. If empty, this is the final response. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to use in a subsequent - * request. If empty, this is the final response. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->loyaltyAccounts)) { - $json['loyalty_accounts'] = $this->loyaltyAccounts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyEventsRequest.php b/src/Models/SearchLoyaltyEventsRequest.php deleted file mode 100644 index 4b983c0a..00000000 --- a/src/Models/SearchLoyaltyEventsRequest.php +++ /dev/null @@ -1,126 +0,0 @@ -query; - } - - /** - * Sets Query. - * Represents a query used to search for loyalty events. - * - * @maps query - */ - public function setQuery(?LoyaltyEventQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of results to include in the response. - * The last page might contain fewer events. - * The default is 30 events. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to include in the response. - * The last page might contain fewer events. - * The default is 30 events. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyEventsResponse.php b/src/Models/SearchLoyaltyEventsResponse.php deleted file mode 100644 index 7a54538c..00000000 --- a/src/Models/SearchLoyaltyEventsResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Events. - * The loyalty events that satisfy the search criteria. - * - * @return LoyaltyEvent[]|null - */ - public function getEvents(): ?array - { - return $this->events; - } - - /** - * Sets Events. - * The loyalty events that satisfy the search criteria. - * - * @maps events - * - * @param LoyaltyEvent[]|null $events - */ - public function setEvents(?array $events): void - { - $this->events = $events; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent - * request. If empty, this is the final response. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent - * request. If empty, this is the final response. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->events)) { - $json['events'] = $this->events; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyRewardsRequest.php b/src/Models/SearchLoyaltyRewardsRequest.php deleted file mode 100644 index 6a7efc98..00000000 --- a/src/Models/SearchLoyaltyRewardsRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -query; - } - - /** - * Sets Query. - * The set of search requirements. - * - * @maps query - */ - public function setQuery(?SearchLoyaltyRewardsRequestLoyaltyRewardQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of results to return in the response. The default value is 30. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to return in the response. The default value is 30. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to - * this endpoint. Provide this to retrieve the next set of - * results for the original query. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to - * this endpoint. Provide this to retrieve the next set of - * results for the original query. - * For more information, - * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php b/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php deleted file mode 100644 index 4bdd4cdb..00000000 --- a/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php +++ /dev/null @@ -1,95 +0,0 @@ -loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Returns Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs. - */ - public function getLoyaltyAccountId(): string - { - return $this->loyaltyAccountId; - } - - /** - * Sets Loyalty Account Id. - * The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs. - * - * @required - * @maps loyalty_account_id - */ - public function setLoyaltyAccountId(string $loyaltyAccountId): void - { - $this->loyaltyAccountId = $loyaltyAccountId; - } - - /** - * Returns Status. - * The status of the loyalty reward. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the loyalty reward. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['loyalty_account_id'] = $this->loyaltyAccountId; - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchLoyaltyRewardsResponse.php b/src/Models/SearchLoyaltyRewardsResponse.php deleted file mode 100644 index 1093856b..00000000 --- a/src/Models/SearchLoyaltyRewardsResponse.php +++ /dev/null @@ -1,128 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Rewards. - * The loyalty rewards that satisfy the search criteria. - * These are returned in descending order by `updated_at`. - * - * @return LoyaltyReward[]|null - */ - public function getRewards(): ?array - { - return $this->rewards; - } - - /** - * Sets Rewards. - * The loyalty rewards that satisfy the search criteria. - * These are returned in descending order by `updated_at`. - * - * @maps rewards - * - * @param LoyaltyReward[]|null $rewards - */ - public function setRewards(?array $rewards): void - { - $this->rewards = $rewards; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent - * request. If empty, this is the final response. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent - * request. If empty, this is the final response. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->rewards)) { - $json['rewards'] = $this->rewards; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersCustomerFilter.php b/src/Models/SearchOrdersCustomerFilter.php deleted file mode 100644 index 49e3634b..00000000 --- a/src/Models/SearchOrdersCustomerFilter.php +++ /dev/null @@ -1,84 +0,0 @@ -customerIds) == 0) { - return null; - } - return $this->customerIds['value']; - } - - /** - * Sets Customer Ids. - * A list of customer IDs to filter by. - * - * Max: 10 customer ids. - * - * @maps customer_ids - * - * @param string[]|null $customerIds - */ - public function setCustomerIds(?array $customerIds): void - { - $this->customerIds['value'] = $customerIds; - } - - /** - * Unsets Customer Ids. - * A list of customer IDs to filter by. - * - * Max: 10 customer ids. - */ - public function unsetCustomerIds(): void - { - $this->customerIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerIds)) { - $json['customer_ids'] = $this->customerIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersDateTimeFilter.php b/src/Models/SearchOrdersDateTimeFilter.php deleted file mode 100644 index 2899f461..00000000 --- a/src/Models/SearchOrdersDateTimeFilter.php +++ /dev/null @@ -1,154 +0,0 @@ -createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getUpdatedAt(): ?TimeRange - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps updated_at - */ - public function setUpdatedAt(?TimeRange $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Closed At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getClosedAt(): ?TimeRange - { - return $this->closedAt; - } - - /** - * Sets Closed At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps closed_at - */ - public function setClosedAt(?TimeRange $closedAt): void - { - $this->closedAt = $closedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->closedAt)) { - $json['closed_at'] = $this->closedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersFilter.php b/src/Models/SearchOrdersFilter.php deleted file mode 100644 index 122275e4..00000000 --- a/src/Models/SearchOrdersFilter.php +++ /dev/null @@ -1,205 +0,0 @@ -stateFilter; - } - - /** - * Sets State Filter. - * Filter by the current order `state`. - * - * @maps state_filter - */ - public function setStateFilter(?SearchOrdersStateFilter $stateFilter): void - { - $this->stateFilter = $stateFilter; - } - - /** - * Returns Date Time Filter. - * Filter for `Order` objects based on whether their `CREATED_AT`, - * `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range. - * You can specify the time range and which timestamp to filter for. You can filter - * for only one time range at a time. - * - * For each time range, the start time and end time are inclusive. If the end time - * is absent, it defaults to the time of the first request for the cursor. - * - * __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, - * you must set the `sort_field` in [OrdersSort]($m/SearchOrdersSort) - * to the same field you filter for. For example, if you set the `CLOSED_AT` field - * in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to - * `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. - * [Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders- - * api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) - */ - public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter - { - return $this->dateTimeFilter; - } - - /** - * Sets Date Time Filter. - * Filter for `Order` objects based on whether their `CREATED_AT`, - * `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range. - * You can specify the time range and which timestamp to filter for. You can filter - * for only one time range at a time. - * - * For each time range, the start time and end time are inclusive. If the end time - * is absent, it defaults to the time of the first request for the cursor. - * - * __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, - * you must set the `sort_field` in [OrdersSort]($m/SearchOrdersSort) - * to the same field you filter for. For example, if you set the `CLOSED_AT` field - * in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to - * `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. - * [Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders- - * api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) - * - * @maps date_time_filter - */ - public function setDateTimeFilter(?SearchOrdersDateTimeFilter $dateTimeFilter): void - { - $this->dateTimeFilter = $dateTimeFilter; - } - - /** - * Returns Fulfillment Filter. - * Filter based on [order fulfillment]($m/Fulfillment) information. - */ - public function getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter - { - return $this->fulfillmentFilter; - } - - /** - * Sets Fulfillment Filter. - * Filter based on [order fulfillment]($m/Fulfillment) information. - * - * @maps fulfillment_filter - */ - public function setFulfillmentFilter(?SearchOrdersFulfillmentFilter $fulfillmentFilter): void - { - $this->fulfillmentFilter = $fulfillmentFilter; - } - - /** - * Returns Source Filter. - * A filter based on order `source` information. - */ - public function getSourceFilter(): ?SearchOrdersSourceFilter - { - return $this->sourceFilter; - } - - /** - * Sets Source Filter. - * A filter based on order `source` information. - * - * @maps source_filter - */ - public function setSourceFilter(?SearchOrdersSourceFilter $sourceFilter): void - { - $this->sourceFilter = $sourceFilter; - } - - /** - * Returns Customer Filter. - * A filter based on the order `customer_id` and any tender `customer_id` - * associated with the order. It does not filter based on the - * [FulfillmentRecipient]($m/FulfillmentRecipient) `customer_id`. - */ - public function getCustomerFilter(): ?SearchOrdersCustomerFilter - { - return $this->customerFilter; - } - - /** - * Sets Customer Filter. - * A filter based on the order `customer_id` and any tender `customer_id` - * associated with the order. It does not filter based on the - * [FulfillmentRecipient]($m/FulfillmentRecipient) `customer_id`. - * - * @maps customer_filter - */ - public function setCustomerFilter(?SearchOrdersCustomerFilter $customerFilter): void - { - $this->customerFilter = $customerFilter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->stateFilter)) { - $json['state_filter'] = $this->stateFilter; - } - if (isset($this->dateTimeFilter)) { - $json['date_time_filter'] = $this->dateTimeFilter; - } - if (isset($this->fulfillmentFilter)) { - $json['fulfillment_filter'] = $this->fulfillmentFilter; - } - if (isset($this->sourceFilter)) { - $json['source_filter'] = $this->sourceFilter; - } - if (isset($this->customerFilter)) { - $json['customer_filter'] = $this->customerFilter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersFulfillmentFilter.php b/src/Models/SearchOrdersFulfillmentFilter.php deleted file mode 100644 index 4b5cbddc..00000000 --- a/src/Models/SearchOrdersFulfillmentFilter.php +++ /dev/null @@ -1,138 +0,0 @@ -fulfillmentTypes) == 0) { - return null; - } - return $this->fulfillmentTypes['value']; - } - - /** - * Sets Fulfillment Types. - * A list of [fulfillment types](entity:FulfillmentType) to filter - * for. The list returns orders if any of its fulfillments match any of the fulfillment types - * listed in this field. - * See [FulfillmentType](#type-fulfillmenttype) for possible values - * - * @maps fulfillment_types - * - * @param string[]|null $fulfillmentTypes - */ - public function setFulfillmentTypes(?array $fulfillmentTypes): void - { - $this->fulfillmentTypes['value'] = $fulfillmentTypes; - } - - /** - * Unsets Fulfillment Types. - * A list of [fulfillment types](entity:FulfillmentType) to filter - * for. The list returns orders if any of its fulfillments match any of the fulfillment types - * listed in this field. - * See [FulfillmentType](#type-fulfillmenttype) for possible values - */ - public function unsetFulfillmentTypes(): void - { - $this->fulfillmentTypes = []; - } - - /** - * Returns Fulfillment States. - * A list of [fulfillment states](entity:FulfillmentState) to filter - * for. The list returns orders if any of its fulfillments match any of the - * fulfillment states listed in this field. - * See [FulfillmentState](#type-fulfillmentstate) for possible values - * - * @return string[]|null - */ - public function getFulfillmentStates(): ?array - { - if (count($this->fulfillmentStates) == 0) { - return null; - } - return $this->fulfillmentStates['value']; - } - - /** - * Sets Fulfillment States. - * A list of [fulfillment states](entity:FulfillmentState) to filter - * for. The list returns orders if any of its fulfillments match any of the - * fulfillment states listed in this field. - * See [FulfillmentState](#type-fulfillmentstate) for possible values - * - * @maps fulfillment_states - * - * @param string[]|null $fulfillmentStates - */ - public function setFulfillmentStates(?array $fulfillmentStates): void - { - $this->fulfillmentStates['value'] = $fulfillmentStates; - } - - /** - * Unsets Fulfillment States. - * A list of [fulfillment states](entity:FulfillmentState) to filter - * for. The list returns orders if any of its fulfillments match any of the - * fulfillment states listed in this field. - * See [FulfillmentState](#type-fulfillmentstate) for possible values - */ - public function unsetFulfillmentStates(): void - { - $this->fulfillmentStates = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->fulfillmentTypes)) { - $json['fulfillment_types'] = $this->fulfillmentTypes['value']; - } - if (!empty($this->fulfillmentStates)) { - $json['fulfillment_states'] = $this->fulfillmentStates['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersQuery.php b/src/Models/SearchOrdersQuery.php deleted file mode 100644 index 446d3761..00000000 --- a/src/Models/SearchOrdersQuery.php +++ /dev/null @@ -1,92 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Filtering criteria to use for a `SearchOrders` request. Multiple filters - * are ANDed together. - * - * @maps filter - */ - public function setFilter(?SearchOrdersFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Sorting criteria for a `SearchOrders` request. Results can only be sorted - * by a timestamp field. - */ - public function getSort(): ?SearchOrdersSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Sorting criteria for a `SearchOrders` request. Results can only be sorted - * by a timestamp field. - * - * @maps sort - */ - public function setSort(?SearchOrdersSort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersRequest.php b/src/Models/SearchOrdersRequest.php deleted file mode 100644 index cadae530..00000000 --- a/src/Models/SearchOrdersRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -locationIds; - } - - /** - * Sets Location Ids. - * The location IDs for the orders to query. All locations must belong to - * the same merchant. - * - * Max: 10 location IDs. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds = $locationIds; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for your original query. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Query. - * Contains query criteria for the search. - */ - public function getQuery(): ?SearchOrdersQuery - { - return $this->query; - } - - /** - * Sets Query. - * Contains query criteria for the search. - * - * @maps query - */ - public function setQuery(?SearchOrdersQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of results to be returned in a single page. - * - * Default: `500` - * Max: `1000` - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of results to be returned in a single page. - * - * Default: `500` - * Max: `1000` - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Return Entries. - * A Boolean that controls the format of the search results. If `true`, - * `SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders` - * returns complete order objects. - * - * Default: `false`. - */ - public function getReturnEntries(): ?bool - { - return $this->returnEntries; - } - - /** - * Sets Return Entries. - * A Boolean that controls the format of the search results. If `true`, - * `SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders` - * returns complete order objects. - * - * Default: `false`. - * - * @maps return_entries - */ - public function setReturnEntries(?bool $returnEntries): void - { - $this->returnEntries = $returnEntries; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->locationIds)) { - $json['location_ids'] = $this->locationIds; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->returnEntries)) { - $json['return_entries'] = $this->returnEntries; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersResponse.php b/src/Models/SearchOrdersResponse.php deleted file mode 100644 index 7c21793b..00000000 --- a/src/Models/SearchOrdersResponse.php +++ /dev/null @@ -1,169 +0,0 @@ -orderEntries; - } - - /** - * Sets Order Entries. - * A list of [OrderEntries](entity:OrderEntry) that fit the query - * conditions. The list is populated only if `return_entries` is set to `true` in the request. - * - * @maps order_entries - * - * @param OrderEntry[]|null $orderEntries - */ - public function setOrderEntries(?array $orderEntries): void - { - $this->orderEntries = $orderEntries; - } - - /** - * Returns Orders. - * A list of - * [Order](entity:Order) objects that match the query conditions. The list is populated only if - * `return_entries` is set to `false` in the request. - * - * @return Order[]|null - */ - public function getOrders(): ?array - { - return $this->orders; - } - - /** - * Sets Orders. - * A list of - * [Order](entity:Order) objects that match the query conditions. The list is populated only if - * `return_entries` is set to `false` in the request. - * - * @maps orders - * - * @param Order[]|null $orders - */ - public function setOrders(?array $orders): void - { - $this->orders = $orders; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * [Errors](entity:Error) encountered during the search. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * [Errors](entity:Error) encountered during the search. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->orderEntries)) { - $json['order_entries'] = $this->orderEntries; - } - if (isset($this->orders)) { - $json['orders'] = $this->orders; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersSort.php b/src/Models/SearchOrdersSort.php deleted file mode 100644 index 4bea212b..00000000 --- a/src/Models/SearchOrdersSort.php +++ /dev/null @@ -1,96 +0,0 @@ -sortField = $sortField; - } - - /** - * Returns Sort Field. - * Specifies which timestamp to use to sort `SearchOrder` results. - */ - public function getSortField(): string - { - return $this->sortField; - } - - /** - * Sets Sort Field. - * Specifies which timestamp to use to sort `SearchOrder` results. - * - * @required - * @maps sort_field - */ - public function setSortField(string $sortField): void - { - $this->sortField = $sortField; - } - - /** - * Returns Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getSortOrder(): ?string - { - return $this->sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['sort_field'] = $this->sortField; - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersSortField.php b/src/Models/SearchOrdersSortField.php deleted file mode 100644 index fc714217..00000000 --- a/src/Models/SearchOrdersSortField.php +++ /dev/null @@ -1,33 +0,0 @@ -sourceNames) == 0) { - return null; - } - return $this->sourceNames['value']; - } - - /** - * Sets Source Names. - * Filters by the [Source](entity:OrderSource) `name`. The filter returns any orders - * with a `source.name` that matches any of the listed source names. - * - * Max: 10 source names. - * - * @maps source_names - * - * @param string[]|null $sourceNames - */ - public function setSourceNames(?array $sourceNames): void - { - $this->sourceNames['value'] = $sourceNames; - } - - /** - * Unsets Source Names. - * Filters by the [Source](entity:OrderSource) `name`. The filter returns any orders - * with a `source.name` that matches any of the listed source names. - * - * Max: 10 source names. - */ - public function unsetSourceNames(): void - { - $this->sourceNames = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->sourceNames)) { - $json['source_names'] = $this->sourceNames['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchOrdersStateFilter.php b/src/Models/SearchOrdersStateFilter.php deleted file mode 100644 index babe42c9..00000000 --- a/src/Models/SearchOrdersStateFilter.php +++ /dev/null @@ -1,73 +0,0 @@ -states = $states; - } - - /** - * Returns States. - * States to filter for. - * See [OrderState](#type-orderstate) for possible values - * - * @return string[] - */ - public function getStates(): array - { - return $this->states; - } - - /** - * Sets States. - * States to filter for. - * See [OrderState](#type-orderstate) for possible values - * - * @required - * @maps states - * - * @param string[] $states - */ - public function setStates(array $states): void - { - $this->states = $states; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['states'] = $this->states; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchShiftsRequest.php b/src/Models/SearchShiftsRequest.php deleted file mode 100644 index 0190ddf3..00000000 --- a/src/Models/SearchShiftsRequest.php +++ /dev/null @@ -1,116 +0,0 @@ -query; - } - - /** - * Sets Query. - * The parameters of a `Shift` search query, which includes filter and sort options. - * - * @maps query - */ - public function setQuery(?ShiftQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The number of resources in a page (200 by default). - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The number of resources in a page (200 by default). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * An opaque cursor for fetching the next page. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * An opaque cursor for fetching the next page. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchShiftsResponse.php b/src/Models/SearchShiftsResponse.php deleted file mode 100644 index 2ded4a54..00000000 --- a/src/Models/SearchShiftsResponse.php +++ /dev/null @@ -1,126 +0,0 @@ -shifts; - } - - /** - * Sets Shifts. - * Shifts. - * - * @maps shifts - * - * @param Shift[]|null $shifts - */ - public function setShifts(?array $shifts): void - { - $this->shifts = $shifts; - } - - /** - * Returns Cursor. - * An opaque cursor for fetching the next page. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * An opaque cursor for fetching the next page. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->shifts)) { - $json['shifts'] = $this->shifts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchSubscriptionsFilter.php b/src/Models/SearchSubscriptionsFilter.php deleted file mode 100644 index cf12e428..00000000 --- a/src/Models/SearchSubscriptionsFilter.php +++ /dev/null @@ -1,166 +0,0 @@ -customerIds) == 0) { - return null; - } - return $this->customerIds['value']; - } - - /** - * Sets Customer Ids. - * A filter to select subscriptions based on the subscribing customer IDs. - * - * @maps customer_ids - * - * @param string[]|null $customerIds - */ - public function setCustomerIds(?array $customerIds): void - { - $this->customerIds['value'] = $customerIds; - } - - /** - * Unsets Customer Ids. - * A filter to select subscriptions based on the subscribing customer IDs. - */ - public function unsetCustomerIds(): void - { - $this->customerIds = []; - } - - /** - * Returns Location Ids. - * A filter to select subscriptions based on the location. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * A filter to select subscriptions based on the location. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * A filter to select subscriptions based on the location. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Source Names. - * A filter to select subscriptions based on the source application. - * - * @return string[]|null - */ - public function getSourceNames(): ?array - { - if (count($this->sourceNames) == 0) { - return null; - } - return $this->sourceNames['value']; - } - - /** - * Sets Source Names. - * A filter to select subscriptions based on the source application. - * - * @maps source_names - * - * @param string[]|null $sourceNames - */ - public function setSourceNames(?array $sourceNames): void - { - $this->sourceNames['value'] = $sourceNames; - } - - /** - * Unsets Source Names. - * A filter to select subscriptions based on the source application. - */ - public function unsetSourceNames(): void - { - $this->sourceNames = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->customerIds)) { - $json['customer_ids'] = $this->customerIds['value']; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->sourceNames)) { - $json['source_names'] = $this->sourceNames['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchSubscriptionsQuery.php b/src/Models/SearchSubscriptionsQuery.php deleted file mode 100644 index bf33a265..00000000 --- a/src/Models/SearchSubscriptionsQuery.php +++ /dev/null @@ -1,64 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions - * returned by - * the [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) endpoint. - * - * @maps filter - */ - public function setFilter(?SearchSubscriptionsFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchSubscriptionsRequest.php b/src/Models/SearchSubscriptionsRequest.php deleted file mode 100644 index 6a2b692b..00000000 --- a/src/Models/SearchSubscriptionsRequest.php +++ /dev/null @@ -1,169 +0,0 @@ -cursor; - } - - /** - * Sets Cursor. - * When the total number of resulting subscriptions exceeds the limit of a paged response, - * specify the cursor returned from a preceding response here to fetch the next set of results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * The upper limit on the number of subscriptions to return - * in a paged response. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The upper limit on the number of subscriptions to return - * in a paged response. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Query. - * Represents a query, consisting of specified query expressions, used to search for subscriptions. - */ - public function getQuery(): ?SearchSubscriptionsQuery - { - return $this->query; - } - - /** - * Sets Query. - * Represents a query, consisting of specified query expressions, used to search for subscriptions. - * - * @maps query - */ - public function setQuery(?SearchSubscriptionsQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Include. - * An option to include related information in the response. - * - * The supported values are: - * - * - `actions`: to include scheduled actions on the targeted subscriptions. - * - * @return string[]|null - */ - public function getInclude(): ?array - { - return $this->include; - } - - /** - * Sets Include. - * An option to include related information in the response. - * - * The supported values are: - * - * - `actions`: to include scheduled actions on the targeted subscriptions. - * - * @maps include - * - * @param string[]|null $include - */ - public function setInclude(?array $include): void - { - $this->include = $include; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->include)) { - $json['include'] = $this->include; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchSubscriptionsResponse.php b/src/Models/SearchSubscriptionsResponse.php deleted file mode 100644 index 67b81566..00000000 --- a/src/Models/SearchSubscriptionsResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscriptions. - * The subscriptions matching the specified query expressions. - * - * @return Subscription[]|null - */ - public function getSubscriptions(): ?array - { - return $this->subscriptions; - } - - /** - * Sets Subscriptions. - * The subscriptions matching the specified query expressions. - * - * @maps subscriptions - * - * @param Subscription[]|null $subscriptions - */ - public function setSubscriptions(?array $subscriptions): void - { - $this->subscriptions = $subscriptions; - } - - /** - * Returns Cursor. - * When the total number of resulting subscription exceeds the limit of a paged response, - * the response includes a cursor for you to use in a subsequent request to fetch the next set of - * results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * When the total number of resulting subscription exceeds the limit of a paged response, - * the response includes a cursor for you to use in a subsequent request to fetch the next set of - * results. - * If the cursor is unset, the response contains the last page of the results. - * - * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscriptions)) { - $json['subscriptions'] = $this->subscriptions; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTeamMembersFilter.php b/src/Models/SearchTeamMembersFilter.php deleted file mode 100644 index 12454aad..00000000 --- a/src/Models/SearchTeamMembersFilter.php +++ /dev/null @@ -1,153 +0,0 @@ -locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * When present, filters by team members assigned to the specified locations. - * When empty, includes team members assigned to any location. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * When present, filters by team members assigned to the specified locations. - * When empty, includes team members assigned to any location. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Status. - * Enumerates the possible statuses the team member can have within a business. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Enumerates the possible statuses the team member can have within a business. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Is Owner. - * When present and set to true, returns the team member who is the owner of the Square account. - */ - public function getIsOwner(): ?bool - { - if (count($this->isOwner) == 0) { - return null; - } - return $this->isOwner['value']; - } - - /** - * Sets Is Owner. - * When present and set to true, returns the team member who is the owner of the Square account. - * - * @maps is_owner - */ - public function setIsOwner(?bool $isOwner): void - { - $this->isOwner['value'] = $isOwner; - } - - /** - * Unsets Is Owner. - * When present and set to true, returns the team member who is the owner of the Square account. - */ - public function unsetIsOwner(): void - { - $this->isOwner = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->isOwner)) { - $json['is_owner'] = $this->isOwner['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTeamMembersQuery.php b/src/Models/SearchTeamMembersQuery.php deleted file mode 100644 index cc0ac55a..00000000 --- a/src/Models/SearchTeamMembersQuery.php +++ /dev/null @@ -1,72 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied - * between the individual fields, and `OR` logic is applied within list-based fields. - * For example, setting this filter value: - * ``` - * filter = (locations_ids = ["A", "B"], status = ACTIVE) - * ``` - * returns only active team members assigned to either location "A" or "B". - * - * @maps filter - */ - public function setFilter(?SearchTeamMembersFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTeamMembersRequest.php b/src/Models/SearchTeamMembersRequest.php deleted file mode 100644 index 90a5f8ef..00000000 --- a/src/Models/SearchTeamMembersRequest.php +++ /dev/null @@ -1,118 +0,0 @@ -query; - } - - /** - * Sets Query. - * Represents the parameters in a search for `TeamMember` objects. - * - * @maps query - */ - public function setQuery(?SearchTeamMembersQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Limit. - * The maximum number of `TeamMember` objects in a page (100 by default). - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * The maximum number of `TeamMember` objects in a page (100 by default). - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Returns Cursor. - * The opaque cursor for fetching the next page. For more information, see - * [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The opaque cursor for fetching the next page. For more information, see - * [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTeamMembersResponse.php b/src/Models/SearchTeamMembersResponse.php deleted file mode 100644 index a395aa3c..00000000 --- a/src/Models/SearchTeamMembersResponse.php +++ /dev/null @@ -1,126 +0,0 @@ -teamMembers; - } - - /** - * Sets Team Members. - * The filtered list of `TeamMember` objects. - * - * @maps team_members - * - * @param TeamMember[]|null $teamMembers - */ - public function setTeamMembers(?array $teamMembers): void - { - $this->teamMembers = $teamMembers; - } - - /** - * Returns Cursor. - * The opaque cursor for fetching the next page. For more information, see - * [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The opaque cursor for fetching the next page. For more information, see - * [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMembers)) { - $json['team_members'] = $this->teamMembers; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalActionsRequest.php b/src/Models/SearchTerminalActionsRequest.php deleted file mode 100644 index f0905235..00000000 --- a/src/Models/SearchTerminalActionsRequest.php +++ /dev/null @@ -1,119 +0,0 @@ -query; - } - - /** - * Sets Query. - * - * @maps query - */ - public function setQuery(?TerminalActionQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more - * information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * Limit the number of results returned for a single request. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * Limit the number of results returned for a single request. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalActionsResponse.php b/src/Models/SearchTerminalActionsResponse.php deleted file mode 100644 index c978638b..00000000 --- a/src/Models/SearchTerminalActionsResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Action. - * The requested search result of `TerminalAction`s. - * - * @return TerminalAction[]|null - */ - public function getAction(): ?array - { - return $this->action; - } - - /** - * Sets Action. - * The requested search result of `TerminalAction`s. - * - * @maps action - * - * @param TerminalAction[]|null $action - */ - public function setAction(?array $action): void - { - $this->action = $action; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more - * information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more - * information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->action)) { - $json['action'] = $this->action; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalCheckoutsRequest.php b/src/Models/SearchTerminalCheckoutsRequest.php deleted file mode 100644 index 930ba0ff..00000000 --- a/src/Models/SearchTerminalCheckoutsRequest.php +++ /dev/null @@ -1,117 +0,0 @@ -query; - } - - /** - * Sets Query. - * - * @maps query - */ - public function setQuery(?TerminalCheckoutQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * Limits the number of results returned for a single request. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * Limits the number of results returned for a single request. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalCheckoutsResponse.php b/src/Models/SearchTerminalCheckoutsResponse.php deleted file mode 100644 index a27d9d26..00000000 --- a/src/Models/SearchTerminalCheckoutsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Checkouts. - * The requested search result of `TerminalCheckout` objects. - * - * @return TerminalCheckout[]|null - */ - public function getCheckouts(): ?array - { - return $this->checkouts; - } - - /** - * Sets Checkouts. - * The requested search result of `TerminalCheckout` objects. - * - * @maps checkouts - * - * @param TerminalCheckout[]|null $checkouts - */ - public function setCheckouts(?array $checkouts): void - { - $this->checkouts = $checkouts; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->checkouts)) { - $json['checkouts'] = $this->checkouts; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalRefundsRequest.php b/src/Models/SearchTerminalRefundsRequest.php deleted file mode 100644 index c98bbb66..00000000 --- a/src/Models/SearchTerminalRefundsRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -query; - } - - /** - * Sets Query. - * - * @maps query - */ - public function setQuery(?TerminalRefundQuery $query): void - { - $this->query = $query; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this cursor to retrieve the next set of results for the original query. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Returns Limit. - * Limits the number of results returned for a single request. - */ - public function getLimit(): ?int - { - return $this->limit; - } - - /** - * Sets Limit. - * Limits the number of results returned for a single request. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit = $limit; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->query)) { - $json['query'] = $this->query; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - if (isset($this->limit)) { - $json['limit'] = $this->limit; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchTerminalRefundsResponse.php b/src/Models/SearchTerminalRefundsResponse.php deleted file mode 100644 index 25f792c6..00000000 --- a/src/Models/SearchTerminalRefundsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Refunds. - * The requested search result of `TerminalRefund` objects. - * - * @return TerminalRefund[]|null - */ - public function getRefunds(): ?array - { - return $this->refunds; - } - - /** - * Sets Refunds. - * The requested search result of `TerminalRefund` objects. - * - * @maps refunds - * - * @param TerminalRefund[]|null $refunds - */ - public function setRefunds(?array $refunds): void - { - $this->refunds = $refunds; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If empty, - * this is the final response. - * - * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) - * for more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->refunds)) { - $json['refunds'] = $this->refunds; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchVendorsRequest.php b/src/Models/SearchVendorsRequest.php deleted file mode 100644 index 28712419..00000000 --- a/src/Models/SearchVendorsRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Defines supported query expressions to search for vendors by. - * - * @maps filter - */ - public function setFilter(?SearchVendorsRequestFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Defines a sorter used to sort results from [SearchVendors]($e/Vendors/SearchVendors). - */ - public function getSort(): ?SearchVendorsRequestSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Defines a sorter used to sort results from [SearchVendors]($e/Vendors/SearchVendors). - * - * @maps sort - */ - public function setSort(?SearchVendorsRequestSort $sort): void - { - $this->sort = $sort; - } - - /** - * Returns Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for the original query. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchVendorsRequestFilter.php b/src/Models/SearchVendorsRequestFilter.php deleted file mode 100644 index 14b8527b..00000000 --- a/src/Models/SearchVendorsRequestFilter.php +++ /dev/null @@ -1,123 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The names of the [Vendor](entity:Vendor) objects to retrieve. - * - * @maps name - * - * @param string[]|null $name - */ - public function setName(?array $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The names of the [Vendor](entity:Vendor) objects to retrieve. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Status. - * The statuses of the [Vendor](entity:Vendor) objects to retrieve. - * See [VendorStatus](#type-vendorstatus) for possible values - * - * @return string[]|null - */ - public function getStatus(): ?array - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * The statuses of the [Vendor](entity:Vendor) objects to retrieve. - * See [VendorStatus](#type-vendorstatus) for possible values - * - * @maps status - * - * @param string[]|null $status - */ - public function setStatus(?array $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * The statuses of the [Vendor](entity:Vendor) objects to retrieve. - * See [VendorStatus](#type-vendorstatus) for possible values - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchVendorsRequestSort.php b/src/Models/SearchVendorsRequestSort.php deleted file mode 100644 index 68e0e805..00000000 --- a/src/Models/SearchVendorsRequestSort.php +++ /dev/null @@ -1,88 +0,0 @@ -field; - } - - /** - * Sets Field. - * The field to sort the returned [Vendor]($m/Vendor) objects by. - * - * @maps field - */ - public function setField(?string $field): void - { - $this->field = $field; - } - - /** - * Returns Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getOrder(): ?string - { - return $this->order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->field)) { - $json['field'] = $this->field; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SearchVendorsRequestSortField.php b/src/Models/SearchVendorsRequestSortField.php deleted file mode 100644 index a6e86494..00000000 --- a/src/Models/SearchVendorsRequestSortField.php +++ /dev/null @@ -1,21 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered when the request fails. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Vendors. - * The [Vendor](entity:Vendor) objects matching the specified search filter. - * - * @return Vendor[]|null - */ - public function getVendors(): ?array - { - return $this->vendors; - } - - /** - * Sets Vendors. - * The [Vendor](entity:Vendor) objects matching the specified search filter. - * - * @maps vendors - * - * @param Vendor[]|null $vendors - */ - public function setVendors(?array $vendors): void - { - $this->vendors = $vendors; - } - - /** - * Returns Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - */ - public function getCursor(): ?string - { - return $this->cursor; - } - - /** - * Sets Cursor. - * The pagination cursor to be used in a subsequent request. If unset, - * this is the final response. - * - * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for - * more information. - * - * @maps cursor - */ - public function setCursor(?string $cursor): void - { - $this->cursor = $cursor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->vendors)) { - $json['vendors'] = $this->vendors; - } - if (isset($this->cursor)) { - $json['cursor'] = $this->cursor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SegmentFilter.php b/src/Models/SegmentFilter.php deleted file mode 100644 index 0b1d2930..00000000 --- a/src/Models/SegmentFilter.php +++ /dev/null @@ -1,105 +0,0 @@ -serviceVariationId = $serviceVariationId; - } - - /** - * Returns Service Variation Id. - * The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service - * booked in this segment. - */ - public function getServiceVariationId(): string - { - return $this->serviceVariationId; - } - - /** - * Sets Service Variation Id. - * The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service - * booked in this segment. - * - * @required - * @maps service_variation_id - */ - public function setServiceVariationId(string $serviceVariationId): void - { - $this->serviceVariationId = $serviceVariationId; - } - - /** - * Returns Team Member Id Filter. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - */ - public function getTeamMemberIdFilter(): ?FilterValue - { - return $this->teamMemberIdFilter; - } - - /** - * Sets Team Member Id Filter. - * A filter to select resources based on an exact field value. For any given - * value, the value can only be in one property. Depending on the field, either - * all properties can be set or only a subset will be available. - * - * Refer to the documentation of the field. - * - * @maps team_member_id_filter - */ - public function setTeamMemberIdFilter(?FilterValue $teamMemberIdFilter): void - { - $this->teamMemberIdFilter = $teamMemberIdFilter; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['service_variation_id'] = $this->serviceVariationId; - if (isset($this->teamMemberIdFilter)) { - $json['team_member_id_filter'] = $this->teamMemberIdFilter; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SelectOption.php b/src/Models/SelectOption.php deleted file mode 100644 index 4872d5e3..00000000 --- a/src/Models/SelectOption.php +++ /dev/null @@ -1,93 +0,0 @@ -referenceId = $referenceId; - $this->title = $title; - } - - /** - * Returns Reference Id. - * The reference id for the option. - */ - public function getReferenceId(): string - { - return $this->referenceId; - } - - /** - * Sets Reference Id. - * The reference id for the option. - * - * @required - * @maps reference_id - */ - public function setReferenceId(string $referenceId): void - { - $this->referenceId = $referenceId; - } - - /** - * Returns Title. - * The title text that displays in the select option button. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text that displays in the select option button. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['reference_id'] = $this->referenceId; - $json['title'] = $this->title; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SelectOptions.php b/src/Models/SelectOptions.php deleted file mode 100644 index 14c8ff8f..00000000 --- a/src/Models/SelectOptions.php +++ /dev/null @@ -1,152 +0,0 @@ -title = $title; - $this->body = $body; - $this->options = $options; - } - - /** - * Returns Title. - * The title text to display in the select flow on the Terminal. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text to display in the select flow on the Terminal. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Returns Body. - * The body text to display in the select flow on the Terminal. - */ - public function getBody(): string - { - return $this->body; - } - - /** - * Sets Body. - * The body text to display in the select flow on the Terminal. - * - * @required - * @maps body - */ - public function setBody(string $body): void - { - $this->body = $body; - } - - /** - * Returns Options. - * Represents the buttons/options that should be displayed in the select flow on the Terminal. - * - * @return SelectOption[] - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * Sets Options. - * Represents the buttons/options that should be displayed in the select flow on the Terminal. - * - * @required - * @maps options - * - * @param SelectOption[] $options - */ - public function setOptions(array $options): void - { - $this->options = $options; - } - - /** - * Returns Selected Option. - */ - public function getSelectedOption(): ?SelectOption - { - return $this->selectedOption; - } - - /** - * Sets Selected Option. - * - * @maps selected_option - */ - public function setSelectedOption(?SelectOption $selectedOption): void - { - $this->selectedOption = $selectedOption; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json['body'] = $this->body; - $json['options'] = $this->options; - if (isset($this->selectedOption)) { - $json['selected_option'] = $this->selectedOption; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Shift.php b/src/Models/Shift.php deleted file mode 100644 index c9784a21..00000000 --- a/src/Models/Shift.php +++ /dev/null @@ -1,532 +0,0 @@ -locationId = $locationId; - $this->startAt = $startAt; - } - - /** - * Returns Id. - * The UUID for this object. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Employee Id. - * The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` - * instead. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` - * instead. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` - * instead. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Location Id. - * The ID of the location this shift occurred at. The location should be based on - * where the employee clocked in. - */ - public function getLocationId(): string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location this shift occurred at. The location should be based on - * where the employee clocked in. - * - * @required - * @maps location_id - */ - public function setLocationId(string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Timezone. - * The read-only convenience value that is calculated from the location based - * on the `location_id`. Format: the IANA timezone database identifier for the - * location timezone. - */ - public function getTimezone(): ?string - { - if (count($this->timezone) == 0) { - return null; - } - return $this->timezone['value']; - } - - /** - * Sets Timezone. - * The read-only convenience value that is calculated from the location based - * on the `location_id`. Format: the IANA timezone database identifier for the - * location timezone. - * - * @maps timezone - */ - public function setTimezone(?string $timezone): void - { - $this->timezone['value'] = $timezone; - } - - /** - * Unsets Timezone. - * The read-only convenience value that is calculated from the location based - * on the `location_id`. Format: the IANA timezone database identifier for the - * location timezone. - */ - public function unsetTimezone(): void - { - $this->timezone = []; - } - - /** - * Returns Start At. - * RFC 3339; shifted to the location timezone + offset. Precision up to the - * minute is respected; seconds are truncated. - */ - public function getStartAt(): string - { - return $this->startAt; - } - - /** - * Sets Start At. - * RFC 3339; shifted to the location timezone + offset. Precision up to the - * minute is respected; seconds are truncated. - * - * @required - * @maps start_at - */ - public function setStartAt(string $startAt): void - { - $this->startAt = $startAt; - } - - /** - * Returns End At. - * RFC 3339; shifted to the timezone + offset. Precision up to the minute is - * respected; seconds are truncated. - */ - public function getEndAt(): ?string - { - if (count($this->endAt) == 0) { - return null; - } - return $this->endAt['value']; - } - - /** - * Sets End At. - * RFC 3339; shifted to the timezone + offset. Precision up to the minute is - * respected; seconds are truncated. - * - * @maps end_at - */ - public function setEndAt(?string $endAt): void - { - $this->endAt['value'] = $endAt; - } - - /** - * Unsets End At. - * RFC 3339; shifted to the timezone + offset. Precision up to the minute is - * respected; seconds are truncated. - */ - public function unsetEndAt(): void - { - $this->endAt = []; - } - - /** - * Returns Wage. - * The hourly wage rate used to compensate an employee for this shift. - */ - public function getWage(): ?ShiftWage - { - return $this->wage; - } - - /** - * Sets Wage. - * The hourly wage rate used to compensate an employee for this shift. - * - * @maps wage - */ - public function setWage(?ShiftWage $wage): void - { - $this->wage = $wage; - } - - /** - * Returns Breaks. - * A list of all the paid or unpaid breaks that were taken during this shift. - * - * @return MBreak[]|null - */ - public function getBreaks(): ?array - { - if (count($this->breaks) == 0) { - return null; - } - return $this->breaks['value']; - } - - /** - * Sets Breaks. - * A list of all the paid or unpaid breaks that were taken during this shift. - * - * @maps breaks - * - * @param MBreak[]|null $breaks - */ - public function setBreaks(?array $breaks): void - { - $this->breaks['value'] = $breaks; - } - - /** - * Unsets Breaks. - * A list of all the paid or unpaid breaks that were taken during this shift. - */ - public function unsetBreaks(): void - { - $this->breaks = []; - } - - /** - * Returns Status. - * Enumerates the possible status of a `Shift`. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Enumerates the possible status of a `Shift`. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write; potentially overwriting data from another - * write. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write; potentially overwriting data from another - * write. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Created At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Team Member Id. - * The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Declared Cash Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getDeclaredCashTipMoney(): ?Money - { - return $this->declaredCashTipMoney; - } - - /** - * Sets Declared Cash Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps declared_cash_tip_money - */ - public function setDeclaredCashTipMoney(?Money $declaredCashTipMoney): void - { - $this->declaredCashTipMoney = $declaredCashTipMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - $json['location_id'] = $this->locationId; - if (!empty($this->timezone)) { - $json['timezone'] = $this->timezone['value']; - } - $json['start_at'] = $this->startAt; - if (!empty($this->endAt)) { - $json['end_at'] = $this->endAt['value']; - } - if (isset($this->wage)) { - $json['wage'] = $this->wage; - } - if (!empty($this->breaks)) { - $json['breaks'] = $this->breaks['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (isset($this->declaredCashTipMoney)) { - $json['declared_cash_tip_money'] = $this->declaredCashTipMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftFilter.php b/src/Models/ShiftFilter.php deleted file mode 100644 index d01ab275..00000000 --- a/src/Models/ShiftFilter.php +++ /dev/null @@ -1,298 +0,0 @@ -locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * Fetch shifts for the specified location. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * Fetch shifts for the specified location. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Returns Employee Ids. - * Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` - * instead. - * - * @return string[]|null - */ - public function getEmployeeIds(): ?array - { - if (count($this->employeeIds) == 0) { - return null; - } - return $this->employeeIds['value']; - } - - /** - * Sets Employee Ids. - * Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` - * instead. - * - * @maps employee_ids - * - * @param string[]|null $employeeIds - */ - public function setEmployeeIds(?array $employeeIds): void - { - $this->employeeIds['value'] = $employeeIds; - } - - /** - * Unsets Employee Ids. - * Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` - * instead. - */ - public function unsetEmployeeIds(): void - { - $this->employeeIds = []; - } - - /** - * Returns Status. - * Specifies the `status` of `Shift` records to be returned. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Specifies the `status` of `Shift` records to be returned. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Start. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getStart(): ?TimeRange - { - return $this->start; - } - - /** - * Sets Start. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps start - */ - public function setStart(?TimeRange $start): void - { - $this->start = $start; - } - - /** - * Returns End. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getEnd(): ?TimeRange - { - return $this->end; - } - - /** - * Sets End. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps end - */ - public function setEnd(?TimeRange $end): void - { - $this->end = $end; - } - - /** - * Returns Workday. - * A `Shift` search query filter parameter that sets a range of days that - * a `Shift` must start or end in before passing the filter condition. - */ - public function getWorkday(): ?ShiftWorkday - { - return $this->workday; - } - - /** - * Sets Workday. - * A `Shift` search query filter parameter that sets a range of days that - * a `Shift` must start or end in before passing the filter condition. - * - * @maps workday - */ - public function setWorkday(?ShiftWorkday $workday): void - { - $this->workday = $workday; - } - - /** - * Returns Team Member Ids. - * Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". - * - * @return string[]|null - */ - public function getTeamMemberIds(): ?array - { - if (count($this->teamMemberIds) == 0) { - return null; - } - return $this->teamMemberIds['value']; - } - - /** - * Sets Team Member Ids. - * Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". - * - * @maps team_member_ids - * - * @param string[]|null $teamMemberIds - */ - public function setTeamMemberIds(?array $teamMemberIds): void - { - $this->teamMemberIds['value'] = $teamMemberIds; - } - - /** - * Unsets Team Member Ids. - * Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". - */ - public function unsetTeamMemberIds(): void - { - $this->teamMemberIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - if (!empty($this->employeeIds)) { - $json['employee_ids'] = $this->employeeIds['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->start)) { - $json['start'] = $this->start; - } - if (isset($this->end)) { - $json['end'] = $this->end; - } - if (isset($this->workday)) { - $json['workday'] = $this->workday; - } - if (!empty($this->teamMemberIds)) { - $json['team_member_ids'] = $this->teamMemberIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftFilterStatus.php b/src/Models/ShiftFilterStatus.php deleted file mode 100644 index bf9fabdb..00000000 --- a/src/Models/ShiftFilterStatus.php +++ /dev/null @@ -1,21 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * Defines a filter used in a search for `Shift` records. `AND` logic is - * used by Square's servers to apply each filter property specified. - * - * @maps filter - */ - public function setFilter(?ShiftFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - * Sets the sort order of search results. - */ - public function getSort(): ?ShiftSort - { - return $this->sort; - } - - /** - * Sets Sort. - * Sets the sort order of search results. - * - * @maps sort - */ - public function setSort(?ShiftSort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftSort.php b/src/Models/ShiftSort.php deleted file mode 100644 index d1400034..00000000 --- a/src/Models/ShiftSort.php +++ /dev/null @@ -1,88 +0,0 @@ -field; - } - - /** - * Sets Field. - * Enumerates the `Shift` fields to sort on. - * - * @maps field - */ - public function setField(?string $field): void - { - $this->field = $field; - } - - /** - * Returns Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ - public function getOrder(): ?string - { - return $this->order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->field)) { - $json['field'] = $this->field; - } - if (isset($this->order)) { - $json['order'] = $this->order; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftSortField.php b/src/Models/ShiftSortField.php deleted file mode 100644 index df424cca..00000000 --- a/src/Models/ShiftSortField.php +++ /dev/null @@ -1,31 +0,0 @@ -title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The name of the job performed during this shift. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The name of the job performed during this shift. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getHourlyRate(): ?Money - { - return $this->hourlyRate; - } - - /** - * Sets Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps hourly_rate - */ - public function setHourlyRate(?Money $hourlyRate): void - { - $this->hourlyRate = $hourlyRate; - } - - /** - * Returns Job Id. - * The id of the job performed during this shift. Square - * labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. - */ - public function getJobId(): ?string - { - return $this->jobId; - } - - /** - * Sets Job Id. - * The id of the job performed during this shift. Square - * labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. - * - * @maps job_id - */ - public function setJobId(?string $jobId): void - { - $this->jobId = $jobId; - } - - /** - * Returns Tip Eligible. - * Whether team members are eligible for tips when working this job. - */ - public function getTipEligible(): ?bool - { - if (count($this->tipEligible) == 0) { - return null; - } - return $this->tipEligible['value']; - } - - /** - * Sets Tip Eligible. - * Whether team members are eligible for tips when working this job. - * - * @maps tip_eligible - */ - public function setTipEligible(?bool $tipEligible): void - { - $this->tipEligible['value'] = $tipEligible; - } - - /** - * Unsets Tip Eligible. - * Whether team members are eligible for tips when working this job. - */ - public function unsetTipEligible(): void - { - $this->tipEligible = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (isset($this->hourlyRate)) { - $json['hourly_rate'] = $this->hourlyRate; - } - if (isset($this->jobId)) { - $json['job_id'] = $this->jobId; - } - if (!empty($this->tipEligible)) { - $json['tip_eligible'] = $this->tipEligible['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftWorkday.php b/src/Models/ShiftWorkday.php deleted file mode 100644 index 53fcf912..00000000 --- a/src/Models/ShiftWorkday.php +++ /dev/null @@ -1,140 +0,0 @@ -dateRange; - } - - /** - * Sets Date Range. - * A range defined by two dates. Used for filtering a query for Connect v2 - * objects that have date properties. - * - * @maps date_range - */ - public function setDateRange(?DateRange $dateRange): void - { - $this->dateRange = $dateRange; - } - - /** - * Returns Match Shifts By. - * Defines the logic used to apply a workday filter. - */ - public function getMatchShiftsBy(): ?string - { - return $this->matchShiftsBy; - } - - /** - * Sets Match Shifts By. - * Defines the logic used to apply a workday filter. - * - * @maps match_shifts_by - */ - public function setMatchShiftsBy(?string $matchShiftsBy): void - { - $this->matchShiftsBy = $matchShiftsBy; - } - - /** - * Returns Default Timezone. - * Location-specific timezones convert workdays to datetime filters. - * Every location included in the query must have a timezone or this field - * must be provided as a fallback. Format: the IANA timezone database - * identifier for the relevant timezone. - */ - public function getDefaultTimezone(): ?string - { - if (count($this->defaultTimezone) == 0) { - return null; - } - return $this->defaultTimezone['value']; - } - - /** - * Sets Default Timezone. - * Location-specific timezones convert workdays to datetime filters. - * Every location included in the query must have a timezone or this field - * must be provided as a fallback. Format: the IANA timezone database - * identifier for the relevant timezone. - * - * @maps default_timezone - */ - public function setDefaultTimezone(?string $defaultTimezone): void - { - $this->defaultTimezone['value'] = $defaultTimezone; - } - - /** - * Unsets Default Timezone. - * Location-specific timezones convert workdays to datetime filters. - * Every location included in the query must have a timezone or this field - * must be provided as a fallback. Format: the IANA timezone database - * identifier for the relevant timezone. - */ - public function unsetDefaultTimezone(): void - { - $this->defaultTimezone = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->dateRange)) { - $json['date_range'] = $this->dateRange; - } - if (isset($this->matchShiftsBy)) { - $json['match_shifts_by'] = $this->matchShiftsBy; - } - if (!empty($this->defaultTimezone)) { - $json['default_timezone'] = $this->defaultTimezone['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ShiftWorkdayMatcher.php b/src/Models/ShiftWorkdayMatcher.php deleted file mode 100644 index b6b946a2..00000000 --- a/src/Models/ShiftWorkdayMatcher.php +++ /dev/null @@ -1,26 +0,0 @@ -charge = $charge; - } - - /** - * Returns Name. - * The name for the shipping fee. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name for the shipping fee. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name for the shipping fee. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Charge. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getCharge(): Money - { - return $this->charge; - } - - /** - * Sets Charge. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps charge - */ - public function setCharge(Money $charge): void - { - $this->charge = $charge; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json['charge'] = $this->charge; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SignatureImage.php b/src/Models/SignatureImage.php deleted file mode 100644 index 373f88b4..00000000 --- a/src/Models/SignatureImage.php +++ /dev/null @@ -1,87 +0,0 @@ -imageType; - } - - /** - * Sets Image Type. - * The mime/type of the image data. - * Use `image/png;base64` for png. - * - * @maps image_type - */ - public function setImageType(?string $imageType): void - { - $this->imageType = $imageType; - } - - /** - * Returns Data. - * The base64 representation of the image. - */ - public function getData(): ?string - { - return $this->data; - } - - /** - * Sets Data. - * The base64 representation of the image. - * - * @maps data - */ - public function setData(?string $data): void - { - $this->data = $data; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->imageType)) { - $json['image_type'] = $this->imageType; - } - if (isset($this->data)) { - $json['data'] = $this->data; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SignatureOptions.php b/src/Models/SignatureOptions.php deleted file mode 100644 index 5c0bb07f..00000000 --- a/src/Models/SignatureOptions.php +++ /dev/null @@ -1,125 +0,0 @@ -title = $title; - $this->body = $body; - } - - /** - * Returns Title. - * The title text to display in the signature capture flow on the Terminal. - */ - public function getTitle(): string - { - return $this->title; - } - - /** - * Sets Title. - * The title text to display in the signature capture flow on the Terminal. - * - * @required - * @maps title - */ - public function setTitle(string $title): void - { - $this->title = $title; - } - - /** - * Returns Body. - * The body text to display in the signature capture flow on the Terminal. - */ - public function getBody(): string - { - return $this->body; - } - - /** - * Sets Body. - * The body text to display in the signature capture flow on the Terminal. - * - * @required - * @maps body - */ - public function setBody(string $body): void - { - $this->body = $body; - } - - /** - * Returns Signature. - * An image representation of the collected signature. - * - * @return SignatureImage[]|null - */ - public function getSignature(): ?array - { - return $this->signature; - } - - /** - * Sets Signature. - * An image representation of the collected signature. - * - * @maps signature - * - * @param SignatureImage[]|null $signature - */ - public function setSignature(?array $signature): void - { - $this->signature = $signature; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['title'] = $this->title; - $json['body'] = $this->body; - if (isset($this->signature)) { - $json['signature'] = $this->signature; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Site.php b/src/Models/Site.php deleted file mode 100644 index ef834b24..00000000 --- a/src/Models/Site.php +++ /dev/null @@ -1,236 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the site. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Site Title. - * The title of the site. - */ - public function getSiteTitle(): ?string - { - if (count($this->siteTitle) == 0) { - return null; - } - return $this->siteTitle['value']; - } - - /** - * Sets Site Title. - * The title of the site. - * - * @maps site_title - */ - public function setSiteTitle(?string $siteTitle): void - { - $this->siteTitle['value'] = $siteTitle; - } - - /** - * Unsets Site Title. - * The title of the site. - */ - public function unsetSiteTitle(): void - { - $this->siteTitle = []; - } - - /** - * Returns Domain. - * The domain of the site (without the protocol). For example, `mysite1.square.site`. - */ - public function getDomain(): ?string - { - if (count($this->domain) == 0) { - return null; - } - return $this->domain['value']; - } - - /** - * Sets Domain. - * The domain of the site (without the protocol). For example, `mysite1.square.site`. - * - * @maps domain - */ - public function setDomain(?string $domain): void - { - $this->domain['value'] = $domain; - } - - /** - * Unsets Domain. - * The domain of the site (without the protocol). For example, `mysite1.square.site`. - */ - public function unsetDomain(): void - { - $this->domain = []; - } - - /** - * Returns Is Published. - * Indicates whether the site is published. - */ - public function getIsPublished(): ?bool - { - if (count($this->isPublished) == 0) { - return null; - } - return $this->isPublished['value']; - } - - /** - * Sets Is Published. - * Indicates whether the site is published. - * - * @maps is_published - */ - public function setIsPublished(?bool $isPublished): void - { - $this->isPublished['value'] = $isPublished; - } - - /** - * Unsets Is Published. - * Indicates whether the site is published. - */ - public function unsetIsPublished(): void - { - $this->isPublished = []; - } - - /** - * Returns Created At. - * The timestamp of when the site was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the site was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the site was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the site was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->siteTitle)) { - $json['site_title'] = $this->siteTitle['value']; - } - if (!empty($this->domain)) { - $json['domain'] = $this->domain['value']; - } - if (!empty($this->isPublished)) { - $json['is_published'] = $this->isPublished['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Snippet.php b/src/Models/Snippet.php deleted file mode 100644 index a91bac2d..00000000 --- a/src/Models/Snippet.php +++ /dev/null @@ -1,180 +0,0 @@ -content = $content; - } - - /** - * Returns Id. - * The Square-assigned ID for the snippet. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The Square-assigned ID for the snippet. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Site Id. - * The ID of the site that contains the snippet. - */ - public function getSiteId(): ?string - { - return $this->siteId; - } - - /** - * Sets Site Id. - * The ID of the site that contains the snippet. - * - * @maps site_id - */ - public function setSiteId(?string $siteId): void - { - $this->siteId = $siteId; - } - - /** - * Returns Content. - * The snippet code, which can contain valid HTML, JavaScript, or both. - */ - public function getContent(): string - { - return $this->content; - } - - /** - * Sets Content. - * The snippet code, which can contain valid HTML, JavaScript, or both. - * - * @required - * @maps content - */ - public function setContent(string $content): void - { - $this->content = $content; - } - - /** - * Returns Created At. - * The timestamp of when the snippet was initially added to the site, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the snippet was initially added to the site, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the snippet was last updated on the site, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the snippet was last updated on the site, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->siteId)) { - $json['site_id'] = $this->siteId; - } - $json['content'] = $this->content; - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SnippetResponse.php b/src/Models/SnippetResponse.php deleted file mode 100644 index 9dd4173a..00000000 --- a/src/Models/SnippetResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - */ - public function getSnippet(): ?Snippet - { - return $this->snippet; - } - - /** - * Sets Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - * - * @maps snippet - */ - public function setSnippet(?Snippet $snippet): void - { - $this->snippet = $snippet; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->snippet)) { - $json['snippet'] = $this->snippet; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SortOrder.php b/src/Models/SortOrder.php deleted file mode 100644 index 65856608..00000000 --- a/src/Models/SortOrder.php +++ /dev/null @@ -1,21 +0,0 @@ -product; - } - - /** - * Sets Product. - * Indicates the Square product used to generate a change. - * - * @maps product - */ - public function setProduct(?string $product): void - { - $this->product = $product; - } - - /** - * Returns Application Id. - * __Read only__ The Square-assigned ID of the application. This field is used only if the - * [product](entity:Product) type is `EXTERNAL_API`. - */ - public function getApplicationId(): ?string - { - if (count($this->applicationId) == 0) { - return null; - } - return $this->applicationId['value']; - } - - /** - * Sets Application Id. - * __Read only__ The Square-assigned ID of the application. This field is used only if the - * [product](entity:Product) type is `EXTERNAL_API`. - * - * @maps application_id - */ - public function setApplicationId(?string $applicationId): void - { - $this->applicationId['value'] = $applicationId; - } - - /** - * Unsets Application Id. - * __Read only__ The Square-assigned ID of the application. This field is used only if the - * [product](entity:Product) type is `EXTERNAL_API`. - */ - public function unsetApplicationId(): void - { - $this->applicationId = []; - } - - /** - * Returns Name. - * __Read only__ The display name of the application - * (for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * __Read only__ The display name of the application - * (for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * __Read only__ The display name of the application - * (for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->product)) { - $json['product'] = $this->product; - } - if (!empty($this->applicationId)) { - $json['application_id'] = $this->applicationId['value']; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SquareAccountDetails.php b/src/Models/SquareAccountDetails.php deleted file mode 100644 index acb8b417..00000000 --- a/src/Models/SquareAccountDetails.php +++ /dev/null @@ -1,116 +0,0 @@ -paymentSourceToken) == 0) { - return null; - } - return $this->paymentSourceToken['value']; - } - - /** - * Sets Payment Source Token. - * Unique identifier for the payment source used for this payment. - * - * @maps payment_source_token - */ - public function setPaymentSourceToken(?string $paymentSourceToken): void - { - $this->paymentSourceToken['value'] = $paymentSourceToken; - } - - /** - * Unsets Payment Source Token. - * Unique identifier for the payment source used for this payment. - */ - public function unsetPaymentSourceToken(): void - { - $this->paymentSourceToken = []; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - if (count($this->errors) == 0) { - return null; - } - return $this->errors['value']; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors['value'] = $errors; - } - - /** - * Unsets Errors. - * Information about errors encountered during the request. - */ - public function unsetErrors(): void - { - $this->errors = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->paymentSourceToken)) { - $json['payment_source_token'] = $this->paymentSourceToken['value']; - } - if (!empty($this->errors)) { - $json['errors'] = $this->errors['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/StandardUnitDescription.php b/src/Models/StandardUnitDescription.php deleted file mode 100644 index 749972bf..00000000 --- a/src/Models/StandardUnitDescription.php +++ /dev/null @@ -1,144 +0,0 @@ -unit; - } - - /** - * Sets Unit. - * Represents a unit of measurement to use with a quantity, such as ounces - * or inches. Exactly one of the following fields are required: `custom_unit`, - * `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. - * - * @maps unit - */ - public function setUnit(?MeasurementUnit $unit): void - { - $this->unit = $unit; - } - - /** - * Returns Name. - * UI display name of the measurement unit. For example, 'Pound'. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * UI display name of the measurement unit. For example, 'Pound'. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * UI display name of the measurement unit. For example, 'Pound'. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Abbreviation. - * UI display abbreviation for the measurement unit. For example, 'lb'. - */ - public function getAbbreviation(): ?string - { - if (count($this->abbreviation) == 0) { - return null; - } - return $this->abbreviation['value']; - } - - /** - * Sets Abbreviation. - * UI display abbreviation for the measurement unit. For example, 'lb'. - * - * @maps abbreviation - */ - public function setAbbreviation(?string $abbreviation): void - { - $this->abbreviation['value'] = $abbreviation; - } - - /** - * Unsets Abbreviation. - * UI display abbreviation for the measurement unit. For example, 'lb'. - */ - public function unsetAbbreviation(): void - { - $this->abbreviation = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->unit)) { - $json['unit'] = $this->unit; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->abbreviation)) { - $json['abbreviation'] = $this->abbreviation['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/StandardUnitDescriptionGroup.php b/src/Models/StandardUnitDescriptionGroup.php deleted file mode 100644 index 28745673..00000000 --- a/src/Models/StandardUnitDescriptionGroup.php +++ /dev/null @@ -1,116 +0,0 @@ -standardUnitDescriptions) == 0) { - return null; - } - return $this->standardUnitDescriptions['value']; - } - - /** - * Sets Standard Unit Descriptions. - * List of standard (non-custom) measurement units in this description group. - * - * @maps standard_unit_descriptions - * - * @param StandardUnitDescription[]|null $standardUnitDescriptions - */ - public function setStandardUnitDescriptions(?array $standardUnitDescriptions): void - { - $this->standardUnitDescriptions['value'] = $standardUnitDescriptions; - } - - /** - * Unsets Standard Unit Descriptions. - * List of standard (non-custom) measurement units in this description group. - */ - public function unsetStandardUnitDescriptions(): void - { - $this->standardUnitDescriptions = []; - } - - /** - * Returns Language Code. - * IETF language tag. - */ - public function getLanguageCode(): ?string - { - if (count($this->languageCode) == 0) { - return null; - } - return $this->languageCode['value']; - } - - /** - * Sets Language Code. - * IETF language tag. - * - * @maps language_code - */ - public function setLanguageCode(?string $languageCode): void - { - $this->languageCode['value'] = $languageCode; - } - - /** - * Unsets Language Code. - * IETF language tag. - */ - public function unsetLanguageCode(): void - { - $this->languageCode = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->standardUnitDescriptions)) { - $json['standard_unit_descriptions'] = $this->standardUnitDescriptions['value']; - } - if (!empty($this->languageCode)) { - $json['language_code'] = $this->languageCode['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubmitEvidenceResponse.php b/src/Models/SubmitEvidenceResponse.php deleted file mode 100644 index c7bcaac0..00000000 --- a/src/Models/SubmitEvidenceResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - */ - public function getDispute(): ?Dispute - { - return $this->dispute; - } - - /** - * Sets Dispute. - * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder - * initiated with their bank. - * - * @maps dispute - */ - public function setDispute(?Dispute $dispute): void - { - $this->dispute = $dispute; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->dispute)) { - $json['dispute'] = $this->dispute; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Subscription.php b/src/Models/Subscription.php deleted file mode 100644 index c8c4b1b8..00000000 --- a/src/Models/Subscription.php +++ /dev/null @@ -1,708 +0,0 @@ -id; - } - - /** - * Sets Id. - * The Square-assigned ID of the subscription. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the location associated with the subscription. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The ID of the location associated with the subscription. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Plan Variation Id. - * The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). - */ - public function getPlanVariationId(): ?string - { - return $this->planVariationId; - } - - /** - * Sets Plan Variation Id. - * The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). - * - * @maps plan_variation_id - */ - public function setPlanVariationId(?string $planVariationId): void - { - $this->planVariationId = $planVariationId; - } - - /** - * Returns Customer Id. - * The ID of the subscribing [customer](entity:Customer) profile. - */ - public function getCustomerId(): ?string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the subscribing [customer](entity:Customer) profile. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Returns Start Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. - */ - public function getStartDate(): ?string - { - return $this->startDate; - } - - /** - * Sets Start Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. - * - * @maps start_date - */ - public function setStartDate(?string $startDate): void - { - $this->startDate = $startDate; - } - - /** - * Returns Canceled Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, - * when the subscription status changes to `CANCELED` and the subscription billing stops. - * - * If this field is not set, the subscription ends according its subscription plan. - * - * This field cannot be updated, other than being cleared. - */ - public function getCanceledDate(): ?string - { - if (count($this->canceledDate) == 0) { - return null; - } - return $this->canceledDate['value']; - } - - /** - * Sets Canceled Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, - * when the subscription status changes to `CANCELED` and the subscription billing stops. - * - * If this field is not set, the subscription ends according its subscription plan. - * - * This field cannot be updated, other than being cleared. - * - * @maps canceled_date - */ - public function setCanceledDate(?string $canceledDate): void - { - $this->canceledDate['value'] = $canceledDate; - } - - /** - * Unsets Canceled Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, - * when the subscription status changes to `CANCELED` and the subscription billing stops. - * - * If this field is not set, the subscription ends according its subscription plan. - * - * This field cannot be updated, other than being cleared. - */ - public function unsetCanceledDate(): void - { - $this->canceledDate = []; - } - - /** - * Returns Charged Through Date. - * The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the - * subscription. - * - * After the invoice is sent for a given billing period, - * this date will be the last day of the billing period. - * For example, - * suppose for the month of May a subscriber gets an invoice - * (or charged the card) on May 1. For the monthly billing scenario, - * this date is then set to May 31. - */ - public function getChargedThroughDate(): ?string - { - return $this->chargedThroughDate; - } - - /** - * Sets Charged Through Date. - * The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the - * subscription. - * - * After the invoice is sent for a given billing period, - * this date will be the last day of the billing period. - * For example, - * suppose for the month of May a subscriber gets an invoice - * (or charged the card) on May 1. For the monthly billing scenario, - * this date is then set to May 31. - * - * @maps charged_through_date - */ - public function setChargedThroughDate(?string $chargedThroughDate): void - { - $this->chargedThroughDate = $chargedThroughDate; - } - - /** - * Returns Status. - * Supported subscription statuses. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Supported subscription statuses. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Tax Percentage. - * The tax amount applied when billing the subscription. The - * percentage is expressed in decimal form, using a `'.'` as the decimal - * separator and without a `'%'` sign. For example, a value of `7.5` - * corresponds to 7.5%. - */ - public function getTaxPercentage(): ?string - { - if (count($this->taxPercentage) == 0) { - return null; - } - return $this->taxPercentage['value']; - } - - /** - * Sets Tax Percentage. - * The tax amount applied when billing the subscription. The - * percentage is expressed in decimal form, using a `'.'` as the decimal - * separator and without a `'%'` sign. For example, a value of `7.5` - * corresponds to 7.5%. - * - * @maps tax_percentage - */ - public function setTaxPercentage(?string $taxPercentage): void - { - $this->taxPercentage['value'] = $taxPercentage; - } - - /** - * Unsets Tax Percentage. - * The tax amount applied when billing the subscription. The - * percentage is expressed in decimal form, using a `'.'` as the decimal - * separator and without a `'%'` sign. For example, a value of `7.5` - * corresponds to 7.5%. - */ - public function unsetTaxPercentage(): void - { - $this->taxPercentage = []; - } - - /** - * Returns Invoice Ids. - * The IDs of the [invoices](entity:Invoice) created for the - * subscription, listed in order when the invoices were created - * (newest invoices appear first). - * - * @return string[]|null - */ - public function getInvoiceIds(): ?array - { - return $this->invoiceIds; - } - - /** - * Sets Invoice Ids. - * The IDs of the [invoices](entity:Invoice) created for the - * subscription, listed in order when the invoices were created - * (newest invoices appear first). - * - * @maps invoice_ids - * - * @param string[]|null $invoiceIds - */ - public function setInvoiceIds(?array $invoiceIds): void - { - $this->invoiceIds = $invoiceIds; - } - - /** - * Returns Price Override Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceOverrideMoney(): ?Money - { - return $this->priceOverrideMoney; - } - - /** - * Sets Price Override Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_override_money - */ - public function setPriceOverrideMoney(?Money $priceOverrideMoney): void - { - $this->priceOverrideMoney = $priceOverrideMoney; - } - - /** - * Returns Version. - * The version of the object. When updating an object, the version - * supplied must match the version in the database, otherwise the write will - * be rejected as conflicting. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version of the object. When updating an object, the version - * supplied must match the version in the database, otherwise the write will - * be rejected as conflicting. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Created At. - * The timestamp when the subscription was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the subscription was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Card Id. - * The ID of the [subscriber's](entity:Customer) [card](entity:Card) - * used to charge for the subscription. - */ - public function getCardId(): ?string - { - if (count($this->cardId) == 0) { - return null; - } - return $this->cardId['value']; - } - - /** - * Sets Card Id. - * The ID of the [subscriber's](entity:Customer) [card](entity:Card) - * used to charge for the subscription. - * - * @maps card_id - */ - public function setCardId(?string $cardId): void - { - $this->cardId['value'] = $cardId; - } - - /** - * Unsets Card Id. - * The ID of the [subscriber's](entity:Customer) [card](entity:Card) - * used to charge for the subscription. - */ - public function unsetCardId(): void - { - $this->cardId = []; - } - - /** - * Returns Timezone. - * Timezone that will be used in date calculations for the subscription. - * Defaults to the timezone of the location based on `location_id`. - * Format: the IANA Timezone Database identifier for the location timezone (for example, - * `America/Los_Angeles`). - */ - public function getTimezone(): ?string - { - return $this->timezone; - } - - /** - * Sets Timezone. - * Timezone that will be used in date calculations for the subscription. - * Defaults to the timezone of the location based on `location_id`. - * Format: the IANA Timezone Database identifier for the location timezone (for example, - * `America/Los_Angeles`). - * - * @maps timezone - */ - public function setTimezone(?string $timezone): void - { - $this->timezone = $timezone; - } - - /** - * Returns Source. - * The origination details of the subscription. - */ - public function getSource(): ?SubscriptionSource - { - return $this->source; - } - - /** - * Sets Source. - * The origination details of the subscription. - * - * @maps source - */ - public function setSource(?SubscriptionSource $source): void - { - $this->source = $source; - } - - /** - * Returns Actions. - * The list of scheduled actions on this subscription. It is set only in the response from - * [RetrieveSubscription]($e/Subscriptions/RetrieveSubscription) with the query parameter - * of `include=actions` or from - * [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) with the input parameter - * of `include:["actions"]`. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - if (count($this->actions) == 0) { - return null; - } - return $this->actions['value']; - } - - /** - * Sets Actions. - * The list of scheduled actions on this subscription. It is set only in the response from - * [RetrieveSubscription]($e/Subscriptions/RetrieveSubscription) with the query parameter - * of `include=actions` or from - * [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) with the input parameter - * of `include:["actions"]`. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions['value'] = $actions; - } - - /** - * Unsets Actions. - * The list of scheduled actions on this subscription. It is set only in the response from - * [RetrieveSubscription]($e/Subscriptions/RetrieveSubscription) with the query parameter - * of `include=actions` or from - * [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) with the input parameter - * of `include:["actions"]`. - */ - public function unsetActions(): void - { - $this->actions = []; - } - - /** - * Returns Monthly Billing Anchor Date. - * The day of the month on which the subscription will issue invoices and publish orders. - */ - public function getMonthlyBillingAnchorDate(): ?int - { - return $this->monthlyBillingAnchorDate; - } - - /** - * Sets Monthly Billing Anchor Date. - * The day of the month on which the subscription will issue invoices and publish orders. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate = $monthlyBillingAnchorDate; - } - - /** - * Returns Phases. - * array of phases for this subscription - * - * @return Phase[]|null - */ - public function getPhases(): ?array - { - return $this->phases; - } - - /** - * Sets Phases. - * array of phases for this subscription - * - * @maps phases - * - * @param Phase[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases = $phases; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->planVariationId)) { - $json['plan_variation_id'] = $this->planVariationId; - } - if (isset($this->customerId)) { - $json['customer_id'] = $this->customerId; - } - if (isset($this->startDate)) { - $json['start_date'] = $this->startDate; - } - if (!empty($this->canceledDate)) { - $json['canceled_date'] = $this->canceledDate['value']; - } - if (isset($this->chargedThroughDate)) { - $json['charged_through_date'] = $this->chargedThroughDate; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->taxPercentage)) { - $json['tax_percentage'] = $this->taxPercentage['value']; - } - if (isset($this->invoiceIds)) { - $json['invoice_ids'] = $this->invoiceIds; - } - if (isset($this->priceOverrideMoney)) { - $json['price_override_money'] = $this->priceOverrideMoney; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->cardId)) { - $json['card_id'] = $this->cardId['value']; - } - if (isset($this->timezone)) { - $json['timezone'] = $this->timezone; - } - if (isset($this->source)) { - $json['source'] = $this->source; - } - if (!empty($this->actions)) { - $json['actions'] = $this->actions['value']; - } - if (isset($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate; - } - if (isset($this->phases)) { - $json['phases'] = $this->phases; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionAction.php b/src/Models/SubscriptionAction.php deleted file mode 100644 index 2a95f272..00000000 --- a/src/Models/SubscriptionAction.php +++ /dev/null @@ -1,252 +0,0 @@ -id; - } - - /** - * Sets Id. - * The ID of an action scoped to a subscription. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Type. - * Supported types of an action as a pending change to a subscription. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Supported types of an action as a pending change to a subscription. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Effective Date. - * The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. - */ - public function getEffectiveDate(): ?string - { - if (count($this->effectiveDate) == 0) { - return null; - } - return $this->effectiveDate['value']; - } - - /** - * Sets Effective Date. - * The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. - * - * @maps effective_date - */ - public function setEffectiveDate(?string $effectiveDate): void - { - $this->effectiveDate['value'] = $effectiveDate; - } - - /** - * Unsets Effective Date. - * The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. - */ - public function unsetEffectiveDate(): void - { - $this->effectiveDate = []; - } - - /** - * Returns Monthly Billing Anchor Date. - * The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. - */ - public function getMonthlyBillingAnchorDate(): ?int - { - if (count($this->monthlyBillingAnchorDate) == 0) { - return null; - } - return $this->monthlyBillingAnchorDate['value']; - } - - /** - * Sets Monthly Billing Anchor Date. - * The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate['value'] = $monthlyBillingAnchorDate; - } - - /** - * Unsets Monthly Billing Anchor Date. - * The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. - */ - public function unsetMonthlyBillingAnchorDate(): void - { - $this->monthlyBillingAnchorDate = []; - } - - /** - * Returns Phases. - * A list of Phases, to pass phase-specific information used in the swap. - * - * @return Phase[]|null - */ - public function getPhases(): ?array - { - if (count($this->phases) == 0) { - return null; - } - return $this->phases['value']; - } - - /** - * Sets Phases. - * A list of Phases, to pass phase-specific information used in the swap. - * - * @maps phases - * - * @param Phase[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases['value'] = $phases; - } - - /** - * Unsets Phases. - * A list of Phases, to pass phase-specific information used in the swap. - */ - public function unsetPhases(): void - { - $this->phases = []; - } - - /** - * Returns New Plan Variation Id. - * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. - */ - public function getNewPlanVariationId(): ?string - { - if (count($this->newPlanVariationId) == 0) { - return null; - } - return $this->newPlanVariationId['value']; - } - - /** - * Sets New Plan Variation Id. - * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. - * - * @maps new_plan_variation_id - */ - public function setNewPlanVariationId(?string $newPlanVariationId): void - { - $this->newPlanVariationId['value'] = $newPlanVariationId; - } - - /** - * Unsets New Plan Variation Id. - * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. - */ - public function unsetNewPlanVariationId(): void - { - $this->newPlanVariationId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->effectiveDate)) { - $json['effective_date'] = $this->effectiveDate['value']; - } - if (!empty($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate['value']; - } - if (!empty($this->phases)) { - $json['phases'] = $this->phases['value']; - } - if (!empty($this->newPlanVariationId)) { - $json['new_plan_variation_id'] = $this->newPlanVariationId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionActionType.php b/src/Models/SubscriptionActionType.php deleted file mode 100644 index bc6f2646..00000000 --- a/src/Models/SubscriptionActionType.php +++ /dev/null @@ -1,36 +0,0 @@ -id = $id; - $this->subscriptionEventType = $subscriptionEventType; - $this->effectiveDate = $effectiveDate; - $this->planVariationId = $planVariationId; - } - - /** - * Returns Id. - * The ID of the subscription event. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * The ID of the subscription event. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Subscription Event Type. - * Supported types of an event occurred to a subscription. - */ - public function getSubscriptionEventType(): string - { - return $this->subscriptionEventType; - } - - /** - * Sets Subscription Event Type. - * Supported types of an event occurred to a subscription. - * - * @required - * @maps subscription_event_type - */ - public function setSubscriptionEventType(string $subscriptionEventType): void - { - $this->subscriptionEventType = $subscriptionEventType; - } - - /** - * Returns Effective Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. - */ - public function getEffectiveDate(): string - { - return $this->effectiveDate; - } - - /** - * Sets Effective Date. - * The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. - * - * @required - * @maps effective_date - */ - public function setEffectiveDate(string $effectiveDate): void - { - $this->effectiveDate = $effectiveDate; - } - - /** - * Returns Monthly Billing Anchor Date. - * The day-of-the-month the billing anchor date was changed to, if applicable. - */ - public function getMonthlyBillingAnchorDate(): ?int - { - return $this->monthlyBillingAnchorDate; - } - - /** - * Sets Monthly Billing Anchor Date. - * The day-of-the-month the billing anchor date was changed to, if applicable. - * - * @maps monthly_billing_anchor_date - */ - public function setMonthlyBillingAnchorDate(?int $monthlyBillingAnchorDate): void - { - $this->monthlyBillingAnchorDate = $monthlyBillingAnchorDate; - } - - /** - * Returns Info. - * Provides information about the subscription event. - */ - public function getInfo(): ?SubscriptionEventInfo - { - return $this->info; - } - - /** - * Sets Info. - * Provides information about the subscription event. - * - * @maps info - */ - public function setInfo(?SubscriptionEventInfo $info): void - { - $this->info = $info; - } - - /** - * Returns Phases. - * A list of Phases, to pass phase-specific information used in the swap. - * - * @return Phase[]|null - */ - public function getPhases(): ?array - { - if (count($this->phases) == 0) { - return null; - } - return $this->phases['value']; - } - - /** - * Sets Phases. - * A list of Phases, to pass phase-specific information used in the swap. - * - * @maps phases - * - * @param Phase[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases['value'] = $phases; - } - - /** - * Unsets Phases. - * A list of Phases, to pass phase-specific information used in the swap. - */ - public function unsetPhases(): void - { - $this->phases = []; - } - - /** - * Returns Plan Variation Id. - * The ID of the subscription plan variation associated with the subscription. - */ - public function getPlanVariationId(): string - { - return $this->planVariationId; - } - - /** - * Sets Plan Variation Id. - * The ID of the subscription plan variation associated with the subscription. - * - * @required - * @maps plan_variation_id - */ - public function setPlanVariationId(string $planVariationId): void - { - $this->planVariationId = $planVariationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['subscription_event_type'] = $this->subscriptionEventType; - $json['effective_date'] = $this->effectiveDate; - if (isset($this->monthlyBillingAnchorDate)) { - $json['monthly_billing_anchor_date'] = $this->monthlyBillingAnchorDate; - } - if (isset($this->info)) { - $json['info'] = $this->info; - } - if (!empty($this->phases)) { - $json['phases'] = $this->phases['value']; - } - $json['plan_variation_id'] = $this->planVariationId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionEventInfo.php b/src/Models/SubscriptionEventInfo.php deleted file mode 100644 index 1d9e3a0d..00000000 --- a/src/Models/SubscriptionEventInfo.php +++ /dev/null @@ -1,100 +0,0 @@ -detail) == 0) { - return null; - } - return $this->detail['value']; - } - - /** - * Sets Detail. - * A human-readable explanation for the event. - * - * @maps detail - */ - public function setDetail(?string $detail): void - { - $this->detail['value'] = $detail; - } - - /** - * Unsets Detail. - * A human-readable explanation for the event. - */ - public function unsetDetail(): void - { - $this->detail = []; - } - - /** - * Returns Code. - * Supported info codes of a subscription event. - */ - public function getCode(): ?string - { - return $this->code; - } - - /** - * Sets Code. - * Supported info codes of a subscription event. - * - * @maps code - */ - public function setCode(?string $code): void - { - $this->code = $code; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->detail)) { - $json['detail'] = $this->detail['value']; - } - if (isset($this->code)) { - $json['code'] = $this->code; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionEventInfoCode.php b/src/Models/SubscriptionEventInfoCode.php deleted file mode 100644 index e31e238d..00000000 --- a/src/Models/SubscriptionEventInfoCode.php +++ /dev/null @@ -1,41 +0,0 @@ -cadence = $cadence; - } - - /** - * Returns Uid. - * The Square-assigned ID of the subscription phase. This field cannot be changed after a - * `SubscriptionPhase` is created. - */ - public function getUid(): ?string - { - if (count($this->uid) == 0) { - return null; - } - return $this->uid['value']; - } - - /** - * Sets Uid. - * The Square-assigned ID of the subscription phase. This field cannot be changed after a - * `SubscriptionPhase` is created. - * - * @maps uid - */ - public function setUid(?string $uid): void - { - $this->uid['value'] = $uid; - } - - /** - * Unsets Uid. - * The Square-assigned ID of the subscription phase. This field cannot be changed after a - * `SubscriptionPhase` is created. - */ - public function unsetUid(): void - { - $this->uid = []; - } - - /** - * Returns Cadence. - * Determines the billing cadence of a [Subscription]($m/Subscription) - */ - public function getCadence(): string - { - return $this->cadence; - } - - /** - * Sets Cadence. - * Determines the billing cadence of a [Subscription]($m/Subscription) - * - * @required - * @maps cadence - */ - public function setCadence(string $cadence): void - { - $this->cadence = $cadence; - } - - /** - * Returns Periods. - * The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can - * be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. - */ - public function getPeriods(): ?int - { - if (count($this->periods) == 0) { - return null; - } - return $this->periods['value']; - } - - /** - * Sets Periods. - * The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can - * be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. - * - * @maps periods - */ - public function setPeriods(?int $periods): void - { - $this->periods['value'] = $periods; - } - - /** - * Unsets Periods. - * The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can - * be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. - */ - public function unsetPeriods(): void - { - $this->periods = []; - } - - /** - * Returns Recurring Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getRecurringPriceMoney(): ?Money - { - return $this->recurringPriceMoney; - } - - /** - * Sets Recurring Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps recurring_price_money - */ - public function setRecurringPriceMoney(?Money $recurringPriceMoney): void - { - $this->recurringPriceMoney = $recurringPriceMoney; - } - - /** - * Returns Ordinal. - * The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This - * field cannot be changed after a `SubscriptionPhase` is created. - */ - public function getOrdinal(): ?int - { - if (count($this->ordinal) == 0) { - return null; - } - return $this->ordinal['value']; - } - - /** - * Sets Ordinal. - * The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This - * field cannot be changed after a `SubscriptionPhase` is created. - * - * @maps ordinal - */ - public function setOrdinal(?int $ordinal): void - { - $this->ordinal['value'] = $ordinal; - } - - /** - * Unsets Ordinal. - * The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This - * field cannot be changed after a `SubscriptionPhase` is created. - */ - public function unsetOrdinal(): void - { - $this->ordinal = []; - } - - /** - * Returns Pricing. - * Describes the pricing for the subscription. - */ - public function getPricing(): ?SubscriptionPricing - { - return $this->pricing; - } - - /** - * Sets Pricing. - * Describes the pricing for the subscription. - * - * @maps pricing - */ - public function setPricing(?SubscriptionPricing $pricing): void - { - $this->pricing = $pricing; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->uid)) { - $json['uid'] = $this->uid['value']; - } - $json['cadence'] = $this->cadence; - if (!empty($this->periods)) { - $json['periods'] = $this->periods['value']; - } - if (isset($this->recurringPriceMoney)) { - $json['recurring_price_money'] = $this->recurringPriceMoney; - } - if (!empty($this->ordinal)) { - $json['ordinal'] = $this->ordinal['value']; - } - if (isset($this->pricing)) { - $json['pricing'] = $this->pricing; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionPricing.php b/src/Models/SubscriptionPricing.php deleted file mode 100644 index e715fd14..00000000 --- a/src/Models/SubscriptionPricing.php +++ /dev/null @@ -1,144 +0,0 @@ -type; - } - - /** - * Sets Type. - * Determines the pricing of a [Subscription]($m/Subscription) - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Discount Ids. - * The ids of the discount catalog objects - * - * @return string[]|null - */ - public function getDiscountIds(): ?array - { - if (count($this->discountIds) == 0) { - return null; - } - return $this->discountIds['value']; - } - - /** - * Sets Discount Ids. - * The ids of the discount catalog objects - * - * @maps discount_ids - * - * @param string[]|null $discountIds - */ - public function setDiscountIds(?array $discountIds): void - { - $this->discountIds['value'] = $discountIds; - } - - /** - * Unsets Discount Ids. - * The ids of the discount catalog objects - */ - public function unsetDiscountIds(): void - { - $this->discountIds = []; - } - - /** - * Returns Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getPriceMoney(): ?Money - { - return $this->priceMoney; - } - - /** - * Sets Price Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps price_money - */ - public function setPriceMoney(?Money $priceMoney): void - { - $this->priceMoney = $priceMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->discountIds)) { - $json['discount_ids'] = $this->discountIds['value']; - } - if (isset($this->priceMoney)) { - $json['price_money'] = $this->priceMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionPricingType.php b/src/Models/SubscriptionPricingType.php deleted file mode 100644 index 10a2f1da..00000000 --- a/src/Models/SubscriptionPricingType.php +++ /dev/null @@ -1,21 +0,0 @@ -name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name used to identify the place (physical or digital) that - * a subscription originates. If unset, the name defaults to the name - * of the application that created the subscription. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name used to identify the place (physical or digital) that - * a subscription originates. If unset, the name defaults to the name - * of the application that created the subscription. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SubscriptionStatus.php b/src/Models/SubscriptionStatus.php deleted file mode 100644 index 4b23c877..00000000 --- a/src/Models/SubscriptionStatus.php +++ /dev/null @@ -1,36 +0,0 @@ -id; - } - - /** - * Sets Id. - * A Square-generated unique ID for the subscription test result. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Status Code. - * The status code returned by the subscription notification URL. - */ - public function getStatusCode(): ?int - { - if (count($this->statusCode) == 0) { - return null; - } - return $this->statusCode['value']; - } - - /** - * Sets Status Code. - * The status code returned by the subscription notification URL. - * - * @maps status_code - */ - public function setStatusCode(?int $statusCode): void - { - $this->statusCode['value'] = $statusCode; - } - - /** - * Unsets Status Code. - * The status code returned by the subscription notification URL. - */ - public function unsetStatusCode(): void - { - $this->statusCode = []; - } - - /** - * Returns Payload. - * An object containing the payload of the test event. For example, a `payment.created` event. - */ - public function getPayload(): ?string - { - if (count($this->payload) == 0) { - return null; - } - return $this->payload['value']; - } - - /** - * Sets Payload. - * An object containing the payload of the test event. For example, a `payment.created` event. - * - * @maps payload - */ - public function setPayload(?string $payload): void - { - $this->payload['value'] = $payload; - } - - /** - * Unsets Payload. - * An object containing the payload of the test event. For example, a `payment.created` event. - */ - public function unsetPayload(): void - { - $this->payload = []; - } - - /** - * Returns Created At. - * The timestamp of when the subscription was created, in RFC 3339 format. - * For example, "2016-09-04T23:59:33.123Z". - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the subscription was created, in RFC 3339 format. - * For example, "2016-09-04T23:59:33.123Z". - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the subscription was updated, in RFC 3339 format. For example, "2016-09-04T23: - * 59:33.123Z". - * Because a subscription test result is unique, this field is the same as the `created_at` field. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the subscription was updated, in RFC 3339 format. For example, "2016-09-04T23: - * 59:33.123Z". - * Because a subscription test result is unique, this field is the same as the `created_at` field. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->statusCode)) { - $json['status_code'] = $this->statusCode['value']; - } - if (!empty($this->payload)) { - $json['payload'] = $this->payload['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SwapPlanRequest.php b/src/Models/SwapPlanRequest.php deleted file mode 100644 index 28bae885..00000000 --- a/src/Models/SwapPlanRequest.php +++ /dev/null @@ -1,123 +0,0 @@ -newPlanVariationId) == 0) { - return null; - } - return $this->newPlanVariationId['value']; - } - - /** - * Sets New Plan Variation Id. - * The ID of the new subscription plan variation. - * - * This field is required. - * - * @maps new_plan_variation_id - */ - public function setNewPlanVariationId(?string $newPlanVariationId): void - { - $this->newPlanVariationId['value'] = $newPlanVariationId; - } - - /** - * Unsets New Plan Variation Id. - * The ID of the new subscription plan variation. - * - * This field is required. - */ - public function unsetNewPlanVariationId(): void - { - $this->newPlanVariationId = []; - } - - /** - * Returns Phases. - * A list of PhaseInputs, to pass phase-specific information used in the swap. - * - * @return PhaseInput[]|null - */ - public function getPhases(): ?array - { - if (count($this->phases) == 0) { - return null; - } - return $this->phases['value']; - } - - /** - * Sets Phases. - * A list of PhaseInputs, to pass phase-specific information used in the swap. - * - * @maps phases - * - * @param PhaseInput[]|null $phases - */ - public function setPhases(?array $phases): void - { - $this->phases['value'] = $phases; - } - - /** - * Unsets Phases. - * A list of PhaseInputs, to pass phase-specific information used in the swap. - */ - public function unsetPhases(): void - { - $this->phases = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->newPlanVariationId)) { - $json['new_plan_variation_id'] = $this->newPlanVariationId['value']; - } - if (!empty($this->phases)) { - $json['phases'] = $this->phases['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/SwapPlanResponse.php b/src/Models/SwapPlanResponse.php deleted file mode 100644 index 8b2e5c31..00000000 --- a/src/Models/SwapPlanResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Returns Actions. - * A list of a `SWAP_PLAN` action created by the request. - * - * @return SubscriptionAction[]|null - */ - public function getActions(): ?array - { - return $this->actions; - } - - /** - * Sets Actions. - * A list of a `SWAP_PLAN` action created by the request. - * - * @maps actions - * - * @param SubscriptionAction[]|null $actions - */ - public function setActions(?array $actions): void - { - $this->actions = $actions; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - if (isset($this->actions)) { - $json['actions'] = $this->actions; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TaxCalculationPhase.php b/src/Models/TaxCalculationPhase.php deleted file mode 100644 index 21d7b355..00000000 --- a/src/Models/TaxCalculationPhase.php +++ /dev/null @@ -1,21 +0,0 @@ -euVat; - } - - /** - * Sets Eu Vat. - * The EU VAT number for this location. For example, `IE3426675K`. - * If the EU VAT number is present, it is well-formed and has been - * validated with VIES, the VAT Information Exchange System. - * - * @maps eu_vat - */ - public function setEuVat(?string $euVat): void - { - $this->euVat = $euVat; - } - - /** - * Returns Fr Siret. - * The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements) - * number is a 14-digit code issued by the French INSEE. For example, `39922799000021`. - */ - public function getFrSiret(): ?string - { - return $this->frSiret; - } - - /** - * Sets Fr Siret. - * The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements) - * number is a 14-digit code issued by the French INSEE. For example, `39922799000021`. - * - * @maps fr_siret - */ - public function setFrSiret(?string $frSiret): void - { - $this->frSiret = $frSiret; - } - - /** - * Returns Fr Naf. - * The French government uses the NAF (Nomenclature des Activités Françaises) to display and - * track economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) - * code. - * For example, `6910Z`. - */ - public function getFrNaf(): ?string - { - return $this->frNaf; - } - - /** - * Sets Fr Naf. - * The French government uses the NAF (Nomenclature des Activités Françaises) to display and - * track economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) - * code. - * For example, `6910Z`. - * - * @maps fr_naf - */ - public function setFrNaf(?string $frNaf): void - { - $this->frNaf = $frNaf; - } - - /** - * Returns Es Nif. - * The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain. - * If it is present, it has been validated. For example, `73628495A`. - */ - public function getEsNif(): ?string - { - return $this->esNif; - } - - /** - * Sets Es Nif. - * The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain. - * If it is present, it has been validated. For example, `73628495A`. - * - * @maps es_nif - */ - public function setEsNif(?string $esNif): void - { - $this->esNif = $esNif; - } - - /** - * Returns Jp Qii. - * The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan. - * For example, `T1234567890123`. - */ - public function getJpQii(): ?string - { - return $this->jpQii; - } - - /** - * Sets Jp Qii. - * The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan. - * For example, `T1234567890123`. - * - * @maps jp_qii - */ - public function setJpQii(?string $jpQii): void - { - $this->jpQii = $jpQii; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->euVat)) { - $json['eu_vat'] = $this->euVat; - } - if (isset($this->frSiret)) { - $json['fr_siret'] = $this->frSiret; - } - if (isset($this->frNaf)) { - $json['fr_naf'] = $this->frNaf; - } - if (isset($this->esNif)) { - $json['es_nif'] = $this->esNif; - } - if (isset($this->jpQii)) { - $json['jp_qii'] = $this->jpQii; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TaxInclusionType.php b/src/Models/TaxInclusionType.php deleted file mode 100644 index 33be2834..00000000 --- a/src/Models/TaxInclusionType.php +++ /dev/null @@ -1,26 +0,0 @@ -id; - } - - /** - * Sets Id. - * The unique ID for the team member. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Reference Id. - * A second ID used to associate the team member with an entity in another system. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * A second ID used to associate the team member with an entity in another system. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * A second ID used to associate the team member with an entity in another system. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Is Owner. - * Whether the team member is the owner of the Square account. - */ - public function getIsOwner(): ?bool - { - return $this->isOwner; - } - - /** - * Sets Is Owner. - * Whether the team member is the owner of the Square account. - * - * @maps is_owner - */ - public function setIsOwner(?bool $isOwner): void - { - $this->isOwner = $isOwner; - } - - /** - * Returns Status. - * Enumerates the possible statuses the team member can have within a business. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * Enumerates the possible statuses the team member can have within a business. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Given Name. - * The given name (that is, the first name) associated with the team member. - */ - public function getGivenName(): ?string - { - if (count($this->givenName) == 0) { - return null; - } - return $this->givenName['value']; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the team member. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName['value'] = $givenName; - } - - /** - * Unsets Given Name. - * The given name (that is, the first name) associated with the team member. - */ - public function unsetGivenName(): void - { - $this->givenName = []; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the team member. - */ - public function getFamilyName(): ?string - { - if (count($this->familyName) == 0) { - return null; - } - return $this->familyName['value']; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the team member. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName['value'] = $familyName; - } - - /** - * Unsets Family Name. - * The family name (that is, the last name) associated with the team member. - */ - public function unsetFamilyName(): void - { - $this->familyName = []; - } - - /** - * Returns Email Address. - * The email address associated with the team member. After accepting the invitation - * from Square, only the team member can change this value. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address associated with the team member. After accepting the invitation - * from Square, only the team member can change this value. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address associated with the team member. After accepting the invitation - * from Square, only the team member can change this value. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Phone Number. - * The team member's phone number, in E.164 format. For example: - * +14155552671 - the country code is 1 for US - * +551155256325 - the country code is 55 for BR - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The team member's phone number, in E.164 format. For example: - * +14155552671 - the country code is 1 for US - * +551155256325 - the country code is 55 for BR - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The team member's phone number, in E.164 format. For example: - * +14155552671 - the country code is 1 for US - * +551155256325 - the country code is 55 for BR - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Created At. - * The timestamp when the team member was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the team member was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the team member was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the team member was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Assigned Locations. - * An object that represents a team member's assignment to locations. - */ - public function getAssignedLocations(): ?TeamMemberAssignedLocations - { - return $this->assignedLocations; - } - - /** - * Sets Assigned Locations. - * An object that represents a team member's assignment to locations. - * - * @maps assigned_locations - */ - public function setAssignedLocations(?TeamMemberAssignedLocations $assignedLocations): void - { - $this->assignedLocations = $assignedLocations; - } - - /** - * Returns Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - */ - public function getWageSetting(): ?WageSetting - { - return $this->wageSetting; - } - - /** - * Sets Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - * - * @maps wage_setting - */ - public function setWageSetting(?WageSetting $wageSetting): void - { - $this->wageSetting = $wageSetting; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->isOwner)) { - $json['is_owner'] = $this->isOwner; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (!empty($this->givenName)) { - $json['given_name'] = $this->givenName['value']; - } - if (!empty($this->familyName)) { - $json['family_name'] = $this->familyName['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->assignedLocations)) { - $json['assigned_locations'] = $this->assignedLocations; - } - if (isset($this->wageSetting)) { - $json['wage_setting'] = $this->wageSetting; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TeamMemberAssignedLocations.php b/src/Models/TeamMemberAssignedLocations.php deleted file mode 100644 index bd3c53da..00000000 --- a/src/Models/TeamMemberAssignedLocations.php +++ /dev/null @@ -1,104 +0,0 @@ -assignmentType; - } - - /** - * Sets Assignment Type. - * Enumerates the possible assignment types that the team member can have. - * - * @maps assignment_type - */ - public function setAssignmentType(?string $assignmentType): void - { - $this->assignmentType = $assignmentType; - } - - /** - * Returns Location Ids. - * The explicit locations that the team member is assigned to. - * - * @return string[]|null - */ - public function getLocationIds(): ?array - { - if (count($this->locationIds) == 0) { - return null; - } - return $this->locationIds['value']; - } - - /** - * Sets Location Ids. - * The explicit locations that the team member is assigned to. - * - * @maps location_ids - * - * @param string[]|null $locationIds - */ - public function setLocationIds(?array $locationIds): void - { - $this->locationIds['value'] = $locationIds; - } - - /** - * Unsets Location Ids. - * The explicit locations that the team member is assigned to. - */ - public function unsetLocationIds(): void - { - $this->locationIds = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->assignmentType)) { - $json['assignment_type'] = $this->assignmentType; - } - if (!empty($this->locationIds)) { - $json['location_ids'] = $this->locationIds['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TeamMemberAssignedLocationsAssignmentType.php b/src/Models/TeamMemberAssignedLocationsAssignmentType.php deleted file mode 100644 index c433dc1e..00000000 --- a/src/Models/TeamMemberAssignedLocationsAssignmentType.php +++ /dev/null @@ -1,23 +0,0 @@ -teamMemberId; - } - - /** - * Sets Team Member Id. - * The ID of the [TeamMember](entity:TeamMember) object for the team member associated with the booking - * profile. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId = $teamMemberId; - } - - /** - * Returns Description. - * The description of the team member. - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * Sets Description. - * The description of the team member. - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description = $description; - } - - /** - * Returns Display Name. - * The display name of the team member. - */ - public function getDisplayName(): ?string - { - return $this->displayName; - } - - /** - * Sets Display Name. - * The display name of the team member. - * - * @maps display_name - */ - public function setDisplayName(?string $displayName): void - { - $this->displayName = $displayName; - } - - /** - * Returns Is Bookable. - * Indicates whether the team member can be booked through the Bookings API or the seller's online - * booking channel or site (`true`) or not (`false`). - */ - public function getIsBookable(): ?bool - { - if (count($this->isBookable) == 0) { - return null; - } - return $this->isBookable['value']; - } - - /** - * Sets Is Bookable. - * Indicates whether the team member can be booked through the Bookings API or the seller's online - * booking channel or site (`true`) or not (`false`). - * - * @maps is_bookable - */ - public function setIsBookable(?bool $isBookable): void - { - $this->isBookable['value'] = $isBookable; - } - - /** - * Unsets Is Bookable. - * Indicates whether the team member can be booked through the Bookings API or the seller's online - * booking channel or site (`true`) or not (`false`). - */ - public function unsetIsBookable(): void - { - $this->isBookable = []; - } - - /** - * Returns Profile Image Url. - * The URL of the team member's image for the bookings profile. - */ - public function getProfileImageUrl(): ?string - { - return $this->profileImageUrl; - } - - /** - * Sets Profile Image Url. - * The URL of the team member's image for the bookings profile. - * - * @maps profile_image_url - */ - public function setProfileImageUrl(?string $profileImageUrl): void - { - $this->profileImageUrl = $profileImageUrl; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId; - } - if (isset($this->description)) { - $json['description'] = $this->description; - } - if (isset($this->displayName)) { - $json['display_name'] = $this->displayName; - } - if (!empty($this->isBookable)) { - $json['is_bookable'] = $this->isBookable['value']; - } - if (isset($this->profileImageUrl)) { - $json['profile_image_url'] = $this->profileImageUrl; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TeamMemberInvitationStatus.php b/src/Models/TeamMemberInvitationStatus.php deleted file mode 100644 index 76aebd29..00000000 --- a/src/Models/TeamMemberInvitationStatus.php +++ /dev/null @@ -1,26 +0,0 @@ -id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Team Member Id. - * The `TeamMember` that this wage is assigned to. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The `TeamMember` that this wage is assigned to. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The `TeamMember` that this wage is assigned to. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Title. - * The job title that this wage relates to. - */ - public function getTitle(): ?string - { - if (count($this->title) == 0) { - return null; - } - return $this->title['value']; - } - - /** - * Sets Title. - * The job title that this wage relates to. - * - * @maps title - */ - public function setTitle(?string $title): void - { - $this->title['value'] = $title; - } - - /** - * Unsets Title. - * The job title that this wage relates to. - */ - public function unsetTitle(): void - { - $this->title = []; - } - - /** - * Returns Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getHourlyRate(): ?Money - { - return $this->hourlyRate; - } - - /** - * Sets Hourly Rate. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps hourly_rate - */ - public function setHourlyRate(?Money $hourlyRate): void - { - $this->hourlyRate = $hourlyRate; - } - - /** - * Returns Job Id. - * An identifier for the job that this wage relates to. This cannot be - * used to retrieve the job. - */ - public function getJobId(): ?string - { - if (count($this->jobId) == 0) { - return null; - } - return $this->jobId['value']; - } - - /** - * Sets Job Id. - * An identifier for the job that this wage relates to. This cannot be - * used to retrieve the job. - * - * @maps job_id - */ - public function setJobId(?string $jobId): void - { - $this->jobId['value'] = $jobId; - } - - /** - * Unsets Job Id. - * An identifier for the job that this wage relates to. This cannot be - * used to retrieve the job. - */ - public function unsetJobId(): void - { - $this->jobId = []; - } - - /** - * Returns Tip Eligible. - * Whether team members are eligible for tips when working this job. - */ - public function getTipEligible(): ?bool - { - if (count($this->tipEligible) == 0) { - return null; - } - return $this->tipEligible['value']; - } - - /** - * Sets Tip Eligible. - * Whether team members are eligible for tips when working this job. - * - * @maps tip_eligible - */ - public function setTipEligible(?bool $tipEligible): void - { - $this->tipEligible['value'] = $tipEligible; - } - - /** - * Unsets Tip Eligible. - * Whether team members are eligible for tips when working this job. - */ - public function unsetTipEligible(): void - { - $this->tipEligible = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->title)) { - $json['title'] = $this->title['value']; - } - if (isset($this->hourlyRate)) { - $json['hourly_rate'] = $this->hourlyRate; - } - if (!empty($this->jobId)) { - $json['job_id'] = $this->jobId['value']; - } - if (!empty($this->tipEligible)) { - $json['tip_eligible'] = $this->tipEligible['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Tender.php b/src/Models/Tender.php deleted file mode 100644 index 9109918e..00000000 --- a/src/Models/Tender.php +++ /dev/null @@ -1,642 +0,0 @@ -type = $type; - } - - /** - * Returns Id. - * The tender's unique ID. It is the associated payment ID. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The tender's unique ID. It is the associated payment ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the transaction's associated location. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the transaction's associated location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the transaction's associated location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Transaction Id. - * The ID of the tender's associated transaction. - */ - public function getTransactionId(): ?string - { - if (count($this->transactionId) == 0) { - return null; - } - return $this->transactionId['value']; - } - - /** - * Sets Transaction Id. - * The ID of the tender's associated transaction. - * - * @maps transaction_id - */ - public function setTransactionId(?string $transactionId): void - { - $this->transactionId['value'] = $transactionId; - } - - /** - * Unsets Transaction Id. - * The ID of the tender's associated transaction. - */ - public function unsetTransactionId(): void - { - $this->transactionId = []; - } - - /** - * Returns Created At. - * The timestamp for when the tender was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the tender was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Note. - * An optional note associated with the tender at the time of payment. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * An optional note associated with the tender at the time of payment. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * An optional note associated with the tender at the time of payment. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): ?Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps amount_money - */ - public function setAmountMoney(?Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTipMoney(): ?Money - { - return $this->tipMoney; - } - - /** - * Sets Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tip_money - */ - public function setTipMoney(?Money $tipMoney): void - { - $this->tipMoney = $tipMoney; - } - - /** - * Returns Processing Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getProcessingFeeMoney(): ?Money - { - return $this->processingFeeMoney; - } - - /** - * Sets Processing Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps processing_fee_money - */ - public function setProcessingFeeMoney(?Money $processingFeeMoney): void - { - $this->processingFeeMoney = $processingFeeMoney; - } - - /** - * Returns Customer Id. - * If the tender is associated with a customer or represents a customer's card on file, - * this is the ID of the associated customer. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * If the tender is associated with a customer or represents a customer's card on file, - * this is the ID of the associated customer. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * If the tender is associated with a customer or represents a customer's card on file, - * this is the ID of the associated customer. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns Type. - * Indicates a tender's type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * Indicates a tender's type. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Card Details. - * Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` - */ - public function getCardDetails(): ?TenderCardDetails - { - return $this->cardDetails; - } - - /** - * Sets Card Details. - * Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` - * - * @maps card_details - */ - public function setCardDetails(?TenderCardDetails $cardDetails): void - { - $this->cardDetails = $cardDetails; - } - - /** - * Returns Cash Details. - * Represents the details of a tender with `type` `CASH`. - */ - public function getCashDetails(): ?TenderCashDetails - { - return $this->cashDetails; - } - - /** - * Sets Cash Details. - * Represents the details of a tender with `type` `CASH`. - * - * @maps cash_details - */ - public function setCashDetails(?TenderCashDetails $cashDetails): void - { - $this->cashDetails = $cashDetails; - } - - /** - * Returns Bank Account Details. - * Represents the details of a tender with `type` `BANK_ACCOUNT`. - * - * See [BankAccountPaymentDetails]($m/BankAccountPaymentDetails) - * for more exposed details of a bank account payment. - */ - public function getBankAccountDetails(): ?TenderBankAccountDetails - { - return $this->bankAccountDetails; - } - - /** - * Sets Bank Account Details. - * Represents the details of a tender with `type` `BANK_ACCOUNT`. - * - * See [BankAccountPaymentDetails]($m/BankAccountPaymentDetails) - * for more exposed details of a bank account payment. - * - * @maps bank_account_details - */ - public function setBankAccountDetails(?TenderBankAccountDetails $bankAccountDetails): void - { - $this->bankAccountDetails = $bankAccountDetails; - } - - /** - * Returns Buy Now Pay Later Details. - * Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. - */ - public function getBuyNowPayLaterDetails(): ?TenderBuyNowPayLaterDetails - { - return $this->buyNowPayLaterDetails; - } - - /** - * Sets Buy Now Pay Later Details. - * Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. - * - * @maps buy_now_pay_later_details - */ - public function setBuyNowPayLaterDetails(?TenderBuyNowPayLaterDetails $buyNowPayLaterDetails): void - { - $this->buyNowPayLaterDetails = $buyNowPayLaterDetails; - } - - /** - * Returns Square Account Details. - * Represents the details of a tender with `type` `SQUARE_ACCOUNT`. - */ - public function getSquareAccountDetails(): ?TenderSquareAccountDetails - { - return $this->squareAccountDetails; - } - - /** - * Sets Square Account Details. - * Represents the details of a tender with `type` `SQUARE_ACCOUNT`. - * - * @maps square_account_details - */ - public function setSquareAccountDetails(?TenderSquareAccountDetails $squareAccountDetails): void - { - $this->squareAccountDetails = $squareAccountDetails; - } - - /** - * Returns Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this tender. - * For example, fees assessed on the purchase by a third party integration. - * - * @return AdditionalRecipient[]|null - */ - public function getAdditionalRecipients(): ?array - { - if (count($this->additionalRecipients) == 0) { - return null; - } - return $this->additionalRecipients['value']; - } - - /** - * Sets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this tender. - * For example, fees assessed on the purchase by a third party integration. - * - * @maps additional_recipients - * - * @param AdditionalRecipient[]|null $additionalRecipients - */ - public function setAdditionalRecipients(?array $additionalRecipients): void - { - $this->additionalRecipients['value'] = $additionalRecipients; - } - - /** - * Unsets Additional Recipients. - * Additional recipients (other than the merchant) receiving a portion of this tender. - * For example, fees assessed on the purchase by a third party integration. - */ - public function unsetAdditionalRecipients(): void - { - $this->additionalRecipients = []; - } - - /** - * Returns Payment Id. - * The ID of the [Payment](entity:Payment) that corresponds to this tender. - * This value is only present for payments created with the v2 Payments API. - */ - public function getPaymentId(): ?string - { - if (count($this->paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The ID of the [Payment](entity:Payment) that corresponds to this tender. - * This value is only present for payments created with the v2 Payments API. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The ID of the [Payment](entity:Payment) that corresponds to this tender. - * This value is only present for payments created with the v2 Payments API. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (!empty($this->transactionId)) { - $json['transaction_id'] = $this->transactionId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; - } - if (isset($this->tipMoney)) { - $json['tip_money'] = $this->tipMoney; - } - if (isset($this->processingFeeMoney)) { - $json['processing_fee_money'] = $this->processingFeeMoney; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - $json['type'] = $this->type; - if (isset($this->cardDetails)) { - $json['card_details'] = $this->cardDetails; - } - if (isset($this->cashDetails)) { - $json['cash_details'] = $this->cashDetails; - } - if (isset($this->bankAccountDetails)) { - $json['bank_account_details'] = $this->bankAccountDetails; - } - if (isset($this->buyNowPayLaterDetails)) { - $json['buy_now_pay_later_details'] = $this->buyNowPayLaterDetails; - } - if (isset($this->squareAccountDetails)) { - $json['square_account_details'] = $this->squareAccountDetails; - } - if (!empty($this->additionalRecipients)) { - $json['additional_recipients'] = $this->additionalRecipients['value']; - } - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderBankAccountDetails.php b/src/Models/TenderBankAccountDetails.php deleted file mode 100644 index 22c08c05..00000000 --- a/src/Models/TenderBankAccountDetails.php +++ /dev/null @@ -1,63 +0,0 @@ -status; - } - - /** - * Sets Status. - * Indicates the bank account payment's current status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderBankAccountDetailsStatus.php b/src/Models/TenderBankAccountDetailsStatus.php deleted file mode 100644 index 54cbea11..00000000 --- a/src/Models/TenderBankAccountDetailsStatus.php +++ /dev/null @@ -1,26 +0,0 @@ -buyNowPayLaterBrand; - } - - /** - * Sets Buy Now Pay Later Brand. - * - * @maps buy_now_pay_later_brand - */ - public function setBuyNowPayLaterBrand(?string $buyNowPayLaterBrand): void - { - $this->buyNowPayLaterBrand = $buyNowPayLaterBrand; - } - - /** - * Returns Status. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->buyNowPayLaterBrand)) { - $json['buy_now_pay_later_brand'] = $this->buyNowPayLaterBrand; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderBuyNowPayLaterDetailsBrand.php b/src/Models/TenderBuyNowPayLaterDetailsBrand.php deleted file mode 100644 index fadb3fa6..00000000 --- a/src/Models/TenderBuyNowPayLaterDetailsBrand.php +++ /dev/null @@ -1,12 +0,0 @@ -status; - } - - /** - * Sets Status. - * Indicates the card transaction's current status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - */ - public function getCard(): ?Card - { - return $this->card; - } - - /** - * Sets Card. - * Represents the payment details of a card to be used for payments. These - * details are determined by the payment token generated by Web Payments SDK. - * - * @maps card - */ - public function setCard(?Card $card): void - { - $this->card = $card; - } - - /** - * Returns Entry Method. - * Indicates the method used to enter the card's details. - */ - public function getEntryMethod(): ?string - { - return $this->entryMethod; - } - - /** - * Sets Entry Method. - * Indicates the method used to enter the card's details. - * - * @maps entry_method - */ - public function setEntryMethod(?string $entryMethod): void - { - $this->entryMethod = $entryMethod; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->card)) { - $json['card'] = $this->card; - } - if (isset($this->entryMethod)) { - $json['entry_method'] = $this->entryMethod; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderCardDetailsEntryMethod.php b/src/Models/TenderCardDetailsEntryMethod.php deleted file mode 100644 index 20b8184b..00000000 --- a/src/Models/TenderCardDetailsEntryMethod.php +++ /dev/null @@ -1,38 +0,0 @@ -buyerTenderedMoney; - } - - /** - * Sets Buyer Tendered Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps buyer_tendered_money - */ - public function setBuyerTenderedMoney(?Money $buyerTenderedMoney): void - { - $this->buyerTenderedMoney = $buyerTenderedMoney; - } - - /** - * Returns Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getChangeBackMoney(): ?Money - { - return $this->changeBackMoney; - } - - /** - * Sets Change Back Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps change_back_money - */ - public function setChangeBackMoney(?Money $changeBackMoney): void - { - $this->changeBackMoney = $changeBackMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->buyerTenderedMoney)) { - $json['buyer_tendered_money'] = $this->buyerTenderedMoney; - } - if (isset($this->changeBackMoney)) { - $json['change_back_money'] = $this->changeBackMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderSquareAccountDetails.php b/src/Models/TenderSquareAccountDetails.php deleted file mode 100644 index 124ee848..00000000 --- a/src/Models/TenderSquareAccountDetails.php +++ /dev/null @@ -1,58 +0,0 @@ -status; - } - - /** - * Sets Status. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TenderSquareAccountDetailsStatus.php b/src/Models/TenderSquareAccountDetailsStatus.php deleted file mode 100644 index d1984818..00000000 --- a/src/Models/TenderSquareAccountDetailsStatus.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique ID for this `TerminalAction`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Device Id. - * The unique Id of the device intended for this `TerminalAction`. - * The Id can be retrieved from /v2/devices api. - */ - public function getDeviceId(): ?string - { - if (count($this->deviceId) == 0) { - return null; - } - return $this->deviceId['value']; - } - - /** - * Sets Device Id. - * The unique Id of the device intended for this `TerminalAction`. - * The Id can be retrieved from /v2/devices api. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId['value'] = $deviceId; - } - - /** - * Unsets Device Id. - * The unique Id of the device intended for this `TerminalAction`. - * The Id can be retrieved from /v2/devices api. - */ - public function unsetDeviceId(): void - { - $this->deviceId = []; - } - - /** - * Returns Deadline Duration. - * The duration as an RFC 3339 duration, after which the action will be automatically canceled. - * TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason - * of `TIMED_OUT` - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - */ - public function getDeadlineDuration(): ?string - { - if (count($this->deadlineDuration) == 0) { - return null; - } - return $this->deadlineDuration['value']; - } - - /** - * Sets Deadline Duration. - * The duration as an RFC 3339 duration, after which the action will be automatically canceled. - * TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason - * of `TIMED_OUT` - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - * - * @maps deadline_duration - */ - public function setDeadlineDuration(?string $deadlineDuration): void - { - $this->deadlineDuration['value'] = $deadlineDuration; - } - - /** - * Unsets Deadline Duration. - * The duration as an RFC 3339 duration, after which the action will be automatically canceled. - * TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason - * of `TIMED_OUT` - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - */ - public function unsetDeadlineDuration(): void - { - $this->deadlineDuration = []; - } - - /** - * Returns Status. - * The status of the `TerminalAction`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the `TerminalAction`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Cancel Reason. - */ - public function getCancelReason(): ?string - { - return $this->cancelReason; - } - - /** - * Sets Cancel Reason. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason = $cancelReason; - } - - /** - * Returns Created At. - * The time when the `TerminalAction` was created as an RFC 3339 timestamp. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the `TerminalAction` was created as an RFC 3339 timestamp. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns App Id. - * The ID of the application that created the action. - */ - public function getAppId(): ?string - { - return $this->appId; - } - - /** - * Sets App Id. - * The ID of the application that created the action. - * - * @maps app_id - */ - public function setAppId(?string $appId): void - { - $this->appId = $appId; - } - - /** - * Returns Location Id. - * The location id the action is attached to, if a link can be made. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location id the action is attached to, if a link can be made. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Qr Code Options. - * Fields to describe the action that displays QR-Codes. - */ - public function getQrCodeOptions(): ?QrCodeOptions - { - return $this->qrCodeOptions; - } - - /** - * Sets Qr Code Options. - * Fields to describe the action that displays QR-Codes. - * - * @maps qr_code_options - */ - public function setQrCodeOptions(?QrCodeOptions $qrCodeOptions): void - { - $this->qrCodeOptions = $qrCodeOptions; - } - - /** - * Returns Save Card Options. - * Describes save-card action fields. - */ - public function getSaveCardOptions(): ?SaveCardOptions - { - return $this->saveCardOptions; - } - - /** - * Sets Save Card Options. - * Describes save-card action fields. - * - * @maps save_card_options - */ - public function setSaveCardOptions(?SaveCardOptions $saveCardOptions): void - { - $this->saveCardOptions = $saveCardOptions; - } - - /** - * Returns Signature Options. - */ - public function getSignatureOptions(): ?SignatureOptions - { - return $this->signatureOptions; - } - - /** - * Sets Signature Options. - * - * @maps signature_options - */ - public function setSignatureOptions(?SignatureOptions $signatureOptions): void - { - $this->signatureOptions = $signatureOptions; - } - - /** - * Returns Confirmation Options. - */ - public function getConfirmationOptions(): ?ConfirmationOptions - { - return $this->confirmationOptions; - } - - /** - * Sets Confirmation Options. - * - * @maps confirmation_options - */ - public function setConfirmationOptions(?ConfirmationOptions $confirmationOptions): void - { - $this->confirmationOptions = $confirmationOptions; - } - - /** - * Returns Receipt Options. - * Describes receipt action fields. - */ - public function getReceiptOptions(): ?ReceiptOptions - { - return $this->receiptOptions; - } - - /** - * Sets Receipt Options. - * Describes receipt action fields. - * - * @maps receipt_options - */ - public function setReceiptOptions(?ReceiptOptions $receiptOptions): void - { - $this->receiptOptions = $receiptOptions; - } - - /** - * Returns Data Collection Options. - */ - public function getDataCollectionOptions(): ?DataCollectionOptions - { - return $this->dataCollectionOptions; - } - - /** - * Sets Data Collection Options. - * - * @maps data_collection_options - */ - public function setDataCollectionOptions(?DataCollectionOptions $dataCollectionOptions): void - { - $this->dataCollectionOptions = $dataCollectionOptions; - } - - /** - * Returns Select Options. - */ - public function getSelectOptions(): ?SelectOptions - { - return $this->selectOptions; - } - - /** - * Sets Select Options. - * - * @maps select_options - */ - public function setSelectOptions(?SelectOptions $selectOptions): void - { - $this->selectOptions = $selectOptions; - } - - /** - * Returns Device Metadata. - */ - public function getDeviceMetadata(): ?DeviceMetadata - { - return $this->deviceMetadata; - } - - /** - * Sets Device Metadata. - * - * @maps device_metadata - */ - public function setDeviceMetadata(?DeviceMetadata $deviceMetadata): void - { - $this->deviceMetadata = $deviceMetadata; - } - - /** - * Returns Await Next Action. - * Indicates the action will be linked to another action and requires a waiting dialog to be - * displayed instead of returning to the idle screen on completion of the action. - * - * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. - */ - public function getAwaitNextAction(): ?bool - { - if (count($this->awaitNextAction) == 0) { - return null; - } - return $this->awaitNextAction['value']; - } - - /** - * Sets Await Next Action. - * Indicates the action will be linked to another action and requires a waiting dialog to be - * displayed instead of returning to the idle screen on completion of the action. - * - * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. - * - * @maps await_next_action - */ - public function setAwaitNextAction(?bool $awaitNextAction): void - { - $this->awaitNextAction['value'] = $awaitNextAction; - } - - /** - * Unsets Await Next Action. - * Indicates the action will be linked to another action and requires a waiting dialog to be - * displayed instead of returning to the idle screen on completion of the action. - * - * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. - */ - public function unsetAwaitNextAction(): void - { - $this->awaitNextAction = []; - } - - /** - * Returns Await Next Action Duration. - * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the - * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. - * - * Default: 5 minutes from when the waiting dialog is displayed - * - * Maximum: 5 minutes - */ - public function getAwaitNextActionDuration(): ?string - { - if (count($this->awaitNextActionDuration) == 0) { - return null; - } - return $this->awaitNextActionDuration['value']; - } - - /** - * Sets Await Next Action Duration. - * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the - * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. - * - * Default: 5 minutes from when the waiting dialog is displayed - * - * Maximum: 5 minutes - * - * @maps await_next_action_duration - */ - public function setAwaitNextActionDuration(?string $awaitNextActionDuration): void - { - $this->awaitNextActionDuration['value'] = $awaitNextActionDuration; - } - - /** - * Unsets Await Next Action Duration. - * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the - * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. - * - * Default: 5 minutes from when the waiting dialog is displayed - * - * Maximum: 5 minutes - */ - public function unsetAwaitNextActionDuration(): void - { - $this->awaitNextActionDuration = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; - } - if (!empty($this->deadlineDuration)) { - $json['deadline_duration'] = $this->deadlineDuration['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->appId)) { - $json['app_id'] = $this->appId; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (isset($this->qrCodeOptions)) { - $json['qr_code_options'] = $this->qrCodeOptions; - } - if (isset($this->saveCardOptions)) { - $json['save_card_options'] = $this->saveCardOptions; - } - if (isset($this->signatureOptions)) { - $json['signature_options'] = $this->signatureOptions; - } - if (isset($this->confirmationOptions)) { - $json['confirmation_options'] = $this->confirmationOptions; - } - if (isset($this->receiptOptions)) { - $json['receipt_options'] = $this->receiptOptions; - } - if (isset($this->dataCollectionOptions)) { - $json['data_collection_options'] = $this->dataCollectionOptions; - } - if (isset($this->selectOptions)) { - $json['select_options'] = $this->selectOptions; - } - if (isset($this->deviceMetadata)) { - $json['device_metadata'] = $this->deviceMetadata; - } - if (!empty($this->awaitNextAction)) { - $json['await_next_action'] = $this->awaitNextAction['value']; - } - if (!empty($this->awaitNextActionDuration)) { - $json['await_next_action_duration'] = $this->awaitNextActionDuration['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalActionActionType.php b/src/Models/TerminalActionActionType.php deleted file mode 100644 index f6b197a3..00000000 --- a/src/Models/TerminalActionActionType.php +++ /dev/null @@ -1,60 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * - * @maps filter - */ - public function setFilter(?TerminalActionQueryFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - */ - public function getSort(): ?TerminalActionQuerySort - { - return $this->sort; - } - - /** - * Sets Sort. - * - * @maps sort - */ - public function setSort(?TerminalActionQuerySort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalActionQueryFilter.php b/src/Models/TerminalActionQueryFilter.php deleted file mode 100644 index d93b724b..00000000 --- a/src/Models/TerminalActionQueryFilter.php +++ /dev/null @@ -1,181 +0,0 @@ -deviceId) == 0) { - return null; - } - return $this->deviceId['value']; - } - - /** - * Sets Device Id. - * `TerminalAction`s associated with a specific device. If no device is specified then all - * `TerminalAction`s for the merchant will be displayed. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId['value'] = $deviceId; - } - - /** - * Unsets Device Id. - * `TerminalAction`s associated with a specific device. If no device is specified then all - * `TerminalAction`s for the merchant will be displayed. - */ - public function unsetDeviceId(): void - { - $this->deviceId = []; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): ?TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Status. - * Filter results with the desired status of the `TerminalAction` - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function getStatus(): ?string - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * Filter results with the desired status of the `TerminalAction` - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * Filter results with the desired status of the `TerminalAction` - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Returns Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * Describes the type of this unit and indicates which field contains the unit information. This is an - * ‘open’ enum. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalActionQuerySort.php b/src/Models/TerminalActionQuerySort.php deleted file mode 100644 index eab37814..00000000 --- a/src/Models/TerminalActionQuerySort.php +++ /dev/null @@ -1,57 +0,0 @@ -sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalCheckout.php b/src/Models/TerminalCheckout.php deleted file mode 100644 index 9dae516a..00000000 --- a/src/Models/TerminalCheckout.php +++ /dev/null @@ -1,785 +0,0 @@ -amountMoney = $amountMoney; - $this->deviceOptions = $deviceOptions; - } - - /** - * Returns Id. - * A unique ID for this `TerminalCheckout`. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A unique ID for this `TerminalCheckout`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `TerminalCheckout` to another entity in an external system. For example, an order - * ID generated by a third-party shopping cart. The ID is also associated with any payments - * used to complete the checkout. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `TerminalCheckout` to another entity in an external system. For example, an order - * ID generated by a third-party shopping cart. The ID is also associated with any payments - * used to complete the checkout. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional user-defined reference ID that can be used to associate - * this `TerminalCheckout` to another entity in an external system. For example, an order - * ID generated by a third-party shopping cart. The ID is also associated with any payments - * used to complete the checkout. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * An optional note to associate with the checkout, as well as with any payments used to complete the - * checkout. - * Note: maximum 500 characters - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * An optional note to associate with the checkout, as well as with any payments used to complete the - * checkout. - * Note: maximum 500 characters - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * An optional note to associate with the checkout, as well as with any payments used to complete the - * checkout. - * Note: maximum 500 characters - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Order Id. - * The reference to the Square order ID for the checkout request. Supported only in the US. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The reference to the Square order ID for the checkout request. Supported only in the US. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The reference to the Square order ID for the checkout request. Supported only in the US. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Returns Payment Options. - */ - public function getPaymentOptions(): ?PaymentOptions - { - return $this->paymentOptions; - } - - /** - * Sets Payment Options. - * - * @maps payment_options - */ - public function setPaymentOptions(?PaymentOptions $paymentOptions): void - { - $this->paymentOptions = $paymentOptions; - } - - /** - * Returns Device Options. - */ - public function getDeviceOptions(): DeviceCheckoutOptions - { - return $this->deviceOptions; - } - - /** - * Sets Device Options. - * - * @required - * @maps device_options - */ - public function setDeviceOptions(DeviceCheckoutOptions $deviceOptions): void - { - $this->deviceOptions = $deviceOptions; - } - - /** - * Returns Deadline Duration. - * An RFC 3339 duration, after which the checkout is automatically canceled. - * A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - */ - public function getDeadlineDuration(): ?string - { - if (count($this->deadlineDuration) == 0) { - return null; - } - return $this->deadlineDuration['value']; - } - - /** - * Sets Deadline Duration. - * An RFC 3339 duration, after which the checkout is automatically canceled. - * A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - * - * @maps deadline_duration - */ - public function setDeadlineDuration(?string $deadlineDuration): void - { - $this->deadlineDuration['value'] = $deadlineDuration; - } - - /** - * Unsets Deadline Duration. - * An RFC 3339 duration, after which the checkout is automatically canceled. - * A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation - * - * Maximum: 5 minutes - */ - public function unsetDeadlineDuration(): void - { - $this->deadlineDuration = []; - } - - /** - * Returns Status. - * The status of the `TerminalCheckout`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the `TerminalCheckout`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Cancel Reason. - */ - public function getCancelReason(): ?string - { - return $this->cancelReason; - } - - /** - * Sets Cancel Reason. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason = $cancelReason; - } - - /** - * Returns Payment Ids. - * A list of IDs for payments created by this `TerminalCheckout`. - * - * @return string[]|null - */ - public function getPaymentIds(): ?array - { - return $this->paymentIds; - } - - /** - * Sets Payment Ids. - * A list of IDs for payments created by this `TerminalCheckout`. - * - * @maps payment_ids - * - * @param string[]|null $paymentIds - */ - public function setPaymentIds(?array $paymentIds): void - { - $this->paymentIds = $paymentIds; - } - - /** - * Returns Created At. - * The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns App Id. - * The ID of the application that created the checkout. - */ - public function getAppId(): ?string - { - return $this->appId; - } - - /** - * Sets App Id. - * The ID of the application that created the checkout. - * - * @maps app_id - */ - public function setAppId(?string $appId): void - { - $this->appId = $appId; - } - - /** - * Returns Location Id. - * The location of the device where the `TerminalCheckout` was directed. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location of the device where the `TerminalCheckout` was directed. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Returns Payment Type. - */ - public function getPaymentType(): ?string - { - return $this->paymentType; - } - - /** - * Sets Payment Type. - * - * @maps payment_type - */ - public function setPaymentType(?string $paymentType): void - { - $this->paymentType = $paymentType; - } - - /** - * Returns Team Member Id. - * An optional ID of the team member associated with creating the checkout. - */ - public function getTeamMemberId(): ?string - { - if (count($this->teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * An optional ID of the team member associated with creating the checkout. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * An optional ID of the team member associated with creating the checkout. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Customer Id. - * An optional ID of the customer associated with the checkout. - */ - public function getCustomerId(): ?string - { - if (count($this->customerId) == 0) { - return null; - } - return $this->customerId['value']; - } - - /** - * Sets Customer Id. - * An optional ID of the customer associated with the checkout. - * - * @maps customer_id - */ - public function setCustomerId(?string $customerId): void - { - $this->customerId['value'] = $customerId; - } - - /** - * Unsets Customer Id. - * An optional ID of the customer associated with the checkout. - */ - public function unsetCustomerId(): void - { - $this->customerId = []; - } - - /** - * Returns App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAppFeeMoney(): ?Money - { - return $this->appFeeMoney; - } - - /** - * Sets App Fee Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps app_fee_money - */ - public function setAppFeeMoney(?Money $appFeeMoney): void - { - $this->appFeeMoney = $appFeeMoney; - } - - /** - * Returns Statement Description Identifier. - * Optional additional payment information to include on the customer's card statement as - * part of the statement description. This can be, for example, an invoice number, ticket number, - * or short description that uniquely identifies the purchase. Supported only in the US. - */ - public function getStatementDescriptionIdentifier(): ?string - { - if (count($this->statementDescriptionIdentifier) == 0) { - return null; - } - return $this->statementDescriptionIdentifier['value']; - } - - /** - * Sets Statement Description Identifier. - * Optional additional payment information to include on the customer's card statement as - * part of the statement description. This can be, for example, an invoice number, ticket number, - * or short description that uniquely identifies the purchase. Supported only in the US. - * - * @maps statement_description_identifier - */ - public function setStatementDescriptionIdentifier(?string $statementDescriptionIdentifier): void - { - $this->statementDescriptionIdentifier['value'] = $statementDescriptionIdentifier; - } - - /** - * Unsets Statement Description Identifier. - * Optional additional payment information to include on the customer's card statement as - * part of the statement description. This can be, for example, an invoice number, ticket number, - * or short description that uniquely identifies the purchase. Supported only in the US. - */ - public function unsetStatementDescriptionIdentifier(): void - { - $this->statementDescriptionIdentifier = []; - } - - /** - * Returns Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getTipMoney(): ?Money - { - return $this->tipMoney; - } - - /** - * Sets Tip Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @maps tip_money - */ - public function setTipMoney(?Money $tipMoney): void - { - $this->tipMoney = $tipMoney; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['amount_money'] = $this->amountMoney; - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - if (isset($this->paymentOptions)) { - $json['payment_options'] = $this->paymentOptions; - } - $json['device_options'] = $this->deviceOptions; - if (!empty($this->deadlineDuration)) { - $json['deadline_duration'] = $this->deadlineDuration['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason; - } - if (isset($this->paymentIds)) { - $json['payment_ids'] = $this->paymentIds; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->appId)) { - $json['app_id'] = $this->appId; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - if (isset($this->paymentType)) { - $json['payment_type'] = $this->paymentType; - } - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->customerId)) { - $json['customer_id'] = $this->customerId['value']; - } - if (isset($this->appFeeMoney)) { - $json['app_fee_money'] = $this->appFeeMoney; - } - if (!empty($this->statementDescriptionIdentifier)) { - $json['statement_description_identifier'] = $this->statementDescriptionIdentifier['value']; - } - if (isset($this->tipMoney)) { - $json['tip_money'] = $this->tipMoney; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalCheckoutQuery.php b/src/Models/TerminalCheckoutQuery.php deleted file mode 100644 index 0ac8195d..00000000 --- a/src/Models/TerminalCheckoutQuery.php +++ /dev/null @@ -1,81 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * - * @maps filter - */ - public function setFilter(?TerminalCheckoutQueryFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - */ - public function getSort(): ?TerminalCheckoutQuerySort - { - return $this->sort; - } - - /** - * Sets Sort. - * - * @maps sort - */ - public function setSort(?TerminalCheckoutQuerySort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalCheckoutQueryFilter.php b/src/Models/TerminalCheckoutQueryFilter.php deleted file mode 100644 index 94364dc8..00000000 --- a/src/Models/TerminalCheckoutQueryFilter.php +++ /dev/null @@ -1,154 +0,0 @@ -deviceId) == 0) { - return null; - } - return $this->deviceId['value']; - } - - /** - * Sets Device Id. - * The `TerminalCheckout` objects associated with a specific device. If no device is specified, then - * all - * `TerminalCheckout` objects for the merchant are displayed. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId['value'] = $deviceId; - } - - /** - * Unsets Device Id. - * The `TerminalCheckout` objects associated with a specific device. If no device is specified, then - * all - * `TerminalCheckout` objects for the merchant are displayed. - */ - public function unsetDeviceId(): void - { - $this->deviceId = []; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): ?TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Status. - * Filtered results with the desired status of the `TerminalCheckout`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function getStatus(): ?string - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * Filtered results with the desired status of the `TerminalCheckout`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * Filtered results with the desired status of the `TerminalCheckout`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalCheckoutQuerySort.php b/src/Models/TerminalCheckoutQuerySort.php deleted file mode 100644 index 1204cfad..00000000 --- a/src/Models/TerminalCheckoutQuerySort.php +++ /dev/null @@ -1,57 +0,0 @@ -sortOrder; - } - - /** - * Sets Sort Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder = $sortOrder; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalRefund.php b/src/Models/TerminalRefund.php deleted file mode 100644 index 5cd0a497..00000000 --- a/src/Models/TerminalRefund.php +++ /dev/null @@ -1,479 +0,0 @@ -paymentId = $paymentId; - $this->amountMoney = $amountMoney; - $this->reason = $reason; - $this->deviceId = $deviceId; - } - - /** - * Returns Id. - * A unique ID for this `TerminalRefund`. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A unique ID for this `TerminalRefund`. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Refund Id. - * The reference to the payment refund created by completing this `TerminalRefund`. - */ - public function getRefundId(): ?string - { - return $this->refundId; - } - - /** - * Sets Refund Id. - * The reference to the payment refund created by completing this `TerminalRefund`. - * - * @maps refund_id - */ - public function setRefundId(?string $refundId): void - { - $this->refundId = $refundId; - } - - /** - * Returns Payment Id. - * The unique ID of the payment being refunded. - */ - public function getPaymentId(): string - { - return $this->paymentId; - } - - /** - * Sets Payment Id. - * The unique ID of the payment being refunded. - * - * @required - * @maps payment_id - */ - public function setPaymentId(string $paymentId): void - { - $this->paymentId = $paymentId; - } - - /** - * Returns Order Id. - * The reference to the Square order ID for the payment identified by the `payment_id`. - */ - public function getOrderId(): ?string - { - return $this->orderId; - } - - /** - * Sets Order Id. - * The reference to the Square order ID for the payment identified by the `payment_id`. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId = $orderId; - } - - /** - * Returns Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - */ - public function getAmountMoney(): Money - { - return $this->amountMoney; - } - - /** - * Sets Amount Money. - * Represents an amount of money. `Money` fields can be signed or unsigned. - * Fields that do not explicitly define whether they are signed or unsigned are - * considered unsigned and can only hold positive amounts. For signed fields, the - * sign of the value indicates the purpose of the money transfer. See - * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with- - * monetary-amounts) - * for more information. - * - * @required - * @maps amount_money - */ - public function setAmountMoney(Money $amountMoney): void - { - $this->amountMoney = $amountMoney; - } - - /** - * Returns Reason. - * A description of the reason for the refund. - */ - public function getReason(): string - { - return $this->reason; - } - - /** - * Sets Reason. - * A description of the reason for the refund. - * - * @required - * @maps reason - */ - public function setReason(string $reason): void - { - $this->reason = $reason; - } - - /** - * Returns Device Id. - * The unique ID of the device intended for this `TerminalRefund`. - * The Id can be retrieved from /v2/devices api. - */ - public function getDeviceId(): string - { - return $this->deviceId; - } - - /** - * Sets Device Id. - * The unique ID of the device intended for this `TerminalRefund`. - * The Id can be retrieved from /v2/devices api. - * - * @required - * @maps device_id - */ - public function setDeviceId(string $deviceId): void - { - $this->deviceId = $deviceId; - } - - /** - * Returns Deadline Duration. - * The RFC 3339 duration, after which the refund is automatically canceled. - * A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation. - * - * Maximum: 5 minutes - */ - public function getDeadlineDuration(): ?string - { - if (count($this->deadlineDuration) == 0) { - return null; - } - return $this->deadlineDuration['value']; - } - - /** - * Sets Deadline Duration. - * The RFC 3339 duration, after which the refund is automatically canceled. - * A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation. - * - * Maximum: 5 minutes - * - * @maps deadline_duration - */ - public function setDeadlineDuration(?string $deadlineDuration): void - { - $this->deadlineDuration['value'] = $deadlineDuration; - } - - /** - * Unsets Deadline Duration. - * The RFC 3339 duration, after which the refund is automatically canceled. - * A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason - * of `TIMED_OUT`. - * - * Default: 5 minutes from creation. - * - * Maximum: 5 minutes - */ - public function unsetDeadlineDuration(): void - { - $this->deadlineDuration = []; - } - - /** - * Returns Status. - * The status of the `TerminalRefund`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the `TerminalRefund`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Returns Cancel Reason. - */ - public function getCancelReason(): ?string - { - return $this->cancelReason; - } - - /** - * Sets Cancel Reason. - * - * @maps cancel_reason - */ - public function setCancelReason(?string $cancelReason): void - { - $this->cancelReason = $cancelReason; - } - - /** - * Returns Created At. - * The time when the `TerminalRefund` was created, as an RFC 3339 timestamp. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the `TerminalRefund` was created, as an RFC 3339 timestamp. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns App Id. - * The ID of the application that created the refund. - */ - public function getAppId(): ?string - { - return $this->appId; - } - - /** - * Sets App Id. - * The ID of the application that created the refund. - * - * @maps app_id - */ - public function setAppId(?string $appId): void - { - $this->appId = $appId; - } - - /** - * Returns Location Id. - * The location of the device where the `TerminalRefund` was directed. - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * Sets Location Id. - * The location of the device where the `TerminalRefund` was directed. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId = $locationId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->refundId)) { - $json['refund_id'] = $this->refundId; - } - $json['payment_id'] = $this->paymentId; - if (isset($this->orderId)) { - $json['order_id'] = $this->orderId; - } - $json['amount_money'] = $this->amountMoney; - $json['reason'] = $this->reason; - $json['device_id'] = $this->deviceId; - if (!empty($this->deadlineDuration)) { - $json['deadline_duration'] = $this->deadlineDuration['value']; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - if (isset($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (isset($this->appId)) { - $json['app_id'] = $this->appId; - } - if (isset($this->locationId)) { - $json['location_id'] = $this->locationId; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalRefundQuery.php b/src/Models/TerminalRefundQuery.php deleted file mode 100644 index b9c544e0..00000000 --- a/src/Models/TerminalRefundQuery.php +++ /dev/null @@ -1,81 +0,0 @@ -filter; - } - - /** - * Sets Filter. - * - * @maps filter - */ - public function setFilter(?TerminalRefundQueryFilter $filter): void - { - $this->filter = $filter; - } - - /** - * Returns Sort. - */ - public function getSort(): ?TerminalRefundQuerySort - { - return $this->sort; - } - - /** - * Sets Sort. - * - * @maps sort - */ - public function setSort(?TerminalRefundQuerySort $sort): void - { - $this->sort = $sort; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->filter)) { - $json['filter'] = $this->filter; - } - if (isset($this->sort)) { - $json['sort'] = $this->sort; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalRefundQueryFilter.php b/src/Models/TerminalRefundQueryFilter.php deleted file mode 100644 index a939ad72..00000000 --- a/src/Models/TerminalRefundQueryFilter.php +++ /dev/null @@ -1,151 +0,0 @@ -deviceId) == 0) { - return null; - } - return $this->deviceId['value']; - } - - /** - * Sets Device Id. - * `TerminalRefund` objects associated with a specific device. If no device is specified, then all - * `TerminalRefund` objects for the signed-in account are displayed. - * - * @maps device_id - */ - public function setDeviceId(?string $deviceId): void - { - $this->deviceId['value'] = $deviceId; - } - - /** - * Unsets Device Id. - * `TerminalRefund` objects associated with a specific device. If no device is specified, then all - * `TerminalRefund` objects for the signed-in account are displayed. - */ - public function unsetDeviceId(): void - { - $this->deviceId = []; - } - - /** - * Returns Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - */ - public function getCreatedAt(): ?TimeRange - { - return $this->createdAt; - } - - /** - * Sets Created At. - * Represents a generic time range. The start and end values are - * represented in RFC 3339 format. Time ranges are customized to be - * inclusive or exclusive based on the needs of a particular endpoint. - * Refer to the relevant endpoint-specific documentation to determine - * how time ranges are handled. - * - * @maps created_at - */ - public function setCreatedAt(?TimeRange $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Status. - * Filtered results with the desired status of the `TerminalRefund`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. - */ - public function getStatus(): ?string - { - if (count($this->status) == 0) { - return null; - } - return $this->status['value']; - } - - /** - * Sets Status. - * Filtered results with the desired status of the `TerminalRefund`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status['value'] = $status; - } - - /** - * Unsets Status. - * Filtered results with the desired status of the `TerminalRefund`. - * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. - */ - public function unsetStatus(): void - { - $this->status = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->status)) { - $json['status'] = $this->status['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TerminalRefundQuerySort.php b/src/Models/TerminalRefundQuerySort.php deleted file mode 100644 index 13854a42..00000000 --- a/src/Models/TerminalRefundQuerySort.php +++ /dev/null @@ -1,75 +0,0 @@ -sortOrder) == 0) { - return null; - } - return $this->sortOrder['value']; - } - - /** - * Sets Sort Order. - * The order in which results are listed. - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - * - * @maps sort_order - */ - public function setSortOrder(?string $sortOrder): void - { - $this->sortOrder['value'] = $sortOrder; - } - - /** - * Unsets Sort Order. - * The order in which results are listed. - * - `ASC` - Oldest to newest. - * - `DESC` - Newest to oldest (default). - */ - public function unsetSortOrder(): void - { - $this->sortOrder = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->sortOrder)) { - $json['sort_order'] = $this->sortOrder['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TestWebhookSubscriptionRequest.php b/src/Models/TestWebhookSubscriptionRequest.php deleted file mode 100644 index fb642df9..00000000 --- a/src/Models/TestWebhookSubscriptionRequest.php +++ /dev/null @@ -1,78 +0,0 @@ -eventType) == 0) { - return null; - } - return $this->eventType['value']; - } - - /** - * Sets Event Type. - * The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event - * type must be - * contained in the list of event types in the [Subscription](entity:WebhookSubscription). - * - * @maps event_type - */ - public function setEventType(?string $eventType): void - { - $this->eventType['value'] = $eventType; - } - - /** - * Unsets Event Type. - * The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event - * type must be - * contained in the list of event types in the [Subscription](entity:WebhookSubscription). - */ - public function unsetEventType(): void - { - $this->eventType = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->eventType)) { - $json['event_type'] = $this->eventType['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TestWebhookSubscriptionResponse.php b/src/Models/TestWebhookSubscriptionResponse.php deleted file mode 100644 index 76197f3e..00000000 --- a/src/Models/TestWebhookSubscriptionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription Test Result. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - */ - public function getSubscriptionTestResult(): ?SubscriptionTestResult - { - return $this->subscriptionTestResult; - } - - /** - * Sets Subscription Test Result. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @maps subscription_test_result - */ - public function setSubscriptionTestResult(?SubscriptionTestResult $subscriptionTestResult): void - { - $this->subscriptionTestResult = $subscriptionTestResult; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscriptionTestResult)) { - $json['subscription_test_result'] = $this->subscriptionTestResult; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TimeRange.php b/src/Models/TimeRange.php deleted file mode 100644 index d44f0d2c..00000000 --- a/src/Models/TimeRange.php +++ /dev/null @@ -1,122 +0,0 @@ -startAt) == 0) { - return null; - } - return $this->startAt['value']; - } - - /** - * Sets Start At. - * A datetime value in RFC 3339 format indicating when the time range - * starts. - * - * @maps start_at - */ - public function setStartAt(?string $startAt): void - { - $this->startAt['value'] = $startAt; - } - - /** - * Unsets Start At. - * A datetime value in RFC 3339 format indicating when the time range - * starts. - */ - public function unsetStartAt(): void - { - $this->startAt = []; - } - - /** - * Returns End At. - * A datetime value in RFC 3339 format indicating when the time range - * ends. - */ - public function getEndAt(): ?string - { - if (count($this->endAt) == 0) { - return null; - } - return $this->endAt['value']; - } - - /** - * Sets End At. - * A datetime value in RFC 3339 format indicating when the time range - * ends. - * - * @maps end_at - */ - public function setEndAt(?string $endAt): void - { - $this->endAt['value'] = $endAt; - } - - /** - * Unsets End At. - * A datetime value in RFC 3339 format indicating when the time range - * ends. - */ - public function unsetEndAt(): void - { - $this->endAt = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->startAt)) { - $json['start_at'] = $this->startAt['value']; - } - if (!empty($this->endAt)) { - $json['end_at'] = $this->endAt['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TipSettings.php b/src/Models/TipSettings.php deleted file mode 100644 index bf08c75f..00000000 --- a/src/Models/TipSettings.php +++ /dev/null @@ -1,278 +0,0 @@ -allowTipping) == 0) { - return null; - } - return $this->allowTipping['value']; - } - - /** - * Sets Allow Tipping. - * Indicates whether tipping is enabled for this checkout. Defaults to false. - * - * @maps allow_tipping - */ - public function setAllowTipping(?bool $allowTipping): void - { - $this->allowTipping['value'] = $allowTipping; - } - - /** - * Unsets Allow Tipping. - * Indicates whether tipping is enabled for this checkout. Defaults to false. - */ - public function unsetAllowTipping(): void - { - $this->allowTipping = []; - } - - /** - * Returns Separate Tip Screen. - * Indicates whether tip options should be presented on the screen before presenting - * the signature screen during card payment. Defaults to false. - */ - public function getSeparateTipScreen(): ?bool - { - if (count($this->separateTipScreen) == 0) { - return null; - } - return $this->separateTipScreen['value']; - } - - /** - * Sets Separate Tip Screen. - * Indicates whether tip options should be presented on the screen before presenting - * the signature screen during card payment. Defaults to false. - * - * @maps separate_tip_screen - */ - public function setSeparateTipScreen(?bool $separateTipScreen): void - { - $this->separateTipScreen['value'] = $separateTipScreen; - } - - /** - * Unsets Separate Tip Screen. - * Indicates whether tip options should be presented on the screen before presenting - * the signature screen during card payment. Defaults to false. - */ - public function unsetSeparateTipScreen(): void - { - $this->separateTipScreen = []; - } - - /** - * Returns Custom Tip Field. - * Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. - */ - public function getCustomTipField(): ?bool - { - if (count($this->customTipField) == 0) { - return null; - } - return $this->customTipField['value']; - } - - /** - * Sets Custom Tip Field. - * Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. - * - * @maps custom_tip_field - */ - public function setCustomTipField(?bool $customTipField): void - { - $this->customTipField['value'] = $customTipField; - } - - /** - * Unsets Custom Tip Field. - * Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. - */ - public function unsetCustomTipField(): void - { - $this->customTipField = []; - } - - /** - * Returns Tip Percentages. - * A list of tip percentages that should be presented during the checkout flow, specified as - * up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25. - * - * @return int[]|null - */ - public function getTipPercentages(): ?array - { - if (count($this->tipPercentages) == 0) { - return null; - } - return $this->tipPercentages['value']; - } - - /** - * Sets Tip Percentages. - * A list of tip percentages that should be presented during the checkout flow, specified as - * up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25. - * - * @maps tip_percentages - * - * @param int[]|null $tipPercentages - */ - public function setTipPercentages(?array $tipPercentages): void - { - $this->tipPercentages['value'] = $tipPercentages; - } - - /** - * Unsets Tip Percentages. - * A list of tip percentages that should be presented during the checkout flow, specified as - * up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25. - */ - public function unsetTipPercentages(): void - { - $this->tipPercentages = []; - } - - /** - * Returns Smart Tipping. - * Enables the "Smart Tip Amounts" behavior. - * Exact tipping options depend on the region in which the Square seller is active. - * - * For payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, - * tipping options are presented as no tip, .50, 1.00 or 2.00. - * - * For payment amounts of 10.00 or greater, tipping options are presented as the following percentages: - * 0%, 5%, 10%, 15%. - * - * If set to true, the `tip_percentages` settings is ignored. - * Defaults to false. - * - * To learn more about smart tipping, see [Accept Tips with the Square App](https://squareup. - * com/help/us/en/article/5069-accept-tips-with-the-square-app). - */ - public function getSmartTipping(): ?bool - { - if (count($this->smartTipping) == 0) { - return null; - } - return $this->smartTipping['value']; - } - - /** - * Sets Smart Tipping. - * Enables the "Smart Tip Amounts" behavior. - * Exact tipping options depend on the region in which the Square seller is active. - * - * For payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, - * tipping options are presented as no tip, .50, 1.00 or 2.00. - * - * For payment amounts of 10.00 or greater, tipping options are presented as the following percentages: - * 0%, 5%, 10%, 15%. - * - * If set to true, the `tip_percentages` settings is ignored. - * Defaults to false. - * - * To learn more about smart tipping, see [Accept Tips with the Square App](https://squareup. - * com/help/us/en/article/5069-accept-tips-with-the-square-app). - * - * @maps smart_tipping - */ - public function setSmartTipping(?bool $smartTipping): void - { - $this->smartTipping['value'] = $smartTipping; - } - - /** - * Unsets Smart Tipping. - * Enables the "Smart Tip Amounts" behavior. - * Exact tipping options depend on the region in which the Square seller is active. - * - * For payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, - * tipping options are presented as no tip, .50, 1.00 or 2.00. - * - * For payment amounts of 10.00 or greater, tipping options are presented as the following percentages: - * 0%, 5%, 10%, 15%. - * - * If set to true, the `tip_percentages` settings is ignored. - * Defaults to false. - * - * To learn more about smart tipping, see [Accept Tips with the Square App](https://squareup. - * com/help/us/en/article/5069-accept-tips-with-the-square-app). - */ - public function unsetSmartTipping(): void - { - $this->smartTipping = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->allowTipping)) { - $json['allow_tipping'] = $this->allowTipping['value']; - } - if (!empty($this->separateTipScreen)) { - $json['separate_tip_screen'] = $this->separateTipScreen['value']; - } - if (!empty($this->customTipField)) { - $json['custom_tip_field'] = $this->customTipField['value']; - } - if (!empty($this->tipPercentages)) { - $json['tip_percentages'] = $this->tipPercentages['value']; - } - if (!empty($this->smartTipping)) { - $json['smart_tipping'] = $this->smartTipping['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Transaction.php b/src/Models/Transaction.php deleted file mode 100644 index fb66d687..00000000 --- a/src/Models/Transaction.php +++ /dev/null @@ -1,433 +0,0 @@ -id; - } - - /** - * Sets Id. - * The transaction's unique ID, issued by Square payments servers. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Location Id. - * The ID of the transaction's associated location. - */ - public function getLocationId(): ?string - { - if (count($this->locationId) == 0) { - return null; - } - return $this->locationId['value']; - } - - /** - * Sets Location Id. - * The ID of the transaction's associated location. - * - * @maps location_id - */ - public function setLocationId(?string $locationId): void - { - $this->locationId['value'] = $locationId; - } - - /** - * Unsets Location Id. - * The ID of the transaction's associated location. - */ - public function unsetLocationId(): void - { - $this->locationId = []; - } - - /** - * Returns Created At. - * The timestamp for when the transaction was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp for when the transaction was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Tenders. - * The tenders used to pay in the transaction. - * - * @return Tender[]|null - */ - public function getTenders(): ?array - { - if (count($this->tenders) == 0) { - return null; - } - return $this->tenders['value']; - } - - /** - * Sets Tenders. - * The tenders used to pay in the transaction. - * - * @maps tenders - * - * @param Tender[]|null $tenders - */ - public function setTenders(?array $tenders): void - { - $this->tenders['value'] = $tenders; - } - - /** - * Unsets Tenders. - * The tenders used to pay in the transaction. - */ - public function unsetTenders(): void - { - $this->tenders = []; - } - - /** - * Returns Refunds. - * Refunds that have been applied to any tender in the transaction. - * - * @return Refund[]|null - */ - public function getRefunds(): ?array - { - if (count($this->refunds) == 0) { - return null; - } - return $this->refunds['value']; - } - - /** - * Sets Refunds. - * Refunds that have been applied to any tender in the transaction. - * - * @maps refunds - * - * @param Refund[]|null $refunds - */ - public function setRefunds(?array $refunds): void - { - $this->refunds['value'] = $refunds; - } - - /** - * Unsets Refunds. - * Refunds that have been applied to any tender in the transaction. - */ - public function unsetRefunds(): void - { - $this->refunds = []; - } - - /** - * Returns Reference Id. - * If the transaction was created with the [Charge](api-endpoint:Transactions-Charge) - * endpoint, this value is the same as the value provided for the `reference_id` - * parameter in the request to that endpoint. Otherwise, it is not set. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * If the transaction was created with the [Charge](api-endpoint:Transactions-Charge) - * endpoint, this value is the same as the value provided for the `reference_id` - * parameter in the request to that endpoint. Otherwise, it is not set. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * If the transaction was created with the [Charge](api-endpoint:Transactions-Charge) - * endpoint, this value is the same as the value provided for the `reference_id` - * parameter in the request to that endpoint. Otherwise, it is not set. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Product. - * Indicates the Square product used to process a transaction. - */ - public function getProduct(): ?string - { - return $this->product; - } - - /** - * Sets Product. - * Indicates the Square product used to process a transaction. - * - * @maps product - */ - public function setProduct(?string $product): void - { - $this->product = $product; - } - - /** - * Returns Client Id. - * If the transaction was created in the Square Point of Sale app, this value - * is the ID generated for the transaction by Square Point of Sale. - * - * This ID has no relationship to the transaction's canonical `id`, which is - * generated by Square's backend servers. This value is generated for bookkeeping - * purposes, in case the transaction cannot immediately be completed (for example, - * if the transaction is processed in offline mode). - * - * It is not currently possible with the Connect API to perform a transaction - * lookup by this value. - */ - public function getClientId(): ?string - { - if (count($this->clientId) == 0) { - return null; - } - return $this->clientId['value']; - } - - /** - * Sets Client Id. - * If the transaction was created in the Square Point of Sale app, this value - * is the ID generated for the transaction by Square Point of Sale. - * - * This ID has no relationship to the transaction's canonical `id`, which is - * generated by Square's backend servers. This value is generated for bookkeeping - * purposes, in case the transaction cannot immediately be completed (for example, - * if the transaction is processed in offline mode). - * - * It is not currently possible with the Connect API to perform a transaction - * lookup by this value. - * - * @maps client_id - */ - public function setClientId(?string $clientId): void - { - $this->clientId['value'] = $clientId; - } - - /** - * Unsets Client Id. - * If the transaction was created in the Square Point of Sale app, this value - * is the ID generated for the transaction by Square Point of Sale. - * - * This ID has no relationship to the transaction's canonical `id`, which is - * generated by Square's backend servers. This value is generated for bookkeeping - * purposes, in case the transaction cannot immediately be completed (for example, - * if the transaction is processed in offline mode). - * - * It is not currently possible with the Connect API to perform a transaction - * lookup by this value. - */ - public function unsetClientId(): void - { - $this->clientId = []; - } - - /** - * Returns Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getShippingAddress(): ?Address - { - return $this->shippingAddress; - } - - /** - * Sets Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps shipping_address - */ - public function setShippingAddress(?Address $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * Returns Order Id. - * The order_id is an identifier for the order associated with this transaction, if any. - */ - public function getOrderId(): ?string - { - if (count($this->orderId) == 0) { - return null; - } - return $this->orderId['value']; - } - - /** - * Sets Order Id. - * The order_id is an identifier for the order associated with this transaction, if any. - * - * @maps order_id - */ - public function setOrderId(?string $orderId): void - { - $this->orderId['value'] = $orderId; - } - - /** - * Unsets Order Id. - * The order_id is an identifier for the order associated with this transaction, if any. - */ - public function unsetOrderId(): void - { - $this->orderId = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->locationId)) { - $json['location_id'] = $this->locationId['value']; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (!empty($this->tenders)) { - $json['tenders'] = $this->tenders['value']; - } - if (!empty($this->refunds)) { - $json['refunds'] = $this->refunds['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (isset($this->product)) { - $json['product'] = $this->product; - } - if (!empty($this->clientId)) { - $json['client_id'] = $this->clientId['value']; - } - if (isset($this->shippingAddress)) { - $json['shipping_address'] = $this->shippingAddress; - } - if (!empty($this->orderId)) { - $json['order_id'] = $this->orderId['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/TransactionProduct.php b/src/Models/TransactionProduct.php deleted file mode 100644 index 311ed5ac..00000000 --- a/src/Models/TransactionProduct.php +++ /dev/null @@ -1,51 +0,0 @@ -customerId = $customerId; - } - - /** - * Returns Customer Id. - * The ID of the customer to unlink from the gift card. - */ - public function getCustomerId(): string - { - return $this->customerId; - } - - /** - * Sets Customer Id. - * The ID of the customer to unlink from the gift card. - * - * @required - * @maps customer_id - */ - public function setCustomerId(string $customerId): void - { - $this->customerId = $customerId; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['customer_id'] = $this->customerId; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UnlinkCustomerFromGiftCardResponse.php b/src/Models/UnlinkCustomerFromGiftCardResponse.php deleted file mode 100644 index 6bde58d4..00000000 --- a/src/Models/UnlinkCustomerFromGiftCardResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Gift Card. - * Represents a Square gift card. - */ - public function getGiftCard(): ?GiftCard - { - return $this->giftCard; - } - - /** - * Sets Gift Card. - * Represents a Square gift card. - * - * @maps gift_card - */ - public function setGiftCard(?GiftCard $giftCard): void - { - $this->giftCard = $giftCard; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->giftCard)) { - $json['gift_card'] = $this->giftCard; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBookingCustomAttributeDefinitionRequest.php b/src/Models/UpdateBookingCustomAttributeDefinitionRequest.php deleted file mode 100644 index 5bf22f4b..00000000 --- a/src/Models/UpdateBookingCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBookingCustomAttributeDefinitionResponse.php b/src/Models/UpdateBookingCustomAttributeDefinitionResponse.php deleted file mode 100644 index ab1febdc..00000000 --- a/src/Models/UpdateBookingCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBookingRequest.php b/src/Models/UpdateBookingRequest.php deleted file mode 100644 index d753cf18..00000000 --- a/src/Models/UpdateBookingRequest.php +++ /dev/null @@ -1,108 +0,0 @@ -booking = $booking; - } - - /** - * Returns Idempotency Key. - * A unique key to make this request an idempotent operation. - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique key to make this request an idempotent operation. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique key to make this request an idempotent operation. - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Returns Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - */ - public function getBooking(): Booking - { - return $this->booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @required - * @maps booking - */ - public function setBooking(Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json['booking'] = $this->booking; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBookingResponse.php b/src/Models/UpdateBookingResponse.php deleted file mode 100644 index 1857b6ca..00000000 --- a/src/Models/UpdateBookingResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -booking; - } - - /** - * Sets Booking. - * Represents a booking as a time-bound service contract for a seller's staff member to provide a - * specified service - * at a given location to a requesting customer in one or more appointment segments. - * - * @maps booking - */ - public function setBooking(?Booking $booking): void - { - $this->booking = $booking; - } - - /** - * Returns Errors. - * Errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->booking)) { - $json['booking'] = $this->booking; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBreakTypeRequest.php b/src/Models/UpdateBreakTypeRequest.php deleted file mode 100644 index 2254bc4e..00000000 --- a/src/Models/UpdateBreakTypeRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -breakType = $breakType; - } - - /** - * Returns Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - */ - public function getBreakType(): BreakType - { - return $this->breakType; - } - - /** - * Sets Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - * - * @required - * @maps break_type - */ - public function setBreakType(BreakType $breakType): void - { - $this->breakType = $breakType; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['break_type'] = $this->breakType; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateBreakTypeResponse.php b/src/Models/UpdateBreakTypeResponse.php deleted file mode 100644 index 72800b1d..00000000 --- a/src/Models/UpdateBreakTypeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -breakType; - } - - /** - * Sets Break Type. - * A defined break template that sets an expectation for possible `Break` - * instances on a `Shift`. - * - * @maps break_type - */ - public function setBreakType(?BreakType $breakType): void - { - $this->breakType = $breakType; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->breakType)) { - $json['break_type'] = $this->breakType; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCatalogImageRequest.php b/src/Models/UpdateCatalogImageRequest.php deleted file mode 100644 index f92b8f24..00000000 --- a/src/Models/UpdateCatalogImageRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this UpdateCatalogImage request. - * Keys can be any valid string but must be unique for every UpdateCatalogImage request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this UpdateCatalogImage request. - * Keys can be any valid string but must be unique for every UpdateCatalogImage request. - * - * See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency) for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCatalogImageResponse.php b/src/Models/UpdateCatalogImageResponse.php deleted file mode 100644 index 5993d81f..00000000 --- a/src/Models/UpdateCatalogImageResponse.php +++ /dev/null @@ -1,115 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getImage(): ?CatalogObject - { - return $this->image; - } - - /** - * Sets Image. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @maps image - */ - public function setImage(?CatalogObject $image): void - { - $this->image = $image; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->image)) { - $json['image'] = $this->image; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerCustomAttributeDefinitionRequest.php b/src/Models/UpdateCustomerCustomAttributeDefinitionRequest.php deleted file mode 100644 index 5a9c94ff..00000000 --- a/src/Models/UpdateCustomerCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerCustomAttributeDefinitionResponse.php b/src/Models/UpdateCustomerCustomAttributeDefinitionResponse.php deleted file mode 100644 index ecff4c98..00000000 --- a/src/Models/UpdateCustomerCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerGroupRequest.php b/src/Models/UpdateCustomerGroupRequest.php deleted file mode 100644 index 8da92e24..00000000 --- a/src/Models/UpdateCustomerGroupRequest.php +++ /dev/null @@ -1,74 +0,0 @@ -group = $group; - } - - /** - * Returns Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - */ - public function getGroup(): CustomerGroup - { - return $this->group; - } - - /** - * Sets Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - * - * @required - * @maps group - */ - public function setGroup(CustomerGroup $group): void - { - $this->group = $group; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['group'] = $this->group; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerGroupResponse.php b/src/Models/UpdateCustomerGroupResponse.php deleted file mode 100644 index ee80f7b5..00000000 --- a/src/Models/UpdateCustomerGroupResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - */ - public function getGroup(): ?CustomerGroup - { - return $this->group; - } - - /** - * Sets Group. - * Represents a group of customer profiles. - * - * Customer groups can be created, be modified, and have their membership defined using - * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. - * - * @maps group - */ - public function setGroup(?CustomerGroup $group): void - { - $this->group = $group; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->group)) { - $json['group'] = $this->group; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerRequest.php b/src/Models/UpdateCustomerRequest.php deleted file mode 100644 index 638d575c..00000000 --- a/src/Models/UpdateCustomerRequest.php +++ /dev/null @@ -1,557 +0,0 @@ -givenName) == 0) { - return null; - } - return $this->givenName['value']; - } - - /** - * Sets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - * - * @maps given_name - */ - public function setGivenName(?string $givenName): void - { - $this->givenName['value'] = $givenName; - } - - /** - * Unsets Given Name. - * The given name (that is, the first name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - */ - public function unsetGivenName(): void - { - $this->givenName = []; - } - - /** - * Returns Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - */ - public function getFamilyName(): ?string - { - if (count($this->familyName) == 0) { - return null; - } - return $this->familyName['value']; - } - - /** - * Sets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - * - * @maps family_name - */ - public function setFamilyName(?string $familyName): void - { - $this->familyName['value'] = $familyName; - } - - /** - * Unsets Family Name. - * The family name (that is, the last name) associated with the customer profile. - * - * The maximum length for this value is 300 characters. - */ - public function unsetFamilyName(): void - { - $this->familyName = []; - } - - /** - * Returns Company Name. - * A business name associated with the customer profile. - * - * The maximum length for this value is 500 characters. - */ - public function getCompanyName(): ?string - { - if (count($this->companyName) == 0) { - return null; - } - return $this->companyName['value']; - } - - /** - * Sets Company Name. - * A business name associated with the customer profile. - * - * The maximum length for this value is 500 characters. - * - * @maps company_name - */ - public function setCompanyName(?string $companyName): void - { - $this->companyName['value'] = $companyName; - } - - /** - * Unsets Company Name. - * A business name associated with the customer profile. - * - * The maximum length for this value is 500 characters. - */ - public function unsetCompanyName(): void - { - $this->companyName = []; - } - - /** - * Returns Nickname. - * A nickname for the customer profile. - * - * The maximum length for this value is 100 characters. - */ - public function getNickname(): ?string - { - if (count($this->nickname) == 0) { - return null; - } - return $this->nickname['value']; - } - - /** - * Sets Nickname. - * A nickname for the customer profile. - * - * The maximum length for this value is 100 characters. - * - * @maps nickname - */ - public function setNickname(?string $nickname): void - { - $this->nickname['value'] = $nickname; - } - - /** - * Unsets Nickname. - * A nickname for the customer profile. - * - * The maximum length for this value is 100 characters. - */ - public function unsetNickname(): void - { - $this->nickname = []; - } - - /** - * Returns Email Address. - * The email address associated with the customer profile. - * - * The maximum length for this value is 254 characters. - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address associated with the customer profile. - * - * The maximum length for this value is 254 characters. - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address associated with the customer profile. - * - * The maximum length for this value is 254 characters. - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Phone Number. - * The phone number associated with the customer profile. The phone number must be valid and can - * contain - * 9–16 digits, with an optional `+` prefix and country code. For more information, see - * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid and can - * contain - * 9–16 digits, with an optional `+` prefix and country code. For more information, see - * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number associated with the customer profile. The phone number must be valid and can - * contain - * 9–16 digits, with an optional `+` prefix and country code. For more information, see - * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep- - * records#phone-number). - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * The maximum length for this value is 100 characters. - */ - public function getReferenceId(): ?string - { - if (count($this->referenceId) == 0) { - return null; - } - return $this->referenceId['value']; - } - - /** - * Sets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * The maximum length for this value is 100 characters. - * - * @maps reference_id - */ - public function setReferenceId(?string $referenceId): void - { - $this->referenceId['value'] = $referenceId; - } - - /** - * Unsets Reference Id. - * An optional second ID used to associate the customer profile with an - * entity in another system. - * - * The maximum length for this value is 100 characters. - */ - public function unsetReferenceId(): void - { - $this->referenceId = []; - } - - /** - * Returns Note. - * A custom note associated with the customer profile. - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A custom note associated with the customer profile. - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A custom note associated with the customer profile. - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, - * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in - * `YYYY-MM-DD` - * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. - */ - public function getBirthday(): ?string - { - if (count($this->birthday) == 0) { - return null; - } - return $this->birthday['value']; - } - - /** - * Sets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, - * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in - * `YYYY-MM-DD` - * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. - * - * @maps birthday - */ - public function setBirthday(?string $birthday): void - { - $this->birthday['value'] = $birthday; - } - - /** - * Unsets Birthday. - * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, - * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in - * `YYYY-MM-DD` - * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified. - */ - public function unsetBirthday(): void - { - $this->birthday = []; - } - - /** - * Returns Version. - * The current version of the customer profile. - * - * As a best practice, you should include this field to enable [optimistic concurrency](https: - * //developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For - * more information, see [Update a customer profile](https://developer.squareup.com/docs/customers- - * api/use-the-api/keep-records#update-a-customer-profile). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The current version of the customer profile. - * - * As a best practice, you should include this field to enable [optimistic concurrency](https: - * //developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For - * more information, see [Update a customer profile](https://developer.squareup.com/docs/customers- - * api/use-the-api/keep-records#update-a-customer-profile). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - */ - public function getTaxIds(): ?CustomerTaxIds - { - return $this->taxIds; - } - - /** - * Sets Tax Ids. - * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` - * field is available only for customers of sellers in EU countries or the United Kingdom. - * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what- - * it-does#customer-tax-ids). - * - * @maps tax_ids - */ - public function setTaxIds(?CustomerTaxIds $taxIds): void - { - $this->taxIds = $taxIds; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->givenName)) { - $json['given_name'] = $this->givenName['value']; - } - if (!empty($this->familyName)) { - $json['family_name'] = $this->familyName['value']; - } - if (!empty($this->companyName)) { - $json['company_name'] = $this->companyName['value']; - } - if (!empty($this->nickname)) { - $json['nickname'] = $this->nickname['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->referenceId)) { - $json['reference_id'] = $this->referenceId['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (!empty($this->birthday)) { - $json['birthday'] = $this->birthday['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->taxIds)) { - $json['tax_ids'] = $this->taxIds; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateCustomerResponse.php b/src/Models/UpdateCustomerResponse.php deleted file mode 100644 index e8c1aa89..00000000 --- a/src/Models/UpdateCustomerResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - */ - public function getCustomer(): ?Customer - { - return $this->customer; - } - - /** - * Sets Customer. - * Represents a Square customer profile in the Customer Directory of a Square seller. - * - * @maps customer - */ - public function setCustomer(?Customer $customer): void - { - $this->customer = $customer; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->customer)) { - $json['customer'] = $this->customer; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateInvoiceRequest.php b/src/Models/UpdateInvoiceRequest.php deleted file mode 100644 index cf7b6fd2..00000000 --- a/src/Models/UpdateInvoiceRequest.php +++ /dev/null @@ -1,176 +0,0 @@ -invoice = $invoice; - } - - /** - * Returns Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - */ - public function getInvoice(): Invoice - { - return $this->invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @required - * @maps invoice - */ - public function setInvoice(Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies the `UpdateInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the `UpdateInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique string that identifies the `UpdateInvoice` request. If you do not - * provide `idempotency_key` (or provide an empty string as the value), the endpoint - * treats each request as independent. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Returns Fields to Clear. - * The list of fields to clear. Although this field is currently supported, we - * recommend using null values or the `remove` field when possible. For examples, see - * [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). - * - * @return string[]|null - */ - public function getFieldsToClear(): ?array - { - if (count($this->fieldsToClear) == 0) { - return null; - } - return $this->fieldsToClear['value']; - } - - /** - * Sets Fields to Clear. - * The list of fields to clear. Although this field is currently supported, we - * recommend using null values or the `remove` field when possible. For examples, see - * [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). - * - * @maps fields_to_clear - * - * @param string[]|null $fieldsToClear - */ - public function setFieldsToClear(?array $fieldsToClear): void - { - $this->fieldsToClear['value'] = $fieldsToClear; - } - - /** - * Unsets Fields to Clear. - * The list of fields to clear. Although this field is currently supported, we - * recommend using null values or the `remove` field when possible. For examples, see - * [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). - */ - public function unsetFieldsToClear(): void - { - $this->fieldsToClear = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['invoice'] = $this->invoice; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - if (!empty($this->fieldsToClear)) { - $json['fields_to_clear'] = $this->fieldsToClear['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateInvoiceResponse.php b/src/Models/UpdateInvoiceResponse.php deleted file mode 100644 index 26701e67..00000000 --- a/src/Models/UpdateInvoiceResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -invoice; - } - - /** - * Sets Invoice. - * Stores information about an invoice. You use the Invoices API to create and manage - * invoices. For more information, see [Invoices API Overview](https://developer.squareup. - * com/docs/invoices-api/overview). - * - * @maps invoice - */ - public function setInvoice(?Invoice $invoice): void - { - $this->invoice = $invoice; - } - - /** - * Returns Errors. - * Information about errors encountered during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->invoice)) { - $json['invoice'] = $this->invoice; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateItemModifierListsRequest.php b/src/Models/UpdateItemModifierListsRequest.php deleted file mode 100644 index dbdb260e..00000000 --- a/src/Models/UpdateItemModifierListsRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -itemIds = $itemIds; - } - - /** - * Returns Item Ids. - * The IDs of the catalog items associated with the CatalogModifierList objects being updated. - * - * @return string[] - */ - public function getItemIds(): array - { - return $this->itemIds; - } - - /** - * Sets Item Ids. - * The IDs of the catalog items associated with the CatalogModifierList objects being updated. - * - * @required - * @maps item_ids - * - * @param string[] $itemIds - */ - public function setItemIds(array $itemIds): void - { - $this->itemIds = $itemIds; - } - - /** - * Returns Modifier Lists to Enable. - * The IDs of the CatalogModifierList objects to enable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - * - * @return string[]|null - */ - public function getModifierListsToEnable(): ?array - { - if (count($this->modifierListsToEnable) == 0) { - return null; - } - return $this->modifierListsToEnable['value']; - } - - /** - * Sets Modifier Lists to Enable. - * The IDs of the CatalogModifierList objects to enable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - * - * @maps modifier_lists_to_enable - * - * @param string[]|null $modifierListsToEnable - */ - public function setModifierListsToEnable(?array $modifierListsToEnable): void - { - $this->modifierListsToEnable['value'] = $modifierListsToEnable; - } - - /** - * Unsets Modifier Lists to Enable. - * The IDs of the CatalogModifierList objects to enable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - */ - public function unsetModifierListsToEnable(): void - { - $this->modifierListsToEnable = []; - } - - /** - * Returns Modifier Lists to Disable. - * The IDs of the CatalogModifierList objects to disable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - * - * @return string[]|null - */ - public function getModifierListsToDisable(): ?array - { - if (count($this->modifierListsToDisable) == 0) { - return null; - } - return $this->modifierListsToDisable['value']; - } - - /** - * Sets Modifier Lists to Disable. - * The IDs of the CatalogModifierList objects to disable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - * - * @maps modifier_lists_to_disable - * - * @param string[]|null $modifierListsToDisable - */ - public function setModifierListsToDisable(?array $modifierListsToDisable): void - { - $this->modifierListsToDisable['value'] = $modifierListsToDisable; - } - - /** - * Unsets Modifier Lists to Disable. - * The IDs of the CatalogModifierList objects to disable for the CatalogItem. - * At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified. - */ - public function unsetModifierListsToDisable(): void - { - $this->modifierListsToDisable = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['item_ids'] = $this->itemIds; - if (!empty($this->modifierListsToEnable)) { - $json['modifier_lists_to_enable'] = $this->modifierListsToEnable['value']; - } - if (!empty($this->modifierListsToDisable)) { - $json['modifier_lists_to_disable'] = $this->modifierListsToDisable['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateItemModifierListsResponse.php b/src/Models/UpdateItemModifierListsResponse.php deleted file mode 100644 index 7e64a99c..00000000 --- a/src/Models/UpdateItemModifierListsResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working- - * with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working- - * with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateItemTaxesRequest.php b/src/Models/UpdateItemTaxesRequest.php deleted file mode 100644 index 80a79729..00000000 --- a/src/Models/UpdateItemTaxesRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -itemIds = $itemIds; - } - - /** - * Returns Item Ids. - * IDs for the CatalogItems associated with the CatalogTax objects being updated. - * No more than 1,000 IDs may be provided. - * - * @return string[] - */ - public function getItemIds(): array - { - return $this->itemIds; - } - - /** - * Sets Item Ids. - * IDs for the CatalogItems associated with the CatalogTax objects being updated. - * No more than 1,000 IDs may be provided. - * - * @required - * @maps item_ids - * - * @param string[] $itemIds - */ - public function setItemIds(array $itemIds): void - { - $this->itemIds = $itemIds; - } - - /** - * Returns Taxes to Enable. - * IDs of the CatalogTax objects to enable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - * - * @return string[]|null - */ - public function getTaxesToEnable(): ?array - { - if (count($this->taxesToEnable) == 0) { - return null; - } - return $this->taxesToEnable['value']; - } - - /** - * Sets Taxes to Enable. - * IDs of the CatalogTax objects to enable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - * - * @maps taxes_to_enable - * - * @param string[]|null $taxesToEnable - */ - public function setTaxesToEnable(?array $taxesToEnable): void - { - $this->taxesToEnable['value'] = $taxesToEnable; - } - - /** - * Unsets Taxes to Enable. - * IDs of the CatalogTax objects to enable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - */ - public function unsetTaxesToEnable(): void - { - $this->taxesToEnable = []; - } - - /** - * Returns Taxes to Disable. - * IDs of the CatalogTax objects to disable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - * - * @return string[]|null - */ - public function getTaxesToDisable(): ?array - { - if (count($this->taxesToDisable) == 0) { - return null; - } - return $this->taxesToDisable['value']; - } - - /** - * Sets Taxes to Disable. - * IDs of the CatalogTax objects to disable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - * - * @maps taxes_to_disable - * - * @param string[]|null $taxesToDisable - */ - public function setTaxesToDisable(?array $taxesToDisable): void - { - $this->taxesToDisable['value'] = $taxesToDisable; - } - - /** - * Unsets Taxes to Disable. - * IDs of the CatalogTax objects to disable. - * At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - */ - public function unsetTaxesToDisable(): void - { - $this->taxesToDisable = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['item_ids'] = $this->itemIds; - if (!empty($this->taxesToEnable)) { - $json['taxes_to_enable'] = $this->taxesToEnable['value']; - } - if (!empty($this->taxesToDisable)) { - $json['taxes_to_disable'] = $this->taxesToDisable['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateItemTaxesResponse.php b/src/Models/UpdateItemTaxesResponse.php deleted file mode 100644 index 24361ede..00000000 --- a/src/Models/UpdateItemTaxesResponse.php +++ /dev/null @@ -1,91 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of - * this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateJobRequest.php b/src/Models/UpdateJobRequest.php deleted file mode 100644 index 9368e0c4..00000000 --- a/src/Models/UpdateJobRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -job = $job; - } - - /** - * Returns Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - */ - public function getJob(): Job - { - return $this->job; - } - - /** - * Sets Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - * - * @required - * @maps job - */ - public function setJob(Job $job): void - { - $this->job = $job; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['job'] = $this->job; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateJobResponse.php b/src/Models/UpdateJobResponse.php deleted file mode 100644 index 75f51d9c..00000000 --- a/src/Models/UpdateJobResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -job; - } - - /** - * Sets Job. - * Represents a job that can be assigned to [team members]($m/TeamMember). This object defines the - * job's title and tip eligibility. Compensation is defined in a [job assignment]($m/JobAssignment) - * in a team member's wage setting. - * - * @maps job - */ - public function setJob(?Job $job): void - { - $this->job = $job; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->job)) { - $json['job'] = $this->job; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationCustomAttributeDefinitionRequest.php b/src/Models/UpdateLocationCustomAttributeDefinitionRequest.php deleted file mode 100644 index da97e683..00000000 --- a/src/Models/UpdateLocationCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationCustomAttributeDefinitionResponse.php b/src/Models/UpdateLocationCustomAttributeDefinitionResponse.php deleted file mode 100644 index d7ee880a..00000000 --- a/src/Models/UpdateLocationCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationRequest.php b/src/Models/UpdateLocationRequest.php deleted file mode 100644 index 9a523977..00000000 --- a/src/Models/UpdateLocationRequest.php +++ /dev/null @@ -1,60 +0,0 @@ -location; - } - - /** - * Sets Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - * - * @maps location - */ - public function setLocation(?Location $location): void - { - $this->location = $location; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->location)) { - $json['location'] = $this->location; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationResponse.php b/src/Models/UpdateLocationResponse.php deleted file mode 100644 index f0899730..00000000 --- a/src/Models/UpdateLocationResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information about errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - */ - public function getLocation(): ?Location - { - return $this->location; - } - - /** - * Sets Location. - * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - * - * @maps location - */ - public function setLocation(?Location $location): void - { - $this->location = $location; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->location)) { - $json['location'] = $this->location; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationSettingsRequest.php b/src/Models/UpdateLocationSettingsRequest.php deleted file mode 100644 index 95d5b391..00000000 --- a/src/Models/UpdateLocationSettingsRequest.php +++ /dev/null @@ -1,62 +0,0 @@ -locationSettings = $locationSettings; - } - - /** - * Returns Location Settings. - */ - public function getLocationSettings(): CheckoutLocationSettings - { - return $this->locationSettings; - } - - /** - * Sets Location Settings. - * - * @required - * @maps location_settings - */ - public function setLocationSettings(CheckoutLocationSettings $locationSettings): void - { - $this->locationSettings = $locationSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['location_settings'] = $this->locationSettings; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateLocationSettingsResponse.php b/src/Models/UpdateLocationSettingsResponse.php deleted file mode 100644 index 9e0a9327..00000000 --- a/src/Models/UpdateLocationSettingsResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred when updating the location settings. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Location Settings. - */ - public function getLocationSettings(): ?CheckoutLocationSettings - { - return $this->locationSettings; - } - - /** - * Sets Location Settings. - * - * @maps location_settings - */ - public function setLocationSettings(?CheckoutLocationSettings $locationSettings): void - { - $this->locationSettings = $locationSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->locationSettings)) { - $json['location_settings'] = $this->locationSettings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateMerchantCustomAttributeDefinitionRequest.php b/src/Models/UpdateMerchantCustomAttributeDefinitionRequest.php deleted file mode 100644 index eb4f5d88..00000000 --- a/src/Models/UpdateMerchantCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateMerchantCustomAttributeDefinitionResponse.php b/src/Models/UpdateMerchantCustomAttributeDefinitionResponse.php deleted file mode 100644 index 4b6f8c52..00000000 --- a/src/Models/UpdateMerchantCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,97 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateMerchantSettingsRequest.php b/src/Models/UpdateMerchantSettingsRequest.php deleted file mode 100644 index ce6e3cdb..00000000 --- a/src/Models/UpdateMerchantSettingsRequest.php +++ /dev/null @@ -1,62 +0,0 @@ -merchantSettings = $merchantSettings; - } - - /** - * Returns Merchant Settings. - */ - public function getMerchantSettings(): CheckoutMerchantSettings - { - return $this->merchantSettings; - } - - /** - * Sets Merchant Settings. - * - * @required - * @maps merchant_settings - */ - public function setMerchantSettings(CheckoutMerchantSettings $merchantSettings): void - { - $this->merchantSettings = $merchantSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['merchant_settings'] = $this->merchantSettings; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateMerchantSettingsResponse.php b/src/Models/UpdateMerchantSettingsResponse.php deleted file mode 100644 index 3fd749db..00000000 --- a/src/Models/UpdateMerchantSettingsResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred when updating the merchant settings. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Merchant Settings. - */ - public function getMerchantSettings(): ?CheckoutMerchantSettings - { - return $this->merchantSettings; - } - - /** - * Sets Merchant Settings. - * - * @maps merchant_settings - */ - public function setMerchantSettings(?CheckoutMerchantSettings $merchantSettings): void - { - $this->merchantSettings = $merchantSettings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->merchantSettings)) { - $json['merchant_settings'] = $this->merchantSettings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateOrderCustomAttributeDefinitionRequest.php b/src/Models/UpdateOrderCustomAttributeDefinitionRequest.php deleted file mode 100644 index 42019526..00000000 --- a/src/Models/UpdateOrderCustomAttributeDefinitionRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - */ - public function getCustomAttributeDefinition(): CustomAttributeDefinition - { - return $this->customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @required - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateOrderCustomAttributeDefinitionResponse.php b/src/Models/UpdateOrderCustomAttributeDefinitionResponse.php deleted file mode 100644 index 43797cd7..00000000 --- a/src/Models/UpdateOrderCustomAttributeDefinitionResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -customAttributeDefinition; - } - - /** - * Sets Custom Attribute Definition. - * Represents a definition for custom attribute values. A custom attribute definition - * specifies the key, visibility, schema, and other properties for a custom attribute. - * - * @maps custom_attribute_definition - */ - public function setCustomAttributeDefinition(?CustomAttributeDefinition $customAttributeDefinition): void - { - $this->customAttributeDefinition = $customAttributeDefinition; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttributeDefinition)) { - $json['custom_attribute_definition'] = $this->customAttributeDefinition; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateOrderRequest.php b/src/Models/UpdateOrderRequest.php deleted file mode 100644 index 28ec6c8e..00000000 --- a/src/Models/UpdateOrderRequest.php +++ /dev/null @@ -1,191 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Fields to Clear. - * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update- - * orders#identifying-fields-to-delete) - * fields to clear. For example, `line_items[uid].note`. - * For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders#deleting-fields). - * - * @return string[]|null - */ - public function getFieldsToClear(): ?array - { - if (count($this->fieldsToClear) == 0) { - return null; - } - return $this->fieldsToClear['value']; - } - - /** - * Sets Fields to Clear. - * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update- - * orders#identifying-fields-to-delete) - * fields to clear. For example, `line_items[uid].note`. - * For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders#deleting-fields). - * - * @maps fields_to_clear - * - * @param string[]|null $fieldsToClear - */ - public function setFieldsToClear(?array $fieldsToClear): void - { - $this->fieldsToClear['value'] = $fieldsToClear; - } - - /** - * Unsets Fields to Clear. - * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update- - * orders#identifying-fields-to-delete) - * fields to clear. For example, `line_items[uid].note`. - * For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage- - * orders/update-orders#deleting-fields). - */ - public function unsetFieldsToClear(): void - { - $this->fieldsToClear = []; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this update request. - * - * If you are unsure whether a particular update was applied to an order successfully, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate updates to the order. - * The latest order version is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this update request. - * - * If you are unsure whether a particular update was applied to an order successfully, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate updates to the order. - * The latest order version is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A value you specify that uniquely identifies this update request. - * - * If you are unsure whether a particular update was applied to an order successfully, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate updates to the order. - * The latest order version is returned. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (!empty($this->fieldsToClear)) { - $json['fields_to_clear'] = $this->fieldsToClear['value']; - } - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateOrderResponse.php b/src/Models/UpdateOrderResponse.php deleted file mode 100644 index c2e12901..00000000 --- a/src/Models/UpdateOrderResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -order; - } - - /** - * Sets Order. - * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. `Order` objects also - * include information about any associated tenders, refunds, and returns. - * - * All Connect V2 Transactions have all been converted to Orders including all associated - * itemization data. - * - * @maps order - */ - public function setOrder(?Order $order): void - { - $this->order = $order; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdatePaymentLinkRequest.php b/src/Models/UpdatePaymentLinkRequest.php deleted file mode 100644 index 626537d1..00000000 --- a/src/Models/UpdatePaymentLinkRequest.php +++ /dev/null @@ -1,62 +0,0 @@ -paymentLink = $paymentLink; - } - - /** - * Returns Payment Link. - */ - public function getPaymentLink(): PaymentLink - { - return $this->paymentLink; - } - - /** - * Sets Payment Link. - * - * @required - * @maps payment_link - */ - public function setPaymentLink(PaymentLink $paymentLink): void - { - $this->paymentLink = $paymentLink; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['payment_link'] = $this->paymentLink; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdatePaymentLinkResponse.php b/src/Models/UpdatePaymentLinkResponse.php deleted file mode 100644 index 46bd5703..00000000 --- a/src/Models/UpdatePaymentLinkResponse.php +++ /dev/null @@ -1,87 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred when updating the payment link. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment Link. - */ - public function getPaymentLink(): ?PaymentLink - { - return $this->paymentLink; - } - - /** - * Sets Payment Link. - * - * @maps payment_link - */ - public function setPaymentLink(?PaymentLink $paymentLink): void - { - $this->paymentLink = $paymentLink; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->paymentLink)) { - $json['payment_link'] = $this->paymentLink; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdatePaymentRequest.php b/src/Models/UpdatePaymentRequest.php deleted file mode 100644 index ff1a6e0d..00000000 --- a/src/Models/UpdatePaymentRequest.php +++ /dev/null @@ -1,104 +0,0 @@ -idempotencyKey = $idempotencyKey; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Returns Idempotency Key. - * A unique string that identifies this `UpdatePayment` request. Keys can be any valid string - * but must be unique for every `UpdatePayment` request. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies this `UpdatePayment` request. Keys can be any valid string - * but must be unique for every `UpdatePayment` request. - * - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json['idempotency_key'] = $this->idempotencyKey; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdatePaymentResponse.php b/src/Models/UpdatePaymentResponse.php deleted file mode 100644 index 8413dfa1..00000000 --- a/src/Models/UpdatePaymentResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Payment. - * Represents a payment processed by the Square API. - */ - public function getPayment(): ?Payment - { - return $this->payment; - } - - /** - * Sets Payment. - * Represents a payment processed by the Square API. - * - * @maps payment - */ - public function setPayment(?Payment $payment): void - { - $this->payment = $payment; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->payment)) { - $json['payment'] = $this->payment; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateShiftRequest.php b/src/Models/UpdateShiftRequest.php deleted file mode 100644 index 12ff7dc5..00000000 --- a/src/Models/UpdateShiftRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -shift = $shift; - } - - /** - * Returns Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - */ - public function getShift(): Shift - { - return $this->shift; - } - - /** - * Sets Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - * - * @required - * @maps shift - */ - public function setShift(Shift $shift): void - { - $this->shift = $shift; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['shift'] = $this->shift; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateShiftResponse.php b/src/Models/UpdateShiftResponse.php deleted file mode 100644 index 7fa990e7..00000000 --- a/src/Models/UpdateShiftResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -shift; - } - - /** - * Sets Shift. - * A record of the hourly rate, start, and end times for a single work shift - * for an employee. This might include a record of the start and end times for breaks - * taken during the shift. - * - * @maps shift - */ - public function setShift(?Shift $shift): void - { - $this->shift = $shift; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->shift)) { - $json['shift'] = $this->shift; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateSubscriptionRequest.php b/src/Models/UpdateSubscriptionRequest.php deleted file mode 100644 index 96e7f70c..00000000 --- a/src/Models/UpdateSubscriptionRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateSubscriptionResponse.php b/src/Models/UpdateSubscriptionResponse.php deleted file mode 100644 index 3657ca1a..00000000 --- a/src/Models/UpdateSubscriptionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - */ - public function getSubscription(): ?Subscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents a subscription purchased by a customer. - * - * For more information, see - * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). - * - * @maps subscription - */ - public function setSubscription(?Subscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateTeamMemberRequest.php b/src/Models/UpdateTeamMemberRequest.php deleted file mode 100644 index 10aaf2d7..00000000 --- a/src/Models/UpdateTeamMemberRequest.php +++ /dev/null @@ -1,60 +0,0 @@ -teamMember; - } - - /** - * Sets Team Member. - * A record representing an individual team member for a business. - * - * @maps team_member - */ - public function setTeamMember(?TeamMember $teamMember): void - { - $this->teamMember = $teamMember; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMember)) { - $json['team_member'] = $this->teamMember; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateTeamMemberResponse.php b/src/Models/UpdateTeamMemberResponse.php deleted file mode 100644 index 883ad743..00000000 --- a/src/Models/UpdateTeamMemberResponse.php +++ /dev/null @@ -1,93 +0,0 @@ -teamMember; - } - - /** - * Sets Team Member. - * A record representing an individual team member for a business. - * - * @maps team_member - */ - public function setTeamMember(?TeamMember $teamMember): void - { - $this->teamMember = $teamMember; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->teamMember)) { - $json['team_member'] = $this->teamMember; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateVendorRequest.php b/src/Models/UpdateVendorRequest.php deleted file mode 100644 index 28a48947..00000000 --- a/src/Models/UpdateVendorRequest.php +++ /dev/null @@ -1,125 +0,0 @@ -vendor = $vendor; - } - - /** - * Returns Idempotency Key. - * A client-supplied, universally unique identifier (UUID) for the - * request. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A client-supplied, universally unique identifier (UUID) for the - * request. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A client-supplied, universally unique identifier (UUID) for the - * request. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * in the - * [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more - * information. - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Returns Vendor. - * Represents a supplier to a seller. - */ - public function getVendor(): Vendor - { - return $this->vendor; - } - - /** - * Sets Vendor. - * Represents a supplier to a seller. - * - * @required - * @maps vendor - */ - public function setVendor(Vendor $vendor): void - { - $this->vendor = $vendor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json['vendor'] = $this->vendor; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateVendorResponse.php b/src/Models/UpdateVendorResponse.php deleted file mode 100644 index 2425fdc1..00000000 --- a/src/Models/UpdateVendorResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Errors occurred when the request fails. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Vendor. - * Represents a supplier to a seller. - */ - public function getVendor(): ?Vendor - { - return $this->vendor; - } - - /** - * Sets Vendor. - * Represents a supplier to a seller. - * - * @maps vendor - */ - public function setVendor(?Vendor $vendor): void - { - $this->vendor = $vendor; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->vendor)) { - $json['vendor'] = $this->vendor; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWageSettingRequest.php b/src/Models/UpdateWageSettingRequest.php deleted file mode 100644 index db870de1..00000000 --- a/src/Models/UpdateWageSettingRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -wageSetting = $wageSetting; - } - - /** - * Returns Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - */ - public function getWageSetting(): WageSetting - { - return $this->wageSetting; - } - - /** - * Sets Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - * - * @required - * @maps wage_setting - */ - public function setWageSetting(WageSetting $wageSetting): void - { - $this->wageSetting = $wageSetting; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['wage_setting'] = $this->wageSetting; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWageSettingResponse.php b/src/Models/UpdateWageSettingResponse.php deleted file mode 100644 index f44fb33f..00000000 --- a/src/Models/UpdateWageSettingResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -wageSetting; - } - - /** - * Sets Wage Setting. - * Represents information about the overtime exemption status, job assignments, and compensation - * for a [team member]($m/TeamMember). - * - * @maps wage_setting - */ - public function setWageSetting(?WageSetting $wageSetting): void - { - $this->wageSetting = $wageSetting; - } - - /** - * Returns Errors. - * The errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * The errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->wageSetting)) { - $json['wage_setting'] = $this->wageSetting; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWebhookSubscriptionRequest.php b/src/Models/UpdateWebhookSubscriptionRequest.php deleted file mode 100644 index e4531432..00000000 --- a/src/Models/UpdateWebhookSubscriptionRequest.php +++ /dev/null @@ -1,62 +0,0 @@ -subscription; - } - - /** - * Sets Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @maps subscription - */ - public function setSubscription(?WebhookSubscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWebhookSubscriptionResponse.php b/src/Models/UpdateWebhookSubscriptionResponse.php deleted file mode 100644 index 4deec34f..00000000 --- a/src/Models/UpdateWebhookSubscriptionResponse.php +++ /dev/null @@ -1,99 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - */ - public function getSubscription(): ?WebhookSubscription - { - return $this->subscription; - } - - /** - * Sets Subscription. - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. - * - * @maps subscription - */ - public function setSubscription(?WebhookSubscription $subscription): void - { - $this->subscription = $subscription; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->subscription)) { - $json['subscription'] = $this->subscription; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWebhookSubscriptionSignatureKeyRequest.php b/src/Models/UpdateWebhookSubscriptionSignatureKeyRequest.php deleted file mode 100644 index 1fee71ca..00000000 --- a/src/Models/UpdateWebhookSubscriptionSignatureKeyRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint: - * WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request. - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint: - * WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request. - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWebhookSubscriptionSignatureKeyResponse.php b/src/Models/UpdateWebhookSubscriptionSignatureKeyResponse.php deleted file mode 100644 index 7271f034..00000000 --- a/src/Models/UpdateWebhookSubscriptionSignatureKeyResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Information on errors encountered during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Signature Key. - * The new Square-generated signature key used to validate the origin of the webhook event. - */ - public function getSignatureKey(): ?string - { - return $this->signatureKey; - } - - /** - * Sets Signature Key. - * The new Square-generated signature key used to validate the origin of the webhook event. - * - * @maps signature_key - */ - public function setSignatureKey(?string $signatureKey): void - { - $this->signatureKey = $signatureKey; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->signatureKey)) { - $json['signature_key'] = $this->signatureKey; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWorkweekConfigRequest.php b/src/Models/UpdateWorkweekConfigRequest.php deleted file mode 100644 index b37fa8d3..00000000 --- a/src/Models/UpdateWorkweekConfigRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -workweekConfig = $workweekConfig; - } - - /** - * Returns Workweek Config. - * Sets the day of the week and hour of the day that a business starts a - * workweek. This is used to calculate overtime pay. - */ - public function getWorkweekConfig(): WorkweekConfig - { - return $this->workweekConfig; - } - - /** - * Sets Workweek Config. - * Sets the day of the week and hour of the day that a business starts a - * workweek. This is used to calculate overtime pay. - * - * @required - * @maps workweek_config - */ - public function setWorkweekConfig(WorkweekConfig $workweekConfig): void - { - $this->workweekConfig = $workweekConfig; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['workweek_config'] = $this->workweekConfig; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateWorkweekConfigResponse.php b/src/Models/UpdateWorkweekConfigResponse.php deleted file mode 100644 index 6acaf8dc..00000000 --- a/src/Models/UpdateWorkweekConfigResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -workweekConfig; - } - - /** - * Sets Workweek Config. - * Sets the day of the week and hour of the day that a business starts a - * workweek. This is used to calculate overtime pay. - * - * @maps workweek_config - */ - public function setWorkweekConfig(?WorkweekConfig $workweekConfig): void - { - $this->workweekConfig = $workweekConfig; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->workweekConfig)) { - $json['workweek_config'] = $this->workweekConfig; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertBookingCustomAttributeRequest.php b/src/Models/UpsertBookingCustomAttributeRequest.php deleted file mode 100644 index f584540d..00000000 --- a/src/Models/UpsertBookingCustomAttributeRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -customAttribute = $customAttribute; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertBookingCustomAttributeResponse.php b/src/Models/UpsertBookingCustomAttributeResponse.php deleted file mode 100644 index 67fb7f4d..00000000 --- a/src/Models/UpsertBookingCustomAttributeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertCatalogObjectRequest.php b/src/Models/UpsertCatalogObjectRequest.php deleted file mode 100644 index 263de105..00000000 --- a/src/Models/UpsertCatalogObjectRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -idempotencyKey = $idempotencyKey; - $this->object = $object; - } - - /** - * Returns Idempotency Key. - * A value you specify that uniquely identifies this - * request among all your requests. A common way to create - * a valid idempotency key is to use a Universally unique - * identifier (UUID). - * - * If you're unsure whether a particular request was successful, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate objects. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * for more information. - */ - public function getIdempotencyKey(): string - { - return $this->idempotencyKey; - } - - /** - * Sets Idempotency Key. - * A value you specify that uniquely identifies this - * request among all your requests. A common way to create - * a valid idempotency key is to use a Universally unique - * identifier (UUID). - * - * If you're unsure whether a particular request was successful, - * you can reattempt it with the same idempotency key without - * worrying about creating duplicate objects. - * - * See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) - * for more information. - * - * @required - * @maps idempotency_key - */ - public function setIdempotencyKey(string $idempotencyKey): void - { - $this->idempotencyKey = $idempotencyKey; - } - - /** - * Returns Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getObject(): CatalogObject - { - return $this->object; - } - - /** - * Sets Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @required - * @maps object - */ - public function setObject(CatalogObject $object): void - { - $this->object = $object; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['idempotency_key'] = $this->idempotencyKey; - $json['object'] = $this->object; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertCatalogObjectResponse.php b/src/Models/UpsertCatalogObjectResponse.php deleted file mode 100644 index 7d86706b..00000000 --- a/src/Models/UpsertCatalogObjectResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Catalog Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - public function getCatalogObject(): ?CatalogObject - { - return $this->catalogObject; - } - - /** - * Sets Catalog Object. - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to - * yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on - * the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``- - * specific data set on the `_data` attribute. The resulting `CatalogObject` instance is - * also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - * - * @maps catalog_object - */ - public function setCatalogObject(?CatalogObject $catalogObject): void - { - $this->catalogObject = $catalogObject; - } - - /** - * Returns Id Mappings. - * The mapping between client and server IDs for this upsert. - * - * @return CatalogIdMapping[]|null - */ - public function getIdMappings(): ?array - { - return $this->idMappings; - } - - /** - * Sets Id Mappings. - * The mapping between client and server IDs for this upsert. - * - * @maps id_mappings - * - * @param CatalogIdMapping[]|null $idMappings - */ - public function setIdMappings(?array $idMappings): void - { - $this->idMappings = $idMappings; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->catalogObject)) { - $json['catalog_object'] = $this->catalogObject; - } - if (isset($this->idMappings)) { - $json['id_mappings'] = $this->idMappings; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertCustomerCustomAttributeRequest.php b/src/Models/UpsertCustomerCustomAttributeRequest.php deleted file mode 100644 index 789fe36f..00000000 --- a/src/Models/UpsertCustomerCustomAttributeRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -customAttribute = $customAttribute; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertCustomerCustomAttributeResponse.php b/src/Models/UpsertCustomerCustomAttributeResponse.php deleted file mode 100644 index ba0c38e6..00000000 --- a/src/Models/UpsertCustomerCustomAttributeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertLocationCustomAttributeRequest.php b/src/Models/UpsertLocationCustomAttributeRequest.php deleted file mode 100644 index 7304c778..00000000 --- a/src/Models/UpsertLocationCustomAttributeRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -customAttribute = $customAttribute; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertLocationCustomAttributeResponse.php b/src/Models/UpsertLocationCustomAttributeResponse.php deleted file mode 100644 index 55d802da..00000000 --- a/src/Models/UpsertLocationCustomAttributeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertMerchantCustomAttributeRequest.php b/src/Models/UpsertMerchantCustomAttributeRequest.php deleted file mode 100644 index 12a8f625..00000000 --- a/src/Models/UpsertMerchantCustomAttributeRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -customAttribute = $customAttribute; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. For more information, - * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertMerchantCustomAttributeResponse.php b/src/Models/UpsertMerchantCustomAttributeResponse.php deleted file mode 100644 index d8aeaefe..00000000 --- a/src/Models/UpsertMerchantCustomAttributeResponse.php +++ /dev/null @@ -1,96 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertOrderCustomAttributeRequest.php b/src/Models/UpsertOrderCustomAttributeRequest.php deleted file mode 100644 index 538112bd..00000000 --- a/src/Models/UpsertOrderCustomAttributeRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -customAttribute = $customAttribute; - } - - /** - * Returns Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - */ - public function getCustomAttribute(): CustomAttribute - { - return $this->customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @required - * @maps custom_attribute - */ - public function setCustomAttribute(CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function getIdempotencyKey(): ?string - { - if (count($this->idempotencyKey) == 0) { - return null; - } - return $this->idempotencyKey['value']; - } - - /** - * Sets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - * - * @maps idempotency_key - */ - public function setIdempotencyKey(?string $idempotencyKey): void - { - $this->idempotencyKey['value'] = $idempotencyKey; - } - - /** - * Unsets Idempotency Key. - * A unique identifier for this request, used to ensure idempotency. - * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api- - * patterns/idempotency). - */ - public function unsetIdempotencyKey(): void - { - $this->idempotencyKey = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['custom_attribute'] = $this->customAttribute; - if (!empty($this->idempotencyKey)) { - $json['idempotency_key'] = $this->idempotencyKey['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertOrderCustomAttributeResponse.php b/src/Models/UpsertOrderCustomAttributeResponse.php deleted file mode 100644 index 26a5a1ae..00000000 --- a/src/Models/UpsertOrderCustomAttributeResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -customAttribute; - } - - /** - * Sets Custom Attribute. - * A custom attribute value. Each custom attribute value has a corresponding - * `CustomAttributeDefinition` object. - * - * @maps custom_attribute - */ - public function setCustomAttribute(?CustomAttribute $customAttribute): void - { - $this->customAttribute = $customAttribute; - } - - /** - * Returns Errors. - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->customAttribute)) { - $json['custom_attribute'] = $this->customAttribute; - } - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertSnippetRequest.php b/src/Models/UpsertSnippetRequest.php deleted file mode 100644 index fa4ada9e..00000000 --- a/src/Models/UpsertSnippetRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -snippet = $snippet; - } - - /** - * Returns Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - */ - public function getSnippet(): Snippet - { - return $this->snippet; - } - - /** - * Sets Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - * - * @required - * @maps snippet - */ - public function setSnippet(Snippet $snippet): void - { - $this->snippet = $snippet; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['snippet'] = $this->snippet; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpsertSnippetResponse.php b/src/Models/UpsertSnippetResponse.php deleted file mode 100644 index a4a7f0e1..00000000 --- a/src/Models/UpsertSnippetResponse.php +++ /dev/null @@ -1,94 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Returns Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - */ - public function getSnippet(): ?Snippet - { - return $this->snippet; - } - - /** - * Sets Snippet. - * Represents the snippet that is added to a Square Online site. The snippet code is injected into the - * `head` element of all pages on the site, except for checkout pages. - * - * @maps snippet - */ - public function setSnippet(?Snippet $snippet): void - { - $this->snippet = $snippet; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - if (isset($this->snippet)) { - $json['snippet'] = $this->snippet; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1Device.php b/src/Models/V1Device.php deleted file mode 100644 index b6c1ace1..00000000 --- a/src/Models/V1Device.php +++ /dev/null @@ -1,97 +0,0 @@ -id; - } - - /** - * Sets Id. - * The device's Square-issued ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The device's merchant-specified name. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The device's merchant-specified name. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The device's merchant-specified name. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1ListOrdersRequest.php b/src/Models/V1ListOrdersRequest.php deleted file mode 100644 index a1c34cc1..00000000 --- a/src/Models/V1ListOrdersRequest.php +++ /dev/null @@ -1,140 +0,0 @@ -order; - } - - /** - * Sets Order. - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - * - * @maps order - */ - public function setOrder(?string $order): void - { - $this->order = $order; - } - - /** - * Returns Limit. - * The maximum number of payments to return in a single response. This value cannot exceed 200. - */ - public function getLimit(): ?int - { - if (count($this->limit) == 0) { - return null; - } - return $this->limit['value']; - } - - /** - * Sets Limit. - * The maximum number of payments to return in a single response. This value cannot exceed 200. - * - * @maps limit - */ - public function setLimit(?int $limit): void - { - $this->limit['value'] = $limit; - } - - /** - * Unsets Limit. - * The maximum number of payments to return in a single response. This value cannot exceed 200. - */ - public function unsetLimit(): void - { - $this->limit = []; - } - - /** - * Returns Batch Token. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. - */ - public function getBatchToken(): ?string - { - if (count($this->batchToken) == 0) { - return null; - } - return $this->batchToken['value']; - } - - /** - * Sets Batch Token. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. - * - * @maps batch_token - */ - public function setBatchToken(?string $batchToken): void - { - $this->batchToken['value'] = $batchToken; - } - - /** - * Unsets Batch Token. - * A pagination cursor to retrieve the next set of results for your - * original query to the endpoint. - */ - public function unsetBatchToken(): void - { - $this->batchToken = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->order)) { - $json['order'] = $this->order; - } - if (!empty($this->limit)) { - $json['limit'] = $this->limit['value']; - } - if (!empty($this->batchToken)) { - $json['batch_token'] = $this->batchToken['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1ListOrdersResponse.php b/src/Models/V1ListOrdersResponse.php deleted file mode 100644 index 9c574bcc..00000000 --- a/src/Models/V1ListOrdersResponse.php +++ /dev/null @@ -1,59 +0,0 @@ -items; - } - - /** - * Sets Items. - * - * @maps items - * - * @param V1Order[]|null $items - */ - public function setItems(?array $items): void - { - $this->items = $items; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->items)) { - $json['items'] = $this->items; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1Money.php b/src/Models/V1Money.php deleted file mode 100644 index 74631059..00000000 --- a/src/Models/V1Money.php +++ /dev/null @@ -1,102 +0,0 @@ -amount) == 0) { - return null; - } - return $this->amount['value']; - } - - /** - * Sets Amount. - * Amount in the lowest denominated value of this Currency. E.g. in USD - * these are cents, in JPY they are Yen (which do not have a 'cent' concept). - * - * @maps amount - */ - public function setAmount(?int $amount): void - { - $this->amount['value'] = $amount; - } - - /** - * Unsets Amount. - * Amount in the lowest denominated value of this Currency. E.g. in USD - * these are cents, in JPY they are Yen (which do not have a 'cent' concept). - */ - public function unsetAmount(): void - { - $this->amount = []; - } - - /** - * Returns Currency Code. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - */ - public function getCurrencyCode(): ?string - { - return $this->currencyCode; - } - - /** - * Sets Currency Code. - * Indicates the associated currency for an amount of money. Values correspond - * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). - * - * @maps currency_code - */ - public function setCurrencyCode(?string $currencyCode): void - { - $this->currencyCode = $currencyCode; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->amount)) { - $json['amount'] = $this->amount['value']; - } - if (isset($this->currencyCode)) { - $json['currency_code'] = $this->currencyCode; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1Order.php b/src/Models/V1Order.php deleted file mode 100644 index e9c9458a..00000000 --- a/src/Models/V1Order.php +++ /dev/null @@ -1,945 +0,0 @@ -errors) == 0) { - return null; - } - return $this->errors['value']; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors['value'] = $errors; - } - - /** - * Unsets Errors. - * Any errors that occurred during the request. - */ - public function unsetErrors(): void - { - $this->errors = []; - } - - /** - * Returns Id. - * The order's unique identifier. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The order's unique identifier. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Buyer Email. - * The email address of the order's buyer. - */ - public function getBuyerEmail(): ?string - { - if (count($this->buyerEmail) == 0) { - return null; - } - return $this->buyerEmail['value']; - } - - /** - * Sets Buyer Email. - * The email address of the order's buyer. - * - * @maps buyer_email - */ - public function setBuyerEmail(?string $buyerEmail): void - { - $this->buyerEmail['value'] = $buyerEmail; - } - - /** - * Unsets Buyer Email. - * The email address of the order's buyer. - */ - public function unsetBuyerEmail(): void - { - $this->buyerEmail = []; - } - - /** - * Returns Recipient Name. - * The name of the order's buyer. - */ - public function getRecipientName(): ?string - { - if (count($this->recipientName) == 0) { - return null; - } - return $this->recipientName['value']; - } - - /** - * Sets Recipient Name. - * The name of the order's buyer. - * - * @maps recipient_name - */ - public function setRecipientName(?string $recipientName): void - { - $this->recipientName['value'] = $recipientName; - } - - /** - * Unsets Recipient Name. - * The name of the order's buyer. - */ - public function unsetRecipientName(): void - { - $this->recipientName = []; - } - - /** - * Returns Recipient Phone Number. - * The phone number to use for the order's delivery. - */ - public function getRecipientPhoneNumber(): ?string - { - if (count($this->recipientPhoneNumber) == 0) { - return null; - } - return $this->recipientPhoneNumber['value']; - } - - /** - * Sets Recipient Phone Number. - * The phone number to use for the order's delivery. - * - * @maps recipient_phone_number - */ - public function setRecipientPhoneNumber(?string $recipientPhoneNumber): void - { - $this->recipientPhoneNumber['value'] = $recipientPhoneNumber; - } - - /** - * Unsets Recipient Phone Number. - * The phone number to use for the order's delivery. - */ - public function unsetRecipientPhoneNumber(): void - { - $this->recipientPhoneNumber = []; - } - - /** - * Returns State. - */ - public function getState(): ?string - { - return $this->state; - } - - /** - * Sets State. - * - * @maps state - */ - public function setState(?string $state): void - { - $this->state = $state; - } - - /** - * Returns Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getShippingAddress(): ?Address - { - return $this->shippingAddress; - } - - /** - * Sets Shipping Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps shipping_address - */ - public function setShippingAddress(?Address $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * Returns Subtotal Money. - */ - public function getSubtotalMoney(): ?V1Money - { - return $this->subtotalMoney; - } - - /** - * Sets Subtotal Money. - * - * @maps subtotal_money - */ - public function setSubtotalMoney(?V1Money $subtotalMoney): void - { - $this->subtotalMoney = $subtotalMoney; - } - - /** - * Returns Total Shipping Money. - */ - public function getTotalShippingMoney(): ?V1Money - { - return $this->totalShippingMoney; - } - - /** - * Sets Total Shipping Money. - * - * @maps total_shipping_money - */ - public function setTotalShippingMoney(?V1Money $totalShippingMoney): void - { - $this->totalShippingMoney = $totalShippingMoney; - } - - /** - * Returns Total Tax Money. - */ - public function getTotalTaxMoney(): ?V1Money - { - return $this->totalTaxMoney; - } - - /** - * Sets Total Tax Money. - * - * @maps total_tax_money - */ - public function setTotalTaxMoney(?V1Money $totalTaxMoney): void - { - $this->totalTaxMoney = $totalTaxMoney; - } - - /** - * Returns Total Price Money. - */ - public function getTotalPriceMoney(): ?V1Money - { - return $this->totalPriceMoney; - } - - /** - * Sets Total Price Money. - * - * @maps total_price_money - */ - public function setTotalPriceMoney(?V1Money $totalPriceMoney): void - { - $this->totalPriceMoney = $totalPriceMoney; - } - - /** - * Returns Total Discount Money. - */ - public function getTotalDiscountMoney(): ?V1Money - { - return $this->totalDiscountMoney; - } - - /** - * Sets Total Discount Money. - * - * @maps total_discount_money - */ - public function setTotalDiscountMoney(?V1Money $totalDiscountMoney): void - { - $this->totalDiscountMoney = $totalDiscountMoney; - } - - /** - * Returns Created At. - * The time when the order was created, in ISO 8601 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the order was created, in ISO 8601 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The time when the order was last modified, in ISO 8601 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The time when the order was last modified, in ISO 8601 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Expires At. - * The time when the order expires if no action is taken, in ISO 8601 format. - */ - public function getExpiresAt(): ?string - { - if (count($this->expiresAt) == 0) { - return null; - } - return $this->expiresAt['value']; - } - - /** - * Sets Expires At. - * The time when the order expires if no action is taken, in ISO 8601 format. - * - * @maps expires_at - */ - public function setExpiresAt(?string $expiresAt): void - { - $this->expiresAt['value'] = $expiresAt; - } - - /** - * Unsets Expires At. - * The time when the order expires if no action is taken, in ISO 8601 format. - */ - public function unsetExpiresAt(): void - { - $this->expiresAt = []; - } - - /** - * Returns Payment Id. - * The unique identifier of the payment associated with the order. - */ - public function getPaymentId(): ?string - { - if (count($this->paymentId) == 0) { - return null; - } - return $this->paymentId['value']; - } - - /** - * Sets Payment Id. - * The unique identifier of the payment associated with the order. - * - * @maps payment_id - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId['value'] = $paymentId; - } - - /** - * Unsets Payment Id. - * The unique identifier of the payment associated with the order. - */ - public function unsetPaymentId(): void - { - $this->paymentId = []; - } - - /** - * Returns Buyer Note. - * A note provided by the buyer when the order was created, if any. - */ - public function getBuyerNote(): ?string - { - if (count($this->buyerNote) == 0) { - return null; - } - return $this->buyerNote['value']; - } - - /** - * Sets Buyer Note. - * A note provided by the buyer when the order was created, if any. - * - * @maps buyer_note - */ - public function setBuyerNote(?string $buyerNote): void - { - $this->buyerNote['value'] = $buyerNote; - } - - /** - * Unsets Buyer Note. - * A note provided by the buyer when the order was created, if any. - */ - public function unsetBuyerNote(): void - { - $this->buyerNote = []; - } - - /** - * Returns Completed Note. - * A note provided by the merchant when the order's state was set to COMPLETED, if any - */ - public function getCompletedNote(): ?string - { - if (count($this->completedNote) == 0) { - return null; - } - return $this->completedNote['value']; - } - - /** - * Sets Completed Note. - * A note provided by the merchant when the order's state was set to COMPLETED, if any - * - * @maps completed_note - */ - public function setCompletedNote(?string $completedNote): void - { - $this->completedNote['value'] = $completedNote; - } - - /** - * Unsets Completed Note. - * A note provided by the merchant when the order's state was set to COMPLETED, if any - */ - public function unsetCompletedNote(): void - { - $this->completedNote = []; - } - - /** - * Returns Refunded Note. - * A note provided by the merchant when the order's state was set to REFUNDED, if any. - */ - public function getRefundedNote(): ?string - { - if (count($this->refundedNote) == 0) { - return null; - } - return $this->refundedNote['value']; - } - - /** - * Sets Refunded Note. - * A note provided by the merchant when the order's state was set to REFUNDED, if any. - * - * @maps refunded_note - */ - public function setRefundedNote(?string $refundedNote): void - { - $this->refundedNote['value'] = $refundedNote; - } - - /** - * Unsets Refunded Note. - * A note provided by the merchant when the order's state was set to REFUNDED, if any. - */ - public function unsetRefundedNote(): void - { - $this->refundedNote = []; - } - - /** - * Returns Canceled Note. - * A note provided by the merchant when the order's state was set to CANCELED, if any. - */ - public function getCanceledNote(): ?string - { - if (count($this->canceledNote) == 0) { - return null; - } - return $this->canceledNote['value']; - } - - /** - * Sets Canceled Note. - * A note provided by the merchant when the order's state was set to CANCELED, if any. - * - * @maps canceled_note - */ - public function setCanceledNote(?string $canceledNote): void - { - $this->canceledNote['value'] = $canceledNote; - } - - /** - * Unsets Canceled Note. - * A note provided by the merchant when the order's state was set to CANCELED, if any. - */ - public function unsetCanceledNote(): void - { - $this->canceledNote = []; - } - - /** - * Returns Tender. - * A tender represents a discrete monetary exchange. Square represents this - * exchange as a money object with a specific currency and amount, where the - * amount is given in the smallest denomination of the given currency. - * - * Square POS can accept more than one form of tender for a single payment (such - * as by splitting a bill between a credit card and a gift card). The `tender` - * field of the Payment object lists all forms of tender used for the payment. - * - * Split tender payments behave slightly differently from single tender payments: - * - * The receipt_url for a split tender corresponds only to the first tender listed - * in the tender field. To get the receipt URLs for the remaining tenders, use - * the receipt_url fields of the corresponding Tender objects. - * - * *A note on gift cards**: when a customer purchases a Square gift card from a - * merchant, the merchant receives the full amount of the gift card in the - * associated payment. - * - * When that gift card is used as a tender, the balance of the gift card is - * reduced and the merchant receives no funds. A `Tender` object with a type of - * `SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the - * associated payment. - */ - public function getTender(): ?V1Tender - { - return $this->tender; - } - - /** - * Sets Tender. - * A tender represents a discrete monetary exchange. Square represents this - * exchange as a money object with a specific currency and amount, where the - * amount is given in the smallest denomination of the given currency. - * - * Square POS can accept more than one form of tender for a single payment (such - * as by splitting a bill between a credit card and a gift card). The `tender` - * field of the Payment object lists all forms of tender used for the payment. - * - * Split tender payments behave slightly differently from single tender payments: - * - * The receipt_url for a split tender corresponds only to the first tender listed - * in the tender field. To get the receipt URLs for the remaining tenders, use - * the receipt_url fields of the corresponding Tender objects. - * - * *A note on gift cards**: when a customer purchases a Square gift card from a - * merchant, the merchant receives the full amount of the gift card in the - * associated payment. - * - * When that gift card is used as a tender, the balance of the gift card is - * reduced and the merchant receives no funds. A `Tender` object with a type of - * `SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the - * associated payment. - * - * @maps tender - */ - public function setTender(?V1Tender $tender): void - { - $this->tender = $tender; - } - - /** - * Returns Order History. - * The history of actions associated with the order. - * - * @return V1OrderHistoryEntry[]|null - */ - public function getOrderHistory(): ?array - { - if (count($this->orderHistory) == 0) { - return null; - } - return $this->orderHistory['value']; - } - - /** - * Sets Order History. - * The history of actions associated with the order. - * - * @maps order_history - * - * @param V1OrderHistoryEntry[]|null $orderHistory - */ - public function setOrderHistory(?array $orderHistory): void - { - $this->orderHistory['value'] = $orderHistory; - } - - /** - * Unsets Order History. - * The history of actions associated with the order. - */ - public function unsetOrderHistory(): void - { - $this->orderHistory = []; - } - - /** - * Returns Promo Code. - * The promo code provided by the buyer, if any. - */ - public function getPromoCode(): ?string - { - if (count($this->promoCode) == 0) { - return null; - } - return $this->promoCode['value']; - } - - /** - * Sets Promo Code. - * The promo code provided by the buyer, if any. - * - * @maps promo_code - */ - public function setPromoCode(?string $promoCode): void - { - $this->promoCode['value'] = $promoCode; - } - - /** - * Unsets Promo Code. - * The promo code provided by the buyer, if any. - */ - public function unsetPromoCode(): void - { - $this->promoCode = []; - } - - /** - * Returns Btc Receive Address. - * For Bitcoin transactions, the address that the buyer sent Bitcoin to. - */ - public function getBtcReceiveAddress(): ?string - { - if (count($this->btcReceiveAddress) == 0) { - return null; - } - return $this->btcReceiveAddress['value']; - } - - /** - * Sets Btc Receive Address. - * For Bitcoin transactions, the address that the buyer sent Bitcoin to. - * - * @maps btc_receive_address - */ - public function setBtcReceiveAddress(?string $btcReceiveAddress): void - { - $this->btcReceiveAddress['value'] = $btcReceiveAddress; - } - - /** - * Unsets Btc Receive Address. - * For Bitcoin transactions, the address that the buyer sent Bitcoin to. - */ - public function unsetBtcReceiveAddress(): void - { - $this->btcReceiveAddress = []; - } - - /** - * Returns Btc Price Satoshi. - * For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 - * BTC). - */ - public function getBtcPriceSatoshi(): ?float - { - if (count($this->btcPriceSatoshi) == 0) { - return null; - } - return $this->btcPriceSatoshi['value']; - } - - /** - * Sets Btc Price Satoshi. - * For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 - * BTC). - * - * @maps btc_price_satoshi - */ - public function setBtcPriceSatoshi(?float $btcPriceSatoshi): void - { - $this->btcPriceSatoshi['value'] = $btcPriceSatoshi; - } - - /** - * Unsets Btc Price Satoshi. - * For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 - * BTC). - */ - public function unsetBtcPriceSatoshi(): void - { - $this->btcPriceSatoshi = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->errors)) { - $json['errors'] = $this->errors['value']; - } - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->buyerEmail)) { - $json['buyer_email'] = $this->buyerEmail['value']; - } - if (!empty($this->recipientName)) { - $json['recipient_name'] = $this->recipientName['value']; - } - if (!empty($this->recipientPhoneNumber)) { - $json['recipient_phone_number'] = $this->recipientPhoneNumber['value']; - } - if (isset($this->state)) { - $json['state'] = $this->state; - } - if (isset($this->shippingAddress)) { - $json['shipping_address'] = $this->shippingAddress; - } - if (isset($this->subtotalMoney)) { - $json['subtotal_money'] = $this->subtotalMoney; - } - if (isset($this->totalShippingMoney)) { - $json['total_shipping_money'] = $this->totalShippingMoney; - } - if (isset($this->totalTaxMoney)) { - $json['total_tax_money'] = $this->totalTaxMoney; - } - if (isset($this->totalPriceMoney)) { - $json['total_price_money'] = $this->totalPriceMoney; - } - if (isset($this->totalDiscountMoney)) { - $json['total_discount_money'] = $this->totalDiscountMoney; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->expiresAt)) { - $json['expires_at'] = $this->expiresAt['value']; - } - if (!empty($this->paymentId)) { - $json['payment_id'] = $this->paymentId['value']; - } - if (!empty($this->buyerNote)) { - $json['buyer_note'] = $this->buyerNote['value']; - } - if (!empty($this->completedNote)) { - $json['completed_note'] = $this->completedNote['value']; - } - if (!empty($this->refundedNote)) { - $json['refunded_note'] = $this->refundedNote['value']; - } - if (!empty($this->canceledNote)) { - $json['canceled_note'] = $this->canceledNote['value']; - } - if (isset($this->tender)) { - $json['tender'] = $this->tender; - } - if (!empty($this->orderHistory)) { - $json['order_history'] = $this->orderHistory['value']; - } - if (!empty($this->promoCode)) { - $json['promo_code'] = $this->promoCode['value']; - } - if (!empty($this->btcReceiveAddress)) { - $json['btc_receive_address'] = $this->btcReceiveAddress['value']; - } - if (!empty($this->btcPriceSatoshi)) { - $json['btc_price_satoshi'] = $this->btcPriceSatoshi['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1OrderHistoryEntry.php b/src/Models/V1OrderHistoryEntry.php deleted file mode 100644 index 7cbd322d..00000000 --- a/src/Models/V1OrderHistoryEntry.php +++ /dev/null @@ -1,86 +0,0 @@ -action; - } - - /** - * Sets Action. - * - * @maps action - */ - public function setAction(?string $action): void - { - $this->action = $action; - } - - /** - * Returns Created At. - * The time when the action was performed, in ISO 8601 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The time when the action was performed, in ISO 8601 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->action)) { - $json['action'] = $this->action; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1OrderHistoryEntryAction.php b/src/Models/V1OrderHistoryEntryAction.php deleted file mode 100644 index 757e0225..00000000 --- a/src/Models/V1OrderHistoryEntryAction.php +++ /dev/null @@ -1,22 +0,0 @@ -callingCode = $callingCode; - $this->number = $number; - } - - /** - * Returns Calling Code. - * The phone number's international calling code. For US phone numbers, this value is +1. - */ - public function getCallingCode(): string - { - return $this->callingCode; - } - - /** - * Sets Calling Code. - * The phone number's international calling code. For US phone numbers, this value is +1. - * - * @required - * @maps calling_code - */ - public function setCallingCode(string $callingCode): void - { - $this->callingCode = $callingCode; - } - - /** - * Returns Number. - * The phone number. - */ - public function getNumber(): string - { - return $this->number; - } - - /** - * Sets Number. - * The phone number. - * - * @required - * @maps number - */ - public function setNumber(string $number): void - { - $this->number = $number; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['calling_code'] = $this->callingCode; - $json['number'] = $this->number; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1Tender.php b/src/Models/V1Tender.php deleted file mode 100644 index 06bc9372..00000000 --- a/src/Models/V1Tender.php +++ /dev/null @@ -1,594 +0,0 @@ -id; - } - - /** - * Sets Id. - * The tender's unique ID. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Type. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Name. - * A human-readable description of the tender. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * A human-readable description of the tender. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * A human-readable description of the tender. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Employee Id. - * The ID of the employee that processed the tender. - */ - public function getEmployeeId(): ?string - { - if (count($this->employeeId) == 0) { - return null; - } - return $this->employeeId['value']; - } - - /** - * Sets Employee Id. - * The ID of the employee that processed the tender. - * - * @maps employee_id - */ - public function setEmployeeId(?string $employeeId): void - { - $this->employeeId['value'] = $employeeId; - } - - /** - * Unsets Employee Id. - * The ID of the employee that processed the tender. - */ - public function unsetEmployeeId(): void - { - $this->employeeId = []; - } - - /** - * Returns Receipt Url. - * The URL of the receipt for the tender. - */ - public function getReceiptUrl(): ?string - { - if (count($this->receiptUrl) == 0) { - return null; - } - return $this->receiptUrl['value']; - } - - /** - * Sets Receipt Url. - * The URL of the receipt for the tender. - * - * @maps receipt_url - */ - public function setReceiptUrl(?string $receiptUrl): void - { - $this->receiptUrl['value'] = $receiptUrl; - } - - /** - * Unsets Receipt Url. - * The URL of the receipt for the tender. - */ - public function unsetReceiptUrl(): void - { - $this->receiptUrl = []; - } - - /** - * Returns Card Brand. - * The brand of a credit card. - */ - public function getCardBrand(): ?string - { - return $this->cardBrand; - } - - /** - * Sets Card Brand. - * The brand of a credit card. - * - * @maps card_brand - */ - public function setCardBrand(?string $cardBrand): void - { - $this->cardBrand = $cardBrand; - } - - /** - * Returns Pan Suffix. - * The last four digits of the provided credit card's account number. - */ - public function getPanSuffix(): ?string - { - if (count($this->panSuffix) == 0) { - return null; - } - return $this->panSuffix['value']; - } - - /** - * Sets Pan Suffix. - * The last four digits of the provided credit card's account number. - * - * @maps pan_suffix - */ - public function setPanSuffix(?string $panSuffix): void - { - $this->panSuffix['value'] = $panSuffix; - } - - /** - * Unsets Pan Suffix. - * The last four digits of the provided credit card's account number. - */ - public function unsetPanSuffix(): void - { - $this->panSuffix = []; - } - - /** - * Returns Entry Method. - */ - public function getEntryMethod(): ?string - { - return $this->entryMethod; - } - - /** - * Sets Entry Method. - * - * @maps entry_method - */ - public function setEntryMethod(?string $entryMethod): void - { - $this->entryMethod = $entryMethod; - } - - /** - * Returns Payment Note. - * Notes entered by the merchant about the tender at the time of payment, if any. Typically only - * present for tender with the type: OTHER. - */ - public function getPaymentNote(): ?string - { - if (count($this->paymentNote) == 0) { - return null; - } - return $this->paymentNote['value']; - } - - /** - * Sets Payment Note. - * Notes entered by the merchant about the tender at the time of payment, if any. Typically only - * present for tender with the type: OTHER. - * - * @maps payment_note - */ - public function setPaymentNote(?string $paymentNote): void - { - $this->paymentNote['value'] = $paymentNote; - } - - /** - * Unsets Payment Note. - * Notes entered by the merchant about the tender at the time of payment, if any. Typically only - * present for tender with the type: OTHER. - */ - public function unsetPaymentNote(): void - { - $this->paymentNote = []; - } - - /** - * Returns Total Money. - */ - public function getTotalMoney(): ?V1Money - { - return $this->totalMoney; - } - - /** - * Sets Total Money. - * - * @maps total_money - */ - public function setTotalMoney(?V1Money $totalMoney): void - { - $this->totalMoney = $totalMoney; - } - - /** - * Returns Tendered Money. - */ - public function getTenderedMoney(): ?V1Money - { - return $this->tenderedMoney; - } - - /** - * Sets Tendered Money. - * - * @maps tendered_money - */ - public function setTenderedMoney(?V1Money $tenderedMoney): void - { - $this->tenderedMoney = $tenderedMoney; - } - - /** - * Returns Tendered At. - * The time when the tender was created, in ISO 8601 format. - */ - public function getTenderedAt(): ?string - { - if (count($this->tenderedAt) == 0) { - return null; - } - return $this->tenderedAt['value']; - } - - /** - * Sets Tendered At. - * The time when the tender was created, in ISO 8601 format. - * - * @maps tendered_at - */ - public function setTenderedAt(?string $tenderedAt): void - { - $this->tenderedAt['value'] = $tenderedAt; - } - - /** - * Unsets Tendered At. - * The time when the tender was created, in ISO 8601 format. - */ - public function unsetTenderedAt(): void - { - $this->tenderedAt = []; - } - - /** - * Returns Settled At. - * The time when the tender was settled, in ISO 8601 format. - */ - public function getSettledAt(): ?string - { - if (count($this->settledAt) == 0) { - return null; - } - return $this->settledAt['value']; - } - - /** - * Sets Settled At. - * The time when the tender was settled, in ISO 8601 format. - * - * @maps settled_at - */ - public function setSettledAt(?string $settledAt): void - { - $this->settledAt['value'] = $settledAt; - } - - /** - * Unsets Settled At. - * The time when the tender was settled, in ISO 8601 format. - */ - public function unsetSettledAt(): void - { - $this->settledAt = []; - } - - /** - * Returns Change Back Money. - */ - public function getChangeBackMoney(): ?V1Money - { - return $this->changeBackMoney; - } - - /** - * Sets Change Back Money. - * - * @maps change_back_money - */ - public function setChangeBackMoney(?V1Money $changeBackMoney): void - { - $this->changeBackMoney = $changeBackMoney; - } - - /** - * Returns Refunded Money. - */ - public function getRefundedMoney(): ?V1Money - { - return $this->refundedMoney; - } - - /** - * Sets Refunded Money. - * - * @maps refunded_money - */ - public function setRefundedMoney(?V1Money $refundedMoney): void - { - $this->refundedMoney = $refundedMoney; - } - - /** - * Returns Is Exchange. - * Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the - * tender represents the value of goods returned in an exchange not the actual money paid. The exchange - * value reduces the tender amounts needed to pay for items purchased in the exchange. - */ - public function getIsExchange(): ?bool - { - if (count($this->isExchange) == 0) { - return null; - } - return $this->isExchange['value']; - } - - /** - * Sets Is Exchange. - * Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the - * tender represents the value of goods returned in an exchange not the actual money paid. The exchange - * value reduces the tender amounts needed to pay for items purchased in the exchange. - * - * @maps is_exchange - */ - public function setIsExchange(?bool $isExchange): void - { - $this->isExchange['value'] = $isExchange; - } - - /** - * Unsets Is Exchange. - * Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the - * tender represents the value of goods returned in an exchange not the actual money paid. The exchange - * value reduces the tender amounts needed to pay for items purchased in the exchange. - */ - public function unsetIsExchange(): void - { - $this->isExchange = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->employeeId)) { - $json['employee_id'] = $this->employeeId['value']; - } - if (!empty($this->receiptUrl)) { - $json['receipt_url'] = $this->receiptUrl['value']; - } - if (isset($this->cardBrand)) { - $json['card_brand'] = $this->cardBrand; - } - if (!empty($this->panSuffix)) { - $json['pan_suffix'] = $this->panSuffix['value']; - } - if (isset($this->entryMethod)) { - $json['entry_method'] = $this->entryMethod; - } - if (!empty($this->paymentNote)) { - $json['payment_note'] = $this->paymentNote['value']; - } - if (isset($this->totalMoney)) { - $json['total_money'] = $this->totalMoney; - } - if (isset($this->tenderedMoney)) { - $json['tendered_money'] = $this->tenderedMoney; - } - if (!empty($this->tenderedAt)) { - $json['tendered_at'] = $this->tenderedAt['value']; - } - if (!empty($this->settledAt)) { - $json['settled_at'] = $this->settledAt['value']; - } - if (isset($this->changeBackMoney)) { - $json['change_back_money'] = $this->changeBackMoney; - } - if (isset($this->refundedMoney)) { - $json['refunded_money'] = $this->refundedMoney; - } - if (!empty($this->isExchange)) { - $json['is_exchange'] = $this->isExchange['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1TenderCardBrand.php b/src/Models/V1TenderCardBrand.php deleted file mode 100644 index 74486b10..00000000 --- a/src/Models/V1TenderCardBrand.php +++ /dev/null @@ -1,29 +0,0 @@ -action = $action; - } - - /** - * Returns Action. - */ - public function getAction(): string - { - return $this->action; - } - - /** - * Sets Action. - * - * @required - * @maps action - */ - public function setAction(string $action): void - { - $this->action = $action; - } - - /** - * Returns Shipped Tracking Number. - * The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. - */ - public function getShippedTrackingNumber(): ?string - { - if (count($this->shippedTrackingNumber) == 0) { - return null; - } - return $this->shippedTrackingNumber['value']; - } - - /** - * Sets Shipped Tracking Number. - * The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. - * - * @maps shipped_tracking_number - */ - public function setShippedTrackingNumber(?string $shippedTrackingNumber): void - { - $this->shippedTrackingNumber['value'] = $shippedTrackingNumber; - } - - /** - * Unsets Shipped Tracking Number. - * The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. - */ - public function unsetShippedTrackingNumber(): void - { - $this->shippedTrackingNumber = []; - } - - /** - * Returns Completed Note. - * A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. - */ - public function getCompletedNote(): ?string - { - if (count($this->completedNote) == 0) { - return null; - } - return $this->completedNote['value']; - } - - /** - * Sets Completed Note. - * A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. - * - * @maps completed_note - */ - public function setCompletedNote(?string $completedNote): void - { - $this->completedNote['value'] = $completedNote; - } - - /** - * Unsets Completed Note. - * A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. - */ - public function unsetCompletedNote(): void - { - $this->completedNote = []; - } - - /** - * Returns Refunded Note. - * A merchant-specified note about the refunding of the order. Only valid if action is REFUND. - */ - public function getRefundedNote(): ?string - { - if (count($this->refundedNote) == 0) { - return null; - } - return $this->refundedNote['value']; - } - - /** - * Sets Refunded Note. - * A merchant-specified note about the refunding of the order. Only valid if action is REFUND. - * - * @maps refunded_note - */ - public function setRefundedNote(?string $refundedNote): void - { - $this->refundedNote['value'] = $refundedNote; - } - - /** - * Unsets Refunded Note. - * A merchant-specified note about the refunding of the order. Only valid if action is REFUND. - */ - public function unsetRefundedNote(): void - { - $this->refundedNote = []; - } - - /** - * Returns Canceled Note. - * A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. - */ - public function getCanceledNote(): ?string - { - if (count($this->canceledNote) == 0) { - return null; - } - return $this->canceledNote['value']; - } - - /** - * Sets Canceled Note. - * A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. - * - * @maps canceled_note - */ - public function setCanceledNote(?string $canceledNote): void - { - $this->canceledNote['value'] = $canceledNote; - } - - /** - * Unsets Canceled Note. - * A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. - */ - public function unsetCanceledNote(): void - { - $this->canceledNote = []; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['action'] = $this->action; - if (!empty($this->shippedTrackingNumber)) { - $json['shipped_tracking_number'] = $this->shippedTrackingNumber['value']; - } - if (!empty($this->completedNote)) { - $json['completed_note'] = $this->completedNote['value']; - } - if (!empty($this->refundedNote)) { - $json['refunded_note'] = $this->refundedNote['value']; - } - if (!empty($this->canceledNote)) { - $json['canceled_note'] = $this->canceledNote['value']; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/V1UpdateOrderRequestAction.php b/src/Models/V1UpdateOrderRequestAction.php deleted file mode 100644 index 61933cc1..00000000 --- a/src/Models/V1UpdateOrderRequestAction.php +++ /dev/null @@ -1,14 +0,0 @@ -id; - } - - /** - * Sets Id. - * A unique Square-generated ID for the [Vendor](entity:Vendor). - * This field is required when attempting to update a [Vendor](entity:Vendor). - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Created At. - * An RFC 3339-formatted timestamp that indicates when the - * [Vendor](entity:Vendor) was created. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * An RFC 3339-formatted timestamp that indicates when the - * [Vendor](entity:Vendor) was created. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * An RFC 3339-formatted timestamp that indicates when the - * [Vendor](entity:Vendor) was last updated. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * An RFC 3339-formatted timestamp that indicates when the - * [Vendor](entity:Vendor) was last updated. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Name. - * The name of the [Vendor](entity:Vendor). - * This field is required when attempting to create or update a [Vendor](entity:Vendor). - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the [Vendor](entity:Vendor). - * This field is required when attempting to create or update a [Vendor](entity:Vendor). - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the [Vendor](entity:Vendor). - * This field is required when attempting to create or update a [Vendor](entity:Vendor). - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - */ - public function getAddress(): ?Address - { - return $this->address; - } - - /** - * Sets Address. - * Represents a postal address in a country. - * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build- - * basics/working-with-addresses). - * - * @maps address - */ - public function setAddress(?Address $address): void - { - $this->address = $address; - } - - /** - * Returns Contacts. - * The contacts of the [Vendor](entity:Vendor). - * - * @return VendorContact[]|null - */ - public function getContacts(): ?array - { - if (count($this->contacts) == 0) { - return null; - } - return $this->contacts['value']; - } - - /** - * Sets Contacts. - * The contacts of the [Vendor](entity:Vendor). - * - * @maps contacts - * - * @param VendorContact[]|null $contacts - */ - public function setContacts(?array $contacts): void - { - $this->contacts['value'] = $contacts; - } - - /** - * Unsets Contacts. - * The contacts of the [Vendor](entity:Vendor). - */ - public function unsetContacts(): void - { - $this->contacts = []; - } - - /** - * Returns Account Number. - * The account number of the [Vendor](entity:Vendor). - */ - public function getAccountNumber(): ?string - { - if (count($this->accountNumber) == 0) { - return null; - } - return $this->accountNumber['value']; - } - - /** - * Sets Account Number. - * The account number of the [Vendor](entity:Vendor). - * - * @maps account_number - */ - public function setAccountNumber(?string $accountNumber): void - { - $this->accountNumber['value'] = $accountNumber; - } - - /** - * Unsets Account Number. - * The account number of the [Vendor](entity:Vendor). - */ - public function unsetAccountNumber(): void - { - $this->accountNumber = []; - } - - /** - * Returns Note. - * A note detailing information about the [Vendor](entity:Vendor). - */ - public function getNote(): ?string - { - if (count($this->note) == 0) { - return null; - } - return $this->note['value']; - } - - /** - * Sets Note. - * A note detailing information about the [Vendor](entity:Vendor). - * - * @maps note - */ - public function setNote(?string $note): void - { - $this->note['value'] = $note; - } - - /** - * Unsets Note. - * A note detailing information about the [Vendor](entity:Vendor). - */ - public function unsetNote(): void - { - $this->note = []; - } - - /** - * Returns Version. - * The version of the [Vendor](entity:Vendor). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * The version of the [Vendor](entity:Vendor). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Status. - * The status of the [Vendor]($m/Vendor), - * whether a [Vendor]($m/Vendor) is active or inactive. - */ - public function getStatus(): ?string - { - return $this->status; - } - - /** - * Sets Status. - * The status of the [Vendor]($m/Vendor), - * whether a [Vendor]($m/Vendor) is active or inactive. - * - * @maps status - */ - public function setStatus(?string $status): void - { - $this->status = $status; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (!empty($this->contacts)) { - $json['contacts'] = $this->contacts['value']; - } - if (!empty($this->accountNumber)) { - $json['account_number'] = $this->accountNumber['value']; - } - if (!empty($this->note)) { - $json['note'] = $this->note['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->status)) { - $json['status'] = $this->status; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/VendorContact.php b/src/Models/VendorContact.php deleted file mode 100644 index 38edcfd4..00000000 --- a/src/Models/VendorContact.php +++ /dev/null @@ -1,260 +0,0 @@ -ordinal = $ordinal; - } - - /** - * Returns Id. - * A unique Square-generated ID for the [VendorContact](entity:VendorContact). - * This field is required when attempting to update a [VendorContact](entity:VendorContact). - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * A unique Square-generated ID for the [VendorContact](entity:VendorContact). - * This field is required when attempting to update a [VendorContact](entity:VendorContact). - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of the [VendorContact](entity:VendorContact). - * This field is required when attempting to create a [Vendor](entity:Vendor). - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of the [VendorContact](entity:VendorContact). - * This field is required when attempting to create a [Vendor](entity:Vendor). - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of the [VendorContact](entity:VendorContact). - * This field is required when attempting to create a [Vendor](entity:Vendor). - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Email Address. - * The email address of the [VendorContact](entity:VendorContact). - */ - public function getEmailAddress(): ?string - { - if (count($this->emailAddress) == 0) { - return null; - } - return $this->emailAddress['value']; - } - - /** - * Sets Email Address. - * The email address of the [VendorContact](entity:VendorContact). - * - * @maps email_address - */ - public function setEmailAddress(?string $emailAddress): void - { - $this->emailAddress['value'] = $emailAddress; - } - - /** - * Unsets Email Address. - * The email address of the [VendorContact](entity:VendorContact). - */ - public function unsetEmailAddress(): void - { - $this->emailAddress = []; - } - - /** - * Returns Phone Number. - * The phone number of the [VendorContact](entity:VendorContact). - */ - public function getPhoneNumber(): ?string - { - if (count($this->phoneNumber) == 0) { - return null; - } - return $this->phoneNumber['value']; - } - - /** - * Sets Phone Number. - * The phone number of the [VendorContact](entity:VendorContact). - * - * @maps phone_number - */ - public function setPhoneNumber(?string $phoneNumber): void - { - $this->phoneNumber['value'] = $phoneNumber; - } - - /** - * Unsets Phone Number. - * The phone number of the [VendorContact](entity:VendorContact). - */ - public function unsetPhoneNumber(): void - { - $this->phoneNumber = []; - } - - /** - * Returns Removed. - * The state of the [VendorContact](entity:VendorContact). - */ - public function getRemoved(): ?bool - { - if (count($this->removed) == 0) { - return null; - } - return $this->removed['value']; - } - - /** - * Sets Removed. - * The state of the [VendorContact](entity:VendorContact). - * - * @maps removed - */ - public function setRemoved(?bool $removed): void - { - $this->removed['value'] = $removed; - } - - /** - * Unsets Removed. - * The state of the [VendorContact](entity:VendorContact). - */ - public function unsetRemoved(): void - { - $this->removed = []; - } - - /** - * Returns Ordinal. - * The ordinal of the [VendorContact](entity:VendorContact). - */ - public function getOrdinal(): int - { - return $this->ordinal; - } - - /** - * Sets Ordinal. - * The ordinal of the [VendorContact](entity:VendorContact). - * - * @required - * @maps ordinal - */ - public function setOrdinal(int $ordinal): void - { - $this->ordinal = $ordinal; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->emailAddress)) { - $json['email_address'] = $this->emailAddress['value']; - } - if (!empty($this->phoneNumber)) { - $json['phone_number'] = $this->phoneNumber['value']; - } - if (!empty($this->removed)) { - $json['removed'] = $this->removed['value']; - } - $json['ordinal'] = $this->ordinal; - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/VendorStatus.php b/src/Models/VendorStatus.php deleted file mode 100644 index 93d7ba80..00000000 --- a/src/Models/VendorStatus.php +++ /dev/null @@ -1,22 +0,0 @@ -errors; - } - - /** - * Sets Errors. - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->errors)) { - $json['errors'] = $this->errors; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/WageSetting.php b/src/Models/WageSetting.php deleted file mode 100644 index 62e5a177..00000000 --- a/src/Models/WageSetting.php +++ /dev/null @@ -1,252 +0,0 @@ -teamMemberId) == 0) { - return null; - } - return $this->teamMemberId['value']; - } - - /** - * Sets Team Member Id. - * The ID of the team member associated with the wage setting. - * - * @maps team_member_id - */ - public function setTeamMemberId(?string $teamMemberId): void - { - $this->teamMemberId['value'] = $teamMemberId; - } - - /** - * Unsets Team Member Id. - * The ID of the team member associated with the wage setting. - */ - public function unsetTeamMemberId(): void - { - $this->teamMemberId = []; - } - - /** - * Returns Job Assignments. - * **Required** The ordered list of jobs that the team member is assigned to. - * The first job assignment is considered the team member's primary job. - * - * @return JobAssignment[]|null - */ - public function getJobAssignments(): ?array - { - if (count($this->jobAssignments) == 0) { - return null; - } - return $this->jobAssignments['value']; - } - - /** - * Sets Job Assignments. - * **Required** The ordered list of jobs that the team member is assigned to. - * The first job assignment is considered the team member's primary job. - * - * @maps job_assignments - * - * @param JobAssignment[]|null $jobAssignments - */ - public function setJobAssignments(?array $jobAssignments): void - { - $this->jobAssignments['value'] = $jobAssignments; - } - - /** - * Unsets Job Assignments. - * **Required** The ordered list of jobs that the team member is assigned to. - * The first job assignment is considered the team member's primary job. - */ - public function unsetJobAssignments(): void - { - $this->jobAssignments = []; - } - - /** - * Returns Is Overtime Exempt. - * Whether the team member is exempt from the overtime rules of the seller's country. - */ - public function getIsOvertimeExempt(): ?bool - { - if (count($this->isOvertimeExempt) == 0) { - return null; - } - return $this->isOvertimeExempt['value']; - } - - /** - * Sets Is Overtime Exempt. - * Whether the team member is exempt from the overtime rules of the seller's country. - * - * @maps is_overtime_exempt - */ - public function setIsOvertimeExempt(?bool $isOvertimeExempt): void - { - $this->isOvertimeExempt['value'] = $isOvertimeExempt; - } - - /** - * Unsets Is Overtime Exempt. - * Whether the team member is exempt from the overtime rules of the seller's country. - */ - public function unsetIsOvertimeExempt(): void - { - $this->isOvertimeExempt = []; - } - - /** - * Returns Version. - * **Read only** Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write, potentially overwriting data from another write. For more information, - * see [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic- - * concurrency). - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * **Read only** Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write, potentially overwriting data from another write. For more information, - * see [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic- - * concurrency). - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Created At. - * The timestamp when the wage setting was created, in RFC 3339 format. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp when the wage setting was created, in RFC 3339 format. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp when the wage setting was last updated, in RFC 3339 format. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp when the wage setting was last updated, in RFC 3339 format. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (!empty($this->teamMemberId)) { - $json['team_member_id'] = $this->teamMemberId['value']; - } - if (!empty($this->jobAssignments)) { - $json['job_assignments'] = $this->jobAssignments['value']; - } - if (!empty($this->isOvertimeExempt)) { - $json['is_overtime_exempt'] = $this->isOvertimeExempt['value']; - } - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/WebhookSubscription.php b/src/Models/WebhookSubscription.php deleted file mode 100644 index 07c221a2..00000000 --- a/src/Models/WebhookSubscription.php +++ /dev/null @@ -1,359 +0,0 @@ -id; - } - - /** - * Sets Id. - * A Square-generated unique ID for the subscription. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * The name of this subscription. - */ - public function getName(): ?string - { - if (count($this->name) == 0) { - return null; - } - return $this->name['value']; - } - - /** - * Sets Name. - * The name of this subscription. - * - * @maps name - */ - public function setName(?string $name): void - { - $this->name['value'] = $name; - } - - /** - * Unsets Name. - * The name of this subscription. - */ - public function unsetName(): void - { - $this->name = []; - } - - /** - * Returns Enabled. - * Indicates whether the subscription is enabled (`true`) or not (`false`). - */ - public function getEnabled(): ?bool - { - if (count($this->enabled) == 0) { - return null; - } - return $this->enabled['value']; - } - - /** - * Sets Enabled. - * Indicates whether the subscription is enabled (`true`) or not (`false`). - * - * @maps enabled - */ - public function setEnabled(?bool $enabled): void - { - $this->enabled['value'] = $enabled; - } - - /** - * Unsets Enabled. - * Indicates whether the subscription is enabled (`true`) or not (`false`). - */ - public function unsetEnabled(): void - { - $this->enabled = []; - } - - /** - * Returns Event Types. - * The event types associated with this subscription. - * - * @return string[]|null - */ - public function getEventTypes(): ?array - { - if (count($this->eventTypes) == 0) { - return null; - } - return $this->eventTypes['value']; - } - - /** - * Sets Event Types. - * The event types associated with this subscription. - * - * @maps event_types - * - * @param string[]|null $eventTypes - */ - public function setEventTypes(?array $eventTypes): void - { - $this->eventTypes['value'] = $eventTypes; - } - - /** - * Unsets Event Types. - * The event types associated with this subscription. - */ - public function unsetEventTypes(): void - { - $this->eventTypes = []; - } - - /** - * Returns Notification Url. - * The URL to which webhooks are sent. - */ - public function getNotificationUrl(): ?string - { - if (count($this->notificationUrl) == 0) { - return null; - } - return $this->notificationUrl['value']; - } - - /** - * Sets Notification Url. - * The URL to which webhooks are sent. - * - * @maps notification_url - */ - public function setNotificationUrl(?string $notificationUrl): void - { - $this->notificationUrl['value'] = $notificationUrl; - } - - /** - * Unsets Notification Url. - * The URL to which webhooks are sent. - */ - public function unsetNotificationUrl(): void - { - $this->notificationUrl = []; - } - - /** - * Returns Api Version. - * The API version of the subscription. - * This field is optional for `CreateWebhookSubscription`. - * The value defaults to the API version used by the application. - */ - public function getApiVersion(): ?string - { - if (count($this->apiVersion) == 0) { - return null; - } - return $this->apiVersion['value']; - } - - /** - * Sets Api Version. - * The API version of the subscription. - * This field is optional for `CreateWebhookSubscription`. - * The value defaults to the API version used by the application. - * - * @maps api_version - */ - public function setApiVersion(?string $apiVersion): void - { - $this->apiVersion['value'] = $apiVersion; - } - - /** - * Unsets Api Version. - * The API version of the subscription. - * This field is optional for `CreateWebhookSubscription`. - * The value defaults to the API version used by the application. - */ - public function unsetApiVersion(): void - { - $this->apiVersion = []; - } - - /** - * Returns Signature Key. - * The Square-generated signature key used to validate the origin of the webhook event. - */ - public function getSignatureKey(): ?string - { - return $this->signatureKey; - } - - /** - * Sets Signature Key. - * The Square-generated signature key used to validate the origin of the webhook event. - * - * @maps signature_key - */ - public function setSignatureKey(?string $signatureKey): void - { - $this->signatureKey = $signatureKey; - } - - /** - * Returns Created At. - * The timestamp of when the subscription was created, in RFC 3339 format. For example, "2016-09-04T23: - * 59:33.123Z". - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * The timestamp of when the subscription was created, in RFC 3339 format. For example, "2016-09-04T23: - * 59:33.123Z". - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * The timestamp of when the subscription was last updated, in RFC 3339 format. - * For example, "2016-09-04T23:59:33.123Z". - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * The timestamp of when the subscription was last updated, in RFC 3339 format. - * For example, "2016-09-04T23:59:33.123Z". - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - if (!empty($this->name)) { - $json['name'] = $this->name['value']; - } - if (!empty($this->enabled)) { - $json['enabled'] = $this->enabled['value']; - } - if (!empty($this->eventTypes)) { - $json['event_types'] = $this->eventTypes['value']; - } - if (!empty($this->notificationUrl)) { - $json['notification_url'] = $this->notificationUrl['value']; - } - if (!empty($this->apiVersion)) { - $json['api_version'] = $this->apiVersion['value']; - } - if (isset($this->signatureKey)) { - $json['signature_key'] = $this->signatureKey; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/Weekday.php b/src/Models/Weekday.php deleted file mode 100644 index ec45c2f7..00000000 --- a/src/Models/Weekday.php +++ /dev/null @@ -1,46 +0,0 @@ -startOfWeek = $startOfWeek; - $this->startOfDayLocalTime = $startOfDayLocalTime; - } - - /** - * Returns Id. - * The UUID for this object. - */ - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets Id. - * The UUID for this object. - * - * @maps id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * Returns Start of Week. - * The days of the week. - */ - public function getStartOfWeek(): string - { - return $this->startOfWeek; - } - - /** - * Sets Start of Week. - * The days of the week. - * - * @required - * @maps start_of_week - */ - public function setStartOfWeek(string $startOfWeek): void - { - $this->startOfWeek = $startOfWeek; - } - - /** - * Returns Start of Day Local Time. - * The local time at which a business week starts. Represented as a - * string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are - * truncated). - */ - public function getStartOfDayLocalTime(): string - { - return $this->startOfDayLocalTime; - } - - /** - * Sets Start of Day Local Time. - * The local time at which a business week starts. Represented as a - * string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are - * truncated). - * - * @required - * @maps start_of_day_local_time - */ - public function setStartOfDayLocalTime(string $startOfDayLocalTime): void - { - $this->startOfDayLocalTime = $startOfDayLocalTime; - } - - /** - * Returns Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write; potentially overwriting data from another - * write. - */ - public function getVersion(): ?int - { - return $this->version; - } - - /** - * Sets Version. - * Used for resolving concurrency issues. The request fails if the version - * provided does not match the server version at the time of the request. If not provided, - * Square executes a blind write; potentially overwriting data from another - * write. - * - * @maps version - */ - public function setVersion(?int $version): void - { - $this->version = $version; - } - - /** - * Returns Created At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - */ - public function getCreatedAt(): ?string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - * - * @maps created_at - */ - public function setCreatedAt(?string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - */ - public function getUpdatedAt(): ?string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * A read-only timestamp in RFC 3339 format; presented in UTC. - * - * @maps updated_at - */ - public function setUpdatedAt(?string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return array|stdClass - */ - #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - if (isset($this->id)) { - $json['id'] = $this->id; - } - $json['start_of_week'] = $this->startOfWeek; - $json['start_of_day_local_time'] = $this->startOfDayLocalTime; - if (isset($this->version)) { - $json['version'] = $this->version; - } - if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; - } - if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; - } - $json = array_filter($json, function ($val) { - return $val !== null; - }); - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/OAuth/OAuthClient.php b/src/OAuth/OAuthClient.php new file mode 100644 index 00000000..172fdaaa --- /dev/null +++ b/src/OAuth/OAuthClient.php @@ -0,0 +1,312 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Revokes an access token generated with the OAuth flow. + * + * If an account has more than one OAuth access token for your application, this + * endpoint revokes all of them, regardless of which token you specify. + * + * __Important:__ The `Authorization` header for this endpoint must have the + * following format: + * + * ``` + * Authorization: Client APPLICATION_SECRET + * ``` + * + * Replace `APPLICATION_SECRET` with the application secret on the **OAuth** + * page for your application in the Developer Dashboard. + * + * @param RevokeTokenRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RevokeTokenResponse + * @throws SquareException + * @throws SquareApiException + */ + public function revokeToken(RevokeTokenRequest $request = new RevokeTokenRequest(), ?array $options = null): RevokeTokenResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "oauth2/revoke", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RevokeTokenResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns an OAuth access token and a refresh token unless the + * `short_lived` parameter is set to `true`, in which case the endpoint + * returns only an access token. + * + * The `grant_type` parameter specifies the type of OAuth request. If + * `grant_type` is `authorization_code`, you must include the authorization + * code you received when a seller granted you authorization. If `grant_type` + * is `refresh_token`, you must provide a valid refresh token. If you're using + * an old version of the Square APIs (prior to March 13, 2019), `grant_type` + * can be `migration_token` and you must provide a valid migration token. + * + * You can use the `scopes` parameter to limit the set of permissions granted + * to the access token and refresh token. You can use the `short_lived` parameter + * to create an access token that expires in 24 hours. + * + * __Note:__ OAuth tokens should be encrypted and stored on a secure server. + * Application clients should never interact directly with OAuth tokens. + * + * @param ObtainTokenRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ObtainTokenResponse + * @throws SquareException + * @throws SquareApiException + */ + public function obtainToken(ObtainTokenRequest $request, ?array $options = null): ObtainTokenResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "oauth2/token", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ObtainTokenResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token). + * + * Add the access token to the Authorization header of the request. + * + * __Important:__ The `Authorization` header you provide to this endpoint must have the following format: + * + * ``` + * Authorization: Bearer ACCESS_TOKEN + * ``` + * + * where `ACCESS_TOKEN` is a + * [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). + * + * If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveTokenStatusResponse + * @throws SquareException + * @throws SquareApiException + */ + public function retrieveTokenStatus(?array $options = null): RetrieveTokenStatusResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "oauth2/token/status", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveTokenStatusResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws SquareException + * @throws SquareApiException + */ + public function authorize(?array $options = null): void + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "oauth2/authorize", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/OAuth/Requests/ObtainTokenRequest.php b/src/OAuth/Requests/ObtainTokenRequest.php new file mode 100644 index 00000000..c533a96b --- /dev/null +++ b/src/OAuth/Requests/ObtainTokenRequest.php @@ -0,0 +1,311 @@ + $scopes + */ + #[JsonProperty('scopes'), ArrayType(['string'])] + private ?array $scopes; + + /** + * A Boolean indicating a request for a short-lived access token. + * + * The short-lived access token returned in the response expires in 24 hours. + * + * @var ?bool $shortLived + */ + #[JsonProperty('short_lived')] + private ?bool $shortLived; + + /** + * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the + * `code_challenge` associated with the `authorization_code`. + * + * @var ?string $codeVerifier + */ + #[JsonProperty('code_verifier')] + private ?string $codeVerifier; + + /** + * @param array{ + * clientId: string, + * grantType: string, + * clientSecret?: ?string, + * code?: ?string, + * redirectUri?: ?string, + * refreshToken?: ?string, + * migrationToken?: ?string, + * scopes?: ?array, + * shortLived?: ?bool, + * codeVerifier?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->clientId = $values['clientId']; + $this->clientSecret = $values['clientSecret'] ?? null; + $this->code = $values['code'] ?? null; + $this->redirectUri = $values['redirectUri'] ?? null; + $this->grantType = $values['grantType']; + $this->refreshToken = $values['refreshToken'] ?? null; + $this->migrationToken = $values['migrationToken'] ?? null; + $this->scopes = $values['scopes'] ?? null; + $this->shortLived = $values['shortLived'] ?? null; + $this->codeVerifier = $values['codeVerifier'] ?? null; + } + + /** + * @return string + */ + public function getClientId(): string + { + return $this->clientId; + } + + /** + * @param string $value + */ + public function setClientId(string $value): self + { + $this->clientId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClientSecret(): ?string + { + return $this->clientSecret; + } + + /** + * @param ?string $value + */ + public function setClientSecret(?string $value = null): self + { + $this->clientSecret = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCode(): ?string + { + return $this->code; + } + + /** + * @param ?string $value + */ + public function setCode(?string $value = null): self + { + $this->code = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRedirectUri(): ?string + { + return $this->redirectUri; + } + + /** + * @param ?string $value + */ + public function setRedirectUri(?string $value = null): self + { + $this->redirectUri = $value; + return $this; + } + + /** + * @return string + */ + public function getGrantType(): string + { + return $this->grantType; + } + + /** + * @param string $value + */ + public function setGrantType(string $value): self + { + $this->grantType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefreshToken(): ?string + { + return $this->refreshToken; + } + + /** + * @param ?string $value + */ + public function setRefreshToken(?string $value = null): self + { + $this->refreshToken = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMigrationToken(): ?string + { + return $this->migrationToken; + } + + /** + * @param ?string $value + */ + public function setMigrationToken(?string $value = null): self + { + $this->migrationToken = $value; + return $this; + } + + /** + * @return ?array + */ + public function getScopes(): ?array + { + return $this->scopes; + } + + /** + * @param ?array $value + */ + public function setScopes(?array $value = null): self + { + $this->scopes = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getShortLived(): ?bool + { + return $this->shortLived; + } + + /** + * @param ?bool $value + */ + public function setShortLived(?bool $value = null): self + { + $this->shortLived = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCodeVerifier(): ?string + { + return $this->codeVerifier; + } + + /** + * @param ?string $value + */ + public function setCodeVerifier(?string $value = null): self + { + $this->codeVerifier = $value; + return $this; + } +} diff --git a/src/OAuth/Requests/RevokeTokenRequest.php b/src/OAuth/Requests/RevokeTokenRequest.php new file mode 100644 index 00000000..3e98a626 --- /dev/null +++ b/src/OAuth/Requests/RevokeTokenRequest.php @@ -0,0 +1,131 @@ +clientId = $values['clientId'] ?? null; + $this->accessToken = $values['accessToken'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->revokeOnlyAccessToken = $values['revokeOnlyAccessToken'] ?? null; + } + + /** + * @return ?string + */ + public function getClientId(): ?string + { + return $this->clientId; + } + + /** + * @param ?string $value + */ + public function setClientId(?string $value = null): self + { + $this->clientId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAccessToken(): ?string + { + return $this->accessToken; + } + + /** + * @param ?string $value + */ + public function setAccessToken(?string $value = null): self + { + $this->accessToken = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getRevokeOnlyAccessToken(): ?bool + { + return $this->revokeOnlyAccessToken; + } + + /** + * @param ?bool $value + */ + public function setRevokeOnlyAccessToken(?bool $value = null): self + { + $this->revokeOnlyAccessToken = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php new file mode 100644 index 00000000..b463aee6 --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -0,0 +1,408 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributeDefinitionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributeDefinitionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListOrderCustomAttributeDefinitionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListOrderCustomAttributeDefinitionsResponse $response) => $response?->getCustomAttributeDefinitions() ?? [], + ); + } + + /** + * Creates an order-related custom attribute definition. Use this endpoint to + * define a custom attribute that can be associated with orders. + * + * After creating a custom attribute definition, you can set the custom attribute for orders + * in the Square seller account. + * + * @param CreateOrderCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateOrderCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateOrderCustomAttributeDefinitionRequest $request, ?array $options = null): CreateOrderCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attribute-definitions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateOrderCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * + * To retrieve a custom attribute definition created by another application, the `visibility` + * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveOrderCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributeDefinitionsRequest $request, ?array $options = null): RetrieveOrderCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveOrderCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an order-related custom attribute definition for a Square seller account. + * + * Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + * + * @param UpdateOrderCustomAttributeDefinitionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateOrderCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateOrderCustomAttributeDefinitionRequest $request, ?array $options = null): UpdateOrderCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateOrderCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + * + * Only the definition owner can delete a custom attribute definition. + * + * @param DeleteCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteOrderCustomAttributeDefinitionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributeDefinitionsRequest $request, ?array $options = null): DeleteOrderCustomAttributeDefinitionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attribute-definitions/{$request->getKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteOrderCustomAttributeDefinitionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + * + * When all response pages are retrieved, the results include all custom attribute definitions + * that are visible to the requesting application, including those that are created by other + * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributeDefinitionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListOrderCustomAttributeDefinitionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributeDefinitionsRequest $request = new ListCustomAttributeDefinitionsRequest(), ?array $options = null): ListOrderCustomAttributeDefinitionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attribute-definitions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListOrderCustomAttributeDefinitionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Orders/CustomAttributeDefinitions/Requests/CreateOrderCustomAttributeDefinitionRequest.php b/src/Orders/CustomAttributeDefinitions/Requests/CreateOrderCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..c14b5b54 --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/Requests/CreateOrderCustomAttributeDefinitionRequest.php @@ -0,0 +1,79 @@ +customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php b/src/Orders/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..d43d09cc --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/Requests/DeleteCustomAttributeDefinitionsRequest.php @@ -0,0 +1,41 @@ +key = $values['key']; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php b/src/Orders/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..f535665a --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php @@ -0,0 +1,68 @@ +key = $values['key']; + $this->version = $values['version'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php b/src/Orders/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php new file mode 100644 index 00000000..b0649f44 --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/Requests/ListCustomAttributeDefinitionsRequest.php @@ -0,0 +1,99 @@ + $visibilityFilter Requests that all of the custom attributes be returned, or only those that are read-only or read-write. + */ + private ?string $visibilityFilter; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @param array{ + * visibilityFilter?: ?value-of, + * cursor?: ?string, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributeDefinitions/Requests/UpdateOrderCustomAttributeDefinitionRequest.php b/src/Orders/CustomAttributeDefinitions/Requests/UpdateOrderCustomAttributeDefinitionRequest.php new file mode 100644 index 00000000..3284e3b6 --- /dev/null +++ b/src/Orders/CustomAttributeDefinitions/Requests/UpdateOrderCustomAttributeDefinitionRequest.php @@ -0,0 +1,102 @@ +key = $values['key']; + $this->customAttributeDefinition = $values['customAttributeDefinition']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(CustomAttributeDefinition $value): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/CustomAttributesClient.php b/src/Orders/CustomAttributes/CustomAttributesClient.php new file mode 100644 index 00000000..df0e4ca9 --- /dev/null +++ b/src/Orders/CustomAttributes/CustomAttributesClient.php @@ -0,0 +1,509 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation. + * + * Use this endpoint to delete one or more custom attributes from one or more orders. + * A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + * custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + * + * This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete + * requests and returns a map of individual delete responses. Each delete request has a unique ID + * and provides an order ID and custom attribute. Each delete response is returned with the ID + * of the corresponding request. + * + * To delete a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkDeleteOrderCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkDeleteOrderCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchDelete(BulkDeleteOrderCustomAttributesRequest $request, ?array $options = null): BulkDeleteOrderCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attributes/bulk-delete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkDeleteOrderCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation. + * + * Use this endpoint to delete one or more custom attributes from one or more orders. + * A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + * custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + * + * This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + * requests and returns a map of individual upsert responses. Each upsert request has a unique ID + * and provides an order ID and custom attribute. Each upsert response is returned with the ID + * of the corresponding request. + * + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param BulkUpsertOrderCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkUpsertOrderCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpsert(BulkUpsertOrderCustomAttributesRequest $request, ?array $options = null): BulkUpsertOrderCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/custom-attributes/bulk-upsert", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkUpsertOrderCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with an order. + * + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListCustomAttributesRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListCustomAttributesRequest $request) => $this->_list($request, $options), + setCursor: function (ListCustomAttributesRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListOrderCustomAttributesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListOrderCustomAttributesResponse $response) => $response?->getCustomAttributes() ?? [], + ); + } + + /** + * Retrieves a [custom attribute](entity:CustomAttribute) associated with an order. + * + * You can use the `with_definition` query parameter to also retrieve the custom attribute definition + * in the same call. + * + * To retrieve a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param GetCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveOrderCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCustomAttributesRequest $request, ?array $options = null): RetrieveOrderCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVersion() != null) { + $query['version'] = $request->getVersion(); + } + if ($request->getWithDefinition() != null) { + $query['with_definition'] = $request->getWithDefinition(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}/custom-attributes/{$request->getCustomAttributeKey()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveOrderCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates a [custom attribute](entity:CustomAttribute) for an order. + * + * Use this endpoint to set the value of a custom attribute for a specific order. + * A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + * custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + * + * To create or update a custom attribute owned by another application, the `visibility` setting + * must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param UpsertOrderCustomAttributeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertOrderCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertOrderCustomAttributeRequest $request, ?array $options = null): UpsertOrderCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}/custom-attributes/{$request->getCustomAttributeKey()}", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertOrderCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile. + * + * To delete a custom attribute owned by another application, the `visibility` setting must be + * `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + * + * @param DeleteCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteOrderCustomAttributeResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteCustomAttributesRequest $request, ?array $options = null): DeleteOrderCustomAttributeResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}/custom-attributes/{$request->getCustomAttributeKey()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteOrderCustomAttributeResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists the [custom attributes](entity:CustomAttribute) associated with an order. + * + * You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + * in the same call. + * + * When all response pages are retrieved, the results include all custom attributes that are + * visible to the requesting application, including those that are owned by other applications + * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @param ListCustomAttributesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListOrderCustomAttributesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListCustomAttributesRequest $request, ?array $options = null): ListOrderCustomAttributesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getVisibilityFilter() != null) { + $query['visibility_filter'] = $request->getVisibilityFilter(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getWithDefinitions() != null) { + $query['with_definitions'] = $request->getWithDefinitions(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}/custom-attributes", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListOrderCustomAttributesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Orders/CustomAttributes/Requests/BulkDeleteOrderCustomAttributesRequest.php b/src/Orders/CustomAttributes/Requests/BulkDeleteOrderCustomAttributesRequest.php new file mode 100644 index 00000000..d7e28d97 --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/BulkDeleteOrderCustomAttributesRequest.php @@ -0,0 +1,45 @@ + $values A map of requests that correspond to individual delete operations for custom attributes. + */ + #[JsonProperty('values'), ArrayType(['string' => BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/Requests/BulkUpsertOrderCustomAttributesRequest.php b/src/Orders/CustomAttributes/Requests/BulkUpsertOrderCustomAttributesRequest.php new file mode 100644 index 00000000..d6255f68 --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/BulkUpsertOrderCustomAttributesRequest.php @@ -0,0 +1,45 @@ + $values A map of requests that correspond to individual upsert operations for custom attributes. + */ + #[JsonProperty('values'), ArrayType(['string' => BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute::class])] + private array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/Requests/DeleteCustomAttributesRequest.php b/src/Orders/CustomAttributes/Requests/DeleteCustomAttributesRequest.php new file mode 100644 index 00000000..e6612d05 --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/DeleteCustomAttributesRequest.php @@ -0,0 +1,68 @@ +orderId = $values['orderId']; + $this->customAttributeKey = $values['customAttributeKey']; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomAttributeKey(): string + { + return $this->customAttributeKey; + } + + /** + * @param string $value + */ + public function setCustomAttributeKey(string $value): self + { + $this->customAttributeKey = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/Requests/GetCustomAttributesRequest.php b/src/Orders/CustomAttributes/Requests/GetCustomAttributesRequest.php new file mode 100644 index 00000000..39ba872b --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/GetCustomAttributesRequest.php @@ -0,0 +1,123 @@ +orderId = $values['orderId']; + $this->customAttributeKey = $values['customAttributeKey']; + $this->version = $values['version'] ?? null; + $this->withDefinition = $values['withDefinition'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomAttributeKey(): string + { + return $this->customAttributeKey; + } + + /** + * @param string $value + */ + public function setCustomAttributeKey(string $value): self + { + $this->customAttributeKey = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinition(): ?bool + { + return $this->withDefinition; + } + + /** + * @param ?bool $value + */ + public function setWithDefinition(?bool $value = null): self + { + $this->withDefinition = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/Requests/ListCustomAttributesRequest.php b/src/Orders/CustomAttributes/Requests/ListCustomAttributesRequest.php new file mode 100644 index 00000000..1426bf10 --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/ListCustomAttributesRequest.php @@ -0,0 +1,151 @@ + $visibilityFilter Requests that all of the custom attributes be returned, or only those that are read-only or read-write. + */ + private ?string $visibilityFilter; + + /** + * The cursor returned in the paged response from the previous call to this endpoint. + * Provide this cursor to retrieve the next page of results for your original request. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * The maximum number of results to return in a single paged response. This limit is advisory. + * The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. + * The default value is 20. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each + * custom attribute. Set this parameter to `true` to get the name and description of each custom attribute, + * information about the data type, or other definition details. The default value is `false`. + * + * @var ?bool $withDefinitions + */ + private ?bool $withDefinitions; + + /** + * @param array{ + * orderId: string, + * visibilityFilter?: ?value-of, + * cursor?: ?string, + * limit?: ?int, + * withDefinitions?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->orderId = $values['orderId']; + $this->visibilityFilter = $values['visibilityFilter'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->withDefinitions = $values['withDefinitions'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVisibilityFilter(): ?string + { + return $this->visibilityFilter; + } + + /** + * @param ?value-of $value + */ + public function setVisibilityFilter(?string $value = null): self + { + $this->visibilityFilter = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getWithDefinitions(): ?bool + { + return $this->withDefinitions; + } + + /** + * @param ?bool $value + */ + public function setWithDefinitions(?bool $value = null): self + { + $this->withDefinitions = $value; + return $this; + } +} diff --git a/src/Orders/CustomAttributes/Requests/UpsertOrderCustomAttributeRequest.php b/src/Orders/CustomAttributes/Requests/UpsertOrderCustomAttributeRequest.php new file mode 100644 index 00000000..8502f5de --- /dev/null +++ b/src/Orders/CustomAttributes/Requests/UpsertOrderCustomAttributeRequest.php @@ -0,0 +1,131 @@ +orderId = $values['orderId']; + $this->customAttributeKey = $values['customAttributeKey']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomAttributeKey(): string + { + return $this->customAttributeKey; + } + + /** + * @param string $value + */ + public function setCustomAttributeKey(string $value): self + { + $this->customAttributeKey = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Orders/OrdersClient.php b/src/Orders/OrdersClient.php new file mode 100644 index 00000000..0f9304cb --- /dev/null +++ b/src/Orders/OrdersClient.php @@ -0,0 +1,580 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->customAttributeDefinitions = new CustomAttributeDefinitionsClient($this->client, $this->options); + $this->customAttributes = new CustomAttributesClient($this->client, $this->options); + } + + /** + * Creates a new [order](entity:Order) that can include information about products for + * purchase and settings to apply to the purchase. + * + * To pay for a created order, see + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + * + * You can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + * + * @param CreateOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateOrderRequest $request, ?array $options = null): CreateOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a set of [orders](entity:Order) by their IDs. + * + * If a given order ID does not exist, the ID is ignored instead of generating an error. + * + * @param BatchGetOrdersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetOrdersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchGet(BatchGetOrdersRequest $request, ?array $options = null): BatchGetOrdersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/batch-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetOrdersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Enables applications to preview order pricing without creating an order. + * + * @param CalculateOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CalculateOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function calculate(CalculateOrderRequest $request, ?array $options = null): CalculateOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/calculate", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CalculateOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has + * only the core fields (such as line items, taxes, and discounts) copied from the original order. + * + * @param CloneOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CloneOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function clone(CloneOrderRequest $request, ?array $options = null): CloneOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/clone", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CloneOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Search all orders for one or more locations. Orders include all sales, + * returns, and exchanges regardless of how or when they entered the Square + * ecosystem (such as Point of Sale, Invoices, and Connect APIs). + * + * `SearchOrders` requests need to specify which locations to search and define a + * [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls + * how to sort or filter the results. Your `SearchOrdersQuery` can: + * + * Set filter criteria. + * Set the sort order. + * Determine whether to return results as complete `Order` objects or as + * [OrderEntry](entity:OrderEntry) objects. + * + * Note that details for orders processed with Square Point of Sale while in + * offline mode might not be transmitted to Square for up to 72 hours. Offline + * orders have a `created_at` value that reflects the time the order was created, + * not the time it was subsequently transmitted to Square. + * + * @param SearchOrdersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchOrdersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchOrdersRequest $request = new SearchOrdersRequest(), ?array $options = null): SearchOrdersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchOrdersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves an [Order](entity:Order) by ID. + * + * @param GetOrdersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetOrdersRequest $request, ?array $options = null): GetOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an open [order](entity:Order) by adding, replacing, or deleting + * fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. + * + * An `UpdateOrder` request requires the following: + * + * - The `order_id` in the endpoint path, identifying the order to update. + * - The latest `version` of the order to update. + * - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + * containing only the fields to update and the version to which the update is + * being applied. + * - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + * identifying the fields to clear. + * + * To pay for an order, see + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + * + * @param UpdateOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateOrderRequest $request, ?array $options = null): UpdateOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Pay for an [order](entity:Order) using one or more approved [payments](entity:Payment) + * or settle an order with a total of `0`. + * + * The total of the `payment_ids` listed in the request must be equal to the order + * total. Orders with a total amount of `0` can be marked as paid by specifying an empty + * array of `payment_ids` in the request. + * + * To be used with `PayOrder`, a payment must: + * + * - Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment). + * Any approved payments that reference the same `order_id` not specified in the + * `payment_ids` is canceled. + * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). + * Using a delayed capture payment with `PayOrder` completes the approved payment. + * + * @param PayOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return PayOrderResponse + * @throws SquareException + * @throws SquareApiException + */ + public function pay(PayOrderRequest $request, ?array $options = null): PayOrderResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/orders/{$request->getOrderId()}/pay", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return PayOrderResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Orders/Requests/BatchGetOrdersRequest.php b/src/Orders/Requests/BatchGetOrdersRequest.php new file mode 100644 index 00000000..cbe25b21 --- /dev/null +++ b/src/Orders/Requests/BatchGetOrdersRequest.php @@ -0,0 +1,72 @@ + $orderIds The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. + */ + #[JsonProperty('order_ids'), ArrayType(['string'])] + private array $orderIds; + + /** + * @param array{ + * orderIds: array, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId'] ?? null; + $this->orderIds = $values['orderIds']; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return array + */ + public function getOrderIds(): array + { + return $this->orderIds; + } + + /** + * @param array $value + */ + public function setOrderIds(array $value): self + { + $this->orderIds = $value; + return $this; + } +} diff --git a/src/Orders/Requests/CalculateOrderRequest.php b/src/Orders/Requests/CalculateOrderRequest.php new file mode 100644 index 00000000..14e270e8 --- /dev/null +++ b/src/Orders/Requests/CalculateOrderRequest.php @@ -0,0 +1,77 @@ + $proposedRewards + */ + #[JsonProperty('proposed_rewards'), ArrayType([OrderReward::class])] + private ?array $proposedRewards; + + /** + * @param array{ + * order: Order, + * proposedRewards?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->order = $values['order']; + $this->proposedRewards = $values['proposedRewards'] ?? null; + } + + /** + * @return Order + */ + public function getOrder(): Order + { + return $this->order; + } + + /** + * @param Order $value + */ + public function setOrder(Order $value): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getProposedRewards(): ?array + { + return $this->proposedRewards; + } + + /** + * @param ?array $value + */ + public function setProposedRewards(?array $value = null): self + { + $this->proposedRewards = $value; + return $this; + } +} diff --git a/src/Orders/Requests/CloneOrderRequest.php b/src/Orders/Requests/CloneOrderRequest.php new file mode 100644 index 00000000..41142d92 --- /dev/null +++ b/src/Orders/Requests/CloneOrderRequest.php @@ -0,0 +1,107 @@ +orderId = $values['orderId']; + $this->version = $values['version'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Orders/Requests/GetOrdersRequest.php b/src/Orders/Requests/GetOrdersRequest.php new file mode 100644 index 00000000..dd86c99c --- /dev/null +++ b/src/Orders/Requests/GetOrdersRequest.php @@ -0,0 +1,41 @@ +orderId = $values['orderId']; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } +} diff --git a/src/Orders/Requests/PayOrderRequest.php b/src/Orders/Requests/PayOrderRequest.php new file mode 100644 index 00000000..4113bc92 --- /dev/null +++ b/src/Orders/Requests/PayOrderRequest.php @@ -0,0 +1,127 @@ + $paymentIds + */ + #[JsonProperty('payment_ids'), ArrayType(['string'])] + private ?array $paymentIds; + + /** + * @param array{ + * orderId: string, + * idempotencyKey: string, + * orderVersion?: ?int, + * paymentIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->orderId = $values['orderId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->orderVersion = $values['orderVersion'] ?? null; + $this->paymentIds = $values['paymentIds'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrderVersion(): ?int + { + return $this->orderVersion; + } + + /** + * @param ?int $value + */ + public function setOrderVersion(?int $value = null): self + { + $this->orderVersion = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPaymentIds(): ?array + { + return $this->paymentIds; + } + + /** + * @param ?array $value + */ + public function setPaymentIds(?array $value = null): self + { + $this->paymentIds = $value; + return $this; + } +} diff --git a/src/Orders/Requests/SearchOrdersRequest.php b/src/Orders/Requests/SearchOrdersRequest.php new file mode 100644 index 00000000..ff900853 --- /dev/null +++ b/src/Orders/Requests/SearchOrdersRequest.php @@ -0,0 +1,168 @@ + $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this cursor to retrieve the next set of results for your original query. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * Query conditions used to filter or sort the results. Note that when + * retrieving additional pages using a cursor, you must use the original query. + * + * @var ?SearchOrdersQuery $query + */ + #[JsonProperty('query')] + private ?SearchOrdersQuery $query; + + /** + * The maximum number of results to be returned in a single page. + * + * Default: `500` + * Max: `1000` + * + * @var ?int $limit + */ + #[JsonProperty('limit')] + private ?int $limit; + + /** + * A Boolean that controls the format of the search results. If `true`, + * `SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders` + * returns complete order objects. + * + * Default: `false`. + * + * @var ?bool $returnEntries + */ + #[JsonProperty('return_entries')] + private ?bool $returnEntries; + + /** + * @param array{ + * locationIds?: ?array, + * cursor?: ?string, + * query?: ?SearchOrdersQuery, + * limit?: ?int, + * returnEntries?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationIds = $values['locationIds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->returnEntries = $values['returnEntries'] ?? null; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?SearchOrdersQuery + */ + public function getQuery(): ?SearchOrdersQuery + { + return $this->query; + } + + /** + * @param ?SearchOrdersQuery $value + */ + public function setQuery(?SearchOrdersQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getReturnEntries(): ?bool + { + return $this->returnEntries; + } + + /** + * @param ?bool $value + */ + public function setReturnEntries(?bool $value = null): self + { + $this->returnEntries = $value; + return $this; + } +} diff --git a/src/Orders/Requests/UpdateOrderRequest.php b/src/Orders/Requests/UpdateOrderRequest.php new file mode 100644 index 00000000..13476d6a --- /dev/null +++ b/src/Orders/Requests/UpdateOrderRequest.php @@ -0,0 +1,136 @@ + $fieldsToClear + */ + #[JsonProperty('fields_to_clear'), ArrayType(['string'])] + private ?array $fieldsToClear; + + /** + * A value you specify that uniquely identifies this update request. + * + * If you are unsure whether a particular update was applied to an order successfully, + * you can reattempt it with the same idempotency key without + * worrying about creating duplicate updates to the order. + * The latest order version is returned. + * + * For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + * + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotency_key')] + private ?string $idempotencyKey; + + /** + * @param array{ + * orderId: string, + * order?: ?Order, + * fieldsToClear?: ?array, + * idempotencyKey?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->orderId = $values['orderId']; + $this->order = $values['order'] ?? null; + $this->fieldsToClear = $values['fieldsToClear'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getFieldsToClear(): ?array + { + return $this->fieldsToClear; + } + + /** + * @param ?array $value + */ + public function setFieldsToClear(?array $value = null): self + { + $this->fieldsToClear = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Payments/PaymentsClient.php b/src/Payments/PaymentsClient.php new file mode 100644 index 00000000..f4f6dbeb --- /dev/null +++ b/src/Payments/PaymentsClient.php @@ -0,0 +1,565 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves a list of payments taken by the account making the request. + * + * Results are eventually consistent, and new payments or changes to payments might take several + * seconds to appear. + * + * The maximum results per page is 100. + * + * @param ListPaymentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListPaymentsRequest $request = new ListPaymentsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListPaymentsRequest $request) => $this->_list($request, $options), + setCursor: function (ListPaymentsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListPaymentsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListPaymentsResponse $response) => $response?->getPayments() ?? [], + ); + } + + /** + * Creates a payment using the provided source. You can use this endpoint + * to charge a card (credit/debit card or + * Square gift card) or record a payment that the seller received outside of Square + * (cash payment from a buyer or a payment that an external entity + * processed on behalf of the seller). + * + * The endpoint creates a + * `Payment` object and returns it in the response. + * + * @param CreatePaymentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreatePaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreatePaymentRequest $request, ?array $options = null): CreatePaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreatePaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels (voids) a payment identified by the idempotency key that is specified in the + * request. + * + * Use this method when the status of a `CreatePayment` request is unknown (for example, after you send a + * `CreatePayment` request, a network error occurs and you do not get a response). In this case, you can + * direct Square to cancel the payment using this endpoint. In the request, you provide the same + * idempotency key that you provided in your `CreatePayment` request that you want to cancel. After + * canceling the payment, you can submit your `CreatePayment` request again. + * + * Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint + * returns successfully. + * + * @param CancelPaymentByIdempotencyKeyRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelPaymentByIdempotencyKeyResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancelByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest $request, ?array $options = null): CancelPaymentByIdempotencyKeyResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments/cancel", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelPaymentByIdempotencyKeyResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves details for a specific payment. + * + * @param GetPaymentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetPaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetPaymentsRequest $request, ?array $options = null): GetPaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments/{$request->getPaymentId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetPaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a payment with the APPROVED status. + * You can update the `amount_money` and `tip_money` using this endpoint. + * + * @param UpdatePaymentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdatePaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdatePaymentRequest $request, ?array $options = null): UpdatePaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments/{$request->getPaymentId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdatePaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels (voids) a payment. You can use this endpoint to cancel a payment with + * the APPROVED `status`. + * + * @param CancelPaymentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelPaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelPaymentsRequest $request, ?array $options = null): CancelPaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments/{$request->getPaymentId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelPaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Completes (captures) a payment. + * By default, payments are set to complete immediately after they are created. + * + * You can use this endpoint to complete a payment with the APPROVED `status`. + * + * @param CompletePaymentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CompletePaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function complete(CompletePaymentRequest $request, ?array $options = null): CompletePaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments/{$request->getPaymentId()}/complete", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CompletePaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a list of payments taken by the account making the request. + * + * Results are eventually consistent, and new payments or changes to payments might take several + * seconds to appear. + * + * The maximum results per page is 100. + * + * @param ListPaymentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListPaymentsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListPaymentsRequest $request = new ListPaymentsRequest(), ?array $options = null): ListPaymentsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getTotal() != null) { + $query['total'] = $request->getTotal(); + } + if ($request->getLast4() != null) { + $query['last_4'] = $request->getLast4(); + } + if ($request->getCardBrand() != null) { + $query['card_brand'] = $request->getCardBrand(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getIsOfflinePayment() != null) { + $query['is_offline_payment'] = $request->getIsOfflinePayment(); + } + if ($request->getOfflineBeginTime() != null) { + $query['offline_begin_time'] = $request->getOfflineBeginTime(); + } + if ($request->getOfflineEndTime() != null) { + $query['offline_end_time'] = $request->getOfflineEndTime(); + } + if ($request->getUpdatedAtBeginTime() != null) { + $query['updated_at_begin_time'] = $request->getUpdatedAtBeginTime(); + } + if ($request->getUpdatedAtEndTime() != null) { + $query['updated_at_end_time'] = $request->getUpdatedAtEndTime(); + } + if ($request->getSortField() != null) { + $query['sort_field'] = $request->getSortField(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payments", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListPaymentsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Payments/Requests/CancelPaymentByIdempotencyKeyRequest.php b/src/Payments/Requests/CancelPaymentByIdempotencyKeyRequest.php new file mode 100644 index 00000000..9f7219e5 --- /dev/null +++ b/src/Payments/Requests/CancelPaymentByIdempotencyKeyRequest.php @@ -0,0 +1,43 @@ +idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Payments/Requests/CancelPaymentsRequest.php b/src/Payments/Requests/CancelPaymentsRequest.php new file mode 100644 index 00000000..2d1a3693 --- /dev/null +++ b/src/Payments/Requests/CancelPaymentsRequest.php @@ -0,0 +1,41 @@ +paymentId = $values['paymentId']; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } +} diff --git a/src/Payments/Requests/CompletePaymentRequest.php b/src/Payments/Requests/CompletePaymentRequest.php new file mode 100644 index 00000000..65e5ed1b --- /dev/null +++ b/src/Payments/Requests/CompletePaymentRequest.php @@ -0,0 +1,71 @@ +paymentId = $values['paymentId']; + $this->versionToken = $values['versionToken'] ?? null; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVersionToken(): ?string + { + return $this->versionToken; + } + + /** + * @param ?string $value + */ + public function setVersionToken(?string $value = null): self + { + $this->versionToken = $value; + return $this; + } +} diff --git a/src/Payments/Requests/CreatePaymentRequest.php b/src/Payments/Requests/CreatePaymentRequest.php new file mode 100644 index 00000000..dc99d246 --- /dev/null +++ b/src/Payments/Requests/CreatePaymentRequest.php @@ -0,0 +1,780 @@ +sourceId = $values['sourceId']; + $this->idempotencyKey = $values['idempotencyKey']; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->tipMoney = $values['tipMoney'] ?? null; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->delayDuration = $values['delayDuration'] ?? null; + $this->delayAction = $values['delayAction'] ?? null; + $this->autocomplete = $values['autocomplete'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->verificationToken = $values['verificationToken'] ?? null; + $this->acceptPartialAuthorization = $values['acceptPartialAuthorization'] ?? null; + $this->buyerEmailAddress = $values['buyerEmailAddress'] ?? null; + $this->buyerPhoneNumber = $values['buyerPhoneNumber'] ?? null; + $this->billingAddress = $values['billingAddress'] ?? null; + $this->shippingAddress = $values['shippingAddress'] ?? null; + $this->note = $values['note'] ?? null; + $this->statementDescriptionIdentifier = $values['statementDescriptionIdentifier'] ?? null; + $this->cashDetails = $values['cashDetails'] ?? null; + $this->externalDetails = $values['externalDetails'] ?? null; + $this->customerDetails = $values['customerDetails'] ?? null; + $this->offlinePaymentDetails = $values['offlinePaymentDetails'] ?? null; + } + + /** + * @return string + */ + public function getSourceId(): string + { + return $this->sourceId; + } + + /** + * @param string $value + */ + public function setSourceId(string $value): self + { + $this->sourceId = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTipMoney(): ?Money + { + return $this->tipMoney; + } + + /** + * @param ?Money $value + */ + public function setTipMoney(?Money $value = null): self + { + $this->tipMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayDuration(): ?string + { + return $this->delayDuration; + } + + /** + * @param ?string $value + */ + public function setDelayDuration(?string $value = null): self + { + $this->delayDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayAction(): ?string + { + return $this->delayAction; + } + + /** + * @param ?string $value + */ + public function setDelayAction(?string $value = null): self + { + $this->delayAction = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAutocomplete(): ?bool + { + return $this->autocomplete; + } + + /** + * @param ?bool $value + */ + public function setAutocomplete(?bool $value = null): self + { + $this->autocomplete = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVerificationToken(): ?string + { + return $this->verificationToken; + } + + /** + * @param ?string $value + */ + public function setVerificationToken(?string $value = null): self + { + $this->verificationToken = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAcceptPartialAuthorization(): ?bool + { + return $this->acceptPartialAuthorization; + } + + /** + * @param ?bool $value + */ + public function setAcceptPartialAuthorization(?bool $value = null): self + { + $this->acceptPartialAuthorization = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerEmailAddress(): ?string + { + return $this->buyerEmailAddress; + } + + /** + * @param ?string $value + */ + public function setBuyerEmailAddress(?string $value = null): self + { + $this->buyerEmailAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerPhoneNumber(): ?string + { + return $this->buyerPhoneNumber; + } + + /** + * @param ?string $value + */ + public function setBuyerPhoneNumber(?string $value = null): self + { + $this->buyerPhoneNumber = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getBillingAddress(): ?Address + { + return $this->billingAddress; + } + + /** + * @param ?Address $value + */ + public function setBillingAddress(?Address $value = null): self + { + $this->billingAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getShippingAddress(): ?Address + { + return $this->shippingAddress; + } + + /** + * @param ?Address $value + */ + public function setShippingAddress(?Address $value = null): self + { + $this->shippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatementDescriptionIdentifier(): ?string + { + return $this->statementDescriptionIdentifier; + } + + /** + * @param ?string $value + */ + public function setStatementDescriptionIdentifier(?string $value = null): self + { + $this->statementDescriptionIdentifier = $value; + return $this; + } + + /** + * @return ?CashPaymentDetails + */ + public function getCashDetails(): ?CashPaymentDetails + { + return $this->cashDetails; + } + + /** + * @param ?CashPaymentDetails $value + */ + public function setCashDetails(?CashPaymentDetails $value = null): self + { + $this->cashDetails = $value; + return $this; + } + + /** + * @return ?ExternalPaymentDetails + */ + public function getExternalDetails(): ?ExternalPaymentDetails + { + return $this->externalDetails; + } + + /** + * @param ?ExternalPaymentDetails $value + */ + public function setExternalDetails(?ExternalPaymentDetails $value = null): self + { + $this->externalDetails = $value; + return $this; + } + + /** + * @return ?CustomerDetails + */ + public function getCustomerDetails(): ?CustomerDetails + { + return $this->customerDetails; + } + + /** + * @param ?CustomerDetails $value + */ + public function setCustomerDetails(?CustomerDetails $value = null): self + { + $this->customerDetails = $value; + return $this; + } + + /** + * @return ?OfflinePaymentDetails + */ + public function getOfflinePaymentDetails(): ?OfflinePaymentDetails + { + return $this->offlinePaymentDetails; + } + + /** + * @param ?OfflinePaymentDetails $value + */ + public function setOfflinePaymentDetails(?OfflinePaymentDetails $value = null): self + { + $this->offlinePaymentDetails = $value; + return $this; + } +} diff --git a/src/Payments/Requests/GetPaymentsRequest.php b/src/Payments/Requests/GetPaymentsRequest.php new file mode 100644 index 00000000..085adb95 --- /dev/null +++ b/src/Payments/Requests/GetPaymentsRequest.php @@ -0,0 +1,41 @@ +paymentId = $values['paymentId']; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } +} diff --git a/src/Payments/Requests/ListPaymentsRequest.php b/src/Payments/Requests/ListPaymentsRequest.php new file mode 100644 index 00000000..b0df5d80 --- /dev/null +++ b/src/Payments/Requests/ListPaymentsRequest.php @@ -0,0 +1,427 @@ + $sortField The field used to sort results by. The default is `CREATED_AT`. + */ + private ?string $sortField; + + /** + * @param array{ + * beginTime?: ?string, + * endTime?: ?string, + * sortOrder?: ?string, + * cursor?: ?string, + * locationId?: ?string, + * total?: ?int, + * last4?: ?string, + * cardBrand?: ?string, + * limit?: ?int, + * isOfflinePayment?: ?bool, + * offlineBeginTime?: ?string, + * offlineEndTime?: ?string, + * updatedAtBeginTime?: ?string, + * updatedAtEndTime?: ?string, + * sortField?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->total = $values['total'] ?? null; + $this->last4 = $values['last4'] ?? null; + $this->cardBrand = $values['cardBrand'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->isOfflinePayment = $values['isOfflinePayment'] ?? null; + $this->offlineBeginTime = $values['offlineBeginTime'] ?? null; + $this->offlineEndTime = $values['offlineEndTime'] ?? null; + $this->updatedAtBeginTime = $values['updatedAtBeginTime'] ?? null; + $this->updatedAtEndTime = $values['updatedAtEndTime'] ?? null; + $this->sortField = $values['sortField'] ?? null; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?string $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getTotal(): ?int + { + return $this->total; + } + + /** + * @param ?int $value + */ + public function setTotal(?int $value = null): self + { + $this->total = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLast4(): ?string + { + return $this->last4; + } + + /** + * @param ?string $value + */ + public function setLast4(?string $value = null): self + { + $this->last4 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardBrand(): ?string + { + return $this->cardBrand; + } + + /** + * @param ?string $value + */ + public function setCardBrand(?string $value = null): self + { + $this->cardBrand = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOfflinePayment(): ?bool + { + return $this->isOfflinePayment; + } + + /** + * @param ?bool $value + */ + public function setIsOfflinePayment(?bool $value = null): self + { + $this->isOfflinePayment = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOfflineBeginTime(): ?string + { + return $this->offlineBeginTime; + } + + /** + * @param ?string $value + */ + public function setOfflineBeginTime(?string $value = null): self + { + $this->offlineBeginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOfflineEndTime(): ?string + { + return $this->offlineEndTime; + } + + /** + * @param ?string $value + */ + public function setOfflineEndTime(?string $value = null): self + { + $this->offlineEndTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAtBeginTime(): ?string + { + return $this->updatedAtBeginTime; + } + + /** + * @param ?string $value + */ + public function setUpdatedAtBeginTime(?string $value = null): self + { + $this->updatedAtBeginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAtEndTime(): ?string + { + return $this->updatedAtEndTime; + } + + /** + * @param ?string $value + */ + public function setUpdatedAtEndTime(?string $value = null): self + { + $this->updatedAtEndTime = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortField(): ?string + { + return $this->sortField; + } + + /** + * @param ?value-of $value + */ + public function setSortField(?string $value = null): self + { + $this->sortField = $value; + return $this; + } +} diff --git a/src/Payments/Requests/UpdatePaymentRequest.php b/src/Payments/Requests/UpdatePaymentRequest.php new file mode 100644 index 00000000..e8e99e0f --- /dev/null +++ b/src/Payments/Requests/UpdatePaymentRequest.php @@ -0,0 +1,98 @@ +paymentId = $values['paymentId']; + $this->payment = $values['payment'] ?? null; + $this->idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Payouts/PayoutsClient.php b/src/Payouts/PayoutsClient.php new file mode 100644 index 00000000..d6b28f47 --- /dev/null +++ b/src/Payouts/PayoutsClient.php @@ -0,0 +1,325 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves a list of all payouts for the default location. + * You can filter payouts by location ID, status, time range, and order them in ascending or descending order. + * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + * + * @param ListPayoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListPayoutsRequest $request = new ListPayoutsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListPayoutsRequest $request) => $this->_list($request, $options), + setCursor: function (ListPayoutsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListPayoutsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListPayoutsResponse $response) => $response?->getPayouts() ?? [], + ); + } + + /** + * Retrieves details of a specific payout identified by a payout ID. + * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + * + * @param GetPayoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetPayoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetPayoutsRequest $request, ?array $options = null): GetPayoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payouts/{$request->getPayoutId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetPayoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a list of all payout entries for a specific payout. + * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + * + * @param ListEntriesPayoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function listEntries(ListEntriesPayoutsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEntriesPayoutsRequest $request) => $this->_listEntries($request, $options), + setCursor: function (ListEntriesPayoutsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListPayoutEntriesResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListPayoutEntriesResponse $response) => $response?->getPayoutEntries() ?? [], + ); + } + + /** + * Retrieves a list of all payouts for the default location. + * You can filter payouts by location ID, status, time range, and order them in ascending or descending order. + * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + * + * @param ListPayoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListPayoutsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListPayoutsRequest $request = new ListPayoutsRequest(), ?array $options = null): ListPayoutsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getStatus() != null) { + $query['status'] = $request->getStatus(); + } + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payouts", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListPayoutsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a list of all payout entries for a specific payout. + * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + * + * @param ListEntriesPayoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListPayoutEntriesResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _listEntries(ListEntriesPayoutsRequest $request, ?array $options = null): ListPayoutEntriesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/payouts/{$request->getPayoutId()}/payout-entries", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListPayoutEntriesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Payouts/Requests/GetPayoutsRequest.php b/src/Payouts/Requests/GetPayoutsRequest.php new file mode 100644 index 00000000..92e3edf9 --- /dev/null +++ b/src/Payouts/Requests/GetPayoutsRequest.php @@ -0,0 +1,41 @@ +payoutId = $values['payoutId']; + } + + /** + * @return string + */ + public function getPayoutId(): string + { + return $this->payoutId; + } + + /** + * @param string $value + */ + public function setPayoutId(string $value): self + { + $this->payoutId = $value; + return $this; + } +} diff --git a/src/Payouts/Requests/ListEntriesPayoutsRequest.php b/src/Payouts/Requests/ListEntriesPayoutsRequest.php new file mode 100644 index 00000000..4164970e --- /dev/null +++ b/src/Payouts/Requests/ListEntriesPayoutsRequest.php @@ -0,0 +1,125 @@ + $sortOrder The order in which payout entries are listed. + */ + private ?string $sortOrder; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this cursor to retrieve the next set of results for the original query. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * If request parameters change between requests, subsequent results may contain duplicates or missing records. + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * The maximum number of results to be returned in a single page. + * It is possible to receive fewer results than the specified limit on a given page. + * The default value of 100 is also the maximum allowed value. If the provided value is + * greater than 100, it is ignored and the default value is used instead. + * Default: `100` + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @param array{ + * payoutId: string, + * sortOrder?: ?value-of, + * cursor?: ?string, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->payoutId = $values['payoutId']; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return string + */ + public function getPayoutId(): string + { + return $this->payoutId; + } + + /** + * @param string $value + */ + public function setPayoutId(string $value): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Payouts/Requests/ListPayoutsRequest.php b/src/Payouts/Requests/ListPayoutsRequest.php new file mode 100644 index 00000000..fcda88ed --- /dev/null +++ b/src/Payouts/Requests/ListPayoutsRequest.php @@ -0,0 +1,207 @@ + $status If provided, only payouts with the given status are returned. + */ + private ?string $status; + + /** + * The timestamp for the beginning of the payout creation time, in RFC 3339 format. + * Inclusive. Default: The current time minus one year. + * + * @var ?string $beginTime + */ + private ?string $beginTime; + + /** + * The timestamp for the end of the payout creation time, in RFC 3339 format. + * Default: The current time. + * + * @var ?string $endTime + */ + private ?string $endTime; + + /** + * @var ?value-of $sortOrder The order in which payouts are listed. + */ + private ?string $sortOrder; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this cursor to retrieve the next set of results for the original query. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * If request parameters change between requests, subsequent results may contain duplicates or missing records. + * + * @var ?string $cursor + */ + private ?string $cursor; + + /** + * The maximum number of results to be returned in a single page. + * It is possible to receive fewer results than the specified limit on a given page. + * The default value of 100 is also the maximum allowed value. If the provided value is + * greater than 100, it is ignored and the default value is used instead. + * Default: `100` + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @param array{ + * locationId?: ?string, + * status?: ?value-of, + * beginTime?: ?string, + * endTime?: ?string, + * sortOrder?: ?value-of, + * cursor?: ?string, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->status = $values['status'] ?? null; + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Refunds/RefundsClient.php b/src/Refunds/RefundsClient.php new file mode 100644 index 00000000..1241f916 --- /dev/null +++ b/src/Refunds/RefundsClient.php @@ -0,0 +1,303 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves a list of refunds for the account making the request. + * + * Results are eventually consistent, and new refunds or changes to refunds might take several + * seconds to appear. + * + * The maximum results per page is 100. + * + * @param ListRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListRefundsRequest $request = new ListRefundsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListRefundsRequest $request) => $this->_list($request, $options), + setCursor: function (ListRefundsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListPaymentRefundsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListPaymentRefundsResponse $response) => $response?->getRefunds() ?? [], + ); + } + + /** + * Refunds a payment. You can refund the entire payment amount or a + * portion of it. You can use this endpoint to refund a card payment or record a + * refund of a cash or external payment. For more information, see + * [Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). + * + * @param RefundPaymentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RefundPaymentResponse + * @throws SquareException + * @throws SquareApiException + */ + public function refundPayment(RefundPaymentRequest $request, ?array $options = null): RefundPaymentResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/refunds", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RefundPaymentResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a specific refund using the `refund_id`. + * + * @param GetRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetPaymentRefundResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetRefundsRequest $request, ?array $options = null): GetPaymentRefundResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/refunds/{$request->getRefundId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetPaymentRefundResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a list of refunds for the account making the request. + * + * Results are eventually consistent, and new refunds or changes to refunds might take several + * seconds to appear. + * + * The maximum results per page is 100. + * + * @param ListRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListPaymentRefundsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListRefundsRequest $request = new ListRefundsRequest(), ?array $options = null): ListPaymentRefundsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getBeginTime() != null) { + $query['begin_time'] = $request->getBeginTime(); + } + if ($request->getEndTime() != null) { + $query['end_time'] = $request->getEndTime(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLocationId() != null) { + $query['location_id'] = $request->getLocationId(); + } + if ($request->getStatus() != null) { + $query['status'] = $request->getStatus(); + } + if ($request->getSourceType() != null) { + $query['source_type'] = $request->getSourceType(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getUpdatedAtBeginTime() != null) { + $query['updated_at_begin_time'] = $request->getUpdatedAtBeginTime(); + } + if ($request->getUpdatedAtEndTime() != null) { + $query['updated_at_end_time'] = $request->getUpdatedAtEndTime(); + } + if ($request->getSortField() != null) { + $query['sort_field'] = $request->getSortField(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/refunds", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListPaymentRefundsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Refunds/Requests/GetRefundsRequest.php b/src/Refunds/Requests/GetRefundsRequest.php new file mode 100644 index 00000000..49a054e7 --- /dev/null +++ b/src/Refunds/Requests/GetRefundsRequest.php @@ -0,0 +1,41 @@ +refundId = $values['refundId']; + } + + /** + * @return string + */ + public function getRefundId(): string + { + return $this->refundId; + } + + /** + * @param string $value + */ + public function setRefundId(string $value): self + { + $this->refundId = $value; + return $this; + } +} diff --git a/src/Refunds/Requests/ListRefundsRequest.php b/src/Refunds/Requests/ListRefundsRequest.php new file mode 100644 index 00000000..261523eb --- /dev/null +++ b/src/Refunds/Requests/ListRefundsRequest.php @@ -0,0 +1,334 @@ + $sortField The field used to sort results by. The default is `CREATED_AT`. + */ + private ?string $sortField; + + /** + * @param array{ + * beginTime?: ?string, + * endTime?: ?string, + * sortOrder?: ?string, + * cursor?: ?string, + * locationId?: ?string, + * status?: ?string, + * sourceType?: ?string, + * limit?: ?int, + * updatedAtBeginTime?: ?string, + * updatedAtEndTime?: ?string, + * sortField?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->beginTime = $values['beginTime'] ?? null; + $this->endTime = $values['endTime'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->status = $values['status'] ?? null; + $this->sourceType = $values['sourceType'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->updatedAtBeginTime = $values['updatedAtBeginTime'] ?? null; + $this->updatedAtEndTime = $values['updatedAtEndTime'] ?? null; + $this->sortField = $values['sortField'] ?? null; + } + + /** + * @return ?string + */ + public function getBeginTime(): ?string + { + return $this->beginTime; + } + + /** + * @param ?string $value + */ + public function setBeginTime(?string $value = null): self + { + $this->beginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndTime(): ?string + { + return $this->endTime; + } + + /** + * @param ?string $value + */ + public function setEndTime(?string $value = null): self + { + $this->endTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?string $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceType(): ?string + { + return $this->sourceType; + } + + /** + * @param ?string $value + */ + public function setSourceType(?string $value = null): self + { + $this->sourceType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAtBeginTime(): ?string + { + return $this->updatedAtBeginTime; + } + + /** + * @param ?string $value + */ + public function setUpdatedAtBeginTime(?string $value = null): self + { + $this->updatedAtBeginTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAtEndTime(): ?string + { + return $this->updatedAtEndTime; + } + + /** + * @param ?string $value + */ + public function setUpdatedAtEndTime(?string $value = null): self + { + $this->updatedAtEndTime = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortField(): ?string + { + return $this->sortField; + } + + /** + * @param ?value-of $value + */ + public function setSortField(?string $value = null): self + { + $this->sortField = $value; + return $this; + } +} diff --git a/src/Refunds/Requests/RefundPaymentRequest.php b/src/Refunds/Requests/RefundPaymentRequest.php new file mode 100644 index 00000000..906cc5c0 --- /dev/null +++ b/src/Refunds/Requests/RefundPaymentRequest.php @@ -0,0 +1,410 @@ +idempotencyKey = $values['idempotencyKey']; + $this->amountMoney = $values['amountMoney']; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + $this->destinationId = $values['destinationId'] ?? null; + $this->unlinked = $values['unlinked'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->paymentVersionToken = $values['paymentVersionToken'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->cashDetails = $values['cashDetails'] ?? null; + $this->externalDetails = $values['externalDetails'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDestinationId(): ?string + { + return $this->destinationId; + } + + /** + * @param ?string $value + */ + public function setDestinationId(?string $value = null): self + { + $this->destinationId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getUnlinked(): ?bool + { + return $this->unlinked; + } + + /** + * @param ?bool $value + */ + public function setUnlinked(?bool $value = null): self + { + $this->unlinked = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReason(): ?string + { + return $this->reason; + } + + /** + * @param ?string $value + */ + public function setReason(?string $value = null): self + { + $this->reason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentVersionToken(): ?string + { + return $this->paymentVersionToken; + } + + /** + * @param ?string $value + */ + public function setPaymentVersionToken(?string $value = null): self + { + $this->paymentVersionToken = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?DestinationDetailsCashRefundDetails + */ + public function getCashDetails(): ?DestinationDetailsCashRefundDetails + { + return $this->cashDetails; + } + + /** + * @param ?DestinationDetailsCashRefundDetails $value + */ + public function setCashDetails(?DestinationDetailsCashRefundDetails $value = null): self + { + $this->cashDetails = $value; + return $this; + } + + /** + * @return ?DestinationDetailsExternalRefundDetails + */ + public function getExternalDetails(): ?DestinationDetailsExternalRefundDetails + { + return $this->externalDetails; + } + + /** + * @param ?DestinationDetailsExternalRefundDetails $value + */ + public function setExternalDetails(?DestinationDetailsExternalRefundDetails $value = null): self + { + $this->externalDetails = $value; + return $this; + } +} diff --git a/src/Server.php b/src/Server.php deleted file mode 100644 index 78337fa5..00000000 --- a/src/Server.php +++ /dev/null @@ -1,13 +0,0 @@ -, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListSitesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function list(?array $options = null): ListSitesResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/sites", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListSitesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Snippets/Requests/DeleteSnippetsRequest.php b/src/Snippets/Requests/DeleteSnippetsRequest.php new file mode 100644 index 00000000..24347d5a --- /dev/null +++ b/src/Snippets/Requests/DeleteSnippetsRequest.php @@ -0,0 +1,41 @@ +siteId = $values['siteId']; + } + + /** + * @return string + */ + public function getSiteId(): string + { + return $this->siteId; + } + + /** + * @param string $value + */ + public function setSiteId(string $value): self + { + $this->siteId = $value; + return $this; + } +} diff --git a/src/Snippets/Requests/GetSnippetsRequest.php b/src/Snippets/Requests/GetSnippetsRequest.php new file mode 100644 index 00000000..2bfb48cb --- /dev/null +++ b/src/Snippets/Requests/GetSnippetsRequest.php @@ -0,0 +1,41 @@ +siteId = $values['siteId']; + } + + /** + * @return string + */ + public function getSiteId(): string + { + return $this->siteId; + } + + /** + * @param string $value + */ + public function setSiteId(string $value): self + { + $this->siteId = $value; + return $this; + } +} diff --git a/src/Snippets/Requests/UpsertSnippetRequest.php b/src/Snippets/Requests/UpsertSnippetRequest.php new file mode 100644 index 00000000..6ccee862 --- /dev/null +++ b/src/Snippets/Requests/UpsertSnippetRequest.php @@ -0,0 +1,68 @@ +siteId = $values['siteId']; + $this->snippet = $values['snippet']; + } + + /** + * @return string + */ + public function getSiteId(): string + { + return $this->siteId; + } + + /** + * @param string $value + */ + public function setSiteId(string $value): self + { + $this->siteId = $value; + return $this; + } + + /** + * @return Snippet + */ + public function getSnippet(): Snippet + { + return $this->snippet; + } + + /** + * @param Snippet $value + */ + public function setSnippet(Snippet $value): self + { + $this->snippet = $value; + return $this; + } +} diff --git a/src/Snippets/SnippetsClient.php b/src/Snippets/SnippetsClient.php new file mode 100644 index 00000000..60756494 --- /dev/null +++ b/src/Snippets/SnippetsClient.php @@ -0,0 +1,239 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application. + * + * You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param GetSnippetsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetSnippetResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetSnippetsRequest $request, ?array $options = null): GetSnippetResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/sites/{$request->getSiteId()}/snippet", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetSnippetResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Adds a snippet to a Square Online site or updates the existing snippet on the site. + * The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. + * + * You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param UpsertSnippetRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpsertSnippetResponse + * @throws SquareException + * @throws SquareApiException + */ + public function upsert(UpsertSnippetRequest $request, ?array $options = null): UpsertSnippetResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/sites/{$request->getSiteId()}/snippet", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpsertSnippetResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Removes your snippet from a Square Online site. + * + * You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param DeleteSnippetsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteSnippetResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteSnippetsRequest $request, ?array $options = null): DeleteSnippetResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/sites/{$request->getSiteId()}/snippet", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteSnippetResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/SquareClient.php b/src/SquareClient.php index 6e3e2a00..afce4452 100644 --- a/src/SquareClient.php +++ b/src/SquareClient.php @@ -1,831 +1,316 @@ config = array_merge(ConfigurationDefaults::_ALL, CoreHelper::clone($config)); - $this->bearerAuthManager = new BearerAuthManager($this->config); - $this->validateConfig(); - $this->client = ClientBuilder::init(new HttpClient(Configuration::init($this))) - ->converter(new CompatibilityConverter()) - ->jsonHelper(ApiHelper::getJsonHelper()) - ->apiCallback($this->config['httpCallback'] ?? null) - ->userAgent( - 'Square-PHP-SDK/40.0.0.20250123 ({api-version}) {engine}/{engine-version} ({os-' . - 'info}) {detail}' - ) - ->userAgentConfig( - [ - '{api-version}' => $this->getSquareVersion(), - '{detail}' => rawurlencode($this->getUserAgentDetail()) - ] - ) - ->globalConfig($this->getGlobalConfiguration()) - ->globalRuntimeParam(AdditionalHeaderParams::init($this->getAdditionalHeaders())) - ->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_) - ->authManagers(['global' => $this->bearerAuthManager]) - ->build(); - } + public MobileClient $mobile; /** - * Create a builder with the current client's configurations. - * - * @return SquareClientBuilder SquareClientBuilder instance + * @var OAuthClient $oAuth */ - public function toBuilder(): SquareClientBuilder - { - $builder = SquareClientBuilder::init() - ->timeout($this->getTimeout()) - ->enableRetries($this->shouldEnableRetries()) - ->numberOfRetries($this->getNumberOfRetries()) - ->retryInterval($this->getRetryInterval()) - ->backOffFactor($this->getBackOffFactor()) - ->maximumRetryWaitTime($this->getMaximumRetryWaitTime()) - ->retryOnTimeout($this->shouldRetryOnTimeout()) - ->httpStatusCodesToRetry($this->getHttpStatusCodesToRetry()) - ->httpMethodsToRetry($this->getHttpMethodsToRetry()) - ->squareVersion($this->getSquareVersion()) - ->additionalHeaders($this->getAdditionalHeaders()) - ->userAgentDetail($this->getUserAgentDetail()) - ->environment($this->getEnvironment()) - ->customUrl($this->getCustomUrl()) - ->httpCallback($this->config['httpCallback'] ?? null); - - $bearerAuth = $this->getBearerAuthCredentialsBuilder(); - if ($bearerAuth != null) { - $builder->bearerAuthCredentials($bearerAuth); - } - return $builder; - } - - public function getTimeout(): int - { - return $this->config['timeout'] ?? ConfigurationDefaults::TIMEOUT; - } - - public function shouldEnableRetries(): bool - { - return $this->config['enableRetries'] ?? ConfigurationDefaults::ENABLE_RETRIES; - } - - public function getNumberOfRetries(): int - { - return $this->config['numberOfRetries'] ?? ConfigurationDefaults::NUMBER_OF_RETRIES; - } - - public function getRetryInterval(): float - { - return $this->config['retryInterval'] ?? ConfigurationDefaults::RETRY_INTERVAL; - } - - public function getBackOffFactor(): float - { - return $this->config['backOffFactor'] ?? ConfigurationDefaults::BACK_OFF_FACTOR; - } - - public function getMaximumRetryWaitTime(): int - { - return $this->config['maximumRetryWaitTime'] ?? ConfigurationDefaults::MAXIMUM_RETRY_WAIT_TIME; - } - - public function shouldRetryOnTimeout(): bool - { - return $this->config['retryOnTimeout'] ?? ConfigurationDefaults::RETRY_ON_TIMEOUT; - } - - public function getHttpStatusCodesToRetry(): array - { - return $this->config['httpStatusCodesToRetry'] ?? ConfigurationDefaults::HTTP_STATUS_CODES_TO_RETRY; - } - - public function getHttpMethodsToRetry(): array - { - return $this->config['httpMethodsToRetry'] ?? ConfigurationDefaults::HTTP_METHODS_TO_RETRY; - } - - public function getSquareVersion(): string - { - return $this->config['squareVersion'] ?? ConfigurationDefaults::SQUARE_VERSION; - } - - public function getAdditionalHeaders(): array - { - return $this->config['additionalHeaders'] ?? ConfigurationDefaults::ADDITIONAL_HEADERS; - } - - public function getUserAgentDetail(): string - { - return $this->config['userAgentDetail'] ?? ConfigurationDefaults::USER_AGENT_DETAIL; - } - - public function getEnvironment(): string - { - return $this->config['environment'] ?? ConfigurationDefaults::ENVIRONMENT; - } - - public function getCustomUrl(): string - { - return $this->config['customUrl'] ?? ConfigurationDefaults::CUSTOM_URL; - } - - public function getBearerAuthCredentials(): BearerAuthCredentials - { - return $this->bearerAuthManager; - } - - public function getBearerAuthCredentialsBuilder(): ?BearerAuthCredentialsBuilder - { - if (empty($this->bearerAuthManager->getAccessToken())) { - return null; - } - return BearerAuthCredentialsBuilder::init($this->bearerAuthManager->getAccessToken()); - } + public OAuthClient $oAuth; /** - * Get the client configuration as an associative array - * - * @see SquareClientBuilder::getConfiguration() + * @var V1TransactionsClient $v1Transactions */ - public function getConfiguration(): array - { - return $this->toBuilder()->getConfiguration(); - } + public V1TransactionsClient $v1Transactions; /** - * Clone this client and override given configuration options - * - * @see SquareClientBuilder::build() + * @var ApplePayClient $applePay */ - public function withConfiguration(array $config): self - { - return new self(array_merge($this->config, $config)); - } + public ApplePayClient $applePay; /** - * Get current SDK version + * @var BankAccountsClient $bankAccounts */ - public function getSdkVersion(): string - { - return '40.0.0.20250123'; - } + public BankAccountsClient $bankAccounts; /** - * Validate required configuration variables + * @var BookingsClient $bookings */ - private function validateConfig(): void - { - SquareClientBuilder::init() - ->additionalHeaders($this->getAdditionalHeaders()) - ->userAgentDetail($this->getUserAgentDetail()); - } + public BookingsClient $bookings; /** - * Get the base uri for a given server in the current environment. - * - * @param string $server Server name - * - * @return string Base URI + * @var CardsClient $cards */ - public function getBaseUri(string $server = Server::DEFAULT_): string - { - return $this->client->getGlobalRequest($server)->getQueryUrl(); - } + public CardsClient $cards; /** - * Returns Mobile Authorization Api + * @var CatalogClient $catalog */ - public function getMobileAuthorizationApi(): MobileAuthorizationApi - { - if ($this->mobileAuthorization == null) { - $this->mobileAuthorization = new MobileAuthorizationApi($this->client); - } - return $this->mobileAuthorization; - } + public CatalogClient $catalog; /** - * Returns O Auth Api + * @var CustomersClient $customers */ - public function getOAuthApi(): OAuthApi - { - if ($this->oAuth == null) { - $this->oAuth = new OAuthApi($this->client); - } - return $this->oAuth; - } + public CustomersClient $customers; /** - * Returns V1 Transactions Api + * @var DevicesClient $devices */ - public function getV1TransactionsApi(): V1TransactionsApi - { - if ($this->v1Transactions == null) { - $this->v1Transactions = new V1TransactionsApi($this->client); - } - return $this->v1Transactions; - } + public DevicesClient $devices; /** - * Returns Apple Pay Api + * @var DisputesClient $disputes */ - public function getApplePayApi(): ApplePayApi - { - if ($this->applePay == null) { - $this->applePay = new ApplePayApi($this->client); - } - return $this->applePay; - } + public DisputesClient $disputes; /** - * Returns Bank Accounts Api + * @var EmployeesClient $employees */ - public function getBankAccountsApi(): BankAccountsApi - { - if ($this->bankAccounts == null) { - $this->bankAccounts = new BankAccountsApi($this->client); - } - return $this->bankAccounts; - } + public EmployeesClient $employees; /** - * Returns Bookings Api + * @var EventsClient $events */ - public function getBookingsApi(): BookingsApi - { - if ($this->bookings == null) { - $this->bookings = new BookingsApi($this->client); - } - return $this->bookings; - } + public EventsClient $events; /** - * Returns Booking Custom Attributes Api + * @var GiftCardsClient $giftCards */ - public function getBookingCustomAttributesApi(): BookingCustomAttributesApi - { - if ($this->bookingCustomAttributes == null) { - $this->bookingCustomAttributes = new BookingCustomAttributesApi($this->client); - } - return $this->bookingCustomAttributes; - } + public GiftCardsClient $giftCards; /** - * Returns Cards Api + * @var InventoryClient $inventory */ - public function getCardsApi(): CardsApi - { - if ($this->cards == null) { - $this->cards = new CardsApi($this->client); - } - return $this->cards; - } + public InventoryClient $inventory; /** - * Returns Cash Drawers Api + * @var InvoicesClient $invoices */ - public function getCashDrawersApi(): CashDrawersApi - { - if ($this->cashDrawers == null) { - $this->cashDrawers = new CashDrawersApi($this->client); - } - return $this->cashDrawers; - } + public InvoicesClient $invoices; /** - * Returns Catalog Api + * @var LocationsClient $locations */ - public function getCatalogApi(): CatalogApi - { - if ($this->catalog == null) { - $this->catalog = new CatalogApi($this->client); - } - return $this->catalog; - } + public LocationsClient $locations; /** - * Returns Customers Api + * @var LoyaltyClient $loyalty */ - public function getCustomersApi(): CustomersApi - { - if ($this->customers == null) { - $this->customers = new CustomersApi($this->client); - } - return $this->customers; - } + public LoyaltyClient $loyalty; /** - * Returns Customer Custom Attributes Api + * @var MerchantsClient $merchants */ - public function getCustomerCustomAttributesApi(): CustomerCustomAttributesApi - { - if ($this->customerCustomAttributes == null) { - $this->customerCustomAttributes = new CustomerCustomAttributesApi($this->client); - } - return $this->customerCustomAttributes; - } + public MerchantsClient $merchants; /** - * Returns Customer Groups Api + * @var CheckoutClient $checkout */ - public function getCustomerGroupsApi(): CustomerGroupsApi - { - if ($this->customerGroups == null) { - $this->customerGroups = new CustomerGroupsApi($this->client); - } - return $this->customerGroups; - } + public CheckoutClient $checkout; /** - * Returns Customer Segments Api + * @var OrdersClient $orders */ - public function getCustomerSegmentsApi(): CustomerSegmentsApi - { - if ($this->customerSegments == null) { - $this->customerSegments = new CustomerSegmentsApi($this->client); - } - return $this->customerSegments; - } + public OrdersClient $orders; /** - * Returns Devices Api + * @var PaymentsClient $payments */ - public function getDevicesApi(): DevicesApi - { - if ($this->devices == null) { - $this->devices = new DevicesApi($this->client); - } - return $this->devices; - } + public PaymentsClient $payments; /** - * Returns Disputes Api + * @var PayoutsClient $payouts */ - public function getDisputesApi(): DisputesApi - { - if ($this->disputes == null) { - $this->disputes = new DisputesApi($this->client); - } - return $this->disputes; - } + public PayoutsClient $payouts; /** - * Returns Employees Api + * @var RefundsClient $refunds */ - public function getEmployeesApi(): EmployeesApi - { - if ($this->employees == null) { - $this->employees = new EmployeesApi($this->client); - } - return $this->employees; - } - - /** - * Returns Events Api - */ - public function getEventsApi(): EventsApi - { - if ($this->events == null) { - $this->events = new EventsApi($this->client); - } - return $this->events; - } + public RefundsClient $refunds; /** - * Returns Gift Cards Api + * @var SitesClient $sites */ - public function getGiftCardsApi(): GiftCardsApi - { - if ($this->giftCards == null) { - $this->giftCards = new GiftCardsApi($this->client); - } - return $this->giftCards; - } - - /** - * Returns Gift Card Activities Api - */ - public function getGiftCardActivitiesApi(): GiftCardActivitiesApi - { - if ($this->giftCardActivities == null) { - $this->giftCardActivities = new GiftCardActivitiesApi($this->client); - } - return $this->giftCardActivities; - } + public SitesClient $sites; /** - * Returns Inventory Api + * @var SnippetsClient $snippets */ - public function getInventoryApi(): InventoryApi - { - if ($this->inventory == null) { - $this->inventory = new InventoryApi($this->client); - } - return $this->inventory; - } + public SnippetsClient $snippets; /** - * Returns Invoices Api + * @var SubscriptionsClient $subscriptions */ - public function getInvoicesApi(): InvoicesApi - { - if ($this->invoices == null) { - $this->invoices = new InvoicesApi($this->client); - } - return $this->invoices; - } + public SubscriptionsClient $subscriptions; /** - * Returns Labor Api + * @var TeamMembersClient $teamMembers */ - public function getLaborApi(): LaborApi - { - if ($this->labor == null) { - $this->labor = new LaborApi($this->client); - } - return $this->labor; - } + public TeamMembersClient $teamMembers; /** - * Returns Locations Api + * @var TeamClient $team */ - public function getLocationsApi(): LocationsApi - { - if ($this->locations == null) { - $this->locations = new LocationsApi($this->client); - } - return $this->locations; - } + public TeamClient $team; /** - * Returns Location Custom Attributes Api + * @var TerminalClient $terminal */ - public function getLocationCustomAttributesApi(): LocationCustomAttributesApi - { - if ($this->locationCustomAttributes == null) { - $this->locationCustomAttributes = new LocationCustomAttributesApi($this->client); - } - return $this->locationCustomAttributes; - } + public TerminalClient $terminal; /** - * Returns Checkout Api + * @var VendorsClient $vendors */ - public function getCheckoutApi(): CheckoutApi - { - if ($this->checkout == null) { - $this->checkout = new CheckoutApi($this->client); - } - return $this->checkout; - } + public VendorsClient $vendors; /** - * Returns Transactions Api + * @var CashDrawersClient $cashDrawers */ - public function getTransactionsApi(): TransactionsApi - { - if ($this->transactions == null) { - $this->transactions = new TransactionsApi($this->client); - } - return $this->transactions; - } + public CashDrawersClient $cashDrawers; /** - * Returns Loyalty Api + * @var LaborClient $labor */ - public function getLoyaltyApi(): LoyaltyApi - { - if ($this->loyalty == null) { - $this->loyalty = new LoyaltyApi($this->client); - } - return $this->loyalty; - } + public LaborClient $labor; /** - * Returns Merchants Api + * @var WebhooksClient $webhooks */ - public function getMerchantsApi(): MerchantsApi - { - if ($this->merchants == null) { - $this->merchants = new MerchantsApi($this->client); - } - return $this->merchants; - } + public WebhooksClient $webhooks; /** - * Returns Merchant Custom Attributes Api + * @var array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options */ - public function getMerchantCustomAttributesApi(): MerchantCustomAttributesApi - { - if ($this->merchantCustomAttributes == null) { - $this->merchantCustomAttributes = new MerchantCustomAttributesApi($this->client); - } - return $this->merchantCustomAttributes; - } + private array $options; /** - * Returns Orders Api + * @var RawClient $client */ - public function getOrdersApi(): OrdersApi - { - if ($this->orders == null) { - $this->orders = new OrdersApi($this->client); - } - return $this->orders; - } + private RawClient $client; /** - * Returns Order Custom Attributes Api + * @param ?string $token The token to use for authentication. + * @param ?string $version + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options */ - public function getOrderCustomAttributesApi(): OrderCustomAttributesApi - { - if ($this->orderCustomAttributes == null) { - $this->orderCustomAttributes = new OrderCustomAttributesApi($this->client); - } - return $this->orderCustomAttributes; - } - - /** - * Returns Payments Api - */ - public function getPaymentsApi(): PaymentsApi - { - if ($this->payments == null) { - $this->payments = new PaymentsApi($this->client); - } - return $this->payments; - } - - /** - * Returns Payouts Api - */ - public function getPayoutsApi(): PayoutsApi - { - if ($this->payouts == null) { - $this->payouts = new PayoutsApi($this->client); - } - return $this->payouts; - } - - /** - * Returns Refunds Api - */ - public function getRefundsApi(): RefundsApi - { - if ($this->refunds == null) { - $this->refunds = new RefundsApi($this->client); - } - return $this->refunds; - } - - /** - * Returns Sites Api - */ - public function getSitesApi(): SitesApi - { - if ($this->sites == null) { - $this->sites = new SitesApi($this->client); - } - return $this->sites; - } - - /** - * Returns Snippets Api - */ - public function getSnippetsApi(): SnippetsApi - { - if ($this->snippets == null) { - $this->snippets = new SnippetsApi($this->client); - } - return $this->snippets; - } - - /** - * Returns Subscriptions Api - */ - public function getSubscriptionsApi(): SubscriptionsApi - { - if ($this->subscriptions == null) { - $this->subscriptions = new SubscriptionsApi($this->client); - } - return $this->subscriptions; - } - - /** - * Returns Team Api - */ - public function getTeamApi(): TeamApi - { - if ($this->team == null) { - $this->team = new TeamApi($this->client); - } - return $this->team; - } - - /** - * Returns Terminal Api - */ - public function getTerminalApi(): TerminalApi - { - if ($this->terminal == null) { - $this->terminal = new TerminalApi($this->client); - } - return $this->terminal; - } - - /** - * Returns Vendors Api - */ - public function getVendorsApi(): VendorsApi - { - if ($this->vendors == null) { - $this->vendors = new VendorsApi($this->client); - } - return $this->vendors; - } - - /** - * Returns Webhook Subscriptions Api - */ - public function getWebhookSubscriptionsApi(): WebhookSubscriptionsApi - { - if ($this->webhookSubscriptions == null) { - $this->webhookSubscriptions = new WebhookSubscriptionsApi($this->client); - } - return $this->webhookSubscriptions; - } - - /** - * Get the defined global configurations - */ - private function getGlobalConfiguration(): array - { - return [ - TemplateParam::init('custom_url', $this->getCustomUrl())->dontEncode(), - HeaderParam::init('Square-Version', $this->getSquareVersion()) + public function __construct( + ?string $token = null, + ?string $version = null, + ?array $options = null, + ) { + $token ??= $this->getFromEnvOrThrow('SQUARE_TOKEN', 'Please pass in token or set the environment variable SQUARE_TOKEN.'); + $defaultHeaders = [ + 'Authorization' => "Bearer $token", + 'Square-Version' => '2025-02-20', + 'X-Fern-Language' => 'PHP', + 'X-Fern-SDK-Name' => 'Square', + 'X-Fern-SDK-Version' => '0.0.350', + 'User-Agent' => 'square/square/0.0.350', ]; + if ($version != null) { + $defaultHeaders['Square-Version'] = $version; + } + + $this->options = $options ?? []; + $this->options['headers'] = array_merge( + $defaultHeaders, + $this->options['headers'] ?? [], + ); + + $this->client = new RawClient( + options: $this->options, + ); + + $this->mobile = new MobileClient($this->client, $this->options); + $this->oAuth = new OAuthClient($this->client, $this->options); + $this->v1Transactions = new V1TransactionsClient($this->client, $this->options); + $this->applePay = new ApplePayClient($this->client, $this->options); + $this->bankAccounts = new BankAccountsClient($this->client, $this->options); + $this->bookings = new BookingsClient($this->client, $this->options); + $this->cards = new CardsClient($this->client, $this->options); + $this->catalog = new CatalogClient($this->client, $this->options); + $this->customers = new CustomersClient($this->client, $this->options); + $this->devices = new DevicesClient($this->client, $this->options); + $this->disputes = new DisputesClient($this->client, $this->options); + $this->employees = new EmployeesClient($this->client, $this->options); + $this->events = new EventsClient($this->client, $this->options); + $this->giftCards = new GiftCardsClient($this->client, $this->options); + $this->inventory = new InventoryClient($this->client, $this->options); + $this->invoices = new InvoicesClient($this->client, $this->options); + $this->locations = new LocationsClient($this->client, $this->options); + $this->loyalty = new LoyaltyClient($this->client, $this->options); + $this->merchants = new MerchantsClient($this->client, $this->options); + $this->checkout = new CheckoutClient($this->client, $this->options); + $this->orders = new OrdersClient($this->client, $this->options); + $this->payments = new PaymentsClient($this->client, $this->options); + $this->payouts = new PayoutsClient($this->client, $this->options); + $this->refunds = new RefundsClient($this->client, $this->options); + $this->sites = new SitesClient($this->client, $this->options); + $this->snippets = new SnippetsClient($this->client, $this->options); + $this->subscriptions = new SubscriptionsClient($this->client, $this->options); + $this->teamMembers = new TeamMembersClient($this->client, $this->options); + $this->team = new TeamClient($this->client, $this->options); + $this->terminal = new TerminalClient($this->client, $this->options); + $this->vendors = new VendorsClient($this->client, $this->options); + $this->cashDrawers = new CashDrawersClient($this->client, $this->options); + $this->labor = new LaborClient($this->client, $this->options); + $this->webhooks = new WebhooksClient($this->client, $this->options); + } + + /** + * @param string $env + * @param string $message + * @return string + */ + private function getFromEnvOrThrow(string $env, string $message): string + { + $value = getenv($env); + return $value ? (string) $value : throw new Exception($message); } - - /** - * A map of all base urls used in different environments and servers - * - * @var array - */ - private const ENVIRONMENT_MAP = [ - Environment::PRODUCTION => [Server::DEFAULT_ => 'https://connect.squareup.com'], - Environment::SANDBOX => [Server::DEFAULT_ => 'https://connect.squareupsandbox.com'], - Environment::CUSTOM => [Server::DEFAULT_ => '{custom_url}'] - ]; } diff --git a/src/SquareClientBuilder.php b/src/SquareClientBuilder.php deleted file mode 100644 index 4e12efb2..00000000 --- a/src/SquareClientBuilder.php +++ /dev/null @@ -1,170 +0,0 @@ -config); - } - - public function timeout(int $timeout): self - { - $this->config['timeout'] = $timeout; - return $this; - } - - public function enableRetries(bool $enableRetries): self - { - $this->config['enableRetries'] = $enableRetries; - return $this; - } - - public function numberOfRetries(int $numberOfRetries): self - { - $this->config['numberOfRetries'] = $numberOfRetries; - return $this; - } - - public function retryInterval(float $retryInterval): self - { - $this->config['retryInterval'] = $retryInterval; - return $this; - } - - public function backOffFactor(float $backOffFactor): self - { - $this->config['backOffFactor'] = $backOffFactor; - return $this; - } - - public function maximumRetryWaitTime(int $maximumRetryWaitTime): self - { - $this->config['maximumRetryWaitTime'] = $maximumRetryWaitTime; - return $this; - } - - public function retryOnTimeout(bool $retryOnTimeout): self - { - $this->config['retryOnTimeout'] = $retryOnTimeout; - return $this; - } - - /** - * @param int[] $httpStatusCodesToRetry - * - * @return $this - */ - public function httpStatusCodesToRetry(array $httpStatusCodesToRetry): self - { - $this->config['httpStatusCodesToRetry'] = $httpStatusCodesToRetry; - return $this; - } - - /** - * @param string[] $httpMethodsToRetry - * - * @return $this - */ - public function httpMethodsToRetry(array $httpMethodsToRetry): self - { - $this->config['httpMethodsToRetry'] = $httpMethodsToRetry; - return $this; - } - - public function squareVersion(string $squareVersion): self - { - $this->config['squareVersion'] = $squareVersion; - return $this; - } - - public function additionalHeaders(array $additionalHeaders): self - { - ApiHelper::assertHeaders($additionalHeaders); - $this->config['additionalHeaders'] = $additionalHeaders; - return $this; - } - - public function userAgentDetail(string $userAgentDetail): self - { - if (strlen($userAgentDetail) > 128) { - throw new \InvalidArgumentException( - 'The length of user-agent detail should not exceed 128 characters.' - ); - } - $this->config['userAgentDetail'] = $userAgentDetail; - return $this; - } - - public function environment(string $environment): self - { - $this->config['environment'] = $environment; - return $this; - } - - public function customUrl(string $customUrl): self - { - $this->config['customUrl'] = $customUrl; - return $this; - } - - /** - * @see SquareClientBuilder::bearerAuthCredentials - * - * @deprecated This builder setter is deprecated. Checkout the see also section for its - * alternate. - * - * @param string $accessToken - * - * @return $this - */ - public function accessToken(string $accessToken): self - { - $this->config['accessToken'] = $accessToken; - return $this; - } - - public function bearerAuthCredentials(BearerAuthCredentialsBuilder $bearerAuth): self - { - $this->config = array_merge($this->config, $bearerAuth->getConfiguration()); - return $this; - } - - public function httpCallback($httpCallback): self - { - if (!$httpCallback instanceof CoreCallback) { - return $this; - } - $this->config['httpCallback'] = $httpCallback; - return $this; - } - - public function build(): SquareClient - { - return new SquareClient($this->config); - } -} diff --git a/src/Subscriptions/Requests/BulkSwapPlanRequest.php b/src/Subscriptions/Requests/BulkSwapPlanRequest.php new file mode 100644 index 00000000..d4a0ae35 --- /dev/null +++ b/src/Subscriptions/Requests/BulkSwapPlanRequest.php @@ -0,0 +1,101 @@ +newPlanVariationId = $values['newPlanVariationId']; + $this->oldPlanVariationId = $values['oldPlanVariationId']; + $this->locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getNewPlanVariationId(): string + { + return $this->newPlanVariationId; + } + + /** + * @param string $value + */ + public function setNewPlanVariationId(string $value): self + { + $this->newPlanVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function getOldPlanVariationId(): string + { + return $this->oldPlanVariationId; + } + + /** + * @param string $value + */ + public function setOldPlanVariationId(string $value): self + { + $this->oldPlanVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/CancelSubscriptionsRequest.php b/src/Subscriptions/Requests/CancelSubscriptionsRequest.php new file mode 100644 index 00000000..32091260 --- /dev/null +++ b/src/Subscriptions/Requests/CancelSubscriptionsRequest.php @@ -0,0 +1,41 @@ +subscriptionId = $values['subscriptionId']; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/ChangeBillingAnchorDateRequest.php b/src/Subscriptions/Requests/ChangeBillingAnchorDateRequest.php new file mode 100644 index 00000000..b3be6d07 --- /dev/null +++ b/src/Subscriptions/Requests/ChangeBillingAnchorDateRequest.php @@ -0,0 +1,98 @@ +subscriptionId = $values['subscriptionId']; + $this->monthlyBillingAnchorDate = $values['monthlyBillingAnchorDate'] ?? null; + $this->effectiveDate = $values['effectiveDate'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMonthlyBillingAnchorDate(): ?int + { + return $this->monthlyBillingAnchorDate; + } + + /** + * @param ?int $value + */ + public function setMonthlyBillingAnchorDate(?int $value = null): self + { + $this->monthlyBillingAnchorDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEffectiveDate(): ?string + { + return $this->effectiveDate; + } + + /** + * @param ?string $value + */ + public function setEffectiveDate(?string $value = null): self + { + $this->effectiveDate = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/CreateSubscriptionRequest.php b/src/Subscriptions/Requests/CreateSubscriptionRequest.php new file mode 100644 index 00000000..83af8058 --- /dev/null +++ b/src/Subscriptions/Requests/CreateSubscriptionRequest.php @@ -0,0 +1,383 @@ + $phases array of phases for this subscription + */ + #[JsonProperty('phases'), ArrayType([Phase::class])] + private ?array $phases; + + /** + * @param array{ + * locationId: string, + * customerId: string, + * idempotencyKey?: ?string, + * planVariationId?: ?string, + * startDate?: ?string, + * canceledDate?: ?string, + * taxPercentage?: ?string, + * priceOverrideMoney?: ?Money, + * cardId?: ?string, + * timezone?: ?string, + * source?: ?SubscriptionSource, + * monthlyBillingAnchorDate?: ?int, + * phases?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->locationId = $values['locationId']; + $this->planVariationId = $values['planVariationId'] ?? null; + $this->customerId = $values['customerId']; + $this->startDate = $values['startDate'] ?? null; + $this->canceledDate = $values['canceledDate'] ?? null; + $this->taxPercentage = $values['taxPercentage'] ?? null; + $this->priceOverrideMoney = $values['priceOverrideMoney'] ?? null; + $this->cardId = $values['cardId'] ?? null; + $this->timezone = $values['timezone'] ?? null; + $this->source = $values['source'] ?? null; + $this->monthlyBillingAnchorDate = $values['monthlyBillingAnchorDate'] ?? null; + $this->phases = $values['phases'] ?? null; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlanVariationId(): ?string + { + return $this->planVariationId; + } + + /** + * @param ?string $value + */ + public function setPlanVariationId(?string $value = null): self + { + $this->planVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartDate(): ?string + { + return $this->startDate; + } + + /** + * @param ?string $value + */ + public function setStartDate(?string $value = null): self + { + $this->startDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledDate(): ?string + { + return $this->canceledDate; + } + + /** + * @param ?string $value + */ + public function setCanceledDate(?string $value = null): self + { + $this->canceledDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTaxPercentage(): ?string + { + return $this->taxPercentage; + } + + /** + * @param ?string $value + */ + public function setTaxPercentage(?string $value = null): self + { + $this->taxPercentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceOverrideMoney(): ?Money + { + return $this->priceOverrideMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceOverrideMoney(?Money $value = null): self + { + $this->priceOverrideMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardId(): ?string + { + return $this->cardId; + } + + /** + * @param ?string $value + */ + public function setCardId(?string $value = null): self + { + $this->cardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTimezone(): ?string + { + return $this->timezone; + } + + /** + * @param ?string $value + */ + public function setTimezone(?string $value = null): self + { + $this->timezone = $value; + return $this; + } + + /** + * @return ?SubscriptionSource + */ + public function getSource(): ?SubscriptionSource + { + return $this->source; + } + + /** + * @param ?SubscriptionSource $value + */ + public function setSource(?SubscriptionSource $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMonthlyBillingAnchorDate(): ?int + { + return $this->monthlyBillingAnchorDate; + } + + /** + * @param ?int $value + */ + public function setMonthlyBillingAnchorDate(?int $value = null): self + { + $this->monthlyBillingAnchorDate = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/DeleteActionSubscriptionsRequest.php b/src/Subscriptions/Requests/DeleteActionSubscriptionsRequest.php new file mode 100644 index 00000000..624a0661 --- /dev/null +++ b/src/Subscriptions/Requests/DeleteActionSubscriptionsRequest.php @@ -0,0 +1,65 @@ +subscriptionId = $values['subscriptionId']; + $this->actionId = $values['actionId']; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return string + */ + public function getActionId(): string + { + return $this->actionId; + } + + /** + * @param string $value + */ + public function setActionId(string $value): self + { + $this->actionId = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/GetSubscriptionsRequest.php b/src/Subscriptions/Requests/GetSubscriptionsRequest.php new file mode 100644 index 00000000..bcd14a3f --- /dev/null +++ b/src/Subscriptions/Requests/GetSubscriptionsRequest.php @@ -0,0 +1,71 @@ +subscriptionId = $values['subscriptionId']; + $this->include = $values['include'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInclude(): ?string + { + return $this->include; + } + + /** + * @param ?string $value + */ + public function setInclude(?string $value = null): self + { + $this->include = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/ListEventsSubscriptionsRequest.php b/src/Subscriptions/Requests/ListEventsSubscriptionsRequest.php new file mode 100644 index 00000000..d2f36641 --- /dev/null +++ b/src/Subscriptions/Requests/ListEventsSubscriptionsRequest.php @@ -0,0 +1,98 @@ +subscriptionId = $values['subscriptionId']; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/PauseSubscriptionRequest.php b/src/Subscriptions/Requests/PauseSubscriptionRequest.php new file mode 100644 index 00000000..bc3d9ace --- /dev/null +++ b/src/Subscriptions/Requests/PauseSubscriptionRequest.php @@ -0,0 +1,186 @@ + $resumeChangeTiming + */ + #[JsonProperty('resume_change_timing')] + private ?string $resumeChangeTiming; + + /** + * @var ?string $pauseReason The user-provided reason to pause the subscription. + */ + #[JsonProperty('pause_reason')] + private ?string $pauseReason; + + /** + * @param array{ + * subscriptionId: string, + * pauseEffectiveDate?: ?string, + * pauseCycleDuration?: ?int, + * resumeEffectiveDate?: ?string, + * resumeChangeTiming?: ?value-of, + * pauseReason?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subscriptionId = $values['subscriptionId']; + $this->pauseEffectiveDate = $values['pauseEffectiveDate'] ?? null; + $this->pauseCycleDuration = $values['pauseCycleDuration'] ?? null; + $this->resumeEffectiveDate = $values['resumeEffectiveDate'] ?? null; + $this->resumeChangeTiming = $values['resumeChangeTiming'] ?? null; + $this->pauseReason = $values['pauseReason'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPauseEffectiveDate(): ?string + { + return $this->pauseEffectiveDate; + } + + /** + * @param ?string $value + */ + public function setPauseEffectiveDate(?string $value = null): self + { + $this->pauseEffectiveDate = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPauseCycleDuration(): ?int + { + return $this->pauseCycleDuration; + } + + /** + * @param ?int $value + */ + public function setPauseCycleDuration(?int $value = null): self + { + $this->pauseCycleDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getResumeEffectiveDate(): ?string + { + return $this->resumeEffectiveDate; + } + + /** + * @param ?string $value + */ + public function setResumeEffectiveDate(?string $value = null): self + { + $this->resumeEffectiveDate = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getResumeChangeTiming(): ?string + { + return $this->resumeChangeTiming; + } + + /** + * @param ?value-of $value + */ + public function setResumeChangeTiming(?string $value = null): self + { + $this->resumeChangeTiming = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPauseReason(): ?string + { + return $this->pauseReason; + } + + /** + * @param ?string $value + */ + public function setPauseReason(?string $value = null): self + { + $this->pauseReason = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/ResumeSubscriptionRequest.php b/src/Subscriptions/Requests/ResumeSubscriptionRequest.php new file mode 100644 index 00000000..f2f5077a --- /dev/null +++ b/src/Subscriptions/Requests/ResumeSubscriptionRequest.php @@ -0,0 +1,97 @@ + $resumeChangeTiming + */ + #[JsonProperty('resume_change_timing')] + private ?string $resumeChangeTiming; + + /** + * @param array{ + * subscriptionId: string, + * resumeEffectiveDate?: ?string, + * resumeChangeTiming?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subscriptionId = $values['subscriptionId']; + $this->resumeEffectiveDate = $values['resumeEffectiveDate'] ?? null; + $this->resumeChangeTiming = $values['resumeChangeTiming'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getResumeEffectiveDate(): ?string + { + return $this->resumeEffectiveDate; + } + + /** + * @param ?string $value + */ + public function setResumeEffectiveDate(?string $value = null): self + { + $this->resumeEffectiveDate = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getResumeChangeTiming(): ?string + { + return $this->resumeChangeTiming; + } + + /** + * @param ?value-of $value + */ + public function setResumeChangeTiming(?string $value = null): self + { + $this->resumeChangeTiming = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/SearchSubscriptionsRequest.php b/src/Subscriptions/Requests/SearchSubscriptionsRequest.php new file mode 100644 index 00000000..d93d50cf --- /dev/null +++ b/src/Subscriptions/Requests/SearchSubscriptionsRequest.php @@ -0,0 +1,139 @@ + $include + */ + #[JsonProperty('include'), ArrayType(['string'])] + private ?array $include; + + /** + * @param array{ + * cursor?: ?string, + * limit?: ?int, + * query?: ?SearchSubscriptionsQuery, + * include?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->query = $values['query'] ?? null; + $this->include = $values['include'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?SearchSubscriptionsQuery + */ + public function getQuery(): ?SearchSubscriptionsQuery + { + return $this->query; + } + + /** + * @param ?SearchSubscriptionsQuery $value + */ + public function setQuery(?SearchSubscriptionsQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?array + */ + public function getInclude(): ?array + { + return $this->include; + } + + /** + * @param ?array $value + */ + public function setInclude(?array $value = null): self + { + $this->include = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/SwapPlanRequest.php b/src/Subscriptions/Requests/SwapPlanRequest.php new file mode 100644 index 00000000..5dd0a6c0 --- /dev/null +++ b/src/Subscriptions/Requests/SwapPlanRequest.php @@ -0,0 +1,98 @@ + $phases A list of PhaseInputs, to pass phase-specific information used in the swap. + */ + #[JsonProperty('phases'), ArrayType([PhaseInput::class])] + private ?array $phases; + + /** + * @param array{ + * subscriptionId: string, + * newPlanVariationId?: ?string, + * phases?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subscriptionId = $values['subscriptionId']; + $this->newPlanVariationId = $values['newPlanVariationId'] ?? null; + $this->phases = $values['phases'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNewPlanVariationId(): ?string + { + return $this->newPlanVariationId; + } + + /** + * @param ?string $value + */ + public function setNewPlanVariationId(?string $value = null): self + { + $this->newPlanVariationId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } +} diff --git a/src/Subscriptions/Requests/UpdateSubscriptionRequest.php b/src/Subscriptions/Requests/UpdateSubscriptionRequest.php new file mode 100644 index 00000000..557b481e --- /dev/null +++ b/src/Subscriptions/Requests/UpdateSubscriptionRequest.php @@ -0,0 +1,72 @@ +subscriptionId = $values['subscriptionId']; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } +} diff --git a/src/Subscriptions/SubscriptionsClient.php b/src/Subscriptions/SubscriptionsClient.php new file mode 100644 index 00000000..d9629e5a --- /dev/null +++ b/src/Subscriptions/SubscriptionsClient.php @@ -0,0 +1,814 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Enrolls a customer in a subscription. + * + * If you provide a card on file in the request, Square charges the card for + * the subscription. Otherwise, Square sends an invoice to the customer's email + * address. The subscription starts immediately, unless the request includes + * the optional `start_date`. Each individual subscription is associated with a particular location. + * + * For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). + * + * @param CreateSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateSubscriptionRequest $request, ?array $options = null): CreateSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Schedules a plan variation change for all active subscriptions under a given plan + * variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + * + * @param BulkSwapPlanRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BulkSwapPlanResponse + * @throws SquareException + * @throws SquareApiException + */ + public function bulkSwapPlan(BulkSwapPlanRequest $request, ?array $options = null): BulkSwapPlanResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/bulk-swap-plan", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BulkSwapPlanResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for subscriptions. + * + * Results are ordered chronologically by subscription creation date. If + * the request specifies more than one location ID, + * the endpoint orders the result + * by location ID, and then by creation date within each location. If no locations are given + * in the query, all locations are searched. + * + * You can also optionally specify `customer_ids` to search by customer. + * If left unset, all customers + * associated with the specified locations are returned. + * If the request specifies customer IDs, the endpoint orders results + * first by location, within location by customer ID, and within + * customer by subscription creation date. + * + * @param SearchSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchSubscriptionsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchSubscriptionsRequest $request = new SearchSubscriptionsRequest(), ?array $options = null): SearchSubscriptionsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchSubscriptionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a specific subscription. + * + * @param GetSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetSubscriptionsRequest $request, ?array $options = null): GetSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getInclude() != null) { + $query['include'] = $request->getInclude(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a subscription by modifying or clearing `subscription` field values. + * To clear a field, set its value to `null`. + * + * @param UpdateSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateSubscriptionRequest $request, ?array $options = null): UpdateSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a scheduled action for a subscription. + * + * @param DeleteActionSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteSubscriptionActionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function deleteAction(DeleteActionSubscriptionsRequest $request, ?array $options = null): DeleteSubscriptionActionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/actions/{$request->getActionId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteSubscriptionActionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) + * for a subscription. + * + * @param ChangeBillingAnchorDateRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ChangeBillingAnchorDateResponse + * @throws SquareException + * @throws SquareApiException + */ + public function changeBillingAnchorDate(ChangeBillingAnchorDateRequest $request, ?array $options = null): ChangeBillingAnchorDateResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/billing-anchor", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ChangeBillingAnchorDateResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Schedules a `CANCEL` action to cancel an active subscription. This + * sets the `canceled_date` field to the end of the active billing period. After this date, + * the subscription status changes from ACTIVE to CANCELED. + * + * @param CancelSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelSubscriptionsRequest $request, ?array $options = null): CancelSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. + * + * @param ListEventsSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function listEvents(ListEventsSubscriptionsRequest $request, ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListEventsSubscriptionsRequest $request) => $this->_listEvents($request, $options), + setCursor: function (ListEventsSubscriptionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListSubscriptionEventsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListSubscriptionEventsResponse $response) => $response?->getSubscriptionEvents() ?? [], + ); + } + + /** + * Schedules a `PAUSE` action to pause an active subscription. + * + * @param PauseSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return PauseSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function pause(PauseSubscriptionRequest $request, ?array $options = null): PauseSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/pause", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return PauseSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Schedules a `RESUME` action to resume a paused or a deactivated subscription. + * + * @param ResumeSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ResumeSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function resume(ResumeSubscriptionRequest $request, ?array $options = null): ResumeSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/resume", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ResumeSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. + * For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + * + * @param SwapPlanRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SwapPlanResponse + * @throws SquareException + * @throws SquareApiException + */ + public function swapPlan(SwapPlanRequest $request, ?array $options = null): SwapPlanResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/swap-plan", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SwapPlanResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. + * + * @param ListEventsSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListSubscriptionEventsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _listEvents(ListEventsSubscriptionsRequest $request, ?array $options = null): ListSubscriptionEventsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/subscriptions/{$request->getSubscriptionId()}/events", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListSubscriptionEventsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Team/Requests/CreateJobRequest.php b/src/Team/Requests/CreateJobRequest.php new file mode 100644 index 00000000..0aed40d9 --- /dev/null +++ b/src/Team/Requests/CreateJobRequest.php @@ -0,0 +1,73 @@ +job = $values['job']; + $this->idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return Job + */ + public function getJob(): Job + { + return $this->job; + } + + /** + * @param Job $value + */ + public function setJob(Job $value): self + { + $this->job = $value; + return $this; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Team/Requests/ListJobsRequest.php b/src/Team/Requests/ListJobsRequest.php new file mode 100644 index 00000000..88d586be --- /dev/null +++ b/src/Team/Requests/ListJobsRequest.php @@ -0,0 +1,45 @@ +cursor = $values['cursor'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Team/Requests/RetrieveJobRequest.php b/src/Team/Requests/RetrieveJobRequest.php new file mode 100644 index 00000000..c6ec0800 --- /dev/null +++ b/src/Team/Requests/RetrieveJobRequest.php @@ -0,0 +1,41 @@ +jobId = $values['jobId']; + } + + /** + * @return string + */ + public function getJobId(): string + { + return $this->jobId; + } + + /** + * @param string $value + */ + public function setJobId(string $value): self + { + $this->jobId = $value; + return $this; + } +} diff --git a/src/Team/Requests/UpdateJobRequest.php b/src/Team/Requests/UpdateJobRequest.php new file mode 100644 index 00000000..c4de66e0 --- /dev/null +++ b/src/Team/Requests/UpdateJobRequest.php @@ -0,0 +1,71 @@ +jobId = $values['jobId']; + $this->job = $values['job']; + } + + /** + * @return string + */ + public function getJobId(): string + { + return $this->jobId; + } + + /** + * @param string $value + */ + public function setJobId(string $value): self + { + $this->jobId = $value; + return $this; + } + + /** + * @return Job + */ + public function getJob(): Job + { + return $this->job; + } + + /** + * @param Job $value + */ + public function setJob(Job $value): self + { + $this->job = $value; + return $this; + } +} diff --git a/src/Team/TeamClient.php b/src/Team/TeamClient.php new file mode 100644 index 00000000..347c5380 --- /dev/null +++ b/src/Team/TeamClient.php @@ -0,0 +1,289 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists jobs in a seller account. Results are sorted by title in ascending order. + * + * @param ListJobsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListJobsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function listJobs(ListJobsRequest $request = new ListJobsRequest(), ?array $options = null): ListJobsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/jobs", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListJobsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates a job in a seller account. A job defines a title and tip eligibility. Note that + * compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. + * + * @param CreateJobRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateJobResponse + * @throws SquareException + * @throws SquareApiException + */ + public function createJob(CreateJobRequest $request, ?array $options = null): CreateJobResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/jobs", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateJobResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a specified job. + * + * @param RetrieveJobRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RetrieveJobResponse + * @throws SquareException + * @throws SquareApiException + */ + public function retrieveJob(RetrieveJobRequest $request, ?array $options = null): RetrieveJobResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/jobs/{$request->getJobId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return RetrieveJobResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the title or tip eligibility of a job. Changes to the title propagate to all + * `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to + * tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. + * + * @param UpdateJobRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateJobResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateJob(UpdateJobRequest $request, ?array $options = null): UpdateJobResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/jobs/{$request->getJobId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateJobResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/TeamMembers/Requests/BatchCreateTeamMembersRequest.php b/src/TeamMembers/Requests/BatchCreateTeamMembersRequest.php new file mode 100644 index 00000000..5b969241 --- /dev/null +++ b/src/TeamMembers/Requests/BatchCreateTeamMembersRequest.php @@ -0,0 +1,51 @@ + $teamMembers + */ + #[JsonProperty('team_members'), ArrayType(['string' => CreateTeamMemberRequest::class])] + private array $teamMembers; + + /** + * @param array{ + * teamMembers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->teamMembers = $values['teamMembers']; + } + + /** + * @return array + */ + public function getTeamMembers(): array + { + return $this->teamMembers; + } + + /** + * @param array $value + */ + public function setTeamMembers(array $value): self + { + $this->teamMembers = $value; + return $this; + } +} diff --git a/src/TeamMembers/Requests/BatchUpdateTeamMembersRequest.php b/src/TeamMembers/Requests/BatchUpdateTeamMembersRequest.php new file mode 100644 index 00000000..a2a35db5 --- /dev/null +++ b/src/TeamMembers/Requests/BatchUpdateTeamMembersRequest.php @@ -0,0 +1,52 @@ + $teamMembers + */ + #[JsonProperty('team_members'), ArrayType(['string' => UpdateTeamMemberRequest::class])] + private array $teamMembers; + + /** + * @param array{ + * teamMembers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->teamMembers = $values['teamMembers']; + } + + /** + * @return array + */ + public function getTeamMembers(): array + { + return $this->teamMembers; + } + + /** + * @param array $value + */ + public function setTeamMembers(array $value): self + { + $this->teamMembers = $value; + return $this; + } +} diff --git a/src/TeamMembers/Requests/GetTeamMembersRequest.php b/src/TeamMembers/Requests/GetTeamMembersRequest.php new file mode 100644 index 00000000..947f4225 --- /dev/null +++ b/src/TeamMembers/Requests/GetTeamMembersRequest.php @@ -0,0 +1,41 @@ +teamMemberId = $values['teamMemberId']; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } +} diff --git a/src/TeamMembers/Requests/SearchTeamMembersRequest.php b/src/TeamMembers/Requests/SearchTeamMembersRequest.php new file mode 100644 index 00000000..3ae097d4 --- /dev/null +++ b/src/TeamMembers/Requests/SearchTeamMembersRequest.php @@ -0,0 +1,97 @@ +query = $values['query'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?SearchTeamMembersQuery + */ + public function getQuery(): ?SearchTeamMembersQuery + { + return $this->query; + } + + /** + * @param ?SearchTeamMembersQuery $value + */ + public function setQuery(?SearchTeamMembersQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/TeamMembers/Requests/UpdateTeamMembersRequest.php b/src/TeamMembers/Requests/UpdateTeamMembersRequest.php new file mode 100644 index 00000000..1c3e5a42 --- /dev/null +++ b/src/TeamMembers/Requests/UpdateTeamMembersRequest.php @@ -0,0 +1,66 @@ +teamMemberId = $values['teamMemberId']; + $this->body = $values['body']; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return UpdateTeamMemberRequest + */ + public function getBody(): UpdateTeamMemberRequest + { + return $this->body; + } + + /** + * @param UpdateTeamMemberRequest $value + */ + public function setBody(UpdateTeamMemberRequest $value): self + { + $this->body = $value; + return $this; + } +} diff --git a/src/TeamMembers/TeamMembersClient.php b/src/TeamMembers/TeamMembersClient.php new file mode 100644 index 00000000..86b79e44 --- /dev/null +++ b/src/TeamMembers/TeamMembersClient.php @@ -0,0 +1,423 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->wageSetting = new WageSettingClient($this->client, $this->options); + } + + /** + * Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates. + * You must provide the following values in your request to this endpoint: + * - `given_name` + * - `family_name` + * + * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). + * + * @param CreateTeamMemberRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateTeamMemberResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateTeamMemberRequest $request, ?array $options = null): CreateTeamMemberResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateTeamMemberResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates. + * This process is non-transactional and processes as much of the request as possible. If one of the creates in + * the request cannot be successfully processed, the request is not marked as failed, but the body of the response + * contains explicit error information for the failed create. + * + * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). + * + * @param BatchCreateTeamMembersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchCreateTeamMembersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchCreate(BatchCreateTeamMembersRequest $request, ?array $options = null): BatchCreateTeamMembersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/bulk-create", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchCreateTeamMembersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates. + * This process is non-transactional and processes as much of the request as possible. If one of the updates in + * the request cannot be successfully processed, the request is not marked as failed, but the body of the response + * contains explicit error information for the failed update. + * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). + * + * @param BatchUpdateTeamMembersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchUpdateTeamMembersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpdate(BatchUpdateTeamMembersRequest $request, ?array $options = null): BatchUpdateTeamMembersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/bulk-update", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchUpdateTeamMembersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a paginated list of `TeamMember` objects for a business. + * The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether + * the team member is the Square account owner. + * + * @param SearchTeamMembersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchTeamMembersResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchTeamMembersRequest $request = new SearchTeamMembersRequest(), ?array $options = null): SearchTeamMembersResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchTeamMembersResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a `TeamMember` object for the given `TeamMember.id`. + * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). + * + * @param GetTeamMembersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTeamMemberResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetTeamMembersRequest $request, ?array $options = null): GetTeamMemberResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/{$request->getTeamMemberId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTeamMemberResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates. + * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). + * + * @param UpdateTeamMembersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateTeamMemberResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateTeamMembersRequest $request, ?array $options = null): UpdateTeamMemberResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/{$request->getTeamMemberId()}", + method: HttpMethod::PUT, + body: $request->getBody(), + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateTeamMemberResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/TeamMembers/WageSetting/Requests/GetWageSettingRequest.php b/src/TeamMembers/WageSetting/Requests/GetWageSettingRequest.php new file mode 100644 index 00000000..c5581bf1 --- /dev/null +++ b/src/TeamMembers/WageSetting/Requests/GetWageSettingRequest.php @@ -0,0 +1,41 @@ +teamMemberId = $values['teamMemberId']; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } +} diff --git a/src/TeamMembers/WageSetting/Requests/UpdateWageSettingRequest.php b/src/TeamMembers/WageSetting/Requests/UpdateWageSettingRequest.php new file mode 100644 index 00000000..09e6715a --- /dev/null +++ b/src/TeamMembers/WageSetting/Requests/UpdateWageSettingRequest.php @@ -0,0 +1,74 @@ +teamMemberId = $values['teamMemberId']; + $this->wageSetting = $values['wageSetting']; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return WageSetting + */ + public function getWageSetting(): WageSetting + { + return $this->wageSetting; + } + + /** + * @param WageSetting $value + */ + public function setWageSetting(WageSetting $value): self + { + $this->wageSetting = $value; + return $this; + } +} diff --git a/src/TeamMembers/WageSetting/WageSettingClient.php b/src/TeamMembers/WageSetting/WageSettingClient.php new file mode 100644 index 00000000..43cace58 --- /dev/null +++ b/src/TeamMembers/WageSetting/WageSettingClient.php @@ -0,0 +1,178 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Retrieves a `WageSetting` object for a team member specified + * by `TeamMember.id`. For more information, see + * [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting). + * + * Square recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + * to get this information directly from the `TeamMember.wage_setting` field. + * + * @param GetWageSettingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetWageSettingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetWageSettingRequest $request, ?array $options = null): GetWageSettingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/{$request->getTeamMemberId()}/wage-setting", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetWageSettingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates or updates a `WageSetting` object. The object is created if a + * `WageSetting` with the specified `team_member_id` doesn't exist. Otherwise, + * it fully replaces the `WageSetting` object for the team member. + * The `WageSetting` is returned on a successful update. For more information, see + * [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). + * + * Square recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) + * to manage the `TeamMember.wage_setting` field directly. + * + * @param UpdateWageSettingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateWageSettingResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateWageSettingRequest $request, ?array $options = null): UpdateWageSettingResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/team-members/{$request->getTeamMemberId()}/wage-setting", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateWageSettingResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Terminal/Actions/ActionsClient.php b/src/Terminal/Actions/ActionsClient.php new file mode 100644 index 00000000..92cc7cf9 --- /dev/null +++ b/src/Terminal/Actions/ActionsClient.php @@ -0,0 +1,281 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a Terminal action request and sends it to the specified device. + * + * @param CreateTerminalActionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateTerminalActionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateTerminalActionRequest $request, ?array $options = null): CreateTerminalActionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/actions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateTerminalActionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. + * + * @param SearchTerminalActionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchTerminalActionsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchTerminalActionsRequest $request = new SearchTerminalActionsRequest(), ?array $options = null): SearchTerminalActionsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/actions/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchTerminalActionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. + * + * @param GetActionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTerminalActionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetActionsRequest $request, ?array $options = null): GetTerminalActionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/actions/{$request->getActionId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTerminalActionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels a Terminal action request if the status of the request permits it. + * + * @param CancelActionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelTerminalActionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelActionsRequest $request, ?array $options = null): CancelTerminalActionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/actions/{$request->getActionId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelTerminalActionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Terminal/Actions/Requests/CancelActionsRequest.php b/src/Terminal/Actions/Requests/CancelActionsRequest.php new file mode 100644 index 00000000..ce84d61b --- /dev/null +++ b/src/Terminal/Actions/Requests/CancelActionsRequest.php @@ -0,0 +1,41 @@ +actionId = $values['actionId']; + } + + /** + * @return string + */ + public function getActionId(): string + { + return $this->actionId; + } + + /** + * @param string $value + */ + public function setActionId(string $value): self + { + $this->actionId = $value; + return $this; + } +} diff --git a/src/Terminal/Actions/Requests/CreateTerminalActionRequest.php b/src/Terminal/Actions/Requests/CreateTerminalActionRequest.php new file mode 100644 index 00000000..e5aa63bc --- /dev/null +++ b/src/Terminal/Actions/Requests/CreateTerminalActionRequest.php @@ -0,0 +1,75 @@ +idempotencyKey = $values['idempotencyKey']; + $this->action = $values['action']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return TerminalAction + */ + public function getAction(): TerminalAction + { + return $this->action; + } + + /** + * @param TerminalAction $value + */ + public function setAction(TerminalAction $value): self + { + $this->action = $value; + return $this; + } +} diff --git a/src/Terminal/Actions/Requests/GetActionsRequest.php b/src/Terminal/Actions/Requests/GetActionsRequest.php new file mode 100644 index 00000000..cd757e46 --- /dev/null +++ b/src/Terminal/Actions/Requests/GetActionsRequest.php @@ -0,0 +1,41 @@ +actionId = $values['actionId']; + } + + /** + * @return string + */ + public function getActionId(): string + { + return $this->actionId; + } + + /** + * @param string $value + */ + public function setActionId(string $value): self + { + $this->actionId = $value; + return $this; + } +} diff --git a/src/Terminal/Actions/Requests/SearchTerminalActionsRequest.php b/src/Terminal/Actions/Requests/SearchTerminalActionsRequest.php new file mode 100644 index 00000000..69ea860e --- /dev/null +++ b/src/Terminal/Actions/Requests/SearchTerminalActionsRequest.php @@ -0,0 +1,102 @@ +query = $values['query'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?TerminalActionQuery + */ + public function getQuery(): ?TerminalActionQuery + { + return $this->query; + } + + /** + * @param ?TerminalActionQuery $value + */ + public function setQuery(?TerminalActionQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Terminal/Checkouts/CheckoutsClient.php b/src/Terminal/Checkouts/CheckoutsClient.php new file mode 100644 index 00000000..198a3ae2 --- /dev/null +++ b/src/Terminal/Checkouts/CheckoutsClient.php @@ -0,0 +1,282 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a Terminal checkout request and sends it to the specified device to take a payment + * for the requested amount. + * + * @param CreateTerminalCheckoutRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateTerminalCheckoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateTerminalCheckoutRequest $request, ?array $options = null): CreateTerminalCheckoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/checkouts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateTerminalCheckoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. + * + * @param SearchTerminalCheckoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchTerminalCheckoutsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchTerminalCheckoutsRequest $request = new SearchTerminalCheckoutsRequest(), ?array $options = null): SearchTerminalCheckoutsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/checkouts/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchTerminalCheckoutsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. + * + * @param GetCheckoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTerminalCheckoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetCheckoutsRequest $request, ?array $options = null): GetTerminalCheckoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/checkouts/{$request->getCheckoutId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTerminalCheckoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels a Terminal checkout request if the status of the request permits it. + * + * @param CancelCheckoutsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelTerminalCheckoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelCheckoutsRequest $request, ?array $options = null): CancelTerminalCheckoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/checkouts/{$request->getCheckoutId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelTerminalCheckoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Terminal/Checkouts/Requests/CancelCheckoutsRequest.php b/src/Terminal/Checkouts/Requests/CancelCheckoutsRequest.php new file mode 100644 index 00000000..967b5902 --- /dev/null +++ b/src/Terminal/Checkouts/Requests/CancelCheckoutsRequest.php @@ -0,0 +1,41 @@ +checkoutId = $values['checkoutId']; + } + + /** + * @return string + */ + public function getCheckoutId(): string + { + return $this->checkoutId; + } + + /** + * @param string $value + */ + public function setCheckoutId(string $value): self + { + $this->checkoutId = $value; + return $this; + } +} diff --git a/src/Terminal/Checkouts/Requests/CreateTerminalCheckoutRequest.php b/src/Terminal/Checkouts/Requests/CreateTerminalCheckoutRequest.php new file mode 100644 index 00000000..bffd8003 --- /dev/null +++ b/src/Terminal/Checkouts/Requests/CreateTerminalCheckoutRequest.php @@ -0,0 +1,74 @@ +idempotencyKey = $values['idempotencyKey']; + $this->checkout = $values['checkout']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return TerminalCheckout + */ + public function getCheckout(): TerminalCheckout + { + return $this->checkout; + } + + /** + * @param TerminalCheckout $value + */ + public function setCheckout(TerminalCheckout $value): self + { + $this->checkout = $value; + return $this; + } +} diff --git a/src/Terminal/Checkouts/Requests/GetCheckoutsRequest.php b/src/Terminal/Checkouts/Requests/GetCheckoutsRequest.php new file mode 100644 index 00000000..837e9eff --- /dev/null +++ b/src/Terminal/Checkouts/Requests/GetCheckoutsRequest.php @@ -0,0 +1,41 @@ +checkoutId = $values['checkoutId']; + } + + /** + * @return string + */ + public function getCheckoutId(): string + { + return $this->checkoutId; + } + + /** + * @param string $value + */ + public function setCheckoutId(string $value): self + { + $this->checkoutId = $value; + return $this; + } +} diff --git a/src/Terminal/Checkouts/Requests/SearchTerminalCheckoutsRequest.php b/src/Terminal/Checkouts/Requests/SearchTerminalCheckoutsRequest.php new file mode 100644 index 00000000..f30b30e1 --- /dev/null +++ b/src/Terminal/Checkouts/Requests/SearchTerminalCheckoutsRequest.php @@ -0,0 +1,101 @@ +query = $values['query'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?TerminalCheckoutQuery + */ + public function getQuery(): ?TerminalCheckoutQuery + { + return $this->query; + } + + /** + * @param ?TerminalCheckoutQuery $value + */ + public function setQuery(?TerminalCheckoutQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Terminal/Refunds/RefundsClient.php b/src/Terminal/Refunds/RefundsClient.php new file mode 100644 index 00000000..f8917809 --- /dev/null +++ b/src/Terminal/Refunds/RefundsClient.php @@ -0,0 +1,281 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds). + * + * @param CreateTerminalRefundRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateTerminalRefundResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateTerminalRefundRequest $request, ?array $options = null): CreateTerminalRefundResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/refunds", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateTerminalRefundResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. + * + * @param SearchTerminalRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchTerminalRefundsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchTerminalRefundsRequest $request = new SearchTerminalRefundsRequest(), ?array $options = null): SearchTerminalRefundsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/refunds/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchTerminalRefundsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. + * + * @param GetRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetTerminalRefundResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetRefundsRequest $request, ?array $options = null): GetTerminalRefundResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/refunds/{$request->getTerminalRefundId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetTerminalRefundResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. + * + * @param CancelRefundsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CancelTerminalRefundResponse + * @throws SquareException + * @throws SquareApiException + */ + public function cancel(CancelRefundsRequest $request, ?array $options = null): CancelTerminalRefundResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/refunds/{$request->getTerminalRefundId()}/cancel", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CancelTerminalRefundResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Terminal/Refunds/Requests/CancelRefundsRequest.php b/src/Terminal/Refunds/Requests/CancelRefundsRequest.php new file mode 100644 index 00000000..9947d69f --- /dev/null +++ b/src/Terminal/Refunds/Requests/CancelRefundsRequest.php @@ -0,0 +1,41 @@ +terminalRefundId = $values['terminalRefundId']; + } + + /** + * @return string + */ + public function getTerminalRefundId(): string + { + return $this->terminalRefundId; + } + + /** + * @param string $value + */ + public function setTerminalRefundId(string $value): self + { + $this->terminalRefundId = $value; + return $this; + } +} diff --git a/src/Terminal/Refunds/Requests/CreateTerminalRefundRequest.php b/src/Terminal/Refunds/Requests/CreateTerminalRefundRequest.php new file mode 100644 index 00000000..106249f9 --- /dev/null +++ b/src/Terminal/Refunds/Requests/CreateTerminalRefundRequest.php @@ -0,0 +1,74 @@ +idempotencyKey = $values['idempotencyKey']; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?TerminalRefund + */ + public function getRefund(): ?TerminalRefund + { + return $this->refund; + } + + /** + * @param ?TerminalRefund $value + */ + public function setRefund(?TerminalRefund $value = null): self + { + $this->refund = $value; + return $this; + } +} diff --git a/src/Terminal/Refunds/Requests/GetRefundsRequest.php b/src/Terminal/Refunds/Requests/GetRefundsRequest.php new file mode 100644 index 00000000..95686493 --- /dev/null +++ b/src/Terminal/Refunds/Requests/GetRefundsRequest.php @@ -0,0 +1,41 @@ +terminalRefundId = $values['terminalRefundId']; + } + + /** + * @return string + */ + public function getTerminalRefundId(): string + { + return $this->terminalRefundId; + } + + /** + * @param string $value + */ + public function setTerminalRefundId(string $value): self + { + $this->terminalRefundId = $value; + return $this; + } +} diff --git a/src/Terminal/Refunds/Requests/SearchTerminalRefundsRequest.php b/src/Terminal/Refunds/Requests/SearchTerminalRefundsRequest.php new file mode 100644 index 00000000..bff50790 --- /dev/null +++ b/src/Terminal/Refunds/Requests/SearchTerminalRefundsRequest.php @@ -0,0 +1,101 @@ +query = $values['query'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?TerminalRefundQuery + */ + public function getQuery(): ?TerminalRefundQuery + { + return $this->query; + } + + /** + * @param ?TerminalRefundQuery $value + */ + public function setQuery(?TerminalRefundQuery $value = null): self + { + $this->query = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Terminal/Requests/DismissTerminalActionRequest.php b/src/Terminal/Requests/DismissTerminalActionRequest.php new file mode 100644 index 00000000..2c621154 --- /dev/null +++ b/src/Terminal/Requests/DismissTerminalActionRequest.php @@ -0,0 +1,41 @@ +actionId = $values['actionId']; + } + + /** + * @return string + */ + public function getActionId(): string + { + return $this->actionId; + } + + /** + * @param string $value + */ + public function setActionId(string $value): self + { + $this->actionId = $value; + return $this; + } +} diff --git a/src/Terminal/Requests/DismissTerminalCheckoutRequest.php b/src/Terminal/Requests/DismissTerminalCheckoutRequest.php new file mode 100644 index 00000000..8b2dc600 --- /dev/null +++ b/src/Terminal/Requests/DismissTerminalCheckoutRequest.php @@ -0,0 +1,41 @@ +checkoutId = $values['checkoutId']; + } + + /** + * @return string + */ + public function getCheckoutId(): string + { + return $this->checkoutId; + } + + /** + * @param string $value + */ + public function setCheckoutId(string $value): self + { + $this->checkoutId = $value; + return $this; + } +} diff --git a/src/Terminal/Requests/DismissTerminalRefundRequest.php b/src/Terminal/Requests/DismissTerminalRefundRequest.php new file mode 100644 index 00000000..dc3f3cb3 --- /dev/null +++ b/src/Terminal/Requests/DismissTerminalRefundRequest.php @@ -0,0 +1,41 @@ +terminalRefundId = $values['terminalRefundId']; + } + + /** + * @return string + */ + public function getTerminalRefundId(): string + { + return $this->terminalRefundId; + } + + /** + * @param string $value + */ + public function setTerminalRefundId(string $value): self + { + $this->terminalRefundId = $value; + return $this; + } +} diff --git a/src/Terminal/TerminalClient.php b/src/Terminal/TerminalClient.php new file mode 100644 index 00000000..b85a5315 --- /dev/null +++ b/src/Terminal/TerminalClient.php @@ -0,0 +1,245 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->actions = new ActionsClient($this->client, $this->options); + $this->checkouts = new CheckoutsClient($this->client, $this->options); + $this->refunds = new RefundsClient($this->client, $this->options); + } + + /** + * Dismisses a Terminal action request if the status and type of the request permits it. + * + * See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. + * + * @param DismissTerminalActionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DismissTerminalActionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function dismissTerminalAction(DismissTerminalActionRequest $request, ?array $options = null): DismissTerminalActionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/actions/{$request->getActionId()}/dismiss", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DismissTerminalActionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Dismisses a Terminal checkout request if the status and type of the request permits it. + * + * @param DismissTerminalCheckoutRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DismissTerminalCheckoutResponse + * @throws SquareException + * @throws SquareApiException + */ + public function dismissTerminalCheckout(DismissTerminalCheckoutRequest $request, ?array $options = null): DismissTerminalCheckoutResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/checkouts/{$request->getCheckoutId()}/dismiss", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DismissTerminalCheckoutResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Dismisses a Terminal refund request if the status and type of the request permits it. + * + * @param DismissTerminalRefundRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DismissTerminalRefundResponse + * @throws SquareException + * @throws SquareApiException + */ + public function dismissTerminalRefund(DismissTerminalRefundRequest $request, ?array $options = null): DismissTerminalRefundResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/terminals/refunds/{$request->getTerminalRefundId()}/dismiss", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DismissTerminalRefundResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Traits/CatalogObjectBase.php b/src/Traits/CatalogObjectBase.php new file mode 100644 index 00000000..0cd0d99b --- /dev/null +++ b/src/Traits/CatalogObjectBase.php @@ -0,0 +1,301 @@ + $customAttributeValues + * @property ?array $catalogV1Ids + * @property ?bool $presentAtAllLocations + * @property ?array $presentAtLocationIds + * @property ?array $absentAtLocationIds + * @property ?string $imageId + */ +trait CatalogObjectBase +{ + /** + * An identifier to reference this object in the catalog. When a new `CatalogObject` + * is inserted, the client should set the id to a temporary identifier starting with + * a "`#`" character. Other objects being inserted or updated within the same request + * may use this identifier to refer to the new object. + * + * When the server receives the new object, it will supply a unique identifier that + * replaces the temporary identifier for all future references. + * + * @var string $id + */ + #[JsonProperty('id')] + private string $id; + + /** + * Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` + * would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. + * + * @var ?string $updatedAt + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * The version of the object. When updating an object, the version supplied + * must match the version in the database, otherwise the write will be rejected as conflicting. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * If `true`, the object has been deleted from the database. Must be `false` for new objects + * being inserted. When deleted, the `updated_at` field will equal the deletion time. + * + * @var ?bool $isDeleted + */ + #[JsonProperty('is_deleted')] + private ?bool $isDeleted; + + /** + * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + * is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + * value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + * object defined by the application making the request. + * + * If the `CatalogCustomAttributeDefinition` object is + * defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + * the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + * `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + * if the application making the request is different from the application defining the custom attribute definition. + * Otherwise, the key used in the map is simply `"cocoa_brand"`. + * + * Application-defined custom attributes are set at a global (location-independent) level. + * Custom attribute values are intended to store additional information about a catalog object + * or associations with an entity in another system. Do not use custom attributes + * to store any sensitive information (personally identifiable information, card details, etc.). + * + * @var ?array $customAttributeValues + */ + #[JsonProperty('custom_attribute_values'), ArrayType(['string' => CatalogCustomAttributeValue::class])] + private ?array $customAttributeValues; + + /** + * The Connect v1 IDs for this object at each location where it is present, where they + * differ from the object's Connect V2 ID. The field will only be present for objects that + * have been created or modified by legacy APIs. + * + * @var ?array $catalogV1Ids + */ + #[JsonProperty('catalog_v1_ids'), ArrayType([CatalogV1Id::class])] + private ?array $catalogV1Ids; + + /** + * If `true`, this object is present at all locations (including future locations), except where specified in + * the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + * + * @var ?bool $presentAtAllLocations + */ + #[JsonProperty('present_at_all_locations')] + private ?bool $presentAtAllLocations; + + /** + * A list of locations where the object is present, even if `present_at_all_locations` is `false`. + * This can include locations that are deactivated. + * + * @var ?array $presentAtLocationIds + */ + #[JsonProperty('present_at_location_ids'), ArrayType(['string'])] + private ?array $presentAtLocationIds; + + /** + * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + * This can include locations that are deactivated. + * + * @var ?array $absentAtLocationIds + */ + #[JsonProperty('absent_at_location_ids'), ArrayType(['string'])] + private ?array $absentAtLocationIds; + + /** + * @var ?string $imageId Identifies the `CatalogImage` attached to this `CatalogObject`. + */ + #[JsonProperty('image_id')] + private ?string $imageId; + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsDeleted(): ?bool + { + return $this->isDeleted; + } + + /** + * @param ?bool $value + */ + public function setIsDeleted(?bool $value = null): self + { + $this->isDeleted = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomAttributeValues(): ?array + { + return $this->customAttributeValues; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeValues(?array $value = null): self + { + $this->customAttributeValues = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCatalogV1Ids(): ?array + { + return $this->catalogV1Ids; + } + + /** + * @param ?array $value + */ + public function setCatalogV1Ids(?array $value = null): self + { + $this->catalogV1Ids = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPresentAtAllLocations(): ?bool + { + return $this->presentAtAllLocations; + } + + /** + * @param ?bool $value + */ + public function setPresentAtAllLocations(?bool $value = null): self + { + $this->presentAtAllLocations = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPresentAtLocationIds(): ?array + { + return $this->presentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setPresentAtLocationIds(?array $value = null): self + { + $this->presentAtLocationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAbsentAtLocationIds(): ?array + { + return $this->absentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setAbsentAtLocationIds(?array $value = null): self + { + $this->absentAtLocationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getImageId(): ?string + { + return $this->imageId; + } + + /** + * @param ?string $value + */ + public function setImageId(?string $value = null): self + { + $this->imageId = $value; + return $this; + } +} diff --git a/src/Types/AcceptDisputeResponse.php b/src/Types/AcceptDisputeResponse.php new file mode 100644 index 00000000..e754dbaf --- /dev/null +++ b/src/Types/AcceptDisputeResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Dispute $dispute Details about the accepted dispute. + */ + #[JsonProperty('dispute')] + private ?Dispute $dispute; + + /** + * @param array{ + * errors?: ?array, + * dispute?: ?Dispute, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->dispute = $values['dispute'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Dispute + */ + public function getDispute(): ?Dispute + { + return $this->dispute; + } + + /** + * @param ?Dispute $value + */ + public function setDispute(?Dispute $value = null): self + { + $this->dispute = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AcceptedPaymentMethods.php b/src/Types/AcceptedPaymentMethods.php new file mode 100644 index 00000000..d60e0c27 --- /dev/null +++ b/src/Types/AcceptedPaymentMethods.php @@ -0,0 +1,126 @@ +applePay = $values['applePay'] ?? null; + $this->googlePay = $values['googlePay'] ?? null; + $this->cashAppPay = $values['cashAppPay'] ?? null; + $this->afterpayClearpay = $values['afterpayClearpay'] ?? null; + } + + /** + * @return ?bool + */ + public function getApplePay(): ?bool + { + return $this->applePay; + } + + /** + * @param ?bool $value + */ + public function setApplePay(?bool $value = null): self + { + $this->applePay = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getGooglePay(): ?bool + { + return $this->googlePay; + } + + /** + * @param ?bool $value + */ + public function setGooglePay(?bool $value = null): self + { + $this->googlePay = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCashAppPay(): ?bool + { + return $this->cashAppPay; + } + + /** + * @param ?bool $value + */ + public function setCashAppPay(?bool $value = null): self + { + $this->cashAppPay = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAfterpayClearpay(): ?bool + { + return $this->afterpayClearpay; + } + + /** + * @param ?bool $value + */ + public function setAfterpayClearpay(?bool $value = null): self + { + $this->afterpayClearpay = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AccumulateLoyaltyPointsResponse.php b/src/Types/AccumulateLoyaltyPointsResponse.php new file mode 100644 index 00000000..ab29919c --- /dev/null +++ b/src/Types/AccumulateLoyaltyPointsResponse.php @@ -0,0 +1,109 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyEvent $event The resulting loyalty event. Starting in Square version 2022-08-17, this field is no longer returned. + */ + #[JsonProperty('event')] + private ?LoyaltyEvent $event; + + /** + * The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event + * is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included + * if the purchase also qualifies for a loyalty promotion. + * + * @var ?array $events + */ + #[JsonProperty('events'), ArrayType([LoyaltyEvent::class])] + private ?array $events; + + /** + * @param array{ + * errors?: ?array, + * event?: ?LoyaltyEvent, + * events?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->event = $values['event'] ?? null; + $this->events = $values['events'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyEvent + */ + public function getEvent(): ?LoyaltyEvent + { + return $this->event; + } + + /** + * @param ?LoyaltyEvent $value + */ + public function setEvent(?LoyaltyEvent $value = null): self + { + $this->event = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEvents(): ?array + { + return $this->events; + } + + /** + * @param ?array $value + */ + public function setEvents(?array $value = null): self + { + $this->events = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AchDetails.php b/src/Types/AchDetails.php new file mode 100644 index 00000000..37104726 --- /dev/null +++ b/src/Types/AchDetails.php @@ -0,0 +1,107 @@ +routingNumber = $values['routingNumber'] ?? null; + $this->accountNumberSuffix = $values['accountNumberSuffix'] ?? null; + $this->accountType = $values['accountType'] ?? null; + } + + /** + * @return ?string + */ + public function getRoutingNumber(): ?string + { + return $this->routingNumber; + } + + /** + * @param ?string $value + */ + public function setRoutingNumber(?string $value = null): self + { + $this->routingNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAccountNumberSuffix(): ?string + { + return $this->accountNumberSuffix; + } + + /** + * @param ?string $value + */ + public function setAccountNumberSuffix(?string $value = null): self + { + $this->accountNumberSuffix = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAccountType(): ?string + { + return $this->accountType; + } + + /** + * @param ?string $value + */ + public function setAccountType(?string $value = null): self + { + $this->accountType = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ActionCancelReason.php b/src/Types/ActionCancelReason.php new file mode 100644 index 00000000..a99f3899 --- /dev/null +++ b/src/Types/ActionCancelReason.php @@ -0,0 +1,10 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AdditionalRecipient.php b/src/Types/AdditionalRecipient.php new file mode 100644 index 00000000..cd21cf0b --- /dev/null +++ b/src/Types/AdditionalRecipient.php @@ -0,0 +1,129 @@ +locationId = $values['locationId']; + $this->description = $values['description'] ?? null; + $this->amountMoney = $values['amountMoney']; + $this->receivableId = $values['receivableId'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReceivableId(): ?string + { + return $this->receivableId; + } + + /** + * @param ?string $value + */ + public function setReceivableId(?string $value = null): self + { + $this->receivableId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Address.php b/src/Types/Address.php new file mode 100644 index 00000000..36c1a0c5 --- /dev/null +++ b/src/Types/Address.php @@ -0,0 +1,399 @@ + $country + */ + #[JsonProperty('country')] + private ?string $country; + + /** + * @var ?string $firstName Optional first name when it's representing recipient. + */ + #[JsonProperty('first_name')] + private ?string $firstName; + + /** + * @var ?string $lastName Optional last name when it's representing recipient. + */ + #[JsonProperty('last_name')] + private ?string $lastName; + + /** + * @param array{ + * addressLine1?: ?string, + * addressLine2?: ?string, + * addressLine3?: ?string, + * locality?: ?string, + * sublocality?: ?string, + * sublocality2?: ?string, + * sublocality3?: ?string, + * administrativeDistrictLevel1?: ?string, + * administrativeDistrictLevel2?: ?string, + * administrativeDistrictLevel3?: ?string, + * postalCode?: ?string, + * country?: ?value-of, + * firstName?: ?string, + * lastName?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->addressLine1 = $values['addressLine1'] ?? null; + $this->addressLine2 = $values['addressLine2'] ?? null; + $this->addressLine3 = $values['addressLine3'] ?? null; + $this->locality = $values['locality'] ?? null; + $this->sublocality = $values['sublocality'] ?? null; + $this->sublocality2 = $values['sublocality2'] ?? null; + $this->sublocality3 = $values['sublocality3'] ?? null; + $this->administrativeDistrictLevel1 = $values['administrativeDistrictLevel1'] ?? null; + $this->administrativeDistrictLevel2 = $values['administrativeDistrictLevel2'] ?? null; + $this->administrativeDistrictLevel3 = $values['administrativeDistrictLevel3'] ?? null; + $this->postalCode = $values['postalCode'] ?? null; + $this->country = $values['country'] ?? null; + $this->firstName = $values['firstName'] ?? null; + $this->lastName = $values['lastName'] ?? null; + } + + /** + * @return ?string + */ + public function getAddressLine1(): ?string + { + return $this->addressLine1; + } + + /** + * @param ?string $value + */ + public function setAddressLine1(?string $value = null): self + { + $this->addressLine1 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAddressLine2(): ?string + { + return $this->addressLine2; + } + + /** + * @param ?string $value + */ + public function setAddressLine2(?string $value = null): self + { + $this->addressLine2 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAddressLine3(): ?string + { + return $this->addressLine3; + } + + /** + * @param ?string $value + */ + public function setAddressLine3(?string $value = null): self + { + $this->addressLine3 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocality(): ?string + { + return $this->locality; + } + + /** + * @param ?string $value + */ + public function setLocality(?string $value = null): self + { + $this->locality = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSublocality(): ?string + { + return $this->sublocality; + } + + /** + * @param ?string $value + */ + public function setSublocality(?string $value = null): self + { + $this->sublocality = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSublocality2(): ?string + { + return $this->sublocality2; + } + + /** + * @param ?string $value + */ + public function setSublocality2(?string $value = null): self + { + $this->sublocality2 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSublocality3(): ?string + { + return $this->sublocality3; + } + + /** + * @param ?string $value + */ + public function setSublocality3(?string $value = null): self + { + $this->sublocality3 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAdministrativeDistrictLevel1(): ?string + { + return $this->administrativeDistrictLevel1; + } + + /** + * @param ?string $value + */ + public function setAdministrativeDistrictLevel1(?string $value = null): self + { + $this->administrativeDistrictLevel1 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAdministrativeDistrictLevel2(): ?string + { + return $this->administrativeDistrictLevel2; + } + + /** + * @param ?string $value + */ + public function setAdministrativeDistrictLevel2(?string $value = null): self + { + $this->administrativeDistrictLevel2 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAdministrativeDistrictLevel3(): ?string + { + return $this->administrativeDistrictLevel3; + } + + /** + * @param ?string $value + */ + public function setAdministrativeDistrictLevel3(?string $value = null): self + { + $this->administrativeDistrictLevel3 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPostalCode(): ?string + { + return $this->postalCode; + } + + /** + * @param ?string $value + */ + public function setPostalCode(?string $value = null): self + { + $this->postalCode = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCountry(): ?string + { + return $this->country; + } + + /** + * @param ?value-of $value + */ + public function setCountry(?string $value = null): self + { + $this->country = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFirstName(): ?string + { + return $this->firstName; + } + + /** + * @param ?string $value + */ + public function setFirstName(?string $value = null): self + { + $this->firstName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param ?string $value + */ + public function setLastName(?string $value = null): self + { + $this->lastName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AdjustLoyaltyPointsResponse.php b/src/Types/AdjustLoyaltyPointsResponse.php new file mode 100644 index 00000000..613378a0 --- /dev/null +++ b/src/Types/AdjustLoyaltyPointsResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyEvent $event The resulting event data for the adjustment. + */ + #[JsonProperty('event')] + private ?LoyaltyEvent $event; + + /** + * @param array{ + * errors?: ?array, + * event?: ?LoyaltyEvent, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->event = $values['event'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyEvent + */ + public function getEvent(): ?LoyaltyEvent + { + return $this->event; + } + + /** + * @param ?LoyaltyEvent $value + */ + public function setEvent(?LoyaltyEvent $value = null): self + { + $this->event = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AfterpayDetails.php b/src/Types/AfterpayDetails.php new file mode 100644 index 00000000..6eaea79d --- /dev/null +++ b/src/Types/AfterpayDetails.php @@ -0,0 +1,54 @@ +emailAddress = $values['emailAddress'] ?? null; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ApplicationDetails.php b/src/Types/ApplicationDetails.php new file mode 100644 index 00000000..cc3520f4 --- /dev/null +++ b/src/Types/ApplicationDetails.php @@ -0,0 +1,91 @@ + $squareProduct + */ + #[JsonProperty('square_product')] + private ?string $squareProduct; + + /** + * The Square ID assigned to the application used to take the payment. + * Application developers can use this information to identify payments that + * their application processed. + * For example, if a developer uses a custom application to process payments, + * this field contains the application ID from the Developer Dashboard. + * If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) + * application to process payments, the field contains the corresponding application ID. + * + * @var ?string $applicationId + */ + #[JsonProperty('application_id')] + private ?string $applicationId; + + /** + * @param array{ + * squareProduct?: ?value-of, + * applicationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->squareProduct = $values['squareProduct'] ?? null; + $this->applicationId = $values['applicationId'] ?? null; + } + + /** + * @return ?value-of + */ + public function getSquareProduct(): ?string + { + return $this->squareProduct; + } + + /** + * @param ?value-of $value + */ + public function setSquareProduct(?string $value = null): self + { + $this->squareProduct = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplicationId(): ?string + { + return $this->applicationId; + } + + /** + * @param ?string $value + */ + public function setApplicationId(?string $value = null): self + { + $this->applicationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ApplicationDetailsExternalSquareProduct.php b/src/Types/ApplicationDetailsExternalSquareProduct.php new file mode 100644 index 00000000..4456bc71 --- /dev/null +++ b/src/Types/ApplicationDetailsExternalSquareProduct.php @@ -0,0 +1,17 @@ + $resourceIds The IDs of the seller-accessible resources used for this appointment segment. + */ + #[JsonProperty('resource_ids'), ArrayType(['string'])] + private ?array $resourceIds; + + /** + * @param array{ + * teamMemberId: string, + * durationMinutes?: ?int, + * serviceVariationId?: ?string, + * serviceVariationVersion?: ?int, + * intermissionMinutes?: ?int, + * anyTeamMember?: ?bool, + * resourceIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->durationMinutes = $values['durationMinutes'] ?? null; + $this->serviceVariationId = $values['serviceVariationId'] ?? null; + $this->teamMemberId = $values['teamMemberId']; + $this->serviceVariationVersion = $values['serviceVariationVersion'] ?? null; + $this->intermissionMinutes = $values['intermissionMinutes'] ?? null; + $this->anyTeamMember = $values['anyTeamMember'] ?? null; + $this->resourceIds = $values['resourceIds'] ?? null; + } + + /** + * @return ?int + */ + public function getDurationMinutes(): ?int + { + return $this->durationMinutes; + } + + /** + * @param ?int $value + */ + public function setDurationMinutes(?int $value = null): self + { + $this->durationMinutes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getServiceVariationId(): ?string + { + return $this->serviceVariationId; + } + + /** + * @param ?string $value + */ + public function setServiceVariationId(?string $value = null): self + { + $this->serviceVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function getTeamMemberId(): string + { + return $this->teamMemberId; + } + + /** + * @param string $value + */ + public function setTeamMemberId(string $value): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getServiceVariationVersion(): ?int + { + return $this->serviceVariationVersion; + } + + /** + * @param ?int $value + */ + public function setServiceVariationVersion(?int $value = null): self + { + $this->serviceVariationVersion = $value; + return $this; + } + + /** + * @return ?int + */ + public function getIntermissionMinutes(): ?int + { + return $this->intermissionMinutes; + } + + /** + * @param ?int $value + */ + public function setIntermissionMinutes(?int $value = null): self + { + $this->intermissionMinutes = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAnyTeamMember(): ?bool + { + return $this->anyTeamMember; + } + + /** + * @param ?bool $value + */ + public function setAnyTeamMember(?bool $value = null): self + { + $this->anyTeamMember = $value; + return $this; + } + + /** + * @return ?array + */ + public function getResourceIds(): ?array + { + return $this->resourceIds; + } + + /** + * @param ?array $value + */ + public function setResourceIds(?array $value = null): self + { + $this->resourceIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ArchivedState.php b/src/Types/ArchivedState.php new file mode 100644 index 00000000..6961f50c --- /dev/null +++ b/src/Types/ArchivedState.php @@ -0,0 +1,10 @@ + $appointmentSegments The list of appointment segments available for booking + */ + #[JsonProperty('appointment_segments'), ArrayType([AppointmentSegment::class])] + private ?array $appointmentSegments; + + /** + * @param array{ + * startAt?: ?string, + * locationId?: ?string, + * appointmentSegments?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->startAt = $values['startAt'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->appointmentSegments = $values['appointmentSegments'] ?? null; + } + + /** + * @return ?string + */ + public function getStartAt(): ?string + { + return $this->startAt; + } + + /** + * @param ?string $value + */ + public function setStartAt(?string $value = null): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppointmentSegments(): ?array + { + return $this->appointmentSegments; + } + + /** + * @param ?array $value + */ + public function setAppointmentSegments(?array $value = null): self + { + $this->appointmentSegments = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BankAccount.php b/src/Types/BankAccount.php new file mode 100644 index 00000000..529abdc7 --- /dev/null +++ b/src/Types/BankAccount.php @@ -0,0 +1,495 @@ + $country + */ + #[JsonProperty('country')] + private string $country; + + /** + * The 3-character ISO 4217 currency code indicating the operating + * currency of the bank account. For example, the currency code for US dollars + * is `USD`. + * See [Currency](#type-currency) for possible values + * + * @var value-of $currency + */ + #[JsonProperty('currency')] + private string $currency; + + /** + * The financial purpose of the associated bank account. + * See [BankAccountType](#type-bankaccounttype) for possible values + * + * @var value-of $accountType + */ + #[JsonProperty('account_type')] + private string $accountType; + + /** + * Name of the account holder. This name must match the name + * on the targeted bank account record. + * + * @var string $holderName + */ + #[JsonProperty('holder_name')] + private string $holderName; + + /** + * Primary identifier for the bank. For more information, see + * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). + * + * @var string $primaryBankIdentificationNumber + */ + #[JsonProperty('primary_bank_identification_number')] + private string $primaryBankIdentificationNumber; + + /** + * Secondary identifier for the bank. For more information, see + * [Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). + * + * @var ?string $secondaryBankIdentificationNumber + */ + #[JsonProperty('secondary_bank_identification_number')] + private ?string $secondaryBankIdentificationNumber; + + /** + * Reference identifier that will be displayed to UK bank account owners + * when collecting direct debit authorization. Only required for UK bank accounts. + * + * @var ?string $debitMandateReferenceId + */ + #[JsonProperty('debit_mandate_reference_id')] + private ?string $debitMandateReferenceId; + + /** + * Client-provided identifier for linking the banking account to an entity + * in a third-party system (for example, a bank account number or a user identifier). + * + * @var ?string $referenceId + */ + #[JsonProperty('reference_id')] + private ?string $referenceId; + + /** + * @var ?string $locationId The location to which the bank account belongs. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * Read-only. The current verification status of this BankAccount object. + * See [BankAccountStatus](#type-bankaccountstatus) for possible values + * + * @var value-of $status + */ + #[JsonProperty('status')] + private string $status; + + /** + * @var bool $creditable Indicates whether it is possible for Square to send money to this bank account. + */ + #[JsonProperty('creditable')] + private bool $creditable; + + /** + * Indicates whether it is possible for Square to take money from this + * bank account. + * + * @var bool $debitable + */ + #[JsonProperty('debitable')] + private bool $debitable; + + /** + * A Square-assigned, unique identifier for the bank account based on the + * account information. The account fingerprint can be used to compare account + * entries and determine if the they represent the same real-world bank account. + * + * @var ?string $fingerprint + */ + #[JsonProperty('fingerprint')] + private ?string $fingerprint; + + /** + * @var ?int $version The current version of the `BankAccount`. + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * Read only. Name of actual financial institution. + * For example "Bank of America". + * + * @var ?string $bankName + */ + #[JsonProperty('bank_name')] + private ?string $bankName; + + /** + * @param array{ + * id: string, + * accountNumberSuffix: string, + * country: value-of, + * currency: value-of, + * accountType: value-of, + * holderName: string, + * primaryBankIdentificationNumber: string, + * status: value-of, + * creditable: bool, + * debitable: bool, + * secondaryBankIdentificationNumber?: ?string, + * debitMandateReferenceId?: ?string, + * referenceId?: ?string, + * locationId?: ?string, + * fingerprint?: ?string, + * version?: ?int, + * bankName?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->accountNumberSuffix = $values['accountNumberSuffix']; + $this->country = $values['country']; + $this->currency = $values['currency']; + $this->accountType = $values['accountType']; + $this->holderName = $values['holderName']; + $this->primaryBankIdentificationNumber = $values['primaryBankIdentificationNumber']; + $this->secondaryBankIdentificationNumber = $values['secondaryBankIdentificationNumber'] ?? null; + $this->debitMandateReferenceId = $values['debitMandateReferenceId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->status = $values['status']; + $this->creditable = $values['creditable']; + $this->debitable = $values['debitable']; + $this->fingerprint = $values['fingerprint'] ?? null; + $this->version = $values['version'] ?? null; + $this->bankName = $values['bankName'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getAccountNumberSuffix(): string + { + return $this->accountNumberSuffix; + } + + /** + * @param string $value + */ + public function setAccountNumberSuffix(string $value): self + { + $this->accountNumberSuffix = $value; + return $this; + } + + /** + * @return value-of + */ + public function getCountry(): string + { + return $this->country; + } + + /** + * @param value-of $value + */ + public function setCountry(string $value): self + { + $this->country = $value; + return $this; + } + + /** + * @return value-of + */ + public function getCurrency(): string + { + return $this->currency; + } + + /** + * @param value-of $value + */ + public function setCurrency(string $value): self + { + $this->currency = $value; + return $this; + } + + /** + * @return value-of + */ + public function getAccountType(): string + { + return $this->accountType; + } + + /** + * @param value-of $value + */ + public function setAccountType(string $value): self + { + $this->accountType = $value; + return $this; + } + + /** + * @return string + */ + public function getHolderName(): string + { + return $this->holderName; + } + + /** + * @param string $value + */ + public function setHolderName(string $value): self + { + $this->holderName = $value; + return $this; + } + + /** + * @return string + */ + public function getPrimaryBankIdentificationNumber(): string + { + return $this->primaryBankIdentificationNumber; + } + + /** + * @param string $value + */ + public function setPrimaryBankIdentificationNumber(string $value): self + { + $this->primaryBankIdentificationNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSecondaryBankIdentificationNumber(): ?string + { + return $this->secondaryBankIdentificationNumber; + } + + /** + * @param ?string $value + */ + public function setSecondaryBankIdentificationNumber(?string $value = null): self + { + $this->secondaryBankIdentificationNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDebitMandateReferenceId(): ?string + { + return $this->debitMandateReferenceId; + } + + /** + * @param ?string $value + */ + public function setDebitMandateReferenceId(?string $value = null): self + { + $this->debitMandateReferenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return value-of + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @param value-of $value + */ + public function setStatus(string $value): self + { + $this->status = $value; + return $this; + } + + /** + * @return bool + */ + public function getCreditable(): bool + { + return $this->creditable; + } + + /** + * @param bool $value + */ + public function setCreditable(bool $value): self + { + $this->creditable = $value; + return $this; + } + + /** + * @return bool + */ + public function getDebitable(): bool + { + return $this->debitable; + } + + /** + * @param bool $value + */ + public function setDebitable(bool $value): self + { + $this->debitable = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFingerprint(): ?string + { + return $this->fingerprint; + } + + /** + * @param ?string $value + */ + public function setFingerprint(?string $value = null): self + { + $this->fingerprint = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBankName(): ?string + { + return $this->bankName; + } + + /** + * @param ?string $value + */ + public function setBankName(?string $value = null): self + { + $this->bankName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BankAccountPaymentDetails.php b/src/Types/BankAccountPaymentDetails.php new file mode 100644 index 00000000..1ddf0e61 --- /dev/null +++ b/src/Types/BankAccountPaymentDetails.php @@ -0,0 +1,239 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bankName?: ?string, + * transferType?: ?string, + * accountOwnershipType?: ?string, + * fingerprint?: ?string, + * country?: ?string, + * statementDescription?: ?string, + * achDetails?: ?AchDetails, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bankName = $values['bankName'] ?? null; + $this->transferType = $values['transferType'] ?? null; + $this->accountOwnershipType = $values['accountOwnershipType'] ?? null; + $this->fingerprint = $values['fingerprint'] ?? null; + $this->country = $values['country'] ?? null; + $this->statementDescription = $values['statementDescription'] ?? null; + $this->achDetails = $values['achDetails'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getBankName(): ?string + { + return $this->bankName; + } + + /** + * @param ?string $value + */ + public function setBankName(?string $value = null): self + { + $this->bankName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTransferType(): ?string + { + return $this->transferType; + } + + /** + * @param ?string $value + */ + public function setTransferType(?string $value = null): self + { + $this->transferType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAccountOwnershipType(): ?string + { + return $this->accountOwnershipType; + } + + /** + * @param ?string $value + */ + public function setAccountOwnershipType(?string $value = null): self + { + $this->accountOwnershipType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFingerprint(): ?string + { + return $this->fingerprint; + } + + /** + * @param ?string $value + */ + public function setFingerprint(?string $value = null): self + { + $this->fingerprint = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCountry(): ?string + { + return $this->country; + } + + /** + * @param ?string $value + */ + public function setCountry(?string $value = null): self + { + $this->country = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatementDescription(): ?string + { + return $this->statementDescription; + } + + /** + * @param ?string $value + */ + public function setStatementDescription(?string $value = null): self + { + $this->statementDescription = $value; + return $this; + } + + /** + * @return ?AchDetails + */ + public function getAchDetails(): ?AchDetails + { + return $this->achDetails; + } + + /** + * @param ?AchDetails $value + */ + public function setAchDetails(?AchDetails $value = null): self + { + $this->achDetails = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BankAccountStatus.php b/src/Types/BankAccountStatus.php new file mode 100644 index 00000000..ee18529a --- /dev/null +++ b/src/Types/BankAccountStatus.php @@ -0,0 +1,10 @@ + $changes + */ + #[JsonProperty('changes'), ArrayType([InventoryChange::class])] + private ?array $changes; + + /** + * Indicates whether the current physical count should be ignored if + * the quantity is unchanged since the last physical count. Default: `true`. + * + * @var ?bool $ignoreUnchangedCounts + */ + #[JsonProperty('ignore_unchanged_counts')] + private ?bool $ignoreUnchangedCounts; + + /** + * @param array{ + * idempotencyKey: string, + * changes?: ?array, + * ignoreUnchangedCounts?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->idempotencyKey = $values['idempotencyKey']; + $this->changes = $values['changes'] ?? null; + $this->ignoreUnchangedCounts = $values['ignoreUnchangedCounts'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChanges(): ?array + { + return $this->changes; + } + + /** + * @param ?array $value + */ + public function setChanges(?array $value = null): self + { + $this->changes = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIgnoreUnchangedCounts(): ?bool + { + return $this->ignoreUnchangedCounts; + } + + /** + * @param ?bool $value + */ + public function setIgnoreUnchangedCounts(?bool $value = null): self + { + $this->ignoreUnchangedCounts = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchChangeInventoryResponse.php b/src/Types/BatchChangeInventoryResponse.php new file mode 100644 index 00000000..bcdd6b46 --- /dev/null +++ b/src/Types/BatchChangeInventoryResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $counts The current counts for all objects referenced in the request. + */ + #[JsonProperty('counts'), ArrayType([InventoryCount::class])] + private ?array $counts; + + /** + * @var ?array $changes Changes created for the request. + */ + #[JsonProperty('changes'), ArrayType([InventoryChange::class])] + private ?array $changes; + + /** + * @param array{ + * errors?: ?array, + * counts?: ?array, + * changes?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->counts = $values['counts'] ?? null; + $this->changes = $values['changes'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCounts(): ?array + { + return $this->counts; + } + + /** + * @param ?array $value + */ + public function setCounts(?array $value = null): self + { + $this->counts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChanges(): ?array + { + return $this->changes; + } + + /** + * @param ?array $value + */ + public function setChanges(?array $value = null): self + { + $this->changes = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchCreateTeamMembersResponse.php b/src/Types/BatchCreateTeamMembersResponse.php new file mode 100644 index 00000000..fc0b185a --- /dev/null +++ b/src/Types/BatchCreateTeamMembersResponse.php @@ -0,0 +1,80 @@ + $teamMembers The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. + */ + #[JsonProperty('team_members'), ArrayType(['string' => CreateTeamMemberResponse::class])] + private ?array $teamMembers; + + /** + * @var ?array $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMembers?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMembers = $values['teamMembers'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMembers(): ?array + { + return $this->teamMembers; + } + + /** + * @param ?array $value + */ + public function setTeamMembers(?array $value = null): self + { + $this->teamMembers = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchCreateVendorsResponse.php b/src/Types/BatchCreateVendorsResponse.php new file mode 100644 index 00000000..62954a9b --- /dev/null +++ b/src/Types/BatchCreateVendorsResponse.php @@ -0,0 +1,85 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor) + * objects or error responses for failed attempts. The set is represented by + * a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified + * in the input. + * + * @var ?array $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => CreateVendorResponse::class])] + private ?array $responses; + + /** + * @param array{ + * errors?: ?array, + * responses?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->responses = $values['responses'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchDeleteCatalogObjectsResponse.php b/src/Types/BatchDeleteCatalogObjectsResponse.php new file mode 100644 index 00000000..2f55dc35 --- /dev/null +++ b/src/Types/BatchDeleteCatalogObjectsResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $deletedObjectIds The IDs of all CatalogObjects deleted by this request. + */ + #[JsonProperty('deleted_object_ids'), ArrayType(['string'])] + private ?array $deletedObjectIds; + + /** + * @var ?string $deletedAt The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + #[JsonProperty('deleted_at')] + private ?string $deletedAt; + + /** + * @param array{ + * errors?: ?array, + * deletedObjectIds?: ?array, + * deletedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->deletedObjectIds = $values['deletedObjectIds'] ?? null; + $this->deletedAt = $values['deletedAt'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDeletedObjectIds(): ?array + { + return $this->deletedObjectIds; + } + + /** + * @param ?array $value + */ + public function setDeletedObjectIds(?array $value = null): self + { + $this->deletedObjectIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeletedAt(): ?string + { + return $this->deletedAt; + } + + /** + * @param ?string $value + */ + public function setDeletedAt(?string $value = null): self + { + $this->deletedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetCatalogObjectsResponse.php b/src/Types/BatchGetCatalogObjectsResponse.php new file mode 100644 index 00000000..fbdc9bfb --- /dev/null +++ b/src/Types/BatchGetCatalogObjectsResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $objects A list of [CatalogObject](entity:CatalogObject)s returned. + */ + #[JsonProperty('objects'), ArrayType([CatalogObject::class])] + private ?array $objects; + + /** + * @var ?array $relatedObjects A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. + */ + #[JsonProperty('related_objects'), ArrayType([CatalogObject::class])] + private ?array $relatedObjects; + + /** + * @param array{ + * errors?: ?array, + * objects?: ?array, + * relatedObjects?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->objects = $values['objects'] ?? null; + $this->relatedObjects = $values['relatedObjects'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getObjects(): ?array + { + return $this->objects; + } + + /** + * @param ?array $value + */ + public function setObjects(?array $value = null): self + { + $this->objects = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRelatedObjects(): ?array + { + return $this->relatedObjects; + } + + /** + * @param ?array $value + */ + public function setRelatedObjects(?array $value = null): self + { + $this->relatedObjects = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetInventoryChangesResponse.php b/src/Types/BatchGetInventoryChangesResponse.php new file mode 100644 index 00000000..227bd3e5 --- /dev/null +++ b/src/Types/BatchGetInventoryChangesResponse.php @@ -0,0 +1,109 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The current calculated inventory changes for the requested objects + * and locations. + * + * @var ?array $changes + */ + #[JsonProperty('changes'), ArrayType([InventoryChange::class])] + private ?array $changes; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * changes?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->changes = $values['changes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChanges(): ?array + { + return $this->changes; + } + + /** + * @param ?array $value + */ + public function setChanges(?array $value = null): self + { + $this->changes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetInventoryCountsRequest.php b/src/Types/BatchGetInventoryCountsRequest.php new file mode 100644 index 00000000..885f874a --- /dev/null +++ b/src/Types/BatchGetInventoryCountsRequest.php @@ -0,0 +1,196 @@ + $catalogObjectIds + */ + #[JsonProperty('catalog_object_ids'), ArrayType(['string'])] + private ?array $catalogObjectIds; + + /** + * The filter to return results by `Location` ID. + * This filter is applicable only when set. The default is null. + * + * @var ?array $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * The filter to return results with their `calculated_at` value + * after the given time as specified in an RFC 3339 timestamp. + * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + * + * @var ?string $updatedAfter + */ + #[JsonProperty('updated_after')] + private ?string $updatedAfter; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this to retrieve the next set of results for the original query. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * The filter to return results by `InventoryState`. The filter is only applicable when set. + * Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. + * The default is null. + * + * @var ?array> $states + */ + #[JsonProperty('states'), ArrayType(['string'])] + private ?array $states; + + /** + * @var ?int $limit The number of [records](entity:InventoryCount) to return. + */ + #[JsonProperty('limit')] + private ?int $limit; + + /** + * @param array{ + * catalogObjectIds?: ?array, + * locationIds?: ?array, + * updatedAfter?: ?string, + * cursor?: ?string, + * states?: ?array>, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->catalogObjectIds = $values['catalogObjectIds'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->updatedAfter = $values['updatedAfter'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->states = $values['states'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?array + */ + public function getCatalogObjectIds(): ?array + { + return $this->catalogObjectIds; + } + + /** + * @param ?array $value + */ + public function setCatalogObjectIds(?array $value = null): self + { + $this->catalogObjectIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAfter(): ?string + { + return $this->updatedAfter; + } + + /** + * @param ?string $value + */ + public function setUpdatedAfter(?string $value = null): self + { + $this->updatedAfter = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getStates(): ?array + { + return $this->states; + } + + /** + * @param ?array> $value + */ + public function setStates(?array $value = null): self + { + $this->states = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetInventoryCountsResponse.php b/src/Types/BatchGetInventoryCountsResponse.php new file mode 100644 index 00000000..fc2bc4c6 --- /dev/null +++ b/src/Types/BatchGetInventoryCountsResponse.php @@ -0,0 +1,110 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The current calculated inventory counts for the requested objects + * and locations. + * + * @var ?array $counts + */ + #[JsonProperty('counts'), ArrayType([InventoryCount::class])] + private ?array $counts; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * counts?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->counts = $values['counts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCounts(): ?array + { + return $this->counts; + } + + /** + * @param ?array $value + */ + public function setCounts(?array $value = null): self + { + $this->counts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetOrdersResponse.php b/src/Types/BatchGetOrdersResponse.php new file mode 100644 index 00000000..831fd6be --- /dev/null +++ b/src/Types/BatchGetOrdersResponse.php @@ -0,0 +1,81 @@ + $orders The requested orders. This will omit any requested orders that do not exist. + */ + #[JsonProperty('orders'), ArrayType([Order::class])] + private ?array $orders; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * orders?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->orders = $values['orders'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getOrders(): ?array + { + return $this->orders; + } + + /** + * @param ?array $value + */ + public function setOrders(?array $value = null): self + { + $this->orders = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchGetVendorsResponse.php b/src/Types/BatchGetVendorsResponse.php new file mode 100644 index 00000000..e378cd6c --- /dev/null +++ b/src/Types/BatchGetVendorsResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating successfully retrieved [Vendor](entity:Vendor) + * objects or error responses for failed attempts. The set is represented by + * a collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs. + * + * @var ?array $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => GetVendorResponse::class])] + private ?array $responses; + + /** + * @param array{ + * errors?: ?array, + * responses?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->responses = $values['responses'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchRetrieveInventoryChangesRequest.php b/src/Types/BatchRetrieveInventoryChangesRequest.php new file mode 100644 index 00000000..d35c2581 --- /dev/null +++ b/src/Types/BatchRetrieveInventoryChangesRequest.php @@ -0,0 +1,253 @@ + $catalogObjectIds + */ + #[JsonProperty('catalog_object_ids'), ArrayType(['string'])] + private ?array $catalogObjectIds; + + /** + * The filter to return results by `Location` ID. + * The filter is only applicable when set. The default value is null. + * + * @var ?array $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * The filter to return results by `InventoryChangeType` values other than `TRANSFER`. + * The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. + * + * @var ?array> $types + */ + #[JsonProperty('types'), ArrayType(['string'])] + private ?array $types; + + /** + * The filter to return `ADJUSTMENT` query results by + * `InventoryState`. This filter is only applied when set. + * The default value is null. + * + * @var ?array> $states + */ + #[JsonProperty('states'), ArrayType(['string'])] + private ?array $states; + + /** + * The filter to return results with their `calculated_at` value + * after the given time as specified in an RFC 3339 timestamp. + * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + * + * @var ?string $updatedAfter + */ + #[JsonProperty('updated_after')] + private ?string $updatedAfter; + + /** + * The filter to return results with their `created_at` or `calculated_at` value + * strictly before the given time as specified in an RFC 3339 timestamp. + * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + * + * @var ?string $updatedBefore + */ + #[JsonProperty('updated_before')] + private ?string $updatedBefore; + + /** + * A pagination cursor returned by a previous call to this endpoint. + * Provide this to retrieve the next set of results for the original query. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?int $limit The number of [records](entity:InventoryChange) to return. + */ + #[JsonProperty('limit')] + private ?int $limit; + + /** + * @param array{ + * catalogObjectIds?: ?array, + * locationIds?: ?array, + * types?: ?array>, + * states?: ?array>, + * updatedAfter?: ?string, + * updatedBefore?: ?string, + * cursor?: ?string, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->catalogObjectIds = $values['catalogObjectIds'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->types = $values['types'] ?? null; + $this->states = $values['states'] ?? null; + $this->updatedAfter = $values['updatedAfter'] ?? null; + $this->updatedBefore = $values['updatedBefore'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?array + */ + public function getCatalogObjectIds(): ?array + { + return $this->catalogObjectIds; + } + + /** + * @param ?array $value + */ + public function setCatalogObjectIds(?array $value = null): self + { + $this->catalogObjectIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getTypes(): ?array + { + return $this->types; + } + + /** + * @param ?array> $value + */ + public function setTypes(?array $value = null): self + { + $this->types = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getStates(): ?array + { + return $this->states; + } + + /** + * @param ?array> $value + */ + public function setStates(?array $value = null): self + { + $this->states = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAfter(): ?string + { + return $this->updatedAfter; + } + + /** + * @param ?string $value + */ + public function setUpdatedAfter(?string $value = null): self + { + $this->updatedAfter = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedBefore(): ?string + { + return $this->updatedBefore; + } + + /** + * @param ?string $value + */ + public function setUpdatedBefore(?string $value = null): self + { + $this->updatedBefore = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpdateTeamMembersResponse.php b/src/Types/BatchUpdateTeamMembersResponse.php new file mode 100644 index 00000000..1b71f924 --- /dev/null +++ b/src/Types/BatchUpdateTeamMembersResponse.php @@ -0,0 +1,80 @@ + $teamMembers The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`. + */ + #[JsonProperty('team_members'), ArrayType(['string' => UpdateTeamMemberResponse::class])] + private ?array $teamMembers; + + /** + * @var ?array $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMembers?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMembers = $values['teamMembers'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMembers(): ?array + { + return $this->teamMembers; + } + + /** + * @param ?array $value + */ + public function setTeamMembers(?array $value = null): self + { + $this->teamMembers = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpdateVendorsResponse.php b/src/Types/BatchUpdateVendorsResponse.php new file mode 100644 index 00000000..237d408a --- /dev/null +++ b/src/Types/BatchUpdateVendorsResponse.php @@ -0,0 +1,84 @@ + $errors Errors encountered when the request fails. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor) + * objects or error responses for failed attempts. The set is represented by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or + * `Vendor`-ID/error-object pairs. + * + * @var ?array $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => UpdateVendorResponse::class])] + private ?array $responses; + + /** + * @param array{ + * errors?: ?array, + * responses?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->responses = $values['responses'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpsertCatalogObjectsResponse.php b/src/Types/BatchUpsertCatalogObjectsResponse.php new file mode 100644 index 00000000..7244b4e5 --- /dev/null +++ b/src/Types/BatchUpsertCatalogObjectsResponse.php @@ -0,0 +1,127 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $objects The created successfully created CatalogObjects. + */ + #[JsonProperty('objects'), ArrayType([CatalogObject::class])] + private ?array $objects; + + /** + * @var ?string $updatedAt The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?array $idMappings The mapping between client and server IDs for this upsert. + */ + #[JsonProperty('id_mappings'), ArrayType([CatalogIdMapping::class])] + private ?array $idMappings; + + /** + * @param array{ + * errors?: ?array, + * objects?: ?array, + * updatedAt?: ?string, + * idMappings?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->objects = $values['objects'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->idMappings = $values['idMappings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getObjects(): ?array + { + return $this->objects; + } + + /** + * @param ?array $value + */ + public function setObjects(?array $value = null): self + { + $this->objects = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getIdMappings(): ?array + { + return $this->idMappings; + } + + /** + * @param ?array $value + */ + public function setIdMappings(?array $value = null): self + { + $this->idMappings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php b/src/Types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php new file mode 100644 index 00000000..bd03bd96 --- /dev/null +++ b/src/Types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.php @@ -0,0 +1,121 @@ +customerId = $values['customerId']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpsertCustomerCustomAttributesResponse.php b/src/Types/BatchUpsertCustomerCustomAttributesResponse.php new file mode 100644 index 00000000..7f9677fd --- /dev/null +++ b/src/Types/BatchUpsertCustomerCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse::class])] + private ?array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php b/src/Types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php new file mode 100644 index 00000000..e60f51f7 --- /dev/null +++ b/src/Types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.php @@ -0,0 +1,105 @@ + $errors Any errors that occurred while processing the individual request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customerId?: ?string, + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customerId = $values['customerId'] ?? null; + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Booking.php b/src/Types/Booking.php new file mode 100644 index 00000000..a5ebade9 --- /dev/null +++ b/src/Types/Booking.php @@ -0,0 +1,472 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $createdAt The RFC 3339 timestamp specifying the creation time of this booking. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The RFC 3339 timestamp specifying the most recent update time of this booking. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $startAt The RFC 3339 timestamp specifying the starting time of this booking. + */ + #[JsonProperty('start_at')] + private ?string $startAt; + + /** + * @var ?string $locationId The ID of the [Location](entity:Location) object representing the location where the booked service is provided. Once set when the booking is created, its value cannot be changed. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * @var ?string $customerId The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service. + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + + /** + * @var ?string $customerNote The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity:CatalogObject) instance. + */ + #[JsonProperty('customer_note')] + private ?string $customerNote; + + /** + * The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity:CatalogObject) instance. + * This field should not be visible to customers. + * + * @var ?string $sellerNote + */ + #[JsonProperty('seller_note')] + private ?string $sellerNote; + + /** + * @var ?array $appointmentSegments A list of appointment segments for this booking. + */ + #[JsonProperty('appointment_segments'), ArrayType([AppointmentSegment::class])] + private ?array $appointmentSegments; + + /** + * Additional time at the end of a booking. + * Applications should not make this field visible to customers of a seller. + * + * @var ?int $transitionTimeMinutes + */ + #[JsonProperty('transition_time_minutes')] + private ?int $transitionTimeMinutes; + + /** + * @var ?bool $allDay Whether the booking is of a full business day. + */ + #[JsonProperty('all_day')] + private ?bool $allDay; + + /** + * The type of location where the booking is held. + * See [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values + * + * @var ?value-of $locationType + */ + #[JsonProperty('location_type')] + private ?string $locationType; + + /** + * @var ?BookingCreatorDetails $creatorDetails Information about the booking creator. + */ + #[JsonProperty('creator_details')] + private ?BookingCreatorDetails $creatorDetails; + + /** + * The source of the booking. + * Access to this field requires seller-level permissions. + * See [BookingBookingSource](#type-bookingbookingsource) for possible values + * + * @var ?value-of $source + */ + #[JsonProperty('source')] + private ?string $source; + + /** + * @var ?Address $address Stores a customer address if the location type is `CUSTOMER_LOCATION`. + */ + #[JsonProperty('address')] + private ?Address $address; + + /** + * @param array{ + * id?: ?string, + * version?: ?int, + * status?: ?value-of, + * createdAt?: ?string, + * updatedAt?: ?string, + * startAt?: ?string, + * locationId?: ?string, + * customerId?: ?string, + * customerNote?: ?string, + * sellerNote?: ?string, + * appointmentSegments?: ?array, + * transitionTimeMinutes?: ?int, + * allDay?: ?bool, + * locationType?: ?value-of, + * creatorDetails?: ?BookingCreatorDetails, + * source?: ?value-of, + * address?: ?Address, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->version = $values['version'] ?? null; + $this->status = $values['status'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->startAt = $values['startAt'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->customerNote = $values['customerNote'] ?? null; + $this->sellerNote = $values['sellerNote'] ?? null; + $this->appointmentSegments = $values['appointmentSegments'] ?? null; + $this->transitionTimeMinutes = $values['transitionTimeMinutes'] ?? null; + $this->allDay = $values['allDay'] ?? null; + $this->locationType = $values['locationType'] ?? null; + $this->creatorDetails = $values['creatorDetails'] ?? null; + $this->source = $values['source'] ?? null; + $this->address = $values['address'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartAt(): ?string + { + return $this->startAt; + } + + /** + * @param ?string $value + */ + public function setStartAt(?string $value = null): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerNote(): ?string + { + return $this->customerNote; + } + + /** + * @param ?string $value + */ + public function setCustomerNote(?string $value = null): self + { + $this->customerNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSellerNote(): ?string + { + return $this->sellerNote; + } + + /** + * @param ?string $value + */ + public function setSellerNote(?string $value = null): self + { + $this->sellerNote = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppointmentSegments(): ?array + { + return $this->appointmentSegments; + } + + /** + * @param ?array $value + */ + public function setAppointmentSegments(?array $value = null): self + { + $this->appointmentSegments = $value; + return $this; + } + + /** + * @return ?int + */ + public function getTransitionTimeMinutes(): ?int + { + return $this->transitionTimeMinutes; + } + + /** + * @param ?int $value + */ + public function setTransitionTimeMinutes(?int $value = null): self + { + $this->transitionTimeMinutes = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAllDay(): ?bool + { + return $this->allDay; + } + + /** + * @param ?bool $value + */ + public function setAllDay(?bool $value = null): self + { + $this->allDay = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getLocationType(): ?string + { + return $this->locationType; + } + + /** + * @param ?value-of $value + */ + public function setLocationType(?string $value = null): self + { + $this->locationType = $value; + return $this; + } + + /** + * @return ?BookingCreatorDetails + */ + public function getCreatorDetails(): ?BookingCreatorDetails + { + return $this->creatorDetails; + } + + /** + * @param ?BookingCreatorDetails $value + */ + public function setCreatorDetails(?BookingCreatorDetails $value = null): self + { + $this->creatorDetails = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSource(): ?string + { + return $this->source; + } + + /** + * @param ?value-of $value + */ + public function setSource(?string $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingBookingSource.php b/src/Types/BookingBookingSource.php new file mode 100644 index 00000000..8ebdfb6a --- /dev/null +++ b/src/Types/BookingBookingSource.php @@ -0,0 +1,11 @@ + $creatorType + */ + #[JsonProperty('creator_type')] + private ?string $creatorType; + + /** + * The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type. + * Access to this field requires seller-level permissions. + * + * @var ?string $teamMemberId + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type. + * Access to this field requires seller-level permissions. + * + * @var ?string $customerId + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + + /** + * @param array{ + * creatorType?: ?value-of, + * teamMemberId?: ?string, + * customerId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->creatorType = $values['creatorType'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + } + + /** + * @return ?value-of + */ + public function getCreatorType(): ?string + { + return $this->creatorType; + } + + /** + * @param ?value-of $value + */ + public function setCreatorType(?string $value = null): self + { + $this->creatorType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingCreatorDetailsCreatorType.php b/src/Types/BookingCreatorDetailsCreatorType.php new file mode 100644 index 00000000..2abf7062 --- /dev/null +++ b/src/Types/BookingCreatorDetailsCreatorType.php @@ -0,0 +1,9 @@ +bookingId = $values['bookingId']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingCustomAttributeDeleteResponse.php b/src/Types/BookingCustomAttributeDeleteResponse.php new file mode 100644 index 00000000..bc7d3113 --- /dev/null +++ b/src/Types/BookingCustomAttributeDeleteResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred while processing the individual request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bookingId?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bookingId = $values['bookingId'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getBookingId(): ?string + { + return $this->bookingId; + } + + /** + * @param ?string $value + */ + public function setBookingId(?string $value = null): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingCustomAttributeUpsertRequest.php b/src/Types/BookingCustomAttributeUpsertRequest.php new file mode 100644 index 00000000..aeb096bf --- /dev/null +++ b/src/Types/BookingCustomAttributeUpsertRequest.php @@ -0,0 +1,121 @@ +bookingId = $values['bookingId']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getBookingId(): string + { + return $this->bookingId; + } + + /** + * @param string $value + */ + public function setBookingId(string $value): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingCustomAttributeUpsertResponse.php b/src/Types/BookingCustomAttributeUpsertResponse.php new file mode 100644 index 00000000..db24529f --- /dev/null +++ b/src/Types/BookingCustomAttributeUpsertResponse.php @@ -0,0 +1,105 @@ + $errors Any errors that occurred while processing the individual request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bookingId?: ?string, + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bookingId = $values['bookingId'] ?? null; + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getBookingId(): ?string + { + return $this->bookingId; + } + + /** + * @param ?string $value + */ + public function setBookingId(?string $value = null): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BookingStatus.php b/src/Types/BookingStatus.php new file mode 100644 index 00000000..45c77800 --- /dev/null +++ b/src/Types/BookingStatus.php @@ -0,0 +1,13 @@ +id = $values['id'] ?? null; + $this->locationId = $values['locationId']; + $this->breakName = $values['breakName']; + $this->expectedDuration = $values['expectedDuration']; + $this->isPaid = $values['isPaid']; + $this->version = $values['version'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getBreakName(): string + { + return $this->breakName; + } + + /** + * @param string $value + */ + public function setBreakName(string $value): self + { + $this->breakName = $value; + return $this; + } + + /** + * @return string + */ + public function getExpectedDuration(): string + { + return $this->expectedDuration; + } + + /** + * @param string $value + */ + public function setExpectedDuration(string $value): self + { + $this->expectedDuration = $value; + return $this; + } + + /** + * @return bool + */ + public function getIsPaid(): bool + { + return $this->isPaid; + } + + /** + * @param bool $value + */ + public function setIsPaid(bool $value): self + { + $this->isPaid = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Break_.php b/src/Types/Break_.php new file mode 100644 index 00000000..4b39e9a2 --- /dev/null +++ b/src/Types/Break_.php @@ -0,0 +1,216 @@ +id = $values['id'] ?? null; + $this->startAt = $values['startAt']; + $this->endAt = $values['endAt'] ?? null; + $this->breakTypeId = $values['breakTypeId']; + $this->name = $values['name']; + $this->expectedDuration = $values['expectedDuration']; + $this->isPaid = $values['isPaid']; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getStartAt(): string + { + return $this->startAt; + } + + /** + * @param string $value + */ + public function setStartAt(string $value): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndAt(): ?string + { + return $this->endAt; + } + + /** + * @param ?string $value + */ + public function setEndAt(?string $value = null): self + { + $this->endAt = $value; + return $this; + } + + /** + * @return string + */ + public function getBreakTypeId(): string + { + return $this->breakTypeId; + } + + /** + * @param string $value + */ + public function setBreakTypeId(string $value): self + { + $this->breakTypeId = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function getExpectedDuration(): string + { + return $this->expectedDuration; + } + + /** + * @param string $value + */ + public function setExpectedDuration(string $value): self + { + $this->expectedDuration = $value; + return $this; + } + + /** + * @return bool + */ + public function getIsPaid(): bool + { + return $this->isPaid; + } + + /** + * @param bool $value + */ + public function setIsPaid(bool $value): self + { + $this->isPaid = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkCreateCustomerData.php b/src/Types/BulkCreateCustomerData.php new file mode 100644 index 00000000..c6ac209f --- /dev/null +++ b/src/Types/BulkCreateCustomerData.php @@ -0,0 +1,325 @@ +givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->nickname = $values['nickname'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->birthday = $values['birthday'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNickname(): ?string + { + return $this->nickname; + } + + /** + * @param ?string $value + */ + public function setNickname(?string $value = null): self + { + $this->nickname = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBirthday(): ?string + { + return $this->birthday; + } + + /** + * @param ?string $value + */ + public function setBirthday(?string $value = null): self + { + $this->birthday = $value; + return $this; + } + + /** + * @return ?CustomerTaxIds + */ + public function getTaxIds(): ?CustomerTaxIds + { + return $this->taxIds; + } + + /** + * @param ?CustomerTaxIds $value + */ + public function setTaxIds(?CustomerTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkCreateCustomersResponse.php b/src/Types/BulkCreateCustomersResponse.php new file mode 100644 index 00000000..cec5ff9c --- /dev/null +++ b/src/Types/BulkCreateCustomersResponse.php @@ -0,0 +1,89 @@ + $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => CreateCustomerResponse::class])] + private ?array $responses; + + /** + * @var ?array $errors Any top-level errors that prevented the bulk operation from running. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * responses?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->responses = $values['responses'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteBookingCustomAttributesResponse.php b/src/Types/BulkDeleteBookingCustomAttributesResponse.php new file mode 100644 index 00000000..a11645de --- /dev/null +++ b/src/Types/BulkDeleteBookingCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BookingCustomAttributeDeleteResponse::class])] + private ?array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteCustomersResponse.php b/src/Types/BulkDeleteCustomersResponse.php new file mode 100644 index 00000000..492ddfc5 --- /dev/null +++ b/src/Types/BulkDeleteCustomersResponse.php @@ -0,0 +1,89 @@ + $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => DeleteCustomerResponse::class])] + private ?array $responses; + + /** + * @var ?array $errors Any top-level errors that prevented the bulk operation from running. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * responses?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->responses = $values['responses'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php b/src/Types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php new file mode 100644 index 00000000..caae0ce6 --- /dev/null +++ b/src/Types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.php @@ -0,0 +1,59 @@ +key = $values['key'] ?? null; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteLocationCustomAttributesResponse.php b/src/Types/BulkDeleteLocationCustomAttributesResponse.php new file mode 100644 index 00000000..075e9e50 --- /dev/null +++ b/src/Types/BulkDeleteLocationCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse::class])] + private array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values: array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php b/src/Types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php new file mode 100644 index 00000000..e9eabe56 --- /dev/null +++ b/src/Types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.php @@ -0,0 +1,81 @@ + $errors Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * locationId?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php b/src/Types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php new file mode 100644 index 00000000..295b9afc --- /dev/null +++ b/src/Types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.php @@ -0,0 +1,59 @@ +key = $values['key'] ?? null; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteMerchantCustomAttributesResponse.php b/src/Types/BulkDeleteMerchantCustomAttributesResponse.php new file mode 100644 index 00000000..b54d2fe6 --- /dev/null +++ b/src/Types/BulkDeleteMerchantCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse::class])] + private array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values: array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php b/src/Types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php new file mode 100644 index 00000000..260f35f5 --- /dev/null +++ b/src/Types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.php @@ -0,0 +1,56 @@ + $errors Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php b/src/Types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php new file mode 100644 index 00000000..39b01bf5 --- /dev/null +++ b/src/Types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.php @@ -0,0 +1,82 @@ +key = $values['key'] ?? null; + $this->orderId = $values['orderId']; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkDeleteOrderCustomAttributesResponse.php b/src/Types/BulkDeleteOrderCustomAttributesResponse.php new file mode 100644 index 00000000..15b4473b --- /dev/null +++ b/src/Types/BulkDeleteOrderCustomAttributesResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * A map of responses that correspond to individual delete requests. Each response has the same ID + * as the corresponding request and contains either a `custom_attribute` or an `errors` field. + * + * @var array $values + */ + #[JsonProperty('values'), ArrayType(['string' => DeleteOrderCustomAttributeResponse::class])] + private array $values; + + /** + * @param array{ + * values: array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->errors = $values['errors'] ?? null; + $this->values = $values['values']; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkRetrieveBookingsResponse.php b/src/Types/BulkRetrieveBookingsResponse.php new file mode 100644 index 00000000..7bc997fa --- /dev/null +++ b/src/Types/BulkRetrieveBookingsResponse.php @@ -0,0 +1,80 @@ + $bookings Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value. + */ + #[JsonProperty('bookings'), ArrayType(['string' => GetBookingResponse::class])] + private ?array $bookings; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bookings?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bookings = $values['bookings'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getBookings(): ?array + { + return $this->bookings; + } + + /** + * @param ?array $value + */ + public function setBookings(?array $value = null): self + { + $this->bookings = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkRetrieveCustomersResponse.php b/src/Types/BulkRetrieveCustomersResponse.php new file mode 100644 index 00000000..b316b33c --- /dev/null +++ b/src/Types/BulkRetrieveCustomersResponse.php @@ -0,0 +1,89 @@ + $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => GetCustomerResponse::class])] + private ?array $responses; + + /** + * @var ?array $errors Any top-level errors that prevented the bulk operation from running. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * responses?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->responses = $values['responses'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkRetrieveTeamMemberBookingProfilesResponse.php b/src/Types/BulkRetrieveTeamMemberBookingProfilesResponse.php new file mode 100644 index 00000000..cb6bb67e --- /dev/null +++ b/src/Types/BulkRetrieveTeamMemberBookingProfilesResponse.php @@ -0,0 +1,80 @@ + $teamMemberBookingProfiles The returned team members' booking profiles, as a map with `team_member_id` as the key and [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. + */ + #[JsonProperty('team_member_booking_profiles'), ArrayType(['string' => GetTeamMemberBookingProfileResponse::class])] + private ?array $teamMemberBookingProfiles; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMemberBookingProfiles?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberBookingProfiles = $values['teamMemberBookingProfiles'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMemberBookingProfiles(): ?array + { + return $this->teamMemberBookingProfiles; + } + + /** + * @param ?array $value + */ + public function setTeamMemberBookingProfiles(?array $value = null): self + { + $this->teamMemberBookingProfiles = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkSwapPlanResponse.php b/src/Types/BulkSwapPlanResponse.php new file mode 100644 index 00000000..9b37c17b --- /dev/null +++ b/src/Types/BulkSwapPlanResponse.php @@ -0,0 +1,81 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?int $affectedSubscriptions The number of affected subscriptions. + */ + #[JsonProperty('affected_subscriptions')] + private ?int $affectedSubscriptions; + + /** + * @param array{ + * errors?: ?array, + * affectedSubscriptions?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->affectedSubscriptions = $values['affectedSubscriptions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?int + */ + public function getAffectedSubscriptions(): ?int + { + return $this->affectedSubscriptions; + } + + /** + * @param ?int $value + */ + public function setAffectedSubscriptions(?int $value = null): self + { + $this->affectedSubscriptions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpdateCustomerData.php b/src/Types/BulkUpdateCustomerData.php new file mode 100644 index 00000000..365a916f --- /dev/null +++ b/src/Types/BulkUpdateCustomerData.php @@ -0,0 +1,356 @@ +givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->nickname = $values['nickname'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->birthday = $values['birthday'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNickname(): ?string + { + return $this->nickname; + } + + /** + * @param ?string $value + */ + public function setNickname(?string $value = null): self + { + $this->nickname = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBirthday(): ?string + { + return $this->birthday; + } + + /** + * @param ?string $value + */ + public function setBirthday(?string $value = null): self + { + $this->birthday = $value; + return $this; + } + + /** + * @return ?CustomerTaxIds + */ + public function getTaxIds(): ?CustomerTaxIds + { + return $this->taxIds; + } + + /** + * @param ?CustomerTaxIds $value + */ + public function setTaxIds(?CustomerTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpdateCustomersResponse.php b/src/Types/BulkUpdateCustomersResponse.php new file mode 100644 index 00000000..7b65cde3 --- /dev/null +++ b/src/Types/BulkUpdateCustomersResponse.php @@ -0,0 +1,89 @@ + $responses + */ + #[JsonProperty('responses'), ArrayType(['string' => UpdateCustomerResponse::class])] + private ?array $responses; + + /** + * @var ?array $errors Any top-level errors that prevented the bulk operation from running. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * responses?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->responses = $values['responses'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getResponses(): ?array + { + return $this->responses; + } + + /** + * @param ?array $value + */ + public function setResponses(?array $value = null): self + { + $this->responses = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertBookingCustomAttributesResponse.php b/src/Types/BulkUpsertBookingCustomAttributesResponse.php new file mode 100644 index 00000000..c160031c --- /dev/null +++ b/src/Types/BulkUpsertBookingCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BookingCustomAttributeUpsertResponse::class])] + private ?array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php b/src/Types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php new file mode 100644 index 00000000..f5a18370 --- /dev/null +++ b/src/Types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.php @@ -0,0 +1,118 @@ +locationId = $values['locationId']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertLocationCustomAttributesResponse.php b/src/Types/BulkUpsertLocationCustomAttributesResponse.php new file mode 100644 index 00000000..0111fbca --- /dev/null +++ b/src/Types/BulkUpsertLocationCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse::class])] + private ?array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php b/src/Types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php new file mode 100644 index 00000000..a1512a76 --- /dev/null +++ b/src/Types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.php @@ -0,0 +1,105 @@ + $errors Any errors that occurred while processing the individual request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * locationId?: ?string, + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php b/src/Types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php new file mode 100644 index 00000000..0d951d9d --- /dev/null +++ b/src/Types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.php @@ -0,0 +1,118 @@ +merchantId = $values['merchantId']; + $this->customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getMerchantId(): string + { + return $this->merchantId; + } + + /** + * @param string $value + */ + public function setMerchantId(string $value): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertMerchantCustomAttributesResponse.php b/src/Types/BulkUpsertMerchantCustomAttributesResponse.php new file mode 100644 index 00000000..3923515a --- /dev/null +++ b/src/Types/BulkUpsertMerchantCustomAttributesResponse.php @@ -0,0 +1,84 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string' => BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse::class])] + private ?array $values; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * values?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php b/src/Types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php new file mode 100644 index 00000000..84d65023 --- /dev/null +++ b/src/Types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.php @@ -0,0 +1,105 @@ + $errors Any errors that occurred while processing the individual request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * merchantId?: ?string, + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->merchantId = $values['merchantId'] ?? null; + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php b/src/Types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php new file mode 100644 index 00000000..bbe715e0 --- /dev/null +++ b/src/Types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.php @@ -0,0 +1,115 @@ +customAttribute = $values['customAttribute']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->orderId = $values['orderId']; + } + + /** + * @return CustomAttribute + */ + public function getCustomAttribute(): CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param CustomAttribute $value + */ + public function setCustomAttribute(CustomAttribute $value): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BulkUpsertOrderCustomAttributesResponse.php b/src/Types/BulkUpsertOrderCustomAttributesResponse.php new file mode 100644 index 00000000..6dd89f80 --- /dev/null +++ b/src/Types/BulkUpsertOrderCustomAttributesResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var array $values A map of responses that correspond to individual upsert operations for custom attributes. + */ + #[JsonProperty('values'), ArrayType(['string' => UpsertOrderCustomAttributeResponse::class])] + private array $values; + + /** + * @param array{ + * values: array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->errors = $values['errors'] ?? null; + $this->values = $values['values']; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return array + */ + public function getValues(): array + { + return $this->values; + } + + /** + * @param array $value + */ + public function setValues(array $value): self + { + $this->values = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BusinessAppointmentSettings.php b/src/Types/BusinessAppointmentSettings.php new file mode 100644 index 00000000..9fb7bfda --- /dev/null +++ b/src/Types/BusinessAppointmentSettings.php @@ -0,0 +1,371 @@ +> $locationTypes + */ + #[JsonProperty('location_types'), ArrayType(['string'])] + private ?array $locationTypes; + + /** + * The time unit of the service duration for bookings. + * See [BusinessAppointmentSettingsAlignmentTime](#type-businessappointmentsettingsalignmenttime) for possible values + * + * @var ?value-of $alignmentTime + */ + #[JsonProperty('alignment_time')] + private ?string $alignmentTime; + + /** + * @var ?int $minBookingLeadTimeSeconds The minimum lead time in seconds before a service can be booked. A booking must be created at least this amount of time before its starting time. + */ + #[JsonProperty('min_booking_lead_time_seconds')] + private ?int $minBookingLeadTimeSeconds; + + /** + * @var ?int $maxBookingLeadTimeSeconds The maximum lead time in seconds before a service can be booked. A booking must be created at most this amount of time before its starting time. + */ + #[JsonProperty('max_booking_lead_time_seconds')] + private ?int $maxBookingLeadTimeSeconds; + + /** + * Indicates whether a customer can choose from all available time slots and have a staff member assigned + * automatically (`true`) or not (`false`). + * + * @var ?bool $anyTeamMemberBookingEnabled + */ + #[JsonProperty('any_team_member_booking_enabled')] + private ?bool $anyTeamMemberBookingEnabled; + + /** + * @var ?bool $multipleServiceBookingEnabled Indicates whether a customer can book multiple services in a single online booking. + */ + #[JsonProperty('multiple_service_booking_enabled')] + private ?bool $multipleServiceBookingEnabled; + + /** + * Indicates whether the daily appointment limit applies to team members or to + * business locations. + * See [BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType](#type-businessappointmentsettingsmaxappointmentsperdaylimittype) for possible values + * + * @var ?value-of $maxAppointmentsPerDayLimitType + */ + #[JsonProperty('max_appointments_per_day_limit_type')] + private ?string $maxAppointmentsPerDayLimitType; + + /** + * @var ?int $maxAppointmentsPerDayLimit The maximum number of daily appointments per team member or per location. + */ + #[JsonProperty('max_appointments_per_day_limit')] + private ?int $maxAppointmentsPerDayLimit; + + /** + * @var ?int $cancellationWindowSeconds The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. + */ + #[JsonProperty('cancellation_window_seconds')] + private ?int $cancellationWindowSeconds; + + /** + * @var ?Money $cancellationFeeMoney The flat-fee amount charged for a no-show booking. + */ + #[JsonProperty('cancellation_fee_money')] + private ?Money $cancellationFeeMoney; + + /** + * The cancellation policy adopted by the seller. + * See [BusinessAppointmentSettingsCancellationPolicy](#type-businessappointmentsettingscancellationpolicy) for possible values + * + * @var ?value-of $cancellationPolicy + */ + #[JsonProperty('cancellation_policy')] + private ?string $cancellationPolicy; + + /** + * @var ?string $cancellationPolicyText The free-form text of the seller's cancellation policy. + */ + #[JsonProperty('cancellation_policy_text')] + private ?string $cancellationPolicyText; + + /** + * @var ?bool $skipBookingFlowStaffSelection Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`). + */ + #[JsonProperty('skip_booking_flow_staff_selection')] + private ?bool $skipBookingFlowStaffSelection; + + /** + * @param array{ + * locationTypes?: ?array>, + * alignmentTime?: ?value-of, + * minBookingLeadTimeSeconds?: ?int, + * maxBookingLeadTimeSeconds?: ?int, + * anyTeamMemberBookingEnabled?: ?bool, + * multipleServiceBookingEnabled?: ?bool, + * maxAppointmentsPerDayLimitType?: ?value-of, + * maxAppointmentsPerDayLimit?: ?int, + * cancellationWindowSeconds?: ?int, + * cancellationFeeMoney?: ?Money, + * cancellationPolicy?: ?value-of, + * cancellationPolicyText?: ?string, + * skipBookingFlowStaffSelection?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationTypes = $values['locationTypes'] ?? null; + $this->alignmentTime = $values['alignmentTime'] ?? null; + $this->minBookingLeadTimeSeconds = $values['minBookingLeadTimeSeconds'] ?? null; + $this->maxBookingLeadTimeSeconds = $values['maxBookingLeadTimeSeconds'] ?? null; + $this->anyTeamMemberBookingEnabled = $values['anyTeamMemberBookingEnabled'] ?? null; + $this->multipleServiceBookingEnabled = $values['multipleServiceBookingEnabled'] ?? null; + $this->maxAppointmentsPerDayLimitType = $values['maxAppointmentsPerDayLimitType'] ?? null; + $this->maxAppointmentsPerDayLimit = $values['maxAppointmentsPerDayLimit'] ?? null; + $this->cancellationWindowSeconds = $values['cancellationWindowSeconds'] ?? null; + $this->cancellationFeeMoney = $values['cancellationFeeMoney'] ?? null; + $this->cancellationPolicy = $values['cancellationPolicy'] ?? null; + $this->cancellationPolicyText = $values['cancellationPolicyText'] ?? null; + $this->skipBookingFlowStaffSelection = $values['skipBookingFlowStaffSelection'] ?? null; + } + + /** + * @return ?array> + */ + public function getLocationTypes(): ?array + { + return $this->locationTypes; + } + + /** + * @param ?array> $value + */ + public function setLocationTypes(?array $value = null): self + { + $this->locationTypes = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getAlignmentTime(): ?string + { + return $this->alignmentTime; + } + + /** + * @param ?value-of $value + */ + public function setAlignmentTime(?string $value = null): self + { + $this->alignmentTime = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMinBookingLeadTimeSeconds(): ?int + { + return $this->minBookingLeadTimeSeconds; + } + + /** + * @param ?int $value + */ + public function setMinBookingLeadTimeSeconds(?int $value = null): self + { + $this->minBookingLeadTimeSeconds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMaxBookingLeadTimeSeconds(): ?int + { + return $this->maxBookingLeadTimeSeconds; + } + + /** + * @param ?int $value + */ + public function setMaxBookingLeadTimeSeconds(?int $value = null): self + { + $this->maxBookingLeadTimeSeconds = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAnyTeamMemberBookingEnabled(): ?bool + { + return $this->anyTeamMemberBookingEnabled; + } + + /** + * @param ?bool $value + */ + public function setAnyTeamMemberBookingEnabled(?bool $value = null): self + { + $this->anyTeamMemberBookingEnabled = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getMultipleServiceBookingEnabled(): ?bool + { + return $this->multipleServiceBookingEnabled; + } + + /** + * @param ?bool $value + */ + public function setMultipleServiceBookingEnabled(?bool $value = null): self + { + $this->multipleServiceBookingEnabled = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getMaxAppointmentsPerDayLimitType(): ?string + { + return $this->maxAppointmentsPerDayLimitType; + } + + /** + * @param ?value-of $value + */ + public function setMaxAppointmentsPerDayLimitType(?string $value = null): self + { + $this->maxAppointmentsPerDayLimitType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMaxAppointmentsPerDayLimit(): ?int + { + return $this->maxAppointmentsPerDayLimit; + } + + /** + * @param ?int $value + */ + public function setMaxAppointmentsPerDayLimit(?int $value = null): self + { + $this->maxAppointmentsPerDayLimit = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCancellationWindowSeconds(): ?int + { + return $this->cancellationWindowSeconds; + } + + /** + * @param ?int $value + */ + public function setCancellationWindowSeconds(?int $value = null): self + { + $this->cancellationWindowSeconds = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getCancellationFeeMoney(): ?Money + { + return $this->cancellationFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setCancellationFeeMoney(?Money $value = null): self + { + $this->cancellationFeeMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCancellationPolicy(): ?string + { + return $this->cancellationPolicy; + } + + /** + * @param ?value-of $value + */ + public function setCancellationPolicy(?string $value = null): self + { + $this->cancellationPolicy = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCancellationPolicyText(): ?string + { + return $this->cancellationPolicyText; + } + + /** + * @param ?string $value + */ + public function setCancellationPolicyText(?string $value = null): self + { + $this->cancellationPolicyText = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSkipBookingFlowStaffSelection(): ?bool + { + return $this->skipBookingFlowStaffSelection; + } + + /** + * @param ?bool $value + */ + public function setSkipBookingFlowStaffSelection(?bool $value = null): self + { + $this->skipBookingFlowStaffSelection = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BusinessAppointmentSettingsAlignmentTime.php b/src/Types/BusinessAppointmentSettingsAlignmentTime.php new file mode 100644 index 00000000..0080c30e --- /dev/null +++ b/src/Types/BusinessAppointmentSettingsAlignmentTime.php @@ -0,0 +1,11 @@ + $customerTimezoneChoice + */ + #[JsonProperty('customer_timezone_choice')] + private ?string $customerTimezoneChoice; + + /** + * The policy for the seller to automatically accept booking requests (`ACCEPT_ALL`) or not (`REQUIRES_ACCEPTANCE`). + * See [BusinessBookingProfileBookingPolicy](#type-businessbookingprofilebookingpolicy) for possible values + * + * @var ?value-of $bookingPolicy + */ + #[JsonProperty('booking_policy')] + private ?string $bookingPolicy; + + /** + * @var ?bool $allowUserCancel Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). + */ + #[JsonProperty('allow_user_cancel')] + private ?bool $allowUserCancel; + + /** + * @var ?BusinessAppointmentSettings $businessAppointmentSettings Settings for appointment-type bookings. + */ + #[JsonProperty('business_appointment_settings')] + private ?BusinessAppointmentSettings $businessAppointmentSettings; + + /** + * @var ?bool $supportSellerLevelWrites Indicates whether the seller's subscription to Square Appointments supports creating, updating or canceling an appointment through the API (`true`) or not (`false`) using seller permission. + */ + #[JsonProperty('support_seller_level_writes')] + private ?bool $supportSellerLevelWrites; + + /** + * @param array{ + * sellerId?: ?string, + * createdAt?: ?string, + * bookingEnabled?: ?bool, + * customerTimezoneChoice?: ?value-of, + * bookingPolicy?: ?value-of, + * allowUserCancel?: ?bool, + * businessAppointmentSettings?: ?BusinessAppointmentSettings, + * supportSellerLevelWrites?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->sellerId = $values['sellerId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->bookingEnabled = $values['bookingEnabled'] ?? null; + $this->customerTimezoneChoice = $values['customerTimezoneChoice'] ?? null; + $this->bookingPolicy = $values['bookingPolicy'] ?? null; + $this->allowUserCancel = $values['allowUserCancel'] ?? null; + $this->businessAppointmentSettings = $values['businessAppointmentSettings'] ?? null; + $this->supportSellerLevelWrites = $values['supportSellerLevelWrites'] ?? null; + } + + /** + * @return ?string + */ + public function getSellerId(): ?string + { + return $this->sellerId; + } + + /** + * @param ?string $value + */ + public function setSellerId(?string $value = null): self + { + $this->sellerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBookingEnabled(): ?bool + { + return $this->bookingEnabled; + } + + /** + * @param ?bool $value + */ + public function setBookingEnabled(?bool $value = null): self + { + $this->bookingEnabled = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCustomerTimezoneChoice(): ?string + { + return $this->customerTimezoneChoice; + } + + /** + * @param ?value-of $value + */ + public function setCustomerTimezoneChoice(?string $value = null): self + { + $this->customerTimezoneChoice = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getBookingPolicy(): ?string + { + return $this->bookingPolicy; + } + + /** + * @param ?value-of $value + */ + public function setBookingPolicy(?string $value = null): self + { + $this->bookingPolicy = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAllowUserCancel(): ?bool + { + return $this->allowUserCancel; + } + + /** + * @param ?bool $value + */ + public function setAllowUserCancel(?bool $value = null): self + { + $this->allowUserCancel = $value; + return $this; + } + + /** + * @return ?BusinessAppointmentSettings + */ + public function getBusinessAppointmentSettings(): ?BusinessAppointmentSettings + { + return $this->businessAppointmentSettings; + } + + /** + * @param ?BusinessAppointmentSettings $value + */ + public function setBusinessAppointmentSettings(?BusinessAppointmentSettings $value = null): self + { + $this->businessAppointmentSettings = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSupportSellerLevelWrites(): ?bool + { + return $this->supportSellerLevelWrites; + } + + /** + * @param ?bool $value + */ + public function setSupportSellerLevelWrites(?bool $value = null): self + { + $this->supportSellerLevelWrites = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BusinessBookingProfileBookingPolicy.php b/src/Types/BusinessBookingProfileBookingPolicy.php new file mode 100644 index 00000000..c54469fa --- /dev/null +++ b/src/Types/BusinessBookingProfileBookingPolicy.php @@ -0,0 +1,9 @@ + $periods The list of time periods during which the business is open. There can be at most 10 periods per day. + */ + #[JsonProperty('periods'), ArrayType([BusinessHoursPeriod::class])] + private ?array $periods; + + /** + * @param array{ + * periods?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->periods = $values['periods'] ?? null; + } + + /** + * @return ?array + */ + public function getPeriods(): ?array + { + return $this->periods; + } + + /** + * @param ?array $value + */ + public function setPeriods(?array $value = null): self + { + $this->periods = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BusinessHoursPeriod.php b/src/Types/BusinessHoursPeriod.php new file mode 100644 index 00000000..131913ac --- /dev/null +++ b/src/Types/BusinessHoursPeriod.php @@ -0,0 +1,115 @@ + $dayOfWeek + */ + #[JsonProperty('day_of_week')] + private ?string $dayOfWeek; + + /** + * The start time of a business hours period, specified in local time using partial-time + * RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. + * Note that the seconds value is always :00, but it is appended for conformance to the RFC. + * + * @var ?string $startLocalTime + */ + #[JsonProperty('start_local_time')] + private ?string $startLocalTime; + + /** + * The end time of a business hours period, specified in local time using partial-time + * RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. + * Note that the seconds value is always :00, but it is appended for conformance to the RFC. + * + * @var ?string $endLocalTime + */ + #[JsonProperty('end_local_time')] + private ?string $endLocalTime; + + /** + * @param array{ + * dayOfWeek?: ?value-of, + * startLocalTime?: ?string, + * endLocalTime?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->dayOfWeek = $values['dayOfWeek'] ?? null; + $this->startLocalTime = $values['startLocalTime'] ?? null; + $this->endLocalTime = $values['endLocalTime'] ?? null; + } + + /** + * @return ?value-of + */ + public function getDayOfWeek(): ?string + { + return $this->dayOfWeek; + } + + /** + * @param ?value-of $value + */ + public function setDayOfWeek(?string $value = null): self + { + $this->dayOfWeek = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartLocalTime(): ?string + { + return $this->startLocalTime; + } + + /** + * @param ?string $value + */ + public function setStartLocalTime(?string $value = null): self + { + $this->startLocalTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndLocalTime(): ?string + { + return $this->endLocalTime; + } + + /** + * @param ?string $value + */ + public function setEndLocalTime(?string $value = null): self + { + $this->endLocalTime = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/BuyNowPayLaterDetails.php b/src/Types/BuyNowPayLaterDetails.php new file mode 100644 index 00000000..84fe4ca1 --- /dev/null +++ b/src/Types/BuyNowPayLaterDetails.php @@ -0,0 +1,113 @@ +brand = $values['brand'] ?? null; + $this->afterpayDetails = $values['afterpayDetails'] ?? null; + $this->clearpayDetails = $values['clearpayDetails'] ?? null; + } + + /** + * @return ?string + */ + public function getBrand(): ?string + { + return $this->brand; + } + + /** + * @param ?string $value + */ + public function setBrand(?string $value = null): self + { + $this->brand = $value; + return $this; + } + + /** + * @return ?AfterpayDetails + */ + public function getAfterpayDetails(): ?AfterpayDetails + { + return $this->afterpayDetails; + } + + /** + * @param ?AfterpayDetails $value + */ + public function setAfterpayDetails(?AfterpayDetails $value = null): self + { + $this->afterpayDetails = $value; + return $this; + } + + /** + * @return ?ClearpayDetails + */ + public function getClearpayDetails(): ?ClearpayDetails + { + return $this->clearpayDetails; + } + + /** + * @param ?ClearpayDetails $value + */ + public function setClearpayDetails(?ClearpayDetails $value = null): self + { + $this->clearpayDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CalculateLoyaltyPointsResponse.php b/src/Types/CalculateLoyaltyPointsResponse.php new file mode 100644 index 00000000..578bda46 --- /dev/null +++ b/src/Types/CalculateLoyaltyPointsResponse.php @@ -0,0 +1,109 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?int $points The number of points that the buyer can earn from the base loyalty program. + */ + #[JsonProperty('points')] + private ?int $points; + + /** + * The number of points that the buyer can earn from a loyalty promotion. To be eligible + * to earn promotion points, the purchase must first qualify for program points. When `order_id` + * is not provided in the request, this value is always 0. + * + * @var ?int $promotionPoints + */ + #[JsonProperty('promotion_points')] + private ?int $promotionPoints; + + /** + * @param array{ + * errors?: ?array, + * points?: ?int, + * promotionPoints?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->points = $values['points'] ?? null; + $this->promotionPoints = $values['promotionPoints'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPoints(): ?int + { + return $this->points; + } + + /** + * @param ?int $value + */ + public function setPoints(?int $value = null): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPromotionPoints(): ?int + { + return $this->promotionPoints; + } + + /** + * @param ?int $value + */ + public function setPromotionPoints(?int $value = null): self + { + $this->promotionPoints = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CalculateOrderResponse.php b/src/Types/CalculateOrderResponse.php new file mode 100644 index 00000000..ad37ac9d --- /dev/null +++ b/src/Types/CalculateOrderResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * order?: ?Order, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->order = $values['order'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelBookingResponse.php b/src/Types/CancelBookingResponse.php new file mode 100644 index 00000000..50d6c63c --- /dev/null +++ b/src/Types/CancelBookingResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * booking?: ?Booking, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->booking = $values['booking'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Booking + */ + public function getBooking(): ?Booking + { + return $this->booking; + } + + /** + * @param ?Booking $value + */ + public function setBooking(?Booking $value = null): self + { + $this->booking = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelInvoiceResponse.php b/src/Types/CancelInvoiceResponse.php new file mode 100644 index 00000000..f3201d32 --- /dev/null +++ b/src/Types/CancelInvoiceResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoice?: ?Invoice, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoice = $values['invoice'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Invoice + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param ?Invoice $value + */ + public function setInvoice(?Invoice $value = null): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelLoyaltyPromotionResponse.php b/src/Types/CancelLoyaltyPromotionResponse.php new file mode 100644 index 00000000..e79ee17d --- /dev/null +++ b/src/Types/CancelLoyaltyPromotionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyPromotion $loyaltyPromotion The canceled loyalty promotion. + */ + #[JsonProperty('loyalty_promotion')] + private ?LoyaltyPromotion $loyaltyPromotion; + + /** + * @param array{ + * errors?: ?array, + * loyaltyPromotion?: ?LoyaltyPromotion, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyPromotion = $values['loyaltyPromotion'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotion + */ + public function getLoyaltyPromotion(): ?LoyaltyPromotion + { + return $this->loyaltyPromotion; + } + + /** + * @param ?LoyaltyPromotion $value + */ + public function setLoyaltyPromotion(?LoyaltyPromotion $value = null): self + { + $this->loyaltyPromotion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelPaymentByIdempotencyKeyResponse.php b/src/Types/CancelPaymentByIdempotencyKeyResponse.php new file mode 100644 index 00000000..e72b66fc --- /dev/null +++ b/src/Types/CancelPaymentByIdempotencyKeyResponse.php @@ -0,0 +1,57 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelPaymentResponse.php b/src/Types/CancelPaymentResponse.php new file mode 100644 index 00000000..2e63aa33 --- /dev/null +++ b/src/Types/CancelPaymentResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Payment $payment The successfully canceled `Payment` object. + */ + #[JsonProperty('payment')] + private ?Payment $payment; + + /** + * @param array{ + * errors?: ?array, + * payment?: ?Payment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payment = $values['payment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelSubscriptionResponse.php b/src/Types/CancelSubscriptionResponse.php new file mode 100644 index 00000000..2d75d832 --- /dev/null +++ b/src/Types/CancelSubscriptionResponse.php @@ -0,0 +1,106 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The specified subscription scheduled for cancellation according to the action created by the request. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @var ?array $actions A list of a single `CANCEL` action scheduled for the subscription. + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * actions?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelTerminalActionResponse.php b/src/Types/CancelTerminalActionResponse.php new file mode 100644 index 00000000..335d046a --- /dev/null +++ b/src/Types/CancelTerminalActionResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalAction $action The canceled `TerminalAction` + */ + #[JsonProperty('action')] + private ?TerminalAction $action; + + /** + * @param array{ + * errors?: ?array, + * action?: ?TerminalAction, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->action = $values['action'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalAction + */ + public function getAction(): ?TerminalAction + { + return $this->action; + } + + /** + * @param ?TerminalAction $value + */ + public function setAction(?TerminalAction $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelTerminalCheckoutResponse.php b/src/Types/CancelTerminalCheckoutResponse.php new file mode 100644 index 00000000..158df64d --- /dev/null +++ b/src/Types/CancelTerminalCheckoutResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalCheckout $checkout The canceled `TerminalCheckout`. + */ + #[JsonProperty('checkout')] + private ?TerminalCheckout $checkout; + + /** + * @param array{ + * errors?: ?array, + * checkout?: ?TerminalCheckout, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->checkout = $values['checkout'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalCheckout + */ + public function getCheckout(): ?TerminalCheckout + { + return $this->checkout; + } + + /** + * @param ?TerminalCheckout $value + */ + public function setCheckout(?TerminalCheckout $value = null): self + { + $this->checkout = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CancelTerminalRefundResponse.php b/src/Types/CancelTerminalRefundResponse.php new file mode 100644 index 00000000..c41ed373 --- /dev/null +++ b/src/Types/CancelTerminalRefundResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalRefund $refund The updated `TerminalRefund`. + */ + #[JsonProperty('refund')] + private ?TerminalRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?TerminalRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalRefund + */ + public function getRefund(): ?TerminalRefund + { + return $this->refund; + } + + /** + * @param ?TerminalRefund $value + */ + public function setRefund(?TerminalRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CaptureTransactionResponse.php b/src/Types/CaptureTransactionResponse.php new file mode 100644 index 00000000..aa6852fc --- /dev/null +++ b/src/Types/CaptureTransactionResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Card.php b/src/Types/Card.php new file mode 100644 index 00000000..4bd414e5 --- /dev/null +++ b/src/Types/Card.php @@ -0,0 +1,485 @@ + $cardBrand + */ + #[JsonProperty('card_brand')] + private ?string $cardBrand; + + /** + * @var ?string $last4 The last 4 digits of the card number. + */ + #[JsonProperty('last_4')] + private ?string $last4; + + /** + * @var ?int $expMonth The expiration month of the associated card as an integer between 1 and 12. + */ + #[JsonProperty('exp_month')] + private ?int $expMonth; + + /** + * @var ?int $expYear The four-digit year of the card's expiration date. + */ + #[JsonProperty('exp_year')] + private ?int $expYear; + + /** + * @var ?string $cardholderName The name of the cardholder. + */ + #[JsonProperty('cardholder_name')] + private ?string $cardholderName; + + /** + * @var ?Address $billingAddress The billing address for this card. + */ + #[JsonProperty('billing_address')] + private ?Address $billingAddress; + + /** + * Intended as a Square-assigned identifier, based + * on the card number, to identify the card across multiple locations within a + * single application. + * + * @var ?string $fingerprint + */ + #[JsonProperty('fingerprint')] + private ?string $fingerprint; + + /** + * @var ?string $customerId **Required** The ID of a customer created using the Customers API to be associated with the card. + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + + /** + * @var ?string $merchantId The ID of the merchant associated with the card. + */ + #[JsonProperty('merchant_id')] + private ?string $merchantId; + + /** + * An optional user-defined reference ID that associates this card with + * another entity in an external system. For example, a customer ID from an + * external customer management system. + * + * @var ?string $referenceId + */ + #[JsonProperty('reference_id')] + private ?string $referenceId; + + /** + * @var ?bool $enabled Indicates whether or not a card can be used for payments. + */ + #[JsonProperty('enabled')] + private ?bool $enabled; + + /** + * The type of the card. + * The Card object includes this field only in response to Payments API calls. + * See [CardType](#type-cardtype) for possible values + * + * @var ?value-of $cardType + */ + #[JsonProperty('card_type')] + private ?string $cardType; + + /** + * Indicates whether the Card is prepaid or not. + * The Card object includes this field only in response to Payments API calls. + * See [CardPrepaidType](#type-cardprepaidtype) for possible values + * + * @var ?value-of $prepaidType + */ + #[JsonProperty('prepaid_type')] + private ?string $prepaidType; + + /** + * The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API + * returns this field. + * + * @var ?string $bin + */ + #[JsonProperty('bin')] + private ?string $bin; + + /** + * Current version number of the card. Increments with each card update. Requests to update an + * existing Card object will be rejected unless the version in the request matches the current + * version for the Card. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * The card's co-brand if available. For example, an Afterpay virtual card would have a + * co-brand of AFTERPAY. + * See [CardCoBrand](#type-cardcobrand) for possible values + * + * @var ?value-of $cardCoBrand + */ + #[JsonProperty('card_co_brand')] + private ?string $cardCoBrand; + + /** + * @param array{ + * id?: ?string, + * cardBrand?: ?value-of, + * last4?: ?string, + * expMonth?: ?int, + * expYear?: ?int, + * cardholderName?: ?string, + * billingAddress?: ?Address, + * fingerprint?: ?string, + * customerId?: ?string, + * merchantId?: ?string, + * referenceId?: ?string, + * enabled?: ?bool, + * cardType?: ?value-of, + * prepaidType?: ?value-of, + * bin?: ?string, + * version?: ?int, + * cardCoBrand?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->cardBrand = $values['cardBrand'] ?? null; + $this->last4 = $values['last4'] ?? null; + $this->expMonth = $values['expMonth'] ?? null; + $this->expYear = $values['expYear'] ?? null; + $this->cardholderName = $values['cardholderName'] ?? null; + $this->billingAddress = $values['billingAddress'] ?? null; + $this->fingerprint = $values['fingerprint'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->enabled = $values['enabled'] ?? null; + $this->cardType = $values['cardType'] ?? null; + $this->prepaidType = $values['prepaidType'] ?? null; + $this->bin = $values['bin'] ?? null; + $this->version = $values['version'] ?? null; + $this->cardCoBrand = $values['cardCoBrand'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCardBrand(): ?string + { + return $this->cardBrand; + } + + /** + * @param ?value-of $value + */ + public function setCardBrand(?string $value = null): self + { + $this->cardBrand = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLast4(): ?string + { + return $this->last4; + } + + /** + * @param ?string $value + */ + public function setLast4(?string $value = null): self + { + $this->last4 = $value; + return $this; + } + + /** + * @return ?int + */ + public function getExpMonth(): ?int + { + return $this->expMonth; + } + + /** + * @param ?int $value + */ + public function setExpMonth(?int $value = null): self + { + $this->expMonth = $value; + return $this; + } + + /** + * @return ?int + */ + public function getExpYear(): ?int + { + return $this->expYear; + } + + /** + * @param ?int $value + */ + public function setExpYear(?int $value = null): self + { + $this->expYear = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardholderName(): ?string + { + return $this->cardholderName; + } + + /** + * @param ?string $value + */ + public function setCardholderName(?string $value = null): self + { + $this->cardholderName = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getBillingAddress(): ?Address + { + return $this->billingAddress; + } + + /** + * @param ?Address $value + */ + public function setBillingAddress(?Address $value = null): self + { + $this->billingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFingerprint(): ?string + { + return $this->fingerprint; + } + + /** + * @param ?string $value + */ + public function setFingerprint(?string $value = null): self + { + $this->fingerprint = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCardType(): ?string + { + return $this->cardType; + } + + /** + * @param ?value-of $value + */ + public function setCardType(?string $value = null): self + { + $this->cardType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getPrepaidType(): ?string + { + return $this->prepaidType; + } + + /** + * @param ?value-of $value + */ + public function setPrepaidType(?string $value = null): self + { + $this->prepaidType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBin(): ?string + { + return $this->bin; + } + + /** + * @param ?string $value + */ + public function setBin(?string $value = null): self + { + $this->bin = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCardCoBrand(): ?string + { + return $this->cardCoBrand; + } + + /** + * @param ?value-of $value + */ + public function setCardCoBrand(?string $value = null): self + { + $this->cardCoBrand = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CardBrand.php b/src/Types/CardBrand.php new file mode 100644 index 00000000..5df3b719 --- /dev/null +++ b/src/Types/CardBrand.php @@ -0,0 +1,21 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * status?: ?string, + * card?: ?Card, + * entryMethod?: ?string, + * cvvStatus?: ?string, + * avsStatus?: ?string, + * authResultCode?: ?string, + * applicationIdentifier?: ?string, + * applicationName?: ?string, + * applicationCryptogram?: ?string, + * verificationMethod?: ?string, + * verificationResults?: ?string, + * statementDescription?: ?string, + * deviceDetails?: ?DeviceDetails, + * cardPaymentTimeline?: ?CardPaymentTimeline, + * refundRequiresCardPresence?: ?bool, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->status = $values['status'] ?? null; + $this->card = $values['card'] ?? null; + $this->entryMethod = $values['entryMethod'] ?? null; + $this->cvvStatus = $values['cvvStatus'] ?? null; + $this->avsStatus = $values['avsStatus'] ?? null; + $this->authResultCode = $values['authResultCode'] ?? null; + $this->applicationIdentifier = $values['applicationIdentifier'] ?? null; + $this->applicationName = $values['applicationName'] ?? null; + $this->applicationCryptogram = $values['applicationCryptogram'] ?? null; + $this->verificationMethod = $values['verificationMethod'] ?? null; + $this->verificationResults = $values['verificationResults'] ?? null; + $this->statementDescription = $values['statementDescription'] ?? null; + $this->deviceDetails = $values['deviceDetails'] ?? null; + $this->cardPaymentTimeline = $values['cardPaymentTimeline'] ?? null; + $this->refundRequiresCardPresence = $values['refundRequiresCardPresence'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEntryMethod(): ?string + { + return $this->entryMethod; + } + + /** + * @param ?string $value + */ + public function setEntryMethod(?string $value = null): self + { + $this->entryMethod = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCvvStatus(): ?string + { + return $this->cvvStatus; + } + + /** + * @param ?string $value + */ + public function setCvvStatus(?string $value = null): self + { + $this->cvvStatus = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAvsStatus(): ?string + { + return $this->avsStatus; + } + + /** + * @param ?string $value + */ + public function setAvsStatus(?string $value = null): self + { + $this->avsStatus = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAuthResultCode(): ?string + { + return $this->authResultCode; + } + + /** + * @param ?string $value + */ + public function setAuthResultCode(?string $value = null): self + { + $this->authResultCode = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplicationIdentifier(): ?string + { + return $this->applicationIdentifier; + } + + /** + * @param ?string $value + */ + public function setApplicationIdentifier(?string $value = null): self + { + $this->applicationIdentifier = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplicationName(): ?string + { + return $this->applicationName; + } + + /** + * @param ?string $value + */ + public function setApplicationName(?string $value = null): self + { + $this->applicationName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplicationCryptogram(): ?string + { + return $this->applicationCryptogram; + } + + /** + * @param ?string $value + */ + public function setApplicationCryptogram(?string $value = null): self + { + $this->applicationCryptogram = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVerificationMethod(): ?string + { + return $this->verificationMethod; + } + + /** + * @param ?string $value + */ + public function setVerificationMethod(?string $value = null): self + { + $this->verificationMethod = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVerificationResults(): ?string + { + return $this->verificationResults; + } + + /** + * @param ?string $value + */ + public function setVerificationResults(?string $value = null): self + { + $this->verificationResults = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatementDescription(): ?string + { + return $this->statementDescription; + } + + /** + * @param ?string $value + */ + public function setStatementDescription(?string $value = null): self + { + $this->statementDescription = $value; + return $this; + } + + /** + * @return ?DeviceDetails + */ + public function getDeviceDetails(): ?DeviceDetails + { + return $this->deviceDetails; + } + + /** + * @param ?DeviceDetails $value + */ + public function setDeviceDetails(?DeviceDetails $value = null): self + { + $this->deviceDetails = $value; + return $this; + } + + /** + * @return ?CardPaymentTimeline + */ + public function getCardPaymentTimeline(): ?CardPaymentTimeline + { + return $this->cardPaymentTimeline; + } + + /** + * @param ?CardPaymentTimeline $value + */ + public function setCardPaymentTimeline(?CardPaymentTimeline $value = null): self + { + $this->cardPaymentTimeline = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getRefundRequiresCardPresence(): ?bool + { + return $this->refundRequiresCardPresence; + } + + /** + * @param ?bool $value + */ + public function setRefundRequiresCardPresence(?bool $value = null): self + { + $this->refundRequiresCardPresence = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CardPaymentTimeline.php b/src/Types/CardPaymentTimeline.php new file mode 100644 index 00000000..da42ef7c --- /dev/null +++ b/src/Types/CardPaymentTimeline.php @@ -0,0 +1,104 @@ +authorizedAt = $values['authorizedAt'] ?? null; + $this->capturedAt = $values['capturedAt'] ?? null; + $this->voidedAt = $values['voidedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getAuthorizedAt(): ?string + { + return $this->authorizedAt; + } + + /** + * @param ?string $value + */ + public function setAuthorizedAt(?string $value = null): self + { + $this->authorizedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCapturedAt(): ?string + { + return $this->capturedAt; + } + + /** + * @param ?string $value + */ + public function setCapturedAt(?string $value = null): self + { + $this->capturedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVoidedAt(): ?string + { + return $this->voidedAt; + } + + /** + * @param ?string $value + */ + public function setVoidedAt(?string $value = null): self + { + $this->voidedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CardPrepaidType.php b/src/Types/CardPrepaidType.php new file mode 100644 index 00000000..7ce6eb7f --- /dev/null +++ b/src/Types/CardPrepaidType.php @@ -0,0 +1,10 @@ +buyerFullName = $values['buyerFullName'] ?? null; + $this->buyerCountryCode = $values['buyerCountryCode'] ?? null; + $this->buyerCashtag = $values['buyerCashtag'] ?? null; + } + + /** + * @return ?string + */ + public function getBuyerFullName(): ?string + { + return $this->buyerFullName; + } + + /** + * @param ?string $value + */ + public function setBuyerFullName(?string $value = null): self + { + $this->buyerFullName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerCountryCode(): ?string + { + return $this->buyerCountryCode; + } + + /** + * @param ?string $value + */ + public function setBuyerCountryCode(?string $value = null): self + { + $this->buyerCountryCode = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerCashtag(): ?string + { + return $this->buyerCashtag; + } + + /** + * @param ?string $value + */ + public function setBuyerCashtag(?string $value = null): self + { + $this->buyerCashtag = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CashDrawerDevice.php b/src/Types/CashDrawerDevice.php new file mode 100644 index 00000000..68f948cb --- /dev/null +++ b/src/Types/CashDrawerDevice.php @@ -0,0 +1,76 @@ +id = $values['id'] ?? null; + $this->name = $values['name'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CashDrawerEventType.php b/src/Types/CashDrawerEventType.php new file mode 100644 index 00000000..7b824b9b --- /dev/null +++ b/src/Types/CashDrawerEventType.php @@ -0,0 +1,16 @@ + $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * @var ?string $openedAt The time when the shift began, in ISO 8601 format. + */ + #[JsonProperty('opened_at')] + private ?string $openedAt; + + /** + * @var ?string $endedAt The time when the shift ended, in ISO 8601 format. + */ + #[JsonProperty('ended_at')] + private ?string $endedAt; + + /** + * @var ?string $closedAt The time when the shift was closed, in ISO 8601 format. + */ + #[JsonProperty('closed_at')] + private ?string $closedAt; + + /** + * @var ?string $description The free-form text description of a cash drawer by an employee. + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * The amount of money in the cash drawer at the start of the shift. + * The amount must be greater than or equal to zero. + * + * @var ?Money $openedCashMoney + */ + #[JsonProperty('opened_cash_money')] + private ?Money $openedCashMoney; + + /** + * The amount of money added to the cash drawer from cash payments. + * This is computed by summing all events with the types CASH_TENDER_PAYMENT and + * CASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or equal to + * zero. + * + * @var ?Money $cashPaymentMoney + */ + #[JsonProperty('cash_payment_money')] + private ?Money $cashPaymentMoney; + + /** + * The amount of money removed from the cash drawer from cash refunds. + * It is computed by summing the events of type CASH_TENDER_REFUND. The amount + * is always greater than or equal to zero. + * + * @var ?Money $cashRefundsMoney + */ + #[JsonProperty('cash_refunds_money')] + private ?Money $cashRefundsMoney; + + /** + * The amount of money added to the cash drawer for reasons other than cash + * payments. It is computed by summing the events of type PAID_IN. The amount is + * always greater than or equal to zero. + * + * @var ?Money $cashPaidInMoney + */ + #[JsonProperty('cash_paid_in_money')] + private ?Money $cashPaidInMoney; + + /** + * The amount of money removed from the cash drawer for reasons other than + * cash refunds. It is computed by summing the events of type PAID_OUT. The amount + * is always greater than or equal to zero. + * + * @var ?Money $cashPaidOutMoney + */ + #[JsonProperty('cash_paid_out_money')] + private ?Money $cashPaidOutMoney; + + /** + * The amount of money that should be in the cash drawer at the end of the + * shift, based on the shift's other money amounts. + * This can be negative if employees have not correctly recorded all the events + * on the cash drawer. + * cash_paid_out_money is a summation of amounts from cash_payment_money (zero + * or positive), cash_refunds_money (zero or negative), cash_paid_in_money (zero + * or positive), and cash_paid_out_money (zero or negative) event types. + * + * @var ?Money $expectedCashMoney + */ + #[JsonProperty('expected_cash_money')] + private ?Money $expectedCashMoney; + + /** + * The amount of money found in the cash drawer at the end of the shift + * by an auditing employee. The amount should be positive. + * + * @var ?Money $closedCashMoney + */ + #[JsonProperty('closed_cash_money')] + private ?Money $closedCashMoney; + + /** + * @var ?CashDrawerDevice $device The device running Square Point of Sale that was connected to the cash drawer. + */ + #[JsonProperty('device')] + private ?CashDrawerDevice $device; + + /** + * @var ?string $createdAt The shift start time in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The shift updated at time in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $locationId The ID of the location the cash drawer shift belongs to. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * The IDs of all team members that were logged into Square Point of Sale at any + * point while the cash drawer shift was open. + * + * @var ?array $teamMemberIds + */ + #[JsonProperty('team_member_ids'), ArrayType(['string'])] + private ?array $teamMemberIds; + + /** + * @var ?string $openingTeamMemberId The ID of the team member that started the cash drawer shift. + */ + #[JsonProperty('opening_team_member_id')] + private ?string $openingTeamMemberId; + + /** + * @var ?string $endingTeamMemberId The ID of the team member that ended the cash drawer shift. + */ + #[JsonProperty('ending_team_member_id')] + private ?string $endingTeamMemberId; + + /** + * The ID of the team member that closed the cash drawer shift by auditing + * the cash drawer contents. + * + * @var ?string $closingTeamMemberId + */ + #[JsonProperty('closing_team_member_id')] + private ?string $closingTeamMemberId; + + /** + * @param array{ + * id?: ?string, + * state?: ?value-of, + * openedAt?: ?string, + * endedAt?: ?string, + * closedAt?: ?string, + * description?: ?string, + * openedCashMoney?: ?Money, + * cashPaymentMoney?: ?Money, + * cashRefundsMoney?: ?Money, + * cashPaidInMoney?: ?Money, + * cashPaidOutMoney?: ?Money, + * expectedCashMoney?: ?Money, + * closedCashMoney?: ?Money, + * device?: ?CashDrawerDevice, + * createdAt?: ?string, + * updatedAt?: ?string, + * locationId?: ?string, + * teamMemberIds?: ?array, + * openingTeamMemberId?: ?string, + * endingTeamMemberId?: ?string, + * closingTeamMemberId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->state = $values['state'] ?? null; + $this->openedAt = $values['openedAt'] ?? null; + $this->endedAt = $values['endedAt'] ?? null; + $this->closedAt = $values['closedAt'] ?? null; + $this->description = $values['description'] ?? null; + $this->openedCashMoney = $values['openedCashMoney'] ?? null; + $this->cashPaymentMoney = $values['cashPaymentMoney'] ?? null; + $this->cashRefundsMoney = $values['cashRefundsMoney'] ?? null; + $this->cashPaidInMoney = $values['cashPaidInMoney'] ?? null; + $this->cashPaidOutMoney = $values['cashPaidOutMoney'] ?? null; + $this->expectedCashMoney = $values['expectedCashMoney'] ?? null; + $this->closedCashMoney = $values['closedCashMoney'] ?? null; + $this->device = $values['device'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->teamMemberIds = $values['teamMemberIds'] ?? null; + $this->openingTeamMemberId = $values['openingTeamMemberId'] ?? null; + $this->endingTeamMemberId = $values['endingTeamMemberId'] ?? null; + $this->closingTeamMemberId = $values['closingTeamMemberId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOpenedAt(): ?string + { + return $this->openedAt; + } + + /** + * @param ?string $value + */ + public function setOpenedAt(?string $value = null): self + { + $this->openedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndedAt(): ?string + { + return $this->endedAt; + } + + /** + * @param ?string $value + */ + public function setEndedAt(?string $value = null): self + { + $this->endedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClosedAt(): ?string + { + return $this->closedAt; + } + + /** + * @param ?string $value + */ + public function setClosedAt(?string $value = null): self + { + $this->closedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getOpenedCashMoney(): ?Money + { + return $this->openedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setOpenedCashMoney(?Money $value = null): self + { + $this->openedCashMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getCashPaymentMoney(): ?Money + { + return $this->cashPaymentMoney; + } + + /** + * @param ?Money $value + */ + public function setCashPaymentMoney(?Money $value = null): self + { + $this->cashPaymentMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getCashRefundsMoney(): ?Money + { + return $this->cashRefundsMoney; + } + + /** + * @param ?Money $value + */ + public function setCashRefundsMoney(?Money $value = null): self + { + $this->cashRefundsMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getCashPaidInMoney(): ?Money + { + return $this->cashPaidInMoney; + } + + /** + * @param ?Money $value + */ + public function setCashPaidInMoney(?Money $value = null): self + { + $this->cashPaidInMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getCashPaidOutMoney(): ?Money + { + return $this->cashPaidOutMoney; + } + + /** + * @param ?Money $value + */ + public function setCashPaidOutMoney(?Money $value = null): self + { + $this->cashPaidOutMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getExpectedCashMoney(): ?Money + { + return $this->expectedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setExpectedCashMoney(?Money $value = null): self + { + $this->expectedCashMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getClosedCashMoney(): ?Money + { + return $this->closedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setClosedCashMoney(?Money $value = null): self + { + $this->closedCashMoney = $value; + return $this; + } + + /** + * @return ?CashDrawerDevice + */ + public function getDevice(): ?CashDrawerDevice + { + return $this->device; + } + + /** + * @param ?CashDrawerDevice $value + */ + public function setDevice(?CashDrawerDevice $value = null): self + { + $this->device = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTeamMemberIds(): ?array + { + return $this->teamMemberIds; + } + + /** + * @param ?array $value + */ + public function setTeamMemberIds(?array $value = null): self + { + $this->teamMemberIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOpeningTeamMemberId(): ?string + { + return $this->openingTeamMemberId; + } + + /** + * @param ?string $value + */ + public function setOpeningTeamMemberId(?string $value = null): self + { + $this->openingTeamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndingTeamMemberId(): ?string + { + return $this->endingTeamMemberId; + } + + /** + * @param ?string $value + */ + public function setEndingTeamMemberId(?string $value = null): self + { + $this->endingTeamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClosingTeamMemberId(): ?string + { + return $this->closingTeamMemberId; + } + + /** + * @param ?string $value + */ + public function setClosingTeamMemberId(?string $value = null): self + { + $this->closingTeamMemberId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CashDrawerShiftEvent.php b/src/Types/CashDrawerShiftEvent.php new file mode 100644 index 00000000..9eda55bd --- /dev/null +++ b/src/Types/CashDrawerShiftEvent.php @@ -0,0 +1,187 @@ + $eventType + */ + #[JsonProperty('event_type')] + private ?string $eventType; + + /** + * The amount of money that was added to or removed from the cash drawer + * in the event. The amount can be positive (for added money) + * or zero (for other tender type payments). The addition or removal of money can be determined by + * by the event type. + * + * @var ?Money $eventMoney + */ + #[JsonProperty('event_money')] + private ?Money $eventMoney; + + /** + * @var ?string $createdAt The event time in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * An optional description of the event, entered by the employee that + * created the event. + * + * @var ?string $description + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * @var ?string $teamMemberId The ID of the team member that created the event. + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @param array{ + * id?: ?string, + * eventType?: ?value-of, + * eventMoney?: ?Money, + * createdAt?: ?string, + * description?: ?string, + * teamMemberId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->eventType = $values['eventType'] ?? null; + $this->eventMoney = $values['eventMoney'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->description = $values['description'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEventType(): ?string + { + return $this->eventType; + } + + /** + * @param ?value-of $value + */ + public function setEventType(?string $value = null): self + { + $this->eventType = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getEventMoney(): ?Money + { + return $this->eventMoney; + } + + /** + * @param ?Money $value + */ + public function setEventMoney(?Money $value = null): self + { + $this->eventMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CashDrawerShiftState.php b/src/Types/CashDrawerShiftState.php new file mode 100644 index 00000000..bcb0dbf0 --- /dev/null +++ b/src/Types/CashDrawerShiftState.php @@ -0,0 +1,10 @@ + $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * @var ?string $openedAt The shift start time in ISO 8601 format. + */ + #[JsonProperty('opened_at')] + private ?string $openedAt; + + /** + * @var ?string $endedAt The shift end time in ISO 8601 format. + */ + #[JsonProperty('ended_at')] + private ?string $endedAt; + + /** + * @var ?string $closedAt The shift close time in ISO 8601 format. + */ + #[JsonProperty('closed_at')] + private ?string $closedAt; + + /** + * @var ?string $description An employee free-text description of a cash drawer shift. + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * The amount of money in the cash drawer at the start of the shift. This + * must be a positive amount. + * + * @var ?Money $openedCashMoney + */ + #[JsonProperty('opened_cash_money')] + private ?Money $openedCashMoney; + + /** + * The amount of money that should be in the cash drawer at the end of the + * shift, based on the cash drawer events on the shift. + * The amount is correct if all shift employees accurately recorded their + * cash drawer shift events. Unrecorded events and events with the wrong amount + * result in an incorrect expected_cash_money amount that can be negative. + * + * @var ?Money $expectedCashMoney + */ + #[JsonProperty('expected_cash_money')] + private ?Money $expectedCashMoney; + + /** + * The amount of money found in the cash drawer at the end of the shift by + * an auditing employee. The amount must be greater than or equal to zero. + * + * @var ?Money $closedCashMoney + */ + #[JsonProperty('closed_cash_money')] + private ?Money $closedCashMoney; + + /** + * @var ?string $createdAt The shift start time in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The shift updated at time in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $locationId The ID of the location the cash drawer shift belongs to. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * @param array{ + * id?: ?string, + * state?: ?value-of, + * openedAt?: ?string, + * endedAt?: ?string, + * closedAt?: ?string, + * description?: ?string, + * openedCashMoney?: ?Money, + * expectedCashMoney?: ?Money, + * closedCashMoney?: ?Money, + * createdAt?: ?string, + * updatedAt?: ?string, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->state = $values['state'] ?? null; + $this->openedAt = $values['openedAt'] ?? null; + $this->endedAt = $values['endedAt'] ?? null; + $this->closedAt = $values['closedAt'] ?? null; + $this->description = $values['description'] ?? null; + $this->openedCashMoney = $values['openedCashMoney'] ?? null; + $this->expectedCashMoney = $values['expectedCashMoney'] ?? null; + $this->closedCashMoney = $values['closedCashMoney'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOpenedAt(): ?string + { + return $this->openedAt; + } + + /** + * @param ?string $value + */ + public function setOpenedAt(?string $value = null): self + { + $this->openedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndedAt(): ?string + { + return $this->endedAt; + } + + /** + * @param ?string $value + */ + public function setEndedAt(?string $value = null): self + { + $this->endedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClosedAt(): ?string + { + return $this->closedAt; + } + + /** + * @param ?string $value + */ + public function setClosedAt(?string $value = null): self + { + $this->closedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getOpenedCashMoney(): ?Money + { + return $this->openedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setOpenedCashMoney(?Money $value = null): self + { + $this->openedCashMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getExpectedCashMoney(): ?Money + { + return $this->expectedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setExpectedCashMoney(?Money $value = null): self + { + $this->expectedCashMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getClosedCashMoney(): ?Money + { + return $this->closedCashMoney; + } + + /** + * @param ?Money $value + */ + public function setClosedCashMoney(?Money $value = null): self + { + $this->closedCashMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CashPaymentDetails.php b/src/Types/CashPaymentDetails.php new file mode 100644 index 00000000..045c165e --- /dev/null +++ b/src/Types/CashPaymentDetails.php @@ -0,0 +1,84 @@ +buyerSuppliedMoney = $values['buyerSuppliedMoney']; + $this->changeBackMoney = $values['changeBackMoney'] ?? null; + } + + /** + * @return Money + */ + public function getBuyerSuppliedMoney(): Money + { + return $this->buyerSuppliedMoney; + } + + /** + * @param Money $value + */ + public function setBuyerSuppliedMoney(Money $value): self + { + $this->buyerSuppliedMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getChangeBackMoney(): ?Money + { + return $this->changeBackMoney; + } + + /** + * @param ?Money $value + */ + public function setChangeBackMoney(?Money $value = null): self + { + $this->changeBackMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCategory.php b/src/Types/CatalogCategory.php new file mode 100644 index 00000000..2d3134d0 --- /dev/null +++ b/src/Types/CatalogCategory.php @@ -0,0 +1,314 @@ + $imageIds + */ + #[JsonProperty('image_ids'), ArrayType(['string'])] + private ?array $imageIds; + + /** + * The type of the category. + * See [CatalogCategoryType](#type-catalogcategorytype) for possible values + * + * @var ?value-of $categoryType + */ + #[JsonProperty('category_type')] + private ?string $categoryType; + + /** + * @var ?CatalogObjectCategory $parentCategory The ID of the parent category of this category instance. + */ + #[JsonProperty('parent_category')] + private ?CatalogObjectCategory $parentCategory; + + /** + * @var ?bool $isTopLevel Indicates whether a category is a top level category, which does not have any parent_category. + */ + #[JsonProperty('is_top_level')] + private ?bool $isTopLevel; + + /** + * @var ?array $channels A list of IDs representing channels, such as a Square Online site, where the category can be made visible. + */ + #[JsonProperty('channels'), ArrayType(['string'])] + private ?array $channels; + + /** + * @var ?array $availabilityPeriodIds The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. + */ + #[JsonProperty('availability_period_ids'), ArrayType(['string'])] + private ?array $availabilityPeriodIds; + + /** + * @var ?bool $onlineVisibility Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. + */ + #[JsonProperty('online_visibility')] + private ?bool $onlineVisibility; + + /** + * @var ?string $rootCategory The top-level category in a category hierarchy. + */ + #[JsonProperty('root_category')] + private ?string $rootCategory; + + /** + * @var ?CatalogEcomSeoData $ecomSeoData The SEO data for a seller's Square Online store. + */ + #[JsonProperty('ecom_seo_data')] + private ?CatalogEcomSeoData $ecomSeoData; + + /** + * The path from the category to its root category. The first node of the path is the parent of the category + * and the last is the root category. The path is empty if the category is a root category. + * + * @var ?array $pathToRoot + */ + #[JsonProperty('path_to_root'), ArrayType([CategoryPathToRootNode::class])] + private ?array $pathToRoot; + + /** + * @param array{ + * name?: ?string, + * imageIds?: ?array, + * categoryType?: ?value-of, + * parentCategory?: ?CatalogObjectCategory, + * isTopLevel?: ?bool, + * channels?: ?array, + * availabilityPeriodIds?: ?array, + * onlineVisibility?: ?bool, + * rootCategory?: ?string, + * ecomSeoData?: ?CatalogEcomSeoData, + * pathToRoot?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->imageIds = $values['imageIds'] ?? null; + $this->categoryType = $values['categoryType'] ?? null; + $this->parentCategory = $values['parentCategory'] ?? null; + $this->isTopLevel = $values['isTopLevel'] ?? null; + $this->channels = $values['channels'] ?? null; + $this->availabilityPeriodIds = $values['availabilityPeriodIds'] ?? null; + $this->onlineVisibility = $values['onlineVisibility'] ?? null; + $this->rootCategory = $values['rootCategory'] ?? null; + $this->ecomSeoData = $values['ecomSeoData'] ?? null; + $this->pathToRoot = $values['pathToRoot'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?array + */ + public function getImageIds(): ?array + { + return $this->imageIds; + } + + /** + * @param ?array $value + */ + public function setImageIds(?array $value = null): self + { + $this->imageIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCategoryType(): ?string + { + return $this->categoryType; + } + + /** + * @param ?value-of $value + */ + public function setCategoryType(?string $value = null): self + { + $this->categoryType = $value; + return $this; + } + + /** + * @return ?CatalogObjectCategory + */ + public function getParentCategory(): ?CatalogObjectCategory + { + return $this->parentCategory; + } + + /** + * @param ?CatalogObjectCategory $value + */ + public function setParentCategory(?CatalogObjectCategory $value = null): self + { + $this->parentCategory = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsTopLevel(): ?bool + { + return $this->isTopLevel; + } + + /** + * @param ?bool $value + */ + public function setIsTopLevel(?bool $value = null): self + { + $this->isTopLevel = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChannels(): ?array + { + return $this->channels; + } + + /** + * @param ?array $value + */ + public function setChannels(?array $value = null): self + { + $this->channels = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAvailabilityPeriodIds(): ?array + { + return $this->availabilityPeriodIds; + } + + /** + * @param ?array $value + */ + public function setAvailabilityPeriodIds(?array $value = null): self + { + $this->availabilityPeriodIds = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getOnlineVisibility(): ?bool + { + return $this->onlineVisibility; + } + + /** + * @param ?bool $value + */ + public function setOnlineVisibility(?bool $value = null): self + { + $this->onlineVisibility = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRootCategory(): ?string + { + return $this->rootCategory; + } + + /** + * @param ?string $value + */ + public function setRootCategory(?string $value = null): self + { + $this->rootCategory = $value; + return $this; + } + + /** + * @return ?CatalogEcomSeoData + */ + public function getEcomSeoData(): ?CatalogEcomSeoData + { + return $this->ecomSeoData; + } + + /** + * @param ?CatalogEcomSeoData $value + */ + public function setEcomSeoData(?CatalogEcomSeoData $value = null): self + { + $this->ecomSeoData = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPathToRoot(): ?array + { + return $this->pathToRoot; + } + + /** + * @param ?array $value + */ + public function setPathToRoot(?array $value = null): self + { + $this->pathToRoot = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCategoryType.php b/src/Types/CatalogCategoryType.php new file mode 100644 index 00000000..36453806 --- /dev/null +++ b/src/Types/CatalogCategoryType.php @@ -0,0 +1,10 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * The name of this definition for API and seller-facing UI purposes. + * The name must be unique within the (merchant, application) pair. Required. + * May not be empty and may not exceed 255 characters. Can be modified after creation. + * + * @var string $name + */ + #[JsonProperty('name')] + private string $name; + + /** + * Seller-oriented description of the meaning of this Custom Attribute, + * any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. + * + * @var ?string $description + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * __Read only.__ Contains information about the application that + * created this custom attribute definition. + * + * @var ?SourceApplication $sourceApplication + */ + #[JsonProperty('source_application')] + private ?SourceApplication $sourceApplication; + + /** + * The set of `CatalogObject` types that this custom atttribute may be applied to. + * Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included. + * See [CatalogObjectType](#type-catalogobjecttype) for possible values + * + * @var array> $allowedObjectTypes + */ + #[JsonProperty('allowed_object_types'), ArrayType(['string'])] + private array $allowedObjectTypes; + + /** + * The visibility of a custom attribute in seller-facing UIs (including Square Point + * of Sale applications and Square Dashboard). May be modified. + * See [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) for possible values + * + * @var ?value-of $sellerVisibility + */ + #[JsonProperty('seller_visibility')] + private ?string $sellerVisibility; + + /** + * The visibility of a custom attribute to applications other than the application + * that created the attribute. + * See [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) for possible values + * + * @var ?value-of $appVisibility + */ + #[JsonProperty('app_visibility')] + private ?string $appVisibility; + + /** + * @var ?CatalogCustomAttributeDefinitionStringConfig $stringConfig Optionally, populated when `type` = `STRING`, unset otherwise. + */ + #[JsonProperty('string_config')] + private ?CatalogCustomAttributeDefinitionStringConfig $stringConfig; + + /** + * @var ?CatalogCustomAttributeDefinitionNumberConfig $numberConfig Optionally, populated when `type` = `NUMBER`, unset otherwise. + */ + #[JsonProperty('number_config')] + private ?CatalogCustomAttributeDefinitionNumberConfig $numberConfig; + + /** + * @var ?CatalogCustomAttributeDefinitionSelectionConfig $selectionConfig Populated when `type` is set to `SELECTION`, unset otherwise. + */ + #[JsonProperty('selection_config')] + private ?CatalogCustomAttributeDefinitionSelectionConfig $selectionConfig; + + /** + * The number of custom attributes that reference this + * custom attribute definition. Set by the server in response to a ListCatalog + * request with `include_counts` set to `true`. If the actual count is greater + * than 100, `custom_attribute_usage_count` will be set to `100`. + * + * @var ?int $customAttributeUsageCount + */ + #[JsonProperty('custom_attribute_usage_count')] + private ?int $customAttributeUsageCount; + + /** + * The name of the desired custom attribute key that can be used to access + * the custom attribute value on catalog objects. Cannot be modified after the + * custom attribute definition has been created. + * Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`. + * + * @var ?string $key + */ + #[JsonProperty('key')] + private ?string $key; + + /** + * @param array{ + * type: value-of, + * name: string, + * allowedObjectTypes: array>, + * description?: ?string, + * sourceApplication?: ?SourceApplication, + * sellerVisibility?: ?value-of, + * appVisibility?: ?value-of, + * stringConfig?: ?CatalogCustomAttributeDefinitionStringConfig, + * numberConfig?: ?CatalogCustomAttributeDefinitionNumberConfig, + * selectionConfig?: ?CatalogCustomAttributeDefinitionSelectionConfig, + * customAttributeUsageCount?: ?int, + * key?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->name = $values['name']; + $this->description = $values['description'] ?? null; + $this->sourceApplication = $values['sourceApplication'] ?? null; + $this->allowedObjectTypes = $values['allowedObjectTypes']; + $this->sellerVisibility = $values['sellerVisibility'] ?? null; + $this->appVisibility = $values['appVisibility'] ?? null; + $this->stringConfig = $values['stringConfig'] ?? null; + $this->numberConfig = $values['numberConfig'] ?? null; + $this->selectionConfig = $values['selectionConfig'] ?? null; + $this->customAttributeUsageCount = $values['customAttributeUsageCount'] ?? null; + $this->key = $values['key'] ?? null; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?SourceApplication + */ + public function getSourceApplication(): ?SourceApplication + { + return $this->sourceApplication; + } + + /** + * @param ?SourceApplication $value + */ + public function setSourceApplication(?SourceApplication $value = null): self + { + $this->sourceApplication = $value; + return $this; + } + + /** + * @return array> + */ + public function getAllowedObjectTypes(): array + { + return $this->allowedObjectTypes; + } + + /** + * @param array> $value + */ + public function setAllowedObjectTypes(array $value): self + { + $this->allowedObjectTypes = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSellerVisibility(): ?string + { + return $this->sellerVisibility; + } + + /** + * @param ?value-of $value + */ + public function setSellerVisibility(?string $value = null): self + { + $this->sellerVisibility = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getAppVisibility(): ?string + { + return $this->appVisibility; + } + + /** + * @param ?value-of $value + */ + public function setAppVisibility(?string $value = null): self + { + $this->appVisibility = $value; + return $this; + } + + /** + * @return ?CatalogCustomAttributeDefinitionStringConfig + */ + public function getStringConfig(): ?CatalogCustomAttributeDefinitionStringConfig + { + return $this->stringConfig; + } + + /** + * @param ?CatalogCustomAttributeDefinitionStringConfig $value + */ + public function setStringConfig(?CatalogCustomAttributeDefinitionStringConfig $value = null): self + { + $this->stringConfig = $value; + return $this; + } + + /** + * @return ?CatalogCustomAttributeDefinitionNumberConfig + */ + public function getNumberConfig(): ?CatalogCustomAttributeDefinitionNumberConfig + { + return $this->numberConfig; + } + + /** + * @param ?CatalogCustomAttributeDefinitionNumberConfig $value + */ + public function setNumberConfig(?CatalogCustomAttributeDefinitionNumberConfig $value = null): self + { + $this->numberConfig = $value; + return $this; + } + + /** + * @return ?CatalogCustomAttributeDefinitionSelectionConfig + */ + public function getSelectionConfig(): ?CatalogCustomAttributeDefinitionSelectionConfig + { + return $this->selectionConfig; + } + + /** + * @param ?CatalogCustomAttributeDefinitionSelectionConfig $value + */ + public function setSelectionConfig(?CatalogCustomAttributeDefinitionSelectionConfig $value = null): self + { + $this->selectionConfig = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCustomAttributeUsageCount(): ?int + { + return $this->customAttributeUsageCount; + } + + /** + * @param ?int $value + */ + public function setCustomAttributeUsageCount(?int $value = null): self + { + $this->customAttributeUsageCount = $value; + return $this; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCustomAttributeDefinitionAppVisibility.php b/src/Types/CatalogCustomAttributeDefinitionAppVisibility.php new file mode 100644 index 00000000..83dcf422 --- /dev/null +++ b/src/Types/CatalogCustomAttributeDefinitionAppVisibility.php @@ -0,0 +1,10 @@ +precision = $values['precision'] ?? null; + } + + /** + * @return ?int + */ + public function getPrecision(): ?int + { + return $this->precision; + } + + /** + * @param ?int $value + */ + public function setPrecision(?int $value = null): self + { + $this->precision = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCustomAttributeDefinitionSelectionConfig.php b/src/Types/CatalogCustomAttributeDefinitionSelectionConfig.php new file mode 100644 index 00000000..983f7ae1 --- /dev/null +++ b/src/Types/CatalogCustomAttributeDefinitionSelectionConfig.php @@ -0,0 +1,88 @@ + $allowedSelections + */ + #[JsonProperty('allowed_selections'), ArrayType([CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection::class])] + private ?array $allowedSelections; + + /** + * @param array{ + * maxAllowedSelections?: ?int, + * allowedSelections?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->maxAllowedSelections = $values['maxAllowedSelections'] ?? null; + $this->allowedSelections = $values['allowedSelections'] ?? null; + } + + /** + * @return ?int + */ + public function getMaxAllowedSelections(): ?int + { + return $this->maxAllowedSelections; + } + + /** + * @param ?int $value + */ + public function setMaxAllowedSelections(?int $value = null): self + { + $this->maxAllowedSelections = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAllowedSelections(): ?array + { + return $this->allowedSelections; + } + + /** + * @param ?array $value + */ + public function setAllowedSelections(?array $value = null): self + { + $this->allowedSelections = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php b/src/Types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php new file mode 100644 index 00000000..5420e796 --- /dev/null +++ b/src/Types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.php @@ -0,0 +1,79 @@ +uid = $values['uid'] ?? null; + $this->name = $values['name']; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCustomAttributeDefinitionSellerVisibility.php b/src/Types/CatalogCustomAttributeDefinitionSellerVisibility.php new file mode 100644 index 00000000..e8d949b3 --- /dev/null +++ b/src/Types/CatalogCustomAttributeDefinitionSellerVisibility.php @@ -0,0 +1,9 @@ +enforceUniqueness = $values['enforceUniqueness'] ?? null; + } + + /** + * @return ?bool + */ + public function getEnforceUniqueness(): ?bool + { + return $this->enforceUniqueness; + } + + /** + * @param ?bool $value + */ + public function setEnforceUniqueness(?bool $value = null): self + { + $this->enforceUniqueness = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogCustomAttributeDefinitionType.php b/src/Types/CatalogCustomAttributeDefinitionType.php new file mode 100644 index 00000000..69639f7e --- /dev/null +++ b/src/Types/CatalogCustomAttributeDefinitionType.php @@ -0,0 +1,11 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * Populated if `type` = `NUMBER`. Contains a string + * representation of a decimal number, using a `.` as the decimal separator. + * + * @var ?string $numberValue + */ + #[JsonProperty('number_value')] + private ?string $numberValue; + + /** + * @var ?bool $booleanValue A `true` or `false` value. Populated if `type` = `BOOLEAN`. + */ + #[JsonProperty('boolean_value')] + private ?bool $booleanValue; + + /** + * @var ?array $selectionUidValues One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. + */ + #[JsonProperty('selection_uid_values'), ArrayType(['string'])] + private ?array $selectionUidValues; + + /** + * If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this key is prefixed by the defining application ID. + * For example, if the CatalogCustomAttributeDefinition has a key attribute of "cocoa_brand" and the defining application ID is "abcd1234", this key is "abcd1234:cocoa_brand" + * when the application making the request is different from the application defining the custom attribute definition. Otherwise, the key is simply "cocoa_brand". + * + * @var ?string $key + */ + #[JsonProperty('key')] + private ?string $key; + + /** + * @param array{ + * name?: ?string, + * stringValue?: ?string, + * customAttributeDefinitionId?: ?string, + * type?: ?value-of, + * numberValue?: ?string, + * booleanValue?: ?bool, + * selectionUidValues?: ?array, + * key?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->stringValue = $values['stringValue'] ?? null; + $this->customAttributeDefinitionId = $values['customAttributeDefinitionId'] ?? null; + $this->type = $values['type'] ?? null; + $this->numberValue = $values['numberValue'] ?? null; + $this->booleanValue = $values['booleanValue'] ?? null; + $this->selectionUidValues = $values['selectionUidValues'] ?? null; + $this->key = $values['key'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStringValue(): ?string + { + return $this->stringValue; + } + + /** + * @param ?string $value + */ + public function setStringValue(?string $value = null): self + { + $this->stringValue = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomAttributeDefinitionId(): ?string + { + return $this->customAttributeDefinitionId; + } + + /** + * @param ?string $value + */ + public function setCustomAttributeDefinitionId(?string $value = null): self + { + $this->customAttributeDefinitionId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNumberValue(): ?string + { + return $this->numberValue; + } + + /** + * @param ?string $value + */ + public function setNumberValue(?string $value = null): self + { + $this->numberValue = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBooleanValue(): ?bool + { + return $this->booleanValue; + } + + /** + * @param ?bool $value + */ + public function setBooleanValue(?bool $value = null): self + { + $this->booleanValue = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSelectionUidValues(): ?array + { + return $this->selectionUidValues; + } + + /** + * @param ?array $value + */ + public function setSelectionUidValues(?array $value = null): self + { + $this->selectionUidValues = $value; + return $this; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogDiscount.php b/src/Types/CatalogDiscount.php new file mode 100644 index 00000000..ff40ad7e --- /dev/null +++ b/src/Types/CatalogDiscount.php @@ -0,0 +1,261 @@ + $discountType + */ + #[JsonProperty('discount_type')] + private ?string $discountType; + + /** + * The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal + * separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type` + * is `VARIABLE_PERCENTAGE`. + * + * Do not use this field for amount-based or variable discounts. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * The amount of the discount. Specify an amount of `0` if `discount_type` is `VARIABLE_AMOUNT`. + * + * Do not use this field for percentage-based or variable discounts. + * + * @var ?Money $amountMoney + */ + #[JsonProperty('amount_money')] + private ?Money $amountMoney; + + /** + * Indicates whether a mobile staff member needs to enter their PIN to apply the + * discount to a payment in the Square Point of Sale app. + * + * @var ?bool $pinRequired + */ + #[JsonProperty('pin_required')] + private ?bool $pinRequired; + + /** + * @var ?string $labelColor The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code. + */ + #[JsonProperty('label_color')] + private ?string $labelColor; + + /** + * Indicates whether this discount should reduce the price used to calculate tax. + * + * Most discounts should use `MODIFY_TAX_BASIS`. However, in some circumstances taxes must + * be calculated based on an item's price, ignoring a particular discount. For example, + * in many US jurisdictions, a manufacturer coupon or instant rebate reduces the price a + * customer pays but does not reduce the sale price used to calculate how much sales tax is + * due. In this case, the discount representing that manufacturer coupon should have + * `DO_NOT_MODIFY_TAX_BASIS` for this field. + * + * If you are unsure whether you need to use this field, consult your tax professional. + * See [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) for possible values + * + * @var ?value-of $modifyTaxBasis + */ + #[JsonProperty('modify_tax_basis')] + private ?string $modifyTaxBasis; + + /** + * For a percentage discount, the maximum absolute value of the discount. For example, if a + * 50% discount has a `maximum_amount_money` of $20, a $100 purchase will yield a $20 discount, + * not a $50 discount. + * + * @var ?Money $maximumAmountMoney + */ + #[JsonProperty('maximum_amount_money')] + private ?Money $maximumAmountMoney; + + /** + * @param array{ + * name?: ?string, + * discountType?: ?value-of, + * percentage?: ?string, + * amountMoney?: ?Money, + * pinRequired?: ?bool, + * labelColor?: ?string, + * modifyTaxBasis?: ?value-of, + * maximumAmountMoney?: ?Money, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->discountType = $values['discountType'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->pinRequired = $values['pinRequired'] ?? null; + $this->labelColor = $values['labelColor'] ?? null; + $this->modifyTaxBasis = $values['modifyTaxBasis'] ?? null; + $this->maximumAmountMoney = $values['maximumAmountMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getDiscountType(): ?string + { + return $this->discountType; + } + + /** + * @param ?value-of $value + */ + public function setDiscountType(?string $value = null): self + { + $this->discountType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPinRequired(): ?bool + { + return $this->pinRequired; + } + + /** + * @param ?bool $value + */ + public function setPinRequired(?bool $value = null): self + { + $this->pinRequired = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLabelColor(): ?string + { + return $this->labelColor; + } + + /** + * @param ?string $value + */ + public function setLabelColor(?string $value = null): self + { + $this->labelColor = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getModifyTaxBasis(): ?string + { + return $this->modifyTaxBasis; + } + + /** + * @param ?value-of $value + */ + public function setModifyTaxBasis(?string $value = null): self + { + $this->modifyTaxBasis = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getMaximumAmountMoney(): ?Money + { + return $this->maximumAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setMaximumAmountMoney(?Money $value = null): self + { + $this->maximumAmountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogDiscountModifyTaxBasis.php b/src/Types/CatalogDiscountModifyTaxBasis.php new file mode 100644 index 00000000..e724da0d --- /dev/null +++ b/src/Types/CatalogDiscountModifyTaxBasis.php @@ -0,0 +1,9 @@ +pageTitle = $values['pageTitle'] ?? null; + $this->pageDescription = $values['pageDescription'] ?? null; + $this->permalink = $values['permalink'] ?? null; + } + + /** + * @return ?string + */ + public function getPageTitle(): ?string + { + return $this->pageTitle; + } + + /** + * @param ?string $value + */ + public function setPageTitle(?string $value = null): self + { + $this->pageTitle = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPageDescription(): ?string + { + return $this->pageDescription; + } + + /** + * @param ?string $value + */ + public function setPageDescription(?string $value = null): self + { + $this->pageDescription = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPermalink(): ?string + { + return $this->permalink; + } + + /** + * @param ?string $value + */ + public function setPermalink(?string $value = null): self + { + $this->permalink = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogIdMapping.php b/src/Types/CatalogIdMapping.php new file mode 100644 index 00000000..fd11540e --- /dev/null +++ b/src/Types/CatalogIdMapping.php @@ -0,0 +1,89 @@ +clientObjectId = $values['clientObjectId'] ?? null; + $this->objectId = $values['objectId'] ?? null; + } + + /** + * @return ?string + */ + public function getClientObjectId(): ?string + { + return $this->clientObjectId; + } + + /** + * @param ?string $value + */ + public function setClientObjectId(?string $value = null): self + { + $this->clientObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getObjectId(): ?string + { + return $this->objectId; + } + + /** + * @param ?string $value + */ + public function setObjectId(?string $value = null): self + { + $this->objectId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogImage.php b/src/Types/CatalogImage.php new file mode 100644 index 00000000..bcde44ee --- /dev/null +++ b/src/Types/CatalogImage.php @@ -0,0 +1,147 @@ +name = $values['name'] ?? null; + $this->url = $values['url'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->photoStudioOrderId = $values['photoStudioOrderId'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUrl(): ?string + { + return $this->url; + } + + /** + * @param ?string $value + */ + public function setUrl(?string $value = null): self + { + $this->url = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param ?string $value + */ + public function setCaption(?string $value = null): self + { + $this->caption = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhotoStudioOrderId(): ?string + { + return $this->photoStudioOrderId; + } + + /** + * @param ?string $value + */ + public function setPhotoStudioOrderId(?string $value = null): self + { + $this->photoStudioOrderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogInfoResponse.php b/src/Types/CatalogInfoResponse.php new file mode 100644 index 00000000..3d7ac874 --- /dev/null +++ b/src/Types/CatalogInfoResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CatalogInfoResponseLimits $limits Limits that apply to this API. + */ + #[JsonProperty('limits')] + private ?CatalogInfoResponseLimits $limits; + + /** + * @var ?StandardUnitDescriptionGroup $standardUnitDescriptionGroup Names and abbreviations for standard units. + */ + #[JsonProperty('standard_unit_description_group')] + private ?StandardUnitDescriptionGroup $standardUnitDescriptionGroup; + + /** + * @param array{ + * errors?: ?array, + * limits?: ?CatalogInfoResponseLimits, + * standardUnitDescriptionGroup?: ?StandardUnitDescriptionGroup, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->limits = $values['limits'] ?? null; + $this->standardUnitDescriptionGroup = $values['standardUnitDescriptionGroup'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CatalogInfoResponseLimits + */ + public function getLimits(): ?CatalogInfoResponseLimits + { + return $this->limits; + } + + /** + * @param ?CatalogInfoResponseLimits $value + */ + public function setLimits(?CatalogInfoResponseLimits $value = null): self + { + $this->limits = $value; + return $this; + } + + /** + * @return ?StandardUnitDescriptionGroup + */ + public function getStandardUnitDescriptionGroup(): ?StandardUnitDescriptionGroup + { + return $this->standardUnitDescriptionGroup; + } + + /** + * @param ?StandardUnitDescriptionGroup $value + */ + public function setStandardUnitDescriptionGroup(?StandardUnitDescriptionGroup $value = null): self + { + $this->standardUnitDescriptionGroup = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogInfoResponseLimits.php b/src/Types/CatalogInfoResponseLimits.php new file mode 100644 index 00000000..43ff0759 --- /dev/null +++ b/src/Types/CatalogInfoResponseLimits.php @@ -0,0 +1,334 @@ +batchUpsertMaxObjectsPerBatch = $values['batchUpsertMaxObjectsPerBatch'] ?? null; + $this->batchUpsertMaxTotalObjects = $values['batchUpsertMaxTotalObjects'] ?? null; + $this->batchRetrieveMaxObjectIds = $values['batchRetrieveMaxObjectIds'] ?? null; + $this->searchMaxPageLimit = $values['searchMaxPageLimit'] ?? null; + $this->batchDeleteMaxObjectIds = $values['batchDeleteMaxObjectIds'] ?? null; + $this->updateItemTaxesMaxItemIds = $values['updateItemTaxesMaxItemIds'] ?? null; + $this->updateItemTaxesMaxTaxesToEnable = $values['updateItemTaxesMaxTaxesToEnable'] ?? null; + $this->updateItemTaxesMaxTaxesToDisable = $values['updateItemTaxesMaxTaxesToDisable'] ?? null; + $this->updateItemModifierListsMaxItemIds = $values['updateItemModifierListsMaxItemIds'] ?? null; + $this->updateItemModifierListsMaxModifierListsToEnable = $values['updateItemModifierListsMaxModifierListsToEnable'] ?? null; + $this->updateItemModifierListsMaxModifierListsToDisable = $values['updateItemModifierListsMaxModifierListsToDisable'] ?? null; + } + + /** + * @return ?int + */ + public function getBatchUpsertMaxObjectsPerBatch(): ?int + { + return $this->batchUpsertMaxObjectsPerBatch; + } + + /** + * @param ?int $value + */ + public function setBatchUpsertMaxObjectsPerBatch(?int $value = null): self + { + $this->batchUpsertMaxObjectsPerBatch = $value; + return $this; + } + + /** + * @return ?int + */ + public function getBatchUpsertMaxTotalObjects(): ?int + { + return $this->batchUpsertMaxTotalObjects; + } + + /** + * @param ?int $value + */ + public function setBatchUpsertMaxTotalObjects(?int $value = null): self + { + $this->batchUpsertMaxTotalObjects = $value; + return $this; + } + + /** + * @return ?int + */ + public function getBatchRetrieveMaxObjectIds(): ?int + { + return $this->batchRetrieveMaxObjectIds; + } + + /** + * @param ?int $value + */ + public function setBatchRetrieveMaxObjectIds(?int $value = null): self + { + $this->batchRetrieveMaxObjectIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getSearchMaxPageLimit(): ?int + { + return $this->searchMaxPageLimit; + } + + /** + * @param ?int $value + */ + public function setSearchMaxPageLimit(?int $value = null): self + { + $this->searchMaxPageLimit = $value; + return $this; + } + + /** + * @return ?int + */ + public function getBatchDeleteMaxObjectIds(): ?int + { + return $this->batchDeleteMaxObjectIds; + } + + /** + * @param ?int $value + */ + public function setBatchDeleteMaxObjectIds(?int $value = null): self + { + $this->batchDeleteMaxObjectIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemTaxesMaxItemIds(): ?int + { + return $this->updateItemTaxesMaxItemIds; + } + + /** + * @param ?int $value + */ + public function setUpdateItemTaxesMaxItemIds(?int $value = null): self + { + $this->updateItemTaxesMaxItemIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemTaxesMaxTaxesToEnable(): ?int + { + return $this->updateItemTaxesMaxTaxesToEnable; + } + + /** + * @param ?int $value + */ + public function setUpdateItemTaxesMaxTaxesToEnable(?int $value = null): self + { + $this->updateItemTaxesMaxTaxesToEnable = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemTaxesMaxTaxesToDisable(): ?int + { + return $this->updateItemTaxesMaxTaxesToDisable; + } + + /** + * @param ?int $value + */ + public function setUpdateItemTaxesMaxTaxesToDisable(?int $value = null): self + { + $this->updateItemTaxesMaxTaxesToDisable = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemModifierListsMaxItemIds(): ?int + { + return $this->updateItemModifierListsMaxItemIds; + } + + /** + * @param ?int $value + */ + public function setUpdateItemModifierListsMaxItemIds(?int $value = null): self + { + $this->updateItemModifierListsMaxItemIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemModifierListsMaxModifierListsToEnable(): ?int + { + return $this->updateItemModifierListsMaxModifierListsToEnable; + } + + /** + * @param ?int $value + */ + public function setUpdateItemModifierListsMaxModifierListsToEnable(?int $value = null): self + { + $this->updateItemModifierListsMaxModifierListsToEnable = $value; + return $this; + } + + /** + * @return ?int + */ + public function getUpdateItemModifierListsMaxModifierListsToDisable(): ?int + { + return $this->updateItemModifierListsMaxModifierListsToDisable; + } + + /** + * @param ?int $value + */ + public function setUpdateItemModifierListsMaxModifierListsToDisable(?int $value = null): self + { + $this->updateItemModifierListsMaxModifierListsToDisable = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItem.php b/src/Types/CatalogItem.php new file mode 100644 index 00000000..44d63d5d --- /dev/null +++ b/src/Types/CatalogItem.php @@ -0,0 +1,660 @@ + $taxIds + */ + #[JsonProperty('tax_ids'), ArrayType(['string'])] + private ?array $taxIds; + + /** + * A set of `CatalogItemModifierListInfo` objects + * representing the modifier lists that apply to this item, along with the overrides and min + * and max limits that are specific to this item. Modifier lists + * may also be added to or deleted from an item using `UpdateItemModifierLists`. + * + * @var ?array $modifierListInfo + */ + #[JsonProperty('modifier_list_info'), ArrayType([CatalogItemModifierListInfo::class])] + private ?array $modifierListInfo; + + /** + * A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have + * at least one variation. + * + * @var ?array $variations + */ + #[JsonProperty('variations'), ArrayType([CatalogObject::class])] + private ?array $variations; + + /** + * The product type of the item. Once set, the `product_type` value cannot be modified. + * + * Items of the `LEGACY_SQUARE_ONLINE_SERVICE` and `LEGACY_SQUARE_ONLINE_MEMBERSHIP` product types can be updated + * but cannot be created using the API. + * See [CatalogItemProductType](#type-catalogitemproducttype) for possible values + * + * @var ?value-of $productType + */ + #[JsonProperty('product_type')] + private ?string $productType; + + /** + * If `false`, the Square Point of Sale app will present the `CatalogItem`'s + * details screen immediately, allowing the merchant to choose `CatalogModifier`s + * before adding the item to the cart. This is the default behavior. + * + * If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected + * modifiers, and merchants can edit modifiers by drilling down onto the item's details. + * + * Third-party clients are encouraged to implement similar behaviors. + * + * @var ?bool $skipModifierScreen + */ + #[JsonProperty('skip_modifier_screen')] + private ?bool $skipModifierScreen; + + /** + * List of item options IDs for this item. Used to manage and group item + * variations in a specified order. + * + * Maximum: 6 item options. + * + * @var ?array $itemOptions + */ + #[JsonProperty('item_options'), ArrayType([CatalogItemOptionForItem::class])] + private ?array $itemOptions; + + /** + * The IDs of images associated with this `CatalogItem` instance. + * These images will be shown to customers in Square Online Store. + * The first image will show up as the icon for this item in POS. + * + * @var ?array $imageIds + */ + #[JsonProperty('image_ids'), ArrayType(['string'])] + private ?array $imageIds; + + /** + * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting. + * Its value must not be empty. + * + * It is currently supported for sellers of the Japanese locale only. + * + * @var ?string $sortName + */ + #[JsonProperty('sort_name')] + private ?string $sortName; + + /** + * @var ?array $categories The list of categories. + */ + #[JsonProperty('categories'), ArrayType([CatalogObjectCategory::class])] + private ?array $categories; + + /** + * The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags, + * is of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or + * unsupported HTML elements or attributes are ignored. + * + * Supported HTML elements include: + * - `a`: Link. Supports linking to website URLs, email address, and telephone numbers. + * - `b`, `strong`: Bold text + * - `br`: Line break + * - `code`: Computer code + * - `div`: Section + * - `h1-h6`: Headings + * - `i`, `em`: Italics + * - `li`: List element + * - `ol`: Numbered list + * - `p`: Paragraph + * - `ul`: Bullet list + * - `u`: Underline + * + * + * Supported HTML attributes include: + * - `align`: Alignment of the text content + * - `href`: Link destination + * - `rel`: Relationship between link's target and source + * - `target`: Place to open the linked document + * + * @var ?string $descriptionHtml + */ + #[JsonProperty('description_html')] + private ?string $descriptionHtml; + + /** + * @var ?string $descriptionPlaintext A server-generated plaintext version of the `description_html` field, without formatting tags. + */ + #[JsonProperty('description_plaintext')] + private ?string $descriptionPlaintext; + + /** + * A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. + * This field is read only and cannot be edited. + * + * @var ?array $channels + */ + #[JsonProperty('channels'), ArrayType(['string'])] + private ?array $channels; + + /** + * @var ?bool $isArchived Indicates whether this item is archived (`true`) or not (`false`). + */ + #[JsonProperty('is_archived')] + private ?bool $isArchived; + + /** + * @var ?CatalogEcomSeoData $ecomSeoData The SEO data for a seller's Square Online store. + */ + #[JsonProperty('ecom_seo_data')] + private ?CatalogEcomSeoData $ecomSeoData; + + /** + * @var ?CatalogItemFoodAndBeverageDetails $foodAndBeverageDetails The food and beverage-specific details for the `FOOD_AND_BEV` item. + */ + #[JsonProperty('food_and_beverage_details')] + private ?CatalogItemFoodAndBeverageDetails $foodAndBeverageDetails; + + /** + * @var ?CatalogObjectCategory $reportingCategory The item's reporting category. + */ + #[JsonProperty('reporting_category')] + private ?CatalogObjectCategory $reportingCategory; + + /** + * @param array{ + * name?: ?string, + * description?: ?string, + * abbreviation?: ?string, + * labelColor?: ?string, + * isTaxable?: ?bool, + * categoryId?: ?string, + * taxIds?: ?array, + * modifierListInfo?: ?array, + * variations?: ?array, + * productType?: ?value-of, + * skipModifierScreen?: ?bool, + * itemOptions?: ?array, + * imageIds?: ?array, + * sortName?: ?string, + * categories?: ?array, + * descriptionHtml?: ?string, + * descriptionPlaintext?: ?string, + * channels?: ?array, + * isArchived?: ?bool, + * ecomSeoData?: ?CatalogEcomSeoData, + * foodAndBeverageDetails?: ?CatalogItemFoodAndBeverageDetails, + * reportingCategory?: ?CatalogObjectCategory, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->description = $values['description'] ?? null; + $this->abbreviation = $values['abbreviation'] ?? null; + $this->labelColor = $values['labelColor'] ?? null; + $this->isTaxable = $values['isTaxable'] ?? null; + $this->categoryId = $values['categoryId'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + $this->modifierListInfo = $values['modifierListInfo'] ?? null; + $this->variations = $values['variations'] ?? null; + $this->productType = $values['productType'] ?? null; + $this->skipModifierScreen = $values['skipModifierScreen'] ?? null; + $this->itemOptions = $values['itemOptions'] ?? null; + $this->imageIds = $values['imageIds'] ?? null; + $this->sortName = $values['sortName'] ?? null; + $this->categories = $values['categories'] ?? null; + $this->descriptionHtml = $values['descriptionHtml'] ?? null; + $this->descriptionPlaintext = $values['descriptionPlaintext'] ?? null; + $this->channels = $values['channels'] ?? null; + $this->isArchived = $values['isArchived'] ?? null; + $this->ecomSeoData = $values['ecomSeoData'] ?? null; + $this->foodAndBeverageDetails = $values['foodAndBeverageDetails'] ?? null; + $this->reportingCategory = $values['reportingCategory'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAbbreviation(): ?string + { + return $this->abbreviation; + } + + /** + * @param ?string $value + */ + public function setAbbreviation(?string $value = null): self + { + $this->abbreviation = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLabelColor(): ?string + { + return $this->labelColor; + } + + /** + * @param ?string $value + */ + public function setLabelColor(?string $value = null): self + { + $this->labelColor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsTaxable(): ?bool + { + return $this->isTaxable; + } + + /** + * @param ?bool $value + */ + public function setIsTaxable(?bool $value = null): self + { + $this->isTaxable = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCategoryId(): ?string + { + return $this->categoryId; + } + + /** + * @param ?string $value + */ + public function setCategoryId(?string $value = null): self + { + $this->categoryId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTaxIds(): ?array + { + return $this->taxIds; + } + + /** + * @param ?array $value + */ + public function setTaxIds(?array $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifierListInfo(): ?array + { + return $this->modifierListInfo; + } + + /** + * @param ?array $value + */ + public function setModifierListInfo(?array $value = null): self + { + $this->modifierListInfo = $value; + return $this; + } + + /** + * @return ?array + */ + public function getVariations(): ?array + { + return $this->variations; + } + + /** + * @param ?array $value + */ + public function setVariations(?array $value = null): self + { + $this->variations = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getProductType(): ?string + { + return $this->productType; + } + + /** + * @param ?value-of $value + */ + public function setProductType(?string $value = null): self + { + $this->productType = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSkipModifierScreen(): ?bool + { + return $this->skipModifierScreen; + } + + /** + * @param ?bool $value + */ + public function setSkipModifierScreen(?bool $value = null): self + { + $this->skipModifierScreen = $value; + return $this; + } + + /** + * @return ?array + */ + public function getItemOptions(): ?array + { + return $this->itemOptions; + } + + /** + * @param ?array $value + */ + public function setItemOptions(?array $value = null): self + { + $this->itemOptions = $value; + return $this; + } + + /** + * @return ?array + */ + public function getImageIds(): ?array + { + return $this->imageIds; + } + + /** + * @param ?array $value + */ + public function setImageIds(?array $value = null): self + { + $this->imageIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSortName(): ?string + { + return $this->sortName; + } + + /** + * @param ?string $value + */ + public function setSortName(?string $value = null): self + { + $this->sortName = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCategories(): ?array + { + return $this->categories; + } + + /** + * @param ?array $value + */ + public function setCategories(?array $value = null): self + { + $this->categories = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescriptionHtml(): ?string + { + return $this->descriptionHtml; + } + + /** + * @param ?string $value + */ + public function setDescriptionHtml(?string $value = null): self + { + $this->descriptionHtml = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescriptionPlaintext(): ?string + { + return $this->descriptionPlaintext; + } + + /** + * @param ?string $value + */ + public function setDescriptionPlaintext(?string $value = null): self + { + $this->descriptionPlaintext = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChannels(): ?array + { + return $this->channels; + } + + /** + * @param ?array $value + */ + public function setChannels(?array $value = null): self + { + $this->channels = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsArchived(): ?bool + { + return $this->isArchived; + } + + /** + * @param ?bool $value + */ + public function setIsArchived(?bool $value = null): self + { + $this->isArchived = $value; + return $this; + } + + /** + * @return ?CatalogEcomSeoData + */ + public function getEcomSeoData(): ?CatalogEcomSeoData + { + return $this->ecomSeoData; + } + + /** + * @param ?CatalogEcomSeoData $value + */ + public function setEcomSeoData(?CatalogEcomSeoData $value = null): self + { + $this->ecomSeoData = $value; + return $this; + } + + /** + * @return ?CatalogItemFoodAndBeverageDetails + */ + public function getFoodAndBeverageDetails(): ?CatalogItemFoodAndBeverageDetails + { + return $this->foodAndBeverageDetails; + } + + /** + * @param ?CatalogItemFoodAndBeverageDetails $value + */ + public function setFoodAndBeverageDetails(?CatalogItemFoodAndBeverageDetails $value = null): self + { + $this->foodAndBeverageDetails = $value; + return $this; + } + + /** + * @return ?CatalogObjectCategory + */ + public function getReportingCategory(): ?CatalogObjectCategory + { + return $this->reportingCategory; + } + + /** + * @param ?CatalogObjectCategory $value + */ + public function setReportingCategory(?CatalogObjectCategory $value = null): self + { + $this->reportingCategory = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemFoodAndBeverageDetails.php b/src/Types/CatalogItemFoodAndBeverageDetails.php new file mode 100644 index 00000000..f052ffe3 --- /dev/null +++ b/src/Types/CatalogItemFoodAndBeverageDetails.php @@ -0,0 +1,105 @@ + $dietaryPreferences The dietary preferences for the `FOOD_AND_BEV` item. + */ + #[JsonProperty('dietary_preferences'), ArrayType([CatalogItemFoodAndBeverageDetailsDietaryPreference::class])] + private ?array $dietaryPreferences; + + /** + * @var ?array $ingredients The ingredients for the `FOOD_AND_BEV` type item. + */ + #[JsonProperty('ingredients'), ArrayType([CatalogItemFoodAndBeverageDetailsIngredient::class])] + private ?array $ingredients; + + /** + * @param array{ + * calorieCount?: ?int, + * dietaryPreferences?: ?array, + * ingredients?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->calorieCount = $values['calorieCount'] ?? null; + $this->dietaryPreferences = $values['dietaryPreferences'] ?? null; + $this->ingredients = $values['ingredients'] ?? null; + } + + /** + * @return ?int + */ + public function getCalorieCount(): ?int + { + return $this->calorieCount; + } + + /** + * @param ?int $value + */ + public function setCalorieCount(?int $value = null): self + { + $this->calorieCount = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDietaryPreferences(): ?array + { + return $this->dietaryPreferences; + } + + /** + * @param ?array $value + */ + public function setDietaryPreferences(?array $value = null): self + { + $this->dietaryPreferences = $value; + return $this; + } + + /** + * @return ?array + */ + public function getIngredients(): ?array + { + return $this->ingredients; + } + + /** + * @param ?array $value + */ + public function setIngredients(?array $value = null): self + { + $this->ingredients = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreference.php b/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreference.php new file mode 100644 index 00000000..6479e104 --- /dev/null +++ b/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreference.php @@ -0,0 +1,110 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The name of the dietary preference from a standard pre-defined list. This should be null if it's a custom dietary preference. + * See [StandardDietaryPreference](#type-standarddietarypreference) for possible values + * + * @var ?value-of $standardName + */ + #[JsonProperty('standard_name')] + private ?string $standardName; + + /** + * @var ?string $customName The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference. + */ + #[JsonProperty('custom_name')] + private ?string $customName; + + /** + * @param array{ + * type?: ?value-of, + * standardName?: ?value-of, + * customName?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->standardName = $values['standardName'] ?? null; + $this->customName = $values['customName'] ?? null; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStandardName(): ?string + { + return $this->standardName; + } + + /** + * @param ?value-of $value + */ + public function setStandardName(?string $value = null): self + { + $this->standardName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomName(): ?string + { + return $this->customName; + } + + /** + * @param ?string $value + */ + public function setCustomName(?string $value = null): self + { + $this->customName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php b/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php new file mode 100644 index 00000000..f99946a8 --- /dev/null +++ b/src/Types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.php @@ -0,0 +1,14 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The name of the ingredient from a standard pre-defined list. This should be null if it's a custom dietary preference. + * See [StandardIngredient](#type-standardingredient) for possible values + * + * @var ?value-of $standardName + */ + #[JsonProperty('standard_name')] + private ?string $standardName; + + /** + * @var ?string $customName The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference. + */ + #[JsonProperty('custom_name')] + private ?string $customName; + + /** + * @param array{ + * type?: ?value-of, + * standardName?: ?value-of, + * customName?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->standardName = $values['standardName'] ?? null; + $this->customName = $values['customName'] ?? null; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStandardName(): ?string + { + return $this->standardName; + } + + /** + * @param ?value-of $value + */ + public function setStandardName(?string $value = null): self + { + $this->standardName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomName(): ?string + { + return $this->customName; + } + + /** + * @param ?string $value + */ + public function setCustomName(?string $value = null): self + { + $this->customName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php b/src/Types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php new file mode 100644 index 00000000..cd113f46 --- /dev/null +++ b/src/Types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.php @@ -0,0 +1,21 @@ + $modifierOverrides A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. + */ + #[JsonProperty('modifier_overrides'), ArrayType([CatalogModifierOverride::class])] + private ?array $modifierOverrides; + + /** + * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. + * The default value is `-1`. + * + * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of + * the `CatalogModifierList` can be selected from the `CatalogModifierList`. + * + * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in + * and can be selected from the `CatalogModifierList` + * + * @var ?int $minSelectedModifiers + */ + #[JsonProperty('min_selected_modifiers')] + private ?int $minSelectedModifiers; + + /** + * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. + * The default value is `-1`. + * + * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of + * the `CatalogModifierList` can be selected from the `CatalogModifierList`. + * + * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in + * and can be selected from the `CatalogModifierList` + * + * @var ?int $maxSelectedModifiers + */ + #[JsonProperty('max_selected_modifiers')] + private ?int $maxSelectedModifiers; + + /** + * @var ?bool $enabled If `true`, enable this `CatalogModifierList`. The default value is `true`. + */ + #[JsonProperty('enabled')] + private ?bool $enabled; + + /** + * The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied + * to a `CatalogItem` instance. + * + * @var ?int $ordinal + */ + #[JsonProperty('ordinal')] + private ?int $ordinal; + + /** + * @param array{ + * modifierListId: string, + * modifierOverrides?: ?array, + * minSelectedModifiers?: ?int, + * maxSelectedModifiers?: ?int, + * enabled?: ?bool, + * ordinal?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->modifierListId = $values['modifierListId']; + $this->modifierOverrides = $values['modifierOverrides'] ?? null; + $this->minSelectedModifiers = $values['minSelectedModifiers'] ?? null; + $this->maxSelectedModifiers = $values['maxSelectedModifiers'] ?? null; + $this->enabled = $values['enabled'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + } + + /** + * @return string + */ + public function getModifierListId(): string + { + return $this->modifierListId; + } + + /** + * @param string $value + */ + public function setModifierListId(string $value): self + { + $this->modifierListId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifierOverrides(): ?array + { + return $this->modifierOverrides; + } + + /** + * @param ?array $value + */ + public function setModifierOverrides(?array $value = null): self + { + $this->modifierOverrides = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMinSelectedModifiers(): ?int + { + return $this->minSelectedModifiers; + } + + /** + * @param ?int $value + */ + public function setMinSelectedModifiers(?int $value = null): self + { + $this->minSelectedModifiers = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMaxSelectedModifiers(): ?int + { + return $this->maxSelectedModifiers; + } + + /** + * @param ?int $value + */ + public function setMaxSelectedModifiers(?int $value = null): self + { + $this->maxSelectedModifiers = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemOption.php b/src/Types/CatalogItemOption.php new file mode 100644 index 00000000..20a33b86 --- /dev/null +++ b/src/Types/CatalogItemOption.php @@ -0,0 +1,165 @@ + $values + */ + #[JsonProperty('values'), ArrayType([CatalogObject::class])] + private ?array $values; + + /** + * @param array{ + * name?: ?string, + * displayName?: ?string, + * description?: ?string, + * showColors?: ?bool, + * values?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->displayName = $values['displayName'] ?? null; + $this->description = $values['description'] ?? null; + $this->showColors = $values['showColors'] ?? null; + $this->values = $values['values'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisplayName(): ?string + { + return $this->displayName; + } + + /** + * @param ?string $value + */ + public function setDisplayName(?string $value = null): self + { + $this->displayName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getShowColors(): ?bool + { + return $this->showColors; + } + + /** + * @param ?bool $value + */ + public function setShowColors(?bool $value = null): self + { + $this->showColors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemOptionForItem.php b/src/Types/CatalogItemOptionForItem.php new file mode 100644 index 00000000..8f69d758 --- /dev/null +++ b/src/Types/CatalogItemOptionForItem.php @@ -0,0 +1,55 @@ +itemOptionId = $values['itemOptionId'] ?? null; + } + + /** + * @return ?string + */ + public function getItemOptionId(): ?string + { + return $this->itemOptionId; + } + + /** + * @param ?string $value + */ + public function setItemOptionId(?string $value = null): self + { + $this->itemOptionId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemOptionValue.php b/src/Types/CatalogItemOptionValue.php new file mode 100644 index 00000000..d99bb97d --- /dev/null +++ b/src/Types/CatalogItemOptionValue.php @@ -0,0 +1,161 @@ +itemOptionId = $values['itemOptionId'] ?? null; + $this->name = $values['name'] ?? null; + $this->description = $values['description'] ?? null; + $this->color = $values['color'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + } + + /** + * @return ?string + */ + public function getItemOptionId(): ?string + { + return $this->itemOptionId; + } + + /** + * @param ?string $value + */ + public function setItemOptionId(?string $value = null): self + { + $this->itemOptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getColor(): ?string + { + return $this->color; + } + + /** + * @param ?string $value + */ + public function setColor(?string $value = null): self + { + $this->color = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemOptionValueForItemVariation.php b/src/Types/CatalogItemOptionValueForItemVariation.php new file mode 100644 index 00000000..cb4affc9 --- /dev/null +++ b/src/Types/CatalogItemOptionValueForItemVariation.php @@ -0,0 +1,82 @@ +itemOptionId = $values['itemOptionId'] ?? null; + $this->itemOptionValueId = $values['itemOptionValueId'] ?? null; + } + + /** + * @return ?string + */ + public function getItemOptionId(): ?string + { + return $this->itemOptionId; + } + + /** + * @param ?string $value + */ + public function setItemOptionId(?string $value = null): self + { + $this->itemOptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getItemOptionValueId(): ?string + { + return $this->itemOptionValueId; + } + + /** + * @param ?string $value + */ + public function setItemOptionValueId(?string $value = null): self + { + $this->itemOptionValueId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogItemProductType.php b/src/Types/CatalogItemProductType.php new file mode 100644 index 00000000..ad709240 --- /dev/null +++ b/src/Types/CatalogItemProductType.php @@ -0,0 +1,16 @@ + $pricingType + */ + #[JsonProperty('pricing_type')] + private ?string $pricingType; + + /** + * @var ?Money $priceMoney The item variation's price, if fixed pricing is used. + */ + #[JsonProperty('price_money')] + private ?Money $priceMoney; + + /** + * @var ?array $locationOverrides Per-location price and inventory overrides. + */ + #[JsonProperty('location_overrides'), ArrayType([ItemVariationLocationOverrides::class])] + private ?array $locationOverrides; + + /** + * @var ?bool $trackInventory If `true`, inventory tracking is active for the variation. + */ + #[JsonProperty('track_inventory')] + private ?bool $trackInventory; + + /** + * Indicates whether the item variation displays an alert when its inventory quantity is less than or equal + * to its `inventory_alert_threshold`. + * See [InventoryAlertType](#type-inventoryalerttype) for possible values + * + * @var ?value-of $inventoryAlertType + */ + #[JsonProperty('inventory_alert_type')] + private ?string $inventoryAlertType; + + /** + * If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` + * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. + * + * This value is always an integer. + * + * @var ?int $inventoryAlertThreshold + */ + #[JsonProperty('inventory_alert_threshold')] + private ?int $inventoryAlertThreshold; + + /** + * @var ?string $userData Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points. + */ + #[JsonProperty('user_data')] + private ?string $userData; + + /** + * If the `CatalogItem` that owns this item variation is of type + * `APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For + * example, a 30 minute appointment would have the value `1800000`, which is equal to + * 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). + * + * @var ?int $serviceDuration + */ + #[JsonProperty('service_duration')] + private ?int $serviceDuration; + + /** + * If the `CatalogItem` that owns this item variation is of type + * `APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. + * + * @var ?bool $availableForBooking + */ + #[JsonProperty('available_for_booking')] + private ?bool $availableForBooking; + + /** + * List of item option values associated with this item variation. Listed + * in the same order as the item options of the parent item. + * + * @var ?array $itemOptionValues + */ + #[JsonProperty('item_option_values'), ArrayType([CatalogItemOptionValueForItemVariation::class])] + private ?array $itemOptionValues; + + /** + * ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity + * sold of this item variation. If left unset, the item will be sold in + * whole quantities. + * + * @var ?string $measurementUnitId + */ + #[JsonProperty('measurement_unit_id')] + private ?string $measurementUnitId; + + /** + * Whether this variation can be sold. The inventory count of a sellable variation indicates + * the number of units available for sale. When a variation is both stockable and sellable, + * its sellable inventory count can be smaller than or equal to its stockable count. + * + * @var ?bool $sellable + */ + #[JsonProperty('sellable')] + private ?bool $sellable; + + /** + * Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE). + * When a variation is both stockable and sellable, the inventory count of a stockable variation keeps track of the number of units of this variation in stock + * and is not an indicator of the number of units of the variation that can be sold. + * + * @var ?bool $stockable + */ + #[JsonProperty('stockable')] + private ?bool $stockable; + + /** + * The IDs of images associated with this `CatalogItemVariation` instance. + * These images will be shown to customers in Square Online Store. + * + * @var ?array $imageIds + */ + #[JsonProperty('image_ids'), ArrayType(['string'])] + private ?array $imageIds; + + /** + * Tokens of employees that can perform the service represented by this variation. Only valid for + * variations of type `APPOINTMENTS_SERVICE`. + * + * @var ?array $teamMemberIds + */ + #[JsonProperty('team_member_ids'), ArrayType(['string'])] + private ?array $teamMemberIds; + + /** + * The unit conversion rule, as prescribed by the [CatalogStockConversion](entity:CatalogStockConversion) type, + * that describes how this non-stockable (i.e., sellable/receivable) item variation is converted + * to/from the stockable item variation sharing the same parent item. With the stock conversion, + * you can accurately track inventory when an item variation is sold in one unit, but stocked in + * another unit. + * + * @var ?CatalogStockConversion $stockableConversion + */ + #[JsonProperty('stockable_conversion')] + private ?CatalogStockConversion $stockableConversion; + + /** + * @param array{ + * itemId?: ?string, + * name?: ?string, + * sku?: ?string, + * upc?: ?string, + * ordinal?: ?int, + * pricingType?: ?value-of, + * priceMoney?: ?Money, + * locationOverrides?: ?array, + * trackInventory?: ?bool, + * inventoryAlertType?: ?value-of, + * inventoryAlertThreshold?: ?int, + * userData?: ?string, + * serviceDuration?: ?int, + * availableForBooking?: ?bool, + * itemOptionValues?: ?array, + * measurementUnitId?: ?string, + * sellable?: ?bool, + * stockable?: ?bool, + * imageIds?: ?array, + * teamMemberIds?: ?array, + * stockableConversion?: ?CatalogStockConversion, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->itemId = $values['itemId'] ?? null; + $this->name = $values['name'] ?? null; + $this->sku = $values['sku'] ?? null; + $this->upc = $values['upc'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->pricingType = $values['pricingType'] ?? null; + $this->priceMoney = $values['priceMoney'] ?? null; + $this->locationOverrides = $values['locationOverrides'] ?? null; + $this->trackInventory = $values['trackInventory'] ?? null; + $this->inventoryAlertType = $values['inventoryAlertType'] ?? null; + $this->inventoryAlertThreshold = $values['inventoryAlertThreshold'] ?? null; + $this->userData = $values['userData'] ?? null; + $this->serviceDuration = $values['serviceDuration'] ?? null; + $this->availableForBooking = $values['availableForBooking'] ?? null; + $this->itemOptionValues = $values['itemOptionValues'] ?? null; + $this->measurementUnitId = $values['measurementUnitId'] ?? null; + $this->sellable = $values['sellable'] ?? null; + $this->stockable = $values['stockable'] ?? null; + $this->imageIds = $values['imageIds'] ?? null; + $this->teamMemberIds = $values['teamMemberIds'] ?? null; + $this->stockableConversion = $values['stockableConversion'] ?? null; + } + + /** + * @return ?string + */ + public function getItemId(): ?string + { + return $this->itemId; + } + + /** + * @param ?string $value + */ + public function setItemId(?string $value = null): self + { + $this->itemId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSku(): ?string + { + return $this->sku; + } + + /** + * @param ?string $value + */ + public function setSku(?string $value = null): self + { + $this->sku = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpc(): ?string + { + return $this->upc; + } + + /** + * @param ?string $value + */ + public function setUpc(?string $value = null): self + { + $this->upc = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getPricingType(): ?string + { + return $this->pricingType; + } + + /** + * @param ?value-of $value + */ + public function setPricingType(?string $value = null): self + { + $this->pricingType = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceMoney(?Money $value = null): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationOverrides(): ?array + { + return $this->locationOverrides; + } + + /** + * @param ?array $value + */ + public function setLocationOverrides(?array $value = null): self + { + $this->locationOverrides = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTrackInventory(): ?bool + { + return $this->trackInventory; + } + + /** + * @param ?bool $value + */ + public function setTrackInventory(?bool $value = null): self + { + $this->trackInventory = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getInventoryAlertType(): ?string + { + return $this->inventoryAlertType; + } + + /** + * @param ?value-of $value + */ + public function setInventoryAlertType(?string $value = null): self + { + $this->inventoryAlertType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getInventoryAlertThreshold(): ?int + { + return $this->inventoryAlertThreshold; + } + + /** + * @param ?int $value + */ + public function setInventoryAlertThreshold(?int $value = null): self + { + $this->inventoryAlertThreshold = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUserData(): ?string + { + return $this->userData; + } + + /** + * @param ?string $value + */ + public function setUserData(?string $value = null): self + { + $this->userData = $value; + return $this; + } + + /** + * @return ?int + */ + public function getServiceDuration(): ?int + { + return $this->serviceDuration; + } + + /** + * @param ?int $value + */ + public function setServiceDuration(?int $value = null): self + { + $this->serviceDuration = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAvailableForBooking(): ?bool + { + return $this->availableForBooking; + } + + /** + * @param ?bool $value + */ + public function setAvailableForBooking(?bool $value = null): self + { + $this->availableForBooking = $value; + return $this; + } + + /** + * @return ?array + */ + public function getItemOptionValues(): ?array + { + return $this->itemOptionValues; + } + + /** + * @param ?array $value + */ + public function setItemOptionValues(?array $value = null): self + { + $this->itemOptionValues = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMeasurementUnitId(): ?string + { + return $this->measurementUnitId; + } + + /** + * @param ?string $value + */ + public function setMeasurementUnitId(?string $value = null): self + { + $this->measurementUnitId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSellable(): ?bool + { + return $this->sellable; + } + + /** + * @param ?bool $value + */ + public function setSellable(?bool $value = null): self + { + $this->sellable = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getStockable(): ?bool + { + return $this->stockable; + } + + /** + * @param ?bool $value + */ + public function setStockable(?bool $value = null): self + { + $this->stockable = $value; + return $this; + } + + /** + * @return ?array + */ + public function getImageIds(): ?array + { + return $this->imageIds; + } + + /** + * @param ?array $value + */ + public function setImageIds(?array $value = null): self + { + $this->imageIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTeamMemberIds(): ?array + { + return $this->teamMemberIds; + } + + /** + * @param ?array $value + */ + public function setTeamMemberIds(?array $value = null): self + { + $this->teamMemberIds = $value; + return $this; + } + + /** + * @return ?CatalogStockConversion + */ + public function getStockableConversion(): ?CatalogStockConversion + { + return $this->stockableConversion; + } + + /** + * @param ?CatalogStockConversion $value + */ + public function setStockableConversion(?CatalogStockConversion $value = null): self + { + $this->stockableConversion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogMeasurementUnit.php b/src/Types/CatalogMeasurementUnit.php new file mode 100644 index 00000000..3e792567 --- /dev/null +++ b/src/Types/CatalogMeasurementUnit.php @@ -0,0 +1,90 @@ +measurementUnit = $values['measurementUnit'] ?? null; + $this->precision = $values['precision'] ?? null; + } + + /** + * @return ?MeasurementUnit + */ + public function getMeasurementUnit(): ?MeasurementUnit + { + return $this->measurementUnit; + } + + /** + * @param ?MeasurementUnit $value + */ + public function setMeasurementUnit(?MeasurementUnit $value = null): self + { + $this->measurementUnit = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPrecision(): ?int + { + return $this->precision; + } + + /** + * @param ?int $value + */ + public function setPrecision(?int $value = null): self + { + $this->precision = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogModifier.php b/src/Types/CatalogModifier.php new file mode 100644 index 00000000..4d0b1aea --- /dev/null +++ b/src/Types/CatalogModifier.php @@ -0,0 +1,183 @@ + $locationOverrides Location-specific price overrides. + */ + #[JsonProperty('location_overrides'), ArrayType([ModifierLocationOverrides::class])] + private ?array $locationOverrides; + + /** + * The ID of the image associated with this `CatalogModifier` instance. + * Currently this image is not displayed by Square, but is free to be displayed in 3rd party applications. + * + * @var ?string $imageId + */ + #[JsonProperty('image_id')] + private ?string $imageId; + + /** + * @param array{ + * name?: ?string, + * priceMoney?: ?Money, + * ordinal?: ?int, + * modifierListId?: ?string, + * locationOverrides?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->priceMoney = $values['priceMoney'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->modifierListId = $values['modifierListId'] ?? null; + $this->locationOverrides = $values['locationOverrides'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceMoney(?Money $value = null): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?string + */ + public function getModifierListId(): ?string + { + return $this->modifierListId; + } + + /** + * @param ?string $value + */ + public function setModifierListId(?string $value = null): self + { + $this->modifierListId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationOverrides(): ?array + { + return $this->locationOverrides; + } + + /** + * @param ?array $value + */ + public function setLocationOverrides(?array $value = null): self + { + $this->locationOverrides = $value; + return $this; + } + + /** + * @return ?string + */ + public function getImageId(): ?string + { + return $this->imageId; + } + + /** + * @param ?string $value + */ + public function setImageId(?string $value = null): self + { + $this->imageId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogModifierList.php b/src/Types/CatalogModifierList.php new file mode 100644 index 00000000..6899105a --- /dev/null +++ b/src/Types/CatalogModifierList.php @@ -0,0 +1,310 @@ + $selectionType + */ + #[JsonProperty('selection_type')] + private ?string $selectionType; + + /** + * A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, + * for non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list + * is a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes: + * ``` + * { + * "id": "{{catalog_modifier_id}}", + * "type": "MODIFIER", + * "modifier_data": {{a CatalogModifier instance>}} + * } + * ``` + * + * @var ?array $modifiers + */ + #[JsonProperty('modifiers'), ArrayType([CatalogObject::class])] + private ?array $modifiers; + + /** + * The IDs of images associated with this `CatalogModifierList` instance. + * Currently these images are not displayed on Square products, but may be displayed in 3rd-party applications. + * + * @var ?array $imageIds + */ + #[JsonProperty('image_ids'), ArrayType(['string'])] + private ?array $imageIds; + + /** + * The type of the modifier. + * + * When this `modifier_type` value is `TEXT`, the `CatalogModifierList` represents a text-based modifier. + * When this `modifier_type` value is `LIST`, the `CatalogModifierList` contains a list of `CatalogModifier` objects. + * See [CatalogModifierListModifierType](#type-catalogmodifierlistmodifiertype) for possible values + * + * @var ?value-of $modifierType + */ + #[JsonProperty('modifier_type')] + private ?string $modifierType; + + /** + * The maximum length, in Unicode points, of the text string of the text-based modifier as represented by + * this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + * + * @var ?int $maxLength + */ + #[JsonProperty('max_length')] + private ?int $maxLength; + + /** + * Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier + * as represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`. + * + * @var ?bool $textRequired + */ + #[JsonProperty('text_required')] + private ?bool $textRequired; + + /** + * A note for internal use by the business. + * + * For example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of "Hello, Kitty!" + * is to be printed on the T-shirt, this `internal_name` attribute can be "Use italic face" as + * an instruction for the business to follow. + * + * For non text-based modifiers, this `internal_name` attribute can be + * used to include SKUs, internal codes, or supplemental descriptions for internal use. + * + * @var ?string $internalName + */ + #[JsonProperty('internal_name')] + private ?string $internalName; + + /** + * @param array{ + * name?: ?string, + * ordinal?: ?int, + * selectionType?: ?value-of, + * modifiers?: ?array, + * imageIds?: ?array, + * modifierType?: ?value-of, + * maxLength?: ?int, + * textRequired?: ?bool, + * internalName?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->selectionType = $values['selectionType'] ?? null; + $this->modifiers = $values['modifiers'] ?? null; + $this->imageIds = $values['imageIds'] ?? null; + $this->modifierType = $values['modifierType'] ?? null; + $this->maxLength = $values['maxLength'] ?? null; + $this->textRequired = $values['textRequired'] ?? null; + $this->internalName = $values['internalName'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSelectionType(): ?string + { + return $this->selectionType; + } + + /** + * @param ?value-of $value + */ + public function setSelectionType(?string $value = null): self + { + $this->selectionType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifiers(): ?array + { + return $this->modifiers; + } + + /** + * @param ?array $value + */ + public function setModifiers(?array $value = null): self + { + $this->modifiers = $value; + return $this; + } + + /** + * @return ?array + */ + public function getImageIds(): ?array + { + return $this->imageIds; + } + + /** + * @param ?array $value + */ + public function setImageIds(?array $value = null): self + { + $this->imageIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getModifierType(): ?string + { + return $this->modifierType; + } + + /** + * @param ?value-of $value + */ + public function setModifierType(?string $value = null): self + { + $this->modifierType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMaxLength(): ?int + { + return $this->maxLength; + } + + /** + * @param ?int $value + */ + public function setMaxLength(?int $value = null): self + { + $this->maxLength = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTextRequired(): ?bool + { + return $this->textRequired; + } + + /** + * @param ?bool $value + */ + public function setTextRequired(?bool $value = null): self + { + $this->textRequired = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInternalName(): ?string + { + return $this->internalName; + } + + /** + * @param ?string $value + */ + public function setInternalName(?string $value = null): self + { + $this->internalName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogModifierListModifierType.php b/src/Types/CatalogModifierListModifierType.php new file mode 100644 index 00000000..beb169ae --- /dev/null +++ b/src/Types/CatalogModifierListModifierType.php @@ -0,0 +1,9 @@ +modifierId = $values['modifierId']; + $this->onByDefault = $values['onByDefault'] ?? null; + } + + /** + * @return string + */ + public function getModifierId(): string + { + return $this->modifierId; + } + + /** + * @param string $value + */ + public function setModifierId(string $value): self + { + $this->modifierId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getOnByDefault(): ?bool + { + return $this->onByDefault; + } + + /** + * @param ?bool $value + */ + public function setOnByDefault(?bool $value = null): self + { + $this->onByDefault = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObject.php b/src/Types/CatalogObject.php new file mode 100644 index 00000000..9f4b04ad --- /dev/null +++ b/src/Types/CatalogObject.php @@ -0,0 +1,1373 @@ +`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + * + * For a more detailed discussion of the Catalog data model, please see the + * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + */ +class CatalogObject extends JsonSerializableType +{ + /** + * @var ( + * 'ITEM' + * |'IMAGE' + * |'CATEGORY' + * |'ITEM_VARIATION' + * |'TAX' + * |'DISCOUNT' + * |'MODIFIER_LIST' + * |'MODIFIER' + * |'DINING_OPTION' + * |'TAX_EXEMPTION' + * |'SERVICE_CHARGE' + * |'PRICING_RULE' + * |'PRODUCT_SET' + * |'TIME_PERIOD' + * |'MEASUREMENT_UNIT' + * |'SUBSCRIPTION_PLAN' + * |'ITEM_OPTION' + * |'ITEM_OPTION_VAL' + * |'CUSTOM_ATTRIBUTE_DEFINITION' + * |'QUICK_AMOUNTS_SETTINGS' + * |'COMPONENT' + * |'COMPOSITION' + * |'RESOURCE' + * |'CHECKOUT_LINK' + * |'ADDRESS' + * |'SUBSCRIPTION_PRODUCT' + * |'_unknown' + * ) $type + */ + private readonly string $type; + + /** + * @var ( + * CatalogObjectItem + * |CatalogObjectImage + * |CatalogObjectCategory + * |CatalogObjectItemVariation + * |CatalogObjectTax + * |CatalogObjectDiscount + * |CatalogObjectModifierList + * |CatalogObjectModifier + * |CatalogObjectDiningOption + * |CatalogObjectTaxExemption + * |CatalogObjectServiceCharge + * |CatalogObjectPricingRule + * |CatalogObjectProductSet + * |CatalogObjectTimePeriod + * |CatalogObjectMeasurementUnit + * |CatalogObjectSubscriptionPlan + * |CatalogObjectItemOption + * |CatalogObjectItemOptionValue + * |CatalogObjectCustomAttributeDefinition + * |CatalogObjectQuickAmountsSettings + * |CatalogObjectComponent + * |CatalogObjectComposition + * |CatalogObjectResource + * |CatalogObjectCheckoutLink + * |CatalogObjectAddress + * |CatalogObjectSubscriptionProduct + * |mixed + * ) $value + */ + private readonly mixed $value; + + /** + * @param array{ + * type: ( + * 'ITEM' + * |'IMAGE' + * |'CATEGORY' + * |'ITEM_VARIATION' + * |'TAX' + * |'DISCOUNT' + * |'MODIFIER_LIST' + * |'MODIFIER' + * |'DINING_OPTION' + * |'TAX_EXEMPTION' + * |'SERVICE_CHARGE' + * |'PRICING_RULE' + * |'PRODUCT_SET' + * |'TIME_PERIOD' + * |'MEASUREMENT_UNIT' + * |'SUBSCRIPTION_PLAN' + * |'ITEM_OPTION' + * |'ITEM_OPTION_VAL' + * |'CUSTOM_ATTRIBUTE_DEFINITION' + * |'QUICK_AMOUNTS_SETTINGS' + * |'COMPONENT' + * |'COMPOSITION' + * |'RESOURCE' + * |'CHECKOUT_LINK' + * |'ADDRESS' + * |'SUBSCRIPTION_PRODUCT' + * |'_unknown' + * ), + * value: ( + * CatalogObjectItem + * |CatalogObjectImage + * |CatalogObjectCategory + * |CatalogObjectItemVariation + * |CatalogObjectTax + * |CatalogObjectDiscount + * |CatalogObjectModifierList + * |CatalogObjectModifier + * |CatalogObjectDiningOption + * |CatalogObjectTaxExemption + * |CatalogObjectServiceCharge + * |CatalogObjectPricingRule + * |CatalogObjectProductSet + * |CatalogObjectTimePeriod + * |CatalogObjectMeasurementUnit + * |CatalogObjectSubscriptionPlan + * |CatalogObjectItemOption + * |CatalogObjectItemOptionValue + * |CatalogObjectCustomAttributeDefinition + * |CatalogObjectQuickAmountsSettings + * |CatalogObjectComponent + * |CatalogObjectComposition + * |CatalogObjectResource + * |CatalogObjectCheckoutLink + * |CatalogObjectAddress + * |CatalogObjectSubscriptionProduct + * |mixed + * ), + * } $values + */ + private function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->value = $values['value']; + } + + /** + * @return ( + * 'ITEM' + * |'IMAGE' + * |'CATEGORY' + * |'ITEM_VARIATION' + * |'TAX' + * |'DISCOUNT' + * |'MODIFIER_LIST' + * |'MODIFIER' + * |'DINING_OPTION' + * |'TAX_EXEMPTION' + * |'SERVICE_CHARGE' + * |'PRICING_RULE' + * |'PRODUCT_SET' + * |'TIME_PERIOD' + * |'MEASUREMENT_UNIT' + * |'SUBSCRIPTION_PLAN' + * |'ITEM_OPTION' + * |'ITEM_OPTION_VAL' + * |'CUSTOM_ATTRIBUTE_DEFINITION' + * |'QUICK_AMOUNTS_SETTINGS' + * |'COMPONENT' + * |'COMPOSITION' + * |'RESOURCE' + * |'CHECKOUT_LINK' + * |'ADDRESS' + * |'SUBSCRIPTION_PRODUCT' + * |'_unknown' + * ) + */ + public function getType(): string + { + return $this->type; + } + + /** + * @return ( + * CatalogObjectItem + * |CatalogObjectImage + * |CatalogObjectCategory + * |CatalogObjectItemVariation + * |CatalogObjectTax + * |CatalogObjectDiscount + * |CatalogObjectModifierList + * |CatalogObjectModifier + * |CatalogObjectDiningOption + * |CatalogObjectTaxExemption + * |CatalogObjectServiceCharge + * |CatalogObjectPricingRule + * |CatalogObjectProductSet + * |CatalogObjectTimePeriod + * |CatalogObjectMeasurementUnit + * |CatalogObjectSubscriptionPlan + * |CatalogObjectItemOption + * |CatalogObjectItemOptionValue + * |CatalogObjectCustomAttributeDefinition + * |CatalogObjectQuickAmountsSettings + * |CatalogObjectComponent + * |CatalogObjectComposition + * |CatalogObjectResource + * |CatalogObjectCheckoutLink + * |CatalogObjectAddress + * |CatalogObjectSubscriptionProduct + * |mixed + * ) + */ + public function getValue(): mixed + { + return $this->value; + } + + /** + * @param CatalogObjectItem $item + * @return CatalogObject + */ + public static function item(CatalogObjectItem $item): CatalogObject + { + return new CatalogObject([ + 'type' => 'ITEM', + 'value' => $item, + ]); + } + + /** + * @param CatalogObjectImage $image + * @return CatalogObject + */ + public static function image(CatalogObjectImage $image): CatalogObject + { + return new CatalogObject([ + 'type' => 'IMAGE', + 'value' => $image, + ]); + } + + /** + * @param CatalogObjectCategory $category + * @return CatalogObject + */ + public static function category(CatalogObjectCategory $category): CatalogObject + { + return new CatalogObject([ + 'type' => 'CATEGORY', + 'value' => $category, + ]); + } + + /** + * @param CatalogObjectItemVariation $itemVariation + * @return CatalogObject + */ + public static function itemVariation(CatalogObjectItemVariation $itemVariation): CatalogObject + { + return new CatalogObject([ + 'type' => 'ITEM_VARIATION', + 'value' => $itemVariation, + ]); + } + + /** + * @param CatalogObjectTax $tax + * @return CatalogObject + */ + public static function tax(CatalogObjectTax $tax): CatalogObject + { + return new CatalogObject([ + 'type' => 'TAX', + 'value' => $tax, + ]); + } + + /** + * @param CatalogObjectDiscount $discount + * @return CatalogObject + */ + public static function discount(CatalogObjectDiscount $discount): CatalogObject + { + return new CatalogObject([ + 'type' => 'DISCOUNT', + 'value' => $discount, + ]); + } + + /** + * @param CatalogObjectModifierList $modifierList + * @return CatalogObject + */ + public static function modifierList(CatalogObjectModifierList $modifierList): CatalogObject + { + return new CatalogObject([ + 'type' => 'MODIFIER_LIST', + 'value' => $modifierList, + ]); + } + + /** + * @param CatalogObjectModifier $modifier + * @return CatalogObject + */ + public static function modifier(CatalogObjectModifier $modifier): CatalogObject + { + return new CatalogObject([ + 'type' => 'MODIFIER', + 'value' => $modifier, + ]); + } + + /** + * @param CatalogObjectDiningOption $diningOption + * @return CatalogObject + */ + public static function diningOption(CatalogObjectDiningOption $diningOption): CatalogObject + { + return new CatalogObject([ + 'type' => 'DINING_OPTION', + 'value' => $diningOption, + ]); + } + + /** + * @param CatalogObjectTaxExemption $taxExemption + * @return CatalogObject + */ + public static function taxExemption(CatalogObjectTaxExemption $taxExemption): CatalogObject + { + return new CatalogObject([ + 'type' => 'TAX_EXEMPTION', + 'value' => $taxExemption, + ]); + } + + /** + * @param CatalogObjectServiceCharge $serviceCharge + * @return CatalogObject + */ + public static function serviceCharge(CatalogObjectServiceCharge $serviceCharge): CatalogObject + { + return new CatalogObject([ + 'type' => 'SERVICE_CHARGE', + 'value' => $serviceCharge, + ]); + } + + /** + * @param CatalogObjectPricingRule $pricingRule + * @return CatalogObject + */ + public static function pricingRule(CatalogObjectPricingRule $pricingRule): CatalogObject + { + return new CatalogObject([ + 'type' => 'PRICING_RULE', + 'value' => $pricingRule, + ]); + } + + /** + * @param CatalogObjectProductSet $productSet + * @return CatalogObject + */ + public static function productSet(CatalogObjectProductSet $productSet): CatalogObject + { + return new CatalogObject([ + 'type' => 'PRODUCT_SET', + 'value' => $productSet, + ]); + } + + /** + * @param CatalogObjectTimePeriod $timePeriod + * @return CatalogObject + */ + public static function timePeriod(CatalogObjectTimePeriod $timePeriod): CatalogObject + { + return new CatalogObject([ + 'type' => 'TIME_PERIOD', + 'value' => $timePeriod, + ]); + } + + /** + * @param CatalogObjectMeasurementUnit $measurementUnit + * @return CatalogObject + */ + public static function measurementUnit(CatalogObjectMeasurementUnit $measurementUnit): CatalogObject + { + return new CatalogObject([ + 'type' => 'MEASUREMENT_UNIT', + 'value' => $measurementUnit, + ]); + } + + /** + * @param CatalogObjectSubscriptionPlan $subscriptionPlan + * @return CatalogObject + */ + public static function subscriptionPlan(CatalogObjectSubscriptionPlan $subscriptionPlan): CatalogObject + { + return new CatalogObject([ + 'type' => 'SUBSCRIPTION_PLAN', + 'value' => $subscriptionPlan, + ]); + } + + /** + * @param CatalogObjectItemOption $itemOption + * @return CatalogObject + */ + public static function itemOption(CatalogObjectItemOption $itemOption): CatalogObject + { + return new CatalogObject([ + 'type' => 'ITEM_OPTION', + 'value' => $itemOption, + ]); + } + + /** + * @param CatalogObjectItemOptionValue $itemOptionVal + * @return CatalogObject + */ + public static function itemOptionVal(CatalogObjectItemOptionValue $itemOptionVal): CatalogObject + { + return new CatalogObject([ + 'type' => 'ITEM_OPTION_VAL', + 'value' => $itemOptionVal, + ]); + } + + /** + * @param CatalogObjectCustomAttributeDefinition $customAttributeDefinition + * @return CatalogObject + */ + public static function customAttributeDefinition(CatalogObjectCustomAttributeDefinition $customAttributeDefinition): CatalogObject + { + return new CatalogObject([ + 'type' => 'CUSTOM_ATTRIBUTE_DEFINITION', + 'value' => $customAttributeDefinition, + ]); + } + + /** + * @param CatalogObjectQuickAmountsSettings $quickAmountsSettings + * @return CatalogObject + */ + public static function quickAmountsSettings(CatalogObjectQuickAmountsSettings $quickAmountsSettings): CatalogObject + { + return new CatalogObject([ + 'type' => 'QUICK_AMOUNTS_SETTINGS', + 'value' => $quickAmountsSettings, + ]); + } + + /** + * @param CatalogObjectComponent $component + * @return CatalogObject + */ + public static function component(CatalogObjectComponent $component): CatalogObject + { + return new CatalogObject([ + 'type' => 'COMPONENT', + 'value' => $component, + ]); + } + + /** + * @param CatalogObjectComposition $composition + * @return CatalogObject + */ + public static function composition(CatalogObjectComposition $composition): CatalogObject + { + return new CatalogObject([ + 'type' => 'COMPOSITION', + 'value' => $composition, + ]); + } + + /** + * @param CatalogObjectResource $resource + * @return CatalogObject + */ + public static function resource(CatalogObjectResource $resource): CatalogObject + { + return new CatalogObject([ + 'type' => 'RESOURCE', + 'value' => $resource, + ]); + } + + /** + * @param CatalogObjectCheckoutLink $checkoutLink + * @return CatalogObject + */ + public static function checkoutLink(CatalogObjectCheckoutLink $checkoutLink): CatalogObject + { + return new CatalogObject([ + 'type' => 'CHECKOUT_LINK', + 'value' => $checkoutLink, + ]); + } + + /** + * @param CatalogObjectAddress $address + * @return CatalogObject + */ + public static function address(CatalogObjectAddress $address): CatalogObject + { + return new CatalogObject([ + 'type' => 'ADDRESS', + 'value' => $address, + ]); + } + + /** + * @param CatalogObjectSubscriptionProduct $subscriptionProduct + * @return CatalogObject + */ + public static function subscriptionProduct(CatalogObjectSubscriptionProduct $subscriptionProduct): CatalogObject + { + return new CatalogObject([ + 'type' => 'SUBSCRIPTION_PRODUCT', + 'value' => $subscriptionProduct, + ]); + } + + /** + * @return bool + */ + public function isItem(): bool + { + return $this->value instanceof CatalogObjectItem && $this->type === 'ITEM'; + } + + /** + * @return CatalogObjectItem + */ + public function asItem(): CatalogObjectItem + { + if (!($this->value instanceof CatalogObjectItem && $this->type === 'ITEM')) { + throw new Exception( + "Expected ITEM; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isImage(): bool + { + return $this->value instanceof CatalogObjectImage && $this->type === 'IMAGE'; + } + + /** + * @return CatalogObjectImage + */ + public function asImage(): CatalogObjectImage + { + if (!($this->value instanceof CatalogObjectImage && $this->type === 'IMAGE')) { + throw new Exception( + "Expected IMAGE; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCategory(): bool + { + return $this->value instanceof CatalogObjectCategory && $this->type === 'CATEGORY'; + } + + /** + * @return CatalogObjectCategory + */ + public function asCategory(): CatalogObjectCategory + { + if (!($this->value instanceof CatalogObjectCategory && $this->type === 'CATEGORY')) { + throw new Exception( + "Expected CATEGORY; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isItemVariation(): bool + { + return $this->value instanceof CatalogObjectItemVariation && $this->type === 'ITEM_VARIATION'; + } + + /** + * @return CatalogObjectItemVariation + */ + public function asItemVariation(): CatalogObjectItemVariation + { + if (!($this->value instanceof CatalogObjectItemVariation && $this->type === 'ITEM_VARIATION')) { + throw new Exception( + "Expected ITEM_VARIATION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTax(): bool + { + return $this->value instanceof CatalogObjectTax && $this->type === 'TAX'; + } + + /** + * @return CatalogObjectTax + */ + public function asTax(): CatalogObjectTax + { + if (!($this->value instanceof CatalogObjectTax && $this->type === 'TAX')) { + throw new Exception( + "Expected TAX; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDiscount(): bool + { + return $this->value instanceof CatalogObjectDiscount && $this->type === 'DISCOUNT'; + } + + /** + * @return CatalogObjectDiscount + */ + public function asDiscount(): CatalogObjectDiscount + { + if (!($this->value instanceof CatalogObjectDiscount && $this->type === 'DISCOUNT')) { + throw new Exception( + "Expected DISCOUNT; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isModifierList(): bool + { + return $this->value instanceof CatalogObjectModifierList && $this->type === 'MODIFIER_LIST'; + } + + /** + * @return CatalogObjectModifierList + */ + public function asModifierList(): CatalogObjectModifierList + { + if (!($this->value instanceof CatalogObjectModifierList && $this->type === 'MODIFIER_LIST')) { + throw new Exception( + "Expected MODIFIER_LIST; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isModifier(): bool + { + return $this->value instanceof CatalogObjectModifier && $this->type === 'MODIFIER'; + } + + /** + * @return CatalogObjectModifier + */ + public function asModifier(): CatalogObjectModifier + { + if (!($this->value instanceof CatalogObjectModifier && $this->type === 'MODIFIER')) { + throw new Exception( + "Expected MODIFIER; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDiningOption(): bool + { + return $this->value instanceof CatalogObjectDiningOption && $this->type === 'DINING_OPTION'; + } + + /** + * @return CatalogObjectDiningOption + */ + public function asDiningOption(): CatalogObjectDiningOption + { + if (!($this->value instanceof CatalogObjectDiningOption && $this->type === 'DINING_OPTION')) { + throw new Exception( + "Expected DINING_OPTION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTaxExemption(): bool + { + return $this->value instanceof CatalogObjectTaxExemption && $this->type === 'TAX_EXEMPTION'; + } + + /** + * @return CatalogObjectTaxExemption + */ + public function asTaxExemption(): CatalogObjectTaxExemption + { + if (!($this->value instanceof CatalogObjectTaxExemption && $this->type === 'TAX_EXEMPTION')) { + throw new Exception( + "Expected TAX_EXEMPTION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isServiceCharge(): bool + { + return $this->value instanceof CatalogObjectServiceCharge && $this->type === 'SERVICE_CHARGE'; + } + + /** + * @return CatalogObjectServiceCharge + */ + public function asServiceCharge(): CatalogObjectServiceCharge + { + if (!($this->value instanceof CatalogObjectServiceCharge && $this->type === 'SERVICE_CHARGE')) { + throw new Exception( + "Expected SERVICE_CHARGE; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPricingRule(): bool + { + return $this->value instanceof CatalogObjectPricingRule && $this->type === 'PRICING_RULE'; + } + + /** + * @return CatalogObjectPricingRule + */ + public function asPricingRule(): CatalogObjectPricingRule + { + if (!($this->value instanceof CatalogObjectPricingRule && $this->type === 'PRICING_RULE')) { + throw new Exception( + "Expected PRICING_RULE; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isProductSet(): bool + { + return $this->value instanceof CatalogObjectProductSet && $this->type === 'PRODUCT_SET'; + } + + /** + * @return CatalogObjectProductSet + */ + public function asProductSet(): CatalogObjectProductSet + { + if (!($this->value instanceof CatalogObjectProductSet && $this->type === 'PRODUCT_SET')) { + throw new Exception( + "Expected PRODUCT_SET; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTimePeriod(): bool + { + return $this->value instanceof CatalogObjectTimePeriod && $this->type === 'TIME_PERIOD'; + } + + /** + * @return CatalogObjectTimePeriod + */ + public function asTimePeriod(): CatalogObjectTimePeriod + { + if (!($this->value instanceof CatalogObjectTimePeriod && $this->type === 'TIME_PERIOD')) { + throw new Exception( + "Expected TIME_PERIOD; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMeasurementUnit(): bool + { + return $this->value instanceof CatalogObjectMeasurementUnit && $this->type === 'MEASUREMENT_UNIT'; + } + + /** + * @return CatalogObjectMeasurementUnit + */ + public function asMeasurementUnit(): CatalogObjectMeasurementUnit + { + if (!($this->value instanceof CatalogObjectMeasurementUnit && $this->type === 'MEASUREMENT_UNIT')) { + throw new Exception( + "Expected MEASUREMENT_UNIT; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSubscriptionPlan(): bool + { + return $this->value instanceof CatalogObjectSubscriptionPlan && $this->type === 'SUBSCRIPTION_PLAN'; + } + + /** + * @return CatalogObjectSubscriptionPlan + */ + public function asSubscriptionPlan(): CatalogObjectSubscriptionPlan + { + if (!($this->value instanceof CatalogObjectSubscriptionPlan && $this->type === 'SUBSCRIPTION_PLAN')) { + throw new Exception( + "Expected SUBSCRIPTION_PLAN; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isItemOption(): bool + { + return $this->value instanceof CatalogObjectItemOption && $this->type === 'ITEM_OPTION'; + } + + /** + * @return CatalogObjectItemOption + */ + public function asItemOption(): CatalogObjectItemOption + { + if (!($this->value instanceof CatalogObjectItemOption && $this->type === 'ITEM_OPTION')) { + throw new Exception( + "Expected ITEM_OPTION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isItemOptionVal(): bool + { + return $this->value instanceof CatalogObjectItemOptionValue && $this->type === 'ITEM_OPTION_VAL'; + } + + /** + * @return CatalogObjectItemOptionValue + */ + public function asItemOptionVal(): CatalogObjectItemOptionValue + { + if (!($this->value instanceof CatalogObjectItemOptionValue && $this->type === 'ITEM_OPTION_VAL')) { + throw new Exception( + "Expected ITEM_OPTION_VAL; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCustomAttributeDefinition(): bool + { + return $this->value instanceof CatalogObjectCustomAttributeDefinition && $this->type === 'CUSTOM_ATTRIBUTE_DEFINITION'; + } + + /** + * @return CatalogObjectCustomAttributeDefinition + */ + public function asCustomAttributeDefinition(): CatalogObjectCustomAttributeDefinition + { + if (!($this->value instanceof CatalogObjectCustomAttributeDefinition && $this->type === 'CUSTOM_ATTRIBUTE_DEFINITION')) { + throw new Exception( + "Expected CUSTOM_ATTRIBUTE_DEFINITION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isQuickAmountsSettings(): bool + { + return $this->value instanceof CatalogObjectQuickAmountsSettings && $this->type === 'QUICK_AMOUNTS_SETTINGS'; + } + + /** + * @return CatalogObjectQuickAmountsSettings + */ + public function asQuickAmountsSettings(): CatalogObjectQuickAmountsSettings + { + if (!($this->value instanceof CatalogObjectQuickAmountsSettings && $this->type === 'QUICK_AMOUNTS_SETTINGS')) { + throw new Exception( + "Expected QUICK_AMOUNTS_SETTINGS; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isComponent(): bool + { + return $this->value instanceof CatalogObjectComponent && $this->type === 'COMPONENT'; + } + + /** + * @return CatalogObjectComponent + */ + public function asComponent(): CatalogObjectComponent + { + if (!($this->value instanceof CatalogObjectComponent && $this->type === 'COMPONENT')) { + throw new Exception( + "Expected COMPONENT; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isComposition(): bool + { + return $this->value instanceof CatalogObjectComposition && $this->type === 'COMPOSITION'; + } + + /** + * @return CatalogObjectComposition + */ + public function asComposition(): CatalogObjectComposition + { + if (!($this->value instanceof CatalogObjectComposition && $this->type === 'COMPOSITION')) { + throw new Exception( + "Expected COMPOSITION; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isResource(): bool + { + return $this->value instanceof CatalogObjectResource && $this->type === 'RESOURCE'; + } + + /** + * @return CatalogObjectResource + */ + public function asResource(): CatalogObjectResource + { + if (!($this->value instanceof CatalogObjectResource && $this->type === 'RESOURCE')) { + throw new Exception( + "Expected RESOURCE; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCheckoutLink(): bool + { + return $this->value instanceof CatalogObjectCheckoutLink && $this->type === 'CHECKOUT_LINK'; + } + + /** + * @return CatalogObjectCheckoutLink + */ + public function asCheckoutLink(): CatalogObjectCheckoutLink + { + if (!($this->value instanceof CatalogObjectCheckoutLink && $this->type === 'CHECKOUT_LINK')) { + throw new Exception( + "Expected CHECKOUT_LINK; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAddress(): bool + { + return $this->value instanceof CatalogObjectAddress && $this->type === 'ADDRESS'; + } + + /** + * @return CatalogObjectAddress + */ + public function asAddress(): CatalogObjectAddress + { + if (!($this->value instanceof CatalogObjectAddress && $this->type === 'ADDRESS')) { + throw new Exception( + "Expected ADDRESS; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSubscriptionProduct(): bool + { + return $this->value instanceof CatalogObjectSubscriptionProduct && $this->type === 'SUBSCRIPTION_PRODUCT'; + } + + /** + * @return CatalogObjectSubscriptionProduct + */ + public function asSubscriptionProduct(): CatalogObjectSubscriptionProduct + { + if (!($this->value instanceof CatalogObjectSubscriptionProduct && $this->type === 'SUBSCRIPTION_PRODUCT')) { + throw new Exception( + "Expected SUBSCRIPTION_PRODUCT; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['type'] = $this->type; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->type) { + case 'ITEM': + $value = $this->asItem()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'IMAGE': + $value = $this->asImage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'CATEGORY': + $value = $this->asCategory()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ITEM_VARIATION': + $value = $this->asItemVariation()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'TAX': + $value = $this->asTax()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'DISCOUNT': + $value = $this->asDiscount()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'MODIFIER_LIST': + $value = $this->asModifierList()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'MODIFIER': + $value = $this->asModifier()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'DINING_OPTION': + $value = $this->asDiningOption()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'TAX_EXEMPTION': + $value = $this->asTaxExemption()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'SERVICE_CHARGE': + $value = $this->asServiceCharge()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'PRICING_RULE': + $value = $this->asPricingRule()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'PRODUCT_SET': + $value = $this->asProductSet()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'TIME_PERIOD': + $value = $this->asTimePeriod()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'MEASUREMENT_UNIT': + $value = $this->asMeasurementUnit()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'SUBSCRIPTION_PLAN': + $value = $this->asSubscriptionPlan()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ITEM_OPTION': + $value = $this->asItemOption()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ITEM_OPTION_VAL': + $value = $this->asItemOptionVal()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'CUSTOM_ATTRIBUTE_DEFINITION': + $value = $this->asCustomAttributeDefinition()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'QUICK_AMOUNTS_SETTINGS': + $value = $this->asQuickAmountsSettings()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'COMPONENT': + $value = $this->asComponent()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'COMPOSITION': + $value = $this->asComposition()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'RESOURCE': + $value = $this->asResource()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'CHECKOUT_LINK': + $value = $this->asCheckoutLink()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ADDRESS': + $value = $this->asAddress()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'SUBSCRIPTION_PRODUCT': + $value = $this->asSubscriptionProduct()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param string $json + */ + public static function fromJson(string $json): static + { + $decodedJson = JsonDecoder::decode($json); + if (!is_array($decodedJson)) { + throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); + } + return self::jsonDeserialize($decodedJson); + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('type', $data)) { + throw new Exception( + "JSON data is missing property 'type'", + ); + } + $type = $data['type']; + if (!(is_string($type))) { + throw new Exception( + "Expected property 'type' in JSON data to be string, instead received " . get_debug_type($data['type']), + ); + } + + $args['type'] = $type; + switch ($type) { + case 'ITEM': + $args['value'] = CatalogObjectItem::jsonDeserialize($data); + break; + case 'IMAGE': + $args['value'] = CatalogObjectImage::jsonDeserialize($data); + break; + case 'CATEGORY': + $args['value'] = CatalogObjectCategory::jsonDeserialize($data); + break; + case 'ITEM_VARIATION': + $args['value'] = CatalogObjectItemVariation::jsonDeserialize($data); + break; + case 'TAX': + $args['value'] = CatalogObjectTax::jsonDeserialize($data); + break; + case 'DISCOUNT': + $args['value'] = CatalogObjectDiscount::jsonDeserialize($data); + break; + case 'MODIFIER_LIST': + $args['value'] = CatalogObjectModifierList::jsonDeserialize($data); + break; + case 'MODIFIER': + $args['value'] = CatalogObjectModifier::jsonDeserialize($data); + break; + case 'DINING_OPTION': + $args['value'] = CatalogObjectDiningOption::jsonDeserialize($data); + break; + case 'TAX_EXEMPTION': + $args['value'] = CatalogObjectTaxExemption::jsonDeserialize($data); + break; + case 'SERVICE_CHARGE': + $args['value'] = CatalogObjectServiceCharge::jsonDeserialize($data); + break; + case 'PRICING_RULE': + $args['value'] = CatalogObjectPricingRule::jsonDeserialize($data); + break; + case 'PRODUCT_SET': + $args['value'] = CatalogObjectProductSet::jsonDeserialize($data); + break; + case 'TIME_PERIOD': + $args['value'] = CatalogObjectTimePeriod::jsonDeserialize($data); + break; + case 'MEASUREMENT_UNIT': + $args['value'] = CatalogObjectMeasurementUnit::jsonDeserialize($data); + break; + case 'SUBSCRIPTION_PLAN': + $args['value'] = CatalogObjectSubscriptionPlan::jsonDeserialize($data); + break; + case 'ITEM_OPTION': + $args['value'] = CatalogObjectItemOption::jsonDeserialize($data); + break; + case 'ITEM_OPTION_VAL': + $args['value'] = CatalogObjectItemOptionValue::jsonDeserialize($data); + break; + case 'CUSTOM_ATTRIBUTE_DEFINITION': + $args['value'] = CatalogObjectCustomAttributeDefinition::jsonDeserialize($data); + break; + case 'QUICK_AMOUNTS_SETTINGS': + $args['value'] = CatalogObjectQuickAmountsSettings::jsonDeserialize($data); + break; + case 'COMPONENT': + $args['value'] = CatalogObjectComponent::jsonDeserialize($data); + break; + case 'COMPOSITION': + $args['value'] = CatalogObjectComposition::jsonDeserialize($data); + break; + case 'RESOURCE': + $args['value'] = CatalogObjectResource::jsonDeserialize($data); + break; + case 'CHECKOUT_LINK': + $args['value'] = CatalogObjectCheckoutLink::jsonDeserialize($data); + break; + case 'ADDRESS': + $args['value'] = CatalogObjectAddress::jsonDeserialize($data); + break; + case 'SUBSCRIPTION_PRODUCT': + $args['value'] = CatalogObjectSubscriptionProduct::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['type'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/CatalogObjectAddress.php b/src/Types/CatalogObjectAddress.php new file mode 100644 index 00000000..12567988 --- /dev/null +++ b/src/Types/CatalogObjectAddress.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectBase.php b/src/Types/CatalogObjectBase.php new file mode 100644 index 00000000..66beefa1 --- /dev/null +++ b/src/Types/CatalogObjectBase.php @@ -0,0 +1,325 @@ + $customAttributeValues + */ + #[JsonProperty('custom_attribute_values'), ArrayType(['string' => CatalogCustomAttributeValue::class])] + private ?array $customAttributeValues; + + /** + * The Connect v1 IDs for this object at each location where it is present, where they + * differ from the object's Connect V2 ID. The field will only be present for objects that + * have been created or modified by legacy APIs. + * + * @var ?array $catalogV1Ids + */ + #[JsonProperty('catalog_v1_ids'), ArrayType([CatalogV1Id::class])] + private ?array $catalogV1Ids; + + /** + * If `true`, this object is present at all locations (including future locations), except where specified in + * the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + * + * @var ?bool $presentAtAllLocations + */ + #[JsonProperty('present_at_all_locations')] + private ?bool $presentAtAllLocations; + + /** + * A list of locations where the object is present, even if `present_at_all_locations` is `false`. + * This can include locations that are deactivated. + * + * @var ?array $presentAtLocationIds + */ + #[JsonProperty('present_at_location_ids'), ArrayType(['string'])] + private ?array $presentAtLocationIds; + + /** + * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + * This can include locations that are deactivated. + * + * @var ?array $absentAtLocationIds + */ + #[JsonProperty('absent_at_location_ids'), ArrayType(['string'])] + private ?array $absentAtLocationIds; + + /** + * @var ?string $imageId Identifies the `CatalogImage` attached to this `CatalogObject`. + */ + #[JsonProperty('image_id')] + private ?string $imageId; + + /** + * @param array{ + * id: string, + * updatedAt?: ?string, + * version?: ?int, + * isDeleted?: ?bool, + * customAttributeValues?: ?array, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsDeleted(): ?bool + { + return $this->isDeleted; + } + + /** + * @param ?bool $value + */ + public function setIsDeleted(?bool $value = null): self + { + $this->isDeleted = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomAttributeValues(): ?array + { + return $this->customAttributeValues; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeValues(?array $value = null): self + { + $this->customAttributeValues = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCatalogV1Ids(): ?array + { + return $this->catalogV1Ids; + } + + /** + * @param ?array $value + */ + public function setCatalogV1Ids(?array $value = null): self + { + $this->catalogV1Ids = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPresentAtAllLocations(): ?bool + { + return $this->presentAtAllLocations; + } + + /** + * @param ?bool $value + */ + public function setPresentAtAllLocations(?bool $value = null): self + { + $this->presentAtAllLocations = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPresentAtLocationIds(): ?array + { + return $this->presentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setPresentAtLocationIds(?array $value = null): self + { + $this->presentAtLocationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAbsentAtLocationIds(): ?array + { + return $this->absentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setAbsentAtLocationIds(?array $value = null): self + { + $this->absentAtLocationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getImageId(): ?string + { + return $this->imageId; + } + + /** + * @param ?string $value + */ + public function setImageId(?string $value = null): self + { + $this->imageId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectBatch.php b/src/Types/CatalogObjectBatch.php new file mode 100644 index 00000000..32c95149 --- /dev/null +++ b/src/Types/CatalogObjectBatch.php @@ -0,0 +1,55 @@ + $objects A list of CatalogObjects belonging to this batch. + */ + #[JsonProperty('objects'), ArrayType([CatalogObject::class])] + private array $objects; + + /** + * @param array{ + * objects: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->objects = $values['objects']; + } + + /** + * @return array + */ + public function getObjects(): array + { + return $this->objects; + } + + /** + * @param array $value + */ + public function setObjects(array $value): self + { + $this->objects = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectCategory.php b/src/Types/CatalogObjectCategory.php new file mode 100644 index 00000000..bd0557ea --- /dev/null +++ b/src/Types/CatalogObjectCategory.php @@ -0,0 +1,372 @@ + $customAttributeValues + */ + #[JsonProperty('custom_attribute_values'), ArrayType(['string' => CatalogCustomAttributeValue::class])] + private ?array $customAttributeValues; + + /** + * The Connect v1 IDs for this object at each location where it is present, where they + * differ from the object's Connect V2 ID. The field will only be present for objects that + * have been created or modified by legacy APIs. + * + * @var ?array $catalogV1Ids + */ + #[JsonProperty('catalog_v1_ids'), ArrayType([CatalogV1Id::class])] + private ?array $catalogV1Ids; + + /** + * If `true`, this object is present at all locations (including future locations), except where specified in + * the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + * except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + * + * @var ?bool $presentAtAllLocations + */ + #[JsonProperty('present_at_all_locations')] + private ?bool $presentAtAllLocations; + + /** + * A list of locations where the object is present, even if `present_at_all_locations` is `false`. + * This can include locations that are deactivated. + * + * @var ?array $presentAtLocationIds + */ + #[JsonProperty('present_at_location_ids'), ArrayType(['string'])] + private ?array $presentAtLocationIds; + + /** + * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + * This can include locations that are deactivated. + * + * @var ?array $absentAtLocationIds + */ + #[JsonProperty('absent_at_location_ids'), ArrayType(['string'])] + private ?array $absentAtLocationIds; + + /** + * @var ?string $imageId Identifies the `CatalogImage` attached to this `CatalogObject`. + */ + #[JsonProperty('image_id')] + private ?string $imageId; + + /** + * @param array{ + * id?: ?string, + * ordinal?: ?int, + * categoryData?: ?CatalogCategory, + * updatedAt?: ?string, + * version?: ?int, + * isDeleted?: ?bool, + * customAttributeValues?: ?array, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->categoryData = $values['categoryData'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?CatalogCategory + */ + public function getCategoryData(): ?CatalogCategory + { + return $this->categoryData; + } + + /** + * @param ?CatalogCategory $value + */ + public function setCategoryData(?CatalogCategory $value = null): self + { + $this->categoryData = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsDeleted(): ?bool + { + return $this->isDeleted; + } + + /** + * @param ?bool $value + */ + public function setIsDeleted(?bool $value = null): self + { + $this->isDeleted = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomAttributeValues(): ?array + { + return $this->customAttributeValues; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeValues(?array $value = null): self + { + $this->customAttributeValues = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCatalogV1Ids(): ?array + { + return $this->catalogV1Ids; + } + + /** + * @param ?array $value + */ + public function setCatalogV1Ids(?array $value = null): self + { + $this->catalogV1Ids = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPresentAtAllLocations(): ?bool + { + return $this->presentAtAllLocations; + } + + /** + * @param ?bool $value + */ + public function setPresentAtAllLocations(?bool $value = null): self + { + $this->presentAtAllLocations = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPresentAtLocationIds(): ?array + { + return $this->presentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setPresentAtLocationIds(?array $value = null): self + { + $this->presentAtLocationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAbsentAtLocationIds(): ?array + { + return $this->absentAtLocationIds; + } + + /** + * @param ?array $value + */ + public function setAbsentAtLocationIds(?array $value = null): self + { + $this->absentAtLocationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getImageId(): ?string + { + return $this->imageId; + } + + /** + * @param ?string $value + */ + public function setImageId(?string $value = null): self + { + $this->imageId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectCheckoutLink.php b/src/Types/CatalogObjectCheckoutLink.php new file mode 100644 index 00000000..96378b04 --- /dev/null +++ b/src/Types/CatalogObjectCheckoutLink.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectComponent.php b/src/Types/CatalogObjectComponent.php new file mode 100644 index 00000000..d5554063 --- /dev/null +++ b/src/Types/CatalogObjectComponent.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectComposition.php b/src/Types/CatalogObjectComposition.php new file mode 100644 index 00000000..0a461432 --- /dev/null +++ b/src/Types/CatalogObjectComposition.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectCustomAttributeDefinition.php b/src/Types/CatalogObjectCustomAttributeDefinition.php new file mode 100644 index 00000000..b447e480 --- /dev/null +++ b/src/Types/CatalogObjectCustomAttributeDefinition.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * customAttributeDefinitionData?: ?CatalogCustomAttributeDefinition, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->customAttributeDefinitionData = $values['customAttributeDefinitionData'] ?? null; + } + + /** + * @return ?CatalogCustomAttributeDefinition + */ + public function getCustomAttributeDefinitionData(): ?CatalogCustomAttributeDefinition + { + return $this->customAttributeDefinitionData; + } + + /** + * @param ?CatalogCustomAttributeDefinition $value + */ + public function setCustomAttributeDefinitionData(?CatalogCustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinitionData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectDiningOption.php b/src/Types/CatalogObjectDiningOption.php new file mode 100644 index 00000000..825343c6 --- /dev/null +++ b/src/Types/CatalogObjectDiningOption.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectDiscount.php b/src/Types/CatalogObjectDiscount.php new file mode 100644 index 00000000..41d9a82f --- /dev/null +++ b/src/Types/CatalogObjectDiscount.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * discountData?: ?CatalogDiscount, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->discountData = $values['discountData'] ?? null; + } + + /** + * @return ?CatalogDiscount + */ + public function getDiscountData(): ?CatalogDiscount + { + return $this->discountData; + } + + /** + * @param ?CatalogDiscount $value + */ + public function setDiscountData(?CatalogDiscount $value = null): self + { + $this->discountData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectImage.php b/src/Types/CatalogObjectImage.php new file mode 100644 index 00000000..7db30c61 --- /dev/null +++ b/src/Types/CatalogObjectImage.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * imageData?: ?CatalogImage, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->imageData = $values['imageData'] ?? null; + } + + /** + * @return ?CatalogImage + */ + public function getImageData(): ?CatalogImage + { + return $this->imageData; + } + + /** + * @param ?CatalogImage $value + */ + public function setImageData(?CatalogImage $value = null): self + { + $this->imageData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectItem.php b/src/Types/CatalogObjectItem.php new file mode 100644 index 00000000..d91f17a6 --- /dev/null +++ b/src/Types/CatalogObjectItem.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * itemData?: ?CatalogItem, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->itemData = $values['itemData'] ?? null; + } + + /** + * @return ?CatalogItem + */ + public function getItemData(): ?CatalogItem + { + return $this->itemData; + } + + /** + * @param ?CatalogItem $value + */ + public function setItemData(?CatalogItem $value = null): self + { + $this->itemData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectItemOption.php b/src/Types/CatalogObjectItemOption.php new file mode 100644 index 00000000..4e343e73 --- /dev/null +++ b/src/Types/CatalogObjectItemOption.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * itemOptionData?: ?CatalogItemOption, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->itemOptionData = $values['itemOptionData'] ?? null; + } + + /** + * @return ?CatalogItemOption + */ + public function getItemOptionData(): ?CatalogItemOption + { + return $this->itemOptionData; + } + + /** + * @param ?CatalogItemOption $value + */ + public function setItemOptionData(?CatalogItemOption $value = null): self + { + $this->itemOptionData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectItemOptionValue.php b/src/Types/CatalogObjectItemOptionValue.php new file mode 100644 index 00000000..562b5f15 --- /dev/null +++ b/src/Types/CatalogObjectItemOptionValue.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * itemOptionValueData?: ?CatalogItemOptionValue, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->itemOptionValueData = $values['itemOptionValueData'] ?? null; + } + + /** + * @return ?CatalogItemOptionValue + */ + public function getItemOptionValueData(): ?CatalogItemOptionValue + { + return $this->itemOptionValueData; + } + + /** + * @param ?CatalogItemOptionValue $value + */ + public function setItemOptionValueData(?CatalogItemOptionValue $value = null): self + { + $this->itemOptionValueData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectItemVariation.php b/src/Types/CatalogObjectItemVariation.php new file mode 100644 index 00000000..16c52b72 --- /dev/null +++ b/src/Types/CatalogObjectItemVariation.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * itemVariationData?: ?CatalogItemVariation, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->itemVariationData = $values['itemVariationData'] ?? null; + } + + /** + * @return ?CatalogItemVariation + */ + public function getItemVariationData(): ?CatalogItemVariation + { + return $this->itemVariationData; + } + + /** + * @param ?CatalogItemVariation $value + */ + public function setItemVariationData(?CatalogItemVariation $value = null): self + { + $this->itemVariationData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectMeasurementUnit.php b/src/Types/CatalogObjectMeasurementUnit.php new file mode 100644 index 00000000..4c0694ae --- /dev/null +++ b/src/Types/CatalogObjectMeasurementUnit.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * measurementUnitData?: ?CatalogMeasurementUnit, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->measurementUnitData = $values['measurementUnitData'] ?? null; + } + + /** + * @return ?CatalogMeasurementUnit + */ + public function getMeasurementUnitData(): ?CatalogMeasurementUnit + { + return $this->measurementUnitData; + } + + /** + * @param ?CatalogMeasurementUnit $value + */ + public function setMeasurementUnitData(?CatalogMeasurementUnit $value = null): self + { + $this->measurementUnitData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectModifier.php b/src/Types/CatalogObjectModifier.php new file mode 100644 index 00000000..e70f3fbd --- /dev/null +++ b/src/Types/CatalogObjectModifier.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * modifierData?: ?CatalogModifier, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->modifierData = $values['modifierData'] ?? null; + } + + /** + * @return ?CatalogModifier + */ + public function getModifierData(): ?CatalogModifier + { + return $this->modifierData; + } + + /** + * @param ?CatalogModifier $value + */ + public function setModifierData(?CatalogModifier $value = null): self + { + $this->modifierData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectModifierList.php b/src/Types/CatalogObjectModifierList.php new file mode 100644 index 00000000..de68d62d --- /dev/null +++ b/src/Types/CatalogObjectModifierList.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * modifierListData?: ?CatalogModifierList, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->modifierListData = $values['modifierListData'] ?? null; + } + + /** + * @return ?CatalogModifierList + */ + public function getModifierListData(): ?CatalogModifierList + { + return $this->modifierListData; + } + + /** + * @param ?CatalogModifierList $value + */ + public function setModifierListData(?CatalogModifierList $value = null): self + { + $this->modifierListData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectPricingRule.php b/src/Types/CatalogObjectPricingRule.php new file mode 100644 index 00000000..aa409b88 --- /dev/null +++ b/src/Types/CatalogObjectPricingRule.php @@ -0,0 +1,77 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * pricingRuleData?: ?CatalogPricingRule, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->pricingRuleData = $values['pricingRuleData'] ?? null; + } + + /** + * @return ?CatalogPricingRule + */ + public function getPricingRuleData(): ?CatalogPricingRule + { + return $this->pricingRuleData; + } + + /** + * @param ?CatalogPricingRule $value + */ + public function setPricingRuleData(?CatalogPricingRule $value = null): self + { + $this->pricingRuleData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectProductSet.php b/src/Types/CatalogObjectProductSet.php new file mode 100644 index 00000000..7b6acd79 --- /dev/null +++ b/src/Types/CatalogObjectProductSet.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * productSetData?: ?CatalogProductSet, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->productSetData = $values['productSetData'] ?? null; + } + + /** + * @return ?CatalogProductSet + */ + public function getProductSetData(): ?CatalogProductSet + { + return $this->productSetData; + } + + /** + * @param ?CatalogProductSet $value + */ + public function setProductSetData(?CatalogProductSet $value = null): self + { + $this->productSetData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectQuickAmountsSettings.php b/src/Types/CatalogObjectQuickAmountsSettings.php new file mode 100644 index 00000000..40ce9f22 --- /dev/null +++ b/src/Types/CatalogObjectQuickAmountsSettings.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * quickAmountsSettingsData?: ?CatalogQuickAmountsSettings, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->quickAmountsSettingsData = $values['quickAmountsSettingsData'] ?? null; + } + + /** + * @return ?CatalogQuickAmountsSettings + */ + public function getQuickAmountsSettingsData(): ?CatalogQuickAmountsSettings + { + return $this->quickAmountsSettingsData; + } + + /** + * @param ?CatalogQuickAmountsSettings $value + */ + public function setQuickAmountsSettingsData(?CatalogQuickAmountsSettings $value = null): self + { + $this->quickAmountsSettingsData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectReference.php b/src/Types/CatalogObjectReference.php new file mode 100644 index 00000000..fbe907a6 --- /dev/null +++ b/src/Types/CatalogObjectReference.php @@ -0,0 +1,81 @@ +objectId = $values['objectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + } + + /** + * @return ?string + */ + public function getObjectId(): ?string + { + return $this->objectId; + } + + /** + * @param ?string $value + */ + public function setObjectId(?string $value = null): self + { + $this->objectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectResource.php b/src/Types/CatalogObjectResource.php new file mode 100644 index 00000000..d11b4641 --- /dev/null +++ b/src/Types/CatalogObjectResource.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectServiceCharge.php b/src/Types/CatalogObjectServiceCharge.php new file mode 100644 index 00000000..681b1221 --- /dev/null +++ b/src/Types/CatalogObjectServiceCharge.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectSubscriptionPlan.php b/src/Types/CatalogObjectSubscriptionPlan.php new file mode 100644 index 00000000..d898a9d5 --- /dev/null +++ b/src/Types/CatalogObjectSubscriptionPlan.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * subscriptionPlanData?: ?CatalogSubscriptionPlan, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->subscriptionPlanData = $values['subscriptionPlanData'] ?? null; + } + + /** + * @return ?CatalogSubscriptionPlan + */ + public function getSubscriptionPlanData(): ?CatalogSubscriptionPlan + { + return $this->subscriptionPlanData; + } + + /** + * @param ?CatalogSubscriptionPlan $value + */ + public function setSubscriptionPlanData(?CatalogSubscriptionPlan $value = null): self + { + $this->subscriptionPlanData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectSubscriptionProduct.php b/src/Types/CatalogObjectSubscriptionProduct.php new file mode 100644 index 00000000..91a31e96 --- /dev/null +++ b/src/Types/CatalogObjectSubscriptionProduct.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectTax.php b/src/Types/CatalogObjectTax.php new file mode 100644 index 00000000..7115105b --- /dev/null +++ b/src/Types/CatalogObjectTax.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * taxData?: ?CatalogTax, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->taxData = $values['taxData'] ?? null; + } + + /** + * @return ?CatalogTax + */ + public function getTaxData(): ?CatalogTax + { + return $this->taxData; + } + + /** + * @param ?CatalogTax $value + */ + public function setTaxData(?CatalogTax $value = null): self + { + $this->taxData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectTaxExemption.php b/src/Types/CatalogObjectTaxExemption.php new file mode 100644 index 00000000..5fbbadf2 --- /dev/null +++ b/src/Types/CatalogObjectTaxExemption.php @@ -0,0 +1,49 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectTimePeriod.php b/src/Types/CatalogObjectTimePeriod.php new file mode 100644 index 00000000..614cfffa --- /dev/null +++ b/src/Types/CatalogObjectTimePeriod.php @@ -0,0 +1,74 @@ +, + * catalogV1Ids?: ?array, + * presentAtAllLocations?: ?bool, + * presentAtLocationIds?: ?array, + * absentAtLocationIds?: ?array, + * imageId?: ?string, + * timePeriodData?: ?CatalogTimePeriod, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->isDeleted = $values['isDeleted'] ?? null; + $this->customAttributeValues = $values['customAttributeValues'] ?? null; + $this->catalogV1Ids = $values['catalogV1Ids'] ?? null; + $this->presentAtAllLocations = $values['presentAtAllLocations'] ?? null; + $this->presentAtLocationIds = $values['presentAtLocationIds'] ?? null; + $this->absentAtLocationIds = $values['absentAtLocationIds'] ?? null; + $this->imageId = $values['imageId'] ?? null; + $this->timePeriodData = $values['timePeriodData'] ?? null; + } + + /** + * @return ?CatalogTimePeriod + */ + public function getTimePeriodData(): ?CatalogTimePeriod + { + return $this->timePeriodData; + } + + /** + * @param ?CatalogTimePeriod $value + */ + public function setTimePeriodData(?CatalogTimePeriod $value = null): self + { + $this->timePeriodData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogObjectType.php b/src/Types/CatalogObjectType.php new file mode 100644 index 00000000..b227e80c --- /dev/null +++ b/src/Types/CatalogObjectType.php @@ -0,0 +1,26 @@ + $timePeriodIds + */ + #[JsonProperty('time_period_ids'), ArrayType(['string'])] + private ?array $timePeriodIds; + + /** + * Unique ID for the `CatalogDiscount` to take off + * the price of all matched items. + * + * @var ?string $discountId + */ + #[JsonProperty('discount_id')] + private ?string $discountId; + + /** + * Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule + * matches within the entire cart, and can match multiple times. This field will always be set. + * + * @var ?string $matchProductsId + */ + #[JsonProperty('match_products_id')] + private ?string $matchProductsId; + + /** + * __Deprecated__: Please use the `exclude_products_id` field to apply + * an exclude set instead. Exclude sets allow better control over quantity + * ranges and offer more flexibility for which matched items receive a discount. + * + * `CatalogProductSet` to apply the pricing to. + * An apply rule matches within the subset of the cart that fits the match rules (the match set). + * An apply rule can only match once in the match set. + * If not supplied, the pricing will be applied to all products in the match set. + * Other products retain their base price, or a price generated by other rules. + * + * @var ?string $applyProductsId + */ + #[JsonProperty('apply_products_id')] + private ?string $applyProductsId; + + /** + * `CatalogProductSet` to exclude from the pricing rule. + * An exclude rule matches within the subset of the cart that fits the match rules (the match set). + * An exclude rule can only match once in the match set. + * If not supplied, the pricing will be applied to all products in the match set. + * Other products retain their base price, or a price generated by other rules. + * + * @var ?string $excludeProductsId + */ + #[JsonProperty('exclude_products_id')] + private ?string $excludeProductsId; + + /** + * @var ?string $validFromDate Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD). + */ + #[JsonProperty('valid_from_date')] + private ?string $validFromDate; + + /** + * Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial-time format + * (HH:MM:SS). Partial seconds will be truncated. + * + * @var ?string $validFromLocalTime + */ + #[JsonProperty('valid_from_local_time')] + private ?string $validFromLocalTime; + + /** + * @var ?string $validUntilDate Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD). + */ + #[JsonProperty('valid_until_date')] + private ?string $validUntilDate; + + /** + * Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial-time format + * (HH:MM:SS). Partial seconds will be truncated. + * + * @var ?string $validUntilLocalTime + */ + #[JsonProperty('valid_until_local_time')] + private ?string $validUntilLocalTime; + + /** + * If an `exclude_products_id` was given, controls which subset of matched + * products is excluded from any discounts. + * + * Default value: `LEAST_EXPENSIVE` + * See [ExcludeStrategy](#type-excludestrategy) for possible values + * + * @var ?value-of $excludeStrategy + */ + #[JsonProperty('exclude_strategy')] + private ?string $excludeStrategy; + + /** + * The minimum order subtotal (before discounts or taxes are applied) + * that must be met before this rule may be applied. + * + * @var ?Money $minimumOrderSubtotalMoney + */ + #[JsonProperty('minimum_order_subtotal_money')] + private ?Money $minimumOrderSubtotalMoney; + + /** + * A list of IDs of customer groups, the members of which are eligible for discounts specified in this pricing rule. + * Notice that a group ID is generated by the Customers API. + * If this field is not set, the specified discount applies to matched products sold to anyone whether the buyer + * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified discount + * applies only to matched products sold to customers belonging to the specified customer groups. + * + * @var ?array $customerGroupIdsAny + */ + #[JsonProperty('customer_group_ids_any'), ArrayType(['string'])] + private ?array $customerGroupIdsAny; + + /** + * @param array{ + * name?: ?string, + * timePeriodIds?: ?array, + * discountId?: ?string, + * matchProductsId?: ?string, + * applyProductsId?: ?string, + * excludeProductsId?: ?string, + * validFromDate?: ?string, + * validFromLocalTime?: ?string, + * validUntilDate?: ?string, + * validUntilLocalTime?: ?string, + * excludeStrategy?: ?value-of, + * minimumOrderSubtotalMoney?: ?Money, + * customerGroupIdsAny?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->timePeriodIds = $values['timePeriodIds'] ?? null; + $this->discountId = $values['discountId'] ?? null; + $this->matchProductsId = $values['matchProductsId'] ?? null; + $this->applyProductsId = $values['applyProductsId'] ?? null; + $this->excludeProductsId = $values['excludeProductsId'] ?? null; + $this->validFromDate = $values['validFromDate'] ?? null; + $this->validFromLocalTime = $values['validFromLocalTime'] ?? null; + $this->validUntilDate = $values['validUntilDate'] ?? null; + $this->validUntilLocalTime = $values['validUntilLocalTime'] ?? null; + $this->excludeStrategy = $values['excludeStrategy'] ?? null; + $this->minimumOrderSubtotalMoney = $values['minimumOrderSubtotalMoney'] ?? null; + $this->customerGroupIdsAny = $values['customerGroupIdsAny'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTimePeriodIds(): ?array + { + return $this->timePeriodIds; + } + + /** + * @param ?array $value + */ + public function setTimePeriodIds(?array $value = null): self + { + $this->timePeriodIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDiscountId(): ?string + { + return $this->discountId; + } + + /** + * @param ?string $value + */ + public function setDiscountId(?string $value = null): self + { + $this->discountId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMatchProductsId(): ?string + { + return $this->matchProductsId; + } + + /** + * @param ?string $value + */ + public function setMatchProductsId(?string $value = null): self + { + $this->matchProductsId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplyProductsId(): ?string + { + return $this->applyProductsId; + } + + /** + * @param ?string $value + */ + public function setApplyProductsId(?string $value = null): self + { + $this->applyProductsId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExcludeProductsId(): ?string + { + return $this->excludeProductsId; + } + + /** + * @param ?string $value + */ + public function setExcludeProductsId(?string $value = null): self + { + $this->excludeProductsId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getValidFromDate(): ?string + { + return $this->validFromDate; + } + + /** + * @param ?string $value + */ + public function setValidFromDate(?string $value = null): self + { + $this->validFromDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getValidFromLocalTime(): ?string + { + return $this->validFromLocalTime; + } + + /** + * @param ?string $value + */ + public function setValidFromLocalTime(?string $value = null): self + { + $this->validFromLocalTime = $value; + return $this; + } + + /** + * @return ?string + */ + public function getValidUntilDate(): ?string + { + return $this->validUntilDate; + } + + /** + * @param ?string $value + */ + public function setValidUntilDate(?string $value = null): self + { + $this->validUntilDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getValidUntilLocalTime(): ?string + { + return $this->validUntilLocalTime; + } + + /** + * @param ?string $value + */ + public function setValidUntilLocalTime(?string $value = null): self + { + $this->validUntilLocalTime = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getExcludeStrategy(): ?string + { + return $this->excludeStrategy; + } + + /** + * @param ?value-of $value + */ + public function setExcludeStrategy(?string $value = null): self + { + $this->excludeStrategy = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getMinimumOrderSubtotalMoney(): ?Money + { + return $this->minimumOrderSubtotalMoney; + } + + /** + * @param ?Money $value + */ + public function setMinimumOrderSubtotalMoney(?Money $value = null): self + { + $this->minimumOrderSubtotalMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomerGroupIdsAny(): ?array + { + return $this->customerGroupIdsAny; + } + + /** + * @param ?array $value + */ + public function setCustomerGroupIdsAny(?array $value = null): self + { + $this->customerGroupIdsAny = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogPricingType.php b/src/Types/CatalogPricingType.php new file mode 100644 index 00000000..443bf0e6 --- /dev/null +++ b/src/Types/CatalogPricingType.php @@ -0,0 +1,9 @@ + $productIdsAny + */ + #[JsonProperty('product_ids_any'), ArrayType(['string'])] + private ?array $productIdsAny; + + /** + * Unique IDs for any `CatalogObject` included in this product set. + * All objects in this set must be included in an order for a pricing rule to apply. + * + * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. + * + * Max: 500 catalog object IDs. + * + * @var ?array $productIdsAll + */ + #[JsonProperty('product_ids_all'), ArrayType(['string'])] + private ?array $productIdsAll; + + /** + * If set, there must be exactly this many items from `products_any` or `products_all` + * in the cart for the discount to apply. + * + * Cannot be combined with either `quantity_min` or `quantity_max`. + * + * @var ?int $quantityExact + */ + #[JsonProperty('quantity_exact')] + private ?int $quantityExact; + + /** + * If set, there must be at least this many items from `products_any` or `products_all` + * in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if + * `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. + * + * @var ?int $quantityMin + */ + #[JsonProperty('quantity_min')] + private ?int $quantityMin; + + /** + * If set, the pricing rule will apply to a maximum of this many items from + * `products_any` or `products_all`. + * + * @var ?int $quantityMax + */ + #[JsonProperty('quantity_max')] + private ?int $quantityMax; + + /** + * If set to `true`, the product set will include every item in the catalog. + * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. + * + * @var ?bool $allProducts + */ + #[JsonProperty('all_products')] + private ?bool $allProducts; + + /** + * @param array{ + * name?: ?string, + * productIdsAny?: ?array, + * productIdsAll?: ?array, + * quantityExact?: ?int, + * quantityMin?: ?int, + * quantityMax?: ?int, + * allProducts?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->productIdsAny = $values['productIdsAny'] ?? null; + $this->productIdsAll = $values['productIdsAll'] ?? null; + $this->quantityExact = $values['quantityExact'] ?? null; + $this->quantityMin = $values['quantityMin'] ?? null; + $this->quantityMax = $values['quantityMax'] ?? null; + $this->allProducts = $values['allProducts'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?array + */ + public function getProductIdsAny(): ?array + { + return $this->productIdsAny; + } + + /** + * @param ?array $value + */ + public function setProductIdsAny(?array $value = null): self + { + $this->productIdsAny = $value; + return $this; + } + + /** + * @return ?array + */ + public function getProductIdsAll(): ?array + { + return $this->productIdsAll; + } + + /** + * @param ?array $value + */ + public function setProductIdsAll(?array $value = null): self + { + $this->productIdsAll = $value; + return $this; + } + + /** + * @return ?int + */ + public function getQuantityExact(): ?int + { + return $this->quantityExact; + } + + /** + * @param ?int $value + */ + public function setQuantityExact(?int $value = null): self + { + $this->quantityExact = $value; + return $this; + } + + /** + * @return ?int + */ + public function getQuantityMin(): ?int + { + return $this->quantityMin; + } + + /** + * @param ?int $value + */ + public function setQuantityMin(?int $value = null): self + { + $this->quantityMin = $value; + return $this; + } + + /** + * @return ?int + */ + public function getQuantityMax(): ?int + { + return $this->quantityMax; + } + + /** + * @param ?int $value + */ + public function setQuantityMax(?int $value = null): self + { + $this->quantityMax = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAllProducts(): ?bool + { + return $this->allProducts; + } + + /** + * @param ?bool $value + */ + public function setAllProducts(?bool $value = null): self + { + $this->allProducts = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuery.php b/src/Types/CatalogQuery.php new file mode 100644 index 00000000..0cb4caa3 --- /dev/null +++ b/src/Types/CatalogQuery.php @@ -0,0 +1,325 @@ +sortedAttributeQuery = $values['sortedAttributeQuery'] ?? null; + $this->exactQuery = $values['exactQuery'] ?? null; + $this->setQuery = $values['setQuery'] ?? null; + $this->prefixQuery = $values['prefixQuery'] ?? null; + $this->rangeQuery = $values['rangeQuery'] ?? null; + $this->textQuery = $values['textQuery'] ?? null; + $this->itemsForTaxQuery = $values['itemsForTaxQuery'] ?? null; + $this->itemsForModifierListQuery = $values['itemsForModifierListQuery'] ?? null; + $this->itemsForItemOptionsQuery = $values['itemsForItemOptionsQuery'] ?? null; + $this->itemVariationsForItemOptionValuesQuery = $values['itemVariationsForItemOptionValuesQuery'] ?? null; + } + + /** + * @return ?CatalogQuerySortedAttribute + */ + public function getSortedAttributeQuery(): ?CatalogQuerySortedAttribute + { + return $this->sortedAttributeQuery; + } + + /** + * @param ?CatalogQuerySortedAttribute $value + */ + public function setSortedAttributeQuery(?CatalogQuerySortedAttribute $value = null): self + { + $this->sortedAttributeQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryExact + */ + public function getExactQuery(): ?CatalogQueryExact + { + return $this->exactQuery; + } + + /** + * @param ?CatalogQueryExact $value + */ + public function setExactQuery(?CatalogQueryExact $value = null): self + { + $this->exactQuery = $value; + return $this; + } + + /** + * @return ?CatalogQuerySet + */ + public function getSetQuery(): ?CatalogQuerySet + { + return $this->setQuery; + } + + /** + * @param ?CatalogQuerySet $value + */ + public function setSetQuery(?CatalogQuerySet $value = null): self + { + $this->setQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryPrefix + */ + public function getPrefixQuery(): ?CatalogQueryPrefix + { + return $this->prefixQuery; + } + + /** + * @param ?CatalogQueryPrefix $value + */ + public function setPrefixQuery(?CatalogQueryPrefix $value = null): self + { + $this->prefixQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryRange + */ + public function getRangeQuery(): ?CatalogQueryRange + { + return $this->rangeQuery; + } + + /** + * @param ?CatalogQueryRange $value + */ + public function setRangeQuery(?CatalogQueryRange $value = null): self + { + $this->rangeQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryText + */ + public function getTextQuery(): ?CatalogQueryText + { + return $this->textQuery; + } + + /** + * @param ?CatalogQueryText $value + */ + public function setTextQuery(?CatalogQueryText $value = null): self + { + $this->textQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryItemsForTax + */ + public function getItemsForTaxQuery(): ?CatalogQueryItemsForTax + { + return $this->itemsForTaxQuery; + } + + /** + * @param ?CatalogQueryItemsForTax $value + */ + public function setItemsForTaxQuery(?CatalogQueryItemsForTax $value = null): self + { + $this->itemsForTaxQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryItemsForModifierList + */ + public function getItemsForModifierListQuery(): ?CatalogQueryItemsForModifierList + { + return $this->itemsForModifierListQuery; + } + + /** + * @param ?CatalogQueryItemsForModifierList $value + */ + public function setItemsForModifierListQuery(?CatalogQueryItemsForModifierList $value = null): self + { + $this->itemsForModifierListQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryItemsForItemOptions + */ + public function getItemsForItemOptionsQuery(): ?CatalogQueryItemsForItemOptions + { + return $this->itemsForItemOptionsQuery; + } + + /** + * @param ?CatalogQueryItemsForItemOptions $value + */ + public function setItemsForItemOptionsQuery(?CatalogQueryItemsForItemOptions $value = null): self + { + $this->itemsForItemOptionsQuery = $value; + return $this; + } + + /** + * @return ?CatalogQueryItemVariationsForItemOptionValues + */ + public function getItemVariationsForItemOptionValuesQuery(): ?CatalogQueryItemVariationsForItemOptionValues + { + return $this->itemVariationsForItemOptionValuesQuery; + } + + /** + * @param ?CatalogQueryItemVariationsForItemOptionValues $value + */ + public function setItemVariationsForItemOptionValuesQuery(?CatalogQueryItemVariationsForItemOptionValues $value = null): self + { + $this->itemVariationsForItemOptionValuesQuery = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryExact.php b/src/Types/CatalogQueryExact.php new file mode 100644 index 00000000..a84d64b1 --- /dev/null +++ b/src/Types/CatalogQueryExact.php @@ -0,0 +1,82 @@ +attributeName = $values['attributeName']; + $this->attributeValue = $values['attributeValue']; + } + + /** + * @return string + */ + public function getAttributeName(): string + { + return $this->attributeName; + } + + /** + * @param string $value + */ + public function setAttributeName(string $value): self + { + $this->attributeName = $value; + return $this; + } + + /** + * @return string + */ + public function getAttributeValue(): string + { + return $this->attributeValue; + } + + /** + * @param string $value + */ + public function setAttributeValue(string $value): self + { + $this->attributeValue = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryItemVariationsForItemOptionValues.php b/src/Types/CatalogQueryItemVariationsForItemOptionValues.php new file mode 100644 index 00000000..a53b8902 --- /dev/null +++ b/src/Types/CatalogQueryItemVariationsForItemOptionValues.php @@ -0,0 +1,59 @@ + $itemOptionValueIds + */ + #[JsonProperty('item_option_value_ids'), ArrayType(['string'])] + private ?array $itemOptionValueIds; + + /** + * @param array{ + * itemOptionValueIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->itemOptionValueIds = $values['itemOptionValueIds'] ?? null; + } + + /** + * @return ?array + */ + public function getItemOptionValueIds(): ?array + { + return $this->itemOptionValueIds; + } + + /** + * @param ?array $value + */ + public function setItemOptionValueIds(?array $value = null): self + { + $this->itemOptionValueIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryItemsForItemOptions.php b/src/Types/CatalogQueryItemsForItemOptions.php new file mode 100644 index 00000000..4bb16726 --- /dev/null +++ b/src/Types/CatalogQueryItemsForItemOptions.php @@ -0,0 +1,59 @@ + $itemOptionIds + */ + #[JsonProperty('item_option_ids'), ArrayType(['string'])] + private ?array $itemOptionIds; + + /** + * @param array{ + * itemOptionIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->itemOptionIds = $values['itemOptionIds'] ?? null; + } + + /** + * @return ?array + */ + public function getItemOptionIds(): ?array + { + return $this->itemOptionIds; + } + + /** + * @param ?array $value + */ + public function setItemOptionIds(?array $value = null): self + { + $this->itemOptionIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryItemsForModifierList.php b/src/Types/CatalogQueryItemsForModifierList.php new file mode 100644 index 00000000..29323f56 --- /dev/null +++ b/src/Types/CatalogQueryItemsForModifierList.php @@ -0,0 +1,55 @@ + $modifierListIds A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. + */ + #[JsonProperty('modifier_list_ids'), ArrayType(['string'])] + private array $modifierListIds; + + /** + * @param array{ + * modifierListIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->modifierListIds = $values['modifierListIds']; + } + + /** + * @return array + */ + public function getModifierListIds(): array + { + return $this->modifierListIds; + } + + /** + * @param array $value + */ + public function setModifierListIds(array $value): self + { + $this->modifierListIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryItemsForTax.php b/src/Types/CatalogQueryItemsForTax.php new file mode 100644 index 00000000..eacef6cc --- /dev/null +++ b/src/Types/CatalogQueryItemsForTax.php @@ -0,0 +1,55 @@ + $taxIds A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. + */ + #[JsonProperty('tax_ids'), ArrayType(['string'])] + private array $taxIds; + + /** + * @param array{ + * taxIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->taxIds = $values['taxIds']; + } + + /** + * @return array + */ + public function getTaxIds(): array + { + return $this->taxIds; + } + + /** + * @param array $value + */ + public function setTaxIds(array $value): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryPrefix.php b/src/Types/CatalogQueryPrefix.php new file mode 100644 index 00000000..a7d36361 --- /dev/null +++ b/src/Types/CatalogQueryPrefix.php @@ -0,0 +1,79 @@ +attributeName = $values['attributeName']; + $this->attributePrefix = $values['attributePrefix']; + } + + /** + * @return string + */ + public function getAttributeName(): string + { + return $this->attributeName; + } + + /** + * @param string $value + */ + public function setAttributeName(string $value): self + { + $this->attributeName = $value; + return $this; + } + + /** + * @return string + */ + public function getAttributePrefix(): string + { + return $this->attributePrefix; + } + + /** + * @param string $value + */ + public function setAttributePrefix(string $value): self + { + $this->attributePrefix = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryRange.php b/src/Types/CatalogQueryRange.php new file mode 100644 index 00000000..83d0257e --- /dev/null +++ b/src/Types/CatalogQueryRange.php @@ -0,0 +1,104 @@ +attributeName = $values['attributeName']; + $this->attributeMinValue = $values['attributeMinValue'] ?? null; + $this->attributeMaxValue = $values['attributeMaxValue'] ?? null; + } + + /** + * @return string + */ + public function getAttributeName(): string + { + return $this->attributeName; + } + + /** + * @param string $value + */ + public function setAttributeName(string $value): self + { + $this->attributeName = $value; + return $this; + } + + /** + * @return ?int + */ + public function getAttributeMinValue(): ?int + { + return $this->attributeMinValue; + } + + /** + * @param ?int $value + */ + public function setAttributeMinValue(?int $value = null): self + { + $this->attributeMinValue = $value; + return $this; + } + + /** + * @return ?int + */ + public function getAttributeMaxValue(): ?int + { + return $this->attributeMaxValue; + } + + /** + * @param ?int $value + */ + public function setAttributeMaxValue(?int $value = null): self + { + $this->attributeMaxValue = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuerySet.php b/src/Types/CatalogQuerySet.php new file mode 100644 index 00000000..c9865992 --- /dev/null +++ b/src/Types/CatalogQuerySet.php @@ -0,0 +1,84 @@ + $attributeValues + */ + #[JsonProperty('attribute_values'), ArrayType(['string'])] + private array $attributeValues; + + /** + * @param array{ + * attributeName: string, + * attributeValues: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->attributeName = $values['attributeName']; + $this->attributeValues = $values['attributeValues']; + } + + /** + * @return string + */ + public function getAttributeName(): string + { + return $this->attributeName; + } + + /** + * @param string $value + */ + public function setAttributeName(string $value): self + { + $this->attributeName = $value; + return $this; + } + + /** + * @return array + */ + public function getAttributeValues(): array + { + return $this->attributeValues; + } + + /** + * @param array $value + */ + public function setAttributeValues(array $value): self + { + $this->attributeValues = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuerySortedAttribute.php b/src/Types/CatalogQuerySortedAttribute.php new file mode 100644 index 00000000..937022e0 --- /dev/null +++ b/src/Types/CatalogQuerySortedAttribute.php @@ -0,0 +1,111 @@ + $sortOrder + */ + #[JsonProperty('sort_order')] + private ?string $sortOrder; + + /** + * @param array{ + * attributeName: string, + * initialAttributeValue?: ?string, + * sortOrder?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->attributeName = $values['attributeName']; + $this->initialAttributeValue = $values['initialAttributeValue'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return string + */ + public function getAttributeName(): string + { + return $this->attributeName; + } + + /** + * @param string $value + */ + public function setAttributeName(string $value): self + { + $this->attributeName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInitialAttributeValue(): ?string + { + return $this->initialAttributeValue; + } + + /** + * @param ?string $value + */ + public function setInitialAttributeValue(?string $value = null): self + { + $this->initialAttributeValue = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQueryText.php b/src/Types/CatalogQueryText.php new file mode 100644 index 00000000..a49cc07b --- /dev/null +++ b/src/Types/CatalogQueryText.php @@ -0,0 +1,55 @@ + $keywords A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. + */ + #[JsonProperty('keywords'), ArrayType(['string'])] + private array $keywords; + + /** + * @param array{ + * keywords: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->keywords = $values['keywords']; + } + + /** + * @return array + */ + public function getKeywords(): array + { + return $this->keywords; + } + + /** + * @param array $value + */ + public function setKeywords(array $value): self + { + $this->keywords = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuickAmount.php b/src/Types/CatalogQuickAmount.php new file mode 100644 index 00000000..8c34538c --- /dev/null +++ b/src/Types/CatalogQuickAmount.php @@ -0,0 +1,135 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * @var Money $amount Represents the actual amount of the Quick Amount with Money type. + */ + #[JsonProperty('amount')] + private Money $amount; + + /** + * Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100]. + * MANUAL type amount will always have score = 100. + * + * @var ?int $score + */ + #[JsonProperty('score')] + private ?int $score; + + /** + * @var ?int $ordinal The order in which this Quick Amount should be displayed. + */ + #[JsonProperty('ordinal')] + private ?int $ordinal; + + /** + * @param array{ + * type: value-of, + * amount: Money, + * score?: ?int, + * ordinal?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->amount = $values['amount']; + $this->score = $values['score'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmount(): Money + { + return $this->amount; + } + + /** + * @param Money $value + */ + public function setAmount(Money $value): self + { + $this->amount = $value; + return $this; + } + + /** + * @return ?int + */ + public function getScore(): ?int + { + return $this->score; + } + + /** + * @param ?int $value + */ + public function setScore(?int $value = null): self + { + $this->score = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuickAmountType.php b/src/Types/CatalogQuickAmountType.php new file mode 100644 index 00000000..b998e728 --- /dev/null +++ b/src/Types/CatalogQuickAmountType.php @@ -0,0 +1,9 @@ + $option + */ + #[JsonProperty('option')] + private string $option; + + /** + * Represents location's eligibility for auto amounts + * The boolean should be consistent with whether there are AUTO amounts in the `amounts`. + * + * @var ?bool $eligibleForAutoAmounts + */ + #[JsonProperty('eligible_for_auto_amounts')] + private ?bool $eligibleForAutoAmounts; + + /** + * @var ?array $amounts Represents a set of Quick Amounts at this location. + */ + #[JsonProperty('amounts'), ArrayType([CatalogQuickAmount::class])] + private ?array $amounts; + + /** + * @param array{ + * option: value-of, + * eligibleForAutoAmounts?: ?bool, + * amounts?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->option = $values['option']; + $this->eligibleForAutoAmounts = $values['eligibleForAutoAmounts'] ?? null; + $this->amounts = $values['amounts'] ?? null; + } + + /** + * @return value-of + */ + public function getOption(): string + { + return $this->option; + } + + /** + * @param value-of $value + */ + public function setOption(string $value): self + { + $this->option = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEligibleForAutoAmounts(): ?bool + { + return $this->eligibleForAutoAmounts; + } + + /** + * @param ?bool $value + */ + public function setEligibleForAutoAmounts(?bool $value = null): self + { + $this->eligibleForAutoAmounts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAmounts(): ?array + { + return $this->amounts; + } + + /** + * @param ?array $value + */ + public function setAmounts(?array $value = null): self + { + $this->amounts = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogQuickAmountsSettingsOption.php b/src/Types/CatalogQuickAmountsSettingsOption.php new file mode 100644 index 00000000..05632460 --- /dev/null +++ b/src/Types/CatalogQuickAmountsSettingsOption.php @@ -0,0 +1,10 @@ +stockableItemVariationId = $values['stockableItemVariationId']; + $this->stockableQuantity = $values['stockableQuantity']; + $this->nonstockableQuantity = $values['nonstockableQuantity']; + } + + /** + * @return string + */ + public function getStockableItemVariationId(): string + { + return $this->stockableItemVariationId; + } + + /** + * @param string $value + */ + public function setStockableItemVariationId(string $value): self + { + $this->stockableItemVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function getStockableQuantity(): string + { + return $this->stockableQuantity; + } + + /** + * @param string $value + */ + public function setStockableQuantity(string $value): self + { + $this->stockableQuantity = $value; + return $this; + } + + /** + * @return string + */ + public function getNonstockableQuantity(): string + { + return $this->nonstockableQuantity; + } + + /** + * @param string $value + */ + public function setNonstockableQuantity(string $value): self + { + $this->nonstockableQuantity = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogSubscriptionPlan.php b/src/Types/CatalogSubscriptionPlan.php new file mode 100644 index 00000000..03a55944 --- /dev/null +++ b/src/Types/CatalogSubscriptionPlan.php @@ -0,0 +1,184 @@ + $phases + */ + #[JsonProperty('phases'), ArrayType([SubscriptionPhase::class])] + private ?array $phases; + + /** + * @var ?array $subscriptionPlanVariations The list of subscription plan variations available for this product + */ + #[JsonProperty('subscription_plan_variations'), ArrayType([CatalogObject::class])] + private ?array $subscriptionPlanVariations; + + /** + * @var ?array $eligibleItemIds The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. + */ + #[JsonProperty('eligible_item_ids'), ArrayType(['string'])] + private ?array $eligibleItemIds; + + /** + * @var ?array $eligibleCategoryIds The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations. + */ + #[JsonProperty('eligible_category_ids'), ArrayType(['string'])] + private ?array $eligibleCategoryIds; + + /** + * @var ?bool $allItems If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. + */ + #[JsonProperty('all_items')] + private ?bool $allItems; + + /** + * @param array{ + * name: string, + * phases?: ?array, + * subscriptionPlanVariations?: ?array, + * eligibleItemIds?: ?array, + * eligibleCategoryIds?: ?array, + * allItems?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->phases = $values['phases'] ?? null; + $this->subscriptionPlanVariations = $values['subscriptionPlanVariations'] ?? null; + $this->eligibleItemIds = $values['eligibleItemIds'] ?? null; + $this->eligibleCategoryIds = $values['eligibleCategoryIds'] ?? null; + $this->allItems = $values['allItems'] ?? null; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSubscriptionPlanVariations(): ?array + { + return $this->subscriptionPlanVariations; + } + + /** + * @param ?array $value + */ + public function setSubscriptionPlanVariations(?array $value = null): self + { + $this->subscriptionPlanVariations = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEligibleItemIds(): ?array + { + return $this->eligibleItemIds; + } + + /** + * @param ?array $value + */ + public function setEligibleItemIds(?array $value = null): self + { + $this->eligibleItemIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEligibleCategoryIds(): ?array + { + return $this->eligibleCategoryIds; + } + + /** + * @param ?array $value + */ + public function setEligibleCategoryIds(?array $value = null): self + { + $this->eligibleCategoryIds = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAllItems(): ?bool + { + return $this->allItems; + } + + /** + * @param ?bool $value + */ + public function setAllItems(?bool $value = null): self + { + $this->allItems = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogTax.php b/src/Types/CatalogTax.php new file mode 100644 index 00000000..c4e397f6 --- /dev/null +++ b/src/Types/CatalogTax.php @@ -0,0 +1,216 @@ + $calculationPhase + */ + #[JsonProperty('calculation_phase')] + private ?string $calculationPhase; + + /** + * Whether the tax is `ADDITIVE` or `INCLUSIVE`. + * See [TaxInclusionType](#type-taxinclusiontype) for possible values + * + * @var ?value-of $inclusionType + */ + #[JsonProperty('inclusion_type')] + private ?string $inclusionType; + + /** + * The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. + * A value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of the location or a tax consultant. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * If `true`, the fee applies to custom amounts entered into the Square Point of Sale + * app that are not associated with a particular `CatalogItem`. + * + * @var ?bool $appliesToCustomAmounts + */ + #[JsonProperty('applies_to_custom_amounts')] + private ?bool $appliesToCustomAmounts; + + /** + * @var ?bool $enabled A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`). + */ + #[JsonProperty('enabled')] + private ?bool $enabled; + + /** + * @var ?string $appliesToProductSetId The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product set. + */ + #[JsonProperty('applies_to_product_set_id')] + private ?string $appliesToProductSetId; + + /** + * @param array{ + * name?: ?string, + * calculationPhase?: ?value-of, + * inclusionType?: ?value-of, + * percentage?: ?string, + * appliesToCustomAmounts?: ?bool, + * enabled?: ?bool, + * appliesToProductSetId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->calculationPhase = $values['calculationPhase'] ?? null; + $this->inclusionType = $values['inclusionType'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->appliesToCustomAmounts = $values['appliesToCustomAmounts'] ?? null; + $this->enabled = $values['enabled'] ?? null; + $this->appliesToProductSetId = $values['appliesToProductSetId'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCalculationPhase(): ?string + { + return $this->calculationPhase; + } + + /** + * @param ?value-of $value + */ + public function setCalculationPhase(?string $value = null): self + { + $this->calculationPhase = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getInclusionType(): ?string + { + return $this->inclusionType; + } + + /** + * @param ?value-of $value + */ + public function setInclusionType(?string $value = null): self + { + $this->inclusionType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAppliesToCustomAmounts(): ?bool + { + return $this->appliesToCustomAmounts; + } + + /** + * @param ?bool $value + */ + public function setAppliesToCustomAmounts(?bool $value = null): self + { + $this->appliesToCustomAmounts = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAppliesToProductSetId(): ?string + { + return $this->appliesToProductSetId; + } + + /** + * @param ?string $value + */ + public function setAppliesToProductSetId(?string $value = null): self + { + $this->appliesToProductSetId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogTimePeriod.php b/src/Types/CatalogTimePeriod.php new file mode 100644 index 00000000..d0dc8b73 --- /dev/null +++ b/src/Types/CatalogTimePeriod.php @@ -0,0 +1,70 @@ +event = $values['event'] ?? null; + } + + /** + * @return ?string + */ + public function getEvent(): ?string + { + return $this->event; + } + + /** + * @param ?string $value + */ + public function setEvent(?string $value = null): self + { + $this->event = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CatalogV1Id.php b/src/Types/CatalogV1Id.php new file mode 100644 index 00000000..5b81ce91 --- /dev/null +++ b/src/Types/CatalogV1Id.php @@ -0,0 +1,79 @@ +catalogV1Id = $values['catalogV1Id'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getCatalogV1Id(): ?string + { + return $this->catalogV1Id; + } + + /** + * @param ?string $value + */ + public function setCatalogV1Id(?string $value = null): self + { + $this->catalogV1Id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CategoryPathToRootNode.php b/src/Types/CategoryPathToRootNode.php new file mode 100644 index 00000000..eceb4308 --- /dev/null +++ b/src/Types/CategoryPathToRootNode.php @@ -0,0 +1,79 @@ +categoryId = $values['categoryId'] ?? null; + $this->categoryName = $values['categoryName'] ?? null; + } + + /** + * @return ?string + */ + public function getCategoryId(): ?string + { + return $this->categoryId; + } + + /** + * @param ?string $value + */ + public function setCategoryId(?string $value = null): self + { + $this->categoryId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCategoryName(): ?string + { + return $this->categoryName; + } + + /** + * @param ?string $value + */ + public function setCategoryName(?string $value = null): self + { + $this->categoryName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeBillingAnchorDateResponse.php b/src/Types/ChangeBillingAnchorDateResponse.php new file mode 100644 index 00000000..d2d0e64f --- /dev/null +++ b/src/Types/ChangeBillingAnchorDateResponse.php @@ -0,0 +1,106 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The specified subscription for updating billing anchor date. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @var ?array $actions A list of a single billing anchor date change for the subscription. + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * actions?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeTiming.php b/src/Types/ChangeTiming.php new file mode 100644 index 00000000..777335ef --- /dev/null +++ b/src/Types/ChangeTiming.php @@ -0,0 +1,9 @@ +locationId = $values['locationId']; + $this->description = $values['description']; + $this->amountMoney = $values['amountMoney']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getDescription(): string + { + return $this->description; + } + + /** + * @param string $value + */ + public function setDescription(string $value): self + { + $this->description = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Checkout.php b/src/Types/Checkout.php new file mode 100644 index 00000000..b3a5c663 --- /dev/null +++ b/src/Types/Checkout.php @@ -0,0 +1,324 @@ +http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx + * + * If you do not provide a redirect URL, Square Checkout will display an order + * confirmation page on your behalf; however Square strongly recommends that + * you provide a redirect URL so you can verify the transaction results and + * finalize the order through your existing/normal confirmation workflow. + * + * @var ?string $redirectUrl + */ + #[JsonProperty('redirect_url')] + private ?string $redirectUrl; + + /** + * @var ?Order $order Order to be checked out. + */ + #[JsonProperty('order')] + private ?Order $order; + + /** + * @var ?string $createdAt The time when the checkout was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * Additional recipients (other than the merchant) receiving a portion of this checkout. + * For example, fees assessed on the purchase by a third party integration. + * + * @var ?array $additionalRecipients + */ + #[JsonProperty('additional_recipients'), ArrayType([AdditionalRecipient::class])] + private ?array $additionalRecipients; + + /** + * @param array{ + * id?: ?string, + * checkoutPageUrl?: ?string, + * askForShippingAddress?: ?bool, + * merchantSupportEmail?: ?string, + * prePopulateBuyerEmail?: ?string, + * prePopulateShippingAddress?: ?Address, + * redirectUrl?: ?string, + * order?: ?Order, + * createdAt?: ?string, + * additionalRecipients?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->checkoutPageUrl = $values['checkoutPageUrl'] ?? null; + $this->askForShippingAddress = $values['askForShippingAddress'] ?? null; + $this->merchantSupportEmail = $values['merchantSupportEmail'] ?? null; + $this->prePopulateBuyerEmail = $values['prePopulateBuyerEmail'] ?? null; + $this->prePopulateShippingAddress = $values['prePopulateShippingAddress'] ?? null; + $this->redirectUrl = $values['redirectUrl'] ?? null; + $this->order = $values['order'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->additionalRecipients = $values['additionalRecipients'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCheckoutPageUrl(): ?string + { + return $this->checkoutPageUrl; + } + + /** + * @param ?string $value + */ + public function setCheckoutPageUrl(?string $value = null): self + { + $this->checkoutPageUrl = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAskForShippingAddress(): ?bool + { + return $this->askForShippingAddress; + } + + /** + * @param ?bool $value + */ + public function setAskForShippingAddress(?bool $value = null): self + { + $this->askForShippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantSupportEmail(): ?string + { + return $this->merchantSupportEmail; + } + + /** + * @param ?string $value + */ + public function setMerchantSupportEmail(?string $value = null): self + { + $this->merchantSupportEmail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPrePopulateBuyerEmail(): ?string + { + return $this->prePopulateBuyerEmail; + } + + /** + * @param ?string $value + */ + public function setPrePopulateBuyerEmail(?string $value = null): self + { + $this->prePopulateBuyerEmail = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getPrePopulateShippingAddress(): ?Address + { + return $this->prePopulateShippingAddress; + } + + /** + * @param ?Address $value + */ + public function setPrePopulateShippingAddress(?Address $value = null): self + { + $this->prePopulateShippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRedirectUrl(): ?string + { + return $this->redirectUrl; + } + + /** + * @param ?string $value + */ + public function setRedirectUrl(?string $value = null): self + { + $this->redirectUrl = $value; + return $this; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAdditionalRecipients(): ?array + { + return $this->additionalRecipients; + } + + /** + * @param ?array $value + */ + public function setAdditionalRecipients(?array $value = null): self + { + $this->additionalRecipients = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutLocationSettings.php b/src/Types/CheckoutLocationSettings.php new file mode 100644 index 00000000..edfdbd76 --- /dev/null +++ b/src/Types/CheckoutLocationSettings.php @@ -0,0 +1,210 @@ + $policies + */ + #[JsonProperty('policies'), ArrayType([CheckoutLocationSettingsPolicy::class])] + private ?array $policies; + + /** + * @var ?CheckoutLocationSettingsBranding $branding The branding settings for this location. + */ + #[JsonProperty('branding')] + private ?CheckoutLocationSettingsBranding $branding; + + /** + * @var ?CheckoutLocationSettingsTipping $tipping The tip settings for this location. + */ + #[JsonProperty('tipping')] + private ?CheckoutLocationSettingsTipping $tipping; + + /** + * @var ?CheckoutLocationSettingsCoupons $coupons The coupon settings for this location. + */ + #[JsonProperty('coupons')] + private ?CheckoutLocationSettingsCoupons $coupons; + + /** + * The timestamp when the settings were last updated, in RFC 3339 format. + * Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: + * UTC: 2020-01-26T02:25:34Z + * Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 + * + * @var ?string $updatedAt + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * locationId?: ?string, + * customerNotesEnabled?: ?bool, + * policies?: ?array, + * branding?: ?CheckoutLocationSettingsBranding, + * tipping?: ?CheckoutLocationSettingsTipping, + * coupons?: ?CheckoutLocationSettingsCoupons, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->customerNotesEnabled = $values['customerNotesEnabled'] ?? null; + $this->policies = $values['policies'] ?? null; + $this->branding = $values['branding'] ?? null; + $this->tipping = $values['tipping'] ?? null; + $this->coupons = $values['coupons'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCustomerNotesEnabled(): ?bool + { + return $this->customerNotesEnabled; + } + + /** + * @param ?bool $value + */ + public function setCustomerNotesEnabled(?bool $value = null): self + { + $this->customerNotesEnabled = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPolicies(): ?array + { + return $this->policies; + } + + /** + * @param ?array $value + */ + public function setPolicies(?array $value = null): self + { + $this->policies = $value; + return $this; + } + + /** + * @return ?CheckoutLocationSettingsBranding + */ + public function getBranding(): ?CheckoutLocationSettingsBranding + { + return $this->branding; + } + + /** + * @param ?CheckoutLocationSettingsBranding $value + */ + public function setBranding(?CheckoutLocationSettingsBranding $value = null): self + { + $this->branding = $value; + return $this; + } + + /** + * @return ?CheckoutLocationSettingsTipping + */ + public function getTipping(): ?CheckoutLocationSettingsTipping + { + return $this->tipping; + } + + /** + * @param ?CheckoutLocationSettingsTipping $value + */ + public function setTipping(?CheckoutLocationSettingsTipping $value = null): self + { + $this->tipping = $value; + return $this; + } + + /** + * @return ?CheckoutLocationSettingsCoupons + */ + public function getCoupons(): ?CheckoutLocationSettingsCoupons + { + return $this->coupons; + } + + /** + * @param ?CheckoutLocationSettingsCoupons $value + */ + public function setCoupons(?CheckoutLocationSettingsCoupons $value = null): self + { + $this->coupons = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutLocationSettingsBranding.php b/src/Types/CheckoutLocationSettingsBranding.php new file mode 100644 index 00000000..7ba3a0bd --- /dev/null +++ b/src/Types/CheckoutLocationSettingsBranding.php @@ -0,0 +1,107 @@ + $headerType + */ + #[JsonProperty('header_type')] + private ?string $headerType; + + /** + * @var ?string $buttonColor The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF"). + */ + #[JsonProperty('button_color')] + private ?string $buttonColor; + + /** + * The shape of the button on the checkout page. + * See [ButtonShape](#type-buttonshape) for possible values + * + * @var ?value-of $buttonShape + */ + #[JsonProperty('button_shape')] + private ?string $buttonShape; + + /** + * @param array{ + * headerType?: ?value-of, + * buttonColor?: ?string, + * buttonShape?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->headerType = $values['headerType'] ?? null; + $this->buttonColor = $values['buttonColor'] ?? null; + $this->buttonShape = $values['buttonShape'] ?? null; + } + + /** + * @return ?value-of + */ + public function getHeaderType(): ?string + { + return $this->headerType; + } + + /** + * @param ?value-of $value + */ + public function setHeaderType(?string $value = null): self + { + $this->headerType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getButtonColor(): ?string + { + return $this->buttonColor; + } + + /** + * @param ?string $value + */ + public function setButtonColor(?string $value = null): self + { + $this->buttonColor = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getButtonShape(): ?string + { + return $this->buttonShape; + } + + /** + * @param ?value-of $value + */ + public function setButtonShape(?string $value = null): self + { + $this->buttonShape = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutLocationSettingsBrandingButtonShape.php b/src/Types/CheckoutLocationSettingsBrandingButtonShape.php new file mode 100644 index 00000000..f844a7ae --- /dev/null +++ b/src/Types/CheckoutLocationSettingsBrandingButtonShape.php @@ -0,0 +1,10 @@ +enabled = $values['enabled'] ?? null; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutLocationSettingsPolicy.php b/src/Types/CheckoutLocationSettingsPolicy.php new file mode 100644 index 00000000..21c2aaa4 --- /dev/null +++ b/src/Types/CheckoutLocationSettingsPolicy.php @@ -0,0 +1,101 @@ +uid = $values['uid'] ?? null; + $this->title = $values['title'] ?? null; + $this->description = $values['description'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutLocationSettingsTipping.php b/src/Types/CheckoutLocationSettingsTipping.php new file mode 100644 index 00000000..e10544ff --- /dev/null +++ b/src/Types/CheckoutLocationSettingsTipping.php @@ -0,0 +1,157 @@ + $percentages Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. + */ + #[JsonProperty('percentages'), ArrayType(['integer'])] + private ?array $percentages; + + /** + * Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows: + * If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3. + * If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. + * You can set custom percentage amounts with the `percentages` field. + * + * @var ?bool $smartTippingEnabled + */ + #[JsonProperty('smart_tipping_enabled')] + private ?bool $smartTippingEnabled; + + /** + * @var ?int $defaultPercent Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. + */ + #[JsonProperty('default_percent')] + private ?int $defaultPercent; + + /** + * @var ?array $smartTips Show the Smart Tip Amounts for this location. + */ + #[JsonProperty('smart_tips'), ArrayType([Money::class])] + private ?array $smartTips; + + /** + * @var ?Money $defaultSmartTip Set the pre-selected whole amount that appears at checkout when Smart Tip is enabled and the transaction amount is less than $10. + */ + #[JsonProperty('default_smart_tip')] + private ?Money $defaultSmartTip; + + /** + * @param array{ + * percentages?: ?array, + * smartTippingEnabled?: ?bool, + * defaultPercent?: ?int, + * smartTips?: ?array, + * defaultSmartTip?: ?Money, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->percentages = $values['percentages'] ?? null; + $this->smartTippingEnabled = $values['smartTippingEnabled'] ?? null; + $this->defaultPercent = $values['defaultPercent'] ?? null; + $this->smartTips = $values['smartTips'] ?? null; + $this->defaultSmartTip = $values['defaultSmartTip'] ?? null; + } + + /** + * @return ?array + */ + public function getPercentages(): ?array + { + return $this->percentages; + } + + /** + * @param ?array $value + */ + public function setPercentages(?array $value = null): self + { + $this->percentages = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSmartTippingEnabled(): ?bool + { + return $this->smartTippingEnabled; + } + + /** + * @param ?bool $value + */ + public function setSmartTippingEnabled(?bool $value = null): self + { + $this->smartTippingEnabled = $value; + return $this; + } + + /** + * @return ?int + */ + public function getDefaultPercent(): ?int + { + return $this->defaultPercent; + } + + /** + * @param ?int $value + */ + public function setDefaultPercent(?int $value = null): self + { + $this->defaultPercent = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSmartTips(): ?array + { + return $this->smartTips; + } + + /** + * @param ?array $value + */ + public function setSmartTips(?array $value = null): self + { + $this->smartTips = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getDefaultSmartTip(): ?Money + { + return $this->defaultSmartTip; + } + + /** + * @param ?Money $value + */ + public function setDefaultSmartTip(?Money $value = null): self + { + $this->defaultSmartTip = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutMerchantSettings.php b/src/Types/CheckoutMerchantSettings.php new file mode 100644 index 00000000..4e20b464 --- /dev/null +++ b/src/Types/CheckoutMerchantSettings.php @@ -0,0 +1,81 @@ +paymentMethods = $values['paymentMethods'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethods + */ + public function getPaymentMethods(): ?CheckoutMerchantSettingsPaymentMethods + { + return $this->paymentMethods; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethods $value + */ + public function setPaymentMethods(?CheckoutMerchantSettingsPaymentMethods $value = null): self + { + $this->paymentMethods = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutMerchantSettingsPaymentMethods.php b/src/Types/CheckoutMerchantSettingsPaymentMethods.php new file mode 100644 index 00000000..bdf488b5 --- /dev/null +++ b/src/Types/CheckoutMerchantSettingsPaymentMethods.php @@ -0,0 +1,126 @@ +applePay = $values['applePay'] ?? null; + $this->googlePay = $values['googlePay'] ?? null; + $this->cashApp = $values['cashApp'] ?? null; + $this->afterpayClearpay = $values['afterpayClearpay'] ?? null; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + */ + public function getApplePay(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + { + return $this->applePay; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value + */ + public function setApplePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value = null): self + { + $this->applePay = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + */ + public function getGooglePay(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + { + return $this->googlePay; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value + */ + public function setGooglePay(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value = null): self + { + $this->googlePay = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + */ + public function getCashApp(): ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod + { + return $this->cashApp; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value + */ + public function setCashApp(?CheckoutMerchantSettingsPaymentMethodsPaymentMethod $value = null): self + { + $this->cashApp = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay + */ + public function getAfterpayClearpay(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay + { + return $this->afterpayClearpay; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay $value + */ + public function setAfterpayClearpay(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay $value = null): self + { + $this->afterpayClearpay = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php b/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php new file mode 100644 index 00000000..cbd727b0 --- /dev/null +++ b/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.php @@ -0,0 +1,104 @@ +orderEligibilityRange = $values['orderEligibilityRange'] ?? null; + $this->itemEligibilityRange = $values['itemEligibilityRange'] ?? null; + $this->enabled = $values['enabled'] ?? null; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange + */ + public function getOrderEligibilityRange(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange + { + return $this->orderEligibilityRange; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value + */ + public function setOrderEligibilityRange(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value = null): self + { + $this->orderEligibilityRange = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange + */ + public function getItemEligibilityRange(): ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange + { + return $this->itemEligibilityRange; + } + + /** + * @param ?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value + */ + public function setItemEligibilityRange(?CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange $value = null): self + { + $this->itemEligibilityRange = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php b/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php new file mode 100644 index 00000000..1dd8adaa --- /dev/null +++ b/src/Types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.php @@ -0,0 +1,79 @@ +min = $values['min']; + $this->max = $values['max']; + } + + /** + * @return Money + */ + public function getMin(): Money + { + return $this->min; + } + + /** + * @param Money $value + */ + public function setMin(Money $value): self + { + $this->min = $value; + return $this; + } + + /** + * @return Money + */ + public function getMax(): Money + { + return $this->max; + } + + /** + * @param Money $value + */ + public function setMax(Money $value): self + { + $this->max = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php b/src/Types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php new file mode 100644 index 00000000..ec73c401 --- /dev/null +++ b/src/Types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.php @@ -0,0 +1,54 @@ +enabled = $values['enabled'] ?? null; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutOptions.php b/src/Types/CheckoutOptions.php new file mode 100644 index 00000000..e8877dc0 --- /dev/null +++ b/src/Types/CheckoutOptions.php @@ -0,0 +1,315 @@ + $customFields The custom fields requesting information from the buyer. + */ + #[JsonProperty('custom_fields'), ArrayType([CustomField::class])] + private ?array $customFields; + + /** + * The ID of the subscription plan for the buyer to pay and subscribe. + * For more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout). + * + * @var ?string $subscriptionPlanId + */ + #[JsonProperty('subscription_plan_id')] + private ?string $subscriptionPlanId; + + /** + * @var ?string $redirectUrl The confirmation page URL to redirect the buyer to after Square processes the payment. + */ + #[JsonProperty('redirect_url')] + private ?string $redirectUrl; + + /** + * @var ?string $merchantSupportEmail The email address that buyers can use to contact the seller. + */ + #[JsonProperty('merchant_support_email')] + private ?string $merchantSupportEmail; + + /** + * @var ?bool $askForShippingAddress Indicates whether to include the address fields in the payment form. + */ + #[JsonProperty('ask_for_shipping_address')] + private ?bool $askForShippingAddress; + + /** + * @var ?AcceptedPaymentMethods $acceptedPaymentMethods The methods allowed for buyers during checkout. + */ + #[JsonProperty('accepted_payment_methods')] + private ?AcceptedPaymentMethods $acceptedPaymentMethods; + + /** + * The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller. + * + * The amount cannot be more than 90% of the total amount of the payment. + * + * The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-monetary-amounts). + * + * The fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller. For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + * + * To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/collect-fees/additional-considerations#permissions). + * + * @var ?Money $appFeeMoney + */ + #[JsonProperty('app_fee_money')] + private ?Money $appFeeMoney; + + /** + * @var ?ShippingFee $shippingFee The fee associated with shipping to be applied to the `Order` as a service charge. + */ + #[JsonProperty('shipping_fee')] + private ?ShippingFee $shippingFee; + + /** + * @var ?bool $enableCoupon Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form. + */ + #[JsonProperty('enable_coupon')] + private ?bool $enableCoupon; + + /** + * @var ?bool $enableLoyalty Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both. + */ + #[JsonProperty('enable_loyalty')] + private ?bool $enableLoyalty; + + /** + * @param array{ + * allowTipping?: ?bool, + * customFields?: ?array, + * subscriptionPlanId?: ?string, + * redirectUrl?: ?string, + * merchantSupportEmail?: ?string, + * askForShippingAddress?: ?bool, + * acceptedPaymentMethods?: ?AcceptedPaymentMethods, + * appFeeMoney?: ?Money, + * shippingFee?: ?ShippingFee, + * enableCoupon?: ?bool, + * enableLoyalty?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->allowTipping = $values['allowTipping'] ?? null; + $this->customFields = $values['customFields'] ?? null; + $this->subscriptionPlanId = $values['subscriptionPlanId'] ?? null; + $this->redirectUrl = $values['redirectUrl'] ?? null; + $this->merchantSupportEmail = $values['merchantSupportEmail'] ?? null; + $this->askForShippingAddress = $values['askForShippingAddress'] ?? null; + $this->acceptedPaymentMethods = $values['acceptedPaymentMethods'] ?? null; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->shippingFee = $values['shippingFee'] ?? null; + $this->enableCoupon = $values['enableCoupon'] ?? null; + $this->enableLoyalty = $values['enableLoyalty'] ?? null; + } + + /** + * @return ?bool + */ + public function getAllowTipping(): ?bool + { + return $this->allowTipping; + } + + /** + * @param ?bool $value + */ + public function setAllowTipping(?bool $value = null): self + { + $this->allowTipping = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomFields(): ?array + { + return $this->customFields; + } + + /** + * @param ?array $value + */ + public function setCustomFields(?array $value = null): self + { + $this->customFields = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSubscriptionPlanId(): ?string + { + return $this->subscriptionPlanId; + } + + /** + * @param ?string $value + */ + public function setSubscriptionPlanId(?string $value = null): self + { + $this->subscriptionPlanId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRedirectUrl(): ?string + { + return $this->redirectUrl; + } + + /** + * @param ?string $value + */ + public function setRedirectUrl(?string $value = null): self + { + $this->redirectUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantSupportEmail(): ?string + { + return $this->merchantSupportEmail; + } + + /** + * @param ?string $value + */ + public function setMerchantSupportEmail(?string $value = null): self + { + $this->merchantSupportEmail = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAskForShippingAddress(): ?bool + { + return $this->askForShippingAddress; + } + + /** + * @param ?bool $value + */ + public function setAskForShippingAddress(?bool $value = null): self + { + $this->askForShippingAddress = $value; + return $this; + } + + /** + * @return ?AcceptedPaymentMethods + */ + public function getAcceptedPaymentMethods(): ?AcceptedPaymentMethods + { + return $this->acceptedPaymentMethods; + } + + /** + * @param ?AcceptedPaymentMethods $value + */ + public function setAcceptedPaymentMethods(?AcceptedPaymentMethods $value = null): self + { + $this->acceptedPaymentMethods = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?ShippingFee + */ + public function getShippingFee(): ?ShippingFee + { + return $this->shippingFee; + } + + /** + * @param ?ShippingFee $value + */ + public function setShippingFee(?ShippingFee $value = null): self + { + $this->shippingFee = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnableCoupon(): ?bool + { + return $this->enableCoupon; + } + + /** + * @param ?bool $value + */ + public function setEnableCoupon(?bool $value = null): self + { + $this->enableCoupon = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnableLoyalty(): ?bool + { + return $this->enableLoyalty; + } + + /** + * @param ?bool $value + */ + public function setEnableLoyalty(?bool $value = null): self + { + $this->enableLoyalty = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CheckoutOptionsPaymentType.php b/src/Types/CheckoutOptionsPaymentType.php new file mode 100644 index 00000000..8048e23f --- /dev/null +++ b/src/Types/CheckoutOptionsPaymentType.php @@ -0,0 +1,15 @@ +emailAddress = $values['emailAddress'] ?? null; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CloneOrderResponse.php b/src/Types/CloneOrderResponse.php new file mode 100644 index 00000000..e21bd1c0 --- /dev/null +++ b/src/Types/CloneOrderResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * order?: ?Order, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->order = $values['order'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CollectedData.php b/src/Types/CollectedData.php new file mode 100644 index 00000000..d50ebd9d --- /dev/null +++ b/src/Types/CollectedData.php @@ -0,0 +1,51 @@ +inputText = $values['inputText'] ?? null; + } + + /** + * @return ?string + */ + public function getInputText(): ?string + { + return $this->inputText; + } + + /** + * @param ?string $value + */ + public function setInputText(?string $value = null): self + { + $this->inputText = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CompletePaymentResponse.php b/src/Types/CompletePaymentResponse.php new file mode 100644 index 00000000..30ba5af2 --- /dev/null +++ b/src/Types/CompletePaymentResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Payment $payment The successfully completed payment. + */ + #[JsonProperty('payment')] + private ?Payment $payment; + + /** + * @param array{ + * errors?: ?array, + * payment?: ?Payment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payment = $values['payment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Component.php b/src/Types/Component.php new file mode 100644 index 00000000..cc7e345c --- /dev/null +++ b/src/Types/Component.php @@ -0,0 +1,183 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * @var ?DeviceComponentDetailsApplicationDetails $applicationDetails Structured data for an `Application`, set for Components of type `APPLICATION`. + */ + #[JsonProperty('application_details')] + private ?DeviceComponentDetailsApplicationDetails $applicationDetails; + + /** + * @var ?DeviceComponentDetailsCardReaderDetails $cardReaderDetails Structured data for a `CardReader`, set for Components of type `CARD_READER`. + */ + #[JsonProperty('card_reader_details')] + private ?DeviceComponentDetailsCardReaderDetails $cardReaderDetails; + + /** + * @var ?DeviceComponentDetailsBatteryDetails $batteryDetails Structured data for a `Battery`, set for Components of type `BATTERY`. + */ + #[JsonProperty('battery_details')] + private ?DeviceComponentDetailsBatteryDetails $batteryDetails; + + /** + * @var ?DeviceComponentDetailsWiFiDetails $wifiDetails Structured data for a `WiFi` interface, set for Components of type `WIFI`. + */ + #[JsonProperty('wifi_details')] + private ?DeviceComponentDetailsWiFiDetails $wifiDetails; + + /** + * @var ?DeviceComponentDetailsEthernetDetails $ethernetDetails Structured data for an `Ethernet` interface, set for Components of type `ETHERNET`. + */ + #[JsonProperty('ethernet_details')] + private ?DeviceComponentDetailsEthernetDetails $ethernetDetails; + + /** + * @param array{ + * type: value-of, + * applicationDetails?: ?DeviceComponentDetailsApplicationDetails, + * cardReaderDetails?: ?DeviceComponentDetailsCardReaderDetails, + * batteryDetails?: ?DeviceComponentDetailsBatteryDetails, + * wifiDetails?: ?DeviceComponentDetailsWiFiDetails, + * ethernetDetails?: ?DeviceComponentDetailsEthernetDetails, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->applicationDetails = $values['applicationDetails'] ?? null; + $this->cardReaderDetails = $values['cardReaderDetails'] ?? null; + $this->batteryDetails = $values['batteryDetails'] ?? null; + $this->wifiDetails = $values['wifiDetails'] ?? null; + $this->ethernetDetails = $values['ethernetDetails'] ?? null; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsApplicationDetails + */ + public function getApplicationDetails(): ?DeviceComponentDetailsApplicationDetails + { + return $this->applicationDetails; + } + + /** + * @param ?DeviceComponentDetailsApplicationDetails $value + */ + public function setApplicationDetails(?DeviceComponentDetailsApplicationDetails $value = null): self + { + $this->applicationDetails = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsCardReaderDetails + */ + public function getCardReaderDetails(): ?DeviceComponentDetailsCardReaderDetails + { + return $this->cardReaderDetails; + } + + /** + * @param ?DeviceComponentDetailsCardReaderDetails $value + */ + public function setCardReaderDetails(?DeviceComponentDetailsCardReaderDetails $value = null): self + { + $this->cardReaderDetails = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsBatteryDetails + */ + public function getBatteryDetails(): ?DeviceComponentDetailsBatteryDetails + { + return $this->batteryDetails; + } + + /** + * @param ?DeviceComponentDetailsBatteryDetails $value + */ + public function setBatteryDetails(?DeviceComponentDetailsBatteryDetails $value = null): self + { + $this->batteryDetails = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsWiFiDetails + */ + public function getWifiDetails(): ?DeviceComponentDetailsWiFiDetails + { + return $this->wifiDetails; + } + + /** + * @param ?DeviceComponentDetailsWiFiDetails $value + */ + public function setWifiDetails(?DeviceComponentDetailsWiFiDetails $value = null): self + { + $this->wifiDetails = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsEthernetDetails + */ + public function getEthernetDetails(): ?DeviceComponentDetailsEthernetDetails + { + return $this->ethernetDetails; + } + + /** + * @param ?DeviceComponentDetailsEthernetDetails $value + */ + public function setEthernetDetails(?DeviceComponentDetailsEthernetDetails $value = null): self + { + $this->ethernetDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ComponentComponentType.php b/src/Types/ComponentComponentType.php new file mode 100644 index 00000000..f2e55249 --- /dev/null +++ b/src/Types/ComponentComponentType.php @@ -0,0 +1,13 @@ +hasAgreed = $values['hasAgreed'] ?? null; + } + + /** + * @return ?bool + */ + public function getHasAgreed(): ?bool + { + return $this->hasAgreed; + } + + /** + * @param ?bool $value + */ + public function setHasAgreed(?bool $value = null): self + { + $this->hasAgreed = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ConfirmationOptions.php b/src/Types/ConfirmationOptions.php new file mode 100644 index 00000000..9cf9104c --- /dev/null +++ b/src/Types/ConfirmationOptions.php @@ -0,0 +1,151 @@ +title = $values['title']; + $this->body = $values['body']; + $this->agreeButtonText = $values['agreeButtonText']; + $this->disagreeButtonText = $values['disagreeButtonText'] ?? null; + $this->decision = $values['decision'] ?? null; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function getBody(): string + { + return $this->body; + } + + /** + * @param string $value + */ + public function setBody(string $value): self + { + $this->body = $value; + return $this; + } + + /** + * @return string + */ + public function getAgreeButtonText(): string + { + return $this->agreeButtonText; + } + + /** + * @param string $value + */ + public function setAgreeButtonText(string $value): self + { + $this->agreeButtonText = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisagreeButtonText(): ?string + { + return $this->disagreeButtonText; + } + + /** + * @param ?string $value + */ + public function setDisagreeButtonText(?string $value = null): self + { + $this->disagreeButtonText = $value; + return $this; + } + + /** + * @return ?ConfirmationDecision + */ + public function getDecision(): ?ConfirmationDecision + { + return $this->decision; + } + + /** + * @param ?ConfirmationDecision $value + */ + public function setDecision(?ConfirmationDecision $value = null): self + { + $this->decision = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Coordinates.php b/src/Types/Coordinates.php new file mode 100644 index 00000000..c0ceadcb --- /dev/null +++ b/src/Types/Coordinates.php @@ -0,0 +1,79 @@ +latitude = $values['latitude'] ?? null; + $this->longitude = $values['longitude'] ?? null; + } + + /** + * @return ?float + */ + public function getLatitude(): ?float + { + return $this->latitude; + } + + /** + * @param ?float $value + */ + public function setLatitude(?float $value = null): self + { + $this->latitude = $value; + return $this; + } + + /** + * @return ?float + */ + public function getLongitude(): ?float + { + return $this->longitude; + } + + /** + * @param ?float $value + */ + public function setLongitude(?float $value = null): self + { + $this->longitude = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Country.php b/src/Types/Country.php new file mode 100644 index 00000000..ff951a83 --- /dev/null +++ b/src/Types/Country.php @@ -0,0 +1,257 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateBookingResponse.php b/src/Types/CreateBookingResponse.php new file mode 100644 index 00000000..23f52c35 --- /dev/null +++ b/src/Types/CreateBookingResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * booking?: ?Booking, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->booking = $values['booking'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Booking + */ + public function getBooking(): ?Booking + { + return $this->booking; + } + + /** + * @param ?Booking $value + */ + public function setBooking(?Booking $value = null): self + { + $this->booking = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateBreakTypeResponse.php b/src/Types/CreateBreakTypeResponse.php new file mode 100644 index 00000000..a980b3a0 --- /dev/null +++ b/src/Types/CreateBreakTypeResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * breakType?: ?BreakType, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->breakType = $values['breakType'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BreakType + */ + public function getBreakType(): ?BreakType + { + return $this->breakType; + } + + /** + * @param ?BreakType $value + */ + public function setBreakType(?BreakType $value = null): self + { + $this->breakType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCardResponse.php b/src/Types/CreateCardResponse.php new file mode 100644 index 00000000..8036aac6 --- /dev/null +++ b/src/Types/CreateCardResponse.php @@ -0,0 +1,84 @@ + $errors Errors resulting from the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Card $card The card created by the request. + */ + #[JsonProperty('card')] + private ?Card $card; + + /** + * @param array{ + * errors?: ?array, + * card?: ?Card, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->card = $values['card'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCatalogImageRequest.php b/src/Types/CreateCatalogImageRequest.php new file mode 100644 index 00000000..6ad8e092 --- /dev/null +++ b/src/Types/CreateCatalogImageRequest.php @@ -0,0 +1,141 @@ +idempotencyKey = $values['idempotencyKey']; + $this->objectId = $values['objectId'] ?? null; + $this->image = $values['image']; + $this->isPrimary = $values['isPrimary'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?string + */ + public function getObjectId(): ?string + { + return $this->objectId; + } + + /** + * @param ?string $value + */ + public function setObjectId(?string $value = null): self + { + $this->objectId = $value; + return $this; + } + + /** + * @return CatalogObject + */ + public function getImage(): CatalogObject + { + return $this->image; + } + + /** + * @param CatalogObject $value + */ + public function setImage(CatalogObject $value): self + { + $this->image = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsPrimary(): ?bool + { + return $this->isPrimary; + } + + /** + * @param ?bool $value + */ + public function setIsPrimary(?bool $value = null): self + { + $this->isPrimary = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCatalogImageResponse.php b/src/Types/CreateCatalogImageResponse.php new file mode 100644 index 00000000..4fe41995 --- /dev/null +++ b/src/Types/CreateCatalogImageResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The newly created `CatalogImage` including a Square-generated + * URL for the encapsulated image file. + * + * @var ?CatalogObject $image + */ + #[JsonProperty('image')] + private ?CatalogObject $image; + + /** + * @param array{ + * errors?: ?array, + * image?: ?CatalogObject, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->image = $values['image'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CatalogObject + */ + public function getImage(): ?CatalogObject + { + return $this->image; + } + + /** + * @param ?CatalogObject $value + */ + public function setImage(?CatalogObject $value = null): self + { + $this->image = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCheckoutResponse.php b/src/Types/CreateCheckoutResponse.php new file mode 100644 index 00000000..ed541751 --- /dev/null +++ b/src/Types/CreateCheckoutResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * checkout?: ?Checkout, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->checkout = $values['checkout'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Checkout + */ + public function getCheckout(): ?Checkout + { + return $this->checkout; + } + + /** + * @param ?Checkout $value + */ + public function setCheckout(?Checkout $value = null): self + { + $this->checkout = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCustomerCardResponse.php b/src/Types/CreateCustomerCardResponse.php new file mode 100644 index 00000000..82f74635 --- /dev/null +++ b/src/Types/CreateCustomerCardResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Card $card The created card on file. + */ + #[JsonProperty('card')] + private ?Card $card; + + /** + * @param array{ + * errors?: ?array, + * card?: ?Card, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->card = $values['card'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCustomerCustomAttributeDefinitionResponse.php b/src/Types/CreateCustomerCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..c00bdf6a --- /dev/null +++ b/src/Types/CreateCustomerCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCustomerGroupResponse.php b/src/Types/CreateCustomerGroupResponse.php new file mode 100644 index 00000000..537d08d5 --- /dev/null +++ b/src/Types/CreateCustomerGroupResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CustomerGroup $group The successfully created customer group. + */ + #[JsonProperty('group')] + private ?CustomerGroup $group; + + /** + * @param array{ + * errors?: ?array, + * group?: ?CustomerGroup, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->group = $values['group'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CustomerGroup + */ + public function getGroup(): ?CustomerGroup + { + return $this->group; + } + + /** + * @param ?CustomerGroup $value + */ + public function setGroup(?CustomerGroup $value = null): self + { + $this->group = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateCustomerResponse.php b/src/Types/CreateCustomerResponse.php new file mode 100644 index 00000000..75e24005 --- /dev/null +++ b/src/Types/CreateCustomerResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Customer $customer The created customer. + */ + #[JsonProperty('customer')] + private ?Customer $customer; + + /** + * @param array{ + * errors?: ?array, + * customer?: ?Customer, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->customer = $values['customer'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Customer + */ + public function getCustomer(): ?Customer + { + return $this->customer; + } + + /** + * @param ?Customer $value + */ + public function setCustomer(?Customer $value = null): self + { + $this->customer = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateDeviceCodeResponse.php b/src/Types/CreateDeviceCodeResponse.php new file mode 100644 index 00000000..1c08e331 --- /dev/null +++ b/src/Types/CreateDeviceCodeResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?DeviceCode $deviceCode The created DeviceCode object containing the device code string. + */ + #[JsonProperty('device_code')] + private ?DeviceCode $deviceCode; + + /** + * @param array{ + * errors?: ?array, + * deviceCode?: ?DeviceCode, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->deviceCode = $values['deviceCode'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?DeviceCode + */ + public function getDeviceCode(): ?DeviceCode + { + return $this->deviceCode; + } + + /** + * @param ?DeviceCode $value + */ + public function setDeviceCode(?DeviceCode $value = null): self + { + $this->deviceCode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateDisputeEvidenceFileRequest.php b/src/Types/CreateDisputeEvidenceFileRequest.php new file mode 100644 index 00000000..75f73bcc --- /dev/null +++ b/src/Types/CreateDisputeEvidenceFileRequest.php @@ -0,0 +1,110 @@ + $evidenceType + */ + #[JsonProperty('evidence_type')] + private ?string $evidenceType; + + /** + * The MIME type of the uploaded file. + * The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff. + * + * @var ?string $contentType + */ + #[JsonProperty('content_type')] + private ?string $contentType; + + /** + * @param array{ + * idempotencyKey: string, + * evidenceType?: ?value-of, + * contentType?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->idempotencyKey = $values['idempotencyKey']; + $this->evidenceType = $values['evidenceType'] ?? null; + $this->contentType = $values['contentType'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEvidenceType(): ?string + { + return $this->evidenceType; + } + + /** + * @param ?value-of $value + */ + public function setEvidenceType(?string $value = null): self + { + $this->evidenceType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getContentType(): ?string + { + return $this->contentType; + } + + /** + * @param ?string $value + */ + public function setContentType(?string $value = null): self + { + $this->contentType = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateDisputeEvidenceFileResponse.php b/src/Types/CreateDisputeEvidenceFileResponse.php new file mode 100644 index 00000000..f9d52c25 --- /dev/null +++ b/src/Types/CreateDisputeEvidenceFileResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?DisputeEvidence $evidence The metadata of the newly uploaded dispute evidence. + */ + #[JsonProperty('evidence')] + private ?DisputeEvidence $evidence; + + /** + * @param array{ + * errors?: ?array, + * evidence?: ?DisputeEvidence, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->evidence = $values['evidence'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?DisputeEvidence + */ + public function getEvidence(): ?DisputeEvidence + { + return $this->evidence; + } + + /** + * @param ?DisputeEvidence $value + */ + public function setEvidence(?DisputeEvidence $value = null): self + { + $this->evidence = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateDisputeEvidenceTextResponse.php b/src/Types/CreateDisputeEvidenceTextResponse.php new file mode 100644 index 00000000..8d1de018 --- /dev/null +++ b/src/Types/CreateDisputeEvidenceTextResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?DisputeEvidence $evidence The newly uploaded dispute evidence metadata. + */ + #[JsonProperty('evidence')] + private ?DisputeEvidence $evidence; + + /** + * @param array{ + * errors?: ?array, + * evidence?: ?DisputeEvidence, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->evidence = $values['evidence'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?DisputeEvidence + */ + public function getEvidence(): ?DisputeEvidence + { + return $this->evidence; + } + + /** + * @param ?DisputeEvidence $value + */ + public function setEvidence(?DisputeEvidence $value = null): self + { + $this->evidence = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateGiftCardActivityResponse.php b/src/Types/CreateGiftCardActivityResponse.php new file mode 100644 index 00000000..8caffbad --- /dev/null +++ b/src/Types/CreateGiftCardActivityResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCardActivity $giftCardActivity The gift card activity that was created. + */ + #[JsonProperty('gift_card_activity')] + private ?GiftCardActivity $giftCardActivity; + + /** + * @param array{ + * errors?: ?array, + * giftCardActivity?: ?GiftCardActivity, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCardActivity = $values['giftCardActivity'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCardActivity + */ + public function getGiftCardActivity(): ?GiftCardActivity + { + return $this->giftCardActivity; + } + + /** + * @param ?GiftCardActivity $value + */ + public function setGiftCardActivity(?GiftCardActivity $value = null): self + { + $this->giftCardActivity = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateGiftCardResponse.php b/src/Types/CreateGiftCardResponse.php new file mode 100644 index 00000000..53f55af3 --- /dev/null +++ b/src/Types/CreateGiftCardResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCard $giftCard The new gift card. + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateInvoiceAttachmentResponse.php b/src/Types/CreateInvoiceAttachmentResponse.php new file mode 100644 index 00000000..7fafbc4f --- /dev/null +++ b/src/Types/CreateInvoiceAttachmentResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * attachment?: ?InvoiceAttachment, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->attachment = $values['attachment'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?InvoiceAttachment + */ + public function getAttachment(): ?InvoiceAttachment + { + return $this->attachment; + } + + /** + * @param ?InvoiceAttachment $value + */ + public function setAttachment(?InvoiceAttachment $value = null): self + { + $this->attachment = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateInvoiceResponse.php b/src/Types/CreateInvoiceResponse.php new file mode 100644 index 00000000..727dd35b --- /dev/null +++ b/src/Types/CreateInvoiceResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoice?: ?Invoice, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoice = $values['invoice'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Invoice + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param ?Invoice $value + */ + public function setInvoice(?Invoice $value = null): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateJobResponse.php b/src/Types/CreateJobResponse.php new file mode 100644 index 00000000..a3701a7e --- /dev/null +++ b/src/Types/CreateJobResponse.php @@ -0,0 +1,81 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * job?: ?Job, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->job = $values['job'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Job + */ + public function getJob(): ?Job + { + return $this->job; + } + + /** + * @param ?Job $value + */ + public function setJob(?Job $value = null): self + { + $this->job = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateLocationCustomAttributeDefinitionResponse.php b/src/Types/CreateLocationCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..a30ee59c --- /dev/null +++ b/src/Types/CreateLocationCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateLocationResponse.php b/src/Types/CreateLocationResponse.php new file mode 100644 index 00000000..9e196e00 --- /dev/null +++ b/src/Types/CreateLocationResponse.php @@ -0,0 +1,80 @@ + $errors Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Location $location The newly created `Location` object. + */ + #[JsonProperty('location')] + private ?Location $location; + + /** + * @param array{ + * errors?: ?array, + * location?: ?Location, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->location = $values['location'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Location + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @param ?Location $value + */ + public function setLocation(?Location $value = null): self + { + $this->location = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateLoyaltyAccountResponse.php b/src/Types/CreateLoyaltyAccountResponse.php new file mode 100644 index 00000000..3dd12a3e --- /dev/null +++ b/src/Types/CreateLoyaltyAccountResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyAccount $loyaltyAccount The newly created loyalty account. + */ + #[JsonProperty('loyalty_account')] + private ?LoyaltyAccount $loyaltyAccount; + + /** + * @param array{ + * errors?: ?array, + * loyaltyAccount?: ?LoyaltyAccount, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyAccount = $values['loyaltyAccount'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyAccount + */ + public function getLoyaltyAccount(): ?LoyaltyAccount + { + return $this->loyaltyAccount; + } + + /** + * @param ?LoyaltyAccount $value + */ + public function setLoyaltyAccount(?LoyaltyAccount $value = null): self + { + $this->loyaltyAccount = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateLoyaltyPromotionResponse.php b/src/Types/CreateLoyaltyPromotionResponse.php new file mode 100644 index 00000000..b8343fd3 --- /dev/null +++ b/src/Types/CreateLoyaltyPromotionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyPromotion $loyaltyPromotion The new loyalty promotion. + */ + #[JsonProperty('loyalty_promotion')] + private ?LoyaltyPromotion $loyaltyPromotion; + + /** + * @param array{ + * errors?: ?array, + * loyaltyPromotion?: ?LoyaltyPromotion, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyPromotion = $values['loyaltyPromotion'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotion + */ + public function getLoyaltyPromotion(): ?LoyaltyPromotion + { + return $this->loyaltyPromotion; + } + + /** + * @param ?LoyaltyPromotion $value + */ + public function setLoyaltyPromotion(?LoyaltyPromotion $value = null): self + { + $this->loyaltyPromotion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateLoyaltyRewardResponse.php b/src/Types/CreateLoyaltyRewardResponse.php new file mode 100644 index 00000000..4f585210 --- /dev/null +++ b/src/Types/CreateLoyaltyRewardResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyReward $reward The loyalty reward created. + */ + #[JsonProperty('reward')] + private ?LoyaltyReward $reward; + + /** + * @param array{ + * errors?: ?array, + * reward?: ?LoyaltyReward, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->reward = $values['reward'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyReward + */ + public function getReward(): ?LoyaltyReward + { + return $this->reward; + } + + /** + * @param ?LoyaltyReward $value + */ + public function setReward(?LoyaltyReward $value = null): self + { + $this->reward = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateMerchantCustomAttributeDefinitionResponse.php b/src/Types/CreateMerchantCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..e44a0bfc --- /dev/null +++ b/src/Types/CreateMerchantCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateMobileAuthorizationCodeResponse.php b/src/Types/CreateMobileAuthorizationCodeResponse.php new file mode 100644 index 00000000..807ca466 --- /dev/null +++ b/src/Types/CreateMobileAuthorizationCodeResponse.php @@ -0,0 +1,112 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * authorizationCode?: ?string, + * expiresAt?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->authorizationCode = $values['authorizationCode'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getAuthorizationCode(): ?string + { + return $this->authorizationCode; + } + + /** + * @param ?string $value + */ + public function setAuthorizationCode(?string $value = null): self + { + $this->authorizationCode = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiresAt(): ?string + { + return $this->expiresAt; + } + + /** + * @param ?string $value + */ + public function setExpiresAt(?string $value = null): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateOrderCustomAttributeDefinitionResponse.php b/src/Types/CreateOrderCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..023ca42a --- /dev/null +++ b/src/Types/CreateOrderCustomAttributeDefinitionResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateOrderRequest.php b/src/Types/CreateOrderRequest.php new file mode 100644 index 00000000..f18a8a8c --- /dev/null +++ b/src/Types/CreateOrderRequest.php @@ -0,0 +1,88 @@ +order = $values['order'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateOrderResponse.php b/src/Types/CreateOrderResponse.php new file mode 100644 index 00000000..b96b2b31 --- /dev/null +++ b/src/Types/CreateOrderResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * order?: ?Order, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->order = $values['order'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreatePaymentLinkResponse.php b/src/Types/CreatePaymentLinkResponse.php new file mode 100644 index 00000000..849f0cd2 --- /dev/null +++ b/src/Types/CreatePaymentLinkResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?PaymentLink $paymentLink The created payment link. + */ + #[JsonProperty('payment_link')] + private ?PaymentLink $paymentLink; + + /** + * @var ?PaymentLinkRelatedResources $relatedResources The list of related objects. + */ + #[JsonProperty('related_resources')] + private ?PaymentLinkRelatedResources $relatedResources; + + /** + * @param array{ + * errors?: ?array, + * paymentLink?: ?PaymentLink, + * relatedResources?: ?PaymentLinkRelatedResources, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->paymentLink = $values['paymentLink'] ?? null; + $this->relatedResources = $values['relatedResources'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?PaymentLink + */ + public function getPaymentLink(): ?PaymentLink + { + return $this->paymentLink; + } + + /** + * @param ?PaymentLink $value + */ + public function setPaymentLink(?PaymentLink $value = null): self + { + $this->paymentLink = $value; + return $this; + } + + /** + * @return ?PaymentLinkRelatedResources + */ + public function getRelatedResources(): ?PaymentLinkRelatedResources + { + return $this->relatedResources; + } + + /** + * @param ?PaymentLinkRelatedResources $value + */ + public function setRelatedResources(?PaymentLinkRelatedResources $value = null): self + { + $this->relatedResources = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreatePaymentResponse.php b/src/Types/CreatePaymentResponse.php new file mode 100644 index 00000000..e32e0197 --- /dev/null +++ b/src/Types/CreatePaymentResponse.php @@ -0,0 +1,83 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Payment $payment The newly created payment. + */ + #[JsonProperty('payment')] + private ?Payment $payment; + + /** + * @param array{ + * errors?: ?array, + * payment?: ?Payment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payment = $values['payment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateShiftResponse.php b/src/Types/CreateShiftResponse.php new file mode 100644 index 00000000..cc3cf68c --- /dev/null +++ b/src/Types/CreateShiftResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * shift?: ?Shift, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->shift = $values['shift'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Shift + */ + public function getShift(): ?Shift + { + return $this->shift; + } + + /** + * @param ?Shift $value + */ + public function setShift(?Shift $value = null): self + { + $this->shift = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateSubscriptionResponse.php b/src/Types/CreateSubscriptionResponse.php new file mode 100644 index 00000000..eee2dd08 --- /dev/null +++ b/src/Types/CreateSubscriptionResponse.php @@ -0,0 +1,86 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The newly created subscription. + * + * For more information, see + * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#subscription-object). + * + * @var ?Subscription $subscription + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateTeamMemberRequest.php b/src/Types/CreateTeamMemberRequest.php new file mode 100644 index 00000000..3adea9d0 --- /dev/null +++ b/src/Types/CreateTeamMemberRequest.php @@ -0,0 +1,88 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->teamMember = $values['teamMember'] ?? null; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?TeamMember + */ + public function getTeamMember(): ?TeamMember + { + return $this->teamMember; + } + + /** + * @param ?TeamMember $value + */ + public function setTeamMember(?TeamMember $value = null): self + { + $this->teamMember = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateTeamMemberResponse.php b/src/Types/CreateTeamMemberResponse.php new file mode 100644 index 00000000..19d94043 --- /dev/null +++ b/src/Types/CreateTeamMemberResponse.php @@ -0,0 +1,80 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMember?: ?TeamMember, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMember = $values['teamMember'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?TeamMember + */ + public function getTeamMember(): ?TeamMember + { + return $this->teamMember; + } + + /** + * @param ?TeamMember $value + */ + public function setTeamMember(?TeamMember $value = null): self + { + $this->teamMember = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateTerminalActionResponse.php b/src/Types/CreateTerminalActionResponse.php new file mode 100644 index 00000000..ce8685a3 --- /dev/null +++ b/src/Types/CreateTerminalActionResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalAction $action The created `TerminalAction` + */ + #[JsonProperty('action')] + private ?TerminalAction $action; + + /** + * @param array{ + * errors?: ?array, + * action?: ?TerminalAction, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->action = $values['action'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalAction + */ + public function getAction(): ?TerminalAction + { + return $this->action; + } + + /** + * @param ?TerminalAction $value + */ + public function setAction(?TerminalAction $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateTerminalCheckoutResponse.php b/src/Types/CreateTerminalCheckoutResponse.php new file mode 100644 index 00000000..563900f6 --- /dev/null +++ b/src/Types/CreateTerminalCheckoutResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalCheckout $checkout The created `TerminalCheckout`. + */ + #[JsonProperty('checkout')] + private ?TerminalCheckout $checkout; + + /** + * @param array{ + * errors?: ?array, + * checkout?: ?TerminalCheckout, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->checkout = $values['checkout'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalCheckout + */ + public function getCheckout(): ?TerminalCheckout + { + return $this->checkout; + } + + /** + * @param ?TerminalCheckout $value + */ + public function setCheckout(?TerminalCheckout $value = null): self + { + $this->checkout = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateTerminalRefundResponse.php b/src/Types/CreateTerminalRefundResponse.php new file mode 100644 index 00000000..181b899a --- /dev/null +++ b/src/Types/CreateTerminalRefundResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalRefund $refund The created `TerminalRefund`. + */ + #[JsonProperty('refund')] + private ?TerminalRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?TerminalRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalRefund + */ + public function getRefund(): ?TerminalRefund + { + return $this->refund; + } + + /** + * @param ?TerminalRefund $value + */ + public function setRefund(?TerminalRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateVendorResponse.php b/src/Types/CreateVendorResponse.php new file mode 100644 index 00000000..805421d0 --- /dev/null +++ b/src/Types/CreateVendorResponse.php @@ -0,0 +1,80 @@ + $errors Errors encountered when the request fails. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Vendor $vendor The successfully created [Vendor](entity:Vendor) object. + */ + #[JsonProperty('vendor')] + private ?Vendor $vendor; + + /** + * @param array{ + * errors?: ?array, + * vendor?: ?Vendor, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->vendor = $values['vendor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Vendor + */ + public function getVendor(): ?Vendor + { + return $this->vendor; + } + + /** + * @param ?Vendor $value + */ + public function setVendor(?Vendor $value = null): self + { + $this->vendor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateWebhookSubscriptionResponse.php b/src/Types/CreateWebhookSubscriptionResponse.php new file mode 100644 index 00000000..5c1d54e8 --- /dev/null +++ b/src/Types/CreateWebhookSubscriptionResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?WebhookSubscription $subscription The new [Subscription](entity:WebhookSubscription). + */ + #[JsonProperty('subscription')] + private ?WebhookSubscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?WebhookSubscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?WebhookSubscription + */ + public function getSubscription(): ?WebhookSubscription + { + return $this->subscription; + } + + /** + * @param ?WebhookSubscription $value + */ + public function setSubscription(?WebhookSubscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Currency.php b/src/Types/Currency.php new file mode 100644 index 00000000..de4051c5 --- /dev/null +++ b/src/Types/Currency.php @@ -0,0 +1,190 @@ + $visibility + */ + #[JsonProperty('visibility')] + private ?string $visibility; + + /** + * A copy of the associated custom attribute definition object. This field is only set when + * the optional field is specified on the request. + * + * @var ?CustomAttributeDefinition $definition + */ + #[JsonProperty('definition')] + private ?CustomAttributeDefinition $definition; + + /** + * The timestamp that indicates when the custom attribute was created or was most recently + * updated, in RFC 3339 format. + * + * @var ?string $updatedAt + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $createdAt The timestamp that indicates when the custom attribute was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @param array{ + * key?: ?string, + * value?: mixed, + * version?: ?int, + * visibility?: ?value-of, + * definition?: ?CustomAttributeDefinition, + * updatedAt?: ?string, + * createdAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->key = $values['key'] ?? null; + $this->value = $values['value'] ?? null; + $this->version = $values['version'] ?? null; + $this->visibility = $values['visibility'] ?? null; + $this->definition = $values['definition'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return mixed + */ + public function getValue(): mixed + { + return $this->value; + } + + /** + * @param mixed $value + */ + public function setValue(mixed $value = null): self + { + $this->value = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVisibility(): ?string + { + return $this->visibility; + } + + /** + * @param ?value-of $value + */ + public function setVisibility(?string $value = null): self + { + $this->visibility = $value; + return $this; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getDefinition(): ?CustomAttributeDefinition + { + return $this->definition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setDefinition(?CustomAttributeDefinition $value = null): self + { + $this->definition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomAttributeDefinition.php b/src/Types/CustomAttributeDefinition.php new file mode 100644 index 00000000..2a599c82 --- /dev/null +++ b/src/Types/CustomAttributeDefinition.php @@ -0,0 +1,276 @@ + $schema + */ + #[JsonProperty('schema'), ArrayType(['string' => 'mixed'])] + private ?array $schema; + + /** + * The name of the custom attribute definition for API and seller-facing UI purposes. The name must + * be unique within the seller and application pair. This field is required if the + * `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @var ?string $name + */ + #[JsonProperty('name')] + private ?string $name; + + /** + * Seller-oriented description of the custom attribute definition, including any constraints + * that the seller should observe. May be displayed as a tooltip in Square UIs. This field is + * required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + * + * @var ?string $description + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * Specifies how the custom attribute definition and its values should be shared with + * the seller and other applications. If no value is specified, the value defaults to `VISIBILITY_HIDDEN`. + * See [Visibility](#type-visibility) for possible values + * + * @var ?value-of $visibility + */ + #[JsonProperty('visibility')] + private ?string $visibility; + + /** + * Read only. The current version of the custom attribute definition. + * The value is incremented each time the custom attribute definition is updated. + * When updating a custom attribute definition, you can provide this field + * and specify the current version of the custom attribute definition to enable + * [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). + * + * On writes, this field must be set to the latest version. Stale writes are rejected. + * + * This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads, + * see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * The timestamp that indicates when the custom attribute definition was created or most recently updated, + * in RFC 3339 format. + * + * @var ?string $updatedAt + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $createdAt The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @param array{ + * key?: ?string, + * schema?: ?array, + * name?: ?string, + * description?: ?string, + * visibility?: ?value-of, + * version?: ?int, + * updatedAt?: ?string, + * createdAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->key = $values['key'] ?? null; + $this->schema = $values['schema'] ?? null; + $this->name = $values['name'] ?? null; + $this->description = $values['description'] ?? null; + $this->visibility = $values['visibility'] ?? null; + $this->version = $values['version'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSchema(): ?array + { + return $this->schema; + } + + /** + * @param ?array $value + */ + public function setSchema(?array $value = null): self + { + $this->schema = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVisibility(): ?string + { + return $this->visibility; + } + + /** + * @param ?value-of $value + */ + public function setVisibility(?string $value = null): self + { + $this->visibility = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomAttributeDefinitionVisibility.php b/src/Types/CustomAttributeDefinitionVisibility.php new file mode 100644 index 00000000..7570bfa2 --- /dev/null +++ b/src/Types/CustomAttributeDefinitionVisibility.php @@ -0,0 +1,10 @@ + $selectionUidsFilter + */ + #[JsonProperty('selection_uids_filter'), ArrayType(['string'])] + private ?array $selectionUidsFilter; + + /** + * A query expression to filter items or item variations by matching their custom attributes' + * `boolean_value` property values against the specified Boolean expression. + * Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified. + * + * @var ?bool $boolFilter + */ + #[JsonProperty('bool_filter')] + private ?bool $boolFilter; + + /** + * @param array{ + * customAttributeDefinitionId?: ?string, + * key?: ?string, + * stringFilter?: ?string, + * numberFilter?: ?Range, + * selectionUidsFilter?: ?array, + * boolFilter?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinitionId = $values['customAttributeDefinitionId'] ?? null; + $this->key = $values['key'] ?? null; + $this->stringFilter = $values['stringFilter'] ?? null; + $this->numberFilter = $values['numberFilter'] ?? null; + $this->selectionUidsFilter = $values['selectionUidsFilter'] ?? null; + $this->boolFilter = $values['boolFilter'] ?? null; + } + + /** + * @return ?string + */ + public function getCustomAttributeDefinitionId(): ?string + { + return $this->customAttributeDefinitionId; + } + + /** + * @param ?string $value + */ + public function setCustomAttributeDefinitionId(?string $value = null): self + { + $this->customAttributeDefinitionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * @param ?string $value + */ + public function setKey(?string $value = null): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStringFilter(): ?string + { + return $this->stringFilter; + } + + /** + * @param ?string $value + */ + public function setStringFilter(?string $value = null): self + { + $this->stringFilter = $value; + return $this; + } + + /** + * @return ?Range + */ + public function getNumberFilter(): ?Range + { + return $this->numberFilter; + } + + /** + * @param ?Range $value + */ + public function setNumberFilter(?Range $value = null): self + { + $this->numberFilter = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSelectionUidsFilter(): ?array + { + return $this->selectionUidsFilter; + } + + /** + * @param ?array $value + */ + public function setSelectionUidsFilter(?array $value = null): self + { + $this->selectionUidsFilter = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBoolFilter(): ?bool + { + return $this->boolFilter; + } + + /** + * @param ?bool $value + */ + public function setBoolFilter(?bool $value = null): self + { + $this->boolFilter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomField.php b/src/Types/CustomField.php new file mode 100644 index 00000000..8462a927 --- /dev/null +++ b/src/Types/CustomField.php @@ -0,0 +1,56 @@ +title = $values['title']; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Customer.php b/src/Types/Customer.php new file mode 100644 index 00000000..c2898013 --- /dev/null +++ b/src/Types/Customer.php @@ -0,0 +1,522 @@ + $creationSource + */ + #[JsonProperty('creation_source')] + private ?string $creationSource; + + /** + * @var ?array $groupIds The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. + */ + #[JsonProperty('group_ids'), ArrayType(['string'])] + private ?array $groupIds; + + /** + * @var ?array $segmentIds The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. + */ + #[JsonProperty('segment_ids'), ArrayType(['string'])] + private ?array $segmentIds; + + /** + * @var ?int $version The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership. + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom. + * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + * + * @var ?CustomerTaxIds $taxIds + */ + #[JsonProperty('tax_ids')] + private ?CustomerTaxIds $taxIds; + + /** + * @param array{ + * id?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * givenName?: ?string, + * familyName?: ?string, + * nickname?: ?string, + * companyName?: ?string, + * emailAddress?: ?string, + * address?: ?Address, + * phoneNumber?: ?string, + * birthday?: ?string, + * referenceId?: ?string, + * note?: ?string, + * preferences?: ?CustomerPreferences, + * creationSource?: ?value-of, + * groupIds?: ?array, + * segmentIds?: ?array, + * version?: ?int, + * taxIds?: ?CustomerTaxIds, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->nickname = $values['nickname'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->birthday = $values['birthday'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->preferences = $values['preferences'] ?? null; + $this->creationSource = $values['creationSource'] ?? null; + $this->groupIds = $values['groupIds'] ?? null; + $this->segmentIds = $values['segmentIds'] ?? null; + $this->version = $values['version'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNickname(): ?string + { + return $this->nickname; + } + + /** + * @param ?string $value + */ + public function setNickname(?string $value = null): self + { + $this->nickname = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBirthday(): ?string + { + return $this->birthday; + } + + /** + * @param ?string $value + */ + public function setBirthday(?string $value = null): self + { + $this->birthday = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?CustomerPreferences + */ + public function getPreferences(): ?CustomerPreferences + { + return $this->preferences; + } + + /** + * @param ?CustomerPreferences $value + */ + public function setPreferences(?CustomerPreferences $value = null): self + { + $this->preferences = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCreationSource(): ?string + { + return $this->creationSource; + } + + /** + * @param ?value-of $value + */ + public function setCreationSource(?string $value = null): self + { + $this->creationSource = $value; + return $this; + } + + /** + * @return ?array + */ + public function getGroupIds(): ?array + { + return $this->groupIds; + } + + /** + * @param ?array $value + */ + public function setGroupIds(?array $value = null): self + { + $this->groupIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSegmentIds(): ?array + { + return $this->segmentIds; + } + + /** + * @param ?array $value + */ + public function setSegmentIds(?array $value = null): self + { + $this->segmentIds = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?CustomerTaxIds + */ + public function getTaxIds(): ?CustomerTaxIds + { + return $this->taxIds; + } + + /** + * @param ?CustomerTaxIds $value + */ + public function setTaxIds(?CustomerTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerAddressFilter.php b/src/Types/CustomerAddressFilter.php new file mode 100644 index 00000000..c9bcbbfb --- /dev/null +++ b/src/Types/CustomerAddressFilter.php @@ -0,0 +1,83 @@ + $country + */ + #[JsonProperty('country')] + private ?string $country; + + /** + * @param array{ + * postalCode?: ?CustomerTextFilter, + * country?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->postalCode = $values['postalCode'] ?? null; + $this->country = $values['country'] ?? null; + } + + /** + * @return ?CustomerTextFilter + */ + public function getPostalCode(): ?CustomerTextFilter + { + return $this->postalCode; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setPostalCode(?CustomerTextFilter $value = null): self + { + $this->postalCode = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCountry(): ?string + { + return $this->country; + } + + /** + * @param ?value-of $value + */ + public function setCountry(?string $value = null): self + { + $this->country = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerCreationSource.php b/src/Types/CustomerCreationSource.php new file mode 100644 index 00000000..51c9c7aa --- /dev/null +++ b/src/Types/CustomerCreationSource.php @@ -0,0 +1,26 @@ +> $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + private ?array $values; + + /** + * Indicates whether a customer profile matching the filter criteria + * should be included in the result or excluded from the result. + * + * Default: `INCLUDE`. + * See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values + * + * @var ?value-of $rule + */ + #[JsonProperty('rule')] + private ?string $rule; + + /** + * @param array{ + * values?: ?array>, + * rule?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->values = $values['values'] ?? null; + $this->rule = $values['rule'] ?? null; + } + + /** + * @return ?array> + */ + public function getValues(): ?array + { + return $this->values; + } + + /** + * @param ?array> $value + */ + public function setValues(?array $value = null): self + { + $this->values = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getRule(): ?string + { + return $this->rule; + } + + /** + * @param ?value-of $value + */ + public function setRule(?string $value = null): self + { + $this->rule = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerCustomAttributeFilter.php b/src/Types/CustomerCustomAttributeFilter.php new file mode 100644 index 00000000..0cbd3c92 --- /dev/null +++ b/src/Types/CustomerCustomAttributeFilter.php @@ -0,0 +1,119 @@ +key = $values['key']; + $this->filter = $values['filter'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return string + */ + public function getKey(): string + { + return $this->key; + } + + /** + * @param string $value + */ + public function setKey(string $value): self + { + $this->key = $value; + return $this; + } + + /** + * @return ?CustomerCustomAttributeFilterValue + */ + public function getFilter(): ?CustomerCustomAttributeFilterValue + { + return $this->filter; + } + + /** + * @param ?CustomerCustomAttributeFilterValue $value + */ + public function setFilter(?CustomerCustomAttributeFilterValue $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getUpdatedAt(): ?TimeRange + { + return $this->updatedAt; + } + + /** + * @param ?TimeRange $value + */ + public function setUpdatedAt(?TimeRange $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerCustomAttributeFilterValue.php b/src/Types/CustomerCustomAttributeFilterValue.php new file mode 100644 index 00000000..5bd65000 --- /dev/null +++ b/src/Types/CustomerCustomAttributeFilterValue.php @@ -0,0 +1,283 @@ +email = $values['email'] ?? null; + $this->phone = $values['phone'] ?? null; + $this->text = $values['text'] ?? null; + $this->selection = $values['selection'] ?? null; + $this->date = $values['date'] ?? null; + $this->number = $values['number'] ?? null; + $this->boolean = $values['boolean'] ?? null; + $this->address = $values['address'] ?? null; + } + + /** + * @return ?CustomerTextFilter + */ + public function getEmail(): ?CustomerTextFilter + { + return $this->email; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setEmail(?CustomerTextFilter $value = null): self + { + $this->email = $value; + return $this; + } + + /** + * @return ?CustomerTextFilter + */ + public function getPhone(): ?CustomerTextFilter + { + return $this->phone; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setPhone(?CustomerTextFilter $value = null): self + { + $this->phone = $value; + return $this; + } + + /** + * @return ?CustomerTextFilter + */ + public function getText(): ?CustomerTextFilter + { + return $this->text; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setText(?CustomerTextFilter $value = null): self + { + $this->text = $value; + return $this; + } + + /** + * @return ?FilterValue + */ + public function getSelection(): ?FilterValue + { + return $this->selection; + } + + /** + * @param ?FilterValue $value + */ + public function setSelection(?FilterValue $value = null): self + { + $this->selection = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getDate(): ?TimeRange + { + return $this->date; + } + + /** + * @param ?TimeRange $value + */ + public function setDate(?TimeRange $value = null): self + { + $this->date = $value; + return $this; + } + + /** + * @return ?FloatNumberRange + */ + public function getNumber(): ?FloatNumberRange + { + return $this->number; + } + + /** + * @param ?FloatNumberRange $value + */ + public function setNumber(?FloatNumberRange $value = null): self + { + $this->number = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBoolean(): ?bool + { + return $this->boolean; + } + + /** + * @param ?bool $value + */ + public function setBoolean(?bool $value = null): self + { + $this->boolean = $value; + return $this; + } + + /** + * @return ?CustomerAddressFilter + */ + public function getAddress(): ?CustomerAddressFilter + { + return $this->address; + } + + /** + * @param ?CustomerAddressFilter $value + */ + public function setAddress(?CustomerAddressFilter $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerCustomAttributeFilters.php b/src/Types/CustomerCustomAttributeFilters.php new file mode 100644 index 00000000..10eecc1c --- /dev/null +++ b/src/Types/CustomerCustomAttributeFilters.php @@ -0,0 +1,60 @@ + $filters + */ + #[JsonProperty('filters'), ArrayType([CustomerCustomAttributeFilter::class])] + private ?array $filters; + + /** + * @param array{ + * filters?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->filters = $values['filters'] ?? null; + } + + /** + * @return ?array + */ + public function getFilters(): ?array + { + return $this->filters; + } + + /** + * @param ?array $value + */ + public function setFilters(?array $value = null): self + { + $this->filters = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerDetails.php b/src/Types/CustomerDetails.php new file mode 100644 index 00000000..b7546c1b --- /dev/null +++ b/src/Types/CustomerDetails.php @@ -0,0 +1,82 @@ +customerInitiated = $values['customerInitiated'] ?? null; + $this->sellerKeyedIn = $values['sellerKeyedIn'] ?? null; + } + + /** + * @return ?bool + */ + public function getCustomerInitiated(): ?bool + { + return $this->customerInitiated; + } + + /** + * @param ?bool $value + */ + public function setCustomerInitiated(?bool $value = null): self + { + $this->customerInitiated = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSellerKeyedIn(): ?bool + { + return $this->sellerKeyedIn; + } + + /** + * @param ?bool $value + */ + public function setSellerKeyedIn(?bool $value = null): self + { + $this->sellerKeyedIn = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerFilter.php b/src/Types/CustomerFilter.php new file mode 100644 index 00000000..7dc4b2c7 --- /dev/null +++ b/src/Types/CustomerFilter.php @@ -0,0 +1,351 @@ +creationSource = $values['creationSource'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->groupIds = $values['groupIds'] ?? null; + $this->customAttribute = $values['customAttribute'] ?? null; + $this->segmentIds = $values['segmentIds'] ?? null; + } + + /** + * @return ?CustomerCreationSourceFilter + */ + public function getCreationSource(): ?CustomerCreationSourceFilter + { + return $this->creationSource; + } + + /** + * @param ?CustomerCreationSourceFilter $value + */ + public function setCreationSource(?CustomerCreationSourceFilter $value = null): self + { + $this->creationSource = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getUpdatedAt(): ?TimeRange + { + return $this->updatedAt; + } + + /** + * @param ?TimeRange $value + */ + public function setUpdatedAt(?TimeRange $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?CustomerTextFilter + */ + public function getEmailAddress(): ?CustomerTextFilter + { + return $this->emailAddress; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setEmailAddress(?CustomerTextFilter $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?CustomerTextFilter + */ + public function getPhoneNumber(): ?CustomerTextFilter + { + return $this->phoneNumber; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setPhoneNumber(?CustomerTextFilter $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?CustomerTextFilter + */ + public function getReferenceId(): ?CustomerTextFilter + { + return $this->referenceId; + } + + /** + * @param ?CustomerTextFilter $value + */ + public function setReferenceId(?CustomerTextFilter $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?FilterValue + */ + public function getGroupIds(): ?FilterValue + { + return $this->groupIds; + } + + /** + * @param ?FilterValue $value + */ + public function setGroupIds(?FilterValue $value = null): self + { + $this->groupIds = $value; + return $this; + } + + /** + * @return ?CustomerCustomAttributeFilters + */ + public function getCustomAttribute(): ?CustomerCustomAttributeFilters + { + return $this->customAttribute; + } + + /** + * @param ?CustomerCustomAttributeFilters $value + */ + public function setCustomAttribute(?CustomerCustomAttributeFilters $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?FilterValue + */ + public function getSegmentIds(): ?FilterValue + { + return $this->segmentIds; + } + + /** + * @param ?FilterValue $value + */ + public function setSegmentIds(?FilterValue $value = null): self + { + $this->segmentIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerGroup.php b/src/Types/CustomerGroup.php new file mode 100644 index 00000000..ae0e364f --- /dev/null +++ b/src/Types/CustomerGroup.php @@ -0,0 +1,132 @@ +id = $values['id'] ?? null; + $this->name = $values['name']; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerInclusionExclusion.php b/src/Types/CustomerInclusionExclusion.php new file mode 100644 index 00000000..0454f1d4 --- /dev/null +++ b/src/Types/CustomerInclusionExclusion.php @@ -0,0 +1,9 @@ +emailUnsubscribed = $values['emailUnsubscribed'] ?? null; + } + + /** + * @return ?bool + */ + public function getEmailUnsubscribed(): ?bool + { + return $this->emailUnsubscribed; + } + + /** + * @param ?bool $value + */ + public function setEmailUnsubscribed(?bool $value = null): self + { + $this->emailUnsubscribed = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerQuery.php b/src/Types/CustomerQuery.php new file mode 100644 index 00000000..5ecf28b4 --- /dev/null +++ b/src/Types/CustomerQuery.php @@ -0,0 +1,88 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?CustomerFilter + */ + public function getFilter(): ?CustomerFilter + { + return $this->filter; + } + + /** + * @param ?CustomerFilter $value + */ + public function setFilter(?CustomerFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?CustomerSort + */ + public function getSort(): ?CustomerSort + { + return $this->sort; + } + + /** + * @param ?CustomerSort $value + */ + public function setSort(?CustomerSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerSegment.php b/src/Types/CustomerSegment.php new file mode 100644 index 00000000..b069c963 --- /dev/null +++ b/src/Types/CustomerSegment.php @@ -0,0 +1,132 @@ +id = $values['id'] ?? null; + $this->name = $values['name']; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerSort.php b/src/Types/CustomerSort.php new file mode 100644 index 00000000..7ece32aa --- /dev/null +++ b/src/Types/CustomerSort.php @@ -0,0 +1,92 @@ + $field + */ + #[JsonProperty('field')] + private ?string $field; + + /** + * Indicates the order in which results should be sorted based on the + * sort field value. Strings use standard alphabetic comparison + * to determine order. Strings representing numbers are sorted as strings. + * + * The default value is `ASC`. + * See [SortOrder](#type-sortorder) for possible values + * + * @var ?value-of $order + */ + #[JsonProperty('order')] + private ?string $order; + + /** + * @param array{ + * field?: ?value-of, + * order?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->field = $values['field'] ?? null; + $this->order = $values['order'] ?? null; + } + + /** + * @return ?value-of + */ + public function getField(): ?string + { + return $this->field; + } + + /** + * @param ?value-of $value + */ + public function setField(?string $value = null): self + { + $this->field = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerSortField.php b/src/Types/CustomerSortField.php new file mode 100644 index 00000000..ffa92948 --- /dev/null +++ b/src/Types/CustomerSortField.php @@ -0,0 +1,9 @@ +euVat = $values['euVat'] ?? null; + } + + /** + * @return ?string + */ + public function getEuVat(): ?string + { + return $this->euVat; + } + + /** + * @param ?string $value + */ + public function setEuVat(?string $value = null): self + { + $this->euVat = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CustomerTextFilter.php b/src/Types/CustomerTextFilter.php new file mode 100644 index 00000000..cae3181f --- /dev/null +++ b/src/Types/CustomerTextFilter.php @@ -0,0 +1,86 @@ +exact = $values['exact'] ?? null; + $this->fuzzy = $values['fuzzy'] ?? null; + } + + /** + * @return ?string + */ + public function getExact(): ?string + { + return $this->exact; + } + + /** + * @param ?string $value + */ + public function setExact(?string $value = null): self + { + $this->exact = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFuzzy(): ?string + { + return $this->fuzzy; + } + + /** + * @param ?string $value + */ + public function setFuzzy(?string $value = null): self + { + $this->fuzzy = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DataCollectionOptions.php b/src/Types/DataCollectionOptions.php new file mode 100644 index 00000000..e2743c2b --- /dev/null +++ b/src/Types/DataCollectionOptions.php @@ -0,0 +1,132 @@ + $inputType + */ + #[JsonProperty('input_type')] + private string $inputType; + + /** + * @var ?CollectedData $collectedData The buyer’s input text from the data collection screen. + */ + #[JsonProperty('collected_data')] + private ?CollectedData $collectedData; + + /** + * @param array{ + * title: string, + * body: string, + * inputType: value-of, + * collectedData?: ?CollectedData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->title = $values['title']; + $this->body = $values['body']; + $this->inputType = $values['inputType']; + $this->collectedData = $values['collectedData'] ?? null; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function getBody(): string + { + return $this->body; + } + + /** + * @param string $value + */ + public function setBody(string $value): self + { + $this->body = $value; + return $this; + } + + /** + * @return value-of + */ + public function getInputType(): string + { + return $this->inputType; + } + + /** + * @param value-of $value + */ + public function setInputType(string $value): self + { + $this->inputType = $value; + return $this; + } + + /** + * @return ?CollectedData + */ + public function getCollectedData(): ?CollectedData + { + return $this->collectedData; + } + + /** + * @param ?CollectedData $value + */ + public function setCollectedData(?CollectedData $value = null): self + { + $this->collectedData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DataCollectionOptionsInputType.php b/src/Types/DataCollectionOptionsInputType.php new file mode 100644 index 00000000..2a123f51 --- /dev/null +++ b/src/Types/DataCollectionOptionsInputType.php @@ -0,0 +1,9 @@ +startDate = $values['startDate'] ?? null; + $this->endDate = $values['endDate'] ?? null; + } + + /** + * @return ?string + */ + public function getStartDate(): ?string + { + return $this->startDate; + } + + /** + * @param ?string $value + */ + public function setStartDate(?string $value = null): self + { + $this->startDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndDate(): ?string + { + return $this->endDate; + } + + /** + * @param ?string $value + */ + public function setEndDate(?string $value = null): self + { + $this->endDate = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DayOfWeek.php b/src/Types/DayOfWeek.php new file mode 100644 index 00000000..0ce93de5 --- /dev/null +++ b/src/Types/DayOfWeek.php @@ -0,0 +1,14 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteBookingCustomAttributeResponse.php b/src/Types/DeleteBookingCustomAttributeResponse.php new file mode 100644 index 00000000..b0c4eff2 --- /dev/null +++ b/src/Types/DeleteBookingCustomAttributeResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteBreakTypeResponse.php b/src/Types/DeleteBreakTypeResponse.php new file mode 100644 index 00000000..3497f059 --- /dev/null +++ b/src/Types/DeleteBreakTypeResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCatalogObjectResponse.php b/src/Types/DeleteCatalogObjectResponse.php new file mode 100644 index 00000000..5adbcd3d --- /dev/null +++ b/src/Types/DeleteCatalogObjectResponse.php @@ -0,0 +1,110 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The IDs of all catalog objects deleted by this request. + * Multiple IDs may be returned when associated objects are also deleted, for example + * a catalog item variation will be deleted (and its ID included in this field) + * when its parent catalog item is deleted. + * + * @var ?array $deletedObjectIds + */ + #[JsonProperty('deleted_object_ids'), ArrayType(['string'])] + private ?array $deletedObjectIds; + + /** + * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + * + * @var ?string $deletedAt + */ + #[JsonProperty('deleted_at')] + private ?string $deletedAt; + + /** + * @param array{ + * errors?: ?array, + * deletedObjectIds?: ?array, + * deletedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->deletedObjectIds = $values['deletedObjectIds'] ?? null; + $this->deletedAt = $values['deletedAt'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDeletedObjectIds(): ?array + { + return $this->deletedObjectIds; + } + + /** + * @param ?array $value + */ + public function setDeletedObjectIds(?array $value = null): self + { + $this->deletedObjectIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeletedAt(): ?string + { + return $this->deletedAt; + } + + /** + * @param ?string $value + */ + public function setDeletedAt(?string $value = null): self + { + $this->deletedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCustomerCardResponse.php b/src/Types/DeleteCustomerCardResponse.php new file mode 100644 index 00000000..a99ba2cd --- /dev/null +++ b/src/Types/DeleteCustomerCardResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCustomerCustomAttributeDefinitionResponse.php b/src/Types/DeleteCustomerCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..daf839ce --- /dev/null +++ b/src/Types/DeleteCustomerCustomAttributeDefinitionResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCustomerCustomAttributeResponse.php b/src/Types/DeleteCustomerCustomAttributeResponse.php new file mode 100644 index 00000000..05dafa6a --- /dev/null +++ b/src/Types/DeleteCustomerCustomAttributeResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCustomerGroupResponse.php b/src/Types/DeleteCustomerGroupResponse.php new file mode 100644 index 00000000..ac8e68ef --- /dev/null +++ b/src/Types/DeleteCustomerGroupResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteCustomerResponse.php b/src/Types/DeleteCustomerResponse.php new file mode 100644 index 00000000..7d8f544d --- /dev/null +++ b/src/Types/DeleteCustomerResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteDisputeEvidenceResponse.php b/src/Types/DeleteDisputeEvidenceResponse.php new file mode 100644 index 00000000..1b29cfef --- /dev/null +++ b/src/Types/DeleteDisputeEvidenceResponse.php @@ -0,0 +1,55 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteInvoiceAttachmentResponse.php b/src/Types/DeleteInvoiceAttachmentResponse.php new file mode 100644 index 00000000..04395257 --- /dev/null +++ b/src/Types/DeleteInvoiceAttachmentResponse.php @@ -0,0 +1,55 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteInvoiceResponse.php b/src/Types/DeleteInvoiceResponse.php new file mode 100644 index 00000000..dc33ca21 --- /dev/null +++ b/src/Types/DeleteInvoiceResponse.php @@ -0,0 +1,55 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteLocationCustomAttributeDefinitionResponse.php b/src/Types/DeleteLocationCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..c8eafd4f --- /dev/null +++ b/src/Types/DeleteLocationCustomAttributeDefinitionResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteLocationCustomAttributeResponse.php b/src/Types/DeleteLocationCustomAttributeResponse.php new file mode 100644 index 00000000..d1ac036d --- /dev/null +++ b/src/Types/DeleteLocationCustomAttributeResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteLoyaltyRewardResponse.php b/src/Types/DeleteLoyaltyRewardResponse.php new file mode 100644 index 00000000..fe5ce345 --- /dev/null +++ b/src/Types/DeleteLoyaltyRewardResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteMerchantCustomAttributeDefinitionResponse.php b/src/Types/DeleteMerchantCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..04fa69fe --- /dev/null +++ b/src/Types/DeleteMerchantCustomAttributeDefinitionResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteMerchantCustomAttributeResponse.php b/src/Types/DeleteMerchantCustomAttributeResponse.php new file mode 100644 index 00000000..c46b490f --- /dev/null +++ b/src/Types/DeleteMerchantCustomAttributeResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteOrderCustomAttributeDefinitionResponse.php b/src/Types/DeleteOrderCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..96e5d0e5 --- /dev/null +++ b/src/Types/DeleteOrderCustomAttributeDefinitionResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteOrderCustomAttributeResponse.php b/src/Types/DeleteOrderCustomAttributeResponse.php new file mode 100644 index 00000000..dbe491c4 --- /dev/null +++ b/src/Types/DeleteOrderCustomAttributeResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeletePaymentLinkResponse.php b/src/Types/DeletePaymentLinkResponse.php new file mode 100644 index 00000000..f33b06b6 --- /dev/null +++ b/src/Types/DeletePaymentLinkResponse.php @@ -0,0 +1,105 @@ + $errors + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $id The ID of the link that is deleted. + */ + #[JsonProperty('id')] + private ?string $id; + + /** + * The ID of the order that is canceled. When a payment link is deleted, Square updates the + * the `state` (of the order that the checkout link created) to CANCELED. + * + * @var ?string $cancelledOrderId + */ + #[JsonProperty('cancelled_order_id')] + private ?string $cancelledOrderId; + + /** + * @param array{ + * errors?: ?array, + * id?: ?string, + * cancelledOrderId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->id = $values['id'] ?? null; + $this->cancelledOrderId = $values['cancelledOrderId'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCancelledOrderId(): ?string + { + return $this->cancelledOrderId; + } + + /** + * @param ?string $value + */ + public function setCancelledOrderId(?string $value = null): self + { + $this->cancelledOrderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteShiftResponse.php b/src/Types/DeleteShiftResponse.php new file mode 100644 index 00000000..ab39692d --- /dev/null +++ b/src/Types/DeleteShiftResponse.php @@ -0,0 +1,56 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteSnippetResponse.php b/src/Types/DeleteSnippetResponse.php new file mode 100644 index 00000000..973e4a6f --- /dev/null +++ b/src/Types/DeleteSnippetResponse.php @@ -0,0 +1,55 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteSubscriptionActionResponse.php b/src/Types/DeleteSubscriptionActionResponse.php new file mode 100644 index 00000000..8b8f11d0 --- /dev/null +++ b/src/Types/DeleteSubscriptionActionResponse.php @@ -0,0 +1,81 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The subscription that has the specified action deleted. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeleteWebhookSubscriptionResponse.php b/src/Types/DeleteWebhookSubscriptionResponse.php new file mode 100644 index 00000000..cfa44136 --- /dev/null +++ b/src/Types/DeleteWebhookSubscriptionResponse.php @@ -0,0 +1,56 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Destination.php b/src/Types/Destination.php new file mode 100644 index 00000000..5d463255 --- /dev/null +++ b/src/Types/Destination.php @@ -0,0 +1,82 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?string $id Square issued unique ID (also known as the instrument ID) associated with this destination. + */ + #[JsonProperty('id')] + private ?string $id; + + /** + * @param array{ + * type?: ?value-of, + * id?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->id = $values['id'] ?? null; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DestinationDetails.php b/src/Types/DestinationDetails.php new file mode 100644 index 00000000..fde39599 --- /dev/null +++ b/src/Types/DestinationDetails.php @@ -0,0 +1,104 @@ +cardDetails = $values['cardDetails'] ?? null; + $this->cashDetails = $values['cashDetails'] ?? null; + $this->externalDetails = $values['externalDetails'] ?? null; + } + + /** + * @return ?DestinationDetailsCardRefundDetails + */ + public function getCardDetails(): ?DestinationDetailsCardRefundDetails + { + return $this->cardDetails; + } + + /** + * @param ?DestinationDetailsCardRefundDetails $value + */ + public function setCardDetails(?DestinationDetailsCardRefundDetails $value = null): self + { + $this->cardDetails = $value; + return $this; + } + + /** + * @return ?DestinationDetailsCashRefundDetails + */ + public function getCashDetails(): ?DestinationDetailsCashRefundDetails + { + return $this->cashDetails; + } + + /** + * @param ?DestinationDetailsCashRefundDetails $value + */ + public function setCashDetails(?DestinationDetailsCashRefundDetails $value = null): self + { + $this->cashDetails = $value; + return $this; + } + + /** + * @return ?DestinationDetailsExternalRefundDetails + */ + public function getExternalDetails(): ?DestinationDetailsExternalRefundDetails + { + return $this->externalDetails; + } + + /** + * @param ?DestinationDetailsExternalRefundDetails $value + */ + public function setExternalDetails(?DestinationDetailsExternalRefundDetails $value = null): self + { + $this->externalDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DestinationDetailsCardRefundDetails.php b/src/Types/DestinationDetailsCardRefundDetails.php new file mode 100644 index 00000000..20e84b5d --- /dev/null +++ b/src/Types/DestinationDetailsCardRefundDetails.php @@ -0,0 +1,104 @@ +card = $values['card'] ?? null; + $this->entryMethod = $values['entryMethod'] ?? null; + $this->authResultCode = $values['authResultCode'] ?? null; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEntryMethod(): ?string + { + return $this->entryMethod; + } + + /** + * @param ?string $value + */ + public function setEntryMethod(?string $value = null): self + { + $this->entryMethod = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAuthResultCode(): ?string + { + return $this->authResultCode; + } + + /** + * @param ?string $value + */ + public function setAuthResultCode(?string $value = null): self + { + $this->authResultCode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DestinationDetailsCashRefundDetails.php b/src/Types/DestinationDetailsCashRefundDetails.php new file mode 100644 index 00000000..efb61cfe --- /dev/null +++ b/src/Types/DestinationDetailsCashRefundDetails.php @@ -0,0 +1,83 @@ +sellerSuppliedMoney = $values['sellerSuppliedMoney']; + $this->changeBackMoney = $values['changeBackMoney'] ?? null; + } + + /** + * @return Money + */ + public function getSellerSuppliedMoney(): Money + { + return $this->sellerSuppliedMoney; + } + + /** + * @param Money $value + */ + public function setSellerSuppliedMoney(Money $value): self + { + $this->sellerSuppliedMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getChangeBackMoney(): ?Money + { + return $this->changeBackMoney; + } + + /** + * @param ?Money $value + */ + public function setChangeBackMoney(?Money $value = null): self + { + $this->changeBackMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DestinationDetailsExternalRefundDetails.php b/src/Types/DestinationDetailsExternalRefundDetails.php new file mode 100644 index 00000000..dd4d9c2a --- /dev/null +++ b/src/Types/DestinationDetailsExternalRefundDetails.php @@ -0,0 +1,122 @@ +type = $values['type']; + $this->source = $values['source']; + $this->sourceId = $values['sourceId'] ?? null; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $value + */ + public function setSource(string $value): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceId(): ?string + { + return $this->sourceId; + } + + /** + * @param ?string $value + */ + public function setSourceId(?string $value = null): self + { + $this->sourceId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DestinationType.php b/src/Types/DestinationType.php new file mode 100644 index 00000000..3e5e403b --- /dev/null +++ b/src/Types/DestinationType.php @@ -0,0 +1,11 @@ + $components A list of components applicable to the device. + */ + #[JsonProperty('components'), ArrayType([Component::class])] + private ?array $components; + + /** + * @var ?DeviceStatus $status The current status of the device. + */ + #[JsonProperty('status')] + private ?DeviceStatus $status; + + /** + * @param array{ + * attributes: DeviceAttributes, + * id?: ?string, + * components?: ?array, + * status?: ?DeviceStatus, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->attributes = $values['attributes']; + $this->components = $values['components'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return DeviceAttributes + */ + public function getAttributes(): DeviceAttributes + { + return $this->attributes; + } + + /** + * @param DeviceAttributes $value + */ + public function setAttributes(DeviceAttributes $value): self + { + $this->attributes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getComponents(): ?array + { + return $this->components; + } + + /** + * @param ?array $value + */ + public function setComponents(?array $value = null): self + { + $this->components = $value; + return $this; + } + + /** + * @return ?DeviceStatus + */ + public function getStatus(): ?DeviceStatus + { + return $this->status; + } + + /** + * @param ?DeviceStatus $value + */ + public function setStatus(?DeviceStatus $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceAttributes.php b/src/Types/DeviceAttributes.php new file mode 100644 index 00000000..aa337d84 --- /dev/null +++ b/src/Types/DeviceAttributes.php @@ -0,0 +1,235 @@ +type = $values['type']; + $this->manufacturer = $values['manufacturer']; + $this->model = $values['model'] ?? null; + $this->name = $values['name'] ?? null; + $this->manufacturersId = $values['manufacturersId'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->merchantToken = $values['merchantToken'] ?? null; + } + + /** + * @return 'TERMINAL' + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param 'TERMINAL' $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getManufacturer(): string + { + return $this->manufacturer; + } + + /** + * @param string $value + */ + public function setManufacturer(string $value): self + { + $this->manufacturer = $value; + return $this; + } + + /** + * @return ?string + */ + public function getModel(): ?string + { + return $this->model; + } + + /** + * @param ?string $value + */ + public function setModel(?string $value = null): self + { + $this->model = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getManufacturersId(): ?string + { + return $this->manufacturersId; + } + + /** + * @param ?string $value + */ + public function setManufacturersId(?string $value = null): self + { + $this->manufacturersId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVersion(): ?string + { + return $this->version; + } + + /** + * @param ?string $value + */ + public function setVersion(?string $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantToken(): ?string + { + return $this->merchantToken; + } + + /** + * @param ?string $value + */ + public function setMerchantToken(?string $value = null): self + { + $this->merchantToken = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceCheckoutOptions.php b/src/Types/DeviceCheckoutOptions.php new file mode 100644 index 00000000..908c80ba --- /dev/null +++ b/src/Types/DeviceCheckoutOptions.php @@ -0,0 +1,158 @@ +deviceId = $values['deviceId']; + $this->skipReceiptScreen = $values['skipReceiptScreen'] ?? null; + $this->collectSignature = $values['collectSignature'] ?? null; + $this->tipSettings = $values['tipSettings'] ?? null; + $this->showItemizedCart = $values['showItemizedCart'] ?? null; + } + + /** + * @return string + */ + public function getDeviceId(): string + { + return $this->deviceId; + } + + /** + * @param string $value + */ + public function setDeviceId(string $value): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSkipReceiptScreen(): ?bool + { + return $this->skipReceiptScreen; + } + + /** + * @param ?bool $value + */ + public function setSkipReceiptScreen(?bool $value = null): self + { + $this->skipReceiptScreen = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCollectSignature(): ?bool + { + return $this->collectSignature; + } + + /** + * @param ?bool $value + */ + public function setCollectSignature(?bool $value = null): self + { + $this->collectSignature = $value; + return $this; + } + + /** + * @return ?TipSettings + */ + public function getTipSettings(): ?TipSettings + { + return $this->tipSettings; + } + + /** + * @param ?TipSettings $value + */ + public function setTipSettings(?TipSettings $value = null): self + { + $this->tipSettings = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getShowItemizedCart(): ?bool + { + return $this->showItemizedCart; + } + + /** + * @param ?bool $value + */ + public function setShowItemizedCart(?bool $value = null): self + { + $this->showItemizedCart = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceCode.php b/src/Types/DeviceCode.php new file mode 100644 index 00000000..fa762ad0 --- /dev/null +++ b/src/Types/DeviceCode.php @@ -0,0 +1,304 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $pairBy When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. + */ + #[JsonProperty('pair_by')] + private ?string $pairBy; + + /** + * @var ?string $createdAt When this DeviceCode was created. Timestamp in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $statusChangedAt When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. + */ + #[JsonProperty('status_changed_at')] + private ?string $statusChangedAt; + + /** + * @var ?string $pairedAt When this DeviceCode was paired. Timestamp in RFC 3339 format. + */ + #[JsonProperty('paired_at')] + private ?string $pairedAt; + + /** + * @param array{ + * productType: 'TERMINAL_API', + * id?: ?string, + * name?: ?string, + * code?: ?string, + * deviceId?: ?string, + * locationId?: ?string, + * status?: ?value-of, + * pairBy?: ?string, + * createdAt?: ?string, + * statusChangedAt?: ?string, + * pairedAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->name = $values['name'] ?? null; + $this->code = $values['code'] ?? null; + $this->deviceId = $values['deviceId'] ?? null; + $this->productType = $values['productType']; + $this->locationId = $values['locationId'] ?? null; + $this->status = $values['status'] ?? null; + $this->pairBy = $values['pairBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->statusChangedAt = $values['statusChangedAt'] ?? null; + $this->pairedAt = $values['pairedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCode(): ?string + { + return $this->code; + } + + /** + * @param ?string $value + */ + public function setCode(?string $value = null): self + { + $this->code = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return 'TERMINAL_API' + */ + public function getProductType(): string + { + return $this->productType; + } + + /** + * @param 'TERMINAL_API' $value + */ + public function setProductType(string $value): self + { + $this->productType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPairBy(): ?string + { + return $this->pairBy; + } + + /** + * @param ?string $value + */ + public function setPairBy(?string $value = null): self + { + $this->pairBy = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatusChangedAt(): ?string + { + return $this->statusChangedAt; + } + + /** + * @param ?string $value + */ + public function setStatusChangedAt(?string $value = null): self + { + $this->statusChangedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPairedAt(): ?string + { + return $this->pairedAt; + } + + /** + * @param ?string $value + */ + public function setPairedAt(?string $value = null): self + { + $this->pairedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceCodeStatus.php b/src/Types/DeviceCodeStatus.php new file mode 100644 index 00000000..37b08366 --- /dev/null +++ b/src/Types/DeviceCodeStatus.php @@ -0,0 +1,11 @@ +applicationType = $values['applicationType'] ?? null; + $this->version = $values['version'] ?? null; + $this->sessionLocation = $values['sessionLocation'] ?? null; + $this->deviceCodeId = $values['deviceCodeId'] ?? null; + } + + /** + * @return ?'TERMINAL_API' + */ + public function getApplicationType(): ?string + { + return $this->applicationType; + } + + /** + * @param ?'TERMINAL_API' $value + */ + public function setApplicationType(?string $value = null): self + { + $this->applicationType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVersion(): ?string + { + return $this->version; + } + + /** + * @param ?string $value + */ + public function setVersion(?string $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSessionLocation(): ?string + { + return $this->sessionLocation; + } + + /** + * @param ?string $value + */ + public function setSessionLocation(?string $value = null): self + { + $this->sessionLocation = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeviceCodeId(): ?string + { + return $this->deviceCodeId; + } + + /** + * @param ?string $value + */ + public function setDeviceCodeId(?string $value = null): self + { + $this->deviceCodeId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceComponentDetailsBatteryDetails.php b/src/Types/DeviceComponentDetailsBatteryDetails.php new file mode 100644 index 00000000..e0da349d --- /dev/null +++ b/src/Types/DeviceComponentDetailsBatteryDetails.php @@ -0,0 +1,79 @@ + $externalPower + */ + #[JsonProperty('external_power')] + private ?string $externalPower; + + /** + * @param array{ + * visiblePercent?: ?int, + * externalPower?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->visiblePercent = $values['visiblePercent'] ?? null; + $this->externalPower = $values['externalPower'] ?? null; + } + + /** + * @return ?int + */ + public function getVisiblePercent(): ?int + { + return $this->visiblePercent; + } + + /** + * @param ?int $value + */ + public function setVisiblePercent(?int $value = null): self + { + $this->visiblePercent = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getExternalPower(): ?string + { + return $this->externalPower; + } + + /** + * @param ?value-of $value + */ + public function setExternalPower(?string $value = null): self + { + $this->externalPower = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceComponentDetailsCardReaderDetails.php b/src/Types/DeviceComponentDetailsCardReaderDetails.php new file mode 100644 index 00000000..53399925 --- /dev/null +++ b/src/Types/DeviceComponentDetailsCardReaderDetails.php @@ -0,0 +1,51 @@ +version = $values['version'] ?? null; + } + + /** + * @return ?string + */ + public function getVersion(): ?string + { + return $this->version; + } + + /** + * @param ?string $value + */ + public function setVersion(?string $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceComponentDetailsEthernetDetails.php b/src/Types/DeviceComponentDetailsEthernetDetails.php new file mode 100644 index 00000000..38c2ca89 --- /dev/null +++ b/src/Types/DeviceComponentDetailsEthernetDetails.php @@ -0,0 +1,76 @@ +active = $values['active'] ?? null; + $this->ipAddressV4 = $values['ipAddressV4'] ?? null; + } + + /** + * @return ?bool + */ + public function getActive(): ?bool + { + return $this->active; + } + + /** + * @param ?bool $value + */ + public function setActive(?bool $value = null): self + { + $this->active = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIpAddressV4(): ?string + { + return $this->ipAddressV4; + } + + /** + * @param ?string $value + */ + public function setIpAddressV4(?string $value = null): self + { + $this->ipAddressV4 = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceComponentDetailsExternalPower.php b/src/Types/DeviceComponentDetailsExternalPower.php new file mode 100644 index 00000000..99d90a66 --- /dev/null +++ b/src/Types/DeviceComponentDetailsExternalPower.php @@ -0,0 +1,11 @@ +value = $values['value'] ?? null; + } + + /** + * @return ?int + */ + public function getValue(): ?int + { + return $this->value; + } + + /** + * @param ?int $value + */ + public function setValue(?int $value = null): self + { + $this->value = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceComponentDetailsWiFiDetails.php b/src/Types/DeviceComponentDetailsWiFiDetails.php new file mode 100644 index 00000000..08d85acb --- /dev/null +++ b/src/Types/DeviceComponentDetailsWiFiDetails.php @@ -0,0 +1,154 @@ +active = $values['active'] ?? null; + $this->ssid = $values['ssid'] ?? null; + $this->ipAddressV4 = $values['ipAddressV4'] ?? null; + $this->secureConnection = $values['secureConnection'] ?? null; + $this->signalStrength = $values['signalStrength'] ?? null; + } + + /** + * @return ?bool + */ + public function getActive(): ?bool + { + return $this->active; + } + + /** + * @param ?bool $value + */ + public function setActive(?bool $value = null): self + { + $this->active = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSsid(): ?string + { + return $this->ssid; + } + + /** + * @param ?string $value + */ + public function setSsid(?string $value = null): self + { + $this->ssid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIpAddressV4(): ?string + { + return $this->ipAddressV4; + } + + /** + * @param ?string $value + */ + public function setIpAddressV4(?string $value = null): self + { + $this->ipAddressV4 = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSecureConnection(): ?string + { + return $this->secureConnection; + } + + /** + * @param ?string $value + */ + public function setSecureConnection(?string $value = null): self + { + $this->secureConnection = $value; + return $this; + } + + /** + * @return ?DeviceComponentDetailsMeasurement + */ + public function getSignalStrength(): ?DeviceComponentDetailsMeasurement + { + return $this->signalStrength; + } + + /** + * @param ?DeviceComponentDetailsMeasurement $value + */ + public function setSignalStrength(?DeviceComponentDetailsMeasurement $value = null): self + { + $this->signalStrength = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceDetails.php b/src/Types/DeviceDetails.php new file mode 100644 index 00000000..0d65aa8e --- /dev/null +++ b/src/Types/DeviceDetails.php @@ -0,0 +1,104 @@ +deviceId = $values['deviceId'] ?? null; + $this->deviceInstallationId = $values['deviceInstallationId'] ?? null; + $this->deviceName = $values['deviceName'] ?? null; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeviceInstallationId(): ?string + { + return $this->deviceInstallationId; + } + + /** + * @param ?string $value + */ + public function setDeviceInstallationId(?string $value = null): self + { + $this->deviceInstallationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeviceName(): ?string + { + return $this->deviceName; + } + + /** + * @param ?string $value + */ + public function setDeviceName(?string $value = null): self + { + $this->deviceName = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceMetadata.php b/src/Types/DeviceMetadata.php new file mode 100644 index 00000000..33e89426 --- /dev/null +++ b/src/Types/DeviceMetadata.php @@ -0,0 +1,338 @@ +batteryPercentage = $values['batteryPercentage'] ?? null; + $this->chargingState = $values['chargingState'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->networkConnectionType = $values['networkConnectionType'] ?? null; + $this->paymentRegion = $values['paymentRegion'] ?? null; + $this->serialNumber = $values['serialNumber'] ?? null; + $this->osVersion = $values['osVersion'] ?? null; + $this->appVersion = $values['appVersion'] ?? null; + $this->wifiNetworkName = $values['wifiNetworkName'] ?? null; + $this->wifiNetworkStrength = $values['wifiNetworkStrength'] ?? null; + $this->ipAddress = $values['ipAddress'] ?? null; + } + + /** + * @return ?string + */ + public function getBatteryPercentage(): ?string + { + return $this->batteryPercentage; + } + + /** + * @param ?string $value + */ + public function setBatteryPercentage(?string $value = null): self + { + $this->batteryPercentage = $value; + return $this; + } + + /** + * @return ?string + */ + public function getChargingState(): ?string + { + return $this->chargingState; + } + + /** + * @param ?string $value + */ + public function setChargingState(?string $value = null): self + { + $this->chargingState = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNetworkConnectionType(): ?string + { + return $this->networkConnectionType; + } + + /** + * @param ?string $value + */ + public function setNetworkConnectionType(?string $value = null): self + { + $this->networkConnectionType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentRegion(): ?string + { + return $this->paymentRegion; + } + + /** + * @param ?string $value + */ + public function setPaymentRegion(?string $value = null): self + { + $this->paymentRegion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSerialNumber(): ?string + { + return $this->serialNumber; + } + + /** + * @param ?string $value + */ + public function setSerialNumber(?string $value = null): self + { + $this->serialNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOsVersion(): ?string + { + return $this->osVersion; + } + + /** + * @param ?string $value + */ + public function setOsVersion(?string $value = null): self + { + $this->osVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAppVersion(): ?string + { + return $this->appVersion; + } + + /** + * @param ?string $value + */ + public function setAppVersion(?string $value = null): self + { + $this->appVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getWifiNetworkName(): ?string + { + return $this->wifiNetworkName; + } + + /** + * @param ?string $value + */ + public function setWifiNetworkName(?string $value = null): self + { + $this->wifiNetworkName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getWifiNetworkStrength(): ?string + { + return $this->wifiNetworkStrength; + } + + /** + * @param ?string $value + */ + public function setWifiNetworkStrength(?string $value = null): self + { + $this->wifiNetworkStrength = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIpAddress(): ?string + { + return $this->ipAddress; + } + + /** + * @param ?string $value + */ + public function setIpAddress(?string $value = null): self + { + $this->ipAddress = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceStatus.php b/src/Types/DeviceStatus.php new file mode 100644 index 00000000..24fd781f --- /dev/null +++ b/src/Types/DeviceStatus.php @@ -0,0 +1,54 @@ + $category + */ + #[JsonProperty('category')] + private ?string $category; + + /** + * @param array{ + * category?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->category = $values['category'] ?? null; + } + + /** + * @return ?value-of + */ + public function getCategory(): ?string + { + return $this->category; + } + + /** + * @param ?value-of $value + */ + public function setCategory(?string $value = null): self + { + $this->category = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeviceStatusCategory.php b/src/Types/DeviceStatusCategory.php new file mode 100644 index 00000000..49c673d1 --- /dev/null +++ b/src/Types/DeviceStatusCategory.php @@ -0,0 +1,10 @@ +status = $values['status'] ?? null; + $this->brand = $values['brand'] ?? null; + $this->cashAppDetails = $values['cashAppDetails'] ?? null; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBrand(): ?string + { + return $this->brand; + } + + /** + * @param ?string $value + */ + public function setBrand(?string $value = null): self + { + $this->brand = $value; + return $this; + } + + /** + * @return ?CashAppDetails + */ + public function getCashAppDetails(): ?CashAppDetails + { + return $this->cashAppDetails; + } + + /** + * @param ?CashAppDetails $value + */ + public function setCashAppDetails(?CashAppDetails $value = null): self + { + $this->cashAppDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DisableCardResponse.php b/src/Types/DisableCardResponse.php new file mode 100644 index 00000000..779183da --- /dev/null +++ b/src/Types/DisableCardResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Card $card The retrieved card. + */ + #[JsonProperty('card')] + private ?Card $card; + + /** + * @param array{ + * errors?: ?array, + * card?: ?Card, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->card = $values['card'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DisableEventsResponse.php b/src/Types/DisableEventsResponse.php new file mode 100644 index 00000000..fedfaaaa --- /dev/null +++ b/src/Types/DisableEventsResponse.php @@ -0,0 +1,59 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DismissTerminalActionResponse.php b/src/Types/DismissTerminalActionResponse.php new file mode 100644 index 00000000..694d248b --- /dev/null +++ b/src/Types/DismissTerminalActionResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalAction $action Current state of the action to be dismissed. + */ + #[JsonProperty('action')] + private ?TerminalAction $action; + + /** + * @param array{ + * errors?: ?array, + * action?: ?TerminalAction, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->action = $values['action'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalAction + */ + public function getAction(): ?TerminalAction + { + return $this->action; + } + + /** + * @param ?TerminalAction $value + */ + public function setAction(?TerminalAction $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DismissTerminalCheckoutResponse.php b/src/Types/DismissTerminalCheckoutResponse.php new file mode 100644 index 00000000..2b540c90 --- /dev/null +++ b/src/Types/DismissTerminalCheckoutResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalCheckout $checkout Current state of the checkout to be dismissed. + */ + #[JsonProperty('checkout')] + private ?TerminalCheckout $checkout; + + /** + * @param array{ + * errors?: ?array, + * checkout?: ?TerminalCheckout, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->checkout = $values['checkout'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalCheckout + */ + public function getCheckout(): ?TerminalCheckout + { + return $this->checkout; + } + + /** + * @param ?TerminalCheckout $value + */ + public function setCheckout(?TerminalCheckout $value = null): self + { + $this->checkout = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DismissTerminalRefundResponse.php b/src/Types/DismissTerminalRefundResponse.php new file mode 100644 index 00000000..c5749f86 --- /dev/null +++ b/src/Types/DismissTerminalRefundResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalRefund $refund Current state of the refund to be dismissed. + */ + #[JsonProperty('refund')] + private ?TerminalRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?TerminalRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalRefund + */ + public function getRefund(): ?TerminalRefund + { + return $this->refund; + } + + /** + * @param ?TerminalRefund $value + */ + public function setRefund(?TerminalRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Dispute.php b/src/Types/Dispute.php new file mode 100644 index 00000000..1901ac6a --- /dev/null +++ b/src/Types/Dispute.php @@ -0,0 +1,442 @@ + $reason + */ + #[JsonProperty('reason')] + private ?string $reason; + + /** + * The current state of this dispute. + * See [DisputeState](#type-disputestate) for possible values + * + * @var ?value-of $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * @var ?string $dueAt The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates). + */ + #[JsonProperty('due_at')] + private ?string $dueAt; + + /** + * @var ?DisputedPayment $disputedPayment The payment challenged in this dispute. + */ + #[JsonProperty('disputed_payment')] + private ?DisputedPayment $disputedPayment; + + /** + * @var ?array $evidenceIds The IDs of the evidence associated with the dispute. + */ + #[JsonProperty('evidence_ids'), ArrayType(['string'])] + private ?array $evidenceIds; + + /** + * The card brand used in the disputed payment. + * See [CardBrand](#type-cardbrand) for possible values + * + * @var ?value-of $cardBrand + */ + #[JsonProperty('card_brand')] + private ?string $cardBrand; + + /** + * @var ?string $createdAt The timestamp when the dispute was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the dispute was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $brandDisputeId The ID of the dispute in the card brand system, generated by the card brand. + */ + #[JsonProperty('brand_dispute_id')] + private ?string $brandDisputeId; + + /** + * @var ?string $reportedDate The timestamp when the dispute was reported, in RFC 3339 format. + */ + #[JsonProperty('reported_date')] + private ?string $reportedDate; + + /** + * @var ?string $reportedAt The timestamp when the dispute was reported, in RFC 3339 format. + */ + #[JsonProperty('reported_at')] + private ?string $reportedAt; + + /** + * @var ?int $version The current version of the `Dispute`. + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?string $locationId The ID of the location where the dispute originated. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * @param array{ + * disputeId?: ?string, + * id?: ?string, + * amountMoney?: ?Money, + * reason?: ?value-of, + * state?: ?value-of, + * dueAt?: ?string, + * disputedPayment?: ?DisputedPayment, + * evidenceIds?: ?array, + * cardBrand?: ?value-of, + * createdAt?: ?string, + * updatedAt?: ?string, + * brandDisputeId?: ?string, + * reportedDate?: ?string, + * reportedAt?: ?string, + * version?: ?int, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->disputeId = $values['disputeId'] ?? null; + $this->id = $values['id'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->state = $values['state'] ?? null; + $this->dueAt = $values['dueAt'] ?? null; + $this->disputedPayment = $values['disputedPayment'] ?? null; + $this->evidenceIds = $values['evidenceIds'] ?? null; + $this->cardBrand = $values['cardBrand'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->brandDisputeId = $values['brandDisputeId'] ?? null; + $this->reportedDate = $values['reportedDate'] ?? null; + $this->reportedAt = $values['reportedAt'] ?? null; + $this->version = $values['version'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getDisputeId(): ?string + { + return $this->disputeId; + } + + /** + * @param ?string $value + */ + public function setDisputeId(?string $value = null): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getReason(): ?string + { + return $this->reason; + } + + /** + * @param ?value-of $value + */ + public function setReason(?string $value = null): self + { + $this->reason = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDueAt(): ?string + { + return $this->dueAt; + } + + /** + * @param ?string $value + */ + public function setDueAt(?string $value = null): self + { + $this->dueAt = $value; + return $this; + } + + /** + * @return ?DisputedPayment + */ + public function getDisputedPayment(): ?DisputedPayment + { + return $this->disputedPayment; + } + + /** + * @param ?DisputedPayment $value + */ + public function setDisputedPayment(?DisputedPayment $value = null): self + { + $this->disputedPayment = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEvidenceIds(): ?array + { + return $this->evidenceIds; + } + + /** + * @param ?array $value + */ + public function setEvidenceIds(?array $value = null): self + { + $this->evidenceIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCardBrand(): ?string + { + return $this->cardBrand; + } + + /** + * @param ?value-of $value + */ + public function setCardBrand(?string $value = null): self + { + $this->cardBrand = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBrandDisputeId(): ?string + { + return $this->brandDisputeId; + } + + /** + * @param ?string $value + */ + public function setBrandDisputeId(?string $value = null): self + { + $this->brandDisputeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReportedDate(): ?string + { + return $this->reportedDate; + } + + /** + * @param ?string $value + */ + public function setReportedDate(?string $value = null): self + { + $this->reportedDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReportedAt(): ?string + { + return $this->reportedAt; + } + + /** + * @param ?string $value + */ + public function setReportedAt(?string $value = null): self + { + $this->reportedAt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DisputeEvidence.php b/src/Types/DisputeEvidence.php new file mode 100644 index 00000000..0d5f20a5 --- /dev/null +++ b/src/Types/DisputeEvidence.php @@ -0,0 +1,204 @@ + $evidenceType + */ + #[JsonProperty('evidence_type')] + private ?string $evidenceType; + + /** + * @param array{ + * evidenceId?: ?string, + * id?: ?string, + * disputeId?: ?string, + * evidenceFile?: ?DisputeEvidenceFile, + * evidenceText?: ?string, + * uploadedAt?: ?string, + * evidenceType?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->evidenceId = $values['evidenceId'] ?? null; + $this->id = $values['id'] ?? null; + $this->disputeId = $values['disputeId'] ?? null; + $this->evidenceFile = $values['evidenceFile'] ?? null; + $this->evidenceText = $values['evidenceText'] ?? null; + $this->uploadedAt = $values['uploadedAt'] ?? null; + $this->evidenceType = $values['evidenceType'] ?? null; + } + + /** + * @return ?string + */ + public function getEvidenceId(): ?string + { + return $this->evidenceId; + } + + /** + * @param ?string $value + */ + public function setEvidenceId(?string $value = null): self + { + $this->evidenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisputeId(): ?string + { + return $this->disputeId; + } + + /** + * @param ?string $value + */ + public function setDisputeId(?string $value = null): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return ?DisputeEvidenceFile + */ + public function getEvidenceFile(): ?DisputeEvidenceFile + { + return $this->evidenceFile; + } + + /** + * @param ?DisputeEvidenceFile $value + */ + public function setEvidenceFile(?DisputeEvidenceFile $value = null): self + { + $this->evidenceFile = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEvidenceText(): ?string + { + return $this->evidenceText; + } + + /** + * @param ?string $value + */ + public function setEvidenceText(?string $value = null): self + { + $this->evidenceText = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUploadedAt(): ?string + { + return $this->uploadedAt; + } + + /** + * @param ?string $value + */ + public function setUploadedAt(?string $value = null): self + { + $this->uploadedAt = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEvidenceType(): ?string + { + return $this->evidenceType; + } + + /** + * @param ?value-of $value + */ + public function setEvidenceType(?string $value = null): self + { + $this->evidenceType = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DisputeEvidenceFile.php b/src/Types/DisputeEvidenceFile.php new file mode 100644 index 00000000..905c4b7b --- /dev/null +++ b/src/Types/DisputeEvidenceFile.php @@ -0,0 +1,79 @@ +filename = $values['filename'] ?? null; + $this->filetype = $values['filetype'] ?? null; + } + + /** + * @return ?string + */ + public function getFilename(): ?string + { + return $this->filename; + } + + /** + * @param ?string $value + */ + public function setFilename(?string $value = null): self + { + $this->filename = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFiletype(): ?string + { + return $this->filetype; + } + + /** + * @param ?string $value + */ + public function setFiletype(?string $value = null): self + { + $this->filetype = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DisputeEvidenceType.php b/src/Types/DisputeEvidenceType.php new file mode 100644 index 00000000..1ac4d2ca --- /dev/null +++ b/src/Types/DisputeEvidenceType.php @@ -0,0 +1,22 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Employee.php b/src/Types/Employee.php new file mode 100644 index 00000000..f16f2cd9 --- /dev/null +++ b/src/Types/Employee.php @@ -0,0 +1,289 @@ + $locationIds A list of location IDs where this employee has access to. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * Specifies the status of the employees being fetched. + * See [EmployeeStatus](#type-employeestatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * Whether this employee is the owner of the merchant. Each merchant + * has one owner employee, and that employee has full authority over + * the account. + * + * @var ?bool $isOwner + */ + #[JsonProperty('is_owner')] + private ?bool $isOwner; + + /** + * @var ?string $createdAt A read-only timestamp in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt A read-only timestamp in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * id?: ?string, + * firstName?: ?string, + * lastName?: ?string, + * email?: ?string, + * phoneNumber?: ?string, + * locationIds?: ?array, + * status?: ?value-of, + * isOwner?: ?bool, + * createdAt?: ?string, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->firstName = $values['firstName'] ?? null; + $this->lastName = $values['lastName'] ?? null; + $this->email = $values['email'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->status = $values['status'] ?? null; + $this->isOwner = $values['isOwner'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFirstName(): ?string + { + return $this->firstName; + } + + /** + * @param ?string $value + */ + public function setFirstName(?string $value = null): self + { + $this->firstName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param ?string $value + */ + public function setLastName(?string $value = null): self + { + $this->lastName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @param ?string $value + */ + public function setEmail(?string $value = null): self + { + $this->email = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOwner(): ?bool + { + return $this->isOwner; + } + + /** + * @param ?bool $value + */ + public function setIsOwner(?bool $value = null): self + { + $this->isOwner = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EmployeeStatus.php b/src/Types/EmployeeStatus.php new file mode 100644 index 00000000..52ba5a47 --- /dev/null +++ b/src/Types/EmployeeStatus.php @@ -0,0 +1,9 @@ +id = $values['id'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->title = $values['title'] ?? null; + $this->hourlyRate = $values['hourlyRate'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getHourlyRate(): ?Money + { + return $this->hourlyRate; + } + + /** + * @param ?Money $value + */ + public function setHourlyRate(?Money $value = null): self + { + $this->hourlyRate = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EnableEventsResponse.php b/src/Types/EnableEventsResponse.php new file mode 100644 index 00000000..e8696af2 --- /dev/null +++ b/src/Types/EnableEventsResponse.php @@ -0,0 +1,59 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Error.php b/src/Types/Error.php new file mode 100644 index 00000000..4c538e57 --- /dev/null +++ b/src/Types/Error.php @@ -0,0 +1,140 @@ + $category + */ + #[JsonProperty('category')] + private string $category; + + /** + * The specific code of the error. + * See [ErrorCode](#type-errorcode) for possible values + * + * @var value-of $code + */ + #[JsonProperty('code')] + private string $code; + + /** + * @var ?string $detail A human-readable description of the error for debugging purposes. + */ + #[JsonProperty('detail')] + private ?string $detail; + + /** + * The name of the field provided in the original request (if any) that + * the error pertains to. + * + * @var ?string $field + */ + #[JsonProperty('field')] + private ?string $field; + + /** + * @param array{ + * category: value-of, + * code: value-of, + * detail?: ?string, + * field?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->category = $values['category']; + $this->code = $values['code']; + $this->detail = $values['detail'] ?? null; + $this->field = $values['field'] ?? null; + } + + /** + * @return value-of + */ + public function getCategory(): string + { + return $this->category; + } + + /** + * @param value-of $value + */ + public function setCategory(string $value): self + { + $this->category = $value; + return $this; + } + + /** + * @return value-of + */ + public function getCode(): string + { + return $this->code; + } + + /** + * @param value-of $value + */ + public function setCode(string $value): self + { + $this->code = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDetail(): ?string + { + return $this->detail; + } + + /** + * @param ?string $value + */ + public function setDetail(?string $value = null): self + { + $this->detail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getField(): ?string + { + return $this->field; + } + + /** + * @param ?string $value + */ + public function setField(?string $value = null): self + { + $this->field = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ErrorCategory.php b/src/Types/ErrorCategory.php new file mode 100644 index 00000000..479c3f4b --- /dev/null +++ b/src/Types/ErrorCategory.php @@ -0,0 +1,15 @@ +merchantId = $values['merchantId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->type = $values['type'] ?? null; + $this->eventId = $values['eventId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->data = $values['data'] ?? null; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?string $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEventId(): ?string + { + return $this->eventId; + } + + /** + * @param ?string $value + */ + public function setEventId(?string $value = null): self + { + $this->eventId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?EventData + */ + public function getData(): ?EventData + { + return $this->data; + } + + /** + * @param ?EventData $value + */ + public function setData(?EventData $value = null): self + { + $this->data = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EventData.php b/src/Types/EventData.php new file mode 100644 index 00000000..25c6cda1 --- /dev/null +++ b/src/Types/EventData.php @@ -0,0 +1,127 @@ + $object An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. + */ + #[JsonProperty('object'), ArrayType(['string' => 'mixed'])] + private ?array $object; + + /** + * @param array{ + * type?: ?string, + * id?: ?string, + * deleted?: ?bool, + * object?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->id = $values['id'] ?? null; + $this->deleted = $values['deleted'] ?? null; + $this->object = $values['object'] ?? null; + } + + /** + * @return ?string + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?string $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getDeleted(): ?bool + { + return $this->deleted; + } + + /** + * @param ?bool $value + */ + public function setDeleted(?bool $value = null): self + { + $this->deleted = $value; + return $this; + } + + /** + * @return ?array + */ + public function getObject(): ?array + { + return $this->object; + } + + /** + * @param ?array $value + */ + public function setObject(?array $value = null): self + { + $this->object = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EventMetadata.php b/src/Types/EventMetadata.php new file mode 100644 index 00000000..b646b3f6 --- /dev/null +++ b/src/Types/EventMetadata.php @@ -0,0 +1,79 @@ +eventId = $values['eventId'] ?? null; + $this->apiVersion = $values['apiVersion'] ?? null; + } + + /** + * @return ?string + */ + public function getEventId(): ?string + { + return $this->eventId; + } + + /** + * @param ?string $value + */ + public function setEventId(?string $value = null): self + { + $this->eventId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + + /** + * @param ?string $value + */ + public function setApiVersion(?string $value = null): self + { + $this->apiVersion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EventTypeMetadata.php b/src/Types/EventTypeMetadata.php new file mode 100644 index 00000000..da905e1e --- /dev/null +++ b/src/Types/EventTypeMetadata.php @@ -0,0 +1,104 @@ +eventType = $values['eventType'] ?? null; + $this->apiVersionIntroduced = $values['apiVersionIntroduced'] ?? null; + $this->releaseStatus = $values['releaseStatus'] ?? null; + } + + /** + * @return ?string + */ + public function getEventType(): ?string + { + return $this->eventType; + } + + /** + * @param ?string $value + */ + public function setEventType(?string $value = null): self + { + $this->eventType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApiVersionIntroduced(): ?string + { + return $this->apiVersionIntroduced; + } + + /** + * @param ?string $value + */ + public function setApiVersionIntroduced(?string $value = null): self + { + $this->apiVersionIntroduced = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReleaseStatus(): ?string + { + return $this->releaseStatus; + } + + /** + * @param ?string $value + */ + public function setReleaseStatus(?string $value = null): self + { + $this->releaseStatus = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ExcludeStrategy.php b/src/Types/ExcludeStrategy.php new file mode 100644 index 00000000..777874b9 --- /dev/null +++ b/src/Types/ExcludeStrategy.php @@ -0,0 +1,9 @@ +type = $values['type']; + $this->source = $values['source']; + $this->sourceId = $values['sourceId'] ?? null; + $this->sourceFeeMoney = $values['sourceFeeMoney'] ?? null; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $value + */ + public function setSource(string $value): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceId(): ?string + { + return $this->sourceId; + } + + /** + * @param ?string $value + */ + public function setSourceId(?string $value = null): self + { + $this->sourceId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getSourceFeeMoney(): ?Money + { + return $this->sourceFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setSourceFeeMoney(?Money $value = null): self + { + $this->sourceFeeMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FilterValue.php b/src/Types/FilterValue.php new file mode 100644 index 00000000..211cc26c --- /dev/null +++ b/src/Types/FilterValue.php @@ -0,0 +1,112 @@ + $all A list of terms that must be present on the field of the resource. + */ + #[JsonProperty('all'), ArrayType(['string'])] + private ?array $all; + + /** + * A list of terms where at least one of them must be present on the + * field of the resource. + * + * @var ?array $any + */ + #[JsonProperty('any'), ArrayType(['string'])] + private ?array $any; + + /** + * @var ?array $none A list of terms that must not be present on the field the resource + */ + #[JsonProperty('none'), ArrayType(['string'])] + private ?array $none; + + /** + * @param array{ + * all?: ?array, + * any?: ?array, + * none?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->all = $values['all'] ?? null; + $this->any = $values['any'] ?? null; + $this->none = $values['none'] ?? null; + } + + /** + * @return ?array + */ + public function getAll(): ?array + { + return $this->all; + } + + /** + * @param ?array $value + */ + public function setAll(?array $value = null): self + { + $this->all = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAny(): ?array + { + return $this->any; + } + + /** + * @param ?array $value + */ + public function setAny(?array $value = null): self + { + $this->any = $value; + return $this; + } + + /** + * @return ?array + */ + public function getNone(): ?array + { + return $this->none; + } + + /** + * @param ?array $value + */ + public function setNone(?array $value = null): self + { + $this->none = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FloatNumberRange.php b/src/Types/FloatNumberRange.php new file mode 100644 index 00000000..1a3fd25b --- /dev/null +++ b/src/Types/FloatNumberRange.php @@ -0,0 +1,79 @@ +startAt = $values['startAt'] ?? null; + $this->endAt = $values['endAt'] ?? null; + } + + /** + * @return ?string + */ + public function getStartAt(): ?string + { + return $this->startAt; + } + + /** + * @param ?string $value + */ + public function setStartAt(?string $value = null): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndAt(): ?string + { + return $this->endAt; + } + + /** + * @param ?string $value + */ + public function setEndAt(?string $value = null): self + { + $this->endAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Fulfillment.php b/src/Types/Fulfillment.php new file mode 100644 index 00000000..f86754a6 --- /dev/null +++ b/src/Types/Fulfillment.php @@ -0,0 +1,313 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The state of the fulfillment. + * See [FulfillmentState](#type-fulfillmentstate) for possible values + * + * @var ?value-of $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * Describes what order line items this fulfillment applies to. + * It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. + * See [FulfillmentFulfillmentLineItemApplication](#type-fulfillmentfulfillmentlineitemapplication) for possible values + * + * @var ?value-of $lineItemApplication + */ + #[JsonProperty('line_item_application')] + private ?string $lineItemApplication; + + /** + * A list of entries pertaining to the fulfillment of an order. Each entry must reference + * a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to + * fulfill. + * + * Multiple entries can reference the same line item `uid`, as long as the total quantity among + * all fulfillment entries referencing a single line item does not exceed the quantity of the + * order's line item itself. + * + * An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, + * `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently + * before order completion. + * + * @var ?array $entries + */ + #[JsonProperty('entries'), ArrayType([FulfillmentFulfillmentEntry::class])] + private ?array $entries; + + /** + * Application-defined data attached to this fulfillment. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * Contains details for a pickup fulfillment. These details are required when the fulfillment + * type is `PICKUP`. + * + * @var ?FulfillmentPickupDetails $pickupDetails + */ + #[JsonProperty('pickup_details')] + private ?FulfillmentPickupDetails $pickupDetails; + + /** + * Contains details for a shipment fulfillment. These details are required when the fulfillment type + * is `SHIPMENT`. + * + * A shipment fulfillment's relationship to fulfillment `state`: + * `PROPOSED`: A shipment is requested. + * `RESERVED`: Fulfillment in progress. Shipment processing. + * `PREPARED`: Shipment packaged. Shipping label created. + * `COMPLETED`: Package has been shipped. + * `CANCELED`: Shipment has been canceled. + * `FAILED`: Shipment has failed. + * + * @var ?FulfillmentShipmentDetails $shipmentDetails + */ + #[JsonProperty('shipment_details')] + private ?FulfillmentShipmentDetails $shipmentDetails; + + /** + * @var ?FulfillmentDeliveryDetails $deliveryDetails Describes delivery details of an order fulfillment. + */ + #[JsonProperty('delivery_details')] + private ?FulfillmentDeliveryDetails $deliveryDetails; + + /** + * @param array{ + * uid?: ?string, + * type?: ?value-of, + * state?: ?value-of, + * lineItemApplication?: ?value-of, + * entries?: ?array, + * metadata?: ?array, + * pickupDetails?: ?FulfillmentPickupDetails, + * shipmentDetails?: ?FulfillmentShipmentDetails, + * deliveryDetails?: ?FulfillmentDeliveryDetails, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->type = $values['type'] ?? null; + $this->state = $values['state'] ?? null; + $this->lineItemApplication = $values['lineItemApplication'] ?? null; + $this->entries = $values['entries'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->pickupDetails = $values['pickupDetails'] ?? null; + $this->shipmentDetails = $values['shipmentDetails'] ?? null; + $this->deliveryDetails = $values['deliveryDetails'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getLineItemApplication(): ?string + { + return $this->lineItemApplication; + } + + /** + * @param ?value-of $value + */ + public function setLineItemApplication(?string $value = null): self + { + $this->lineItemApplication = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEntries(): ?array + { + return $this->entries; + } + + /** + * @param ?array $value + */ + public function setEntries(?array $value = null): self + { + $this->entries = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?FulfillmentPickupDetails + */ + public function getPickupDetails(): ?FulfillmentPickupDetails + { + return $this->pickupDetails; + } + + /** + * @param ?FulfillmentPickupDetails $value + */ + public function setPickupDetails(?FulfillmentPickupDetails $value = null): self + { + $this->pickupDetails = $value; + return $this; + } + + /** + * @return ?FulfillmentShipmentDetails + */ + public function getShipmentDetails(): ?FulfillmentShipmentDetails + { + return $this->shipmentDetails; + } + + /** + * @param ?FulfillmentShipmentDetails $value + */ + public function setShipmentDetails(?FulfillmentShipmentDetails $value = null): self + { + $this->shipmentDetails = $value; + return $this; + } + + /** + * @return ?FulfillmentDeliveryDetails + */ + public function getDeliveryDetails(): ?FulfillmentDeliveryDetails + { + return $this->deliveryDetails; + } + + /** + * @param ?FulfillmentDeliveryDetails $value + */ + public function setDeliveryDetails(?FulfillmentDeliveryDetails $value = null): self + { + $this->deliveryDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentDeliveryDetails.php b/src/Types/FulfillmentDeliveryDetails.php new file mode 100644 index 00000000..e6becec7 --- /dev/null +++ b/src/Types/FulfillmentDeliveryDetails.php @@ -0,0 +1,679 @@ + $scheduleType + */ + #[JsonProperty('schedule_type')] + private ?string $scheduleType; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was placed. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * + * @var ?string $placedAt + */ + #[JsonProperty('placed_at')] + private ?string $placedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * that represents the start of the delivery period. + * When the fulfillment `schedule_type` is `ASAP`, the field is automatically + * set to the current time plus the `prep_time_duration`. + * Otherwise, the application can set this field while the fulfillment `state` is + * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the + * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). + * + * The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $deliverAt + */ + #[JsonProperty('deliver_at')] + private ?string $deliverAt; + + /** + * The duration of time it takes to prepare and deliver this fulfillment. + * The duration must be in RFC 3339 format (for example, "P1W3D"). + * + * @var ?string $prepTimeDuration + */ + #[JsonProperty('prep_time_duration')] + private ?string $prepTimeDuration; + + /** + * The time period after `deliver_at` in which to deliver the order. + * Applications can set this field when the fulfillment `state` is + * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state + * such as `COMPLETED`, `CANCELED`, and `FAILED`). + * + * The duration must be in RFC 3339 format (for example, "P1W3D"). + * + * @var ?string $deliveryWindowDuration + */ + #[JsonProperty('delivery_window_duration')] + private ?string $deliveryWindowDuration; + + /** + * Provides additional instructions about the delivery fulfillment. + * It is displayed in the Square Point of Sale application and set by the API. + * + * @var ?string $note + */ + #[JsonProperty('note')] + private ?string $note; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicates when the seller completed the fulfillment. + * This field is automatically set when fulfillment `state` changes to `COMPLETED`. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $completedAt + */ + #[JsonProperty('completed_at')] + private ?string $completedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicates when the seller started processing the fulfillment. + * This field is automatically set when the fulfillment `state` changes to `RESERVED`. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $inProgressAt + */ + #[JsonProperty('in_progress_at')] + private ?string $inProgressAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was rejected. This field is + * automatically set when the fulfillment `state` changes to `FAILED`. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $rejectedAt + */ + #[JsonProperty('rejected_at')] + private ?string $rejectedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the seller marked the fulfillment as ready for + * courier pickup. This field is automatically set when the fulfillment `state` changes + * to PREPARED. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $readyAt + */ + #[JsonProperty('ready_at')] + private ?string $readyAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was delivered to the recipient. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $deliveredAt + */ + #[JsonProperty('delivered_at')] + private ?string $deliveredAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was canceled. This field is automatically + * set when the fulfillment `state` changes to `CANCELED`. + * + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $canceledAt + */ + #[JsonProperty('canceled_at')] + private ?string $canceledAt; + + /** + * @var ?string $cancelReason The delivery cancellation reason. Max length: 100 characters. + */ + #[JsonProperty('cancel_reason')] + private ?string $cancelReason; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when an order can be picked up by the courier for delivery. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $courierPickupAt + */ + #[JsonProperty('courier_pickup_at')] + private ?string $courierPickupAt; + + /** + * The time period after `courier_pickup_at` in which the courier should pick up the order. + * The duration must be in RFC 3339 format (for example, "P1W3D"). + * + * @var ?string $courierPickupWindowDuration + */ + #[JsonProperty('courier_pickup_window_duration')] + private ?string $courierPickupWindowDuration; + + /** + * @var ?bool $isNoContactDelivery Whether the delivery is preferred to be no contact. + */ + #[JsonProperty('is_no_contact_delivery')] + private ?bool $isNoContactDelivery; + + /** + * @var ?string $dropoffNotes A note to provide additional instructions about how to deliver the order. + */ + #[JsonProperty('dropoff_notes')] + private ?string $dropoffNotes; + + /** + * @var ?string $courierProviderName The name of the courier provider. + */ + #[JsonProperty('courier_provider_name')] + private ?string $courierProviderName; + + /** + * @var ?string $courierSupportPhoneNumber The support phone number of the courier. + */ + #[JsonProperty('courier_support_phone_number')] + private ?string $courierSupportPhoneNumber; + + /** + * @var ?string $squareDeliveryId The identifier for the delivery created by Square. + */ + #[JsonProperty('square_delivery_id')] + private ?string $squareDeliveryId; + + /** + * @var ?string $externalDeliveryId The identifier for the delivery created by the third-party courier service. + */ + #[JsonProperty('external_delivery_id')] + private ?string $externalDeliveryId; + + /** + * The flag to indicate the delivery is managed by a third party (ie DoorDash), which means + * we may not receive all recipient information for PII purposes. + * + * @var ?bool $managedDelivery + */ + #[JsonProperty('managed_delivery')] + private ?bool $managedDelivery; + + /** + * @param array{ + * recipient?: ?FulfillmentRecipient, + * scheduleType?: ?value-of, + * placedAt?: ?string, + * deliverAt?: ?string, + * prepTimeDuration?: ?string, + * deliveryWindowDuration?: ?string, + * note?: ?string, + * completedAt?: ?string, + * inProgressAt?: ?string, + * rejectedAt?: ?string, + * readyAt?: ?string, + * deliveredAt?: ?string, + * canceledAt?: ?string, + * cancelReason?: ?string, + * courierPickupAt?: ?string, + * courierPickupWindowDuration?: ?string, + * isNoContactDelivery?: ?bool, + * dropoffNotes?: ?string, + * courierProviderName?: ?string, + * courierSupportPhoneNumber?: ?string, + * squareDeliveryId?: ?string, + * externalDeliveryId?: ?string, + * managedDelivery?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->recipient = $values['recipient'] ?? null; + $this->scheduleType = $values['scheduleType'] ?? null; + $this->placedAt = $values['placedAt'] ?? null; + $this->deliverAt = $values['deliverAt'] ?? null; + $this->prepTimeDuration = $values['prepTimeDuration'] ?? null; + $this->deliveryWindowDuration = $values['deliveryWindowDuration'] ?? null; + $this->note = $values['note'] ?? null; + $this->completedAt = $values['completedAt'] ?? null; + $this->inProgressAt = $values['inProgressAt'] ?? null; + $this->rejectedAt = $values['rejectedAt'] ?? null; + $this->readyAt = $values['readyAt'] ?? null; + $this->deliveredAt = $values['deliveredAt'] ?? null; + $this->canceledAt = $values['canceledAt'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->courierPickupAt = $values['courierPickupAt'] ?? null; + $this->courierPickupWindowDuration = $values['courierPickupWindowDuration'] ?? null; + $this->isNoContactDelivery = $values['isNoContactDelivery'] ?? null; + $this->dropoffNotes = $values['dropoffNotes'] ?? null; + $this->courierProviderName = $values['courierProviderName'] ?? null; + $this->courierSupportPhoneNumber = $values['courierSupportPhoneNumber'] ?? null; + $this->squareDeliveryId = $values['squareDeliveryId'] ?? null; + $this->externalDeliveryId = $values['externalDeliveryId'] ?? null; + $this->managedDelivery = $values['managedDelivery'] ?? null; + } + + /** + * @return ?FulfillmentRecipient + */ + public function getRecipient(): ?FulfillmentRecipient + { + return $this->recipient; + } + + /** + * @param ?FulfillmentRecipient $value + */ + public function setRecipient(?FulfillmentRecipient $value = null): self + { + $this->recipient = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScheduleType(): ?string + { + return $this->scheduleType; + } + + /** + * @param ?value-of $value + */ + public function setScheduleType(?string $value = null): self + { + $this->scheduleType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlacedAt(): ?string + { + return $this->placedAt; + } + + /** + * @param ?string $value + */ + public function setPlacedAt(?string $value = null): self + { + $this->placedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeliverAt(): ?string + { + return $this->deliverAt; + } + + /** + * @param ?string $value + */ + public function setDeliverAt(?string $value = null): self + { + $this->deliverAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPrepTimeDuration(): ?string + { + return $this->prepTimeDuration; + } + + /** + * @param ?string $value + */ + public function setPrepTimeDuration(?string $value = null): self + { + $this->prepTimeDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeliveryWindowDuration(): ?string + { + return $this->deliveryWindowDuration; + } + + /** + * @param ?string $value + */ + public function setDeliveryWindowDuration(?string $value = null): self + { + $this->deliveryWindowDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompletedAt(): ?string + { + return $this->completedAt; + } + + /** + * @param ?string $value + */ + public function setCompletedAt(?string $value = null): self + { + $this->completedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInProgressAt(): ?string + { + return $this->inProgressAt; + } + + /** + * @param ?string $value + */ + public function setInProgressAt(?string $value = null): self + { + $this->inProgressAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRejectedAt(): ?string + { + return $this->rejectedAt; + } + + /** + * @param ?string $value + */ + public function setRejectedAt(?string $value = null): self + { + $this->rejectedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReadyAt(): ?string + { + return $this->readyAt; + } + + /** + * @param ?string $value + */ + public function setReadyAt(?string $value = null): self + { + $this->readyAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeliveredAt(): ?string + { + return $this->deliveredAt; + } + + /** + * @param ?string $value + */ + public function setDeliveredAt(?string $value = null): self + { + $this->deliveredAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledAt(): ?string + { + return $this->canceledAt; + } + + /** + * @param ?string $value + */ + public function setCanceledAt(?string $value = null): self + { + $this->canceledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?string $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCourierPickupAt(): ?string + { + return $this->courierPickupAt; + } + + /** + * @param ?string $value + */ + public function setCourierPickupAt(?string $value = null): self + { + $this->courierPickupAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCourierPickupWindowDuration(): ?string + { + return $this->courierPickupWindowDuration; + } + + /** + * @param ?string $value + */ + public function setCourierPickupWindowDuration(?string $value = null): self + { + $this->courierPickupWindowDuration = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsNoContactDelivery(): ?bool + { + return $this->isNoContactDelivery; + } + + /** + * @param ?bool $value + */ + public function setIsNoContactDelivery(?bool $value = null): self + { + $this->isNoContactDelivery = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDropoffNotes(): ?string + { + return $this->dropoffNotes; + } + + /** + * @param ?string $value + */ + public function setDropoffNotes(?string $value = null): self + { + $this->dropoffNotes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCourierProviderName(): ?string + { + return $this->courierProviderName; + } + + /** + * @param ?string $value + */ + public function setCourierProviderName(?string $value = null): self + { + $this->courierProviderName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCourierSupportPhoneNumber(): ?string + { + return $this->courierSupportPhoneNumber; + } + + /** + * @param ?string $value + */ + public function setCourierSupportPhoneNumber(?string $value = null): self + { + $this->courierSupportPhoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSquareDeliveryId(): ?string + { + return $this->squareDeliveryId; + } + + /** + * @param ?string $value + */ + public function setSquareDeliveryId(?string $value = null): self + { + $this->squareDeliveryId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExternalDeliveryId(): ?string + { + return $this->externalDeliveryId; + } + + /** + * @param ?string $value + */ + public function setExternalDeliveryId(?string $value = null): self + { + $this->externalDeliveryId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getManagedDelivery(): ?bool + { + return $this->managedDelivery; + } + + /** + * @param ?bool $value + */ + public function setManagedDelivery(?bool $value = null): self + { + $this->managedDelivery = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php b/src/Types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php new file mode 100644 index 00000000..98e0d40a --- /dev/null +++ b/src/Types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.php @@ -0,0 +1,9 @@ + $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * @param array{ + * lineItemUid: string, + * quantity: string, + * uid?: ?string, + * metadata?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->uid = $values['uid'] ?? null; + $this->lineItemUid = $values['lineItemUid']; + $this->quantity = $values['quantity']; + $this->metadata = $values['metadata'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return string + */ + public function getLineItemUid(): string + { + return $this->lineItemUid; + } + + /** + * @param string $value + */ + public function setLineItemUid(string $value): self + { + $this->lineItemUid = $value; + return $this; + } + + /** + * @return string + */ + public function getQuantity(): string + { + return $this->quantity; + } + + /** + * @param string $value + */ + public function setQuantity(string $value): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentFulfillmentLineItemApplication.php b/src/Types/FulfillmentFulfillmentLineItemApplication.php new file mode 100644 index 00000000..e55caca0 --- /dev/null +++ b/src/Types/FulfillmentFulfillmentLineItemApplication.php @@ -0,0 +1,9 @@ + $scheduleType + */ + #[JsonProperty('schedule_type')] + private ?string $scheduleType; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". + * + * For fulfillments with the schedule type `ASAP`, this is automatically set + * to the current time plus the expected duration to prepare the fulfillment. + * + * @var ?string $pickupAt + */ + #[JsonProperty('pickup_at')] + private ?string $pickupAt; + + /** + * The window of time in which the order should be picked up after the `pickup_at` timestamp. + * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an + * informational guideline for merchants. + * + * @var ?string $pickupWindowDuration + */ + #[JsonProperty('pickup_window_duration')] + private ?string $pickupWindowDuration; + + /** + * The duration of time it takes to prepare this fulfillment. + * The duration must be in RFC 3339 format (for example, "P1W3D"). + * + * @var ?string $prepTimeDuration + */ + #[JsonProperty('prep_time_duration')] + private ?string $prepTimeDuration; + + /** + * A note to provide additional instructions about the pickup + * fulfillment displayed in the Square Point of Sale application and set by the API. + * + * @var ?string $note + */ + #[JsonProperty('note')] + private ?string $note; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $placedAt + */ + #[JsonProperty('placed_at')] + private ?string $placedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $acceptedAt + */ + #[JsonProperty('accepted_at')] + private ?string $acceptedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $rejectedAt + */ + #[JsonProperty('rejected_at')] + private ?string $rejectedAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $readyAt + */ + #[JsonProperty('ready_at')] + private ?string $readyAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $expiredAt + */ + #[JsonProperty('expired_at')] + private ?string $expiredAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $pickedUpAt + */ + #[JsonProperty('picked_up_at')] + private ?string $pickedUpAt; + + /** + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). + * + * @var ?string $canceledAt + */ + #[JsonProperty('canceled_at')] + private ?string $canceledAt; + + /** + * @var ?string $cancelReason A description of why the pickup was canceled. The maximum length: 100 characters. + */ + #[JsonProperty('cancel_reason')] + private ?string $cancelReason; + + /** + * @var ?bool $isCurbsidePickup If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. + */ + #[JsonProperty('is_curbside_pickup')] + private ?bool $isCurbsidePickup; + + /** + * @var ?FulfillmentPickupDetailsCurbsidePickupDetails $curbsidePickupDetails Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`. + */ + #[JsonProperty('curbside_pickup_details')] + private ?FulfillmentPickupDetailsCurbsidePickupDetails $curbsidePickupDetails; + + /** + * @param array{ + * recipient?: ?FulfillmentRecipient, + * expiresAt?: ?string, + * autoCompleteDuration?: ?string, + * scheduleType?: ?value-of, + * pickupAt?: ?string, + * pickupWindowDuration?: ?string, + * prepTimeDuration?: ?string, + * note?: ?string, + * placedAt?: ?string, + * acceptedAt?: ?string, + * rejectedAt?: ?string, + * readyAt?: ?string, + * expiredAt?: ?string, + * pickedUpAt?: ?string, + * canceledAt?: ?string, + * cancelReason?: ?string, + * isCurbsidePickup?: ?bool, + * curbsidePickupDetails?: ?FulfillmentPickupDetailsCurbsidePickupDetails, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->recipient = $values['recipient'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->autoCompleteDuration = $values['autoCompleteDuration'] ?? null; + $this->scheduleType = $values['scheduleType'] ?? null; + $this->pickupAt = $values['pickupAt'] ?? null; + $this->pickupWindowDuration = $values['pickupWindowDuration'] ?? null; + $this->prepTimeDuration = $values['prepTimeDuration'] ?? null; + $this->note = $values['note'] ?? null; + $this->placedAt = $values['placedAt'] ?? null; + $this->acceptedAt = $values['acceptedAt'] ?? null; + $this->rejectedAt = $values['rejectedAt'] ?? null; + $this->readyAt = $values['readyAt'] ?? null; + $this->expiredAt = $values['expiredAt'] ?? null; + $this->pickedUpAt = $values['pickedUpAt'] ?? null; + $this->canceledAt = $values['canceledAt'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->isCurbsidePickup = $values['isCurbsidePickup'] ?? null; + $this->curbsidePickupDetails = $values['curbsidePickupDetails'] ?? null; + } + + /** + * @return ?FulfillmentRecipient + */ + public function getRecipient(): ?FulfillmentRecipient + { + return $this->recipient; + } + + /** + * @param ?FulfillmentRecipient $value + */ + public function setRecipient(?FulfillmentRecipient $value = null): self + { + $this->recipient = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiresAt(): ?string + { + return $this->expiresAt; + } + + /** + * @param ?string $value + */ + public function setExpiresAt(?string $value = null): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAutoCompleteDuration(): ?string + { + return $this->autoCompleteDuration; + } + + /** + * @param ?string $value + */ + public function setAutoCompleteDuration(?string $value = null): self + { + $this->autoCompleteDuration = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScheduleType(): ?string + { + return $this->scheduleType; + } + + /** + * @param ?value-of $value + */ + public function setScheduleType(?string $value = null): self + { + $this->scheduleType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPickupAt(): ?string + { + return $this->pickupAt; + } + + /** + * @param ?string $value + */ + public function setPickupAt(?string $value = null): self + { + $this->pickupAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPickupWindowDuration(): ?string + { + return $this->pickupWindowDuration; + } + + /** + * @param ?string $value + */ + public function setPickupWindowDuration(?string $value = null): self + { + $this->pickupWindowDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPrepTimeDuration(): ?string + { + return $this->prepTimeDuration; + } + + /** + * @param ?string $value + */ + public function setPrepTimeDuration(?string $value = null): self + { + $this->prepTimeDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlacedAt(): ?string + { + return $this->placedAt; + } + + /** + * @param ?string $value + */ + public function setPlacedAt(?string $value = null): self + { + $this->placedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAcceptedAt(): ?string + { + return $this->acceptedAt; + } + + /** + * @param ?string $value + */ + public function setAcceptedAt(?string $value = null): self + { + $this->acceptedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRejectedAt(): ?string + { + return $this->rejectedAt; + } + + /** + * @param ?string $value + */ + public function setRejectedAt(?string $value = null): self + { + $this->rejectedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReadyAt(): ?string + { + return $this->readyAt; + } + + /** + * @param ?string $value + */ + public function setReadyAt(?string $value = null): self + { + $this->readyAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiredAt(): ?string + { + return $this->expiredAt; + } + + /** + * @param ?string $value + */ + public function setExpiredAt(?string $value = null): self + { + $this->expiredAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPickedUpAt(): ?string + { + return $this->pickedUpAt; + } + + /** + * @param ?string $value + */ + public function setPickedUpAt(?string $value = null): self + { + $this->pickedUpAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledAt(): ?string + { + return $this->canceledAt; + } + + /** + * @param ?string $value + */ + public function setCanceledAt(?string $value = null): self + { + $this->canceledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?string $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsCurbsidePickup(): ?bool + { + return $this->isCurbsidePickup; + } + + /** + * @param ?bool $value + */ + public function setIsCurbsidePickup(?bool $value = null): self + { + $this->isCurbsidePickup = $value; + return $this; + } + + /** + * @return ?FulfillmentPickupDetailsCurbsidePickupDetails + */ + public function getCurbsidePickupDetails(): ?FulfillmentPickupDetailsCurbsidePickupDetails + { + return $this->curbsidePickupDetails; + } + + /** + * @param ?FulfillmentPickupDetailsCurbsidePickupDetails $value + */ + public function setCurbsidePickupDetails(?FulfillmentPickupDetailsCurbsidePickupDetails $value = null): self + { + $this->curbsidePickupDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentPickupDetailsCurbsidePickupDetails.php b/src/Types/FulfillmentPickupDetailsCurbsidePickupDetails.php new file mode 100644 index 00000000..4b4fa51c --- /dev/null +++ b/src/Types/FulfillmentPickupDetailsCurbsidePickupDetails.php @@ -0,0 +1,83 @@ +curbsideDetails = $values['curbsideDetails'] ?? null; + $this->buyerArrivedAt = $values['buyerArrivedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getCurbsideDetails(): ?string + { + return $this->curbsideDetails; + } + + /** + * @param ?string $value + */ + public function setCurbsideDetails(?string $value = null): self + { + $this->curbsideDetails = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerArrivedAt(): ?string + { + return $this->buyerArrivedAt; + } + + /** + * @param ?string $value + */ + public function setBuyerArrivedAt(?string $value = null): self + { + $this->buyerArrivedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentPickupDetailsScheduleType.php b/src/Types/FulfillmentPickupDetailsScheduleType.php new file mode 100644 index 00000000..76fe44bd --- /dev/null +++ b/src/Types/FulfillmentPickupDetailsScheduleType.php @@ -0,0 +1,9 @@ +customerId = $values['customerId'] ?? null; + $this->displayName = $values['displayName'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->address = $values['address'] ?? null; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisplayName(): ?string + { + return $this->displayName; + } + + /** + * @param ?string $value + */ + public function setDisplayName(?string $value = null): self + { + $this->displayName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentShipmentDetails.php b/src/Types/FulfillmentShipmentDetails.php new file mode 100644 index 00000000..b27752a4 --- /dev/null +++ b/src/Types/FulfillmentShipmentDetails.php @@ -0,0 +1,436 @@ +recipient = $values['recipient'] ?? null; + $this->carrier = $values['carrier'] ?? null; + $this->shippingNote = $values['shippingNote'] ?? null; + $this->shippingType = $values['shippingType'] ?? null; + $this->trackingNumber = $values['trackingNumber'] ?? null; + $this->trackingUrl = $values['trackingUrl'] ?? null; + $this->placedAt = $values['placedAt'] ?? null; + $this->inProgressAt = $values['inProgressAt'] ?? null; + $this->packagedAt = $values['packagedAt'] ?? null; + $this->expectedShippedAt = $values['expectedShippedAt'] ?? null; + $this->shippedAt = $values['shippedAt'] ?? null; + $this->canceledAt = $values['canceledAt'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->failedAt = $values['failedAt'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + } + + /** + * @return ?FulfillmentRecipient + */ + public function getRecipient(): ?FulfillmentRecipient + { + return $this->recipient; + } + + /** + * @param ?FulfillmentRecipient $value + */ + public function setRecipient(?FulfillmentRecipient $value = null): self + { + $this->recipient = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCarrier(): ?string + { + return $this->carrier; + } + + /** + * @param ?string $value + */ + public function setCarrier(?string $value = null): self + { + $this->carrier = $value; + return $this; + } + + /** + * @return ?string + */ + public function getShippingNote(): ?string + { + return $this->shippingNote; + } + + /** + * @param ?string $value + */ + public function setShippingNote(?string $value = null): self + { + $this->shippingNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getShippingType(): ?string + { + return $this->shippingType; + } + + /** + * @param ?string $value + */ + public function setShippingType(?string $value = null): self + { + $this->shippingType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTrackingNumber(): ?string + { + return $this->trackingNumber; + } + + /** + * @param ?string $value + */ + public function setTrackingNumber(?string $value = null): self + { + $this->trackingNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTrackingUrl(): ?string + { + return $this->trackingUrl; + } + + /** + * @param ?string $value + */ + public function setTrackingUrl(?string $value = null): self + { + $this->trackingUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlacedAt(): ?string + { + return $this->placedAt; + } + + /** + * @param ?string $value + */ + public function setPlacedAt(?string $value = null): self + { + $this->placedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInProgressAt(): ?string + { + return $this->inProgressAt; + } + + /** + * @param ?string $value + */ + public function setInProgressAt(?string $value = null): self + { + $this->inProgressAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPackagedAt(): ?string + { + return $this->packagedAt; + } + + /** + * @param ?string $value + */ + public function setPackagedAt(?string $value = null): self + { + $this->packagedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpectedShippedAt(): ?string + { + return $this->expectedShippedAt; + } + + /** + * @param ?string $value + */ + public function setExpectedShippedAt(?string $value = null): self + { + $this->expectedShippedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getShippedAt(): ?string + { + return $this->shippedAt; + } + + /** + * @param ?string $value + */ + public function setShippedAt(?string $value = null): self + { + $this->shippedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledAt(): ?string + { + return $this->canceledAt; + } + + /** + * @param ?string $value + */ + public function setCanceledAt(?string $value = null): self + { + $this->canceledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?string $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFailedAt(): ?string + { + return $this->failedAt; + } + + /** + * @param ?string $value + */ + public function setFailedAt(?string $value = null): self + { + $this->failedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFailureReason(): ?string + { + return $this->failureReason; + } + + /** + * @param ?string $value + */ + public function setFailureReason(?string $value = null): self + { + $this->failureReason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FulfillmentState.php b/src/Types/FulfillmentState.php new file mode 100644 index 00000000..798a4f48 --- /dev/null +++ b/src/Types/FulfillmentState.php @@ -0,0 +1,13 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?BankAccount $bankAccount The requested `BankAccount` object. + */ + #[JsonProperty('bank_account')] + private ?BankAccount $bankAccount; + + /** + * @param array{ + * errors?: ?array, + * bankAccount?: ?BankAccount, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->bankAccount = $values['bankAccount'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?BankAccount + */ + public function getBankAccount(): ?BankAccount + { + return $this->bankAccount; + } + + /** + * @param ?BankAccount $value + */ + public function setBankAccount(?BankAccount $value = null): self + { + $this->bankAccount = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetBankAccountResponse.php b/src/Types/GetBankAccountResponse.php new file mode 100644 index 00000000..e7f76b7e --- /dev/null +++ b/src/Types/GetBankAccountResponse.php @@ -0,0 +1,80 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?BankAccount $bankAccount The requested `BankAccount` object. + */ + #[JsonProperty('bank_account')] + private ?BankAccount $bankAccount; + + /** + * @param array{ + * errors?: ?array, + * bankAccount?: ?BankAccount, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->bankAccount = $values['bankAccount'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?BankAccount + */ + public function getBankAccount(): ?BankAccount + { + return $this->bankAccount; + } + + /** + * @param ?BankAccount $value + */ + public function setBankAccount(?BankAccount $value = null): self + { + $this->bankAccount = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetBookingResponse.php b/src/Types/GetBookingResponse.php new file mode 100644 index 00000000..f6e642a0 --- /dev/null +++ b/src/Types/GetBookingResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * booking?: ?Booking, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->booking = $values['booking'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Booking + */ + public function getBooking(): ?Booking + { + return $this->booking; + } + + /** + * @param ?Booking $value + */ + public function setBooking(?Booking $value = null): self + { + $this->booking = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetBreakTypeResponse.php b/src/Types/GetBreakTypeResponse.php new file mode 100644 index 00000000..86f971c9 --- /dev/null +++ b/src/Types/GetBreakTypeResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * breakType?: ?BreakType, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->breakType = $values['breakType'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BreakType + */ + public function getBreakType(): ?BreakType + { + return $this->breakType; + } + + /** + * @param ?BreakType $value + */ + public function setBreakType(?BreakType $value = null): self + { + $this->breakType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetBusinessBookingProfileResponse.php b/src/Types/GetBusinessBookingProfileResponse.php new file mode 100644 index 00000000..93717724 --- /dev/null +++ b/src/Types/GetBusinessBookingProfileResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * businessBookingProfile?: ?BusinessBookingProfile, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->businessBookingProfile = $values['businessBookingProfile'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BusinessBookingProfile + */ + public function getBusinessBookingProfile(): ?BusinessBookingProfile + { + return $this->businessBookingProfile; + } + + /** + * @param ?BusinessBookingProfile $value + */ + public function setBusinessBookingProfile(?BusinessBookingProfile $value = null): self + { + $this->businessBookingProfile = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCardResponse.php b/src/Types/GetCardResponse.php new file mode 100644 index 00000000..01c079bb --- /dev/null +++ b/src/Types/GetCardResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Card $card The retrieved card. + */ + #[JsonProperty('card')] + private ?Card $card; + + /** + * @param array{ + * errors?: ?array, + * card?: ?Card, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->card = $values['card'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCashDrawerShiftResponse.php b/src/Types/GetCashDrawerShiftResponse.php new file mode 100644 index 00000000..cfec658d --- /dev/null +++ b/src/Types/GetCashDrawerShiftResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * cashDrawerShift?: ?CashDrawerShift, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cashDrawerShift = $values['cashDrawerShift'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CashDrawerShift + */ + public function getCashDrawerShift(): ?CashDrawerShift + { + return $this->cashDrawerShift; + } + + /** + * @param ?CashDrawerShift $value + */ + public function setCashDrawerShift(?CashDrawerShift $value = null): self + { + $this->cashDrawerShift = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCatalogObjectResponse.php b/src/Types/GetCatalogObjectResponse.php new file mode 100644 index 00000000..412d38b2 --- /dev/null +++ b/src/Types/GetCatalogObjectResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CatalogObject $object The `CatalogObject`s returned. + */ + #[JsonProperty('object')] + private ?CatalogObject $object; + + /** + * @var ?array $relatedObjects A list of `CatalogObject`s referenced by the object in the `object` field. + */ + #[JsonProperty('related_objects'), ArrayType([CatalogObject::class])] + private ?array $relatedObjects; + + /** + * @param array{ + * errors?: ?array, + * object?: ?CatalogObject, + * relatedObjects?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->object = $values['object'] ?? null; + $this->relatedObjects = $values['relatedObjects'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CatalogObject + */ + public function getObject(): ?CatalogObject + { + return $this->object; + } + + /** + * @param ?CatalogObject $value + */ + public function setObject(?CatalogObject $value = null): self + { + $this->object = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRelatedObjects(): ?array + { + return $this->relatedObjects; + } + + /** + * @param ?array $value + */ + public function setRelatedObjects(?array $value = null): self + { + $this->relatedObjects = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCustomerCustomAttributeDefinitionResponse.php b/src/Types/GetCustomerCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..a3483e25 --- /dev/null +++ b/src/Types/GetCustomerCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCustomerCustomAttributeResponse.php b/src/Types/GetCustomerCustomAttributeResponse.php new file mode 100644 index 00000000..60c13a0f --- /dev/null +++ b/src/Types/GetCustomerCustomAttributeResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCustomerGroupResponse.php b/src/Types/GetCustomerGroupResponse.php new file mode 100644 index 00000000..dc426fcc --- /dev/null +++ b/src/Types/GetCustomerGroupResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CustomerGroup $group The retrieved customer group. + */ + #[JsonProperty('group')] + private ?CustomerGroup $group; + + /** + * @param array{ + * errors?: ?array, + * group?: ?CustomerGroup, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->group = $values['group'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CustomerGroup + */ + public function getGroup(): ?CustomerGroup + { + return $this->group; + } + + /** + * @param ?CustomerGroup $value + */ + public function setGroup(?CustomerGroup $value = null): self + { + $this->group = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCustomerResponse.php b/src/Types/GetCustomerResponse.php new file mode 100644 index 00000000..fac29b8c --- /dev/null +++ b/src/Types/GetCustomerResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Customer $customer The requested customer. + */ + #[JsonProperty('customer')] + private ?Customer $customer; + + /** + * @param array{ + * errors?: ?array, + * customer?: ?Customer, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->customer = $values['customer'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Customer + */ + public function getCustomer(): ?Customer + { + return $this->customer; + } + + /** + * @param ?Customer $value + */ + public function setCustomer(?Customer $value = null): self + { + $this->customer = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetCustomerSegmentResponse.php b/src/Types/GetCustomerSegmentResponse.php new file mode 100644 index 00000000..fecd2316 --- /dev/null +++ b/src/Types/GetCustomerSegmentResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CustomerSegment $segment The retrieved customer segment. + */ + #[JsonProperty('segment')] + private ?CustomerSegment $segment; + + /** + * @param array{ + * errors?: ?array, + * segment?: ?CustomerSegment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->segment = $values['segment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CustomerSegment + */ + public function getSegment(): ?CustomerSegment + { + return $this->segment; + } + + /** + * @param ?CustomerSegment $value + */ + public function setSegment(?CustomerSegment $value = null): self + { + $this->segment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetDeviceCodeResponse.php b/src/Types/GetDeviceCodeResponse.php new file mode 100644 index 00000000..50a873fb --- /dev/null +++ b/src/Types/GetDeviceCodeResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?DeviceCode $deviceCode The queried DeviceCode. + */ + #[JsonProperty('device_code')] + private ?DeviceCode $deviceCode; + + /** + * @param array{ + * errors?: ?array, + * deviceCode?: ?DeviceCode, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->deviceCode = $values['deviceCode'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?DeviceCode + */ + public function getDeviceCode(): ?DeviceCode + { + return $this->deviceCode; + } + + /** + * @param ?DeviceCode $value + */ + public function setDeviceCode(?DeviceCode $value = null): self + { + $this->deviceCode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetDeviceResponse.php b/src/Types/GetDeviceResponse.php new file mode 100644 index 00000000..d059343c --- /dev/null +++ b/src/Types/GetDeviceResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Device $device The requested `Device`. + */ + #[JsonProperty('device')] + private ?Device $device; + + /** + * @param array{ + * errors?: ?array, + * device?: ?Device, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->device = $values['device'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Device + */ + public function getDevice(): ?Device + { + return $this->device; + } + + /** + * @param ?Device $value + */ + public function setDevice(?Device $value = null): self + { + $this->device = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetDisputeEvidenceResponse.php b/src/Types/GetDisputeEvidenceResponse.php new file mode 100644 index 00000000..c15eb39f --- /dev/null +++ b/src/Types/GetDisputeEvidenceResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?DisputeEvidence $evidence Metadata about the dispute evidence file. + */ + #[JsonProperty('evidence')] + private ?DisputeEvidence $evidence; + + /** + * @param array{ + * errors?: ?array, + * evidence?: ?DisputeEvidence, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->evidence = $values['evidence'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?DisputeEvidence + */ + public function getEvidence(): ?DisputeEvidence + { + return $this->evidence; + } + + /** + * @param ?DisputeEvidence $value + */ + public function setEvidence(?DisputeEvidence $value = null): self + { + $this->evidence = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetDisputeResponse.php b/src/Types/GetDisputeResponse.php new file mode 100644 index 00000000..281b2bdc --- /dev/null +++ b/src/Types/GetDisputeResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Dispute $dispute Details about the requested `Dispute`. + */ + #[JsonProperty('dispute')] + private ?Dispute $dispute; + + /** + * @param array{ + * errors?: ?array, + * dispute?: ?Dispute, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->dispute = $values['dispute'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Dispute + */ + public function getDispute(): ?Dispute + { + return $this->dispute; + } + + /** + * @param ?Dispute $value + */ + public function setDispute(?Dispute $value = null): self + { + $this->dispute = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetEmployeeResponse.php b/src/Types/GetEmployeeResponse.php new file mode 100644 index 00000000..1dac3444 --- /dev/null +++ b/src/Types/GetEmployeeResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * employee?: ?Employee, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->employee = $values['employee'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Employee + */ + public function getEmployee(): ?Employee + { + return $this->employee; + } + + /** + * @param ?Employee $value + */ + public function setEmployee(?Employee $value = null): self + { + $this->employee = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetEmployeeWageResponse.php b/src/Types/GetEmployeeWageResponse.php new file mode 100644 index 00000000..6ff2b0ea --- /dev/null +++ b/src/Types/GetEmployeeWageResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * employeeWage?: ?EmployeeWage, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->employeeWage = $values['employeeWage'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?EmployeeWage + */ + public function getEmployeeWage(): ?EmployeeWage + { + return $this->employeeWage; + } + + /** + * @param ?EmployeeWage $value + */ + public function setEmployeeWage(?EmployeeWage $value = null): self + { + $this->employeeWage = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetGiftCardFromGanResponse.php b/src/Types/GetGiftCardFromGanResponse.php new file mode 100644 index 00000000..ceb44f31 --- /dev/null +++ b/src/Types/GetGiftCardFromGanResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCard $giftCard A gift card that was fetched, if present. It returns empty if an error occurred. + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetGiftCardFromNonceResponse.php b/src/Types/GetGiftCardFromNonceResponse.php new file mode 100644 index 00000000..facc5f14 --- /dev/null +++ b/src/Types/GetGiftCardFromNonceResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCard $giftCard The retrieved gift card. + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetGiftCardResponse.php b/src/Types/GetGiftCardResponse.php new file mode 100644 index 00000000..ab265f2a --- /dev/null +++ b/src/Types/GetGiftCardResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCard $giftCard The gift card retrieved. + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInventoryAdjustmentResponse.php b/src/Types/GetInventoryAdjustmentResponse.php new file mode 100644 index 00000000..36f85df9 --- /dev/null +++ b/src/Types/GetInventoryAdjustmentResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?InventoryAdjustment $adjustment The requested [InventoryAdjustment](entity:InventoryAdjustment). + */ + #[JsonProperty('adjustment')] + private ?InventoryAdjustment $adjustment; + + /** + * @param array{ + * errors?: ?array, + * adjustment?: ?InventoryAdjustment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->adjustment = $values['adjustment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?InventoryAdjustment + */ + public function getAdjustment(): ?InventoryAdjustment + { + return $this->adjustment; + } + + /** + * @param ?InventoryAdjustment $value + */ + public function setAdjustment(?InventoryAdjustment $value = null): self + { + $this->adjustment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInventoryChangesResponse.php b/src/Types/GetInventoryChangesResponse.php new file mode 100644 index 00000000..011e3cdd --- /dev/null +++ b/src/Types/GetInventoryChangesResponse.php @@ -0,0 +1,107 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $changes The set of inventory changes for the requested object and locations. + */ + #[JsonProperty('changes'), ArrayType([InventoryChange::class])] + private ?array $changes; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * changes?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->changes = $values['changes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getChanges(): ?array + { + return $this->changes; + } + + /** + * @param ?array $value + */ + public function setChanges(?array $value = null): self + { + $this->changes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInventoryCountResponse.php b/src/Types/GetInventoryCountResponse.php new file mode 100644 index 00000000..f4b49af3 --- /dev/null +++ b/src/Types/GetInventoryCountResponse.php @@ -0,0 +1,110 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The current calculated inventory counts for the requested object and + * locations. + * + * @var ?array $counts + */ + #[JsonProperty('counts'), ArrayType([InventoryCount::class])] + private ?array $counts; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * counts?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->counts = $values['counts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCounts(): ?array + { + return $this->counts; + } + + /** + * @param ?array $value + */ + public function setCounts(?array $value = null): self + { + $this->counts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInventoryPhysicalCountResponse.php b/src/Types/GetInventoryPhysicalCountResponse.php new file mode 100644 index 00000000..16ad3aaf --- /dev/null +++ b/src/Types/GetInventoryPhysicalCountResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?InventoryPhysicalCount $count The requested [InventoryPhysicalCount](entity:InventoryPhysicalCount). + */ + #[JsonProperty('count')] + private ?InventoryPhysicalCount $count; + + /** + * @param array{ + * errors?: ?array, + * count?: ?InventoryPhysicalCount, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->count = $values['count'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?InventoryPhysicalCount + */ + public function getCount(): ?InventoryPhysicalCount + { + return $this->count; + } + + /** + * @param ?InventoryPhysicalCount $value + */ + public function setCount(?InventoryPhysicalCount $value = null): self + { + $this->count = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInventoryTransferResponse.php b/src/Types/GetInventoryTransferResponse.php new file mode 100644 index 00000000..89dab570 --- /dev/null +++ b/src/Types/GetInventoryTransferResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?InventoryTransfer $transfer The requested [InventoryTransfer](entity:InventoryTransfer). + */ + #[JsonProperty('transfer')] + private ?InventoryTransfer $transfer; + + /** + * @param array{ + * errors?: ?array, + * transfer?: ?InventoryTransfer, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->transfer = $values['transfer'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?InventoryTransfer + */ + public function getTransfer(): ?InventoryTransfer + { + return $this->transfer; + } + + /** + * @param ?InventoryTransfer $value + */ + public function setTransfer(?InventoryTransfer $value = null): self + { + $this->transfer = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetInvoiceResponse.php b/src/Types/GetInvoiceResponse.php new file mode 100644 index 00000000..fc5fb0bc --- /dev/null +++ b/src/Types/GetInvoiceResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoice?: ?Invoice, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoice = $values['invoice'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Invoice + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param ?Invoice $value + */ + public function setInvoice(?Invoice $value = null): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetLocationResponse.php b/src/Types/GetLocationResponse.php new file mode 100644 index 00000000..3cc510c6 --- /dev/null +++ b/src/Types/GetLocationResponse.php @@ -0,0 +1,81 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Location $location The requested location. + */ + #[JsonProperty('location')] + private ?Location $location; + + /** + * @param array{ + * errors?: ?array, + * location?: ?Location, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->location = $values['location'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Location + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @param ?Location $value + */ + public function setLocation(?Location $value = null): self + { + $this->location = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetLoyaltyAccountResponse.php b/src/Types/GetLoyaltyAccountResponse.php new file mode 100644 index 00000000..87f56563 --- /dev/null +++ b/src/Types/GetLoyaltyAccountResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyAccount $loyaltyAccount The loyalty account. + */ + #[JsonProperty('loyalty_account')] + private ?LoyaltyAccount $loyaltyAccount; + + /** + * @param array{ + * errors?: ?array, + * loyaltyAccount?: ?LoyaltyAccount, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyAccount = $values['loyaltyAccount'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyAccount + */ + public function getLoyaltyAccount(): ?LoyaltyAccount + { + return $this->loyaltyAccount; + } + + /** + * @param ?LoyaltyAccount $value + */ + public function setLoyaltyAccount(?LoyaltyAccount $value = null): self + { + $this->loyaltyAccount = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetLoyaltyProgramResponse.php b/src/Types/GetLoyaltyProgramResponse.php new file mode 100644 index 00000000..7ee598ab --- /dev/null +++ b/src/Types/GetLoyaltyProgramResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyProgram $program The loyalty program that was requested. + */ + #[JsonProperty('program')] + private ?LoyaltyProgram $program; + + /** + * @param array{ + * errors?: ?array, + * program?: ?LoyaltyProgram, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->program = $values['program'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyProgram + */ + public function getProgram(): ?LoyaltyProgram + { + return $this->program; + } + + /** + * @param ?LoyaltyProgram $value + */ + public function setProgram(?LoyaltyProgram $value = null): self + { + $this->program = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetLoyaltyPromotionResponse.php b/src/Types/GetLoyaltyPromotionResponse.php new file mode 100644 index 00000000..d4fd40b0 --- /dev/null +++ b/src/Types/GetLoyaltyPromotionResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyPromotion $loyaltyPromotion The retrieved loyalty promotion. + */ + #[JsonProperty('loyalty_promotion')] + private ?LoyaltyPromotion $loyaltyPromotion; + + /** + * @param array{ + * errors?: ?array, + * loyaltyPromotion?: ?LoyaltyPromotion, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyPromotion = $values['loyaltyPromotion'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotion + */ + public function getLoyaltyPromotion(): ?LoyaltyPromotion + { + return $this->loyaltyPromotion; + } + + /** + * @param ?LoyaltyPromotion $value + */ + public function setLoyaltyPromotion(?LoyaltyPromotion $value = null): self + { + $this->loyaltyPromotion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetLoyaltyRewardResponse.php b/src/Types/GetLoyaltyRewardResponse.php new file mode 100644 index 00000000..6d493595 --- /dev/null +++ b/src/Types/GetLoyaltyRewardResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyReward $reward The loyalty reward retrieved. + */ + #[JsonProperty('reward')] + private ?LoyaltyReward $reward; + + /** + * @param array{ + * errors?: ?array, + * reward?: ?LoyaltyReward, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->reward = $values['reward'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyReward + */ + public function getReward(): ?LoyaltyReward + { + return $this->reward; + } + + /** + * @param ?LoyaltyReward $value + */ + public function setReward(?LoyaltyReward $value = null): self + { + $this->reward = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetMerchantResponse.php b/src/Types/GetMerchantResponse.php new file mode 100644 index 00000000..86cb224c --- /dev/null +++ b/src/Types/GetMerchantResponse.php @@ -0,0 +1,80 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Merchant $merchant The requested `Merchant` object. + */ + #[JsonProperty('merchant')] + private ?Merchant $merchant; + + /** + * @param array{ + * errors?: ?array, + * merchant?: ?Merchant, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->merchant = $values['merchant'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Merchant + */ + public function getMerchant(): ?Merchant + { + return $this->merchant; + } + + /** + * @param ?Merchant $value + */ + public function setMerchant(?Merchant $value = null): self + { + $this->merchant = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetOrderResponse.php b/src/Types/GetOrderResponse.php new file mode 100644 index 00000000..cc7920f3 --- /dev/null +++ b/src/Types/GetOrderResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * order?: ?Order, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->order = $values['order'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetPaymentLinkResponse.php b/src/Types/GetPaymentLinkResponse.php new file mode 100644 index 00000000..eeed461a --- /dev/null +++ b/src/Types/GetPaymentLinkResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?PaymentLink $paymentLink The payment link that is retrieved. + */ + #[JsonProperty('payment_link')] + private ?PaymentLink $paymentLink; + + /** + * @param array{ + * errors?: ?array, + * paymentLink?: ?PaymentLink, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->paymentLink = $values['paymentLink'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?PaymentLink + */ + public function getPaymentLink(): ?PaymentLink + { + return $this->paymentLink; + } + + /** + * @param ?PaymentLink $value + */ + public function setPaymentLink(?PaymentLink $value = null): self + { + $this->paymentLink = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetPaymentRefundResponse.php b/src/Types/GetPaymentRefundResponse.php new file mode 100644 index 00000000..a16d4aab --- /dev/null +++ b/src/Types/GetPaymentRefundResponse.php @@ -0,0 +1,83 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?PaymentRefund $refund The requested `PaymentRefund`. + */ + #[JsonProperty('refund')] + private ?PaymentRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?PaymentRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?PaymentRefund + */ + public function getRefund(): ?PaymentRefund + { + return $this->refund; + } + + /** + * @param ?PaymentRefund $value + */ + public function setRefund(?PaymentRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetPaymentResponse.php b/src/Types/GetPaymentResponse.php new file mode 100644 index 00000000..a9a3f2e4 --- /dev/null +++ b/src/Types/GetPaymentResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Payment $payment The requested `Payment`. + */ + #[JsonProperty('payment')] + private ?Payment $payment; + + /** + * @param array{ + * errors?: ?array, + * payment?: ?Payment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payment = $values['payment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetPayoutResponse.php b/src/Types/GetPayoutResponse.php new file mode 100644 index 00000000..6f16556b --- /dev/null +++ b/src/Types/GetPayoutResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * payout?: ?Payout, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->payout = $values['payout'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Payout + */ + public function getPayout(): ?Payout + { + return $this->payout; + } + + /** + * @param ?Payout $value + */ + public function setPayout(?Payout $value = null): self + { + $this->payout = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetShiftResponse.php b/src/Types/GetShiftResponse.php new file mode 100644 index 00000000..1edf5ef9 --- /dev/null +++ b/src/Types/GetShiftResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * shift?: ?Shift, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->shift = $values['shift'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Shift + */ + public function getShift(): ?Shift + { + return $this->shift; + } + + /** + * @param ?Shift $value + */ + public function setShift(?Shift $value = null): self + { + $this->shift = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetSnippetResponse.php b/src/Types/GetSnippetResponse.php new file mode 100644 index 00000000..44aa373e --- /dev/null +++ b/src/Types/GetSnippetResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Snippet $snippet The retrieved snippet. + */ + #[JsonProperty('snippet')] + private ?Snippet $snippet; + + /** + * @param array{ + * errors?: ?array, + * snippet?: ?Snippet, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->snippet = $values['snippet'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Snippet + */ + public function getSnippet(): ?Snippet + { + return $this->snippet; + } + + /** + * @param ?Snippet $value + */ + public function setSnippet(?Snippet $value = null): self + { + $this->snippet = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetSubscriptionResponse.php b/src/Types/GetSubscriptionResponse.php new file mode 100644 index 00000000..2996b05d --- /dev/null +++ b/src/Types/GetSubscriptionResponse.php @@ -0,0 +1,81 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The subscription retrieved. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTeamMemberBookingProfileResponse.php b/src/Types/GetTeamMemberBookingProfileResponse.php new file mode 100644 index 00000000..6da0cbf3 --- /dev/null +++ b/src/Types/GetTeamMemberBookingProfileResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMemberBookingProfile?: ?TeamMemberBookingProfile, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberBookingProfile = $values['teamMemberBookingProfile'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?TeamMemberBookingProfile + */ + public function getTeamMemberBookingProfile(): ?TeamMemberBookingProfile + { + return $this->teamMemberBookingProfile; + } + + /** + * @param ?TeamMemberBookingProfile $value + */ + public function setTeamMemberBookingProfile(?TeamMemberBookingProfile $value = null): self + { + $this->teamMemberBookingProfile = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTeamMemberResponse.php b/src/Types/GetTeamMemberResponse.php new file mode 100644 index 00000000..2d908936 --- /dev/null +++ b/src/Types/GetTeamMemberResponse.php @@ -0,0 +1,80 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMember?: ?TeamMember, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMember = $values['teamMember'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?TeamMember + */ + public function getTeamMember(): ?TeamMember + { + return $this->teamMember; + } + + /** + * @param ?TeamMember $value + */ + public function setTeamMember(?TeamMember $value = null): self + { + $this->teamMember = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTeamMemberWageResponse.php b/src/Types/GetTeamMemberWageResponse.php new file mode 100644 index 00000000..d3c9c643 --- /dev/null +++ b/src/Types/GetTeamMemberWageResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMemberWage?: ?TeamMemberWage, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberWage = $values['teamMemberWage'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?TeamMemberWage + */ + public function getTeamMemberWage(): ?TeamMemberWage + { + return $this->teamMemberWage; + } + + /** + * @param ?TeamMemberWage $value + */ + public function setTeamMemberWage(?TeamMemberWage $value = null): self + { + $this->teamMemberWage = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTerminalActionResponse.php b/src/Types/GetTerminalActionResponse.php new file mode 100644 index 00000000..b6881a80 --- /dev/null +++ b/src/Types/GetTerminalActionResponse.php @@ -0,0 +1,77 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalAction $action The requested `TerminalAction` + */ + #[JsonProperty('action')] + private ?TerminalAction $action; + + /** + * @param array{ + * errors?: ?array, + * action?: ?TerminalAction, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->action = $values['action'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalAction + */ + public function getAction(): ?TerminalAction + { + return $this->action; + } + + /** + * @param ?TerminalAction $value + */ + public function setAction(?TerminalAction $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTerminalCheckoutResponse.php b/src/Types/GetTerminalCheckoutResponse.php new file mode 100644 index 00000000..d1ec6e6e --- /dev/null +++ b/src/Types/GetTerminalCheckoutResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalCheckout $checkout The requested `TerminalCheckout`. + */ + #[JsonProperty('checkout')] + private ?TerminalCheckout $checkout; + + /** + * @param array{ + * errors?: ?array, + * checkout?: ?TerminalCheckout, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->checkout = $values['checkout'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalCheckout + */ + public function getCheckout(): ?TerminalCheckout + { + return $this->checkout; + } + + /** + * @param ?TerminalCheckout $value + */ + public function setCheckout(?TerminalCheckout $value = null): self + { + $this->checkout = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTerminalRefundResponse.php b/src/Types/GetTerminalRefundResponse.php new file mode 100644 index 00000000..38f6bce9 --- /dev/null +++ b/src/Types/GetTerminalRefundResponse.php @@ -0,0 +1,77 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?TerminalRefund $refund The requested `Refund`. + */ + #[JsonProperty('refund')] + private ?TerminalRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?TerminalRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?TerminalRefund + */ + public function getRefund(): ?TerminalRefund + { + return $this->refund; + } + + /** + * @param ?TerminalRefund $value + */ + public function setRefund(?TerminalRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetTransactionResponse.php b/src/Types/GetTransactionResponse.php new file mode 100644 index 00000000..5f4ec09b --- /dev/null +++ b/src/Types/GetTransactionResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Transaction $transaction The requested transaction. + */ + #[JsonProperty('transaction')] + private ?Transaction $transaction; + + /** + * @param array{ + * errors?: ?array, + * transaction?: ?Transaction, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->transaction = $values['transaction'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Transaction + */ + public function getTransaction(): ?Transaction + { + return $this->transaction; + } + + /** + * @param ?Transaction $value + */ + public function setTransaction(?Transaction $value = null): self + { + $this->transaction = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetVendorResponse.php b/src/Types/GetVendorResponse.php new file mode 100644 index 00000000..cc2a15cb --- /dev/null +++ b/src/Types/GetVendorResponse.php @@ -0,0 +1,80 @@ + $errors Errors encountered when the request fails. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Vendor $vendor The successfully retrieved [Vendor](entity:Vendor) object. + */ + #[JsonProperty('vendor')] + private ?Vendor $vendor; + + /** + * @param array{ + * errors?: ?array, + * vendor?: ?Vendor, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->vendor = $values['vendor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Vendor + */ + public function getVendor(): ?Vendor + { + return $this->vendor; + } + + /** + * @param ?Vendor $value + */ + public function setVendor(?Vendor $value = null): self + { + $this->vendor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetWageSettingResponse.php b/src/Types/GetWageSettingResponse.php new file mode 100644 index 00000000..aa64965e --- /dev/null +++ b/src/Types/GetWageSettingResponse.php @@ -0,0 +1,80 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * wageSetting?: ?WageSetting, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->wageSetting = $values['wageSetting'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?WageSetting + */ + public function getWageSetting(): ?WageSetting + { + return $this->wageSetting; + } + + /** + * @param ?WageSetting $value + */ + public function setWageSetting(?WageSetting $value = null): self + { + $this->wageSetting = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GetWebhookSubscriptionResponse.php b/src/Types/GetWebhookSubscriptionResponse.php new file mode 100644 index 00000000..f9798bf9 --- /dev/null +++ b/src/Types/GetWebhookSubscriptionResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?WebhookSubscription $subscription The requested [Subscription](entity:WebhookSubscription). + */ + #[JsonProperty('subscription')] + private ?WebhookSubscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?WebhookSubscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?WebhookSubscription + */ + public function getSubscription(): ?WebhookSubscription + { + return $this->subscription; + } + + /** + * @param ?WebhookSubscription $value + */ + public function setSubscription(?WebhookSubscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCard.php b/src/Types/GiftCard.php new file mode 100644 index 00000000..f470bfda --- /dev/null +++ b/src/Types/GiftCard.php @@ -0,0 +1,248 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * The source that generated the gift card account number (GAN). The default value is `SQUARE`. + * See [GANSource](#type-gansource) for possible values + * + * @var ?value-of $ganSource + */ + #[JsonProperty('gan_source')] + private ?string $ganSource; + + /** + * The current gift card state. + * See [Status](#type-status) for possible values + * + * @var ?value-of $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * @var ?Money $balanceMoney The current gift card balance. This balance is always greater than or equal to zero. + */ + #[JsonProperty('balance_money')] + private ?Money $balanceMoney; + + /** + * The gift card account number (GAN). Buyers can use the GAN to make purchases or check + * the gift card balance. + * + * @var ?string $gan + */ + #[JsonProperty('gan')] + private ?string $gan; + + /** + * The timestamp when the gift card was created, in RFC 3339 format. + * In the case of a digital gift card, it is the time when you create a card + * (using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). + * In the case of a plastic gift card, it is the time when Square associates the card with the + * seller at the time of activation. + * + * @var ?string $createdAt + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?array $customerIds The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private ?array $customerIds; + + /** + * @param array{ + * type: value-of, + * id?: ?string, + * ganSource?: ?value-of, + * state?: ?value-of, + * balanceMoney?: ?Money, + * gan?: ?string, + * createdAt?: ?string, + * customerIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->type = $values['type']; + $this->ganSource = $values['ganSource'] ?? null; + $this->state = $values['state'] ?? null; + $this->balanceMoney = $values['balanceMoney'] ?? null; + $this->gan = $values['gan'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->customerIds = $values['customerIds'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getGanSource(): ?string + { + return $this->ganSource; + } + + /** + * @param ?value-of $value + */ + public function setGanSource(?string $value = null): self + { + $this->ganSource = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getBalanceMoney(): ?Money + { + return $this->balanceMoney; + } + + /** + * @param ?Money $value + */ + public function setBalanceMoney(?Money $value = null): self + { + $this->balanceMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGan(): ?string + { + return $this->gan; + } + + /** + * @param ?string $value + */ + public function setGan(?string $value = null): self + { + $this->gan = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomerIds(): ?array + { + return $this->customerIds; + } + + /** + * @param ?array $value + */ + public function setCustomerIds(?array $value = null): self + { + $this->customerIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivity.php b/src/Types/GiftCardActivity.php new file mode 100644 index 00000000..38fea9c1 --- /dev/null +++ b/src/Types/GiftCardActivity.php @@ -0,0 +1,630 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * @var string $locationId The ID of the [business location](entity:Location) where the activity occurred. + */ + #[JsonProperty('location_id')] + private string $locationId; + + /** + * @var ?string $createdAt The timestamp when the gift card activity was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * The gift card ID. When creating a gift card activity, `gift_card_id` is not required if + * `gift_card_gan` is specified. + * + * @var ?string $giftCardId + */ + #[JsonProperty('gift_card_id')] + private ?string $giftCardId; + + /** + * The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` + * is not required if `gift_card_id` is specified. + * + * @var ?string $giftCardGan + */ + #[JsonProperty('gift_card_gan')] + private ?string $giftCardGan; + + /** + * @var ?Money $giftCardBalanceMoney The final balance on the gift card after the action is completed. + */ + #[JsonProperty('gift_card_balance_money')] + private ?Money $giftCardBalanceMoney; + + /** + * @var ?GiftCardActivityLoad $loadActivityDetails Additional details about a `LOAD` activity, which is used to reload money onto a gift card. + */ + #[JsonProperty('load_activity_details')] + private ?GiftCardActivityLoad $loadActivityDetails; + + /** + * Additional details about an `ACTIVATE` activity, which is used to activate a gift card with + * an initial balance. + * + * @var ?GiftCardActivityActivate $activateActivityDetails + */ + #[JsonProperty('activate_activity_details')] + private ?GiftCardActivityActivate $activateActivityDetails; + + /** + * Additional details about a `REDEEM` activity, which is used to redeem a gift card for a purchase. + * + * For applications that process payments using the Square Payments API, Square creates a `REDEEM` activity that + * updates the gift card balance after the corresponding [CreatePayment](api-endpoint:Payments-CreatePayment) + * request is completed. Applications that use a custom payment processing system must call + * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REDEEM` activity. + * + * @var ?GiftCardActivityRedeem $redeemActivityDetails + */ + #[JsonProperty('redeem_activity_details')] + private ?GiftCardActivityRedeem $redeemActivityDetails; + + /** + * @var ?GiftCardActivityClearBalance $clearBalanceActivityDetails Additional details about a `CLEAR_BALANCE` activity, which is used to set the balance of a gift card to zero. + */ + #[JsonProperty('clear_balance_activity_details')] + private ?GiftCardActivityClearBalance $clearBalanceActivityDetails; + + /** + * @var ?GiftCardActivityDeactivate $deactivateActivityDetails Additional details about a `DEACTIVATE` activity, which is used to deactivate a gift card. + */ + #[JsonProperty('deactivate_activity_details')] + private ?GiftCardActivityDeactivate $deactivateActivityDetails; + + /** + * Additional details about an `ADJUST_INCREMENT` activity, which is used to add money to a gift card + * outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. + * + * @var ?GiftCardActivityAdjustIncrement $adjustIncrementActivityDetails + */ + #[JsonProperty('adjust_increment_activity_details')] + private ?GiftCardActivityAdjustIncrement $adjustIncrementActivityDetails; + + /** + * Additional details about an `ADJUST_DECREMENT` activity, which is used to deduct money from a gift + * card outside of a typical `REDEEM` activity flow. + * + * @var ?GiftCardActivityAdjustDecrement $adjustDecrementActivityDetails + */ + #[JsonProperty('adjust_decrement_activity_details')] + private ?GiftCardActivityAdjustDecrement $adjustDecrementActivityDetails; + + /** + * Additional details about a `REFUND` activity, which is used to add money to a gift card when + * refunding a payment. + * + * For applications that refund payments to a gift card using the Square Refunds API, Square automatically + * creates a `REFUND` activity that updates the gift card balance after a [RefundPayment](api-endpoint:Refunds-RefundPayment) + * request is completed. Applications that use a custom processing system must call + * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REFUND` activity. + * + * @var ?GiftCardActivityRefund $refundActivityDetails + */ + #[JsonProperty('refund_activity_details')] + private ?GiftCardActivityRefund $refundActivityDetails; + + /** + * Additional details about an `UNLINKED_ACTIVITY_REFUND` activity. This activity is used to add money + * to a gift card when refunding a payment that was processed using a custom payment processing system + * and not linked to the gift card. + * + * @var ?GiftCardActivityUnlinkedActivityRefund $unlinkedActivityRefundActivityDetails + */ + #[JsonProperty('unlinked_activity_refund_activity_details')] + private ?GiftCardActivityUnlinkedActivityRefund $unlinkedActivityRefundActivityDetails; + + /** + * Additional details about an `IMPORT` activity, which Square uses to import a third-party + * gift card with a balance. + * + * @var ?GiftCardActivityImport $importActivityDetails + */ + #[JsonProperty('import_activity_details')] + private ?GiftCardActivityImport $importActivityDetails; + + /** + * @var ?GiftCardActivityBlock $blockActivityDetails Additional details about a `BLOCK` activity, which Square uses to temporarily block a gift card. + */ + #[JsonProperty('block_activity_details')] + private ?GiftCardActivityBlock $blockActivityDetails; + + /** + * @var ?GiftCardActivityUnblock $unblockActivityDetails Additional details about an `UNBLOCK` activity, which Square uses to unblock a gift card. + */ + #[JsonProperty('unblock_activity_details')] + private ?GiftCardActivityUnblock $unblockActivityDetails; + + /** + * Additional details about an `IMPORT_REVERSAL` activity, which Square uses to reverse the + * import of a third-party gift card. + * + * @var ?GiftCardActivityImportReversal $importReversalActivityDetails + */ + #[JsonProperty('import_reversal_activity_details')] + private ?GiftCardActivityImportReversal $importReversalActivityDetails; + + /** + * Additional details about a `TRANSFER_BALANCE_TO` activity, which Square uses to add money to + * a gift card as the result of a transfer from another gift card. + * + * @var ?GiftCardActivityTransferBalanceTo $transferBalanceToActivityDetails + */ + #[JsonProperty('transfer_balance_to_activity_details')] + private ?GiftCardActivityTransferBalanceTo $transferBalanceToActivityDetails; + + /** + * Additional details about a `TRANSFER_BALANCE_FROM` activity, which Square uses to deduct money from + * a gift as the result of a transfer to another gift card. + * + * @var ?GiftCardActivityTransferBalanceFrom $transferBalanceFromActivityDetails + */ + #[JsonProperty('transfer_balance_from_activity_details')] + private ?GiftCardActivityTransferBalanceFrom $transferBalanceFromActivityDetails; + + /** + * @param array{ + * type: value-of, + * locationId: string, + * id?: ?string, + * createdAt?: ?string, + * giftCardId?: ?string, + * giftCardGan?: ?string, + * giftCardBalanceMoney?: ?Money, + * loadActivityDetails?: ?GiftCardActivityLoad, + * activateActivityDetails?: ?GiftCardActivityActivate, + * redeemActivityDetails?: ?GiftCardActivityRedeem, + * clearBalanceActivityDetails?: ?GiftCardActivityClearBalance, + * deactivateActivityDetails?: ?GiftCardActivityDeactivate, + * adjustIncrementActivityDetails?: ?GiftCardActivityAdjustIncrement, + * adjustDecrementActivityDetails?: ?GiftCardActivityAdjustDecrement, + * refundActivityDetails?: ?GiftCardActivityRefund, + * unlinkedActivityRefundActivityDetails?: ?GiftCardActivityUnlinkedActivityRefund, + * importActivityDetails?: ?GiftCardActivityImport, + * blockActivityDetails?: ?GiftCardActivityBlock, + * unblockActivityDetails?: ?GiftCardActivityUnblock, + * importReversalActivityDetails?: ?GiftCardActivityImportReversal, + * transferBalanceToActivityDetails?: ?GiftCardActivityTransferBalanceTo, + * transferBalanceFromActivityDetails?: ?GiftCardActivityTransferBalanceFrom, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->type = $values['type']; + $this->locationId = $values['locationId']; + $this->createdAt = $values['createdAt'] ?? null; + $this->giftCardId = $values['giftCardId'] ?? null; + $this->giftCardGan = $values['giftCardGan'] ?? null; + $this->giftCardBalanceMoney = $values['giftCardBalanceMoney'] ?? null; + $this->loadActivityDetails = $values['loadActivityDetails'] ?? null; + $this->activateActivityDetails = $values['activateActivityDetails'] ?? null; + $this->redeemActivityDetails = $values['redeemActivityDetails'] ?? null; + $this->clearBalanceActivityDetails = $values['clearBalanceActivityDetails'] ?? null; + $this->deactivateActivityDetails = $values['deactivateActivityDetails'] ?? null; + $this->adjustIncrementActivityDetails = $values['adjustIncrementActivityDetails'] ?? null; + $this->adjustDecrementActivityDetails = $values['adjustDecrementActivityDetails'] ?? null; + $this->refundActivityDetails = $values['refundActivityDetails'] ?? null; + $this->unlinkedActivityRefundActivityDetails = $values['unlinkedActivityRefundActivityDetails'] ?? null; + $this->importActivityDetails = $values['importActivityDetails'] ?? null; + $this->blockActivityDetails = $values['blockActivityDetails'] ?? null; + $this->unblockActivityDetails = $values['unblockActivityDetails'] ?? null; + $this->importReversalActivityDetails = $values['importReversalActivityDetails'] ?? null; + $this->transferBalanceToActivityDetails = $values['transferBalanceToActivityDetails'] ?? null; + $this->transferBalanceFromActivityDetails = $values['transferBalanceFromActivityDetails'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGiftCardId(): ?string + { + return $this->giftCardId; + } + + /** + * @param ?string $value + */ + public function setGiftCardId(?string $value = null): self + { + $this->giftCardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGiftCardGan(): ?string + { + return $this->giftCardGan; + } + + /** + * @param ?string $value + */ + public function setGiftCardGan(?string $value = null): self + { + $this->giftCardGan = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getGiftCardBalanceMoney(): ?Money + { + return $this->giftCardBalanceMoney; + } + + /** + * @param ?Money $value + */ + public function setGiftCardBalanceMoney(?Money $value = null): self + { + $this->giftCardBalanceMoney = $value; + return $this; + } + + /** + * @return ?GiftCardActivityLoad + */ + public function getLoadActivityDetails(): ?GiftCardActivityLoad + { + return $this->loadActivityDetails; + } + + /** + * @param ?GiftCardActivityLoad $value + */ + public function setLoadActivityDetails(?GiftCardActivityLoad $value = null): self + { + $this->loadActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityActivate + */ + public function getActivateActivityDetails(): ?GiftCardActivityActivate + { + return $this->activateActivityDetails; + } + + /** + * @param ?GiftCardActivityActivate $value + */ + public function setActivateActivityDetails(?GiftCardActivityActivate $value = null): self + { + $this->activateActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityRedeem + */ + public function getRedeemActivityDetails(): ?GiftCardActivityRedeem + { + return $this->redeemActivityDetails; + } + + /** + * @param ?GiftCardActivityRedeem $value + */ + public function setRedeemActivityDetails(?GiftCardActivityRedeem $value = null): self + { + $this->redeemActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityClearBalance + */ + public function getClearBalanceActivityDetails(): ?GiftCardActivityClearBalance + { + return $this->clearBalanceActivityDetails; + } + + /** + * @param ?GiftCardActivityClearBalance $value + */ + public function setClearBalanceActivityDetails(?GiftCardActivityClearBalance $value = null): self + { + $this->clearBalanceActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityDeactivate + */ + public function getDeactivateActivityDetails(): ?GiftCardActivityDeactivate + { + return $this->deactivateActivityDetails; + } + + /** + * @param ?GiftCardActivityDeactivate $value + */ + public function setDeactivateActivityDetails(?GiftCardActivityDeactivate $value = null): self + { + $this->deactivateActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityAdjustIncrement + */ + public function getAdjustIncrementActivityDetails(): ?GiftCardActivityAdjustIncrement + { + return $this->adjustIncrementActivityDetails; + } + + /** + * @param ?GiftCardActivityAdjustIncrement $value + */ + public function setAdjustIncrementActivityDetails(?GiftCardActivityAdjustIncrement $value = null): self + { + $this->adjustIncrementActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityAdjustDecrement + */ + public function getAdjustDecrementActivityDetails(): ?GiftCardActivityAdjustDecrement + { + return $this->adjustDecrementActivityDetails; + } + + /** + * @param ?GiftCardActivityAdjustDecrement $value + */ + public function setAdjustDecrementActivityDetails(?GiftCardActivityAdjustDecrement $value = null): self + { + $this->adjustDecrementActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityRefund + */ + public function getRefundActivityDetails(): ?GiftCardActivityRefund + { + return $this->refundActivityDetails; + } + + /** + * @param ?GiftCardActivityRefund $value + */ + public function setRefundActivityDetails(?GiftCardActivityRefund $value = null): self + { + $this->refundActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityUnlinkedActivityRefund + */ + public function getUnlinkedActivityRefundActivityDetails(): ?GiftCardActivityUnlinkedActivityRefund + { + return $this->unlinkedActivityRefundActivityDetails; + } + + /** + * @param ?GiftCardActivityUnlinkedActivityRefund $value + */ + public function setUnlinkedActivityRefundActivityDetails(?GiftCardActivityUnlinkedActivityRefund $value = null): self + { + $this->unlinkedActivityRefundActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityImport + */ + public function getImportActivityDetails(): ?GiftCardActivityImport + { + return $this->importActivityDetails; + } + + /** + * @param ?GiftCardActivityImport $value + */ + public function setImportActivityDetails(?GiftCardActivityImport $value = null): self + { + $this->importActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityBlock + */ + public function getBlockActivityDetails(): ?GiftCardActivityBlock + { + return $this->blockActivityDetails; + } + + /** + * @param ?GiftCardActivityBlock $value + */ + public function setBlockActivityDetails(?GiftCardActivityBlock $value = null): self + { + $this->blockActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityUnblock + */ + public function getUnblockActivityDetails(): ?GiftCardActivityUnblock + { + return $this->unblockActivityDetails; + } + + /** + * @param ?GiftCardActivityUnblock $value + */ + public function setUnblockActivityDetails(?GiftCardActivityUnblock $value = null): self + { + $this->unblockActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityImportReversal + */ + public function getImportReversalActivityDetails(): ?GiftCardActivityImportReversal + { + return $this->importReversalActivityDetails; + } + + /** + * @param ?GiftCardActivityImportReversal $value + */ + public function setImportReversalActivityDetails(?GiftCardActivityImportReversal $value = null): self + { + $this->importReversalActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityTransferBalanceTo + */ + public function getTransferBalanceToActivityDetails(): ?GiftCardActivityTransferBalanceTo + { + return $this->transferBalanceToActivityDetails; + } + + /** + * @param ?GiftCardActivityTransferBalanceTo $value + */ + public function setTransferBalanceToActivityDetails(?GiftCardActivityTransferBalanceTo $value = null): self + { + $this->transferBalanceToActivityDetails = $value; + return $this; + } + + /** + * @return ?GiftCardActivityTransferBalanceFrom + */ + public function getTransferBalanceFromActivityDetails(): ?GiftCardActivityTransferBalanceFrom + { + return $this->transferBalanceFromActivityDetails; + } + + /** + * @param ?GiftCardActivityTransferBalanceFrom $value + */ + public function setTransferBalanceFromActivityDetails(?GiftCardActivityTransferBalanceFrom $value = null): self + { + $this->transferBalanceFromActivityDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityActivate.php b/src/Types/GiftCardActivityActivate.php new file mode 100644 index 00000000..5b414c94 --- /dev/null +++ b/src/Types/GiftCardActivityActivate.php @@ -0,0 +1,187 @@ + $buyerPaymentInstrumentIds + */ + #[JsonProperty('buyer_payment_instrument_ids'), ArrayType(['string'])] + private ?array $buyerPaymentInstrumentIds; + + /** + * @param array{ + * amountMoney?: ?Money, + * orderId?: ?string, + * lineItemUid?: ?string, + * referenceId?: ?string, + * buyerPaymentInstrumentIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->amountMoney = $values['amountMoney'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->lineItemUid = $values['lineItemUid'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->buyerPaymentInstrumentIds = $values['buyerPaymentInstrumentIds'] ?? null; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLineItemUid(): ?string + { + return $this->lineItemUid; + } + + /** + * @param ?string $value + */ + public function setLineItemUid(?string $value = null): self + { + $this->lineItemUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getBuyerPaymentInstrumentIds(): ?array + { + return $this->buyerPaymentInstrumentIds; + } + + /** + * @param ?array $value + */ + public function setBuyerPaymentInstrumentIds(?array $value = null): self + { + $this->buyerPaymentInstrumentIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityAdjustDecrement.php b/src/Types/GiftCardActivityAdjustDecrement.php new file mode 100644 index 00000000..fc42e88b --- /dev/null +++ b/src/Types/GiftCardActivityAdjustDecrement.php @@ -0,0 +1,82 @@ + $reason + */ + #[JsonProperty('reason')] + private string $reason; + + /** + * @param array{ + * amountMoney: Money, + * reason: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->amountMoney = $values['amountMoney']; + $this->reason = $values['reason']; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return value-of + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param value-of $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityAdjustDecrementReason.php b/src/Types/GiftCardActivityAdjustDecrementReason.php new file mode 100644 index 00000000..3f97358a --- /dev/null +++ b/src/Types/GiftCardActivityAdjustDecrementReason.php @@ -0,0 +1,11 @@ + $reason + */ + #[JsonProperty('reason')] + private string $reason; + + /** + * @param array{ + * amountMoney: Money, + * reason: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->amountMoney = $values['amountMoney']; + $this->reason = $values['reason']; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return value-of + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param value-of $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityAdjustIncrementReason.php b/src/Types/GiftCardActivityAdjustIncrementReason.php new file mode 100644 index 00000000..a5931942 --- /dev/null +++ b/src/Types/GiftCardActivityAdjustIncrementReason.php @@ -0,0 +1,10 @@ +reason = $values['reason']; + } + + /** + * @return 'CHARGEBACK_BLOCK' + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param 'CHARGEBACK_BLOCK' $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityClearBalance.php b/src/Types/GiftCardActivityClearBalance.php new file mode 100644 index 00000000..4df14119 --- /dev/null +++ b/src/Types/GiftCardActivityClearBalance.php @@ -0,0 +1,57 @@ + $reason + */ + #[JsonProperty('reason')] + private string $reason; + + /** + * @param array{ + * reason: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->reason = $values['reason']; + } + + /** + * @return value-of + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param value-of $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityClearBalanceReason.php b/src/Types/GiftCardActivityClearBalanceReason.php new file mode 100644 index 00000000..ecf72a7a --- /dev/null +++ b/src/Types/GiftCardActivityClearBalanceReason.php @@ -0,0 +1,10 @@ + $reason + */ + #[JsonProperty('reason')] + private string $reason; + + /** + * @param array{ + * reason: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->reason = $values['reason']; + } + + /** + * @return value-of + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param value-of $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityDeactivateReason.php b/src/Types/GiftCardActivityDeactivateReason.php new file mode 100644 index 00000000..374d80fb --- /dev/null +++ b/src/Types/GiftCardActivityDeactivateReason.php @@ -0,0 +1,10 @@ +amountMoney = $values['amountMoney']; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityImportReversal.php b/src/Types/GiftCardActivityImportReversal.php new file mode 100644 index 00000000..83f94494 --- /dev/null +++ b/src/Types/GiftCardActivityImportReversal.php @@ -0,0 +1,57 @@ +amountMoney = $values['amountMoney']; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityLoad.php b/src/Types/GiftCardActivityLoad.php new file mode 100644 index 00000000..d9738f12 --- /dev/null +++ b/src/Types/GiftCardActivityLoad.php @@ -0,0 +1,187 @@ + $buyerPaymentInstrumentIds + */ + #[JsonProperty('buyer_payment_instrument_ids'), ArrayType(['string'])] + private ?array $buyerPaymentInstrumentIds; + + /** + * @param array{ + * amountMoney?: ?Money, + * orderId?: ?string, + * lineItemUid?: ?string, + * referenceId?: ?string, + * buyerPaymentInstrumentIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->amountMoney = $values['amountMoney'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->lineItemUid = $values['lineItemUid'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->buyerPaymentInstrumentIds = $values['buyerPaymentInstrumentIds'] ?? null; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLineItemUid(): ?string + { + return $this->lineItemUid; + } + + /** + * @param ?string $value + */ + public function setLineItemUid(?string $value = null): self + { + $this->lineItemUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getBuyerPaymentInstrumentIds(): ?array + { + return $this->buyerPaymentInstrumentIds; + } + + /** + * @param ?array $value + */ + public function setBuyerPaymentInstrumentIds(?array $value = null): self + { + $this->buyerPaymentInstrumentIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityRedeem.php b/src/Types/GiftCardActivityRedeem.php new file mode 100644 index 00000000..0f4b1639 --- /dev/null +++ b/src/Types/GiftCardActivityRedeem.php @@ -0,0 +1,148 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * amountMoney: Money, + * paymentId?: ?string, + * referenceId?: ?string, + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->amountMoney = $values['amountMoney']; + $this->paymentId = $values['paymentId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityRedeemStatus.php b/src/Types/GiftCardActivityRedeemStatus.php new file mode 100644 index 00000000..4d34c70a --- /dev/null +++ b/src/Types/GiftCardActivityRedeemStatus.php @@ -0,0 +1,10 @@ +redeemActivityId = $values['redeemActivityId'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getRedeemActivityId(): ?string + { + return $this->redeemActivityId; + } + + /** + * @param ?string $value + */ + public function setRedeemActivityId(?string $value = null): self + { + $this->redeemActivityId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityTransferBalanceFrom.php b/src/Types/GiftCardActivityTransferBalanceFrom.php new file mode 100644 index 00000000..fb76ebff --- /dev/null +++ b/src/Types/GiftCardActivityTransferBalanceFrom.php @@ -0,0 +1,79 @@ +transferToGiftCardId = $values['transferToGiftCardId']; + $this->amountMoney = $values['amountMoney']; + } + + /** + * @return string + */ + public function getTransferToGiftCardId(): string + { + return $this->transferToGiftCardId; + } + + /** + * @param string $value + */ + public function setTransferToGiftCardId(string $value): self + { + $this->transferToGiftCardId = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityTransferBalanceTo.php b/src/Types/GiftCardActivityTransferBalanceTo.php new file mode 100644 index 00000000..4e233512 --- /dev/null +++ b/src/Types/GiftCardActivityTransferBalanceTo.php @@ -0,0 +1,79 @@ +transferFromGiftCardId = $values['transferFromGiftCardId']; + $this->amountMoney = $values['amountMoney']; + } + + /** + * @return string + */ + public function getTransferFromGiftCardId(): string + { + return $this->transferFromGiftCardId; + } + + /** + * @param string $value + */ + public function setTransferFromGiftCardId(string $value): self + { + $this->transferFromGiftCardId = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityType.php b/src/Types/GiftCardActivityType.php new file mode 100644 index 00000000..4bc4bc55 --- /dev/null +++ b/src/Types/GiftCardActivityType.php @@ -0,0 +1,22 @@ +reason = $values['reason']; + } + + /** + * @return 'CHARGEBACK_UNBLOCK' + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param 'CHARGEBACK_UNBLOCK' $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardActivityUnlinkedActivityRefund.php b/src/Types/GiftCardActivityUnlinkedActivityRefund.php new file mode 100644 index 00000000..ba17c024 --- /dev/null +++ b/src/Types/GiftCardActivityUnlinkedActivityRefund.php @@ -0,0 +1,104 @@ +amountMoney = $values['amountMoney']; + $this->referenceId = $values['referenceId'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GiftCardGanSource.php b/src/Types/GiftCardGanSource.php new file mode 100644 index 00000000..d6c885c4 --- /dev/null +++ b/src/Types/GiftCardGanSource.php @@ -0,0 +1,9 @@ + $fromState + */ + #[JsonProperty('from_state')] + private ?string $fromState; + + /** + * The [inventory state](entity:InventoryState) of the related quantity + * of items after the adjustment. + * See [InventoryState](#type-inventorystate) for possible values + * + * @var ?value-of $toState + */ + #[JsonProperty('to_state')] + private ?string $toState; + + /** + * The Square-generated ID of the [Location](entity:Location) where the related + * quantity of items is being tracked. + * + * @var ?string $locationId + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * The Square-generated ID of the + * [CatalogObject](entity:CatalogObject) being tracked. + * + * @var ?string $catalogObjectId + */ + #[JsonProperty('catalog_object_id')] + private ?string $catalogObjectId; + + /** + * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. + * + * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value. + * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app. + * + * @var ?string $catalogObjectType + */ + #[JsonProperty('catalog_object_type')] + private ?string $catalogObjectType; + + /** + * The number of items affected by the adjustment as a decimal string. + * Can support up to 5 digits after the decimal point. + * + * @var ?string $quantity + */ + #[JsonProperty('quantity')] + private ?string $quantity; + + /** + * The total price paid for goods associated with the + * adjustment. Present if and only if `to_state` is `SOLD`. Always + * non-negative. + * + * @var ?Money $totalPriceMoney + */ + #[JsonProperty('total_price_money')] + private ?Money $totalPriceMoney; + + /** + * A client-generated RFC 3339-formatted timestamp that indicates when + * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` + * timestamp cannot be older than 24 hours or in the future relative to the + * time of the request. + * + * @var ?string $occurredAt + */ + #[JsonProperty('occurred_at')] + private ?string $occurredAt; + + /** + * @var ?string $createdAt An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * Information about the application that caused the + * inventory adjustment. + * + * @var ?SourceApplication $source + */ + #[JsonProperty('source')] + private ?SourceApplication $source; + + /** + * The Square-generated ID of the [Employee](entity:Employee) responsible for the + * inventory adjustment. + * + * @var ?string $employeeId + */ + #[JsonProperty('employee_id')] + private ?string $employeeId; + + /** + * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the + * inventory adjustment. + * + * @var ?string $teamMemberId + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * The Square-generated ID of the [Transaction](entity:Transaction) that + * caused the adjustment. Only relevant for payment-related state + * transitions. + * + * @var ?string $transactionId + */ + #[JsonProperty('transaction_id')] + private ?string $transactionId; + + /** + * The Square-generated ID of the [Refund](entity:Refund) that + * caused the adjustment. Only relevant for refund-related state + * transitions. + * + * @var ?string $refundId + */ + #[JsonProperty('refund_id')] + private ?string $refundId; + + /** + * The Square-generated ID of the purchase order that caused the + * adjustment. Only relevant for state transitions from the Square for Retail + * app. + * + * @var ?string $purchaseOrderId + */ + #[JsonProperty('purchase_order_id')] + private ?string $purchaseOrderId; + + /** + * The Square-generated ID of the goods receipt that caused the + * adjustment. Only relevant for state transitions from the Square for Retail + * app. + * + * @var ?string $goodsReceiptId + */ + #[JsonProperty('goods_receipt_id')] + private ?string $goodsReceiptId; + + /** + * @var ?InventoryAdjustmentGroup $adjustmentGroup An adjustment group bundling the related adjustments of item variations through stock conversions in a single inventory event. + */ + #[JsonProperty('adjustment_group')] + private ?InventoryAdjustmentGroup $adjustmentGroup; + + /** + * @param array{ + * id?: ?string, + * referenceId?: ?string, + * fromState?: ?value-of, + * toState?: ?value-of, + * locationId?: ?string, + * catalogObjectId?: ?string, + * catalogObjectType?: ?string, + * quantity?: ?string, + * totalPriceMoney?: ?Money, + * occurredAt?: ?string, + * createdAt?: ?string, + * source?: ?SourceApplication, + * employeeId?: ?string, + * teamMemberId?: ?string, + * transactionId?: ?string, + * refundId?: ?string, + * purchaseOrderId?: ?string, + * goodsReceiptId?: ?string, + * adjustmentGroup?: ?InventoryAdjustmentGroup, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->fromState = $values['fromState'] ?? null; + $this->toState = $values['toState'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogObjectType = $values['catalogObjectType'] ?? null; + $this->quantity = $values['quantity'] ?? null; + $this->totalPriceMoney = $values['totalPriceMoney'] ?? null; + $this->occurredAt = $values['occurredAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->source = $values['source'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->transactionId = $values['transactionId'] ?? null; + $this->refundId = $values['refundId'] ?? null; + $this->purchaseOrderId = $values['purchaseOrderId'] ?? null; + $this->goodsReceiptId = $values['goodsReceiptId'] ?? null; + $this->adjustmentGroup = $values['adjustmentGroup'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getFromState(): ?string + { + return $this->fromState; + } + + /** + * @param ?value-of $value + */ + public function setFromState(?string $value = null): self + { + $this->fromState = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getToState(): ?string + { + return $this->toState; + } + + /** + * @param ?value-of $value + */ + public function setToState(?string $value = null): self + { + $this->toState = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectType(): ?string + { + return $this->catalogObjectType; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectType(?string $value = null): self + { + $this->catalogObjectType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalPriceMoney(): ?Money + { + return $this->totalPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalPriceMoney(?Money $value = null): self + { + $this->totalPriceMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOccurredAt(): ?string + { + return $this->occurredAt; + } + + /** + * @param ?string $value + */ + public function setOccurredAt(?string $value = null): self + { + $this->occurredAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?SourceApplication + */ + public function getSource(): ?SourceApplication + { + return $this->source; + } + + /** + * @param ?SourceApplication $value + */ + public function setSource(?SourceApplication $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTransactionId(): ?string + { + return $this->transactionId; + } + + /** + * @param ?string $value + */ + public function setTransactionId(?string $value = null): self + { + $this->transactionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundId(): ?string + { + return $this->refundId; + } + + /** + * @param ?string $value + */ + public function setRefundId(?string $value = null): self + { + $this->refundId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPurchaseOrderId(): ?string + { + return $this->purchaseOrderId; + } + + /** + * @param ?string $value + */ + public function setPurchaseOrderId(?string $value = null): self + { + $this->purchaseOrderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGoodsReceiptId(): ?string + { + return $this->goodsReceiptId; + } + + /** + * @param ?string $value + */ + public function setGoodsReceiptId(?string $value = null): self + { + $this->goodsReceiptId = $value; + return $this; + } + + /** + * @return ?InventoryAdjustmentGroup + */ + public function getAdjustmentGroup(): ?InventoryAdjustmentGroup + { + return $this->adjustmentGroup; + } + + /** + * @param ?InventoryAdjustmentGroup $value + */ + public function setAdjustmentGroup(?InventoryAdjustmentGroup $value = null): self + { + $this->adjustmentGroup = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InventoryAdjustmentGroup.php b/src/Types/InventoryAdjustmentGroup.php new file mode 100644 index 00000000..49ae0376 --- /dev/null +++ b/src/Types/InventoryAdjustmentGroup.php @@ -0,0 +1,139 @@ + $fromState + */ + #[JsonProperty('from_state')] + private ?string $fromState; + + /** + * Representative `to_state` for adjustments within group. For example, for a group adjustment from `IN_STOCK` to `SOLD`, + * the two component adjustments in the group can be from `IN_STOCK` to `COMPOSED` and from `COMPOSED` to `SOLD`. + * Here, the representative `to_state` of the `InventoryAdjustmentGroup` is `SOLD`. + * See [InventoryState](#type-inventorystate) for possible values + * + * @var ?value-of $toState + */ + #[JsonProperty('to_state')] + private ?string $toState; + + /** + * @param array{ + * id?: ?string, + * rootAdjustmentId?: ?string, + * fromState?: ?value-of, + * toState?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->rootAdjustmentId = $values['rootAdjustmentId'] ?? null; + $this->fromState = $values['fromState'] ?? null; + $this->toState = $values['toState'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRootAdjustmentId(): ?string + { + return $this->rootAdjustmentId; + } + + /** + * @param ?string $value + */ + public function setRootAdjustmentId(?string $value = null): self + { + $this->rootAdjustmentId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getFromState(): ?string + { + return $this->fromState; + } + + /** + * @param ?value-of $value + */ + public function setFromState(?string $value = null): self + { + $this->fromState = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getToState(): ?string + { + return $this->toState; + } + + /** + * @param ?value-of $value + */ + public function setToState(?string $value = null): self + { + $this->toState = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InventoryAlertType.php b/src/Types/InventoryAlertType.php new file mode 100644 index 00000000..fbd0a520 --- /dev/null +++ b/src/Types/InventoryAlertType.php @@ -0,0 +1,9 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * Contains details about the physical count when `type` is + * `PHYSICAL_COUNT`, and is unset for all other change types. + * + * @var ?InventoryPhysicalCount $physicalCount + */ + #[JsonProperty('physical_count')] + private ?InventoryPhysicalCount $physicalCount; + + /** + * Contains details about the inventory adjustment when `type` is + * `ADJUSTMENT`, and is unset for all other change types. + * + * @var ?InventoryAdjustment $adjustment + */ + #[JsonProperty('adjustment')] + private ?InventoryAdjustment $adjustment; + + /** + * Contains details about the inventory transfer when `type` is + * `TRANSFER`, and is unset for all other change types. + * + * _Note:_ An [InventoryTransfer](entity:InventoryTransfer) object can only be set in the input to the + * [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) endpoint when the seller has an active Retail Plus subscription. + * + * @var ?InventoryTransfer $transfer + */ + #[JsonProperty('transfer')] + private ?InventoryTransfer $transfer; + + /** + * @var ?CatalogMeasurementUnit $measurementUnit The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change. + */ + #[JsonProperty('measurement_unit')] + private ?CatalogMeasurementUnit $measurementUnit; + + /** + * @var ?string $measurementUnitId The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change. + */ + #[JsonProperty('measurement_unit_id')] + private ?string $measurementUnitId; + + /** + * @param array{ + * type?: ?value-of, + * physicalCount?: ?InventoryPhysicalCount, + * adjustment?: ?InventoryAdjustment, + * transfer?: ?InventoryTransfer, + * measurementUnit?: ?CatalogMeasurementUnit, + * measurementUnitId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->physicalCount = $values['physicalCount'] ?? null; + $this->adjustment = $values['adjustment'] ?? null; + $this->transfer = $values['transfer'] ?? null; + $this->measurementUnit = $values['measurementUnit'] ?? null; + $this->measurementUnitId = $values['measurementUnitId'] ?? null; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?InventoryPhysicalCount + */ + public function getPhysicalCount(): ?InventoryPhysicalCount + { + return $this->physicalCount; + } + + /** + * @param ?InventoryPhysicalCount $value + */ + public function setPhysicalCount(?InventoryPhysicalCount $value = null): self + { + $this->physicalCount = $value; + return $this; + } + + /** + * @return ?InventoryAdjustment + */ + public function getAdjustment(): ?InventoryAdjustment + { + return $this->adjustment; + } + + /** + * @param ?InventoryAdjustment $value + */ + public function setAdjustment(?InventoryAdjustment $value = null): self + { + $this->adjustment = $value; + return $this; + } + + /** + * @return ?InventoryTransfer + */ + public function getTransfer(): ?InventoryTransfer + { + return $this->transfer; + } + + /** + * @param ?InventoryTransfer $value + */ + public function setTransfer(?InventoryTransfer $value = null): self + { + $this->transfer = $value; + return $this; + } + + /** + * @return ?CatalogMeasurementUnit + */ + public function getMeasurementUnit(): ?CatalogMeasurementUnit + { + return $this->measurementUnit; + } + + /** + * @param ?CatalogMeasurementUnit $value + */ + public function setMeasurementUnit(?CatalogMeasurementUnit $value = null): self + { + $this->measurementUnit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMeasurementUnitId(): ?string + { + return $this->measurementUnitId; + } + + /** + * @param ?string $value + */ + public function setMeasurementUnitId(?string $value = null): self + { + $this->measurementUnitId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InventoryChangeType.php b/src/Types/InventoryChangeType.php new file mode 100644 index 00000000..0e85c42f --- /dev/null +++ b/src/Types/InventoryChangeType.php @@ -0,0 +1,10 @@ + $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * The Square-generated ID of the [Location](entity:Location) where the related + * quantity of items is being tracked. + * + * @var ?string $locationId + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * The number of items affected by the estimated count as a decimal string. + * Can support up to 5 digits after the decimal point. + * + * @var ?string $quantity + */ + #[JsonProperty('quantity')] + private ?string $quantity; + + /** + * An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting + * the estimated count is received. + * + * @var ?string $calculatedAt + */ + #[JsonProperty('calculated_at')] + private ?string $calculatedAt; + + /** + * Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory count will not be present in the response of + * any of these endpoints: [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory), + * [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges), + * [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts), and + * [RetrieveInventoryChanges](api-endpoint:Inventory-RetrieveInventoryChanges). + * + * @var ?bool $isEstimated + */ + #[JsonProperty('is_estimated')] + private ?bool $isEstimated; + + /** + * @param array{ + * catalogObjectId?: ?string, + * catalogObjectType?: ?string, + * state?: ?value-of, + * locationId?: ?string, + * quantity?: ?string, + * calculatedAt?: ?string, + * isEstimated?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogObjectType = $values['catalogObjectType'] ?? null; + $this->state = $values['state'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->quantity = $values['quantity'] ?? null; + $this->calculatedAt = $values['calculatedAt'] ?? null; + $this->isEstimated = $values['isEstimated'] ?? null; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectType(): ?string + { + return $this->catalogObjectType; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectType(?string $value = null): self + { + $this->catalogObjectType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCalculatedAt(): ?string + { + return $this->calculatedAt; + } + + /** + * @param ?string $value + */ + public function setCalculatedAt(?string $value = null): self + { + $this->calculatedAt = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsEstimated(): ?bool + { + return $this->isEstimated; + } + + /** + * @param ?bool $value + */ + public function setIsEstimated(?bool $value = null): self + { + $this->isEstimated = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InventoryPhysicalCount.php b/src/Types/InventoryPhysicalCount.php new file mode 100644 index 00000000..cff65631 --- /dev/null +++ b/src/Types/InventoryPhysicalCount.php @@ -0,0 +1,371 @@ + $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * The Square-generated ID of the [Location](entity:Location) where the related + * quantity of items is being tracked. + * + * @var ?string $locationId + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * The number of items affected by the physical count as a decimal string. + * The number can support up to 5 digits after the decimal point. + * + * @var ?string $quantity + */ + #[JsonProperty('quantity')] + private ?string $quantity; + + /** + * Information about the application with which the + * physical count is submitted. + * + * @var ?SourceApplication $source + */ + #[JsonProperty('source')] + private ?SourceApplication $source; + + /** + * The Square-generated ID of the [Employee](entity:Employee) responsible for the + * physical count. + * + * @var ?string $employeeId + */ + #[JsonProperty('employee_id')] + private ?string $employeeId; + + /** + * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the + * physical count. + * + * @var ?string $teamMemberId + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * A client-generated RFC 3339-formatted timestamp that indicates when + * the physical count was examined. For physical count updates, the `occurred_at` + * timestamp cannot be older than 24 hours or in the future relative to the + * time of the request. + * + * @var ?string $occurredAt + */ + #[JsonProperty('occurred_at')] + private ?string $occurredAt; + + /** + * @var ?string $createdAt An RFC 3339-formatted timestamp that indicates when the physical count is received. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @param array{ + * id?: ?string, + * referenceId?: ?string, + * catalogObjectId?: ?string, + * catalogObjectType?: ?string, + * state?: ?value-of, + * locationId?: ?string, + * quantity?: ?string, + * source?: ?SourceApplication, + * employeeId?: ?string, + * teamMemberId?: ?string, + * occurredAt?: ?string, + * createdAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogObjectType = $values['catalogObjectType'] ?? null; + $this->state = $values['state'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->quantity = $values['quantity'] ?? null; + $this->source = $values['source'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->occurredAt = $values['occurredAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectType(): ?string + { + return $this->catalogObjectType; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectType(?string $value = null): self + { + $this->catalogObjectType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?SourceApplication + */ + public function getSource(): ?SourceApplication + { + return $this->source; + } + + /** + * @param ?SourceApplication $value + */ + public function setSource(?SourceApplication $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOccurredAt(): ?string + { + return $this->occurredAt; + } + + /** + * @param ?string $value + */ + public function setOccurredAt(?string $value = null): self + { + $this->occurredAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InventoryState.php b/src/Types/InventoryState.php new file mode 100644 index 00000000..96afe83f --- /dev/null +++ b/src/Types/InventoryState.php @@ -0,0 +1,23 @@ + $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * The Square-generated ID of the [Location](entity:Location) where the related + * quantity of items was tracked before the transfer. + * + * @var ?string $fromLocationId + */ + #[JsonProperty('from_location_id')] + private ?string $fromLocationId; + + /** + * The Square-generated ID of the [Location](entity:Location) where the related + * quantity of items was tracked after the transfer. + * + * @var ?string $toLocationId + */ + #[JsonProperty('to_location_id')] + private ?string $toLocationId; + + /** + * The Square-generated ID of the + * [CatalogObject](entity:CatalogObject) being tracked. + * + * @var ?string $catalogObjectId + */ + #[JsonProperty('catalog_object_id')] + private ?string $catalogObjectId; + + /** + * The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. + * + * The Inventory API supports setting and reading the `"catalog_object_type": "ITEM_VARIATION"` field value. + * In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app. + * + * @var ?string $catalogObjectType + */ + #[JsonProperty('catalog_object_type')] + private ?string $catalogObjectType; + + /** + * The number of items affected by the transfer as a decimal string. + * Can support up to 5 digits after the decimal point. + * + * @var ?string $quantity + */ + #[JsonProperty('quantity')] + private ?string $quantity; + + /** + * A client-generated RFC 3339-formatted timestamp that indicates when + * the transfer took place. For write actions, the `occurred_at` timestamp + * cannot be older than 24 hours or in the future relative to the time of the + * request. + * + * @var ?string $occurredAt + */ + #[JsonProperty('occurred_at')] + private ?string $occurredAt; + + /** + * An RFC 3339-formatted timestamp that indicates when Square + * received the transfer request. + * + * @var ?string $createdAt + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * Information about the application that initiated the + * inventory transfer. + * + * @var ?SourceApplication $source + */ + #[JsonProperty('source')] + private ?SourceApplication $source; + + /** + * The Square-generated ID of the [Employee](entity:Employee) responsible for the + * inventory transfer. + * + * @var ?string $employeeId + */ + #[JsonProperty('employee_id')] + private ?string $employeeId; + + /** + * The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the + * inventory transfer. + * + * @var ?string $teamMemberId + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @param array{ + * id?: ?string, + * referenceId?: ?string, + * state?: ?value-of, + * fromLocationId?: ?string, + * toLocationId?: ?string, + * catalogObjectId?: ?string, + * catalogObjectType?: ?string, + * quantity?: ?string, + * occurredAt?: ?string, + * createdAt?: ?string, + * source?: ?SourceApplication, + * employeeId?: ?string, + * teamMemberId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->state = $values['state'] ?? null; + $this->fromLocationId = $values['fromLocationId'] ?? null; + $this->toLocationId = $values['toLocationId'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogObjectType = $values['catalogObjectType'] ?? null; + $this->quantity = $values['quantity'] ?? null; + $this->occurredAt = $values['occurredAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->source = $values['source'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFromLocationId(): ?string + { + return $this->fromLocationId; + } + + /** + * @param ?string $value + */ + public function setFromLocationId(?string $value = null): self + { + $this->fromLocationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getToLocationId(): ?string + { + return $this->toLocationId; + } + + /** + * @param ?string $value + */ + public function setToLocationId(?string $value = null): self + { + $this->toLocationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectType(): ?string + { + return $this->catalogObjectType; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectType(?string $value = null): self + { + $this->catalogObjectType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOccurredAt(): ?string + { + return $this->occurredAt; + } + + /** + * @param ?string $value + */ + public function setOccurredAt(?string $value = null): self + { + $this->occurredAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?SourceApplication + */ + public function getSource(): ?SourceApplication + { + return $this->source; + } + + /** + * @param ?SourceApplication $value + */ + public function setSource(?SourceApplication $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Invoice.php b/src/Types/Invoice.php new file mode 100644 index 00000000..c3705842 --- /dev/null +++ b/src/Types/Invoice.php @@ -0,0 +1,733 @@ + $paymentRequests + */ + #[JsonProperty('payment_requests'), ArrayType([InvoicePaymentRequest::class])] + private ?array $paymentRequests; + + /** + * The delivery method that Square uses to send the invoice, reminders, and receipts to + * the customer. After the invoice is published, Square processes the invoice based on the delivery + * method and payment request settings, either immediately or on the `scheduled_at` date, if specified. + * For example, Square might send the invoice or receipt for an automatic payment. For invoices with + * automatic payments, this field must be set to `EMAIL`. + * + * One of the following is required when creating an invoice: + * - (Recommended) This `delivery_method` field. To configure an automatic payment, the + * `automatic_payment_source` field of the payment request is also required. + * - The deprecated `request_method` field of the payment request. Note that `invoice` + * objects returned in responses do not include `request_method`. + * See [InvoiceDeliveryMethod](#type-invoicedeliverymethod) for possible values + * + * @var ?value-of $deliveryMethod + */ + #[JsonProperty('delivery_method')] + private ?string $deliveryMethod; + + /** + * A user-friendly invoice number that is displayed on the invoice. The value is unique within a location. + * If not provided when creating an invoice, Square assigns a value. + * It increments from 1 and is padded with zeros making it 7 characters long + * (for example, 0000001 and 0000002). + * + * @var ?string $invoiceNumber + */ + #[JsonProperty('invoice_number')] + private ?string $invoiceNumber; + + /** + * @var ?string $title The title of the invoice, which is displayed on the invoice. + */ + #[JsonProperty('title')] + private ?string $title; + + /** + * @var ?string $description The description of the invoice, which is displayed on the invoice. + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. + * After the invoice is published, Square processes the invoice on the specified date, + * according to the delivery method and payment request settings. + * + * If the field is not set, Square processes the invoice immediately after it is published. + * + * @var ?string $scheduledAt + */ + #[JsonProperty('scheduled_at')] + private ?string $scheduledAt; + + /** + * The URL of the Square-hosted invoice page. + * After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice + * page and returns the page URL in the response. + * + * @var ?string $publicUrl + */ + #[JsonProperty('public_url')] + private ?string $publicUrl; + + /** + * The current amount due for the invoice. In addition to the + * amount due on the next payment request, this includes any overdue payment amounts. + * + * @var ?Money $nextPaymentAmountMoney + */ + #[JsonProperty('next_payment_amount_money')] + private ?Money $nextPaymentAmountMoney; + + /** + * The status of the invoice. + * See [InvoiceStatus](#type-invoicestatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * The time zone used to interpret calendar dates on the invoice, such as `due_date`. + * When an invoice is created, this field is set to the `timezone` specified for the seller + * location. The value cannot be changed. + * + * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles + * becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp + * of 2021-03-10T08:00:00Z). + * + * @var ?string $timezone + */ + #[JsonProperty('timezone')] + private ?string $timezone; + + /** + * @var ?string $createdAt The timestamp when the invoice was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the invoice was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * The payment methods that customers can use to pay the invoice on the Square-hosted + * invoice page. This setting is independent of any automatic payment requests for the invoice. + * + * This field is required when creating an invoice and must set at least one payment method to `true`. + * + * @var ?InvoiceAcceptedPaymentMethods $acceptedPaymentMethods + */ + #[JsonProperty('accepted_payment_methods')] + private ?InvoiceAcceptedPaymentMethods $acceptedPaymentMethods; + + /** + * Additional seller-defined fields that are displayed on the invoice. For more information, see + * [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). + * + * Adding custom fields to an invoice requires an + * [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + * + * Max: 2 custom fields + * + * @var ?array $customFields + */ + #[JsonProperty('custom_fields'), ArrayType([InvoiceCustomField::class])] + private ?array $customFields; + + /** + * The ID of the [subscription](entity:Subscription) associated with the invoice. + * This field is present only on subscription billing invoices. + * + * @var ?string $subscriptionId + */ + #[JsonProperty('subscription_id')] + private ?string $subscriptionId; + + /** + * The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format. + * This field can be used to specify a past or future date which is displayed on the invoice. + * + * @var ?string $saleOrServiceDate + */ + #[JsonProperty('sale_or_service_date')] + private ?string $saleOrServiceDate; + + /** + * **France only.** The payment terms and conditions that are displayed on the invoice. For more information, + * see [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions). + * + * For countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and + * "Payment conditions are not supported for this location's country" detail if this field is included in `CreateInvoice` or `UpdateInvoice` requests. + * + * @var ?string $paymentConditions + */ + #[JsonProperty('payment_conditions')] + private ?string $paymentConditions; + + /** + * Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank transfer as a + * bank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on file__ checkbox on the + * invoice payment page. Stored payment information can be used for future automatic payments. The default value is `false`. + * + * @var ?bool $storePaymentMethodEnabled + */ + #[JsonProperty('store_payment_method_enabled')] + private ?bool $storePaymentMethodEnabled; + + /** + * Metadata about the attachments on the invoice. Invoice attachments are managed using the + * [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints. + * + * @var ?array $attachments + */ + #[JsonProperty('attachments'), ArrayType([InvoiceAttachment::class])] + private ?array $attachments; + + /** + * @param array{ + * id?: ?string, + * version?: ?int, + * locationId?: ?string, + * orderId?: ?string, + * primaryRecipient?: ?InvoiceRecipient, + * paymentRequests?: ?array, + * deliveryMethod?: ?value-of, + * invoiceNumber?: ?string, + * title?: ?string, + * description?: ?string, + * scheduledAt?: ?string, + * publicUrl?: ?string, + * nextPaymentAmountMoney?: ?Money, + * status?: ?value-of, + * timezone?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * acceptedPaymentMethods?: ?InvoiceAcceptedPaymentMethods, + * customFields?: ?array, + * subscriptionId?: ?string, + * saleOrServiceDate?: ?string, + * paymentConditions?: ?string, + * storePaymentMethodEnabled?: ?bool, + * attachments?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->version = $values['version'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->primaryRecipient = $values['primaryRecipient'] ?? null; + $this->paymentRequests = $values['paymentRequests'] ?? null; + $this->deliveryMethod = $values['deliveryMethod'] ?? null; + $this->invoiceNumber = $values['invoiceNumber'] ?? null; + $this->title = $values['title'] ?? null; + $this->description = $values['description'] ?? null; + $this->scheduledAt = $values['scheduledAt'] ?? null; + $this->publicUrl = $values['publicUrl'] ?? null; + $this->nextPaymentAmountMoney = $values['nextPaymentAmountMoney'] ?? null; + $this->status = $values['status'] ?? null; + $this->timezone = $values['timezone'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->acceptedPaymentMethods = $values['acceptedPaymentMethods'] ?? null; + $this->customFields = $values['customFields'] ?? null; + $this->subscriptionId = $values['subscriptionId'] ?? null; + $this->saleOrServiceDate = $values['saleOrServiceDate'] ?? null; + $this->paymentConditions = $values['paymentConditions'] ?? null; + $this->storePaymentMethodEnabled = $values['storePaymentMethodEnabled'] ?? null; + $this->attachments = $values['attachments'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?InvoiceRecipient + */ + public function getPrimaryRecipient(): ?InvoiceRecipient + { + return $this->primaryRecipient; + } + + /** + * @param ?InvoiceRecipient $value + */ + public function setPrimaryRecipient(?InvoiceRecipient $value = null): self + { + $this->primaryRecipient = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPaymentRequests(): ?array + { + return $this->paymentRequests; + } + + /** + * @param ?array $value + */ + public function setPaymentRequests(?array $value = null): self + { + $this->paymentRequests = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getDeliveryMethod(): ?string + { + return $this->deliveryMethod; + } + + /** + * @param ?value-of $value + */ + public function setDeliveryMethod(?string $value = null): self + { + $this->deliveryMethod = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInvoiceNumber(): ?string + { + return $this->invoiceNumber; + } + + /** + * @param ?string $value + */ + public function setInvoiceNumber(?string $value = null): self + { + $this->invoiceNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getScheduledAt(): ?string + { + return $this->scheduledAt; + } + + /** + * @param ?string $value + */ + public function setScheduledAt(?string $value = null): self + { + $this->scheduledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPublicUrl(): ?string + { + return $this->publicUrl; + } + + /** + * @param ?string $value + */ + public function setPublicUrl(?string $value = null): self + { + $this->publicUrl = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getNextPaymentAmountMoney(): ?Money + { + return $this->nextPaymentAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setNextPaymentAmountMoney(?Money $value = null): self + { + $this->nextPaymentAmountMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTimezone(): ?string + { + return $this->timezone; + } + + /** + * @param ?string $value + */ + public function setTimezone(?string $value = null): self + { + $this->timezone = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?InvoiceAcceptedPaymentMethods + */ + public function getAcceptedPaymentMethods(): ?InvoiceAcceptedPaymentMethods + { + return $this->acceptedPaymentMethods; + } + + /** + * @param ?InvoiceAcceptedPaymentMethods $value + */ + public function setAcceptedPaymentMethods(?InvoiceAcceptedPaymentMethods $value = null): self + { + $this->acceptedPaymentMethods = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomFields(): ?array + { + return $this->customFields; + } + + /** + * @param ?array $value + */ + public function setCustomFields(?array $value = null): self + { + $this->customFields = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSubscriptionId(): ?string + { + return $this->subscriptionId; + } + + /** + * @param ?string $value + */ + public function setSubscriptionId(?string $value = null): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSaleOrServiceDate(): ?string + { + return $this->saleOrServiceDate; + } + + /** + * @param ?string $value + */ + public function setSaleOrServiceDate(?string $value = null): self + { + $this->saleOrServiceDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentConditions(): ?string + { + return $this->paymentConditions; + } + + /** + * @param ?string $value + */ + public function setPaymentConditions(?string $value = null): self + { + $this->paymentConditions = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getStorePaymentMethodEnabled(): ?bool + { + return $this->storePaymentMethodEnabled; + } + + /** + * @param ?bool $value + */ + public function setStorePaymentMethodEnabled(?bool $value = null): self + { + $this->storePaymentMethodEnabled = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAttachments(): ?array + { + return $this->attachments; + } + + /** + * @param ?array $value + */ + public function setAttachments(?array $value = null): self + { + $this->attachments = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceAcceptedPaymentMethods.php b/src/Types/InvoiceAcceptedPaymentMethods.php new file mode 100644 index 00000000..a01a19c0 --- /dev/null +++ b/src/Types/InvoiceAcceptedPaymentMethods.php @@ -0,0 +1,166 @@ +card = $values['card'] ?? null; + $this->squareGiftCard = $values['squareGiftCard'] ?? null; + $this->bankAccount = $values['bankAccount'] ?? null; + $this->buyNowPayLater = $values['buyNowPayLater'] ?? null; + $this->cashAppPay = $values['cashAppPay'] ?? null; + } + + /** + * @return ?bool + */ + public function getCard(): ?bool + { + return $this->card; + } + + /** + * @param ?bool $value + */ + public function setCard(?bool $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSquareGiftCard(): ?bool + { + return $this->squareGiftCard; + } + + /** + * @param ?bool $value + */ + public function setSquareGiftCard(?bool $value = null): self + { + $this->squareGiftCard = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBankAccount(): ?bool + { + return $this->bankAccount; + } + + /** + * @param ?bool $value + */ + public function setBankAccount(?bool $value = null): self + { + $this->bankAccount = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getBuyNowPayLater(): ?bool + { + return $this->buyNowPayLater; + } + + /** + * @param ?bool $value + */ + public function setBuyNowPayLater(?bool $value = null): self + { + $this->buyNowPayLater = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCashAppPay(): ?bool + { + return $this->cashAppPay; + } + + /** + * @param ?bool $value + */ + public function setCashAppPay(?bool $value = null): self + { + $this->cashAppPay = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceAttachment.php b/src/Types/InvoiceAttachment.php new file mode 100644 index 00000000..a984825e --- /dev/null +++ b/src/Types/InvoiceAttachment.php @@ -0,0 +1,211 @@ +id = $values['id'] ?? null; + $this->filename = $values['filename'] ?? null; + $this->description = $values['description'] ?? null; + $this->filesize = $values['filesize'] ?? null; + $this->hash = $values['hash'] ?? null; + $this->mimeType = $values['mimeType'] ?? null; + $this->uploadedAt = $values['uploadedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFilename(): ?string + { + return $this->filename; + } + + /** + * @param ?string $value + */ + public function setFilename(?string $value = null): self + { + $this->filename = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?int + */ + public function getFilesize(): ?int + { + return $this->filesize; + } + + /** + * @param ?int $value + */ + public function setFilesize(?int $value = null): self + { + $this->filesize = $value; + return $this; + } + + /** + * @return ?string + */ + public function getHash(): ?string + { + return $this->hash; + } + + /** + * @param ?string $value + */ + public function setHash(?string $value = null): self + { + $this->hash = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param ?string $value + */ + public function setMimeType(?string $value = null): self + { + $this->mimeType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUploadedAt(): ?string + { + return $this->uploadedAt; + } + + /** + * @param ?string $value + */ + public function setUploadedAt(?string $value = null): self + { + $this->uploadedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceAutomaticPaymentSource.php b/src/Types/InvoiceAutomaticPaymentSource.php new file mode 100644 index 00000000..05bd8180 --- /dev/null +++ b/src/Types/InvoiceAutomaticPaymentSource.php @@ -0,0 +1,10 @@ + $placement + */ + #[JsonProperty('placement')] + private ?string $placement; + + /** + * @param array{ + * label?: ?string, + * value?: ?string, + * placement?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->label = $values['label'] ?? null; + $this->value = $values['value'] ?? null; + $this->placement = $values['placement'] ?? null; + } + + /** + * @return ?string + */ + public function getLabel(): ?string + { + return $this->label; + } + + /** + * @param ?string $value + */ + public function setLabel(?string $value = null): self + { + $this->label = $value; + return $this; + } + + /** + * @return ?string + */ + public function getValue(): ?string + { + return $this->value; + } + + /** + * @param ?string $value + */ + public function setValue(?string $value = null): self + { + $this->value = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getPlacement(): ?string + { + return $this->placement; + } + + /** + * @param ?value-of $value + */ + public function setPlacement(?string $value = null): self + { + $this->placement = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceCustomFieldPlacement.php b/src/Types/InvoiceCustomFieldPlacement.php new file mode 100644 index 00000000..8dba5b19 --- /dev/null +++ b/src/Types/InvoiceCustomFieldPlacement.php @@ -0,0 +1,9 @@ + $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private array $locationIds; + + /** + * Limits the search to the specified customers, within the specified locations. + * Specifying a customer is optional. In the current implementation, + * a maximum of one customer can be specified. + * + * @var ?array $customerIds + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private ?array $customerIds; + + /** + * @param array{ + * locationIds: array, + * customerIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationIds = $values['locationIds']; + $this->customerIds = $values['customerIds'] ?? null; + } + + /** + * @return array + */ + public function getLocationIds(): array + { + return $this->locationIds; + } + + /** + * @param array $value + */ + public function setLocationIds(array $value): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomerIds(): ?array + { + return $this->customerIds; + } + + /** + * @param ?array $value + */ + public function setCustomerIds(?array $value = null): self + { + $this->customerIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoicePaymentReminder.php b/src/Types/InvoicePaymentReminder.php new file mode 100644 index 00000000..e2954d1a --- /dev/null +++ b/src/Types/InvoicePaymentReminder.php @@ -0,0 +1,166 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $sentAt If sent, the timestamp when the reminder was sent, in RFC 3339 format. + */ + #[JsonProperty('sent_at')] + private ?string $sentAt; + + /** + * @param array{ + * uid?: ?string, + * relativeScheduledDays?: ?int, + * message?: ?string, + * status?: ?value-of, + * sentAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->relativeScheduledDays = $values['relativeScheduledDays'] ?? null; + $this->message = $values['message'] ?? null; + $this->status = $values['status'] ?? null; + $this->sentAt = $values['sentAt'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?int + */ + public function getRelativeScheduledDays(): ?int + { + return $this->relativeScheduledDays; + } + + /** + * @param ?int $value + */ + public function setRelativeScheduledDays(?int $value = null): self + { + $this->relativeScheduledDays = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMessage(): ?string + { + return $this->message; + } + + /** + * @param ?string $value + */ + public function setMessage(?string $value = null): self + { + $this->message = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSentAt(): ?string + { + return $this->sentAt; + } + + /** + * @param ?string $value + */ + public function setSentAt(?string $value = null): self + { + $this->sentAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoicePaymentReminderStatus.php b/src/Types/InvoicePaymentReminderStatus.php new file mode 100644 index 00000000..a72888a9 --- /dev/null +++ b/src/Types/InvoicePaymentReminderStatus.php @@ -0,0 +1,10 @@ + $requestMethod + */ + #[JsonProperty('request_method')] + private ?string $requestMethod; + + /** + * Identifies the payment request type. This type defines how the payment request amount is determined. + * This field is required to create a payment request. + * See [InvoiceRequestType](#type-invoicerequesttype) for possible values + * + * @var ?value-of $requestType + */ + #[JsonProperty('request_type')] + private ?string $requestType; + + /** + * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field + * is required to create a payment request. If an `automatic_payment_source` is defined for the request, Square + * charges the payment source on this date. + * + * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` + * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC + * timestamp of 2021-03-10T08:00:00Z). + * + * @var ?string $dueDate + */ + #[JsonProperty('due_date')] + private ?string $dueDate; + + /** + * If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the `request_type`, + * this indicates the request amount. + * You cannot specify this when `request_type` is `BALANCE` or when the + * payment request includes the `percentage_requested` field. + * + * @var ?Money $fixedAmountRequestedMoney + */ + #[JsonProperty('fixed_amount_requested_money')] + private ?Money $fixedAmountRequestedMoney; + + /** + * Specifies the amount for the payment request in percentage: + * + * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. + * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less + * the deposit, if requested. The sum of the `percentage_requested` in all installment + * payment requests must be equal to 100. + * + * You cannot specify this when the payment `request_type` is `BALANCE` or when the + * payment request specifies the `fixed_amount_requested_money` field. + * + * @var ?string $percentageRequested + */ + #[JsonProperty('percentage_requested')] + private ?string $percentageRequested; + + /** + * If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) + * provides a place for the customer to pay a tip. + * + * This field is allowed only on the final payment request + * and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. + * + * @var ?bool $tippingEnabled + */ + #[JsonProperty('tipping_enabled')] + private ?bool $tippingEnabled; + + /** + * The payment method for an automatic payment. + * + * The default value is `NONE`. + * See [InvoiceAutomaticPaymentSource](#type-invoiceautomaticpaymentsource) for possible values + * + * @var ?value-of $automaticPaymentSource + */ + #[JsonProperty('automatic_payment_source')] + private ?string $automaticPaymentSource; + + /** + * The ID of the credit or debit card on file to charge for the payment request. To get the cards on file for a customer, + * call [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice recipient. + * + * @var ?string $cardId + */ + #[JsonProperty('card_id')] + private ?string $cardId; + + /** + * @var ?array $reminders A list of one or more reminders to send for the payment request. + */ + #[JsonProperty('reminders'), ArrayType([InvoicePaymentReminder::class])] + private ?array $reminders; + + /** + * The amount of the payment request, computed using the order amount and information from the various payment + * request fields (`request_type`, `fixed_amount_requested_money`, and `percentage_requested`). + * + * @var ?Money $computedAmountMoney + */ + #[JsonProperty('computed_amount_money')] + private ?Money $computedAmountMoney; + + /** + * The amount of money already paid for the specific payment request. + * This amount might include a rounding adjustment if the most recent invoice payment + * was in cash in a currency that rounds cash payments (such as, `CAD` or `AUD`). + * + * @var ?Money $totalCompletedAmountMoney + */ + #[JsonProperty('total_completed_amount_money')] + private ?Money $totalCompletedAmountMoney; + + /** + * If the most recent payment was a cash payment + * in a currency that rounds cash payments (such as, `CAD` or `AUD`) and the payment + * is rounded from `computed_amount_money` in the payment request, then this + * field specifies the rounding adjustment applied. This amount + * might be negative. + * + * @var ?Money $roundingAdjustmentIncludedMoney + */ + #[JsonProperty('rounding_adjustment_included_money')] + private ?Money $roundingAdjustmentIncludedMoney; + + /** + * @param array{ + * uid?: ?string, + * requestMethod?: ?value-of, + * requestType?: ?value-of, + * dueDate?: ?string, + * fixedAmountRequestedMoney?: ?Money, + * percentageRequested?: ?string, + * tippingEnabled?: ?bool, + * automaticPaymentSource?: ?value-of, + * cardId?: ?string, + * reminders?: ?array, + * computedAmountMoney?: ?Money, + * totalCompletedAmountMoney?: ?Money, + * roundingAdjustmentIncludedMoney?: ?Money, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->requestMethod = $values['requestMethod'] ?? null; + $this->requestType = $values['requestType'] ?? null; + $this->dueDate = $values['dueDate'] ?? null; + $this->fixedAmountRequestedMoney = $values['fixedAmountRequestedMoney'] ?? null; + $this->percentageRequested = $values['percentageRequested'] ?? null; + $this->tippingEnabled = $values['tippingEnabled'] ?? null; + $this->automaticPaymentSource = $values['automaticPaymentSource'] ?? null; + $this->cardId = $values['cardId'] ?? null; + $this->reminders = $values['reminders'] ?? null; + $this->computedAmountMoney = $values['computedAmountMoney'] ?? null; + $this->totalCompletedAmountMoney = $values['totalCompletedAmountMoney'] ?? null; + $this->roundingAdjustmentIncludedMoney = $values['roundingAdjustmentIncludedMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getRequestMethod(): ?string + { + return $this->requestMethod; + } + + /** + * @param ?value-of $value + */ + public function setRequestMethod(?string $value = null): self + { + $this->requestMethod = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getRequestType(): ?string + { + return $this->requestType; + } + + /** + * @param ?value-of $value + */ + public function setRequestType(?string $value = null): self + { + $this->requestType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDueDate(): ?string + { + return $this->dueDate; + } + + /** + * @param ?string $value + */ + public function setDueDate(?string $value = null): self + { + $this->dueDate = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getFixedAmountRequestedMoney(): ?Money + { + return $this->fixedAmountRequestedMoney; + } + + /** + * @param ?Money $value + */ + public function setFixedAmountRequestedMoney(?Money $value = null): self + { + $this->fixedAmountRequestedMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentageRequested(): ?string + { + return $this->percentageRequested; + } + + /** + * @param ?string $value + */ + public function setPercentageRequested(?string $value = null): self + { + $this->percentageRequested = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTippingEnabled(): ?bool + { + return $this->tippingEnabled; + } + + /** + * @param ?bool $value + */ + public function setTippingEnabled(?bool $value = null): self + { + $this->tippingEnabled = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getAutomaticPaymentSource(): ?string + { + return $this->automaticPaymentSource; + } + + /** + * @param ?value-of $value + */ + public function setAutomaticPaymentSource(?string $value = null): self + { + $this->automaticPaymentSource = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardId(): ?string + { + return $this->cardId; + } + + /** + * @param ?string $value + */ + public function setCardId(?string $value = null): self + { + $this->cardId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReminders(): ?array + { + return $this->reminders; + } + + /** + * @param ?array $value + */ + public function setReminders(?array $value = null): self + { + $this->reminders = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getComputedAmountMoney(): ?Money + { + return $this->computedAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setComputedAmountMoney(?Money $value = null): self + { + $this->computedAmountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalCompletedAmountMoney(): ?Money + { + return $this->totalCompletedAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalCompletedAmountMoney(?Money $value = null): self + { + $this->totalCompletedAmountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getRoundingAdjustmentIncludedMoney(): ?Money + { + return $this->roundingAdjustmentIncludedMoney; + } + + /** + * @param ?Money $value + */ + public function setRoundingAdjustmentIncludedMoney(?Money $value = null): self + { + $this->roundingAdjustmentIncludedMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceQuery.php b/src/Types/InvoiceQuery.php new file mode 100644 index 00000000..94960f02 --- /dev/null +++ b/src/Types/InvoiceQuery.php @@ -0,0 +1,82 @@ +filter = $values['filter']; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return InvoiceFilter + */ + public function getFilter(): InvoiceFilter + { + return $this->filter; + } + + /** + * @param InvoiceFilter $value + */ + public function setFilter(InvoiceFilter $value): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?InvoiceSort + */ + public function getSort(): ?InvoiceSort + { + return $this->sort; + } + + /** + * @param ?InvoiceSort $value + */ + public function setSort(?InvoiceSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceRecipient.php b/src/Types/InvoiceRecipient.php new file mode 100644 index 00000000..479156d7 --- /dev/null +++ b/src/Types/InvoiceRecipient.php @@ -0,0 +1,240 @@ +customerId = $values['customerId'] ?? null; + $this->givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->address = $values['address'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->companyName = $values['companyName'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompanyName(): ?string + { + return $this->companyName; + } + + /** + * @param ?string $value + */ + public function setCompanyName(?string $value = null): self + { + $this->companyName = $value; + return $this; + } + + /** + * @return ?InvoiceRecipientTaxIds + */ + public function getTaxIds(): ?InvoiceRecipientTaxIds + { + return $this->taxIds; + } + + /** + * @param ?InvoiceRecipientTaxIds $value + */ + public function setTaxIds(?InvoiceRecipientTaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceRecipientTaxIds.php b/src/Types/InvoiceRecipientTaxIds.php new file mode 100644 index 00000000..55652dd2 --- /dev/null +++ b/src/Types/InvoiceRecipientTaxIds.php @@ -0,0 +1,56 @@ +euVat = $values['euVat'] ?? null; + } + + /** + * @return ?string + */ + public function getEuVat(): ?string + { + return $this->euVat; + } + + /** + * @param ?string $value + */ + public function setEuVat(?string $value = null): self + { + $this->euVat = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceRequestMethod.php b/src/Types/InvoiceRequestMethod.php new file mode 100644 index 00000000..1d10b8b0 --- /dev/null +++ b/src/Types/InvoiceRequestMethod.php @@ -0,0 +1,14 @@ + $order + */ + #[JsonProperty('order')] + private ?string $order; + + /** + * @param array{ + * field: 'INVOICE_SORT_DATE', + * order?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->order = $values['order'] ?? null; + } + + /** + * @return 'INVOICE_SORT_DATE' + */ + public function getField(): string + { + return $this->field; + } + + /** + * @param 'INVOICE_SORT_DATE' $value + */ + public function setField(string $value): self + { + $this->field = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/InvoiceStatus.php b/src/Types/InvoiceStatus.php new file mode 100644 index 00000000..82816b9a --- /dev/null +++ b/src/Types/InvoiceStatus.php @@ -0,0 +1,17 @@ + $pricingType + */ + #[JsonProperty('pricing_type')] + private ?string $pricingType; + + /** + * @var ?bool $trackInventory If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. + */ + #[JsonProperty('track_inventory')] + private ?bool $trackInventory; + + /** + * Indicates whether the `CatalogItemVariation` displays an alert when its inventory + * quantity is less than or equal to its `inventory_alert_threshold`. + * See [InventoryAlertType](#type-inventoryalerttype) for possible values + * + * @var ?value-of $inventoryAlertType + */ + #[JsonProperty('inventory_alert_type')] + private ?string $inventoryAlertType; + + /** + * If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` + * is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. + * + * This value is always an integer. + * + * @var ?int $inventoryAlertThreshold + */ + #[JsonProperty('inventory_alert_threshold')] + private ?int $inventoryAlertThreshold; + + /** + * Indicates whether the overridden item variation is sold out at the specified location. + * + * When inventory tracking is enabled on the item variation either globally or at the specified location, + * the item variation is automatically marked as sold out when its inventory count reaches zero. The seller + * can manually set the item variation as sold out even when the inventory count is greater than zero. + * Attempts by an application to set this attribute are ignored. Regardless how the sold-out status is set, + * applications should treat its inventory count as zero when this attribute value is `true`. + * + * @var ?bool $soldOut + */ + #[JsonProperty('sold_out')] + private ?bool $soldOut; + + /** + * The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation + * becomes available again at the specified location. Attempts by an application to set this attribute are ignored. + * When the current time is later than this attribute value, the affected item variation is no longer sold out. + * + * @var ?string $soldOutValidUntil + */ + #[JsonProperty('sold_out_valid_until')] + private ?string $soldOutValidUntil; + + /** + * @param array{ + * locationId?: ?string, + * priceMoney?: ?Money, + * pricingType?: ?value-of, + * trackInventory?: ?bool, + * inventoryAlertType?: ?value-of, + * inventoryAlertThreshold?: ?int, + * soldOut?: ?bool, + * soldOutValidUntil?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationId = $values['locationId'] ?? null; + $this->priceMoney = $values['priceMoney'] ?? null; + $this->pricingType = $values['pricingType'] ?? null; + $this->trackInventory = $values['trackInventory'] ?? null; + $this->inventoryAlertType = $values['inventoryAlertType'] ?? null; + $this->inventoryAlertThreshold = $values['inventoryAlertThreshold'] ?? null; + $this->soldOut = $values['soldOut'] ?? null; + $this->soldOutValidUntil = $values['soldOutValidUntil'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceMoney(?Money $value = null): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getPricingType(): ?string + { + return $this->pricingType; + } + + /** + * @param ?value-of $value + */ + public function setPricingType(?string $value = null): self + { + $this->pricingType = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTrackInventory(): ?bool + { + return $this->trackInventory; + } + + /** + * @param ?bool $value + */ + public function setTrackInventory(?bool $value = null): self + { + $this->trackInventory = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getInventoryAlertType(): ?string + { + return $this->inventoryAlertType; + } + + /** + * @param ?value-of $value + */ + public function setInventoryAlertType(?string $value = null): self + { + $this->inventoryAlertType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getInventoryAlertThreshold(): ?int + { + return $this->inventoryAlertThreshold; + } + + /** + * @param ?int $value + */ + public function setInventoryAlertThreshold(?int $value = null): self + { + $this->inventoryAlertThreshold = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSoldOut(): ?bool + { + return $this->soldOut; + } + + /** + * @param ?bool $value + */ + public function setSoldOut(?bool $value = null): self + { + $this->soldOut = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSoldOutValidUntil(): ?string + { + return $this->soldOutValidUntil; + } + + /** + * @param ?string $value + */ + public function setSoldOutValidUntil(?string $value = null): self + { + $this->soldOutValidUntil = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Job.php b/src/Types/Job.php new file mode 100644 index 00000000..0d4bd176 --- /dev/null +++ b/src/Types/Job.php @@ -0,0 +1,190 @@ +id = $values['id'] ?? null; + $this->title = $values['title'] ?? null; + $this->isTipEligible = $values['isTipEligible'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->version = $values['version'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsTipEligible(): ?bool + { + return $this->isTipEligible; + } + + /** + * @param ?bool $value + */ + public function setIsTipEligible(?bool $value = null): self + { + $this->isTipEligible = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/JobAssignment.php b/src/Types/JobAssignment.php new file mode 100644 index 00000000..b5865445 --- /dev/null +++ b/src/Types/JobAssignment.php @@ -0,0 +1,187 @@ + $payType + */ + #[JsonProperty('pay_type')] + private string $payType; + + /** + * The hourly pay rate of the job. For `SALARY` pay types, Square calculates the hourly rate based on + * `annual_rate` and `weekly_hours`. + * + * @var ?Money $hourlyRate + */ + #[JsonProperty('hourly_rate')] + private ?Money $hourlyRate; + + /** + * @var ?Money $annualRate The total pay amount for a 12-month period on the job. Set if the job `PayType` is `SALARY`. + */ + #[JsonProperty('annual_rate')] + private ?Money $annualRate; + + /** + * @var ?int $weeklyHours The planned hours per week for the job. Set if the job `PayType` is `SALARY`. + */ + #[JsonProperty('weekly_hours')] + private ?int $weeklyHours; + + /** + * @var ?string $jobId The ID of the [job](entity:Job). + */ + #[JsonProperty('job_id')] + private ?string $jobId; + + /** + * @param array{ + * payType: value-of, + * jobTitle?: ?string, + * hourlyRate?: ?Money, + * annualRate?: ?Money, + * weeklyHours?: ?int, + * jobId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->jobTitle = $values['jobTitle'] ?? null; + $this->payType = $values['payType']; + $this->hourlyRate = $values['hourlyRate'] ?? null; + $this->annualRate = $values['annualRate'] ?? null; + $this->weeklyHours = $values['weeklyHours'] ?? null; + $this->jobId = $values['jobId'] ?? null; + } + + /** + * @return ?string + */ + public function getJobTitle(): ?string + { + return $this->jobTitle; + } + + /** + * @param ?string $value + */ + public function setJobTitle(?string $value = null): self + { + $this->jobTitle = $value; + return $this; + } + + /** + * @return value-of + */ + public function getPayType(): string + { + return $this->payType; + } + + /** + * @param value-of $value + */ + public function setPayType(string $value): self + { + $this->payType = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getHourlyRate(): ?Money + { + return $this->hourlyRate; + } + + /** + * @param ?Money $value + */ + public function setHourlyRate(?Money $value = null): self + { + $this->hourlyRate = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAnnualRate(): ?Money + { + return $this->annualRate; + } + + /** + * @param ?Money $value + */ + public function setAnnualRate(?Money $value = null): self + { + $this->annualRate = $value; + return $this; + } + + /** + * @return ?int + */ + public function getWeeklyHours(): ?int + { + return $this->weeklyHours; + } + + /** + * @param ?int $value + */ + public function setWeeklyHours(?int $value = null): self + { + $this->weeklyHours = $value; + return $this; + } + + /** + * @return ?string + */ + public function getJobId(): ?string + { + return $this->jobId; + } + + /** + * @param ?string $value + */ + public function setJobId(?string $value = null): self + { + $this->jobId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/JobAssignmentPayType.php b/src/Types/JobAssignmentPayType.php new file mode 100644 index 00000000..79adbe75 --- /dev/null +++ b/src/Types/JobAssignmentPayType.php @@ -0,0 +1,10 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?GiftCard $giftCard The gift card with the ID of the linked customer listed in the `customer_ids` field. + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListBankAccountsResponse.php b/src/Types/ListBankAccountsResponse.php new file mode 100644 index 00000000..b600af2b --- /dev/null +++ b/src/Types/ListBankAccountsResponse.php @@ -0,0 +1,111 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $bankAccounts List of BankAccounts associated with this account. + */ + #[JsonProperty('bank_accounts'), ArrayType([BankAccount::class])] + private ?array $bankAccounts; + + /** + * When a response is truncated, it includes a cursor that you can + * use in a subsequent request to fetch next set of bank accounts. + * If empty, this is the final response. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * bankAccounts?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->bankAccounts = $values['bankAccounts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getBankAccounts(): ?array + { + return $this->bankAccounts; + } + + /** + * @param ?array $value + */ + public function setBankAccounts(?array $value = null): self + { + $this->bankAccounts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListBookingCustomAttributeDefinitionsResponse.php b/src/Types/ListBookingCustomAttributeDefinitionsResponse.php new file mode 100644 index 00000000..304fac9e --- /dev/null +++ b/src/Types/ListBookingCustomAttributeDefinitionsResponse.php @@ -0,0 +1,114 @@ + $customAttributeDefinitions + */ + #[JsonProperty('custom_attribute_definitions'), ArrayType([CustomAttributeDefinition::class])] + private ?array $customAttributeDefinitions; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of + * results for your original request. This field is present only if the request succeeded and + * additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinitions?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinitions = $values['customAttributeDefinitions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributeDefinitions(): ?array + { + return $this->customAttributeDefinitions; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeDefinitions(?array $value = null): self + { + $this->customAttributeDefinitions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListBookingCustomAttributesResponse.php b/src/Types/ListBookingCustomAttributesResponse.php new file mode 100644 index 00000000..0ab3c212 --- /dev/null +++ b/src/Types/ListBookingCustomAttributesResponse.php @@ -0,0 +1,116 @@ + $customAttributes + */ + #[JsonProperty('custom_attributes'), ArrayType([CustomAttribute::class])] + private ?array $customAttributes; + + /** + * The cursor to use in your next call to this endpoint to retrieve the next page of results + * for your original request. This field is present only if the request succeeded and additional + * results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributes = $values['customAttributes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributes(): ?array + { + return $this->customAttributes; + } + + /** + * @param ?array $value + */ + public function setCustomAttributes(?array $value = null): self + { + $this->customAttributes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListBookingsResponse.php b/src/Types/ListBookingsResponse.php new file mode 100644 index 00000000..b484ba16 --- /dev/null +++ b/src/Types/ListBookingsResponse.php @@ -0,0 +1,102 @@ + $bookings The list of targeted bookings. + */ + #[JsonProperty('bookings'), ArrayType([Booking::class])] + private ?array $bookings; + + /** + * @var ?string $cursor The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bookings?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bookings = $values['bookings'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getBookings(): ?array + { + return $this->bookings; + } + + /** + * @param ?array $value + */ + public function setBookings(?array $value = null): self + { + $this->bookings = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListBreakTypesResponse.php b/src/Types/ListBreakTypesResponse.php new file mode 100644 index 00000000..6eb09be0 --- /dev/null +++ b/src/Types/ListBreakTypesResponse.php @@ -0,0 +1,110 @@ + $breakTypes A page of `BreakType` results. + */ + #[JsonProperty('break_types'), ArrayType([BreakType::class])] + private ?array $breakTypes; + + /** + * The value supplied in the subsequent request to fetch the next page + * of `BreakType` results. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * breakTypes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->breakTypes = $values['breakTypes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getBreakTypes(): ?array + { + return $this->breakTypes; + } + + /** + * @param ?array $value + */ + public function setBreakTypes(?array $value = null): self + { + $this->breakTypes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCardsResponse.php b/src/Types/ListCardsResponse.php new file mode 100644 index 00000000..f815fa6d --- /dev/null +++ b/src/Types/ListCardsResponse.php @@ -0,0 +1,114 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $cards The requested list of `Card`s. + */ + #[JsonProperty('cards'), ArrayType([Card::class])] + private ?array $cards; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * cards?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->cards = $values['cards'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCards(): ?array + { + return $this->cards; + } + + /** + * @param ?array $value + */ + public function setCards(?array $value = null): self + { + $this->cards = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCashDrawerShiftEventsResponse.php b/src/Types/ListCashDrawerShiftEventsResponse.php new file mode 100644 index 00000000..7288dac4 --- /dev/null +++ b/src/Types/ListCashDrawerShiftEventsResponse.php @@ -0,0 +1,108 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * All of the events (payments, refunds, etc.) for a cash drawer during + * the shift. + * + * @var ?array $cashDrawerShiftEvents + */ + #[JsonProperty('cash_drawer_shift_events'), ArrayType([CashDrawerShiftEvent::class])] + private ?array $cashDrawerShiftEvents; + + /** + * @param array{ + * cursor?: ?string, + * errors?: ?array, + * cashDrawerShiftEvents?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + $this->cashDrawerShiftEvents = $values['cashDrawerShiftEvents'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCashDrawerShiftEvents(): ?array + { + return $this->cashDrawerShiftEvents; + } + + /** + * @param ?array $value + */ + public function setCashDrawerShiftEvents(?array $value = null): self + { + $this->cashDrawerShiftEvents = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCashDrawerShiftsResponse.php b/src/Types/ListCashDrawerShiftsResponse.php new file mode 100644 index 00000000..2c2a4050 --- /dev/null +++ b/src/Types/ListCashDrawerShiftsResponse.php @@ -0,0 +1,108 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * A collection of CashDrawerShiftSummary objects for shifts that match + * the query. + * + * @var ?array $cashDrawerShifts + */ + #[JsonProperty('cash_drawer_shifts'), ArrayType([CashDrawerShiftSummary::class])] + private ?array $cashDrawerShifts; + + /** + * @param array{ + * cursor?: ?string, + * errors?: ?array, + * cashDrawerShifts?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + $this->cashDrawerShifts = $values['cashDrawerShifts'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCashDrawerShifts(): ?array + { + return $this->cashDrawerShifts; + } + + /** + * @param ?array $value + */ + public function setCashDrawerShifts(?array $value = null): self + { + $this->cashDrawerShifts = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCatalogResponse.php b/src/Types/ListCatalogResponse.php new file mode 100644 index 00000000..6eba9d78 --- /dev/null +++ b/src/Types/ListCatalogResponse.php @@ -0,0 +1,105 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The pagination cursor to be used in a subsequent request. If unset, this is the final response. + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $objects The CatalogObjects returned. + */ + #[JsonProperty('objects'), ArrayType([CatalogObject::class])] + private ?array $objects; + + /** + * @param array{ + * errors?: ?array, + * cursor?: ?string, + * objects?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->objects = $values['objects'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getObjects(): ?array + { + return $this->objects; + } + + /** + * @param ?array $value + */ + public function setObjects(?array $value = null): self + { + $this->objects = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCustomerCustomAttributeDefinitionsResponse.php b/src/Types/ListCustomerCustomAttributeDefinitionsResponse.php new file mode 100644 index 00000000..72cbeb29 --- /dev/null +++ b/src/Types/ListCustomerCustomAttributeDefinitionsResponse.php @@ -0,0 +1,114 @@ + $customAttributeDefinitions + */ + #[JsonProperty('custom_attribute_definitions'), ArrayType([CustomAttributeDefinition::class])] + private ?array $customAttributeDefinitions; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of + * results for your original request. This field is present only if the request succeeded and + * additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinitions?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinitions = $values['customAttributeDefinitions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributeDefinitions(): ?array + { + return $this->customAttributeDefinitions; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeDefinitions(?array $value = null): self + { + $this->customAttributeDefinitions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCustomerCustomAttributesResponse.php b/src/Types/ListCustomerCustomAttributesResponse.php new file mode 100644 index 00000000..10a3962b --- /dev/null +++ b/src/Types/ListCustomerCustomAttributesResponse.php @@ -0,0 +1,116 @@ + $customAttributes + */ + #[JsonProperty('custom_attributes'), ArrayType([CustomAttribute::class])] + private ?array $customAttributes; + + /** + * The cursor to use in your next call to this endpoint to retrieve the next page of results + * for your original request. This field is present only if the request succeeded and additional + * results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributes = $values['customAttributes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributes(): ?array + { + return $this->customAttributes; + } + + /** + * @param ?array $value + */ + public function setCustomAttributes(?array $value = null): self + { + $this->customAttributes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCustomerGroupsResponse.php b/src/Types/ListCustomerGroupsResponse.php new file mode 100644 index 00000000..f5ba7a4e --- /dev/null +++ b/src/Types/ListCustomerGroupsResponse.php @@ -0,0 +1,114 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $groups A list of customer groups belonging to the current seller. + */ + #[JsonProperty('groups'), ArrayType([CustomerGroup::class])] + private ?array $groups; + + /** + * A pagination cursor to retrieve the next set of results for your + * original query to the endpoint. This value is present only if the request + * succeeded and additional results are available. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * groups?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->groups = $values['groups'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getGroups(): ?array + { + return $this->groups; + } + + /** + * @param ?array $value + */ + public function setGroups(?array $value = null): self + { + $this->groups = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCustomerSegmentsResponse.php b/src/Types/ListCustomerSegmentsResponse.php new file mode 100644 index 00000000..560c4ac6 --- /dev/null +++ b/src/Types/ListCustomerSegmentsResponse.php @@ -0,0 +1,113 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $segments The list of customer segments belonging to the associated Square account. + */ + #[JsonProperty('segments'), ArrayType([CustomerSegment::class])] + private ?array $segments; + + /** + * A pagination cursor to be used in subsequent calls to `ListCustomerSegments` + * to retrieve the next set of query results. The cursor is only present if the request succeeded and + * additional results are available. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * segments?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->segments = $values['segments'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSegments(): ?array + { + return $this->segments; + } + + /** + * @param ?array $value + */ + public function setSegments(?array $value = null): self + { + $this->segments = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListCustomersResponse.php b/src/Types/ListCustomersResponse.php new file mode 100644 index 00000000..18b3195d --- /dev/null +++ b/src/Types/ListCustomersResponse.php @@ -0,0 +1,147 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The customer profiles associated with the Square account or an empty object (`{}`) if none are found. + * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or + * `phone_number`) are included in the response. + * + * @var ?array $customers + */ + #[JsonProperty('customers'), ArrayType([Customer::class])] + private ?array $customers; + + /** + * A pagination cursor to retrieve the next set of results for the + * original query. A cursor is only present if the request succeeded and additional results + * are available. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * The total count of customers associated with the Square account. Only customer profiles with public information + * (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present + * only if `count` is set to `true` in the request. + * + * @var ?int $count + */ + #[JsonProperty('count')] + private ?int $count; + + /** + * @param array{ + * errors?: ?array, + * customers?: ?array, + * cursor?: ?string, + * count?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->customers = $values['customers'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->count = $values['count'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomers(): ?array + { + return $this->customers; + } + + /** + * @param ?array $value + */ + public function setCustomers(?array $value = null): self + { + $this->customers = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCount(): ?int + { + return $this->count; + } + + /** + * @param ?int $value + */ + public function setCount(?int $value = null): self + { + $this->count = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListDeviceCodesResponse.php b/src/Types/ListDeviceCodesResponse.php new file mode 100644 index 00000000..98f7530b --- /dev/null +++ b/src/Types/ListDeviceCodesResponse.php @@ -0,0 +1,108 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $deviceCodes The queried DeviceCode. + */ + #[JsonProperty('device_codes'), ArrayType([DeviceCode::class])] + private ?array $deviceCodes; + + /** + * A pagination cursor to retrieve the next set of results for your + * original query to the endpoint. This value is present only if the request + * succeeded and additional results are available. + * + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * deviceCodes?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->deviceCodes = $values['deviceCodes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDeviceCodes(): ?array + { + return $this->deviceCodes; + } + + /** + * @param ?array $value + */ + public function setDeviceCodes(?array $value = null): self + { + $this->deviceCodes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListDevicesResponse.php b/src/Types/ListDevicesResponse.php new file mode 100644 index 00000000..8ac1a948 --- /dev/null +++ b/src/Types/ListDevicesResponse.php @@ -0,0 +1,106 @@ + $errors Information about errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $devices The requested list of `Device` objects. + */ + #[JsonProperty('devices'), ArrayType([Device::class])] + private ?array $devices; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * devices?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->devices = $values['devices'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDevices(): ?array + { + return $this->devices; + } + + /** + * @param ?array $value + */ + public function setDevices(?array $value = null): self + { + $this->devices = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListDisputeEvidenceResponse.php b/src/Types/ListDisputeEvidenceResponse.php new file mode 100644 index 00000000..69126584 --- /dev/null +++ b/src/Types/ListDisputeEvidenceResponse.php @@ -0,0 +1,108 @@ + $evidence The list of evidence previously uploaded to the specified dispute. + */ + #[JsonProperty('evidence'), ArrayType([DisputeEvidence::class])] + private ?array $evidence; + + /** + * @var ?array $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The pagination cursor to be used in a subsequent request. + * If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * evidence?: ?array, + * errors?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->evidence = $values['evidence'] ?? null; + $this->errors = $values['errors'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getEvidence(): ?array + { + return $this->evidence; + } + + /** + * @param ?array $value + */ + public function setEvidence(?array $value = null): self + { + $this->evidence = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListDisputesResponse.php b/src/Types/ListDisputesResponse.php new file mode 100644 index 00000000..1c2cd90c --- /dev/null +++ b/src/Types/ListDisputesResponse.php @@ -0,0 +1,108 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $disputes The list of disputes. + */ + #[JsonProperty('disputes'), ArrayType([Dispute::class])] + private ?array $disputes; + + /** + * The pagination cursor to be used in a subsequent request. + * If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * disputes?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->disputes = $values['disputes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDisputes(): ?array + { + return $this->disputes; + } + + /** + * @param ?array $value + */ + public function setDisputes(?array $value = null): self + { + $this->disputes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListEmployeeWagesResponse.php b/src/Types/ListEmployeeWagesResponse.php new file mode 100644 index 00000000..089b856b --- /dev/null +++ b/src/Types/ListEmployeeWagesResponse.php @@ -0,0 +1,109 @@ + $employeeWages A page of `EmployeeWage` results. + */ + #[JsonProperty('employee_wages'), ArrayType([EmployeeWage::class])] + private ?array $employeeWages; + + /** + * The value supplied in the subsequent request to fetch the next page + * of `EmployeeWage` results. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * employeeWages?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->employeeWages = $values['employeeWages'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getEmployeeWages(): ?array + { + return $this->employeeWages; + } + + /** + * @param ?array $value + */ + public function setEmployeeWages(?array $value = null): self + { + $this->employeeWages = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListEmployeesResponse.php b/src/Types/ListEmployeesResponse.php new file mode 100644 index 00000000..47b284c4 --- /dev/null +++ b/src/Types/ListEmployeesResponse.php @@ -0,0 +1,102 @@ + $employees + */ + #[JsonProperty('employees'), ArrayType([Employee::class])] + private ?array $employees; + + /** + * @var ?string $cursor The token to be used to retrieve the next page of results. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * employees?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->employees = $values['employees'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getEmployees(): ?array + { + return $this->employees; + } + + /** + * @param ?array $value + */ + public function setEmployees(?array $value = null): self + { + $this->employees = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListEventTypesResponse.php b/src/Types/ListEventTypesResponse.php new file mode 100644 index 00000000..a472b4ab --- /dev/null +++ b/src/Types/ListEventTypesResponse.php @@ -0,0 +1,109 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $eventTypes The list of event types. + */ + #[JsonProperty('event_types'), ArrayType(['string'])] + private ?array $eventTypes; + + /** + * @var ?array $metadata Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). + */ + #[JsonProperty('metadata'), ArrayType([EventTypeMetadata::class])] + private ?array $metadata; + + /** + * @param array{ + * errors?: ?array, + * eventTypes?: ?array, + * metadata?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->eventTypes = $values['eventTypes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEventTypes(): ?array + { + return $this->eventTypes; + } + + /** + * @param ?array $value + */ + public function setEventTypes(?array $value = null): self + { + $this->eventTypes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListGiftCardActivitiesResponse.php b/src/Types/ListGiftCardActivitiesResponse.php new file mode 100644 index 00000000..617093e7 --- /dev/null +++ b/src/Types/ListGiftCardActivitiesResponse.php @@ -0,0 +1,111 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $giftCardActivities The requested gift card activities or an empty object if none are found. + */ + #[JsonProperty('gift_card_activities'), ArrayType([GiftCardActivity::class])] + private ?array $giftCardActivities; + + /** + * When a response is truncated, it includes a cursor that you can use in a + * subsequent request to retrieve the next set of activities. If a cursor is not present, this is + * the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * giftCardActivities?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCardActivities = $values['giftCardActivities'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getGiftCardActivities(): ?array + { + return $this->giftCardActivities; + } + + /** + * @param ?array $value + */ + public function setGiftCardActivities(?array $value = null): self + { + $this->giftCardActivities = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListGiftCardsResponse.php b/src/Types/ListGiftCardsResponse.php new file mode 100644 index 00000000..e1b25230 --- /dev/null +++ b/src/Types/ListGiftCardsResponse.php @@ -0,0 +1,111 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $giftCards The requested gift cards or an empty object if none are found. + */ + #[JsonProperty('gift_cards'), ArrayType([GiftCard::class])] + private ?array $giftCards; + + /** + * When a response is truncated, it includes a cursor that you can use in a + * subsequent request to retrieve the next set of gift cards. If a cursor is not present, this is + * the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * giftCards?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCards = $values['giftCards'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getGiftCards(): ?array + { + return $this->giftCards; + } + + /** + * @param ?array $value + */ + public function setGiftCards(?array $value = null): self + { + $this->giftCards = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListInvoicesResponse.php b/src/Types/ListInvoicesResponse.php new file mode 100644 index 00000000..9c3ba944 --- /dev/null +++ b/src/Types/ListInvoicesResponse.php @@ -0,0 +1,110 @@ + $invoices The invoices retrieved. + */ + #[JsonProperty('invoices'), ArrayType([Invoice::class])] + private ?array $invoices; + + /** + * When a response is truncated, it includes a cursor that you can use in a + * subsequent request to retrieve the next set of invoices. If empty, this is the final + * response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoices?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoices = $values['invoices'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getInvoices(): ?array + { + return $this->invoices; + } + + /** + * @param ?array $value + */ + public function setInvoices(?array $value = null): self + { + $this->invoices = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListJobsResponse.php b/src/Types/ListJobsResponse.php new file mode 100644 index 00000000..b47d8c0b --- /dev/null +++ b/src/Types/ListJobsResponse.php @@ -0,0 +1,110 @@ + $jobs The retrieved jobs. A single paged response contains up to 100 jobs. + */ + #[JsonProperty('jobs'), ArrayType([Job::class])] + private ?array $jobs; + + /** + * An opaque cursor used to retrieve the next page of results. This field is present only + * if the request succeeded and additional results are available. For more information, see + * [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * jobs?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->jobs = $values['jobs'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getJobs(): ?array + { + return $this->jobs; + } + + /** + * @param ?array $value + */ + public function setJobs(?array $value = null): self + { + $this->jobs = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLocationBookingProfilesResponse.php b/src/Types/ListLocationBookingProfilesResponse.php new file mode 100644 index 00000000..c2733883 --- /dev/null +++ b/src/Types/ListLocationBookingProfilesResponse.php @@ -0,0 +1,102 @@ + $locationBookingProfiles The list of a seller's location booking profiles. + */ + #[JsonProperty('location_booking_profiles'), ArrayType([LocationBookingProfile::class])] + private ?array $locationBookingProfiles; + + /** + * @var ?string $cursor The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * locationBookingProfiles?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationBookingProfiles = $values['locationBookingProfiles'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getLocationBookingProfiles(): ?array + { + return $this->locationBookingProfiles; + } + + /** + * @param ?array $value + */ + public function setLocationBookingProfiles(?array $value = null): self + { + $this->locationBookingProfiles = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLocationCustomAttributeDefinitionsResponse.php b/src/Types/ListLocationCustomAttributeDefinitionsResponse.php new file mode 100644 index 00000000..c6aef78f --- /dev/null +++ b/src/Types/ListLocationCustomAttributeDefinitionsResponse.php @@ -0,0 +1,114 @@ + $customAttributeDefinitions + */ + #[JsonProperty('custom_attribute_definitions'), ArrayType([CustomAttributeDefinition::class])] + private ?array $customAttributeDefinitions; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of + * results for your original request. This field is present only if the request succeeded and + * additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinitions?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinitions = $values['customAttributeDefinitions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributeDefinitions(): ?array + { + return $this->customAttributeDefinitions; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeDefinitions(?array $value = null): self + { + $this->customAttributeDefinitions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLocationCustomAttributesResponse.php b/src/Types/ListLocationCustomAttributesResponse.php new file mode 100644 index 00000000..3bbd7a67 --- /dev/null +++ b/src/Types/ListLocationCustomAttributesResponse.php @@ -0,0 +1,115 @@ + $customAttributes + */ + #[JsonProperty('custom_attributes'), ArrayType([CustomAttribute::class])] + private ?array $customAttributes; + + /** + * The cursor to use in your next call to this endpoint to retrieve the next page of results + * for your original request. This field is present only if the request succeeded and additional + * results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributes = $values['customAttributes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributes(): ?array + { + return $this->customAttributes; + } + + /** + * @param ?array $value + */ + public function setCustomAttributes(?array $value = null): self + { + $this->customAttributes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLocationsResponse.php b/src/Types/ListLocationsResponse.php new file mode 100644 index 00000000..3cf36bf9 --- /dev/null +++ b/src/Types/ListLocationsResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $locations The business locations. + */ + #[JsonProperty('locations'), ArrayType([Location::class])] + private ?array $locations; + + /** + * @param array{ + * errors?: ?array, + * locations?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->locations = $values['locations'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocations(): ?array + { + return $this->locations; + } + + /** + * @param ?array $value + */ + public function setLocations(?array $value = null): self + { + $this->locations = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLoyaltyProgramsResponse.php b/src/Types/ListLoyaltyProgramsResponse.php new file mode 100644 index 00000000..5c06a8a6 --- /dev/null +++ b/src/Types/ListLoyaltyProgramsResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $programs A list of `LoyaltyProgram` for the merchant. + */ + #[JsonProperty('programs'), ArrayType([LoyaltyProgram::class])] + private ?array $programs; + + /** + * @param array{ + * errors?: ?array, + * programs?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->programs = $values['programs'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPrograms(): ?array + { + return $this->programs; + } + + /** + * @param ?array $value + */ + public function setPrograms(?array $value = null): self + { + $this->programs = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListLoyaltyPromotionsResponse.php b/src/Types/ListLoyaltyPromotionsResponse.php new file mode 100644 index 00000000..6a6b374d --- /dev/null +++ b/src/Types/ListLoyaltyPromotionsResponse.php @@ -0,0 +1,111 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $loyaltyPromotions The retrieved loyalty promotions. + */ + #[JsonProperty('loyalty_promotions'), ArrayType([LoyaltyPromotion::class])] + private ?array $loyaltyPromotions; + + /** + * The cursor to use in your next call to this endpoint to retrieve the next page of results + * for your original request. This field is present only if the request succeeded and additional + * results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * loyaltyPromotions?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyPromotions = $values['loyaltyPromotions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLoyaltyPromotions(): ?array + { + return $this->loyaltyPromotions; + } + + /** + * @param ?array $value + */ + public function setLoyaltyPromotions(?array $value = null): self + { + $this->loyaltyPromotions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListMerchantCustomAttributeDefinitionsResponse.php b/src/Types/ListMerchantCustomAttributeDefinitionsResponse.php new file mode 100644 index 00000000..6e0faada --- /dev/null +++ b/src/Types/ListMerchantCustomAttributeDefinitionsResponse.php @@ -0,0 +1,114 @@ + $customAttributeDefinitions + */ + #[JsonProperty('custom_attribute_definitions'), ArrayType([CustomAttributeDefinition::class])] + private ?array $customAttributeDefinitions; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of + * results for your original request. This field is present only if the request succeeded and + * additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinitions?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinitions = $values['customAttributeDefinitions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributeDefinitions(): ?array + { + return $this->customAttributeDefinitions; + } + + /** + * @param ?array $value + */ + public function setCustomAttributeDefinitions(?array $value = null): self + { + $this->customAttributeDefinitions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListMerchantCustomAttributesResponse.php b/src/Types/ListMerchantCustomAttributesResponse.php new file mode 100644 index 00000000..9dafa736 --- /dev/null +++ b/src/Types/ListMerchantCustomAttributesResponse.php @@ -0,0 +1,115 @@ + $customAttributes + */ + #[JsonProperty('custom_attributes'), ArrayType([CustomAttribute::class])] + private ?array $customAttributes; + + /** + * The cursor to use in your next call to this endpoint to retrieve the next page of results + * for your original request. This field is present only if the request succeeded and additional + * results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributes = $values['customAttributes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributes(): ?array + { + return $this->customAttributes; + } + + /** + * @param ?array $value + */ + public function setCustomAttributes(?array $value = null): self + { + $this->customAttributes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListMerchantsResponse.php b/src/Types/ListMerchantsResponse.php new file mode 100644 index 00000000..9a124de8 --- /dev/null +++ b/src/Types/ListMerchantsResponse.php @@ -0,0 +1,105 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $merchant The requested `Merchant` entities. + */ + #[JsonProperty('merchant'), ArrayType([Merchant::class])] + private ?array $merchant; + + /** + * @var ?int $cursor If the response is truncated, the cursor to use in next request to fetch next set of objects. + */ + #[JsonProperty('cursor')] + private ?int $cursor; + + /** + * @param array{ + * errors?: ?array, + * merchant?: ?array, + * cursor?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->merchant = $values['merchant'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMerchant(): ?array + { + return $this->merchant; + } + + /** + * @param ?array $value + */ + public function setMerchant(?array $value = null): self + { + $this->merchant = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCursor(): ?int + { + return $this->cursor; + } + + /** + * @param ?int $value + */ + public function setCursor(?int $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListOrderCustomAttributeDefinitionsResponse.php b/src/Types/ListOrderCustomAttributeDefinitionsResponse.php new file mode 100644 index 00000000..3839e3ae --- /dev/null +++ b/src/Types/ListOrderCustomAttributeDefinitionsResponse.php @@ -0,0 +1,109 @@ + $customAttributeDefinitions The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`). + */ + #[JsonProperty('custom_attribute_definitions'), ArrayType([CustomAttributeDefinition::class])] + private array $customAttributeDefinitions; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. + * This field is present only if the request succeeded and additional results are available. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinitions: array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->customAttributeDefinitions = $values['customAttributeDefinitions']; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return array + */ + public function getCustomAttributeDefinitions(): array + { + return $this->customAttributeDefinitions; + } + + /** + * @param array $value + */ + public function setCustomAttributeDefinitions(array $value): self + { + $this->customAttributeDefinitions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListOrderCustomAttributesResponse.php b/src/Types/ListOrderCustomAttributesResponse.php new file mode 100644 index 00000000..5fe4e789 --- /dev/null +++ b/src/Types/ListOrderCustomAttributesResponse.php @@ -0,0 +1,109 @@ + $customAttributes The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`). + */ + #[JsonProperty('custom_attributes'), ArrayType([CustomAttribute::class])] + private ?array $customAttributes; + + /** + * The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. + * This field is present only if the request succeeded and additional results are available. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributes?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributes = $values['customAttributes'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomAttributes(): ?array + { + return $this->customAttributes; + } + + /** + * @param ?array $value + */ + public function setCustomAttributes(?array $value = null): self + { + $this->customAttributes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListPaymentLinksResponse.php b/src/Types/ListPaymentLinksResponse.php new file mode 100644 index 00000000..279d300f --- /dev/null +++ b/src/Types/ListPaymentLinksResponse.php @@ -0,0 +1,106 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $paymentLinks The list of payment links. + */ + #[JsonProperty('payment_links'), ArrayType([PaymentLink::class])] + private ?array $paymentLinks; + + /** + * When a response is truncated, it includes a cursor that you can use in a subsequent request + * to retrieve the next set of gift cards. If a cursor is not present, this is the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * paymentLinks?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->paymentLinks = $values['paymentLinks'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPaymentLinks(): ?array + { + return $this->paymentLinks; + } + + /** + * @param ?array $value + */ + public function setPaymentLinks(?array $value = null): self + { + $this->paymentLinks = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListPaymentRefundsRequestSortField.php b/src/Types/ListPaymentRefundsRequestSortField.php new file mode 100644 index 00000000..8d152087 --- /dev/null +++ b/src/Types/ListPaymentRefundsRequestSortField.php @@ -0,0 +1,9 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $refunds The list of requested refunds. + */ + #[JsonProperty('refunds'), ArrayType([PaymentRefund::class])] + private ?array $refunds; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * refunds?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refunds = $values['refunds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRefunds(): ?array + { + return $this->refunds; + } + + /** + * @param ?array $value + */ + public function setRefunds(?array $value = null): self + { + $this->refunds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListPaymentsRequestSortField.php b/src/Types/ListPaymentsRequestSortField.php new file mode 100644 index 00000000..9aeadfa4 --- /dev/null +++ b/src/Types/ListPaymentsRequestSortField.php @@ -0,0 +1,10 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $payments The requested list of payments. + */ + #[JsonProperty('payments'), ArrayType([Payment::class])] + private ?array $payments; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * payments?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payments = $values['payments'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPayments(): ?array + { + return $this->payments; + } + + /** + * @param ?array $value + */ + public function setPayments(?array $value = null): self + { + $this->payments = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListPayoutEntriesResponse.php b/src/Types/ListPayoutEntriesResponse.php new file mode 100644 index 00000000..67b34b06 --- /dev/null +++ b/src/Types/ListPayoutEntriesResponse.php @@ -0,0 +1,108 @@ + $payoutEntries The requested list of payout entries, ordered with the given or default sort order. + */ + #[JsonProperty('payout_entries'), ArrayType([PayoutEntry::class])] + private ?array $payoutEntries; + + /** + * The pagination cursor to be used in a subsequent request. If empty, this is the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * payoutEntries?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->payoutEntries = $values['payoutEntries'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getPayoutEntries(): ?array + { + return $this->payoutEntries; + } + + /** + * @param ?array $value + */ + public function setPayoutEntries(?array $value = null): self + { + $this->payoutEntries = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListPayoutsResponse.php b/src/Types/ListPayoutsResponse.php new file mode 100644 index 00000000..2169c36a --- /dev/null +++ b/src/Types/ListPayoutsResponse.php @@ -0,0 +1,108 @@ + $payouts The requested list of payouts. + */ + #[JsonProperty('payouts'), ArrayType([Payout::class])] + private ?array $payouts; + + /** + * The pagination cursor to be used in a subsequent request. If empty, this is the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * payouts?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->payouts = $values['payouts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getPayouts(): ?array + { + return $this->payouts; + } + + /** + * @param ?array $value + */ + public function setPayouts(?array $value = null): self + { + $this->payouts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListSitesResponse.php b/src/Types/ListSitesResponse.php new file mode 100644 index 00000000..38cf6d57 --- /dev/null +++ b/src/Types/ListSitesResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $sites The sites that belong to the seller. + */ + #[JsonProperty('sites'), ArrayType([Site::class])] + private ?array $sites; + + /** + * @param array{ + * errors?: ?array, + * sites?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->sites = $values['sites'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSites(): ?array + { + return $this->sites; + } + + /** + * @param ?array $value + */ + public function setSites(?array $value = null): self + { + $this->sites = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListSubscriptionEventsResponse.php b/src/Types/ListSubscriptionEventsResponse.php new file mode 100644 index 00000000..74ff2c78 --- /dev/null +++ b/src/Types/ListSubscriptionEventsResponse.php @@ -0,0 +1,112 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $subscriptionEvents The retrieved subscription events. + */ + #[JsonProperty('subscription_events'), ArrayType([SubscriptionEvent::class])] + private ?array $subscriptionEvents; + + /** + * When the total number of resulting subscription events exceeds the limit of a paged response, + * the response includes a cursor for you to use in a subsequent request to fetch the next set of events. + * If the cursor is unset, the response contains the last page of the results. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * subscriptionEvents?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscriptionEvents = $values['subscriptionEvents'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSubscriptionEvents(): ?array + { + return $this->subscriptionEvents; + } + + /** + * @param ?array $value + */ + public function setSubscriptionEvents(?array $value = null): self + { + $this->subscriptionEvents = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListTeamMemberBookingProfilesResponse.php b/src/Types/ListTeamMemberBookingProfilesResponse.php new file mode 100644 index 00000000..3376e020 --- /dev/null +++ b/src/Types/ListTeamMemberBookingProfilesResponse.php @@ -0,0 +1,106 @@ + $teamMemberBookingProfiles + */ + #[JsonProperty('team_member_booking_profiles'), ArrayType([TeamMemberBookingProfile::class])] + private ?array $teamMemberBookingProfiles; + + /** + * @var ?string $cursor The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMemberBookingProfiles?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberBookingProfiles = $values['teamMemberBookingProfiles'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMemberBookingProfiles(): ?array + { + return $this->teamMemberBookingProfiles; + } + + /** + * @param ?array $value + */ + public function setTeamMemberBookingProfiles(?array $value = null): self + { + $this->teamMemberBookingProfiles = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListTeamMemberWagesResponse.php b/src/Types/ListTeamMemberWagesResponse.php new file mode 100644 index 00000000..14d4f117 --- /dev/null +++ b/src/Types/ListTeamMemberWagesResponse.php @@ -0,0 +1,109 @@ + $teamMemberWages A page of `TeamMemberWage` results. + */ + #[JsonProperty('team_member_wages'), ArrayType([TeamMemberWage::class])] + private ?array $teamMemberWages; + + /** + * The value supplied in the subsequent request to fetch the next page + * of `TeamMemberWage` results. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMemberWages?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberWages = $values['teamMemberWages'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMemberWages(): ?array + { + return $this->teamMemberWages; + } + + /** + * @param ?array $value + */ + public function setTeamMemberWages(?array $value = null): self + { + $this->teamMemberWages = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListTransactionsResponse.php b/src/Types/ListTransactionsResponse.php new file mode 100644 index 00000000..ddd1e272 --- /dev/null +++ b/src/Types/ListTransactionsResponse.php @@ -0,0 +1,114 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $transactions An array of transactions that match your query. + */ + #[JsonProperty('transactions'), ArrayType([Transaction::class])] + private ?array $transactions; + + /** + * A pagination cursor for retrieving the next set of results, + * if any remain. Provide this value as the `cursor` parameter in a subsequent + * request to this endpoint. + * + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * transactions?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->transactions = $values['transactions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTransactions(): ?array + { + return $this->transactions; + } + + /** + * @param ?array $value + */ + public function setTransactions(?array $value = null): self + { + $this->transactions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListWebhookEventTypesResponse.php b/src/Types/ListWebhookEventTypesResponse.php new file mode 100644 index 00000000..f36fb94f --- /dev/null +++ b/src/Types/ListWebhookEventTypesResponse.php @@ -0,0 +1,109 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $eventTypes The list of event types. + */ + #[JsonProperty('event_types'), ArrayType(['string'])] + private ?array $eventTypes; + + /** + * @var ?array $metadata Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). + */ + #[JsonProperty('metadata'), ArrayType([EventTypeMetadata::class])] + private ?array $metadata; + + /** + * @param array{ + * errors?: ?array, + * eventTypes?: ?array, + * metadata?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->eventTypes = $values['eventTypes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEventTypes(): ?array + { + return $this->eventTypes; + } + + /** + * @param ?array $value + */ + public function setEventTypes(?array $value = null): self + { + $this->eventTypes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListWebhookSubscriptionsResponse.php b/src/Types/ListWebhookSubscriptionsResponse.php new file mode 100644 index 00000000..6cd4657e --- /dev/null +++ b/src/Types/ListWebhookSubscriptionsResponse.php @@ -0,0 +1,114 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $subscriptions The requested list of [Subscription](entity:WebhookSubscription)s. + */ + #[JsonProperty('subscriptions'), ArrayType([WebhookSubscription::class])] + private ?array $subscriptions; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * subscriptions?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscriptions = $values['subscriptions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSubscriptions(): ?array + { + return $this->subscriptions; + } + + /** + * @param ?array $value + */ + public function setSubscriptions(?array $value = null): self + { + $this->subscriptions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ListWorkweekConfigsResponse.php b/src/Types/ListWorkweekConfigsResponse.php new file mode 100644 index 00000000..02ba58a9 --- /dev/null +++ b/src/Types/ListWorkweekConfigsResponse.php @@ -0,0 +1,110 @@ + $workweekConfigs A page of `WorkweekConfig` results. + */ + #[JsonProperty('workweek_configs'), ArrayType([WorkweekConfig::class])] + private ?array $workweekConfigs; + + /** + * The value supplied in the subsequent request to fetch the next page of + * `WorkweekConfig` results. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * workweekConfigs?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->workweekConfigs = $values['workweekConfigs'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getWorkweekConfigs(): ?array + { + return $this->workweekConfigs; + } + + /** + * @param ?array $value + */ + public function setWorkweekConfigs(?array $value = null): self + { + $this->workweekConfigs = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Location.php b/src/Types/Location.php new file mode 100644 index 00000000..1f6598d0 --- /dev/null +++ b/src/Types/Location.php @@ -0,0 +1,751 @@ +> $capabilities + */ + #[JsonProperty('capabilities'), ArrayType(['string'])] + private ?array $capabilities; + + /** + * The status of the location. + * See [LocationStatus](#type-locationstatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * The time when the location was created, in RFC 3339 format. + * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + * + * @var ?string $createdAt + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $merchantId The ID of the merchant that owns the location. + */ + #[JsonProperty('merchant_id')] + private ?string $merchantId; + + /** + * The country of the location, in the two-letter format of ISO 3166. For example, `US` or `JP`. + * + * See [Country](entity:Country) for possible values. + * See [Country](#type-country) for possible values + * + * @var ?value-of $country + */ + #[JsonProperty('country')] + private ?string $country; + + /** + * The language associated with the location, in + * [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). + * For more information, see [Language Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences). + * + * @var ?string $languageCode + */ + #[JsonProperty('language_code')] + private ?string $languageCode; + + /** + * The currency used for all transactions at this location, + * in ISO 4217 format. For example, the currency code for US dollars is `USD`. + * See [Currency](entity:Currency) for possible values. + * See [Currency](#type-currency) for possible values + * + * @var ?value-of $currency + */ + #[JsonProperty('currency')] + private ?string $currency; + + /** + * @var ?string $phoneNumber The phone number of the location. For example, `+1 855-700-6000`. + */ + #[JsonProperty('phone_number')] + private ?string $phoneNumber; + + /** + * @var ?string $businessName The name of the location's overall business. This name is present on receipts and other customer-facing branding, and can be changed no more than three times in a twelve-month period. + */ + #[JsonProperty('business_name')] + private ?string $businessName; + + /** + * The type of the location. + * See [LocationType](#type-locationtype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?string $websiteUrl The website URL of the location. For example, `https://squareup.com`. + */ + #[JsonProperty('website_url')] + private ?string $websiteUrl; + + /** + * @var ?BusinessHours $businessHours The hours of operation for the location. + */ + #[JsonProperty('business_hours')] + private ?BusinessHours $businessHours; + + /** + * @var ?string $businessEmail The email address of the location. This can be unique to the location and is not always the email address for the business owner or administrator. + */ + #[JsonProperty('business_email')] + private ?string $businessEmail; + + /** + * @var ?string $description The description of the location. For example, `Main Street location`. + */ + #[JsonProperty('description')] + private ?string $description; + + /** + * @var ?string $twitterUsername The Twitter username of the location without the '@' symbol. For example, `Square`. + */ + #[JsonProperty('twitter_username')] + private ?string $twitterUsername; + + /** + * @var ?string $instagramUsername The Instagram username of the location without the '@' symbol. For example, `square`. + */ + #[JsonProperty('instagram_username')] + private ?string $instagramUsername; + + /** + * @var ?string $facebookUrl The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, `https://www.facebook.com/square`. + */ + #[JsonProperty('facebook_url')] + private ?string $facebookUrl; + + /** + * @var ?Coordinates $coordinates The physical coordinates (latitude and longitude) of the location. + */ + #[JsonProperty('coordinates')] + private ?Coordinates $coordinates; + + /** + * The URL of the logo image for the location. When configured in the Seller + * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller. + * This image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels. + * + * @var ?string $logoUrl + */ + #[JsonProperty('logo_url')] + private ?string $logoUrl; + + /** + * @var ?string $posBackgroundUrl The URL of the Point of Sale background image for the location. + */ + #[JsonProperty('pos_background_url')] + private ?string $posBackgroundUrl; + + /** + * A four-digit number that describes the kind of goods or services sold at the location. + * The [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) of the location as standardized by ISO 18245. + * For example, `5045`, for a location that sells computer goods and software. + * + * @var ?string $mcc + */ + #[JsonProperty('mcc')] + private ?string $mcc; + + /** + * The URL of a full-format logo image for the location. When configured in the Seller + * Dashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller. + * This image can be wider than it is tall and should be at least 1280x648 pixels. + * + * @var ?string $fullFormatLogoUrl + */ + #[JsonProperty('full_format_logo_url')] + private ?string $fullFormatLogoUrl; + + /** + * @var ?TaxIds $taxIds The tax IDs for this location. + */ + #[JsonProperty('tax_ids')] + private ?TaxIds $taxIds; + + /** + * @param array{ + * id?: ?string, + * name?: ?string, + * address?: ?Address, + * timezone?: ?string, + * capabilities?: ?array>, + * status?: ?value-of, + * createdAt?: ?string, + * merchantId?: ?string, + * country?: ?value-of, + * languageCode?: ?string, + * currency?: ?value-of, + * phoneNumber?: ?string, + * businessName?: ?string, + * type?: ?value-of, + * websiteUrl?: ?string, + * businessHours?: ?BusinessHours, + * businessEmail?: ?string, + * description?: ?string, + * twitterUsername?: ?string, + * instagramUsername?: ?string, + * facebookUrl?: ?string, + * coordinates?: ?Coordinates, + * logoUrl?: ?string, + * posBackgroundUrl?: ?string, + * mcc?: ?string, + * fullFormatLogoUrl?: ?string, + * taxIds?: ?TaxIds, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->name = $values['name'] ?? null; + $this->address = $values['address'] ?? null; + $this->timezone = $values['timezone'] ?? null; + $this->capabilities = $values['capabilities'] ?? null; + $this->status = $values['status'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->country = $values['country'] ?? null; + $this->languageCode = $values['languageCode'] ?? null; + $this->currency = $values['currency'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->businessName = $values['businessName'] ?? null; + $this->type = $values['type'] ?? null; + $this->websiteUrl = $values['websiteUrl'] ?? null; + $this->businessHours = $values['businessHours'] ?? null; + $this->businessEmail = $values['businessEmail'] ?? null; + $this->description = $values['description'] ?? null; + $this->twitterUsername = $values['twitterUsername'] ?? null; + $this->instagramUsername = $values['instagramUsername'] ?? null; + $this->facebookUrl = $values['facebookUrl'] ?? null; + $this->coordinates = $values['coordinates'] ?? null; + $this->logoUrl = $values['logoUrl'] ?? null; + $this->posBackgroundUrl = $values['posBackgroundUrl'] ?? null; + $this->mcc = $values['mcc'] ?? null; + $this->fullFormatLogoUrl = $values['fullFormatLogoUrl'] ?? null; + $this->taxIds = $values['taxIds'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTimezone(): ?string + { + return $this->timezone; + } + + /** + * @param ?string $value + */ + public function setTimezone(?string $value = null): self + { + $this->timezone = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getCapabilities(): ?array + { + return $this->capabilities; + } + + /** + * @param ?array> $value + */ + public function setCapabilities(?array $value = null): self + { + $this->capabilities = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCountry(): ?string + { + return $this->country; + } + + /** + * @param ?value-of $value + */ + public function setCountry(?string $value = null): self + { + $this->country = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLanguageCode(): ?string + { + return $this->languageCode; + } + + /** + * @param ?string $value + */ + public function setLanguageCode(?string $value = null): self + { + $this->languageCode = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCurrency(): ?string + { + return $this->currency; + } + + /** + * @param ?value-of $value + */ + public function setCurrency(?string $value = null): self + { + $this->currency = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBusinessName(): ?string + { + return $this->businessName; + } + + /** + * @param ?string $value + */ + public function setBusinessName(?string $value = null): self + { + $this->businessName = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getWebsiteUrl(): ?string + { + return $this->websiteUrl; + } + + /** + * @param ?string $value + */ + public function setWebsiteUrl(?string $value = null): self + { + $this->websiteUrl = $value; + return $this; + } + + /** + * @return ?BusinessHours + */ + public function getBusinessHours(): ?BusinessHours + { + return $this->businessHours; + } + + /** + * @param ?BusinessHours $value + */ + public function setBusinessHours(?BusinessHours $value = null): self + { + $this->businessHours = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBusinessEmail(): ?string + { + return $this->businessEmail; + } + + /** + * @param ?string $value + */ + public function setBusinessEmail(?string $value = null): self + { + $this->businessEmail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTwitterUsername(): ?string + { + return $this->twitterUsername; + } + + /** + * @param ?string $value + */ + public function setTwitterUsername(?string $value = null): self + { + $this->twitterUsername = $value; + return $this; + } + + /** + * @return ?string + */ + public function getInstagramUsername(): ?string + { + return $this->instagramUsername; + } + + /** + * @param ?string $value + */ + public function setInstagramUsername(?string $value = null): self + { + $this->instagramUsername = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFacebookUrl(): ?string + { + return $this->facebookUrl; + } + + /** + * @param ?string $value + */ + public function setFacebookUrl(?string $value = null): self + { + $this->facebookUrl = $value; + return $this; + } + + /** + * @return ?Coordinates + */ + public function getCoordinates(): ?Coordinates + { + return $this->coordinates; + } + + /** + * @param ?Coordinates $value + */ + public function setCoordinates(?Coordinates $value = null): self + { + $this->coordinates = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLogoUrl(): ?string + { + return $this->logoUrl; + } + + /** + * @param ?string $value + */ + public function setLogoUrl(?string $value = null): self + { + $this->logoUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPosBackgroundUrl(): ?string + { + return $this->posBackgroundUrl; + } + + /** + * @param ?string $value + */ + public function setPosBackgroundUrl(?string $value = null): self + { + $this->posBackgroundUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMcc(): ?string + { + return $this->mcc; + } + + /** + * @param ?string $value + */ + public function setMcc(?string $value = null): self + { + $this->mcc = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFullFormatLogoUrl(): ?string + { + return $this->fullFormatLogoUrl; + } + + /** + * @param ?string $value + */ + public function setFullFormatLogoUrl(?string $value = null): self + { + $this->fullFormatLogoUrl = $value; + return $this; + } + + /** + * @return ?TaxIds + */ + public function getTaxIds(): ?TaxIds + { + return $this->taxIds; + } + + /** + * @param ?TaxIds $value + */ + public function setTaxIds(?TaxIds $value = null): self + { + $this->taxIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LocationBookingProfile.php b/src/Types/LocationBookingProfile.php new file mode 100644 index 00000000..21b07496 --- /dev/null +++ b/src/Types/LocationBookingProfile.php @@ -0,0 +1,104 @@ +locationId = $values['locationId'] ?? null; + $this->bookingSiteUrl = $values['bookingSiteUrl'] ?? null; + $this->onlineBookingEnabled = $values['onlineBookingEnabled'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBookingSiteUrl(): ?string + { + return $this->bookingSiteUrl; + } + + /** + * @param ?string $value + */ + public function setBookingSiteUrl(?string $value = null): self + { + $this->bookingSiteUrl = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getOnlineBookingEnabled(): ?bool + { + return $this->onlineBookingEnabled; + } + + /** + * @param ?bool $value + */ + public function setOnlineBookingEnabled(?bool $value = null): self + { + $this->onlineBookingEnabled = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LocationCapability.php b/src/Types/LocationCapability.php new file mode 100644 index 00000000..ed9376d2 --- /dev/null +++ b/src/Types/LocationCapability.php @@ -0,0 +1,10 @@ + $expiringPointDeadlines + */ + #[JsonProperty('expiring_point_deadlines'), ArrayType([LoyaltyAccountExpiringPointDeadline::class])] + private ?array $expiringPointDeadlines; + + /** + * @param array{ + * programId: string, + * id?: ?string, + * balance?: ?int, + * lifetimePoints?: ?int, + * customerId?: ?string, + * enrolledAt?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * mapping?: ?LoyaltyAccountMapping, + * expiringPointDeadlines?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->programId = $values['programId']; + $this->balance = $values['balance'] ?? null; + $this->lifetimePoints = $values['lifetimePoints'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->enrolledAt = $values['enrolledAt'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->mapping = $values['mapping'] ?? null; + $this->expiringPointDeadlines = $values['expiringPointDeadlines'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getProgramId(): string + { + return $this->programId; + } + + /** + * @param string $value + */ + public function setProgramId(string $value): self + { + $this->programId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getBalance(): ?int + { + return $this->balance; + } + + /** + * @param ?int $value + */ + public function setBalance(?int $value = null): self + { + $this->balance = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLifetimePoints(): ?int + { + return $this->lifetimePoints; + } + + /** + * @param ?int $value + */ + public function setLifetimePoints(?int $value = null): self + { + $this->lifetimePoints = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEnrolledAt(): ?string + { + return $this->enrolledAt; + } + + /** + * @param ?string $value + */ + public function setEnrolledAt(?string $value = null): self + { + $this->enrolledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?LoyaltyAccountMapping + */ + public function getMapping(): ?LoyaltyAccountMapping + { + return $this->mapping; + } + + /** + * @param ?LoyaltyAccountMapping $value + */ + public function setMapping(?LoyaltyAccountMapping $value = null): self + { + $this->mapping = $value; + return $this; + } + + /** + * @return ?array + */ + public function getExpiringPointDeadlines(): ?array + { + return $this->expiringPointDeadlines; + } + + /** + * @param ?array $value + */ + public function setExpiringPointDeadlines(?array $value = null): self + { + $this->expiringPointDeadlines = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyAccountExpiringPointDeadline.php b/src/Types/LoyaltyAccountExpiringPointDeadline.php new file mode 100644 index 00000000..e8f44d61 --- /dev/null +++ b/src/Types/LoyaltyAccountExpiringPointDeadline.php @@ -0,0 +1,79 @@ +points = $values['points']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function getExpiresAt(): string + { + return $this->expiresAt; + } + + /** + * @param string $value + */ + public function setExpiresAt(string $value): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyAccountMapping.php b/src/Types/LoyaltyAccountMapping.php new file mode 100644 index 00000000..c605d2f1 --- /dev/null +++ b/src/Types/LoyaltyAccountMapping.php @@ -0,0 +1,107 @@ +id = $values['id'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEvent.php b/src/Types/LoyaltyEvent.php new file mode 100644 index 00000000..90cd65bd --- /dev/null +++ b/src/Types/LoyaltyEvent.php @@ -0,0 +1,386 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * @var string $createdAt The timestamp when the event was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private string $createdAt; + + /** + * @var ?LoyaltyEventAccumulatePoints $accumulatePoints Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + */ + #[JsonProperty('accumulate_points')] + private ?LoyaltyEventAccumulatePoints $accumulatePoints; + + /** + * @var ?LoyaltyEventCreateReward $createReward Provides metadata when the event `type` is `CREATE_REWARD`. + */ + #[JsonProperty('create_reward')] + private ?LoyaltyEventCreateReward $createReward; + + /** + * @var ?LoyaltyEventRedeemReward $redeemReward Provides metadata when the event `type` is `REDEEM_REWARD`. + */ + #[JsonProperty('redeem_reward')] + private ?LoyaltyEventRedeemReward $redeemReward; + + /** + * @var ?LoyaltyEventDeleteReward $deleteReward Provides metadata when the event `type` is `DELETE_REWARD`. + */ + #[JsonProperty('delete_reward')] + private ?LoyaltyEventDeleteReward $deleteReward; + + /** + * @var ?LoyaltyEventAdjustPoints $adjustPoints Provides metadata when the event `type` is `ADJUST_POINTS`. + */ + #[JsonProperty('adjust_points')] + private ?LoyaltyEventAdjustPoints $adjustPoints; + + /** + * @var string $loyaltyAccountId The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event. + */ + #[JsonProperty('loyalty_account_id')] + private string $loyaltyAccountId; + + /** + * @var ?string $locationId The ID of the [location](entity:Location) where the event occurred. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * Defines whether the event was generated by the Square Point of Sale. + * See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values + * + * @var value-of $source + */ + #[JsonProperty('source')] + private string $source; + + /** + * @var ?LoyaltyEventExpirePoints $expirePoints Provides metadata when the event `type` is `EXPIRE_POINTS`. + */ + #[JsonProperty('expire_points')] + private ?LoyaltyEventExpirePoints $expirePoints; + + /** + * @var ?LoyaltyEventOther $otherEvent Provides metadata when the event `type` is `OTHER`. + */ + #[JsonProperty('other_event')] + private ?LoyaltyEventOther $otherEvent; + + /** + * @var ?LoyaltyEventAccumulatePromotionPoints $accumulatePromotionPoints Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. + */ + #[JsonProperty('accumulate_promotion_points')] + private ?LoyaltyEventAccumulatePromotionPoints $accumulatePromotionPoints; + + /** + * @param array{ + * id: string, + * type: value-of, + * createdAt: string, + * loyaltyAccountId: string, + * source: value-of, + * accumulatePoints?: ?LoyaltyEventAccumulatePoints, + * createReward?: ?LoyaltyEventCreateReward, + * redeemReward?: ?LoyaltyEventRedeemReward, + * deleteReward?: ?LoyaltyEventDeleteReward, + * adjustPoints?: ?LoyaltyEventAdjustPoints, + * locationId?: ?string, + * expirePoints?: ?LoyaltyEventExpirePoints, + * otherEvent?: ?LoyaltyEventOther, + * accumulatePromotionPoints?: ?LoyaltyEventAccumulatePromotionPoints, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->type = $values['type']; + $this->createdAt = $values['createdAt']; + $this->accumulatePoints = $values['accumulatePoints'] ?? null; + $this->createReward = $values['createReward'] ?? null; + $this->redeemReward = $values['redeemReward'] ?? null; + $this->deleteReward = $values['deleteReward'] ?? null; + $this->adjustPoints = $values['adjustPoints'] ?? null; + $this->loyaltyAccountId = $values['loyaltyAccountId']; + $this->locationId = $values['locationId'] ?? null; + $this->source = $values['source']; + $this->expirePoints = $values['expirePoints'] ?? null; + $this->otherEvent = $values['otherEvent'] ?? null; + $this->accumulatePromotionPoints = $values['accumulatePromotionPoints'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function getCreatedAt(): string + { + return $this->createdAt; + } + + /** + * @param string $value + */ + public function setCreatedAt(string $value): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?LoyaltyEventAccumulatePoints + */ + public function getAccumulatePoints(): ?LoyaltyEventAccumulatePoints + { + return $this->accumulatePoints; + } + + /** + * @param ?LoyaltyEventAccumulatePoints $value + */ + public function setAccumulatePoints(?LoyaltyEventAccumulatePoints $value = null): self + { + $this->accumulatePoints = $value; + return $this; + } + + /** + * @return ?LoyaltyEventCreateReward + */ + public function getCreateReward(): ?LoyaltyEventCreateReward + { + return $this->createReward; + } + + /** + * @param ?LoyaltyEventCreateReward $value + */ + public function setCreateReward(?LoyaltyEventCreateReward $value = null): self + { + $this->createReward = $value; + return $this; + } + + /** + * @return ?LoyaltyEventRedeemReward + */ + public function getRedeemReward(): ?LoyaltyEventRedeemReward + { + return $this->redeemReward; + } + + /** + * @param ?LoyaltyEventRedeemReward $value + */ + public function setRedeemReward(?LoyaltyEventRedeemReward $value = null): self + { + $this->redeemReward = $value; + return $this; + } + + /** + * @return ?LoyaltyEventDeleteReward + */ + public function getDeleteReward(): ?LoyaltyEventDeleteReward + { + return $this->deleteReward; + } + + /** + * @param ?LoyaltyEventDeleteReward $value + */ + public function setDeleteReward(?LoyaltyEventDeleteReward $value = null): self + { + $this->deleteReward = $value; + return $this; + } + + /** + * @return ?LoyaltyEventAdjustPoints + */ + public function getAdjustPoints(): ?LoyaltyEventAdjustPoints + { + return $this->adjustPoints; + } + + /** + * @param ?LoyaltyEventAdjustPoints $value + */ + public function setAdjustPoints(?LoyaltyEventAdjustPoints $value = null): self + { + $this->adjustPoints = $value; + return $this; + } + + /** + * @return string + */ + public function getLoyaltyAccountId(): string + { + return $this->loyaltyAccountId; + } + + /** + * @param string $value + */ + public function setLoyaltyAccountId(string $value): self + { + $this->loyaltyAccountId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return value-of + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param value-of $value + */ + public function setSource(string $value): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?LoyaltyEventExpirePoints + */ + public function getExpirePoints(): ?LoyaltyEventExpirePoints + { + return $this->expirePoints; + } + + /** + * @param ?LoyaltyEventExpirePoints $value + */ + public function setExpirePoints(?LoyaltyEventExpirePoints $value = null): self + { + $this->expirePoints = $value; + return $this; + } + + /** + * @return ?LoyaltyEventOther + */ + public function getOtherEvent(): ?LoyaltyEventOther + { + return $this->otherEvent; + } + + /** + * @param ?LoyaltyEventOther $value + */ + public function setOtherEvent(?LoyaltyEventOther $value = null): self + { + $this->otherEvent = $value; + return $this; + } + + /** + * @return ?LoyaltyEventAccumulatePromotionPoints + */ + public function getAccumulatePromotionPoints(): ?LoyaltyEventAccumulatePromotionPoints + { + return $this->accumulatePromotionPoints; + } + + /** + * @param ?LoyaltyEventAccumulatePromotionPoints $value + */ + public function setAccumulatePromotionPoints(?LoyaltyEventAccumulatePromotionPoints $value = null): self + { + $this->accumulatePromotionPoints = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventAccumulatePoints.php b/src/Types/LoyaltyEventAccumulatePoints.php new file mode 100644 index 00000000..0d8be23c --- /dev/null +++ b/src/Types/LoyaltyEventAccumulatePoints.php @@ -0,0 +1,107 @@ +loyaltyProgramId = $values['loyaltyProgramId'] ?? null; + $this->points = $values['points'] ?? null; + $this->orderId = $values['orderId'] ?? null; + } + + /** + * @return ?string + */ + public function getLoyaltyProgramId(): ?string + { + return $this->loyaltyProgramId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyProgramId(?string $value = null): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPoints(): ?int + { + return $this->points; + } + + /** + * @param ?int $value + */ + public function setPoints(?int $value = null): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventAccumulatePromotionPoints.php b/src/Types/LoyaltyEventAccumulatePromotionPoints.php new file mode 100644 index 00000000..8f7c4b2f --- /dev/null +++ b/src/Types/LoyaltyEventAccumulatePromotionPoints.php @@ -0,0 +1,132 @@ +loyaltyProgramId = $values['loyaltyProgramId'] ?? null; + $this->loyaltyPromotionId = $values['loyaltyPromotionId'] ?? null; + $this->points = $values['points']; + $this->orderId = $values['orderId']; + } + + /** + * @return ?string + */ + public function getLoyaltyProgramId(): ?string + { + return $this->loyaltyProgramId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyProgramId(?string $value = null): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLoyaltyPromotionId(): ?string + { + return $this->loyaltyPromotionId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyPromotionId(?string $value = null): self + { + $this->loyaltyPromotionId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventAdjustPoints.php b/src/Types/LoyaltyEventAdjustPoints.php new file mode 100644 index 00000000..d1b0fd63 --- /dev/null +++ b/src/Types/LoyaltyEventAdjustPoints.php @@ -0,0 +1,104 @@ +loyaltyProgramId = $values['loyaltyProgramId'] ?? null; + $this->points = $values['points']; + $this->reason = $values['reason'] ?? null; + } + + /** + * @return ?string + */ + public function getLoyaltyProgramId(): ?string + { + return $this->loyaltyProgramId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyProgramId(?string $value = null): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReason(): ?string + { + return $this->reason; + } + + /** + * @param ?string $value + */ + public function setReason(?string $value = null): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventCreateReward.php b/src/Types/LoyaltyEventCreateReward.php new file mode 100644 index 00000000..19ed692c --- /dev/null +++ b/src/Types/LoyaltyEventCreateReward.php @@ -0,0 +1,107 @@ +loyaltyProgramId = $values['loyaltyProgramId']; + $this->rewardId = $values['rewardId'] ?? null; + $this->points = $values['points']; + } + + /** + * @return string + */ + public function getLoyaltyProgramId(): string + { + return $this->loyaltyProgramId; + } + + /** + * @param string $value + */ + public function setLoyaltyProgramId(string $value): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRewardId(): ?string + { + return $this->rewardId; + } + + /** + * @param ?string $value + */ + public function setRewardId(?string $value = null): self + { + $this->rewardId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventDateTimeFilter.php b/src/Types/LoyaltyEventDateTimeFilter.php new file mode 100644 index 00000000..5bd6fb61 --- /dev/null +++ b/src/Types/LoyaltyEventDateTimeFilter.php @@ -0,0 +1,54 @@ +createdAt = $values['createdAt']; + } + + /** + * @return TimeRange + */ + public function getCreatedAt(): TimeRange + { + return $this->createdAt; + } + + /** + * @param TimeRange $value + */ + public function setCreatedAt(TimeRange $value): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventDeleteReward.php b/src/Types/LoyaltyEventDeleteReward.php new file mode 100644 index 00000000..97a00361 --- /dev/null +++ b/src/Types/LoyaltyEventDeleteReward.php @@ -0,0 +1,107 @@ +loyaltyProgramId = $values['loyaltyProgramId']; + $this->rewardId = $values['rewardId'] ?? null; + $this->points = $values['points']; + } + + /** + * @return string + */ + public function getLoyaltyProgramId(): string + { + return $this->loyaltyProgramId; + } + + /** + * @param string $value + */ + public function setLoyaltyProgramId(string $value): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRewardId(): ?string + { + return $this->rewardId; + } + + /** + * @param ?string $value + */ + public function setRewardId(?string $value = null): self + { + $this->rewardId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventExpirePoints.php b/src/Types/LoyaltyEventExpirePoints.php new file mode 100644 index 00000000..684efad6 --- /dev/null +++ b/src/Types/LoyaltyEventExpirePoints.php @@ -0,0 +1,79 @@ +loyaltyProgramId = $values['loyaltyProgramId']; + $this->points = $values['points']; + } + + /** + * @return string + */ + public function getLoyaltyProgramId(): string + { + return $this->loyaltyProgramId; + } + + /** + * @param string $value + */ + public function setLoyaltyProgramId(string $value): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventFilter.php b/src/Types/LoyaltyEventFilter.php new file mode 100644 index 00000000..1404577e --- /dev/null +++ b/src/Types/LoyaltyEventFilter.php @@ -0,0 +1,159 @@ +loyaltyAccountFilter = $values['loyaltyAccountFilter'] ?? null; + $this->typeFilter = $values['typeFilter'] ?? null; + $this->dateTimeFilter = $values['dateTimeFilter'] ?? null; + $this->locationFilter = $values['locationFilter'] ?? null; + $this->orderFilter = $values['orderFilter'] ?? null; + } + + /** + * @return ?LoyaltyEventLoyaltyAccountFilter + */ + public function getLoyaltyAccountFilter(): ?LoyaltyEventLoyaltyAccountFilter + { + return $this->loyaltyAccountFilter; + } + + /** + * @param ?LoyaltyEventLoyaltyAccountFilter $value + */ + public function setLoyaltyAccountFilter(?LoyaltyEventLoyaltyAccountFilter $value = null): self + { + $this->loyaltyAccountFilter = $value; + return $this; + } + + /** + * @return ?LoyaltyEventTypeFilter + */ + public function getTypeFilter(): ?LoyaltyEventTypeFilter + { + return $this->typeFilter; + } + + /** + * @param ?LoyaltyEventTypeFilter $value + */ + public function setTypeFilter(?LoyaltyEventTypeFilter $value = null): self + { + $this->typeFilter = $value; + return $this; + } + + /** + * @return ?LoyaltyEventDateTimeFilter + */ + public function getDateTimeFilter(): ?LoyaltyEventDateTimeFilter + { + return $this->dateTimeFilter; + } + + /** + * @param ?LoyaltyEventDateTimeFilter $value + */ + public function setDateTimeFilter(?LoyaltyEventDateTimeFilter $value = null): self + { + $this->dateTimeFilter = $value; + return $this; + } + + /** + * @return ?LoyaltyEventLocationFilter + */ + public function getLocationFilter(): ?LoyaltyEventLocationFilter + { + return $this->locationFilter; + } + + /** + * @param ?LoyaltyEventLocationFilter $value + */ + public function setLocationFilter(?LoyaltyEventLocationFilter $value = null): self + { + $this->locationFilter = $value; + return $this; + } + + /** + * @return ?LoyaltyEventOrderFilter + */ + public function getOrderFilter(): ?LoyaltyEventOrderFilter + { + return $this->orderFilter; + } + + /** + * @param ?LoyaltyEventOrderFilter $value + */ + public function setOrderFilter(?LoyaltyEventOrderFilter $value = null): self + { + $this->orderFilter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventLocationFilter.php b/src/Types/LoyaltyEventLocationFilter.php new file mode 100644 index 00000000..65fb076d --- /dev/null +++ b/src/Types/LoyaltyEventLocationFilter.php @@ -0,0 +1,59 @@ + $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private array $locationIds; + + /** + * @param array{ + * locationIds: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationIds = $values['locationIds']; + } + + /** + * @return array + */ + public function getLocationIds(): array + { + return $this->locationIds; + } + + /** + * @param array $value + */ + public function setLocationIds(array $value): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventLoyaltyAccountFilter.php b/src/Types/LoyaltyEventLoyaltyAccountFilter.php new file mode 100644 index 00000000..b20e7668 --- /dev/null +++ b/src/Types/LoyaltyEventLoyaltyAccountFilter.php @@ -0,0 +1,54 @@ +loyaltyAccountId = $values['loyaltyAccountId']; + } + + /** + * @return string + */ + public function getLoyaltyAccountId(): string + { + return $this->loyaltyAccountId; + } + + /** + * @param string $value + */ + public function setLoyaltyAccountId(string $value): self + { + $this->loyaltyAccountId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventOrderFilter.php b/src/Types/LoyaltyEventOrderFilter.php new file mode 100644 index 00000000..5d7ea4c3 --- /dev/null +++ b/src/Types/LoyaltyEventOrderFilter.php @@ -0,0 +1,54 @@ +orderId = $values['orderId']; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventOther.php b/src/Types/LoyaltyEventOther.php new file mode 100644 index 00000000..98b163f8 --- /dev/null +++ b/src/Types/LoyaltyEventOther.php @@ -0,0 +1,79 @@ +loyaltyProgramId = $values['loyaltyProgramId']; + $this->points = $values['points']; + } + + /** + * @return string + */ + public function getLoyaltyProgramId(): string + { + return $this->loyaltyProgramId; + } + + /** + * @param string $value + */ + public function setLoyaltyProgramId(string $value): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventQuery.php b/src/Types/LoyaltyEventQuery.php new file mode 100644 index 00000000..52b90a2e --- /dev/null +++ b/src/Types/LoyaltyEventQuery.php @@ -0,0 +1,54 @@ +filter = $values['filter'] ?? null; + } + + /** + * @return ?LoyaltyEventFilter + */ + public function getFilter(): ?LoyaltyEventFilter + { + return $this->filter; + } + + /** + * @param ?LoyaltyEventFilter $value + */ + public function setFilter(?LoyaltyEventFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventRedeemReward.php b/src/Types/LoyaltyEventRedeemReward.php new file mode 100644 index 00000000..9b50f26d --- /dev/null +++ b/src/Types/LoyaltyEventRedeemReward.php @@ -0,0 +1,110 @@ +loyaltyProgramId = $values['loyaltyProgramId']; + $this->rewardId = $values['rewardId'] ?? null; + $this->orderId = $values['orderId'] ?? null; + } + + /** + * @return string + */ + public function getLoyaltyProgramId(): string + { + return $this->loyaltyProgramId; + } + + /** + * @param string $value + */ + public function setLoyaltyProgramId(string $value): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRewardId(): ?string + { + return $this->rewardId; + } + + /** + * @param ?string $value + */ + public function setRewardId(?string $value = null): self + { + $this->rewardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyEventSource.php b/src/Types/LoyaltyEventSource.php new file mode 100644 index 00000000..5c8dc63d --- /dev/null +++ b/src/Types/LoyaltyEventSource.php @@ -0,0 +1,9 @@ +> $types + */ + #[JsonProperty('types'), ArrayType(['string'])] + private array $types; + + /** + * @param array{ + * types: array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->types = $values['types']; + } + + /** + * @return array> + */ + public function getTypes(): array + { + return $this->types; + } + + /** + * @param array> $value + */ + public function setTypes(array $value): self + { + $this->types = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgram.php b/src/Types/LoyaltyProgram.php new file mode 100644 index 00000000..0884280c --- /dev/null +++ b/src/Types/LoyaltyProgram.php @@ -0,0 +1,267 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?array $rewardTiers The list of rewards for buyers, sorted by ascending points. + */ + #[JsonProperty('reward_tiers'), ArrayType([LoyaltyProgramRewardTier::class])] + private ?array $rewardTiers; + + /** + * @var ?LoyaltyProgramExpirationPolicy $expirationPolicy If present, details for how points expire. + */ + #[JsonProperty('expiration_policy')] + private ?LoyaltyProgramExpirationPolicy $expirationPolicy; + + /** + * @var ?LoyaltyProgramTerminology $terminology A cosmetic name for the “points” currency. + */ + #[JsonProperty('terminology')] + private ?LoyaltyProgramTerminology $terminology; + + /** + * @var ?array $locationIds The [locations](entity:Location) at which the program is active. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * @var ?string $createdAt The timestamp when the program was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the reward was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * Defines how buyers can earn loyalty points from the base loyalty program. + * To check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable + * buyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions). + * + * @var ?array $accrualRules + */ + #[JsonProperty('accrual_rules'), ArrayType([LoyaltyProgramAccrualRule::class])] + private ?array $accrualRules; + + /** + * @param array{ + * id?: ?string, + * status?: ?value-of, + * rewardTiers?: ?array, + * expirationPolicy?: ?LoyaltyProgramExpirationPolicy, + * terminology?: ?LoyaltyProgramTerminology, + * locationIds?: ?array, + * createdAt?: ?string, + * updatedAt?: ?string, + * accrualRules?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->status = $values['status'] ?? null; + $this->rewardTiers = $values['rewardTiers'] ?? null; + $this->expirationPolicy = $values['expirationPolicy'] ?? null; + $this->terminology = $values['terminology'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->accrualRules = $values['accrualRules'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRewardTiers(): ?array + { + return $this->rewardTiers; + } + + /** + * @param ?array $value + */ + public function setRewardTiers(?array $value = null): self + { + $this->rewardTiers = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramExpirationPolicy + */ + public function getExpirationPolicy(): ?LoyaltyProgramExpirationPolicy + { + return $this->expirationPolicy; + } + + /** + * @param ?LoyaltyProgramExpirationPolicy $value + */ + public function setExpirationPolicy(?LoyaltyProgramExpirationPolicy $value = null): self + { + $this->expirationPolicy = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramTerminology + */ + public function getTerminology(): ?LoyaltyProgramTerminology + { + return $this->terminology; + } + + /** + * @param ?LoyaltyProgramTerminology $value + */ + public function setTerminology(?LoyaltyProgramTerminology $value = null): self + { + $this->terminology = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAccrualRules(): ?array + { + return $this->accrualRules; + } + + /** + * @param ?array $value + */ + public function setAccrualRules(?array $value = null): self + { + $this->accrualRules = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramAccrualRule.php b/src/Types/LoyaltyProgramAccrualRule.php new file mode 100644 index 00000000..19ea51cf --- /dev/null +++ b/src/Types/LoyaltyProgramAccrualRule.php @@ -0,0 +1,185 @@ + $accrualType + */ + #[JsonProperty('accrual_type')] + private string $accrualType; + + /** + * The number of points that + * buyers earn based on the `accrual_type`. + * + * @var ?int $points + */ + #[JsonProperty('points')] + private ?int $points; + + /** + * @var ?LoyaltyProgramAccrualRuleVisitData $visitData Additional data for rules with the `VISIT` accrual type. + */ + #[JsonProperty('visit_data')] + private ?LoyaltyProgramAccrualRuleVisitData $visitData; + + /** + * @var ?LoyaltyProgramAccrualRuleSpendData $spendData Additional data for rules with the `SPEND` accrual type. + */ + #[JsonProperty('spend_data')] + private ?LoyaltyProgramAccrualRuleSpendData $spendData; + + /** + * @var ?LoyaltyProgramAccrualRuleItemVariationData $itemVariationData Additional data for rules with the `ITEM_VARIATION` accrual type. + */ + #[JsonProperty('item_variation_data')] + private ?LoyaltyProgramAccrualRuleItemVariationData $itemVariationData; + + /** + * @var ?LoyaltyProgramAccrualRuleCategoryData $categoryData Additional data for rules with the `CATEGORY` accrual type. + */ + #[JsonProperty('category_data')] + private ?LoyaltyProgramAccrualRuleCategoryData $categoryData; + + /** + * @param array{ + * accrualType: value-of, + * points?: ?int, + * visitData?: ?LoyaltyProgramAccrualRuleVisitData, + * spendData?: ?LoyaltyProgramAccrualRuleSpendData, + * itemVariationData?: ?LoyaltyProgramAccrualRuleItemVariationData, + * categoryData?: ?LoyaltyProgramAccrualRuleCategoryData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->accrualType = $values['accrualType']; + $this->points = $values['points'] ?? null; + $this->visitData = $values['visitData'] ?? null; + $this->spendData = $values['spendData'] ?? null; + $this->itemVariationData = $values['itemVariationData'] ?? null; + $this->categoryData = $values['categoryData'] ?? null; + } + + /** + * @return value-of + */ + public function getAccrualType(): string + { + return $this->accrualType; + } + + /** + * @param value-of $value + */ + public function setAccrualType(string $value): self + { + $this->accrualType = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPoints(): ?int + { + return $this->points; + } + + /** + * @param ?int $value + */ + public function setPoints(?int $value = null): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramAccrualRuleVisitData + */ + public function getVisitData(): ?LoyaltyProgramAccrualRuleVisitData + { + return $this->visitData; + } + + /** + * @param ?LoyaltyProgramAccrualRuleVisitData $value + */ + public function setVisitData(?LoyaltyProgramAccrualRuleVisitData $value = null): self + { + $this->visitData = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramAccrualRuleSpendData + */ + public function getSpendData(): ?LoyaltyProgramAccrualRuleSpendData + { + return $this->spendData; + } + + /** + * @param ?LoyaltyProgramAccrualRuleSpendData $value + */ + public function setSpendData(?LoyaltyProgramAccrualRuleSpendData $value = null): self + { + $this->spendData = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramAccrualRuleItemVariationData + */ + public function getItemVariationData(): ?LoyaltyProgramAccrualRuleItemVariationData + { + return $this->itemVariationData; + } + + /** + * @param ?LoyaltyProgramAccrualRuleItemVariationData $value + */ + public function setItemVariationData(?LoyaltyProgramAccrualRuleItemVariationData $value = null): self + { + $this->itemVariationData = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramAccrualRuleCategoryData + */ + public function getCategoryData(): ?LoyaltyProgramAccrualRuleCategoryData + { + return $this->categoryData; + } + + /** + * @param ?LoyaltyProgramAccrualRuleCategoryData $value + */ + public function setCategoryData(?LoyaltyProgramAccrualRuleCategoryData $value = null): self + { + $this->categoryData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramAccrualRuleCategoryData.php b/src/Types/LoyaltyProgramAccrualRuleCategoryData.php new file mode 100644 index 00000000..a0520aa6 --- /dev/null +++ b/src/Types/LoyaltyProgramAccrualRuleCategoryData.php @@ -0,0 +1,57 @@ +categoryId = $values['categoryId']; + } + + /** + * @return string + */ + public function getCategoryId(): string + { + return $this->categoryId; + } + + /** + * @param string $value + */ + public function setCategoryId(string $value): self + { + $this->categoryId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramAccrualRuleItemVariationData.php b/src/Types/LoyaltyProgramAccrualRuleItemVariationData.php new file mode 100644 index 00000000..5f20761a --- /dev/null +++ b/src/Types/LoyaltyProgramAccrualRuleItemVariationData.php @@ -0,0 +1,57 @@ +itemVariationId = $values['itemVariationId']; + } + + /** + * @return string + */ + public function getItemVariationId(): string + { + return $this->itemVariationId; + } + + /** + * @param string $value + */ + public function setItemVariationId(string $value): self + { + $this->itemVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramAccrualRuleSpendData.php b/src/Types/LoyaltyProgramAccrualRuleSpendData.php new file mode 100644 index 00000000..17f2508c --- /dev/null +++ b/src/Types/LoyaltyProgramAccrualRuleSpendData.php @@ -0,0 +1,146 @@ + $excludedCategoryIds + */ + #[JsonProperty('excluded_category_ids'), ArrayType(['string'])] + private ?array $excludedCategoryIds; + + /** + * The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual. + * + * You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) + * endpoint to retrieve information about the excluded item variations. + * + * @var ?array $excludedItemVariationIds + */ + #[JsonProperty('excluded_item_variation_ids'), ArrayType(['string'])] + private ?array $excludedItemVariationIds; + + /** + * Indicates how taxes should be treated when calculating the purchase amount used for points accrual. + * See [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values + * + * @var value-of $taxMode + */ + #[JsonProperty('tax_mode')] + private string $taxMode; + + /** + * @param array{ + * amountMoney: Money, + * taxMode: value-of, + * excludedCategoryIds?: ?array, + * excludedItemVariationIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->amountMoney = $values['amountMoney']; + $this->excludedCategoryIds = $values['excludedCategoryIds'] ?? null; + $this->excludedItemVariationIds = $values['excludedItemVariationIds'] ?? null; + $this->taxMode = $values['taxMode']; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getExcludedCategoryIds(): ?array + { + return $this->excludedCategoryIds; + } + + /** + * @param ?array $value + */ + public function setExcludedCategoryIds(?array $value = null): self + { + $this->excludedCategoryIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getExcludedItemVariationIds(): ?array + { + return $this->excludedItemVariationIds; + } + + /** + * @param ?array $value + */ + public function setExcludedItemVariationIds(?array $value = null): self + { + $this->excludedItemVariationIds = $value; + return $this; + } + + /** + * @return value-of + */ + public function getTaxMode(): string + { + return $this->taxMode; + } + + /** + * @param value-of $value + */ + public function setTaxMode(string $value): self + { + $this->taxMode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramAccrualRuleTaxMode.php b/src/Types/LoyaltyProgramAccrualRuleTaxMode.php new file mode 100644 index 00000000..1cf403a8 --- /dev/null +++ b/src/Types/LoyaltyProgramAccrualRuleTaxMode.php @@ -0,0 +1,9 @@ + $taxMode + */ + #[JsonProperty('tax_mode')] + private string $taxMode; + + /** + * @param array{ + * taxMode: value-of, + * minimumAmountMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->minimumAmountMoney = $values['minimumAmountMoney'] ?? null; + $this->taxMode = $values['taxMode']; + } + + /** + * @return ?Money + */ + public function getMinimumAmountMoney(): ?Money + { + return $this->minimumAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setMinimumAmountMoney(?Money $value = null): self + { + $this->minimumAmountMoney = $value; + return $this; + } + + /** + * @return value-of + */ + public function getTaxMode(): string + { + return $this->taxMode; + } + + /** + * @param value-of $value + */ + public function setTaxMode(string $value): self + { + $this->taxMode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramExpirationPolicy.php b/src/Types/LoyaltyProgramExpirationPolicy.php new file mode 100644 index 00000000..3a11d954 --- /dev/null +++ b/src/Types/LoyaltyProgramExpirationPolicy.php @@ -0,0 +1,57 @@ +expirationDuration = $values['expirationDuration']; + } + + /** + * @return string + */ + public function getExpirationDuration(): string + { + return $this->expirationDuration; + } + + /** + * @param string $value + */ + public function setExpirationDuration(string $value): self + { + $this->expirationDuration = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramRewardDefinition.php b/src/Types/LoyaltyProgramRewardDefinition.php new file mode 100644 index 00000000..57a00664 --- /dev/null +++ b/src/Types/LoyaltyProgramRewardDefinition.php @@ -0,0 +1,208 @@ + $scope + */ + #[JsonProperty('scope')] + private string $scope; + + /** + * The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. You can find this information + * in the `discount_data.discount_type` field of the `DISCOUNT` catalog object referenced by the pricing rule. + * See [LoyaltyProgramRewardDefinitionType](#type-loyaltyprogramrewarddefinitiontype) for possible values + * + * @var value-of $discountType + */ + #[JsonProperty('discount_type')] + private string $discountType; + + /** + * The fixed percentage of the discount. Present if `discount_type` is `FIXED_PERCENTAGE`. + * For example, a 7.25% off discount will be represented as "7.25". DEPRECATED at version 2020-12-16. You can find this + * information in the `discount_data.percentage` field of the `DISCOUNT` catalog object referenced by the pricing rule. + * + * @var ?string $percentageDiscount + */ + #[JsonProperty('percentage_discount')] + private ?string $percentageDiscount; + + /** + * The list of catalog objects to which this reward can be applied. They are either all item-variation ids or category ids, depending on the `type` field. + * DEPRECATED at version 2020-12-16. You can find this information in the `product_set_data.product_ids_any` field + * of the `PRODUCT_SET` catalog object referenced by the pricing rule. + * + * @var ?array $catalogObjectIds + */ + #[JsonProperty('catalog_object_ids'), ArrayType(['string'])] + private ?array $catalogObjectIds; + + /** + * The amount of the discount. Present if `discount_type` is `FIXED_AMOUNT`. For example, $5 off. + * DEPRECATED at version 2020-12-16. You can find this information in the `discount_data.amount_money` field of the + * `DISCOUNT` catalog object referenced by the pricing rule. + * + * @var ?Money $fixedDiscountMoney + */ + #[JsonProperty('fixed_discount_money')] + private ?Money $fixedDiscountMoney; + + /** + * When `discount_type` is `FIXED_PERCENTAGE`, the maximum discount amount that can be applied. + * DEPRECATED at version 2020-12-16. You can find this information in the `discount_data.maximum_amount_money` field + * of the `DISCOUNT` catalog object referenced by the the pricing rule. + * + * @var ?Money $maxDiscountMoney + */ + #[JsonProperty('max_discount_money')] + private ?Money $maxDiscountMoney; + + /** + * @param array{ + * scope: value-of, + * discountType: value-of, + * percentageDiscount?: ?string, + * catalogObjectIds?: ?array, + * fixedDiscountMoney?: ?Money, + * maxDiscountMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->scope = $values['scope']; + $this->discountType = $values['discountType']; + $this->percentageDiscount = $values['percentageDiscount'] ?? null; + $this->catalogObjectIds = $values['catalogObjectIds'] ?? null; + $this->fixedDiscountMoney = $values['fixedDiscountMoney'] ?? null; + $this->maxDiscountMoney = $values['maxDiscountMoney'] ?? null; + } + + /** + * @return value-of + */ + public function getScope(): string + { + return $this->scope; + } + + /** + * @param value-of $value + */ + public function setScope(string $value): self + { + $this->scope = $value; + return $this; + } + + /** + * @return value-of + */ + public function getDiscountType(): string + { + return $this->discountType; + } + + /** + * @param value-of $value + */ + public function setDiscountType(string $value): self + { + $this->discountType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentageDiscount(): ?string + { + return $this->percentageDiscount; + } + + /** + * @param ?string $value + */ + public function setPercentageDiscount(?string $value = null): self + { + $this->percentageDiscount = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCatalogObjectIds(): ?array + { + return $this->catalogObjectIds; + } + + /** + * @param ?array $value + */ + public function setCatalogObjectIds(?array $value = null): self + { + $this->catalogObjectIds = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getFixedDiscountMoney(): ?Money + { + return $this->fixedDiscountMoney; + } + + /** + * @param ?Money $value + */ + public function setFixedDiscountMoney(?Money $value = null): self + { + $this->fixedDiscountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getMaxDiscountMoney(): ?Money + { + return $this->maxDiscountMoney; + } + + /** + * @param ?Money $value + */ + public function setMaxDiscountMoney(?Money $value = null): self + { + $this->maxDiscountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramRewardDefinitionScope.php b/src/Types/LoyaltyProgramRewardDefinitionScope.php new file mode 100644 index 00000000..8b75c477 --- /dev/null +++ b/src/Types/LoyaltyProgramRewardDefinitionScope.php @@ -0,0 +1,10 @@ +id = $values['id'] ?? null; + $this->points = $values['points']; + $this->name = $values['name'] ?? null; + $this->definition = $values['definition'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->pricingRuleReference = $values['pricingRuleReference']; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return int + */ + public function getPoints(): int + { + return $this->points; + } + + /** + * @param int $value + */ + public function setPoints(int $value): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?LoyaltyProgramRewardDefinition + */ + public function getDefinition(): ?LoyaltyProgramRewardDefinition + { + return $this->definition; + } + + /** + * @param ?LoyaltyProgramRewardDefinition $value + */ + public function setDefinition(?LoyaltyProgramRewardDefinition $value = null): self + { + $this->definition = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return CatalogObjectReference + */ + public function getPricingRuleReference(): CatalogObjectReference + { + return $this->pricingRuleReference; + } + + /** + * @param CatalogObjectReference $value + */ + public function setPricingRuleReference(CatalogObjectReference $value): self + { + $this->pricingRuleReference = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyProgramStatus.php b/src/Types/LoyaltyProgramStatus.php new file mode 100644 index 00000000..27571303 --- /dev/null +++ b/src/Types/LoyaltyProgramStatus.php @@ -0,0 +1,9 @@ +one = $values['one']; + $this->other = $values['other']; + } + + /** + * @return string + */ + public function getOne(): string + { + return $this->one; + } + + /** + * @param string $value + */ + public function setOne(string $value): self + { + $this->one = $value; + return $this; + } + + /** + * @return string + */ + public function getOther(): string + { + return $this->other; + } + + /** + * @param string $value + */ + public function setOther(string $value): self + { + $this->other = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotion.php b/src/Types/LoyaltyPromotion.php new file mode 100644 index 00000000..eb8699b1 --- /dev/null +++ b/src/Types/LoyaltyPromotion.php @@ -0,0 +1,383 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $createdAt The timestamp of when the promotion was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $canceledAt The timestamp of when the promotion was canceled, in RFC 3339 format. + */ + #[JsonProperty('canceled_at')] + private ?string $canceledAt; + + /** + * @var ?string $updatedAt The timestamp when the promotion was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $loyaltyProgramId The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. + */ + #[JsonProperty('loyalty_program_id')] + private ?string $loyaltyProgramId; + + /** + * @var ?Money $minimumSpendAmountMoney The minimum purchase amount required to earn promotion points. If specified, this amount is positive. + */ + #[JsonProperty('minimum_spend_amount_money')] + private ?Money $minimumSpendAmountMoney; + + /** + * The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified, + * the purchase must include at least one of these items to qualify for the promotion. + * + * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. + * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. + * + * You can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, but not both. + * + * @var ?array $qualifyingItemVariationIds + */ + #[JsonProperty('qualifying_item_variation_ids'), ArrayType(['string'])] + private ?array $qualifyingItemVariationIds; + + /** + * The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified, + * the purchase must include at least one item from one of these categories to qualify for the promotion. + * + * This option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule. + * With `SPEND` accrual rules, make sure that qualifying promotional items are not excluded. + * + * You can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but not both. + * + * @var ?array $qualifyingCategoryIds + */ + #[JsonProperty('qualifying_category_ids'), ArrayType(['string'])] + private ?array $qualifyingCategoryIds; + + /** + * @param array{ + * name: string, + * incentive: LoyaltyPromotionIncentive, + * availableTime: LoyaltyPromotionAvailableTimeData, + * id?: ?string, + * triggerLimit?: ?LoyaltyPromotionTriggerLimit, + * status?: ?value-of, + * createdAt?: ?string, + * canceledAt?: ?string, + * updatedAt?: ?string, + * loyaltyProgramId?: ?string, + * minimumSpendAmountMoney?: ?Money, + * qualifyingItemVariationIds?: ?array, + * qualifyingCategoryIds?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->name = $values['name']; + $this->incentive = $values['incentive']; + $this->availableTime = $values['availableTime']; + $this->triggerLimit = $values['triggerLimit'] ?? null; + $this->status = $values['status'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->canceledAt = $values['canceledAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->loyaltyProgramId = $values['loyaltyProgramId'] ?? null; + $this->minimumSpendAmountMoney = $values['minimumSpendAmountMoney'] ?? null; + $this->qualifyingItemVariationIds = $values['qualifyingItemVariationIds'] ?? null; + $this->qualifyingCategoryIds = $values['qualifyingCategoryIds'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return LoyaltyPromotionIncentive + */ + public function getIncentive(): LoyaltyPromotionIncentive + { + return $this->incentive; + } + + /** + * @param LoyaltyPromotionIncentive $value + */ + public function setIncentive(LoyaltyPromotionIncentive $value): self + { + $this->incentive = $value; + return $this; + } + + /** + * @return LoyaltyPromotionAvailableTimeData + */ + public function getAvailableTime(): LoyaltyPromotionAvailableTimeData + { + return $this->availableTime; + } + + /** + * @param LoyaltyPromotionAvailableTimeData $value + */ + public function setAvailableTime(LoyaltyPromotionAvailableTimeData $value): self + { + $this->availableTime = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotionTriggerLimit + */ + public function getTriggerLimit(): ?LoyaltyPromotionTriggerLimit + { + return $this->triggerLimit; + } + + /** + * @param ?LoyaltyPromotionTriggerLimit $value + */ + public function setTriggerLimit(?LoyaltyPromotionTriggerLimit $value = null): self + { + $this->triggerLimit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledAt(): ?string + { + return $this->canceledAt; + } + + /** + * @param ?string $value + */ + public function setCanceledAt(?string $value = null): self + { + $this->canceledAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLoyaltyProgramId(): ?string + { + return $this->loyaltyProgramId; + } + + /** + * @param ?string $value + */ + public function setLoyaltyProgramId(?string $value = null): self + { + $this->loyaltyProgramId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getMinimumSpendAmountMoney(): ?Money + { + return $this->minimumSpendAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setMinimumSpendAmountMoney(?Money $value = null): self + { + $this->minimumSpendAmountMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getQualifyingItemVariationIds(): ?array + { + return $this->qualifyingItemVariationIds; + } + + /** + * @param ?array $value + */ + public function setQualifyingItemVariationIds(?array $value = null): self + { + $this->qualifyingItemVariationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getQualifyingCategoryIds(): ?array + { + return $this->qualifyingCategoryIds; + } + + /** + * @param ?array $value + */ + public function setQualifyingCategoryIds(?array $value = null): self + { + $this->qualifyingCategoryIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionAvailableTimeData.php b/src/Types/LoyaltyPromotionAvailableTimeData.php new file mode 100644 index 00000000..53b64154 --- /dev/null +++ b/src/Types/LoyaltyPromotionAvailableTimeData.php @@ -0,0 +1,125 @@ + $timePeriods + */ + #[JsonProperty('time_periods'), ArrayType(['string'])] + private array $timePeriods; + + /** + * @param array{ + * timePeriods: array, + * startDate?: ?string, + * endDate?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->startDate = $values['startDate'] ?? null; + $this->endDate = $values['endDate'] ?? null; + $this->timePeriods = $values['timePeriods']; + } + + /** + * @return ?string + */ + public function getStartDate(): ?string + { + return $this->startDate; + } + + /** + * @param ?string $value + */ + public function setStartDate(?string $value = null): self + { + $this->startDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndDate(): ?string + { + return $this->endDate; + } + + /** + * @param ?string $value + */ + public function setEndDate(?string $value = null): self + { + $this->endDate = $value; + return $this; + } + + /** + * @return array + */ + public function getTimePeriods(): array + { + return $this->timePeriods; + } + + /** + * @param array $value + */ + public function setTimePeriods(array $value): self + { + $this->timePeriods = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionIncentive.php b/src/Types/LoyaltyPromotionIncentive.php new file mode 100644 index 00000000..4243d662 --- /dev/null +++ b/src/Types/LoyaltyPromotionIncentive.php @@ -0,0 +1,109 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * @var ?LoyaltyPromotionIncentivePointsMultiplierData $pointsMultiplierData Additional data for a `POINTS_MULTIPLIER` incentive type. + */ + #[JsonProperty('points_multiplier_data')] + private ?LoyaltyPromotionIncentivePointsMultiplierData $pointsMultiplierData; + + /** + * @var ?LoyaltyPromotionIncentivePointsAdditionData $pointsAdditionData Additional data for a `POINTS_ADDITION` incentive type. + */ + #[JsonProperty('points_addition_data')] + private ?LoyaltyPromotionIncentivePointsAdditionData $pointsAdditionData; + + /** + * @param array{ + * type: value-of, + * pointsMultiplierData?: ?LoyaltyPromotionIncentivePointsMultiplierData, + * pointsAdditionData?: ?LoyaltyPromotionIncentivePointsAdditionData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->pointsMultiplierData = $values['pointsMultiplierData'] ?? null; + $this->pointsAdditionData = $values['pointsAdditionData'] ?? null; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotionIncentivePointsMultiplierData + */ + public function getPointsMultiplierData(): ?LoyaltyPromotionIncentivePointsMultiplierData + { + return $this->pointsMultiplierData; + } + + /** + * @param ?LoyaltyPromotionIncentivePointsMultiplierData $value + */ + public function setPointsMultiplierData(?LoyaltyPromotionIncentivePointsMultiplierData $value = null): self + { + $this->pointsMultiplierData = $value; + return $this; + } + + /** + * @return ?LoyaltyPromotionIncentivePointsAdditionData + */ + public function getPointsAdditionData(): ?LoyaltyPromotionIncentivePointsAdditionData + { + return $this->pointsAdditionData; + } + + /** + * @param ?LoyaltyPromotionIncentivePointsAdditionData $value + */ + public function setPointsAdditionData(?LoyaltyPromotionIncentivePointsAdditionData $value = null): self + { + $this->pointsAdditionData = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionIncentivePointsAdditionData.php b/src/Types/LoyaltyPromotionIncentivePointsAdditionData.php new file mode 100644 index 00000000..96eccfc9 --- /dev/null +++ b/src/Types/LoyaltyPromotionIncentivePointsAdditionData.php @@ -0,0 +1,59 @@ +pointsAddition = $values['pointsAddition']; + } + + /** + * @return int + */ + public function getPointsAddition(): int + { + return $this->pointsAddition; + } + + /** + * @param int $value + */ + public function setPointsAddition(int $value): self + { + $this->pointsAddition = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionIncentivePointsMultiplierData.php b/src/Types/LoyaltyPromotionIncentivePointsMultiplierData.php new file mode 100644 index 00000000..54ea24db --- /dev/null +++ b/src/Types/LoyaltyPromotionIncentivePointsMultiplierData.php @@ -0,0 +1,103 @@ +pointsMultiplier = $values['pointsMultiplier'] ?? null; + $this->multiplier = $values['multiplier'] ?? null; + } + + /** + * @return ?int + */ + public function getPointsMultiplier(): ?int + { + return $this->pointsMultiplier; + } + + /** + * @param ?int $value + */ + public function setPointsMultiplier(?int $value = null): self + { + $this->pointsMultiplier = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMultiplier(): ?string + { + return $this->multiplier; + } + + /** + * @param ?string $value + */ + public function setMultiplier(?string $value = null): self + { + $this->multiplier = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionIncentiveType.php b/src/Types/LoyaltyPromotionIncentiveType.php new file mode 100644 index 00000000..9730d526 --- /dev/null +++ b/src/Types/LoyaltyPromotionIncentiveType.php @@ -0,0 +1,9 @@ + $interval + */ + #[JsonProperty('interval')] + private ?string $interval; + + /** + * @param array{ + * times: int, + * interval?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->times = $values['times']; + $this->interval = $values['interval'] ?? null; + } + + /** + * @return int + */ + public function getTimes(): int + { + return $this->times; + } + + /** + * @param int $value + */ + public function setTimes(int $value): self + { + $this->times = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getInterval(): ?string + { + return $this->interval; + } + + /** + * @param ?value-of $value + */ + public function setInterval(?string $value = null): self + { + $this->interval = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyPromotionTriggerLimitInterval.php b/src/Types/LoyaltyPromotionTriggerLimitInterval.php new file mode 100644 index 00000000..6a48c807 --- /dev/null +++ b/src/Types/LoyaltyPromotionTriggerLimitInterval.php @@ -0,0 +1,9 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var string $loyaltyAccountId The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs. + */ + #[JsonProperty('loyalty_account_id')] + private string $loyaltyAccountId; + + /** + * @var string $rewardTierId The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the reward. + */ + #[JsonProperty('reward_tier_id')] + private string $rewardTierId; + + /** + * @var ?int $points The number of loyalty points used for the reward. + */ + #[JsonProperty('points')] + private ?int $points; + + /** + * @var ?string $orderId The Square-assigned ID of the [order](entity:Order) to which the reward is attached. + */ + #[JsonProperty('order_id')] + private ?string $orderId; + + /** + * @var ?string $createdAt The timestamp when the reward was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the reward was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $redeemedAt The timestamp when the reward was redeemed, in RFC 3339 format. + */ + #[JsonProperty('redeemed_at')] + private ?string $redeemedAt; + + /** + * @param array{ + * loyaltyAccountId: string, + * rewardTierId: string, + * id?: ?string, + * status?: ?value-of, + * points?: ?int, + * orderId?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * redeemedAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->status = $values['status'] ?? null; + $this->loyaltyAccountId = $values['loyaltyAccountId']; + $this->rewardTierId = $values['rewardTierId']; + $this->points = $values['points'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->redeemedAt = $values['redeemedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function getLoyaltyAccountId(): string + { + return $this->loyaltyAccountId; + } + + /** + * @param string $value + */ + public function setLoyaltyAccountId(string $value): self + { + $this->loyaltyAccountId = $value; + return $this; + } + + /** + * @return string + */ + public function getRewardTierId(): string + { + return $this->rewardTierId; + } + + /** + * @param string $value + */ + public function setRewardTierId(string $value): self + { + $this->rewardTierId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPoints(): ?int + { + return $this->points; + } + + /** + * @param ?int $value + */ + public function setPoints(?int $value = null): self + { + $this->points = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRedeemedAt(): ?string + { + return $this->redeemedAt; + } + + /** + * @param ?string $value + */ + public function setRedeemedAt(?string $value = null): self + { + $this->redeemedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/LoyaltyRewardStatus.php b/src/Types/LoyaltyRewardStatus.php new file mode 100644 index 00000000..d43e8288 --- /dev/null +++ b/src/Types/LoyaltyRewardStatus.php @@ -0,0 +1,10 @@ + $areaUnit + */ + #[JsonProperty('area_unit')] + private ?string $areaUnit; + + /** + * Represents a standard length unit. + * See [MeasurementUnitLength](#type-measurementunitlength) for possible values + * + * @var ?value-of $lengthUnit + */ + #[JsonProperty('length_unit')] + private ?string $lengthUnit; + + /** + * Represents a standard volume unit. + * See [MeasurementUnitVolume](#type-measurementunitvolume) for possible values + * + * @var ?value-of $volumeUnit + */ + #[JsonProperty('volume_unit')] + private ?string $volumeUnit; + + /** + * Represents a standard unit of weight or mass. + * See [MeasurementUnitWeight](#type-measurementunitweight) for possible values + * + * @var ?value-of $weightUnit + */ + #[JsonProperty('weight_unit')] + private ?string $weightUnit; + + /** + * Reserved for API integrations that lack the ability to specify a real measurement unit + * See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values + * + * @var ?'UNIT' $genericUnit + */ + #[JsonProperty('generic_unit')] + private ?string $genericUnit; + + /** + * Represents a standard unit of time. + * See [MeasurementUnitTime](#type-measurementunittime) for possible values + * + * @var ?value-of $timeUnit + */ + #[JsonProperty('time_unit')] + private ?string $timeUnit; + + /** + * Represents the type of the measurement unit. + * See [MeasurementUnitUnitType](#type-measurementunitunittype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @param array{ + * customUnit?: ?MeasurementUnitCustom, + * areaUnit?: ?value-of, + * lengthUnit?: ?value-of, + * volumeUnit?: ?value-of, + * weightUnit?: ?value-of, + * genericUnit?: ?'UNIT', + * timeUnit?: ?value-of, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customUnit = $values['customUnit'] ?? null; + $this->areaUnit = $values['areaUnit'] ?? null; + $this->lengthUnit = $values['lengthUnit'] ?? null; + $this->volumeUnit = $values['volumeUnit'] ?? null; + $this->weightUnit = $values['weightUnit'] ?? null; + $this->genericUnit = $values['genericUnit'] ?? null; + $this->timeUnit = $values['timeUnit'] ?? null; + $this->type = $values['type'] ?? null; + } + + /** + * @return ?MeasurementUnitCustom + */ + public function getCustomUnit(): ?MeasurementUnitCustom + { + return $this->customUnit; + } + + /** + * @param ?MeasurementUnitCustom $value + */ + public function setCustomUnit(?MeasurementUnitCustom $value = null): self + { + $this->customUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getAreaUnit(): ?string + { + return $this->areaUnit; + } + + /** + * @param ?value-of $value + */ + public function setAreaUnit(?string $value = null): self + { + $this->areaUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getLengthUnit(): ?string + { + return $this->lengthUnit; + } + + /** + * @param ?value-of $value + */ + public function setLengthUnit(?string $value = null): self + { + $this->lengthUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getVolumeUnit(): ?string + { + return $this->volumeUnit; + } + + /** + * @param ?value-of $value + */ + public function setVolumeUnit(?string $value = null): self + { + $this->volumeUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getWeightUnit(): ?string + { + return $this->weightUnit; + } + + /** + * @param ?value-of $value + */ + public function setWeightUnit(?string $value = null): self + { + $this->weightUnit = $value; + return $this; + } + + /** + * @return ?'UNIT' + */ + public function getGenericUnit(): ?string + { + return $this->genericUnit; + } + + /** + * @param ?'UNIT' $value + */ + public function setGenericUnit(?string $value = null): self + { + $this->genericUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getTimeUnit(): ?string + { + return $this->timeUnit; + } + + /** + * @param ?value-of $value + */ + public function setTimeUnit(?string $value = null): self + { + $this->timeUnit = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/MeasurementUnitArea.php b/src/Types/MeasurementUnitArea.php new file mode 100644 index 00000000..474f8828 --- /dev/null +++ b/src/Types/MeasurementUnitArea.php @@ -0,0 +1,15 @@ +name = $values['name']; + $this->abbreviation = $values['abbreviation']; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function getAbbreviation(): string + { + return $this->abbreviation; + } + + /** + * @param string $value + */ + public function setAbbreviation(string $value): self + { + $this->abbreviation = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/MeasurementUnitLength.php b/src/Types/MeasurementUnitLength.php new file mode 100644 index 00000000..1beeb6f8 --- /dev/null +++ b/src/Types/MeasurementUnitLength.php @@ -0,0 +1,15 @@ + $country + */ + #[JsonProperty('country')] + private string $country; + + /** + * @var ?string $languageCode The code indicating the [language preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`. + */ + #[JsonProperty('language_code')] + private ?string $languageCode; + + /** + * The currency associated with the merchant, in ISO 4217 format. For example, the currency code for US dollars is `USD`. + * See [Currency](#type-currency) for possible values + * + * @var ?value-of $currency + */ + #[JsonProperty('currency')] + private ?string $currency; + + /** + * The merchant's status. + * See [MerchantStatus](#type-merchantstatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $mainLocationId The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant. + */ + #[JsonProperty('main_location_id')] + private ?string $mainLocationId; + + /** + * The time when the merchant was created, in RFC 3339 format. + * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + * + * @var ?string $createdAt + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @param array{ + * country: value-of, + * id?: ?string, + * businessName?: ?string, + * languageCode?: ?string, + * currency?: ?value-of, + * status?: ?value-of, + * mainLocationId?: ?string, + * createdAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->businessName = $values['businessName'] ?? null; + $this->country = $values['country']; + $this->languageCode = $values['languageCode'] ?? null; + $this->currency = $values['currency'] ?? null; + $this->status = $values['status'] ?? null; + $this->mainLocationId = $values['mainLocationId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBusinessName(): ?string + { + return $this->businessName; + } + + /** + * @param ?string $value + */ + public function setBusinessName(?string $value = null): self + { + $this->businessName = $value; + return $this; + } + + /** + * @return value-of + */ + public function getCountry(): string + { + return $this->country; + } + + /** + * @param value-of $value + */ + public function setCountry(string $value): self + { + $this->country = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLanguageCode(): ?string + { + return $this->languageCode; + } + + /** + * @param ?string $value + */ + public function setLanguageCode(?string $value = null): self + { + $this->languageCode = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCurrency(): ?string + { + return $this->currency; + } + + /** + * @param ?value-of $value + */ + public function setCurrency(?string $value = null): self + { + $this->currency = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMainLocationId(): ?string + { + return $this->mainLocationId; + } + + /** + * @param ?string $value + */ + public function setMainLocationId(?string $value = null): self + { + $this->mainLocationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/MerchantStatus.php b/src/Types/MerchantStatus.php new file mode 100644 index 00000000..43ffd854 --- /dev/null +++ b/src/Types/MerchantStatus.php @@ -0,0 +1,9 @@ +locationId = $values['locationId'] ?? null; + $this->priceMoney = $values['priceMoney'] ?? null; + $this->soldOut = $values['soldOut'] ?? null; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceMoney(?Money $value = null): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSoldOut(): ?bool + { + return $this->soldOut; + } + + /** + * @param ?bool $value + */ + public function setSoldOut(?bool $value = null): self + { + $this->soldOut = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Money.php b/src/Types/Money.php new file mode 100644 index 00000000..1cf6b89f --- /dev/null +++ b/src/Types/Money.php @@ -0,0 +1,95 @@ + $currency + */ + #[JsonProperty('currency')] + private ?string $currency; + + /** + * @param array{ + * amount?: ?int, + * currency?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->amount = $values['amount'] ?? null; + $this->currency = $values['currency'] ?? null; + } + + /** + * @return ?int + */ + public function getAmount(): ?int + { + return $this->amount; + } + + /** + * @param ?int $value + */ + public function setAmount(?int $value = null): self + { + $this->amount = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCurrency(): ?string + { + return $this->currency; + } + + /** + * @param ?value-of $value + */ + public function setCurrency(?string $value = null): self + { + $this->currency = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ObtainTokenResponse.php b/src/Types/ObtainTokenResponse.php new file mode 100644 index 00000000..5d67b5af --- /dev/null +++ b/src/Types/ObtainTokenResponse.php @@ -0,0 +1,322 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $refreshTokenExpiresAt The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. + */ + #[JsonProperty('refresh_token_expires_at')] + private ?string $refreshTokenExpiresAt; + + /** + * @param array{ + * accessToken?: ?string, + * tokenType?: ?string, + * expiresAt?: ?string, + * merchantId?: ?string, + * subscriptionId?: ?string, + * planId?: ?string, + * idToken?: ?string, + * refreshToken?: ?string, + * shortLived?: ?bool, + * errors?: ?array, + * refreshTokenExpiresAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->accessToken = $values['accessToken'] ?? null; + $this->tokenType = $values['tokenType'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->subscriptionId = $values['subscriptionId'] ?? null; + $this->planId = $values['planId'] ?? null; + $this->idToken = $values['idToken'] ?? null; + $this->refreshToken = $values['refreshToken'] ?? null; + $this->shortLived = $values['shortLived'] ?? null; + $this->errors = $values['errors'] ?? null; + $this->refreshTokenExpiresAt = $values['refreshTokenExpiresAt'] ?? null; + } + + /** + * @return ?string + */ + public function getAccessToken(): ?string + { + return $this->accessToken; + } + + /** + * @param ?string $value + */ + public function setAccessToken(?string $value = null): self + { + $this->accessToken = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTokenType(): ?string + { + return $this->tokenType; + } + + /** + * @param ?string $value + */ + public function setTokenType(?string $value = null): self + { + $this->tokenType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiresAt(): ?string + { + return $this->expiresAt; + } + + /** + * @param ?string $value + */ + public function setExpiresAt(?string $value = null): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSubscriptionId(): ?string + { + return $this->subscriptionId; + } + + /** + * @param ?string $value + */ + public function setSubscriptionId(?string $value = null): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlanId(): ?string + { + return $this->planId; + } + + /** + * @param ?string $value + */ + public function setPlanId(?string $value = null): self + { + $this->planId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdToken(): ?string + { + return $this->idToken; + } + + /** + * @param ?string $value + */ + public function setIdToken(?string $value = null): self + { + $this->idToken = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefreshToken(): ?string + { + return $this->refreshToken; + } + + /** + * @param ?string $value + */ + public function setRefreshToken(?string $value = null): self + { + $this->refreshToken = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getShortLived(): ?bool + { + return $this->shortLived; + } + + /** + * @param ?bool $value + */ + public function setShortLived(?bool $value = null): self + { + $this->shortLived = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefreshTokenExpiresAt(): ?string + { + return $this->refreshTokenExpiresAt; + } + + /** + * @param ?string $value + */ + public function setRefreshTokenExpiresAt(?string $value = null): self + { + $this->refreshTokenExpiresAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OfflinePaymentDetails.php b/src/Types/OfflinePaymentDetails.php new file mode 100644 index 00000000..26fa4b86 --- /dev/null +++ b/src/Types/OfflinePaymentDetails.php @@ -0,0 +1,54 @@ +clientCreatedAt = $values['clientCreatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getClientCreatedAt(): ?string + { + return $this->clientCreatedAt; + } + + /** + * @param ?string $value + */ + public function setClientCreatedAt(?string $value = null): self + { + $this->clientCreatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Order.php b/src/Types/Order.php new file mode 100644 index 00000000..2af6356f --- /dev/null +++ b/src/Types/Order.php @@ -0,0 +1,897 @@ + $lineItems The line items included in the order. + */ + #[JsonProperty('line_items'), ArrayType([OrderLineItem::class])] + private ?array $lineItems; + + /** + * The list of all taxes associated with the order. + * + * Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an + * `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes + * with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item. + * + * On reads, each tax in the list includes the total amount of that tax applied to the order. + * + * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated + * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` + * instead. + * + * @var ?array $taxes + */ + #[JsonProperty('taxes'), ArrayType([OrderLineItemTax::class])] + private ?array $taxes; + + /** + * The list of all discounts associated with the order. + * + * Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, + * an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. + * For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount` + * for every line item. + * + * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated + * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` + * instead. + * + * @var ?array $discounts + */ + #[JsonProperty('discounts'), ArrayType([OrderLineItemDiscount::class])] + private ?array $discounts; + + /** + * @var ?array $serviceCharges A list of service charges applied to the order. + */ + #[JsonProperty('service_charges'), ArrayType([OrderServiceCharge::class])] + private ?array $serviceCharges; + + /** + * Details about order fulfillment. + * + * Orders can only be created with at most one fulfillment. However, orders returned + * by the API might contain multiple fulfillments. + * + * @var ?array $fulfillments + */ + #[JsonProperty('fulfillments'), ArrayType([Fulfillment::class])] + private ?array $fulfillments; + + /** + * A collection of items from sale orders being returned in this one. Normally part of an + * itemized return or exchange. There is exactly one `Return` object per sale `Order` being + * referenced. + * + * @var ?array $returns + */ + #[JsonProperty('returns'), ArrayType([OrderReturn::class])] + private ?array $returns; + + /** + * @var ?OrderMoneyAmounts $returnAmounts The rollup of the returned money amounts. + */ + #[JsonProperty('return_amounts')] + private ?OrderMoneyAmounts $returnAmounts; + + /** + * @var ?OrderMoneyAmounts $netAmounts The net money amounts (sale money - return money). + */ + #[JsonProperty('net_amounts')] + private ?OrderMoneyAmounts $netAmounts; + + /** + * A positive rounding adjustment to the total of the order. This adjustment is commonly + * used to apply cash rounding when the minimum unit of account is smaller than the lowest physical + * denomination of the currency. + * + * @var ?OrderRoundingAdjustment $roundingAdjustment + */ + #[JsonProperty('rounding_adjustment')] + private ?OrderRoundingAdjustment $roundingAdjustment; + + /** + * @var ?array $tenders The tenders that were used to pay for the order. + */ + #[JsonProperty('tenders'), ArrayType([Tender::class])] + private ?array $tenders; + + /** + * @var ?array $refunds The refunds that are part of this order. + */ + #[JsonProperty('refunds'), ArrayType([Refund::class])] + private ?array $refunds; + + /** + * Application-defined data attached to this order. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * @var ?string $createdAt The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $closedAt The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example "2016-09-04T23:59:33.123Z"). + */ + #[JsonProperty('closed_at')] + private ?string $closedAt; + + /** + * The current state of the order. + * See [OrderState](#type-orderstate) for possible values + * + * @var ?value-of $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * The version number, which is incremented each time an update is committed to the order. + * Orders not created through the API do not include a version number and + * therefore cannot be updated. + * + * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders). + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?Money $totalMoney The total amount of money to collect for the order. + */ + #[JsonProperty('total_money')] + private ?Money $totalMoney; + + /** + * @var ?Money $totalTaxMoney The total amount of tax money to collect for the order. + */ + #[JsonProperty('total_tax_money')] + private ?Money $totalTaxMoney; + + /** + * @var ?Money $totalDiscountMoney The total amount of discount money to collect for the order. + */ + #[JsonProperty('total_discount_money')] + private ?Money $totalDiscountMoney; + + /** + * @var ?Money $totalTipMoney The total amount of tip money to collect for the order. + */ + #[JsonProperty('total_tip_money')] + private ?Money $totalTipMoney; + + /** + * The total amount of money collected in service charges for the order. + * + * Note: `total_service_charge_money` is the sum of `applied_money` fields for each individual + * service charge. Therefore, `total_service_charge_money` only includes inclusive tax amounts, + * not additive tax amounts. + * + * @var ?Money $totalServiceChargeMoney + */ + #[JsonProperty('total_service_charge_money')] + private ?Money $totalServiceChargeMoney; + + /** + * A short-term identifier for the order (such as a customer first name, + * table number, or auto-generated order number that resets daily). + * + * @var ?string $ticketName + */ + #[JsonProperty('ticket_name')] + private ?string $ticketName; + + /** + * Pricing options for an order. The options affect how the order's price is calculated. + * They can be used, for example, to apply automatic price adjustments that are based on + * preconfigured [pricing rules](entity:CatalogPricingRule). + * + * @var ?OrderPricingOptions $pricingOptions + */ + #[JsonProperty('pricing_options')] + private ?OrderPricingOptions $pricingOptions; + + /** + * @var ?array $rewards A set-like list of Rewards that have been added to the Order. + */ + #[JsonProperty('rewards'), ArrayType([OrderReward::class])] + private ?array $rewards; + + /** + * @var ?Money $netAmountDueMoney The net amount of money due on the order. + */ + #[JsonProperty('net_amount_due_money')] + private ?Money $netAmountDueMoney; + + /** + * @param array{ + * locationId: string, + * id?: ?string, + * referenceId?: ?string, + * source?: ?OrderSource, + * customerId?: ?string, + * lineItems?: ?array, + * taxes?: ?array, + * discounts?: ?array, + * serviceCharges?: ?array, + * fulfillments?: ?array, + * returns?: ?array, + * returnAmounts?: ?OrderMoneyAmounts, + * netAmounts?: ?OrderMoneyAmounts, + * roundingAdjustment?: ?OrderRoundingAdjustment, + * tenders?: ?array, + * refunds?: ?array, + * metadata?: ?array, + * createdAt?: ?string, + * updatedAt?: ?string, + * closedAt?: ?string, + * state?: ?value-of, + * version?: ?int, + * totalMoney?: ?Money, + * totalTaxMoney?: ?Money, + * totalDiscountMoney?: ?Money, + * totalTipMoney?: ?Money, + * totalServiceChargeMoney?: ?Money, + * ticketName?: ?string, + * pricingOptions?: ?OrderPricingOptions, + * rewards?: ?array, + * netAmountDueMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->locationId = $values['locationId']; + $this->referenceId = $values['referenceId'] ?? null; + $this->source = $values['source'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->lineItems = $values['lineItems'] ?? null; + $this->taxes = $values['taxes'] ?? null; + $this->discounts = $values['discounts'] ?? null; + $this->serviceCharges = $values['serviceCharges'] ?? null; + $this->fulfillments = $values['fulfillments'] ?? null; + $this->returns = $values['returns'] ?? null; + $this->returnAmounts = $values['returnAmounts'] ?? null; + $this->netAmounts = $values['netAmounts'] ?? null; + $this->roundingAdjustment = $values['roundingAdjustment'] ?? null; + $this->tenders = $values['tenders'] ?? null; + $this->refunds = $values['refunds'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->closedAt = $values['closedAt'] ?? null; + $this->state = $values['state'] ?? null; + $this->version = $values['version'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->totalDiscountMoney = $values['totalDiscountMoney'] ?? null; + $this->totalTipMoney = $values['totalTipMoney'] ?? null; + $this->totalServiceChargeMoney = $values['totalServiceChargeMoney'] ?? null; + $this->ticketName = $values['ticketName'] ?? null; + $this->pricingOptions = $values['pricingOptions'] ?? null; + $this->rewards = $values['rewards'] ?? null; + $this->netAmountDueMoney = $values['netAmountDueMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?OrderSource + */ + public function getSource(): ?OrderSource + { + return $this->source; + } + + /** + * @param ?OrderSource $value + */ + public function setSource(?OrderSource $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLineItems(): ?array + { + return $this->lineItems; + } + + /** + * @param ?array $value + */ + public function setLineItems(?array $value = null): self + { + $this->lineItems = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTaxes(): ?array + { + return $this->taxes; + } + + /** + * @param ?array $value + */ + public function setTaxes(?array $value = null): self + { + $this->taxes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDiscounts(): ?array + { + return $this->discounts; + } + + /** + * @param ?array $value + */ + public function setDiscounts(?array $value = null): self + { + $this->discounts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getServiceCharges(): ?array + { + return $this->serviceCharges; + } + + /** + * @param ?array $value + */ + public function setServiceCharges(?array $value = null): self + { + $this->serviceCharges = $value; + return $this; + } + + /** + * @return ?array + */ + public function getFulfillments(): ?array + { + return $this->fulfillments; + } + + /** + * @param ?array $value + */ + public function setFulfillments(?array $value = null): self + { + $this->fulfillments = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturns(): ?array + { + return $this->returns; + } + + /** + * @param ?array $value + */ + public function setReturns(?array $value = null): self + { + $this->returns = $value; + return $this; + } + + /** + * @return ?OrderMoneyAmounts + */ + public function getReturnAmounts(): ?OrderMoneyAmounts + { + return $this->returnAmounts; + } + + /** + * @param ?OrderMoneyAmounts $value + */ + public function setReturnAmounts(?OrderMoneyAmounts $value = null): self + { + $this->returnAmounts = $value; + return $this; + } + + /** + * @return ?OrderMoneyAmounts + */ + public function getNetAmounts(): ?OrderMoneyAmounts + { + return $this->netAmounts; + } + + /** + * @param ?OrderMoneyAmounts $value + */ + public function setNetAmounts(?OrderMoneyAmounts $value = null): self + { + $this->netAmounts = $value; + return $this; + } + + /** + * @return ?OrderRoundingAdjustment + */ + public function getRoundingAdjustment(): ?OrderRoundingAdjustment + { + return $this->roundingAdjustment; + } + + /** + * @param ?OrderRoundingAdjustment $value + */ + public function setRoundingAdjustment(?OrderRoundingAdjustment $value = null): self + { + $this->roundingAdjustment = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTenders(): ?array + { + return $this->tenders; + } + + /** + * @param ?array $value + */ + public function setTenders(?array $value = null): self + { + $this->tenders = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRefunds(): ?array + { + return $this->refunds; + } + + /** + * @param ?array $value + */ + public function setRefunds(?array $value = null): self + { + $this->refunds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClosedAt(): ?string + { + return $this->closedAt; + } + + /** + * @param ?string $value + */ + public function setClosedAt(?string $value = null): self + { + $this->closedAt = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTaxMoney(): ?Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTaxMoney(?Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalDiscountMoney(): ?Money + { + return $this->totalDiscountMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalDiscountMoney(?Money $value = null): self + { + $this->totalDiscountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTipMoney(): ?Money + { + return $this->totalTipMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTipMoney(?Money $value = null): self + { + $this->totalTipMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalServiceChargeMoney(): ?Money + { + return $this->totalServiceChargeMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalServiceChargeMoney(?Money $value = null): self + { + $this->totalServiceChargeMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTicketName(): ?string + { + return $this->ticketName; + } + + /** + * @param ?string $value + */ + public function setTicketName(?string $value = null): self + { + $this->ticketName = $value; + return $this; + } + + /** + * @return ?OrderPricingOptions + */ + public function getPricingOptions(): ?OrderPricingOptions + { + return $this->pricingOptions; + } + + /** + * @param ?OrderPricingOptions $value + */ + public function setPricingOptions(?OrderPricingOptions $value = null): self + { + $this->pricingOptions = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRewards(): ?array + { + return $this->rewards; + } + + /** + * @param ?array $value + */ + public function setRewards(?array $value = null): self + { + $this->rewards = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getNetAmountDueMoney(): ?Money + { + return $this->netAmountDueMoney; + } + + /** + * @param ?Money $value + */ + public function setNetAmountDueMoney(?Money $value = null): self + { + $this->netAmountDueMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderEntry.php b/src/Types/OrderEntry.php new file mode 100644 index 00000000..961910d4 --- /dev/null +++ b/src/Types/OrderEntry.php @@ -0,0 +1,111 @@ +orderId = $values['orderId'] ?? null; + $this->version = $values['version'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItem.php b/src/Types/OrderLineItem.php new file mode 100644 index 00000000..0a20f860 --- /dev/null +++ b/src/Types/OrderLineItem.php @@ -0,0 +1,660 @@ + $itemType + */ + #[JsonProperty('item_type')] + private ?string $itemType; + + /** + * Application-defined data attached to this line item. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * @var ?array $modifiers The [CatalogModifier](entity:CatalogModifier)s applied to this line item. + */ + #[JsonProperty('modifiers'), ArrayType([OrderLineItemModifier::class])] + private ?array $modifiers; + + /** + * The list of references to taxes applied to this line item. Each + * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a + * top-level `OrderLineItemTax` applied to the line item. On reads, the + * amount applied is populated. + * + * An `OrderLineItemAppliedTax` is automatically created on every line + * item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax` + * records for `LINE_ITEM` scoped taxes must be added in requests for the tax + * to apply to any line items. + * + * To change the amount of a tax, modify the referenced top-level tax. + * + * @var ?array $appliedTaxes + */ + #[JsonProperty('applied_taxes'), ArrayType([OrderLineItemAppliedTax::class])] + private ?array $appliedTaxes; + + /** + * The list of references to discounts applied to this line item. Each + * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level + * `OrderLineItemDiscounts` applied to the line item. On reads, the amount + * applied is populated. + * + * An `OrderLineItemAppliedDiscount` is automatically created on every line item for all + * `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records + * for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any + * line items. + * + * To change the amount of a discount, modify the referenced top-level discount. + * + * @var ?array $appliedDiscounts + */ + #[JsonProperty('applied_discounts'), ArrayType([OrderLineItemAppliedDiscount::class])] + private ?array $appliedDiscounts; + + /** + * The list of references to service charges applied to this line item. Each + * `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a + * top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is + * populated. + * + * To change the amount of a service charge, modify the referenced top-level service charge. + * + * @var ?array $appliedServiceCharges + */ + #[JsonProperty('applied_service_charges'), ArrayType([OrderLineItemAppliedServiceCharge::class])] + private ?array $appliedServiceCharges; + + /** + * @var ?Money $basePriceMoney The base price for a single unit of the line item. + */ + #[JsonProperty('base_price_money')] + private ?Money $basePriceMoney; + + /** + * The total price of all item variations sold in this line item. + * The price is calculated as `base_price_money` multiplied by `quantity`. + * It does not include modifiers. + * + * @var ?Money $variationTotalPriceMoney + */ + #[JsonProperty('variation_total_price_money')] + private ?Money $variationTotalPriceMoney; + + /** + * The amount of money made in gross sales for this line item. + * The amount is calculated as the sum of the variation's total price and each modifier's total price. + * For inclusive tax items in the US, Canada, and Japan, tax is deducted from `gross_sales_money`. For Europe and + * Australia, inclusive tax remains as part of the gross sale calculation. + * + * @var ?Money $grossSalesMoney + */ + #[JsonProperty('gross_sales_money')] + private ?Money $grossSalesMoney; + + /** + * @var ?Money $totalTaxMoney The total amount of tax money to collect for the line item. + */ + #[JsonProperty('total_tax_money')] + private ?Money $totalTaxMoney; + + /** + * @var ?Money $totalDiscountMoney The total amount of discount money to collect for the line item. + */ + #[JsonProperty('total_discount_money')] + private ?Money $totalDiscountMoney; + + /** + * @var ?Money $totalMoney The total amount of money to collect for this line item. + */ + #[JsonProperty('total_money')] + private ?Money $totalMoney; + + /** + * Describes pricing adjustments that are blocked from automatic + * application to a line item. For more information, see + * [Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). + * + * @var ?OrderLineItemPricingBlocklists $pricingBlocklists + */ + #[JsonProperty('pricing_blocklists')] + private ?OrderLineItemPricingBlocklists $pricingBlocklists; + + /** + * @var ?Money $totalServiceChargeMoney The total amount of apportioned service charge money to collect for the line item. + */ + #[JsonProperty('total_service_charge_money')] + private ?Money $totalServiceChargeMoney; + + /** + * @param array{ + * quantity: string, + * uid?: ?string, + * name?: ?string, + * quantityUnit?: ?OrderQuantityUnit, + * note?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * variationName?: ?string, + * itemType?: ?value-of, + * metadata?: ?array, + * modifiers?: ?array, + * appliedTaxes?: ?array, + * appliedDiscounts?: ?array, + * appliedServiceCharges?: ?array, + * basePriceMoney?: ?Money, + * variationTotalPriceMoney?: ?Money, + * grossSalesMoney?: ?Money, + * totalTaxMoney?: ?Money, + * totalDiscountMoney?: ?Money, + * totalMoney?: ?Money, + * pricingBlocklists?: ?OrderLineItemPricingBlocklists, + * totalServiceChargeMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->uid = $values['uid'] ?? null; + $this->name = $values['name'] ?? null; + $this->quantity = $values['quantity']; + $this->quantityUnit = $values['quantityUnit'] ?? null; + $this->note = $values['note'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->variationName = $values['variationName'] ?? null; + $this->itemType = $values['itemType'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->modifiers = $values['modifiers'] ?? null; + $this->appliedTaxes = $values['appliedTaxes'] ?? null; + $this->appliedDiscounts = $values['appliedDiscounts'] ?? null; + $this->appliedServiceCharges = $values['appliedServiceCharges'] ?? null; + $this->basePriceMoney = $values['basePriceMoney'] ?? null; + $this->variationTotalPriceMoney = $values['variationTotalPriceMoney'] ?? null; + $this->grossSalesMoney = $values['grossSalesMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->totalDiscountMoney = $values['totalDiscountMoney'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->pricingBlocklists = $values['pricingBlocklists'] ?? null; + $this->totalServiceChargeMoney = $values['totalServiceChargeMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function getQuantity(): string + { + return $this->quantity; + } + + /** + * @param string $value + */ + public function setQuantity(string $value): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?OrderQuantityUnit + */ + public function getQuantityUnit(): ?OrderQuantityUnit + { + return $this->quantityUnit; + } + + /** + * @param ?OrderQuantityUnit $value + */ + public function setQuantityUnit(?OrderQuantityUnit $value = null): self + { + $this->quantityUnit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVariationName(): ?string + { + return $this->variationName; + } + + /** + * @param ?string $value + */ + public function setVariationName(?string $value = null): self + { + $this->variationName = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getItemType(): ?string + { + return $this->itemType; + } + + /** + * @param ?value-of $value + */ + public function setItemType(?string $value = null): self + { + $this->itemType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?array + */ + public function getModifiers(): ?array + { + return $this->modifiers; + } + + /** + * @param ?array $value + */ + public function setModifiers(?array $value = null): self + { + $this->modifiers = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedTaxes(): ?array + { + return $this->appliedTaxes; + } + + /** + * @param ?array $value + */ + public function setAppliedTaxes(?array $value = null): self + { + $this->appliedTaxes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedDiscounts(): ?array + { + return $this->appliedDiscounts; + } + + /** + * @param ?array $value + */ + public function setAppliedDiscounts(?array $value = null): self + { + $this->appliedDiscounts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedServiceCharges(): ?array + { + return $this->appliedServiceCharges; + } + + /** + * @param ?array $value + */ + public function setAppliedServiceCharges(?array $value = null): self + { + $this->appliedServiceCharges = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getBasePriceMoney(): ?Money + { + return $this->basePriceMoney; + } + + /** + * @param ?Money $value + */ + public function setBasePriceMoney(?Money $value = null): self + { + $this->basePriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getVariationTotalPriceMoney(): ?Money + { + return $this->variationTotalPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setVariationTotalPriceMoney(?Money $value = null): self + { + $this->variationTotalPriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getGrossSalesMoney(): ?Money + { + return $this->grossSalesMoney; + } + + /** + * @param ?Money $value + */ + public function setGrossSalesMoney(?Money $value = null): self + { + $this->grossSalesMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTaxMoney(): ?Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTaxMoney(?Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalDiscountMoney(): ?Money + { + return $this->totalDiscountMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalDiscountMoney(?Money $value = null): self + { + $this->totalDiscountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?OrderLineItemPricingBlocklists + */ + public function getPricingBlocklists(): ?OrderLineItemPricingBlocklists + { + return $this->pricingBlocklists; + } + + /** + * @param ?OrderLineItemPricingBlocklists $value + */ + public function setPricingBlocklists(?OrderLineItemPricingBlocklists $value = null): self + { + $this->pricingBlocklists = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalServiceChargeMoney(): ?Money + { + return $this->totalServiceChargeMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalServiceChargeMoney(?Money $value = null): self + { + $this->totalServiceChargeMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemAppliedDiscount.php b/src/Types/OrderLineItemAppliedDiscount.php new file mode 100644 index 00000000..4eed5712 --- /dev/null +++ b/src/Types/OrderLineItemAppliedDiscount.php @@ -0,0 +1,115 @@ +uid = $values['uid'] ?? null; + $this->discountUid = $values['discountUid']; + $this->appliedMoney = $values['appliedMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return string + */ + public function getDiscountUid(): string + { + return $this->discountUid; + } + + /** + * @param string $value + */ + public function setDiscountUid(string $value): self + { + $this->discountUid = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemAppliedServiceCharge.php b/src/Types/OrderLineItemAppliedServiceCharge.php new file mode 100644 index 00000000..54ba28e4 --- /dev/null +++ b/src/Types/OrderLineItemAppliedServiceCharge.php @@ -0,0 +1,107 @@ +uid = $values['uid'] ?? null; + $this->serviceChargeUid = $values['serviceChargeUid']; + $this->appliedMoney = $values['appliedMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return string + */ + public function getServiceChargeUid(): string + { + return $this->serviceChargeUid; + } + + /** + * @param string $value + */ + public function setServiceChargeUid(string $value): self + { + $this->serviceChargeUid = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemAppliedTax.php b/src/Types/OrderLineItemAppliedTax.php new file mode 100644 index 00000000..d567f317 --- /dev/null +++ b/src/Types/OrderLineItemAppliedTax.php @@ -0,0 +1,115 @@ +uid = $values['uid'] ?? null; + $this->taxUid = $values['taxUid']; + $this->appliedMoney = $values['appliedMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return string + */ + public function getTaxUid(): string + { + return $this->taxUid; + } + + /** + * @param string $value + */ + public function setTaxUid(string $value): self + { + $this->taxUid = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemDiscount.php b/src/Types/OrderLineItemDiscount.php new file mode 100644 index 00000000..8d9d852a --- /dev/null +++ b/src/Types/OrderLineItemDiscount.php @@ -0,0 +1,397 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The percentage of the discount, as a string representation of a decimal number. + * A value of `7.25` corresponds to a percentage of 7.25%. + * + * `percentage` is not set for amount-based discounts. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * The total declared monetary amount of the discount. + * + * `amount_money` is not set for percentage-based discounts. + * + * @var ?Money $amountMoney + */ + #[JsonProperty('amount_money')] + private ?Money $amountMoney; + + /** + * The amount of discount actually applied to the line item. + * + * The amount represents the amount of money applied as a line-item scoped discount. + * When an amount-based discount is scoped to the entire order, the value + * of `applied_money` is different than `amount_money` because the total + * amount of the discount is distributed across all line items. + * + * @var ?Money $appliedMoney + */ + #[JsonProperty('applied_money')] + private ?Money $appliedMoney; + + /** + * Application-defined data attached to this discount. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * Indicates the level at which the discount applies. For `ORDER` scoped discounts, + * Square generates references in `applied_discounts` on all order line items that do + * not have them. For `LINE_ITEM` scoped discounts, the discount only applies to line items + * with a discount reference in their `applied_discounts` field. + * + * This field is immutable. To change the scope of a discount, you must delete + * the discount and re-add it as a new discount. + * See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * The reward IDs corresponding to this discount. The application and + * specification of discounts that have `reward_ids` are completely controlled by the backing + * criteria corresponding to the reward tiers of the rewards that are added to the order + * through the Loyalty API. To manually unapply discounts that are the result of added rewards, + * the rewards must be removed from the order through the Loyalty API. + * + * @var ?array $rewardIds + */ + #[JsonProperty('reward_ids'), ArrayType(['string'])] + private ?array $rewardIds; + + /** + * The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied + * automatically to this discount. The specification and application of the discounts, to + * which a `pricing_rule_id` is assigned, are completely controlled by the corresponding + * pricing rule. + * + * @var ?string $pricingRuleId + */ + #[JsonProperty('pricing_rule_id')] + private ?string $pricingRuleId; + + /** + * @param array{ + * uid?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * name?: ?string, + * type?: ?value-of, + * percentage?: ?string, + * amountMoney?: ?Money, + * appliedMoney?: ?Money, + * metadata?: ?array, + * scope?: ?value-of, + * rewardIds?: ?array, + * pricingRuleId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->type = $values['type'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->scope = $values['scope'] ?? null; + $this->rewardIds = $values['rewardIds'] ?? null; + $this->pricingRuleId = $values['pricingRuleId'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRewardIds(): ?array + { + return $this->rewardIds; + } + + /** + * @param ?array $value + */ + public function setRewardIds(?array $value = null): self + { + $this->rewardIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPricingRuleId(): ?string + { + return $this->pricingRuleId; + } + + /** + * @param ?string $value + */ + public function setPricingRuleId(?string $value = null): self + { + $this->pricingRuleId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemDiscountScope.php b/src/Types/OrderLineItemDiscountScope.php new file mode 100644 index 00000000..0904f3d8 --- /dev/null +++ b/src/Types/OrderLineItemDiscountScope.php @@ -0,0 +1,10 @@ + $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * @param array{ + * uid?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * name?: ?string, + * quantity?: ?string, + * basePriceMoney?: ?Money, + * totalPriceMoney?: ?Money, + * metadata?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->quantity = $values['quantity'] ?? null; + $this->basePriceMoney = $values['basePriceMoney'] ?? null; + $this->totalPriceMoney = $values['totalPriceMoney'] ?? null; + $this->metadata = $values['metadata'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getBasePriceMoney(): ?Money + { + return $this->basePriceMoney; + } + + /** + * @param ?Money $value + */ + public function setBasePriceMoney(?Money $value = null): self + { + $this->basePriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalPriceMoney(): ?Money + { + return $this->totalPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalPriceMoney(?Money $value = null): self + { + $this->totalPriceMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemPricingBlocklists.php b/src/Types/OrderLineItemPricingBlocklists.php new file mode 100644 index 00000000..e7ba0599 --- /dev/null +++ b/src/Types/OrderLineItemPricingBlocklists.php @@ -0,0 +1,90 @@ + $blockedDiscounts + */ + #[JsonProperty('blocked_discounts'), ArrayType([OrderLineItemPricingBlocklistsBlockedDiscount::class])] + private ?array $blockedDiscounts; + + /** + * A list of taxes blocked from applying to the line item. + * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or + * the `tax_catalog_object_id` (for catalog taxes). + * + * @var ?array $blockedTaxes + */ + #[JsonProperty('blocked_taxes'), ArrayType([OrderLineItemPricingBlocklistsBlockedTax::class])] + private ?array $blockedTaxes; + + /** + * @param array{ + * blockedDiscounts?: ?array, + * blockedTaxes?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->blockedDiscounts = $values['blockedDiscounts'] ?? null; + $this->blockedTaxes = $values['blockedTaxes'] ?? null; + } + + /** + * @return ?array + */ + public function getBlockedDiscounts(): ?array + { + return $this->blockedDiscounts; + } + + /** + * @param ?array $value + */ + public function setBlockedDiscounts(?array $value = null): self + { + $this->blockedDiscounts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getBlockedTaxes(): ?array + { + return $this->blockedTaxes; + } + + /** + * @param ?array $value + */ + public function setBlockedTaxes(?array $value = null): self + { + $this->blockedTaxes = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemPricingBlocklistsBlockedDiscount.php b/src/Types/OrderLineItemPricingBlocklistsBlockedDiscount.php new file mode 100644 index 00000000..2e2b8aea --- /dev/null +++ b/src/Types/OrderLineItemPricingBlocklistsBlockedDiscount.php @@ -0,0 +1,112 @@ +uid = $values['uid'] ?? null; + $this->discountUid = $values['discountUid'] ?? null; + $this->discountCatalogObjectId = $values['discountCatalogObjectId'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDiscountUid(): ?string + { + return $this->discountUid; + } + + /** + * @param ?string $value + */ + public function setDiscountUid(?string $value = null): self + { + $this->discountUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDiscountCatalogObjectId(): ?string + { + return $this->discountCatalogObjectId; + } + + /** + * @param ?string $value + */ + public function setDiscountCatalogObjectId(?string $value = null): self + { + $this->discountCatalogObjectId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemPricingBlocklistsBlockedTax.php b/src/Types/OrderLineItemPricingBlocklistsBlockedTax.php new file mode 100644 index 00000000..78987b25 --- /dev/null +++ b/src/Types/OrderLineItemPricingBlocklistsBlockedTax.php @@ -0,0 +1,112 @@ +uid = $values['uid'] ?? null; + $this->taxUid = $values['taxUid'] ?? null; + $this->taxCatalogObjectId = $values['taxCatalogObjectId'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTaxUid(): ?string + { + return $this->taxUid; + } + + /** + * @param ?string $value + */ + public function setTaxUid(?string $value = null): self + { + $this->taxUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTaxCatalogObjectId(): ?string + { + return $this->taxCatalogObjectId; + } + + /** + * @param ?string $value + */ + public function setTaxCatalogObjectId(?string $value = null): self + { + $this->taxCatalogObjectId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemTax.php b/src/Types/OrderLineItemTax.php new file mode 100644 index 00000000..26e0155f --- /dev/null +++ b/src/Types/OrderLineItemTax.php @@ -0,0 +1,329 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The percentage of the tax, as a string representation of a decimal + * number. For example, a value of `"7.25"` corresponds to a percentage of + * 7.25%. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * Application-defined data attached to this tax. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * The amount of money applied to the order by the tax. + * + * - For percentage-based taxes, `applied_money` is the money + * calculated using the percentage. + * + * @var ?Money $appliedMoney + */ + #[JsonProperty('applied_money')] + private ?Money $appliedMoney; + + /** + * Indicates the level at which the tax applies. For `ORDER` scoped taxes, + * Square generates references in `applied_taxes` on all order line items that do + * not have them. For `LINE_ITEM` scoped taxes, the tax only applies to line items + * with references in their `applied_taxes` field. + * + * This field is immutable. To change the scope, you must delete the tax and + * re-add it as a new tax. + * See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * Determines whether the tax was automatically applied to the order based on + * the catalog configuration. For an example, see + * [Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes). + * + * @var ?bool $autoApplied + */ + #[JsonProperty('auto_applied')] + private ?bool $autoApplied; + + /** + * @param array{ + * uid?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * name?: ?string, + * type?: ?value-of, + * percentage?: ?string, + * metadata?: ?array, + * appliedMoney?: ?Money, + * scope?: ?value-of, + * autoApplied?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->type = $values['type'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->scope = $values['scope'] ?? null; + $this->autoApplied = $values['autoApplied'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAutoApplied(): ?bool + { + return $this->autoApplied; + } + + /** + * @param ?bool $value + */ + public function setAutoApplied(?bool $value = null): self + { + $this->autoApplied = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderLineItemTaxScope.php b/src/Types/OrderLineItemTaxScope.php new file mode 100644 index 00000000..bcd4238a --- /dev/null +++ b/src/Types/OrderLineItemTaxScope.php @@ -0,0 +1,10 @@ +totalMoney = $values['totalMoney'] ?? null; + $this->taxMoney = $values['taxMoney'] ?? null; + $this->discountMoney = $values['discountMoney'] ?? null; + $this->tipMoney = $values['tipMoney'] ?? null; + $this->serviceChargeMoney = $values['serviceChargeMoney'] ?? null; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTaxMoney(): ?Money + { + return $this->taxMoney; + } + + /** + * @param ?Money $value + */ + public function setTaxMoney(?Money $value = null): self + { + $this->taxMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getDiscountMoney(): ?Money + { + return $this->discountMoney; + } + + /** + * @param ?Money $value + */ + public function setDiscountMoney(?Money $value = null): self + { + $this->discountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTipMoney(): ?Money + { + return $this->tipMoney; + } + + /** + * @param ?Money $value + */ + public function setTipMoney(?Money $value = null): self + { + $this->tipMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getServiceChargeMoney(): ?Money + { + return $this->serviceChargeMoney; + } + + /** + * @param ?Money $value + */ + public function setServiceChargeMoney(?Money $value = null): self + { + $this->serviceChargeMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderPricingOptions.php b/src/Types/OrderPricingOptions.php new file mode 100644 index 00000000..6ceb5e55 --- /dev/null +++ b/src/Types/OrderPricingOptions.php @@ -0,0 +1,87 @@ +autoApplyDiscounts = $values['autoApplyDiscounts'] ?? null; + $this->autoApplyTaxes = $values['autoApplyTaxes'] ?? null; + } + + /** + * @return ?bool + */ + public function getAutoApplyDiscounts(): ?bool + { + return $this->autoApplyDiscounts; + } + + /** + * @param ?bool $value + */ + public function setAutoApplyDiscounts(?bool $value = null): self + { + $this->autoApplyDiscounts = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAutoApplyTaxes(): ?bool + { + return $this->autoApplyTaxes; + } + + /** + * @param ?bool $value + */ + public function setAutoApplyTaxes(?bool $value = null): self + { + $this->autoApplyTaxes = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderQuantityUnit.php b/src/Types/OrderQuantityUnit.php new file mode 100644 index 00000000..78856d68 --- /dev/null +++ b/src/Types/OrderQuantityUnit.php @@ -0,0 +1,149 @@ +measurementUnit = $values['measurementUnit'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + } + + /** + * @return ?MeasurementUnit + */ + public function getMeasurementUnit(): ?MeasurementUnit + { + return $this->measurementUnit; + } + + /** + * @param ?MeasurementUnit $value + */ + public function setMeasurementUnit(?MeasurementUnit $value = null): self + { + $this->measurementUnit = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPrecision(): ?int + { + return $this->precision; + } + + /** + * @param ?int $value + */ + public function setPrecision(?int $value = null): self + { + $this->precision = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturn.php b/src/Types/OrderReturn.php new file mode 100644 index 00000000..0eef00fc --- /dev/null +++ b/src/Types/OrderReturn.php @@ -0,0 +1,270 @@ + $returnLineItems A collection of line items that are being returned. + */ + #[JsonProperty('return_line_items'), ArrayType([OrderReturnLineItem::class])] + private ?array $returnLineItems; + + /** + * @var ?array $returnServiceCharges A collection of service charges that are being returned. + */ + #[JsonProperty('return_service_charges'), ArrayType([OrderReturnServiceCharge::class])] + private ?array $returnServiceCharges; + + /** + * A collection of references to taxes being returned for an order, including the total + * applied tax amount to be returned. The taxes must reference a top-level tax ID from the source + * order. + * + * @var ?array $returnTaxes + */ + #[JsonProperty('return_taxes'), ArrayType([OrderReturnTax::class])] + private ?array $returnTaxes; + + /** + * A collection of references to discounts being returned for an order, including the total + * applied discount amount to be returned. The discounts must reference a top-level discount ID + * from the source order. + * + * @var ?array $returnDiscounts + */ + #[JsonProperty('return_discounts'), ArrayType([OrderReturnDiscount::class])] + private ?array $returnDiscounts; + + /** + * @var ?array $returnTips A collection of references to tips being returned for an order. + */ + #[JsonProperty('return_tips'), ArrayType([OrderReturnTip::class])] + private ?array $returnTips; + + /** + * A positive or negative rounding adjustment to the total value being returned. Adjustments are commonly + * used to apply cash rounding when the minimum unit of the account is smaller than the lowest + * physical denomination of the currency. + * + * @var ?OrderRoundingAdjustment $roundingAdjustment + */ + #[JsonProperty('rounding_adjustment')] + private ?OrderRoundingAdjustment $roundingAdjustment; + + /** + * @var ?OrderMoneyAmounts $returnAmounts An aggregate monetary value being returned by this return entry. + */ + #[JsonProperty('return_amounts')] + private ?OrderMoneyAmounts $returnAmounts; + + /** + * @param array{ + * uid?: ?string, + * sourceOrderId?: ?string, + * returnLineItems?: ?array, + * returnServiceCharges?: ?array, + * returnTaxes?: ?array, + * returnDiscounts?: ?array, + * returnTips?: ?array, + * roundingAdjustment?: ?OrderRoundingAdjustment, + * returnAmounts?: ?OrderMoneyAmounts, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->sourceOrderId = $values['sourceOrderId'] ?? null; + $this->returnLineItems = $values['returnLineItems'] ?? null; + $this->returnServiceCharges = $values['returnServiceCharges'] ?? null; + $this->returnTaxes = $values['returnTaxes'] ?? null; + $this->returnDiscounts = $values['returnDiscounts'] ?? null; + $this->returnTips = $values['returnTips'] ?? null; + $this->roundingAdjustment = $values['roundingAdjustment'] ?? null; + $this->returnAmounts = $values['returnAmounts'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceOrderId(): ?string + { + return $this->sourceOrderId; + } + + /** + * @param ?string $value + */ + public function setSourceOrderId(?string $value = null): self + { + $this->sourceOrderId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnLineItems(): ?array + { + return $this->returnLineItems; + } + + /** + * @param ?array $value + */ + public function setReturnLineItems(?array $value = null): self + { + $this->returnLineItems = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnServiceCharges(): ?array + { + return $this->returnServiceCharges; + } + + /** + * @param ?array $value + */ + public function setReturnServiceCharges(?array $value = null): self + { + $this->returnServiceCharges = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnTaxes(): ?array + { + return $this->returnTaxes; + } + + /** + * @param ?array $value + */ + public function setReturnTaxes(?array $value = null): self + { + $this->returnTaxes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnDiscounts(): ?array + { + return $this->returnDiscounts; + } + + /** + * @param ?array $value + */ + public function setReturnDiscounts(?array $value = null): self + { + $this->returnDiscounts = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnTips(): ?array + { + return $this->returnTips; + } + + /** + * @param ?array $value + */ + public function setReturnTips(?array $value = null): self + { + $this->returnTips = $value; + return $this; + } + + /** + * @return ?OrderRoundingAdjustment + */ + public function getRoundingAdjustment(): ?OrderRoundingAdjustment + { + return $this->roundingAdjustment; + } + + /** + * @param ?OrderRoundingAdjustment $value + */ + public function setRoundingAdjustment(?OrderRoundingAdjustment $value = null): self + { + $this->roundingAdjustment = $value; + return $this; + } + + /** + * @return ?OrderMoneyAmounts + */ + public function getReturnAmounts(): ?OrderMoneyAmounts + { + return $this->returnAmounts; + } + + /** + * @param ?OrderMoneyAmounts $value + */ + public function setReturnAmounts(?OrderMoneyAmounts $value = null): self + { + $this->returnAmounts = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnDiscount.php b/src/Types/OrderReturnDiscount.php new file mode 100644 index 00000000..b96b56c6 --- /dev/null +++ b/src/Types/OrderReturnDiscount.php @@ -0,0 +1,309 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The percentage of the tax, as a string representation of a decimal number. + * A value of `"7.25"` corresponds to a percentage of 7.25%. + * + * `percentage` is not set for amount-based discounts. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * The total declared monetary amount of the discount. + * + * `amount_money` is not set for percentage-based discounts. + * + * @var ?Money $amountMoney + */ + #[JsonProperty('amount_money')] + private ?Money $amountMoney; + + /** + * The amount of discount actually applied to this line item. When an amount-based + * discount is at the order level, this value is different from `amount_money` because the discount + * is distributed across the line items. + * + * @var ?Money $appliedMoney + */ + #[JsonProperty('applied_money')] + private ?Money $appliedMoney; + + /** + * Indicates the level at which the `OrderReturnDiscount` applies. For `ORDER` scoped + * discounts, the server generates references in `applied_discounts` on all + * `OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount is only applied to + * `OrderReturnLineItem`s with references in their `applied_discounts` field. + * See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * @param array{ + * uid?: ?string, + * sourceDiscountUid?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * name?: ?string, + * type?: ?value-of, + * percentage?: ?string, + * amountMoney?: ?Money, + * appliedMoney?: ?Money, + * scope?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->sourceDiscountUid = $values['sourceDiscountUid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->type = $values['type'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->scope = $values['scope'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceDiscountUid(): ?string + { + return $this->sourceDiscountUid; + } + + /** + * @param ?string $value + */ + public function setSourceDiscountUid(?string $value = null): self + { + $this->sourceDiscountUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnLineItem.php b/src/Types/OrderReturnLineItem.php new file mode 100644 index 00000000..3b61d358 --- /dev/null +++ b/src/Types/OrderReturnLineItem.php @@ -0,0 +1,584 @@ + $itemType + */ + #[JsonProperty('item_type')] + private ?string $itemType; + + /** + * @var ?array $returnModifiers The [CatalogModifier](entity:CatalogModifier)s applied to this line item. + */ + #[JsonProperty('return_modifiers'), ArrayType([OrderReturnLineItemModifier::class])] + private ?array $returnModifiers; + + /** + * The list of references to `OrderReturnTax` entities applied to the return line item. Each + * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level + * `OrderReturnTax` applied to the return line item. On reads, the applied amount + * is populated. + * + * @var ?array $appliedTaxes + */ + #[JsonProperty('applied_taxes'), ArrayType([OrderLineItemAppliedTax::class])] + private ?array $appliedTaxes; + + /** + * The list of references to `OrderReturnDiscount` entities applied to the return line item. Each + * `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level + * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount + * is populated. + * + * @var ?array $appliedDiscounts + */ + #[JsonProperty('applied_discounts'), ArrayType([OrderLineItemAppliedDiscount::class])] + private ?array $appliedDiscounts; + + /** + * @var ?Money $basePriceMoney The base price for a single unit of the line item. + */ + #[JsonProperty('base_price_money')] + private ?Money $basePriceMoney; + + /** + * The total price of all item variations returned in this line item. + * The price is calculated as `base_price_money` multiplied by `quantity` and + * does not include modifiers. + * + * @var ?Money $variationTotalPriceMoney + */ + #[JsonProperty('variation_total_price_money')] + private ?Money $variationTotalPriceMoney; + + /** + * @var ?Money $grossReturnMoney The gross return amount of money calculated as (item base price + modifiers price) * quantity. + */ + #[JsonProperty('gross_return_money')] + private ?Money $grossReturnMoney; + + /** + * @var ?Money $totalTaxMoney The total amount of tax money to return for the line item. + */ + #[JsonProperty('total_tax_money')] + private ?Money $totalTaxMoney; + + /** + * @var ?Money $totalDiscountMoney The total amount of discount money to return for the line item. + */ + #[JsonProperty('total_discount_money')] + private ?Money $totalDiscountMoney; + + /** + * @var ?Money $totalMoney The total amount of money to return for this line item. + */ + #[JsonProperty('total_money')] + private ?Money $totalMoney; + + /** + * The list of references to `OrderReturnServiceCharge` entities applied to the return + * line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that + * references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line + * item. On reads, the applied amount is populated. + * + * @var ?array $appliedServiceCharges + */ + #[JsonProperty('applied_service_charges'), ArrayType([OrderLineItemAppliedServiceCharge::class])] + private ?array $appliedServiceCharges; + + /** + * @var ?Money $totalServiceChargeMoney The total amount of apportioned service charge money to return for the line item. + */ + #[JsonProperty('total_service_charge_money')] + private ?Money $totalServiceChargeMoney; + + /** + * @param array{ + * quantity: string, + * uid?: ?string, + * sourceLineItemUid?: ?string, + * name?: ?string, + * quantityUnit?: ?OrderQuantityUnit, + * note?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * variationName?: ?string, + * itemType?: ?value-of, + * returnModifiers?: ?array, + * appliedTaxes?: ?array, + * appliedDiscounts?: ?array, + * basePriceMoney?: ?Money, + * variationTotalPriceMoney?: ?Money, + * grossReturnMoney?: ?Money, + * totalTaxMoney?: ?Money, + * totalDiscountMoney?: ?Money, + * totalMoney?: ?Money, + * appliedServiceCharges?: ?array, + * totalServiceChargeMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->uid = $values['uid'] ?? null; + $this->sourceLineItemUid = $values['sourceLineItemUid'] ?? null; + $this->name = $values['name'] ?? null; + $this->quantity = $values['quantity']; + $this->quantityUnit = $values['quantityUnit'] ?? null; + $this->note = $values['note'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->variationName = $values['variationName'] ?? null; + $this->itemType = $values['itemType'] ?? null; + $this->returnModifiers = $values['returnModifiers'] ?? null; + $this->appliedTaxes = $values['appliedTaxes'] ?? null; + $this->appliedDiscounts = $values['appliedDiscounts'] ?? null; + $this->basePriceMoney = $values['basePriceMoney'] ?? null; + $this->variationTotalPriceMoney = $values['variationTotalPriceMoney'] ?? null; + $this->grossReturnMoney = $values['grossReturnMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->totalDiscountMoney = $values['totalDiscountMoney'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->appliedServiceCharges = $values['appliedServiceCharges'] ?? null; + $this->totalServiceChargeMoney = $values['totalServiceChargeMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceLineItemUid(): ?string + { + return $this->sourceLineItemUid; + } + + /** + * @param ?string $value + */ + public function setSourceLineItemUid(?string $value = null): self + { + $this->sourceLineItemUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function getQuantity(): string + { + return $this->quantity; + } + + /** + * @param string $value + */ + public function setQuantity(string $value): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return ?OrderQuantityUnit + */ + public function getQuantityUnit(): ?OrderQuantityUnit + { + return $this->quantityUnit; + } + + /** + * @param ?OrderQuantityUnit $value + */ + public function setQuantityUnit(?OrderQuantityUnit $value = null): self + { + $this->quantityUnit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVariationName(): ?string + { + return $this->variationName; + } + + /** + * @param ?string $value + */ + public function setVariationName(?string $value = null): self + { + $this->variationName = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getItemType(): ?string + { + return $this->itemType; + } + + /** + * @param ?value-of $value + */ + public function setItemType(?string $value = null): self + { + $this->itemType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getReturnModifiers(): ?array + { + return $this->returnModifiers; + } + + /** + * @param ?array $value + */ + public function setReturnModifiers(?array $value = null): self + { + $this->returnModifiers = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedTaxes(): ?array + { + return $this->appliedTaxes; + } + + /** + * @param ?array $value + */ + public function setAppliedTaxes(?array $value = null): self + { + $this->appliedTaxes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedDiscounts(): ?array + { + return $this->appliedDiscounts; + } + + /** + * @param ?array $value + */ + public function setAppliedDiscounts(?array $value = null): self + { + $this->appliedDiscounts = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getBasePriceMoney(): ?Money + { + return $this->basePriceMoney; + } + + /** + * @param ?Money $value + */ + public function setBasePriceMoney(?Money $value = null): self + { + $this->basePriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getVariationTotalPriceMoney(): ?Money + { + return $this->variationTotalPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setVariationTotalPriceMoney(?Money $value = null): self + { + $this->variationTotalPriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getGrossReturnMoney(): ?Money + { + return $this->grossReturnMoney; + } + + /** + * @param ?Money $value + */ + public function setGrossReturnMoney(?Money $value = null): self + { + $this->grossReturnMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTaxMoney(): ?Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTaxMoney(?Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalDiscountMoney(): ?Money + { + return $this->totalDiscountMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalDiscountMoney(?Money $value = null): self + { + $this->totalDiscountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedServiceCharges(): ?array + { + return $this->appliedServiceCharges; + } + + /** + * @param ?array $value + */ + public function setAppliedServiceCharges(?array $value = null): self + { + $this->appliedServiceCharges = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalServiceChargeMoney(): ?Money + { + return $this->totalServiceChargeMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalServiceChargeMoney(?Money $value = null): self + { + $this->totalServiceChargeMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnLineItemModifier.php b/src/Types/OrderReturnLineItemModifier.php new file mode 100644 index 00000000..457c2537 --- /dev/null +++ b/src/Types/OrderReturnLineItemModifier.php @@ -0,0 +1,248 @@ +uid = $values['uid'] ?? null; + $this->sourceModifierUid = $values['sourceModifierUid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->basePriceMoney = $values['basePriceMoney'] ?? null; + $this->totalPriceMoney = $values['totalPriceMoney'] ?? null; + $this->quantity = $values['quantity'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceModifierUid(): ?string + { + return $this->sourceModifierUid; + } + + /** + * @param ?string $value + */ + public function setSourceModifierUid(?string $value = null): self + { + $this->sourceModifierUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getBasePriceMoney(): ?Money + { + return $this->basePriceMoney; + } + + /** + * @param ?Money $value + */ + public function setBasePriceMoney(?Money $value = null): self + { + $this->basePriceMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalPriceMoney(): ?Money + { + return $this->totalPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalPriceMoney(?Money $value = null): self + { + $this->totalPriceMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getQuantity(): ?string + { + return $this->quantity; + } + + /** + * @param ?string $value + */ + public function setQuantity(?string $value = null): self + { + $this->quantity = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnServiceCharge.php b/src/Types/OrderReturnServiceCharge.php new file mode 100644 index 00000000..7c632770 --- /dev/null +++ b/src/Types/OrderReturnServiceCharge.php @@ -0,0 +1,456 @@ + $calculationPhase + */ + #[JsonProperty('calculation_phase')] + private ?string $calculationPhase; + + /** + * Indicates whether the surcharge can be taxed. Service charges + * calculated in the `TOTAL_PHASE` cannot be marked as taxable. + * + * @var ?bool $taxable + */ + #[JsonProperty('taxable')] + private ?bool $taxable; + + /** + * The list of references to `OrderReturnTax` entities applied to the + * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` + * that references the `uid` of a top-level `OrderReturnTax` that is being + * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is + * populated. + * + * @var ?array $appliedTaxes + */ + #[JsonProperty('applied_taxes'), ArrayType([OrderLineItemAppliedTax::class])] + private ?array $appliedTaxes; + + /** + * The treatment type of the service charge. + * See [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values + * + * @var ?value-of $treatmentType + */ + #[JsonProperty('treatment_type')] + private ?string $treatmentType; + + /** + * Indicates the level at which the apportioned service charge applies. For `ORDER` + * scoped service charges, Square generates references in `applied_service_charges` on + * all order line items that do not have them. For `LINE_ITEM` scoped service charges, + * the service charge only applies to line items with a service charge reference in their + * `applied_service_charges` field. + * + * This field is immutable. To change the scope of an apportioned service charge, you must delete + * the apportioned service charge and re-add it as a new apportioned service charge. + * See [OrderServiceChargeScope](#type-orderservicechargescope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * @param array{ + * uid?: ?string, + * sourceServiceChargeUid?: ?string, + * name?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * percentage?: ?string, + * amountMoney?: ?Money, + * appliedMoney?: ?Money, + * totalMoney?: ?Money, + * totalTaxMoney?: ?Money, + * calculationPhase?: ?value-of, + * taxable?: ?bool, + * appliedTaxes?: ?array, + * treatmentType?: ?value-of, + * scope?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->sourceServiceChargeUid = $values['sourceServiceChargeUid'] ?? null; + $this->name = $values['name'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->calculationPhase = $values['calculationPhase'] ?? null; + $this->taxable = $values['taxable'] ?? null; + $this->appliedTaxes = $values['appliedTaxes'] ?? null; + $this->treatmentType = $values['treatmentType'] ?? null; + $this->scope = $values['scope'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceServiceChargeUid(): ?string + { + return $this->sourceServiceChargeUid; + } + + /** + * @param ?string $value + */ + public function setSourceServiceChargeUid(?string $value = null): self + { + $this->sourceServiceChargeUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTaxMoney(): ?Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTaxMoney(?Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCalculationPhase(): ?string + { + return $this->calculationPhase; + } + + /** + * @param ?value-of $value + */ + public function setCalculationPhase(?string $value = null): self + { + $this->calculationPhase = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTaxable(): ?bool + { + return $this->taxable; + } + + /** + * @param ?bool $value + */ + public function setTaxable(?bool $value = null): self + { + $this->taxable = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedTaxes(): ?array + { + return $this->appliedTaxes; + } + + /** + * @param ?array $value + */ + public function setAppliedTaxes(?array $value = null): self + { + $this->appliedTaxes = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getTreatmentType(): ?string + { + return $this->treatmentType; + } + + /** + * @param ?value-of $value + */ + public function setTreatmentType(?string $value = null): self + { + $this->treatmentType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnTax.php b/src/Types/OrderReturnTax.php new file mode 100644 index 00000000..55941957 --- /dev/null +++ b/src/Types/OrderReturnTax.php @@ -0,0 +1,270 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The percentage of the tax, as a string representation of a decimal number. + * For example, a value of `"7.25"` corresponds to a percentage of 7.25%. + * + * @var ?string $percentage + */ + #[JsonProperty('percentage')] + private ?string $percentage; + + /** + * @var ?Money $appliedMoney The amount of money applied by the tax in an order. + */ + #[JsonProperty('applied_money')] + private ?Money $appliedMoney; + + /** + * Indicates the level at which the `OrderReturnTax` applies. For `ORDER` scoped + * taxes, Square generates references in `applied_taxes` on all + * `OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only applied to + * `OrderReturnLineItem`s with references in their `applied_discounts` field. + * See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * @param array{ + * uid?: ?string, + * sourceTaxUid?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * name?: ?string, + * type?: ?value-of, + * percentage?: ?string, + * appliedMoney?: ?Money, + * scope?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->sourceTaxUid = $values['sourceTaxUid'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->name = $values['name'] ?? null; + $this->type = $values['type'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->scope = $values['scope'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceTaxUid(): ?string + { + return $this->sourceTaxUid; + } + + /** + * @param ?string $value + */ + public function setSourceTaxUid(?string $value = null): self + { + $this->sourceTaxUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnTip.php b/src/Types/OrderReturnTip.php new file mode 100644 index 00000000..8ffb2088 --- /dev/null +++ b/src/Types/OrderReturnTip.php @@ -0,0 +1,132 @@ +uid = $values['uid'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->sourceTenderUid = $values['sourceTenderUid'] ?? null; + $this->sourceTenderId = $values['sourceTenderId'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceTenderUid(): ?string + { + return $this->sourceTenderUid; + } + + /** + * @param ?string $value + */ + public function setSourceTenderUid(?string $value = null): self + { + $this->sourceTenderUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceTenderId(): ?string + { + return $this->sourceTenderId; + } + + /** + * @param ?string $value + */ + public function setSourceTenderId(?string $value = null): self + { + $this->sourceTenderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReward.php b/src/Types/OrderReward.php new file mode 100644 index 00000000..2cc54a12 --- /dev/null +++ b/src/Types/OrderReward.php @@ -0,0 +1,80 @@ +id = $values['id']; + $this->rewardTierId = $values['rewardTierId']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getRewardTierId(): string + { + return $this->rewardTierId; + } + + /** + * @param string $value + */ + public function setRewardTierId(string $value): self + { + $this->rewardTierId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderRoundingAdjustment.php b/src/Types/OrderRoundingAdjustment.php new file mode 100644 index 00000000..7b99252a --- /dev/null +++ b/src/Types/OrderRoundingAdjustment.php @@ -0,0 +1,105 @@ +uid = $values['uid'] ?? null; + $this->name = $values['name'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderServiceCharge.php b/src/Types/OrderServiceCharge.php new file mode 100644 index 00000000..3e99f151 --- /dev/null +++ b/src/Types/OrderServiceCharge.php @@ -0,0 +1,509 @@ + $calculationPhase + */ + #[JsonProperty('calculation_phase')] + private ?string $calculationPhase; + + /** + * Indicates whether the service charge can be taxed. If set to `true`, + * order-level taxes automatically apply to the service charge. Note that + * service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. + * + * @var ?bool $taxable + */ + #[JsonProperty('taxable')] + private ?bool $taxable; + + /** + * The list of references to the taxes applied to this service charge. Each + * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level + * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied + * is populated. + * + * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge + * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records + * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable + * service charge. Taxable service charges have the `taxable` field set to `true` and calculated + * in the `SUBTOTAL_PHASE`. + * + * To change the amount of a tax, modify the referenced top-level tax. + * + * @var ?array $appliedTaxes + */ + #[JsonProperty('applied_taxes'), ArrayType([OrderLineItemAppliedTax::class])] + private ?array $appliedTaxes; + + /** + * Application-defined data attached to this service charge. Metadata fields are intended + * to store descriptive references or associations with an entity in another system or store brief + * information about the object. Square does not process this field; it only stores and returns it + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). + * + * Keys written by applications must be 60 characters or less and must be in the character set + * `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed + * with a namespace, separated from the key with a ':' character. + * + * Values have a maximum length of 255 characters. + * + * An application can have up to 10 entries per metadata field. + * + * Entries written by applications are private and can only be read or modified by the same + * application. + * + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + * + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => new Union('string', 'null')])] + private ?array $metadata; + + /** + * The type of the service charge. + * See [OrderServiceChargeType](#type-orderservicechargetype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * The treatment type of the service charge. + * See [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values + * + * @var ?value-of $treatmentType + */ + #[JsonProperty('treatment_type')] + private ?string $treatmentType; + + /** + * Indicates the level at which the apportioned service charge applies. For `ORDER` + * scoped service charges, Square generates references in `applied_service_charges` on + * all order line items that do not have them. For `LINE_ITEM` scoped service charges, + * the service charge only applies to line items with a service charge reference in their + * `applied_service_charges` field. + * + * This field is immutable. To change the scope of an apportioned service charge, you must delete + * the apportioned service charge and re-add it as a new apportioned service charge. + * See [OrderServiceChargeScope](#type-orderservicechargescope) for possible values + * + * @var ?value-of $scope + */ + #[JsonProperty('scope')] + private ?string $scope; + + /** + * @param array{ + * uid?: ?string, + * name?: ?string, + * catalogObjectId?: ?string, + * catalogVersion?: ?int, + * percentage?: ?string, + * amountMoney?: ?Money, + * appliedMoney?: ?Money, + * totalMoney?: ?Money, + * totalTaxMoney?: ?Money, + * calculationPhase?: ?value-of, + * taxable?: ?bool, + * appliedTaxes?: ?array, + * metadata?: ?array, + * type?: ?value-of, + * treatmentType?: ?value-of, + * scope?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->uid = $values['uid'] ?? null; + $this->name = $values['name'] ?? null; + $this->catalogObjectId = $values['catalogObjectId'] ?? null; + $this->catalogVersion = $values['catalogVersion'] ?? null; + $this->percentage = $values['percentage'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->calculationPhase = $values['calculationPhase'] ?? null; + $this->taxable = $values['taxable'] ?? null; + $this->appliedTaxes = $values['appliedTaxes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->type = $values['type'] ?? null; + $this->treatmentType = $values['treatmentType'] ?? null; + $this->scope = $values['scope'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCatalogObjectId(): ?string + { + return $this->catalogObjectId; + } + + /** + * @param ?string $value + */ + public function setCatalogObjectId(?string $value = null): self + { + $this->catalogObjectId = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCatalogVersion(): ?int + { + return $this->catalogVersion; + } + + /** + * @param ?int $value + */ + public function setCatalogVersion(?int $value = null): self + { + $this->catalogVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPercentage(): ?string + { + return $this->percentage; + } + + /** + * @param ?string $value + */ + public function setPercentage(?string $value = null): self + { + $this->percentage = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppliedMoney(): ?Money + { + return $this->appliedMoney; + } + + /** + * @param ?Money $value + */ + public function setAppliedMoney(?Money $value = null): self + { + $this->appliedMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalTaxMoney(): ?Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalTaxMoney(?Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCalculationPhase(): ?string + { + return $this->calculationPhase; + } + + /** + * @param ?value-of $value + */ + public function setCalculationPhase(?string $value = null): self + { + $this->calculationPhase = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTaxable(): ?bool + { + return $this->taxable; + } + + /** + * @param ?bool $value + */ + public function setTaxable(?bool $value = null): self + { + $this->taxable = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAppliedTaxes(): ?array + { + return $this->appliedTaxes; + } + + /** + * @param ?array $value + */ + public function setAppliedTaxes(?array $value = null): self + { + $this->appliedTaxes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getTreatmentType(): ?string + { + return $this->treatmentType; + } + + /** + * @param ?value-of $value + */ + public function setTreatmentType(?string $value = null): self + { + $this->treatmentType = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * @param ?value-of $value + */ + public function setScope(?string $value = null): self + { + $this->scope = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderServiceChargeCalculationPhase.php b/src/Types/OrderServiceChargeCalculationPhase.php new file mode 100644 index 00000000..24e98ccc --- /dev/null +++ b/src/Types/OrderServiceChargeCalculationPhase.php @@ -0,0 +1,11 @@ +name = $values['name'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderState.php b/src/Types/OrderState.php new file mode 100644 index 00000000..b1385d76 --- /dev/null +++ b/src/Types/OrderState.php @@ -0,0 +1,11 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The subscription to be paused by the scheduled `PAUSE` action. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @var ?array $actions The list of a `PAUSE` action and a possible `RESUME` action created by the request. + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * actions?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PayOrderResponse.php b/src/Types/PayOrderResponse.php new file mode 100644 index 00000000..d1a2b828 --- /dev/null +++ b/src/Types/PayOrderResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Order $order The paid, updated [order](entity:Order). + */ + #[JsonProperty('order')] + private ?Order $order; + + /** + * @param array{ + * errors?: ?array, + * order?: ?Order, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->order = $values['order'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Payment.php b/src/Types/Payment.php new file mode 100644 index 00000000..97c8dfa1 --- /dev/null +++ b/src/Types/Payment.php @@ -0,0 +1,1258 @@ + $processingFee The processing fees and fee adjustments assessed by Square for this payment. + */ + #[JsonProperty('processing_fee'), ArrayType([ProcessingFee::class])] + private ?array $processingFee; + + /** + * The total amount of the payment refunded to date. + * + * This amount is specified in the smallest denomination of the applicable currency (for example, + * US dollar amounts are specified in cents). + * + * @var ?Money $refundedMoney + */ + #[JsonProperty('refunded_money')] + private ?Money $refundedMoney; + + /** + * @var ?string $status Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * The duration of time after the payment's creation when Square automatically applies the + * `delay_action` to the payment. This automatic `delay_action` applies only to payments that + * do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration` + * time period. + * + * This field is specified as a time duration, in RFC 3339 format. + * + * Notes: + * This feature is only supported for card payments. + * + * Default: + * + * - Card-present payments: "PT36H" (36 hours) from the creation time. + * - Card-not-present payments: "P7D" (7 days) from the creation time. + * + * @var ?string $delayDuration + */ + #[JsonProperty('delay_duration')] + private ?string $delayDuration; + + /** + * The action to be applied to the payment when the `delay_duration` has elapsed. + * + * Current values include `CANCEL` and `COMPLETE`. + * + * @var ?string $delayAction + */ + #[JsonProperty('delay_action')] + private ?string $delayAction; + + /** + * The read-only timestamp of when the `delay_action` is automatically applied, + * in RFC 3339 format. + * + * Note that this field is calculated by summing the payment's `delay_duration` and `created_at` + * fields. The `created_at` field is generated by Square and might not exactly match the + * time on your local machine. + * + * @var ?string $delayedUntil + */ + #[JsonProperty('delayed_until')] + private ?string $delayedUntil; + + /** + * The source type for this payment. + * + * Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, + * `CASH` and `EXTERNAL`. For information about these payment source types, + * see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). + * + * @var ?string $sourceType + */ + #[JsonProperty('source_type')] + private ?string $sourceType; + + /** + * @var ?CardPaymentDetails $cardDetails Details about a card payment. These details are only populated if the source_type is `CARD`. + */ + #[JsonProperty('card_details')] + private ?CardPaymentDetails $cardDetails; + + /** + * @var ?CashPaymentDetails $cashDetails Details about a cash payment. These details are only populated if the source_type is `CASH`. + */ + #[JsonProperty('cash_details')] + private ?CashPaymentDetails $cashDetails; + + /** + * @var ?BankAccountPaymentDetails $bankAccountDetails Details about a bank account payment. These details are only populated if the source_type is `BANK_ACCOUNT`. + */ + #[JsonProperty('bank_account_details')] + private ?BankAccountPaymentDetails $bankAccountDetails; + + /** + * Details about an external payment. The details are only populated + * if the `source_type` is `EXTERNAL`. + * + * @var ?ExternalPaymentDetails $externalDetails + */ + #[JsonProperty('external_details')] + private ?ExternalPaymentDetails $externalDetails; + + /** + * Details about an wallet payment. The details are only populated + * if the `source_type` is `WALLET`. + * + * @var ?DigitalWalletDetails $walletDetails + */ + #[JsonProperty('wallet_details')] + private ?DigitalWalletDetails $walletDetails; + + /** + * Details about a Buy Now Pay Later payment. The details are only populated + * if the `source_type` is `BUY_NOW_PAY_LATER`. For more information, see + * [Afterpay Payments](https://developer.squareup.com/docs/payments-api/take-payments/afterpay-payments). + * + * @var ?BuyNowPayLaterDetails $buyNowPayLaterDetails + */ + #[JsonProperty('buy_now_pay_later_details')] + private ?BuyNowPayLaterDetails $buyNowPayLaterDetails; + + /** + * Details about a Square Account payment. The details are only populated + * if the `source_type` is `SQUARE_ACCOUNT`. + * + * @var ?SquareAccountDetails $squareAccountDetails + */ + #[JsonProperty('square_account_details')] + private ?SquareAccountDetails $squareAccountDetails; + + /** + * @var ?string $locationId The ID of the location associated with the payment. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * @var ?string $orderId The ID of the order associated with the payment. + */ + #[JsonProperty('order_id')] + private ?string $orderId; + + /** + * An optional ID that associates the payment with an entity in + * another system. + * + * @var ?string $referenceId + */ + #[JsonProperty('reference_id')] + private ?string $referenceId; + + /** + * The ID of the customer associated with the payment. If the ID is + * not provided in the `CreatePayment` request that was used to create the `Payment`, + * Square may use information in the request + * (such as the billing and shipping address, email address, and payment source) + * to identify a matching customer profile in the Customer Directory. + * If found, the profile ID is used. If a profile is not found, the + * API attempts to create an + * [instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). + * If the API cannot create an + * instant profile (either because the seller has disabled it or the + * seller's region prevents creating it), this field remains unset. Note that + * this process is asynchronous and it may take some time before a + * customer ID is added to the payment. + * + * @var ?string $customerId + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + + /** + * __Deprecated__: Use `Payment.team_member_id` instead. + * + * An optional ID of the employee associated with taking the payment. + * + * @var ?string $employeeId + */ + #[JsonProperty('employee_id')] + private ?string $employeeId; + + /** + * @var ?string $teamMemberId An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @var ?array $refundIds A list of `refund_id`s identifying refunds for the payment. + */ + #[JsonProperty('refund_ids'), ArrayType(['string'])] + private ?array $refundIds; + + /** + * Provides information about the risk associated with the payment, as determined by Square. + * This field is present for payments to sellers that have opted in to receive risk + * evaluations. + * + * @var ?RiskEvaluation $riskEvaluation + */ + #[JsonProperty('risk_evaluation')] + private ?RiskEvaluation $riskEvaluation; + + /** + * @var ?string $terminalCheckoutId An optional ID for a Terminal checkout that is associated with the payment. + */ + #[JsonProperty('terminal_checkout_id')] + private ?string $terminalCheckoutId; + + /** + * @var ?string $buyerEmailAddress The buyer's email address. + */ + #[JsonProperty('buyer_email_address')] + private ?string $buyerEmailAddress; + + /** + * @var ?Address $billingAddress The buyer's billing address. + */ + #[JsonProperty('billing_address')] + private ?Address $billingAddress; + + /** + * @var ?Address $shippingAddress The buyer's shipping address. + */ + #[JsonProperty('shipping_address')] + private ?Address $shippingAddress; + + /** + * @var ?string $note An optional note to include when creating a payment. + */ + #[JsonProperty('note')] + private ?string $note; + + /** + * Additional payment information that gets added to the customer's card statement + * as part of the statement description. + * + * Note that the `statement_description_identifier` might get truncated on the statement description + * to fit the required information including the Square identifier (SQ *) and the name of the + * seller taking the payment. + * + * @var ?string $statementDescriptionIdentifier + */ + #[JsonProperty('statement_description_identifier')] + private ?string $statementDescriptionIdentifier; + + /** + * Actions that can be performed on this payment: + * - `EDIT_AMOUNT_UP` - The payment amount can be edited up. + * - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. + * - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. + * - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. + * - `EDIT_DELAY_ACTION` - The delay_action can be edited. + * + * @var ?array $capabilities + */ + #[JsonProperty('capabilities'), ArrayType(['string'])] + private ?array $capabilities; + + /** + * The payment's receipt number. + * The field is missing if a payment is canceled. + * + * @var ?string $receiptNumber + */ + #[JsonProperty('receipt_number')] + private ?string $receiptNumber; + + /** + * The URL for the payment's receipt. + * The field is only populated for COMPLETED payments. + * + * @var ?string $receiptUrl + */ + #[JsonProperty('receipt_url')] + private ?string $receiptUrl; + + /** + * @var ?DeviceDetails $deviceDetails Details about the device that took the payment. + */ + #[JsonProperty('device_details')] + private ?DeviceDetails $deviceDetails; + + /** + * @var ?ApplicationDetails $applicationDetails Details about the application that took the payment. + */ + #[JsonProperty('application_details')] + private ?ApplicationDetails $applicationDetails; + + /** + * @var ?bool $isOfflinePayment Whether or not this payment was taken offline. + */ + #[JsonProperty('is_offline_payment')] + private ?bool $isOfflinePayment; + + /** + * @var ?OfflinePaymentDetails $offlinePaymentDetails Additional information about the payment if it was taken offline. + */ + #[JsonProperty('offline_payment_details')] + private ?OfflinePaymentDetails $offlinePaymentDetails; + + /** + * Used for optimistic concurrency. This opaque token identifies a specific version of the + * `Payment` object. + * + * @var ?string $versionToken + */ + #[JsonProperty('version_token')] + private ?string $versionToken; + + /** + * @param array{ + * id?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * amountMoney?: ?Money, + * tipMoney?: ?Money, + * totalMoney?: ?Money, + * appFeeMoney?: ?Money, + * approvedMoney?: ?Money, + * processingFee?: ?array, + * refundedMoney?: ?Money, + * status?: ?string, + * delayDuration?: ?string, + * delayAction?: ?string, + * delayedUntil?: ?string, + * sourceType?: ?string, + * cardDetails?: ?CardPaymentDetails, + * cashDetails?: ?CashPaymentDetails, + * bankAccountDetails?: ?BankAccountPaymentDetails, + * externalDetails?: ?ExternalPaymentDetails, + * walletDetails?: ?DigitalWalletDetails, + * buyNowPayLaterDetails?: ?BuyNowPayLaterDetails, + * squareAccountDetails?: ?SquareAccountDetails, + * locationId?: ?string, + * orderId?: ?string, + * referenceId?: ?string, + * customerId?: ?string, + * employeeId?: ?string, + * teamMemberId?: ?string, + * refundIds?: ?array, + * riskEvaluation?: ?RiskEvaluation, + * terminalCheckoutId?: ?string, + * buyerEmailAddress?: ?string, + * billingAddress?: ?Address, + * shippingAddress?: ?Address, + * note?: ?string, + * statementDescriptionIdentifier?: ?string, + * capabilities?: ?array, + * receiptNumber?: ?string, + * receiptUrl?: ?string, + * deviceDetails?: ?DeviceDetails, + * applicationDetails?: ?ApplicationDetails, + * isOfflinePayment?: ?bool, + * offlinePaymentDetails?: ?OfflinePaymentDetails, + * versionToken?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->tipMoney = $values['tipMoney'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->approvedMoney = $values['approvedMoney'] ?? null; + $this->processingFee = $values['processingFee'] ?? null; + $this->refundedMoney = $values['refundedMoney'] ?? null; + $this->status = $values['status'] ?? null; + $this->delayDuration = $values['delayDuration'] ?? null; + $this->delayAction = $values['delayAction'] ?? null; + $this->delayedUntil = $values['delayedUntil'] ?? null; + $this->sourceType = $values['sourceType'] ?? null; + $this->cardDetails = $values['cardDetails'] ?? null; + $this->cashDetails = $values['cashDetails'] ?? null; + $this->bankAccountDetails = $values['bankAccountDetails'] ?? null; + $this->externalDetails = $values['externalDetails'] ?? null; + $this->walletDetails = $values['walletDetails'] ?? null; + $this->buyNowPayLaterDetails = $values['buyNowPayLaterDetails'] ?? null; + $this->squareAccountDetails = $values['squareAccountDetails'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->refundIds = $values['refundIds'] ?? null; + $this->riskEvaluation = $values['riskEvaluation'] ?? null; + $this->terminalCheckoutId = $values['terminalCheckoutId'] ?? null; + $this->buyerEmailAddress = $values['buyerEmailAddress'] ?? null; + $this->billingAddress = $values['billingAddress'] ?? null; + $this->shippingAddress = $values['shippingAddress'] ?? null; + $this->note = $values['note'] ?? null; + $this->statementDescriptionIdentifier = $values['statementDescriptionIdentifier'] ?? null; + $this->capabilities = $values['capabilities'] ?? null; + $this->receiptNumber = $values['receiptNumber'] ?? null; + $this->receiptUrl = $values['receiptUrl'] ?? null; + $this->deviceDetails = $values['deviceDetails'] ?? null; + $this->applicationDetails = $values['applicationDetails'] ?? null; + $this->isOfflinePayment = $values['isOfflinePayment'] ?? null; + $this->offlinePaymentDetails = $values['offlinePaymentDetails'] ?? null; + $this->versionToken = $values['versionToken'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTipMoney(): ?Money + { + return $this->tipMoney; + } + + /** + * @param ?Money $value + */ + public function setTipMoney(?Money $value = null): self + { + $this->tipMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTotalMoney(): ?Money + { + return $this->totalMoney; + } + + /** + * @param ?Money $value + */ + public function setTotalMoney(?Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getApprovedMoney(): ?Money + { + return $this->approvedMoney; + } + + /** + * @param ?Money $value + */ + public function setApprovedMoney(?Money $value = null): self + { + $this->approvedMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getProcessingFee(): ?array + { + return $this->processingFee; + } + + /** + * @param ?array $value + */ + public function setProcessingFee(?array $value = null): self + { + $this->processingFee = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getRefundedMoney(): ?Money + { + return $this->refundedMoney; + } + + /** + * @param ?Money $value + */ + public function setRefundedMoney(?Money $value = null): self + { + $this->refundedMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayDuration(): ?string + { + return $this->delayDuration; + } + + /** + * @param ?string $value + */ + public function setDelayDuration(?string $value = null): self + { + $this->delayDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayAction(): ?string + { + return $this->delayAction; + } + + /** + * @param ?string $value + */ + public function setDelayAction(?string $value = null): self + { + $this->delayAction = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayedUntil(): ?string + { + return $this->delayedUntil; + } + + /** + * @param ?string $value + */ + public function setDelayedUntil(?string $value = null): self + { + $this->delayedUntil = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSourceType(): ?string + { + return $this->sourceType; + } + + /** + * @param ?string $value + */ + public function setSourceType(?string $value = null): self + { + $this->sourceType = $value; + return $this; + } + + /** + * @return ?CardPaymentDetails + */ + public function getCardDetails(): ?CardPaymentDetails + { + return $this->cardDetails; + } + + /** + * @param ?CardPaymentDetails $value + */ + public function setCardDetails(?CardPaymentDetails $value = null): self + { + $this->cardDetails = $value; + return $this; + } + + /** + * @return ?CashPaymentDetails + */ + public function getCashDetails(): ?CashPaymentDetails + { + return $this->cashDetails; + } + + /** + * @param ?CashPaymentDetails $value + */ + public function setCashDetails(?CashPaymentDetails $value = null): self + { + $this->cashDetails = $value; + return $this; + } + + /** + * @return ?BankAccountPaymentDetails + */ + public function getBankAccountDetails(): ?BankAccountPaymentDetails + { + return $this->bankAccountDetails; + } + + /** + * @param ?BankAccountPaymentDetails $value + */ + public function setBankAccountDetails(?BankAccountPaymentDetails $value = null): self + { + $this->bankAccountDetails = $value; + return $this; + } + + /** + * @return ?ExternalPaymentDetails + */ + public function getExternalDetails(): ?ExternalPaymentDetails + { + return $this->externalDetails; + } + + /** + * @param ?ExternalPaymentDetails $value + */ + public function setExternalDetails(?ExternalPaymentDetails $value = null): self + { + $this->externalDetails = $value; + return $this; + } + + /** + * @return ?DigitalWalletDetails + */ + public function getWalletDetails(): ?DigitalWalletDetails + { + return $this->walletDetails; + } + + /** + * @param ?DigitalWalletDetails $value + */ + public function setWalletDetails(?DigitalWalletDetails $value = null): self + { + $this->walletDetails = $value; + return $this; + } + + /** + * @return ?BuyNowPayLaterDetails + */ + public function getBuyNowPayLaterDetails(): ?BuyNowPayLaterDetails + { + return $this->buyNowPayLaterDetails; + } + + /** + * @param ?BuyNowPayLaterDetails $value + */ + public function setBuyNowPayLaterDetails(?BuyNowPayLaterDetails $value = null): self + { + $this->buyNowPayLaterDetails = $value; + return $this; + } + + /** + * @return ?SquareAccountDetails + */ + public function getSquareAccountDetails(): ?SquareAccountDetails + { + return $this->squareAccountDetails; + } + + /** + * @param ?SquareAccountDetails $value + */ + public function setSquareAccountDetails(?SquareAccountDetails $value = null): self + { + $this->squareAccountDetails = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRefundIds(): ?array + { + return $this->refundIds; + } + + /** + * @param ?array $value + */ + public function setRefundIds(?array $value = null): self + { + $this->refundIds = $value; + return $this; + } + + /** + * @return ?RiskEvaluation + */ + public function getRiskEvaluation(): ?RiskEvaluation + { + return $this->riskEvaluation; + } + + /** + * @param ?RiskEvaluation $value + */ + public function setRiskEvaluation(?RiskEvaluation $value = null): self + { + $this->riskEvaluation = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTerminalCheckoutId(): ?string + { + return $this->terminalCheckoutId; + } + + /** + * @param ?string $value + */ + public function setTerminalCheckoutId(?string $value = null): self + { + $this->terminalCheckoutId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerEmailAddress(): ?string + { + return $this->buyerEmailAddress; + } + + /** + * @param ?string $value + */ + public function setBuyerEmailAddress(?string $value = null): self + { + $this->buyerEmailAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getBillingAddress(): ?Address + { + return $this->billingAddress; + } + + /** + * @param ?Address $value + */ + public function setBillingAddress(?Address $value = null): self + { + $this->billingAddress = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getShippingAddress(): ?Address + { + return $this->shippingAddress; + } + + /** + * @param ?Address $value + */ + public function setShippingAddress(?Address $value = null): self + { + $this->shippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatementDescriptionIdentifier(): ?string + { + return $this->statementDescriptionIdentifier; + } + + /** + * @param ?string $value + */ + public function setStatementDescriptionIdentifier(?string $value = null): self + { + $this->statementDescriptionIdentifier = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCapabilities(): ?array + { + return $this->capabilities; + } + + /** + * @param ?array $value + */ + public function setCapabilities(?array $value = null): self + { + $this->capabilities = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReceiptNumber(): ?string + { + return $this->receiptNumber; + } + + /** + * @param ?string $value + */ + public function setReceiptNumber(?string $value = null): self + { + $this->receiptNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReceiptUrl(): ?string + { + return $this->receiptUrl; + } + + /** + * @param ?string $value + */ + public function setReceiptUrl(?string $value = null): self + { + $this->receiptUrl = $value; + return $this; + } + + /** + * @return ?DeviceDetails + */ + public function getDeviceDetails(): ?DeviceDetails + { + return $this->deviceDetails; + } + + /** + * @param ?DeviceDetails $value + */ + public function setDeviceDetails(?DeviceDetails $value = null): self + { + $this->deviceDetails = $value; + return $this; + } + + /** + * @return ?ApplicationDetails + */ + public function getApplicationDetails(): ?ApplicationDetails + { + return $this->applicationDetails; + } + + /** + * @param ?ApplicationDetails $value + */ + public function setApplicationDetails(?ApplicationDetails $value = null): self + { + $this->applicationDetails = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOfflinePayment(): ?bool + { + return $this->isOfflinePayment; + } + + /** + * @param ?bool $value + */ + public function setIsOfflinePayment(?bool $value = null): self + { + $this->isOfflinePayment = $value; + return $this; + } + + /** + * @return ?OfflinePaymentDetails + */ + public function getOfflinePaymentDetails(): ?OfflinePaymentDetails + { + return $this->offlinePaymentDetails; + } + + /** + * @param ?OfflinePaymentDetails $value + */ + public function setOfflinePaymentDetails(?OfflinePaymentDetails $value = null): self + { + $this->offlinePaymentDetails = $value; + return $this; + } + + /** + * @return ?string + */ + public function getVersionToken(): ?string + { + return $this->versionToken; + } + + /** + * @param ?string $value + */ + public function setVersionToken(?string $value = null): self + { + $this->versionToken = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityAppFeeRefundDetail.php b/src/Types/PaymentBalanceActivityAppFeeRefundDetail.php new file mode 100644 index 00000000..ac1b10fe --- /dev/null +++ b/src/Types/PaymentBalanceActivityAppFeeRefundDetail.php @@ -0,0 +1,101 @@ +paymentId = $values['paymentId'] ?? null; + $this->refundId = $values['refundId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundId(): ?string + { + return $this->refundId; + } + + /** + * @param ?string $value + */ + public function setRefundId(?string $value = null): self + { + $this->refundId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityAppFeeRevenueDetail.php b/src/Types/PaymentBalanceActivityAppFeeRevenueDetail.php new file mode 100644 index 00000000..2dfecff2 --- /dev/null +++ b/src/Types/PaymentBalanceActivityAppFeeRevenueDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityAutomaticSavingsDetail.php b/src/Types/PaymentBalanceActivityAutomaticSavingsDetail.php new file mode 100644 index 00000000..9c503450 --- /dev/null +++ b/src/Types/PaymentBalanceActivityAutomaticSavingsDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->payoutId = $values['payoutId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPayoutId(): ?string + { + return $this->payoutId; + } + + /** + * @param ?string $value + */ + public function setPayoutId(?string $value = null): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityAutomaticSavingsReversedDetail.php b/src/Types/PaymentBalanceActivityAutomaticSavingsReversedDetail.php new file mode 100644 index 00000000..256a3d3b --- /dev/null +++ b/src/Types/PaymentBalanceActivityAutomaticSavingsReversedDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->payoutId = $values['payoutId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPayoutId(): ?string + { + return $this->payoutId; + } + + /** + * @param ?string $value + */ + public function setPayoutId(?string $value = null): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityChargeDetail.php b/src/Types/PaymentBalanceActivityChargeDetail.php new file mode 100644 index 00000000..136daf76 --- /dev/null +++ b/src/Types/PaymentBalanceActivityChargeDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityDepositFeeDetail.php b/src/Types/PaymentBalanceActivityDepositFeeDetail.php new file mode 100644 index 00000000..910bd739 --- /dev/null +++ b/src/Types/PaymentBalanceActivityDepositFeeDetail.php @@ -0,0 +1,51 @@ +payoutId = $values['payoutId'] ?? null; + } + + /** + * @return ?string + */ + public function getPayoutId(): ?string + { + return $this->payoutId; + } + + /** + * @param ?string $value + */ + public function setPayoutId(?string $value = null): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityDepositFeeReversedDetail.php b/src/Types/PaymentBalanceActivityDepositFeeReversedDetail.php new file mode 100644 index 00000000..cc440e84 --- /dev/null +++ b/src/Types/PaymentBalanceActivityDepositFeeReversedDetail.php @@ -0,0 +1,51 @@ +payoutId = $values['payoutId'] ?? null; + } + + /** + * @return ?string + */ + public function getPayoutId(): ?string + { + return $this->payoutId; + } + + /** + * @param ?string $value + */ + public function setPayoutId(?string $value = null): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityDisputeDetail.php b/src/Types/PaymentBalanceActivityDisputeDetail.php new file mode 100644 index 00000000..8dd34ffc --- /dev/null +++ b/src/Types/PaymentBalanceActivityDisputeDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->disputeId = $values['disputeId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisputeId(): ?string + { + return $this->disputeId; + } + + /** + * @param ?string $value + */ + public function setDisputeId(?string $value = null): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityFeeDetail.php b/src/Types/PaymentBalanceActivityFeeDetail.php new file mode 100644 index 00000000..4390318d --- /dev/null +++ b/src/Types/PaymentBalanceActivityFeeDetail.php @@ -0,0 +1,56 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityFreeProcessingDetail.php b/src/Types/PaymentBalanceActivityFreeProcessingDetail.php new file mode 100644 index 00000000..81c53a45 --- /dev/null +++ b/src/Types/PaymentBalanceActivityFreeProcessingDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityHoldAdjustmentDetail.php b/src/Types/PaymentBalanceActivityHoldAdjustmentDetail.php new file mode 100644 index 00000000..c1b7657f --- /dev/null +++ b/src/Types/PaymentBalanceActivityHoldAdjustmentDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityOpenDisputeDetail.php b/src/Types/PaymentBalanceActivityOpenDisputeDetail.php new file mode 100644 index 00000000..47dda480 --- /dev/null +++ b/src/Types/PaymentBalanceActivityOpenDisputeDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->disputeId = $values['disputeId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisputeId(): ?string + { + return $this->disputeId; + } + + /** + * @param ?string $value + */ + public function setDisputeId(?string $value = null): self + { + $this->disputeId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityOtherAdjustmentDetail.php b/src/Types/PaymentBalanceActivityOtherAdjustmentDetail.php new file mode 100644 index 00000000..b953148a --- /dev/null +++ b/src/Types/PaymentBalanceActivityOtherAdjustmentDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityOtherDetail.php b/src/Types/PaymentBalanceActivityOtherDetail.php new file mode 100644 index 00000000..c95cde50 --- /dev/null +++ b/src/Types/PaymentBalanceActivityOtherDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityRefundDetail.php b/src/Types/PaymentBalanceActivityRefundDetail.php new file mode 100644 index 00000000..fa653aae --- /dev/null +++ b/src/Types/PaymentBalanceActivityRefundDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->refundId = $values['refundId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundId(): ?string + { + return $this->refundId; + } + + /** + * @param ?string $value + */ + public function setRefundId(?string $value = null): self + { + $this->refundId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityReleaseAdjustmentDetail.php b/src/Types/PaymentBalanceActivityReleaseAdjustmentDetail.php new file mode 100644 index 00000000..d1016d8f --- /dev/null +++ b/src/Types/PaymentBalanceActivityReleaseAdjustmentDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityReserveHoldDetail.php b/src/Types/PaymentBalanceActivityReserveHoldDetail.php new file mode 100644 index 00000000..1b7b5006 --- /dev/null +++ b/src/Types/PaymentBalanceActivityReserveHoldDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityReserveReleaseDetail.php b/src/Types/PaymentBalanceActivityReserveReleaseDetail.php new file mode 100644 index 00000000..c5bfc590 --- /dev/null +++ b/src/Types/PaymentBalanceActivityReserveReleaseDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivitySquareCapitalPaymentDetail.php b/src/Types/PaymentBalanceActivitySquareCapitalPaymentDetail.php new file mode 100644 index 00000000..df17c0f5 --- /dev/null +++ b/src/Types/PaymentBalanceActivitySquareCapitalPaymentDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php b/src/Types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php new file mode 100644 index 00000000..92c9aada --- /dev/null +++ b/src/Types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivitySquarePayrollTransferDetail.php b/src/Types/PaymentBalanceActivitySquarePayrollTransferDetail.php new file mode 100644 index 00000000..f9b95975 --- /dev/null +++ b/src/Types/PaymentBalanceActivitySquarePayrollTransferDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php b/src/Types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php new file mode 100644 index 00000000..47f3c501 --- /dev/null +++ b/src/Types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityTaxOnFeeDetail.php b/src/Types/PaymentBalanceActivityTaxOnFeeDetail.php new file mode 100644 index 00000000..f5153aae --- /dev/null +++ b/src/Types/PaymentBalanceActivityTaxOnFeeDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->taxRateDescription = $values['taxRateDescription'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTaxRateDescription(): ?string + { + return $this->taxRateDescription; + } + + /** + * @param ?string $value + */ + public function setTaxRateDescription(?string $value = null): self + { + $this->taxRateDescription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityThirdPartyFeeDetail.php b/src/Types/PaymentBalanceActivityThirdPartyFeeDetail.php new file mode 100644 index 00000000..c74c0661 --- /dev/null +++ b/src/Types/PaymentBalanceActivityThirdPartyFeeDetail.php @@ -0,0 +1,51 @@ +paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentBalanceActivityThirdPartyFeeRefundDetail.php b/src/Types/PaymentBalanceActivityThirdPartyFeeRefundDetail.php new file mode 100644 index 00000000..07845e41 --- /dev/null +++ b/src/Types/PaymentBalanceActivityThirdPartyFeeRefundDetail.php @@ -0,0 +1,76 @@ +paymentId = $values['paymentId'] ?? null; + $this->refundId = $values['refundId'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundId(): ?string + { + return $this->refundId; + } + + /** + * @param ?string $value + */ + public function setRefundId(?string $value = null): self + { + $this->refundId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentLink.php b/src/Types/PaymentLink.php new file mode 100644 index 00000000..212afca6 --- /dev/null +++ b/src/Types/PaymentLink.php @@ -0,0 +1,313 @@ +id = $values['id'] ?? null; + $this->version = $values['version']; + $this->description = $values['description'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->checkoutOptions = $values['checkoutOptions'] ?? null; + $this->prePopulatedData = $values['prePopulatedData'] ?? null; + $this->url = $values['url'] ?? null; + $this->longUrl = $values['longUrl'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->paymentNote = $values['paymentNote'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return int + */ + public function getVersion(): int + { + return $this->version; + } + + /** + * @param int $value + */ + public function setVersion(int $value): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?CheckoutOptions + */ + public function getCheckoutOptions(): ?CheckoutOptions + { + return $this->checkoutOptions; + } + + /** + * @param ?CheckoutOptions $value + */ + public function setCheckoutOptions(?CheckoutOptions $value = null): self + { + $this->checkoutOptions = $value; + return $this; + } + + /** + * @return ?PrePopulatedData + */ + public function getPrePopulatedData(): ?PrePopulatedData + { + return $this->prePopulatedData; + } + + /** + * @param ?PrePopulatedData $value + */ + public function setPrePopulatedData(?PrePopulatedData $value = null): self + { + $this->prePopulatedData = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUrl(): ?string + { + return $this->url; + } + + /** + * @param ?string $value + */ + public function setUrl(?string $value = null): self + { + $this->url = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLongUrl(): ?string + { + return $this->longUrl; + } + + /** + * @param ?string $value + */ + public function setLongUrl(?string $value = null): self + { + $this->longUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentNote(): ?string + { + return $this->paymentNote; + } + + /** + * @param ?string $value + */ + public function setPaymentNote(?string $value = null): self + { + $this->paymentNote = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentLinkRelatedResources.php b/src/Types/PaymentLinkRelatedResources.php new file mode 100644 index 00000000..1f018420 --- /dev/null +++ b/src/Types/PaymentLinkRelatedResources.php @@ -0,0 +1,77 @@ + $orders The order associated with the payment link. + */ + #[JsonProperty('orders'), ArrayType([Order::class])] + private ?array $orders; + + /** + * @var ?array $subscriptionPlans The subscription plan associated with the payment link. + */ + #[JsonProperty('subscription_plans'), ArrayType([CatalogObject::class])] + private ?array $subscriptionPlans; + + /** + * @param array{ + * orders?: ?array, + * subscriptionPlans?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->orders = $values['orders'] ?? null; + $this->subscriptionPlans = $values['subscriptionPlans'] ?? null; + } + + /** + * @return ?array + */ + public function getOrders(): ?array + { + return $this->orders; + } + + /** + * @param ?array $value + */ + public function setOrders(?array $value = null): self + { + $this->orders = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSubscriptionPlans(): ?array + { + return $this->subscriptionPlans; + } + + /** + * @param ?array $value + */ + public function setSubscriptionPlans(?array $value = null): self + { + $this->subscriptionPlans = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentOptions.php b/src/Types/PaymentOptions.php new file mode 100644 index 00000000..5791a2b4 --- /dev/null +++ b/src/Types/PaymentOptions.php @@ -0,0 +1,167 @@ + $delayAction + */ + #[JsonProperty('delay_action')] + private ?string $delayAction; + + /** + * @param array{ + * autocomplete?: ?bool, + * delayDuration?: ?string, + * acceptPartialAuthorization?: ?bool, + * delayAction?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->autocomplete = $values['autocomplete'] ?? null; + $this->delayDuration = $values['delayDuration'] ?? null; + $this->acceptPartialAuthorization = $values['acceptPartialAuthorization'] ?? null; + $this->delayAction = $values['delayAction'] ?? null; + } + + /** + * @return ?bool + */ + public function getAutocomplete(): ?bool + { + return $this->autocomplete; + } + + /** + * @param ?bool $value + */ + public function setAutocomplete(?bool $value = null): self + { + $this->autocomplete = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDelayDuration(): ?string + { + return $this->delayDuration; + } + + /** + * @param ?string $value + */ + public function setDelayDuration(?string $value = null): self + { + $this->delayDuration = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAcceptPartialAuthorization(): ?bool + { + return $this->acceptPartialAuthorization; + } + + /** + * @param ?bool $value + */ + public function setAcceptPartialAuthorization(?bool $value = null): self + { + $this->acceptPartialAuthorization = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getDelayAction(): ?string + { + return $this->delayAction; + } + + /** + * @param ?value-of $value + */ + public function setDelayAction(?string $value = null): self + { + $this->delayAction = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PaymentOptionsDelayAction.php b/src/Types/PaymentOptionsDelayAction.php new file mode 100644 index 00000000..23090b0e --- /dev/null +++ b/src/Types/PaymentOptionsDelayAction.php @@ -0,0 +1,9 @@ + $processingFee Processing fees and fee adjustments assessed by Square for this refund. + */ + #[JsonProperty('processing_fee'), ArrayType([ProcessingFee::class])] + private ?array $processingFee; + + /** + * @var ?string $paymentId The ID of the payment associated with this refund. + */ + #[JsonProperty('payment_id')] + private ?string $paymentId; + + /** + * @var ?string $orderId The ID of the order associated with the refund. + */ + #[JsonProperty('order_id')] + private ?string $orderId; + + /** + * @var ?string $reason The reason for the refund. + */ + #[JsonProperty('reason')] + private ?string $reason; + + /** + * @var ?string $createdAt The timestamp of when the refund was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp of when the refund was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $teamMemberId An optional ID of the team member associated with taking the payment. + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @var ?string $terminalRefundId An optional ID for a Terminal refund. + */ + #[JsonProperty('terminal_refund_id')] + private ?string $terminalRefundId; + + /** + * @param array{ + * id: string, + * amountMoney: Money, + * status?: ?string, + * locationId?: ?string, + * unlinked?: ?bool, + * destinationType?: ?string, + * destinationDetails?: ?DestinationDetails, + * appFeeMoney?: ?Money, + * processingFee?: ?array, + * paymentId?: ?string, + * orderId?: ?string, + * reason?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * teamMemberId?: ?string, + * terminalRefundId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->status = $values['status'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->unlinked = $values['unlinked'] ?? null; + $this->destinationType = $values['destinationType'] ?? null; + $this->destinationDetails = $values['destinationDetails'] ?? null; + $this->amountMoney = $values['amountMoney']; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->processingFee = $values['processingFee'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->terminalRefundId = $values['terminalRefundId'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getUnlinked(): ?bool + { + return $this->unlinked; + } + + /** + * @param ?bool $value + */ + public function setUnlinked(?bool $value = null): self + { + $this->unlinked = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDestinationType(): ?string + { + return $this->destinationType; + } + + /** + * @param ?string $value + */ + public function setDestinationType(?string $value = null): self + { + $this->destinationType = $value; + return $this; + } + + /** + * @return ?DestinationDetails + */ + public function getDestinationDetails(): ?DestinationDetails + { + return $this->destinationDetails; + } + + /** + * @param ?DestinationDetails $value + */ + public function setDestinationDetails(?DestinationDetails $value = null): self + { + $this->destinationDetails = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getProcessingFee(): ?array + { + return $this->processingFee; + } + + /** + * @param ?array $value + */ + public function setProcessingFee(?array $value = null): self + { + $this->processingFee = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReason(): ?string + { + return $this->reason; + } + + /** + * @param ?string $value + */ + public function setReason(?string $value = null): self + { + $this->reason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTerminalRefundId(): ?string + { + return $this->terminalRefundId; + } + + /** + * @param ?string $value + */ + public function setTerminalRefundId(?string $value = null): self + { + $this->terminalRefundId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Payout.php b/src/Types/Payout.php new file mode 100644 index 00000000..c7fa6552 --- /dev/null +++ b/src/Types/Payout.php @@ -0,0 +1,343 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var string $locationId The ID of the location associated with the payout. + */ + #[JsonProperty('location_id')] + private string $locationId; + + /** + * @var ?string $createdAt The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp of when the payout was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?Money $amountMoney The amount of money involved in the payout. A positive amount indicates a deposit, and a negative amount indicates a withdrawal. This amount is never zero. + */ + #[JsonProperty('amount_money')] + private ?Money $amountMoney; + + /** + * Information about the banking destination (such as a bank account, Square checking account, or debit card) + * against which the payout was made. + * + * @var ?Destination $destination + */ + #[JsonProperty('destination')] + private ?Destination $destination; + + /** + * The version number, which is incremented each time an update is made to this payout record. + * The version number helps developers receive event notifications or feeds out of order. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * Indicates the payout type. + * See [PayoutType](#type-payouttype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?array $payoutFee A list of transfer fees and any taxes on the fees assessed by Square for this payout. + */ + #[JsonProperty('payout_fee'), ArrayType([PayoutFee::class])] + private ?array $payoutFee; + + /** + * @var ?string $arrivalDate The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. + */ + #[JsonProperty('arrival_date')] + private ?string $arrivalDate; + + /** + * @var ?string $endToEndId A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can use this ID to automate the process of reconciling each payout with the corresponding line item on the bank statement. + */ + #[JsonProperty('end_to_end_id')] + private ?string $endToEndId; + + /** + * @param array{ + * id: string, + * locationId: string, + * status?: ?value-of, + * createdAt?: ?string, + * updatedAt?: ?string, + * amountMoney?: ?Money, + * destination?: ?Destination, + * version?: ?int, + * type?: ?value-of, + * payoutFee?: ?array, + * arrivalDate?: ?string, + * endToEndId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->status = $values['status'] ?? null; + $this->locationId = $values['locationId']; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->destination = $values['destination'] ?? null; + $this->version = $values['version'] ?? null; + $this->type = $values['type'] ?? null; + $this->payoutFee = $values['payoutFee'] ?? null; + $this->arrivalDate = $values['arrivalDate'] ?? null; + $this->endToEndId = $values['endToEndId'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Destination + */ + public function getDestination(): ?Destination + { + return $this->destination; + } + + /** + * @param ?Destination $value + */ + public function setDestination(?Destination $value = null): self + { + $this->destination = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPayoutFee(): ?array + { + return $this->payoutFee; + } + + /** + * @param ?array $value + */ + public function setPayoutFee(?array $value = null): self + { + $this->payoutFee = $value; + return $this; + } + + /** + * @return ?string + */ + public function getArrivalDate(): ?string + { + return $this->arrivalDate; + } + + /** + * @param ?string $value + */ + public function setArrivalDate(?string $value = null): self + { + $this->arrivalDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndToEndId(): ?string + { + return $this->endToEndId; + } + + /** + * @param ?string $value + */ + public function setEndToEndId(?string $value = null): self + { + $this->endToEndId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PayoutEntry.php b/src/Types/PayoutEntry.php new file mode 100644 index 00000000..63dbd554 --- /dev/null +++ b/src/Types/PayoutEntry.php @@ -0,0 +1,833 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?Money $grossAmountMoney The amount of money involved in this payout entry. + */ + #[JsonProperty('gross_amount_money')] + private ?Money $grossAmountMoney; + + /** + * @var ?Money $feeAmountMoney The amount of Square fees associated with this payout entry. + */ + #[JsonProperty('fee_amount_money')] + private ?Money $feeAmountMoney; + + /** + * @var ?Money $netAmountMoney The net proceeds from this transaction after any fees. + */ + #[JsonProperty('net_amount_money')] + private ?Money $netAmountMoney; + + /** + * @var ?PaymentBalanceActivityAppFeeRevenueDetail $typeAppFeeRevenueDetails Details of any developer app fee revenue generated on a payment. + */ + #[JsonProperty('type_app_fee_revenue_details')] + private ?PaymentBalanceActivityAppFeeRevenueDetail $typeAppFeeRevenueDetails; + + /** + * @var ?PaymentBalanceActivityAppFeeRefundDetail $typeAppFeeRefundDetails Details of a refund for an app fee on a payment. + */ + #[JsonProperty('type_app_fee_refund_details')] + private ?PaymentBalanceActivityAppFeeRefundDetail $typeAppFeeRefundDetails; + + /** + * @var ?PaymentBalanceActivityAutomaticSavingsDetail $typeAutomaticSavingsDetails Details of any automatic transfer from the payment processing balance to the Square Savings account. These are, generally, proportional to the merchant's sales. + */ + #[JsonProperty('type_automatic_savings_details')] + private ?PaymentBalanceActivityAutomaticSavingsDetail $typeAutomaticSavingsDetails; + + /** + * @var ?PaymentBalanceActivityAutomaticSavingsReversedDetail $typeAutomaticSavingsReversedDetails Details of any automatic transfer from the Square Savings account back to the processing balance. These are, generally, proportional to the merchant's refunds. + */ + #[JsonProperty('type_automatic_savings_reversed_details')] + private ?PaymentBalanceActivityAutomaticSavingsReversedDetail $typeAutomaticSavingsReversedDetails; + + /** + * @var ?PaymentBalanceActivityChargeDetail $typeChargeDetails Details of credit card payment captures. + */ + #[JsonProperty('type_charge_details')] + private ?PaymentBalanceActivityChargeDetail $typeChargeDetails; + + /** + * @var ?PaymentBalanceActivityDepositFeeDetail $typeDepositFeeDetails Details of any fees involved with deposits such as for instant deposits. + */ + #[JsonProperty('type_deposit_fee_details')] + private ?PaymentBalanceActivityDepositFeeDetail $typeDepositFeeDetails; + + /** + * @var ?PaymentBalanceActivityDepositFeeReversedDetail $typeDepositFeeReversedDetails Details of any reversal or refund of fees involved with deposits such as for instant deposits. + */ + #[JsonProperty('type_deposit_fee_reversed_details')] + private ?PaymentBalanceActivityDepositFeeReversedDetail $typeDepositFeeReversedDetails; + + /** + * @var ?PaymentBalanceActivityDisputeDetail $typeDisputeDetails Details of any balance change due to a dispute event. + */ + #[JsonProperty('type_dispute_details')] + private ?PaymentBalanceActivityDisputeDetail $typeDisputeDetails; + + /** + * @var ?PaymentBalanceActivityFeeDetail $typeFeeDetails Details of adjustments due to the Square processing fee. + */ + #[JsonProperty('type_fee_details')] + private ?PaymentBalanceActivityFeeDetail $typeFeeDetails; + + /** + * @var ?PaymentBalanceActivityFreeProcessingDetail $typeFreeProcessingDetails Square offers Free Payments Processing for a variety of business scenarios including seller referral or when Square wants to apologize for a bug, customer service, repricing complication, and so on. This entry represents details of any credit to the merchant for the purposes of Free Processing. + */ + #[JsonProperty('type_free_processing_details')] + private ?PaymentBalanceActivityFreeProcessingDetail $typeFreeProcessingDetails; + + /** + * @var ?PaymentBalanceActivityHoldAdjustmentDetail $typeHoldAdjustmentDetails Details of any adjustment made by Square related to the holding or releasing of a payment. + */ + #[JsonProperty('type_hold_adjustment_details')] + private ?PaymentBalanceActivityHoldAdjustmentDetail $typeHoldAdjustmentDetails; + + /** + * @var ?PaymentBalanceActivityOpenDisputeDetail $typeOpenDisputeDetails Details of any open disputes. + */ + #[JsonProperty('type_open_dispute_details')] + private ?PaymentBalanceActivityOpenDisputeDetail $typeOpenDisputeDetails; + + /** + * @var ?PaymentBalanceActivityOtherDetail $typeOtherDetails Details of any other type that does not belong in the rest of the types. + */ + #[JsonProperty('type_other_details')] + private ?PaymentBalanceActivityOtherDetail $typeOtherDetails; + + /** + * @var ?PaymentBalanceActivityOtherAdjustmentDetail $typeOtherAdjustmentDetails Details of any other type of adjustments that don't fall under existing types. + */ + #[JsonProperty('type_other_adjustment_details')] + private ?PaymentBalanceActivityOtherAdjustmentDetail $typeOtherAdjustmentDetails; + + /** + * @var ?PaymentBalanceActivityRefundDetail $typeRefundDetails Details of a refund for an existing card payment. + */ + #[JsonProperty('type_refund_details')] + private ?PaymentBalanceActivityRefundDetail $typeRefundDetails; + + /** + * @var ?PaymentBalanceActivityReleaseAdjustmentDetail $typeReleaseAdjustmentDetails Details of fees released for adjustments. + */ + #[JsonProperty('type_release_adjustment_details')] + private ?PaymentBalanceActivityReleaseAdjustmentDetail $typeReleaseAdjustmentDetails; + + /** + * @var ?PaymentBalanceActivityReserveHoldDetail $typeReserveHoldDetails Details of fees paid for funding risk reserve. + */ + #[JsonProperty('type_reserve_hold_details')] + private ?PaymentBalanceActivityReserveHoldDetail $typeReserveHoldDetails; + + /** + * @var ?PaymentBalanceActivityReserveReleaseDetail $typeReserveReleaseDetails Details of fees released from risk reserve. + */ + #[JsonProperty('type_reserve_release_details')] + private ?PaymentBalanceActivityReserveReleaseDetail $typeReserveReleaseDetails; + + /** + * @var ?PaymentBalanceActivitySquareCapitalPaymentDetail $typeSquareCapitalPaymentDetails Details of capital merchant cash advance (MCA) assessments. These are, generally, proportional to the merchant's sales but may be issued for other reasons related to the MCA. + */ + #[JsonProperty('type_square_capital_payment_details')] + private ?PaymentBalanceActivitySquareCapitalPaymentDetail $typeSquareCapitalPaymentDetails; + + /** + * @var ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $typeSquareCapitalReversedPaymentDetails Details of capital merchant cash advance (MCA) assessment refunds. These are, generally, proportional to the merchant's refunds but may be issued for other reasons related to the MCA. + */ + #[JsonProperty('type_square_capital_reversed_payment_details')] + private ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $typeSquareCapitalReversedPaymentDetails; + + /** + * @var ?PaymentBalanceActivityTaxOnFeeDetail $typeTaxOnFeeDetails Details of tax paid on fee amounts. + */ + #[JsonProperty('type_tax_on_fee_details')] + private ?PaymentBalanceActivityTaxOnFeeDetail $typeTaxOnFeeDetails; + + /** + * @var ?PaymentBalanceActivityThirdPartyFeeDetail $typeThirdPartyFeeDetails Details of fees collected by a 3rd party platform. + */ + #[JsonProperty('type_third_party_fee_details')] + private ?PaymentBalanceActivityThirdPartyFeeDetail $typeThirdPartyFeeDetails; + + /** + * @var ?PaymentBalanceActivityThirdPartyFeeRefundDetail $typeThirdPartyFeeRefundDetails Details of refunded fees from a 3rd party platform. + */ + #[JsonProperty('type_third_party_fee_refund_details')] + private ?PaymentBalanceActivityThirdPartyFeeRefundDetail $typeThirdPartyFeeRefundDetails; + + /** + * @var ?PaymentBalanceActivitySquarePayrollTransferDetail $typeSquarePayrollTransferDetails Details of a payroll payment that was transferred to a team member’s bank account. + */ + #[JsonProperty('type_square_payroll_transfer_details')] + private ?PaymentBalanceActivitySquarePayrollTransferDetail $typeSquarePayrollTransferDetails; + + /** + * @var ?PaymentBalanceActivitySquarePayrollTransferReversedDetail $typeSquarePayrollTransferReversedDetails Details of a payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square. + */ + #[JsonProperty('type_square_payroll_transfer_reversed_details')] + private ?PaymentBalanceActivitySquarePayrollTransferReversedDetail $typeSquarePayrollTransferReversedDetails; + + /** + * @param array{ + * id: string, + * payoutId: string, + * effectiveAt?: ?string, + * type?: ?value-of, + * grossAmountMoney?: ?Money, + * feeAmountMoney?: ?Money, + * netAmountMoney?: ?Money, + * typeAppFeeRevenueDetails?: ?PaymentBalanceActivityAppFeeRevenueDetail, + * typeAppFeeRefundDetails?: ?PaymentBalanceActivityAppFeeRefundDetail, + * typeAutomaticSavingsDetails?: ?PaymentBalanceActivityAutomaticSavingsDetail, + * typeAutomaticSavingsReversedDetails?: ?PaymentBalanceActivityAutomaticSavingsReversedDetail, + * typeChargeDetails?: ?PaymentBalanceActivityChargeDetail, + * typeDepositFeeDetails?: ?PaymentBalanceActivityDepositFeeDetail, + * typeDepositFeeReversedDetails?: ?PaymentBalanceActivityDepositFeeReversedDetail, + * typeDisputeDetails?: ?PaymentBalanceActivityDisputeDetail, + * typeFeeDetails?: ?PaymentBalanceActivityFeeDetail, + * typeFreeProcessingDetails?: ?PaymentBalanceActivityFreeProcessingDetail, + * typeHoldAdjustmentDetails?: ?PaymentBalanceActivityHoldAdjustmentDetail, + * typeOpenDisputeDetails?: ?PaymentBalanceActivityOpenDisputeDetail, + * typeOtherDetails?: ?PaymentBalanceActivityOtherDetail, + * typeOtherAdjustmentDetails?: ?PaymentBalanceActivityOtherAdjustmentDetail, + * typeRefundDetails?: ?PaymentBalanceActivityRefundDetail, + * typeReleaseAdjustmentDetails?: ?PaymentBalanceActivityReleaseAdjustmentDetail, + * typeReserveHoldDetails?: ?PaymentBalanceActivityReserveHoldDetail, + * typeReserveReleaseDetails?: ?PaymentBalanceActivityReserveReleaseDetail, + * typeSquareCapitalPaymentDetails?: ?PaymentBalanceActivitySquareCapitalPaymentDetail, + * typeSquareCapitalReversedPaymentDetails?: ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail, + * typeTaxOnFeeDetails?: ?PaymentBalanceActivityTaxOnFeeDetail, + * typeThirdPartyFeeDetails?: ?PaymentBalanceActivityThirdPartyFeeDetail, + * typeThirdPartyFeeRefundDetails?: ?PaymentBalanceActivityThirdPartyFeeRefundDetail, + * typeSquarePayrollTransferDetails?: ?PaymentBalanceActivitySquarePayrollTransferDetail, + * typeSquarePayrollTransferReversedDetails?: ?PaymentBalanceActivitySquarePayrollTransferReversedDetail, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->payoutId = $values['payoutId']; + $this->effectiveAt = $values['effectiveAt'] ?? null; + $this->type = $values['type'] ?? null; + $this->grossAmountMoney = $values['grossAmountMoney'] ?? null; + $this->feeAmountMoney = $values['feeAmountMoney'] ?? null; + $this->netAmountMoney = $values['netAmountMoney'] ?? null; + $this->typeAppFeeRevenueDetails = $values['typeAppFeeRevenueDetails'] ?? null; + $this->typeAppFeeRefundDetails = $values['typeAppFeeRefundDetails'] ?? null; + $this->typeAutomaticSavingsDetails = $values['typeAutomaticSavingsDetails'] ?? null; + $this->typeAutomaticSavingsReversedDetails = $values['typeAutomaticSavingsReversedDetails'] ?? null; + $this->typeChargeDetails = $values['typeChargeDetails'] ?? null; + $this->typeDepositFeeDetails = $values['typeDepositFeeDetails'] ?? null; + $this->typeDepositFeeReversedDetails = $values['typeDepositFeeReversedDetails'] ?? null; + $this->typeDisputeDetails = $values['typeDisputeDetails'] ?? null; + $this->typeFeeDetails = $values['typeFeeDetails'] ?? null; + $this->typeFreeProcessingDetails = $values['typeFreeProcessingDetails'] ?? null; + $this->typeHoldAdjustmentDetails = $values['typeHoldAdjustmentDetails'] ?? null; + $this->typeOpenDisputeDetails = $values['typeOpenDisputeDetails'] ?? null; + $this->typeOtherDetails = $values['typeOtherDetails'] ?? null; + $this->typeOtherAdjustmentDetails = $values['typeOtherAdjustmentDetails'] ?? null; + $this->typeRefundDetails = $values['typeRefundDetails'] ?? null; + $this->typeReleaseAdjustmentDetails = $values['typeReleaseAdjustmentDetails'] ?? null; + $this->typeReserveHoldDetails = $values['typeReserveHoldDetails'] ?? null; + $this->typeReserveReleaseDetails = $values['typeReserveReleaseDetails'] ?? null; + $this->typeSquareCapitalPaymentDetails = $values['typeSquareCapitalPaymentDetails'] ?? null; + $this->typeSquareCapitalReversedPaymentDetails = $values['typeSquareCapitalReversedPaymentDetails'] ?? null; + $this->typeTaxOnFeeDetails = $values['typeTaxOnFeeDetails'] ?? null; + $this->typeThirdPartyFeeDetails = $values['typeThirdPartyFeeDetails'] ?? null; + $this->typeThirdPartyFeeRefundDetails = $values['typeThirdPartyFeeRefundDetails'] ?? null; + $this->typeSquarePayrollTransferDetails = $values['typeSquarePayrollTransferDetails'] ?? null; + $this->typeSquarePayrollTransferReversedDetails = $values['typeSquarePayrollTransferReversedDetails'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getPayoutId(): string + { + return $this->payoutId; + } + + /** + * @param string $value + */ + public function setPayoutId(string $value): self + { + $this->payoutId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEffectiveAt(): ?string + { + return $this->effectiveAt; + } + + /** + * @param ?string $value + */ + public function setEffectiveAt(?string $value = null): self + { + $this->effectiveAt = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getGrossAmountMoney(): ?Money + { + return $this->grossAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setGrossAmountMoney(?Money $value = null): self + { + $this->grossAmountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getFeeAmountMoney(): ?Money + { + return $this->feeAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setFeeAmountMoney(?Money $value = null): self + { + $this->feeAmountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getNetAmountMoney(): ?Money + { + return $this->netAmountMoney; + } + + /** + * @param ?Money $value + */ + public function setNetAmountMoney(?Money $value = null): self + { + $this->netAmountMoney = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityAppFeeRevenueDetail + */ + public function getTypeAppFeeRevenueDetails(): ?PaymentBalanceActivityAppFeeRevenueDetail + { + return $this->typeAppFeeRevenueDetails; + } + + /** + * @param ?PaymentBalanceActivityAppFeeRevenueDetail $value + */ + public function setTypeAppFeeRevenueDetails(?PaymentBalanceActivityAppFeeRevenueDetail $value = null): self + { + $this->typeAppFeeRevenueDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityAppFeeRefundDetail + */ + public function getTypeAppFeeRefundDetails(): ?PaymentBalanceActivityAppFeeRefundDetail + { + return $this->typeAppFeeRefundDetails; + } + + /** + * @param ?PaymentBalanceActivityAppFeeRefundDetail $value + */ + public function setTypeAppFeeRefundDetails(?PaymentBalanceActivityAppFeeRefundDetail $value = null): self + { + $this->typeAppFeeRefundDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityAutomaticSavingsDetail + */ + public function getTypeAutomaticSavingsDetails(): ?PaymentBalanceActivityAutomaticSavingsDetail + { + return $this->typeAutomaticSavingsDetails; + } + + /** + * @param ?PaymentBalanceActivityAutomaticSavingsDetail $value + */ + public function setTypeAutomaticSavingsDetails(?PaymentBalanceActivityAutomaticSavingsDetail $value = null): self + { + $this->typeAutomaticSavingsDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityAutomaticSavingsReversedDetail + */ + public function getTypeAutomaticSavingsReversedDetails(): ?PaymentBalanceActivityAutomaticSavingsReversedDetail + { + return $this->typeAutomaticSavingsReversedDetails; + } + + /** + * @param ?PaymentBalanceActivityAutomaticSavingsReversedDetail $value + */ + public function setTypeAutomaticSavingsReversedDetails(?PaymentBalanceActivityAutomaticSavingsReversedDetail $value = null): self + { + $this->typeAutomaticSavingsReversedDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityChargeDetail + */ + public function getTypeChargeDetails(): ?PaymentBalanceActivityChargeDetail + { + return $this->typeChargeDetails; + } + + /** + * @param ?PaymentBalanceActivityChargeDetail $value + */ + public function setTypeChargeDetails(?PaymentBalanceActivityChargeDetail $value = null): self + { + $this->typeChargeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityDepositFeeDetail + */ + public function getTypeDepositFeeDetails(): ?PaymentBalanceActivityDepositFeeDetail + { + return $this->typeDepositFeeDetails; + } + + /** + * @param ?PaymentBalanceActivityDepositFeeDetail $value + */ + public function setTypeDepositFeeDetails(?PaymentBalanceActivityDepositFeeDetail $value = null): self + { + $this->typeDepositFeeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityDepositFeeReversedDetail + */ + public function getTypeDepositFeeReversedDetails(): ?PaymentBalanceActivityDepositFeeReversedDetail + { + return $this->typeDepositFeeReversedDetails; + } + + /** + * @param ?PaymentBalanceActivityDepositFeeReversedDetail $value + */ + public function setTypeDepositFeeReversedDetails(?PaymentBalanceActivityDepositFeeReversedDetail $value = null): self + { + $this->typeDepositFeeReversedDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityDisputeDetail + */ + public function getTypeDisputeDetails(): ?PaymentBalanceActivityDisputeDetail + { + return $this->typeDisputeDetails; + } + + /** + * @param ?PaymentBalanceActivityDisputeDetail $value + */ + public function setTypeDisputeDetails(?PaymentBalanceActivityDisputeDetail $value = null): self + { + $this->typeDisputeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityFeeDetail + */ + public function getTypeFeeDetails(): ?PaymentBalanceActivityFeeDetail + { + return $this->typeFeeDetails; + } + + /** + * @param ?PaymentBalanceActivityFeeDetail $value + */ + public function setTypeFeeDetails(?PaymentBalanceActivityFeeDetail $value = null): self + { + $this->typeFeeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityFreeProcessingDetail + */ + public function getTypeFreeProcessingDetails(): ?PaymentBalanceActivityFreeProcessingDetail + { + return $this->typeFreeProcessingDetails; + } + + /** + * @param ?PaymentBalanceActivityFreeProcessingDetail $value + */ + public function setTypeFreeProcessingDetails(?PaymentBalanceActivityFreeProcessingDetail $value = null): self + { + $this->typeFreeProcessingDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityHoldAdjustmentDetail + */ + public function getTypeHoldAdjustmentDetails(): ?PaymentBalanceActivityHoldAdjustmentDetail + { + return $this->typeHoldAdjustmentDetails; + } + + /** + * @param ?PaymentBalanceActivityHoldAdjustmentDetail $value + */ + public function setTypeHoldAdjustmentDetails(?PaymentBalanceActivityHoldAdjustmentDetail $value = null): self + { + $this->typeHoldAdjustmentDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityOpenDisputeDetail + */ + public function getTypeOpenDisputeDetails(): ?PaymentBalanceActivityOpenDisputeDetail + { + return $this->typeOpenDisputeDetails; + } + + /** + * @param ?PaymentBalanceActivityOpenDisputeDetail $value + */ + public function setTypeOpenDisputeDetails(?PaymentBalanceActivityOpenDisputeDetail $value = null): self + { + $this->typeOpenDisputeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityOtherDetail + */ + public function getTypeOtherDetails(): ?PaymentBalanceActivityOtherDetail + { + return $this->typeOtherDetails; + } + + /** + * @param ?PaymentBalanceActivityOtherDetail $value + */ + public function setTypeOtherDetails(?PaymentBalanceActivityOtherDetail $value = null): self + { + $this->typeOtherDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityOtherAdjustmentDetail + */ + public function getTypeOtherAdjustmentDetails(): ?PaymentBalanceActivityOtherAdjustmentDetail + { + return $this->typeOtherAdjustmentDetails; + } + + /** + * @param ?PaymentBalanceActivityOtherAdjustmentDetail $value + */ + public function setTypeOtherAdjustmentDetails(?PaymentBalanceActivityOtherAdjustmentDetail $value = null): self + { + $this->typeOtherAdjustmentDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityRefundDetail + */ + public function getTypeRefundDetails(): ?PaymentBalanceActivityRefundDetail + { + return $this->typeRefundDetails; + } + + /** + * @param ?PaymentBalanceActivityRefundDetail $value + */ + public function setTypeRefundDetails(?PaymentBalanceActivityRefundDetail $value = null): self + { + $this->typeRefundDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityReleaseAdjustmentDetail + */ + public function getTypeReleaseAdjustmentDetails(): ?PaymentBalanceActivityReleaseAdjustmentDetail + { + return $this->typeReleaseAdjustmentDetails; + } + + /** + * @param ?PaymentBalanceActivityReleaseAdjustmentDetail $value + */ + public function setTypeReleaseAdjustmentDetails(?PaymentBalanceActivityReleaseAdjustmentDetail $value = null): self + { + $this->typeReleaseAdjustmentDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityReserveHoldDetail + */ + public function getTypeReserveHoldDetails(): ?PaymentBalanceActivityReserveHoldDetail + { + return $this->typeReserveHoldDetails; + } + + /** + * @param ?PaymentBalanceActivityReserveHoldDetail $value + */ + public function setTypeReserveHoldDetails(?PaymentBalanceActivityReserveHoldDetail $value = null): self + { + $this->typeReserveHoldDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityReserveReleaseDetail + */ + public function getTypeReserveReleaseDetails(): ?PaymentBalanceActivityReserveReleaseDetail + { + return $this->typeReserveReleaseDetails; + } + + /** + * @param ?PaymentBalanceActivityReserveReleaseDetail $value + */ + public function setTypeReserveReleaseDetails(?PaymentBalanceActivityReserveReleaseDetail $value = null): self + { + $this->typeReserveReleaseDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivitySquareCapitalPaymentDetail + */ + public function getTypeSquareCapitalPaymentDetails(): ?PaymentBalanceActivitySquareCapitalPaymentDetail + { + return $this->typeSquareCapitalPaymentDetails; + } + + /** + * @param ?PaymentBalanceActivitySquareCapitalPaymentDetail $value + */ + public function setTypeSquareCapitalPaymentDetails(?PaymentBalanceActivitySquareCapitalPaymentDetail $value = null): self + { + $this->typeSquareCapitalPaymentDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail + */ + public function getTypeSquareCapitalReversedPaymentDetails(): ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail + { + return $this->typeSquareCapitalReversedPaymentDetails; + } + + /** + * @param ?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $value + */ + public function setTypeSquareCapitalReversedPaymentDetails(?PaymentBalanceActivitySquareCapitalReversedPaymentDetail $value = null): self + { + $this->typeSquareCapitalReversedPaymentDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityTaxOnFeeDetail + */ + public function getTypeTaxOnFeeDetails(): ?PaymentBalanceActivityTaxOnFeeDetail + { + return $this->typeTaxOnFeeDetails; + } + + /** + * @param ?PaymentBalanceActivityTaxOnFeeDetail $value + */ + public function setTypeTaxOnFeeDetails(?PaymentBalanceActivityTaxOnFeeDetail $value = null): self + { + $this->typeTaxOnFeeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityThirdPartyFeeDetail + */ + public function getTypeThirdPartyFeeDetails(): ?PaymentBalanceActivityThirdPartyFeeDetail + { + return $this->typeThirdPartyFeeDetails; + } + + /** + * @param ?PaymentBalanceActivityThirdPartyFeeDetail $value + */ + public function setTypeThirdPartyFeeDetails(?PaymentBalanceActivityThirdPartyFeeDetail $value = null): self + { + $this->typeThirdPartyFeeDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivityThirdPartyFeeRefundDetail + */ + public function getTypeThirdPartyFeeRefundDetails(): ?PaymentBalanceActivityThirdPartyFeeRefundDetail + { + return $this->typeThirdPartyFeeRefundDetails; + } + + /** + * @param ?PaymentBalanceActivityThirdPartyFeeRefundDetail $value + */ + public function setTypeThirdPartyFeeRefundDetails(?PaymentBalanceActivityThirdPartyFeeRefundDetail $value = null): self + { + $this->typeThirdPartyFeeRefundDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivitySquarePayrollTransferDetail + */ + public function getTypeSquarePayrollTransferDetails(): ?PaymentBalanceActivitySquarePayrollTransferDetail + { + return $this->typeSquarePayrollTransferDetails; + } + + /** + * @param ?PaymentBalanceActivitySquarePayrollTransferDetail $value + */ + public function setTypeSquarePayrollTransferDetails(?PaymentBalanceActivitySquarePayrollTransferDetail $value = null): self + { + $this->typeSquarePayrollTransferDetails = $value; + return $this; + } + + /** + * @return ?PaymentBalanceActivitySquarePayrollTransferReversedDetail + */ + public function getTypeSquarePayrollTransferReversedDetails(): ?PaymentBalanceActivitySquarePayrollTransferReversedDetail + { + return $this->typeSquarePayrollTransferReversedDetails; + } + + /** + * @param ?PaymentBalanceActivitySquarePayrollTransferReversedDetail $value + */ + public function setTypeSquarePayrollTransferReversedDetails(?PaymentBalanceActivitySquarePayrollTransferReversedDetail $value = null): self + { + $this->typeSquarePayrollTransferReversedDetails = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PayoutFee.php b/src/Types/PayoutFee.php new file mode 100644 index 00000000..3961a4ab --- /dev/null +++ b/src/Types/PayoutFee.php @@ -0,0 +1,107 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @param array{ + * amountMoney?: ?Money, + * effectiveAt?: ?string, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->amountMoney = $values['amountMoney'] ?? null; + $this->effectiveAt = $values['effectiveAt'] ?? null; + $this->type = $values['type'] ?? null; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEffectiveAt(): ?string + { + return $this->effectiveAt; + } + + /** + * @param ?string $value + */ + public function setEffectiveAt(?string $value = null): self + { + $this->effectiveAt = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PayoutFeeType.php b/src/Types/PayoutFeeType.php new file mode 100644 index 00000000..18eaeb48 --- /dev/null +++ b/src/Types/PayoutFeeType.php @@ -0,0 +1,9 @@ +uid = $values['uid'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->orderTemplateId = $values['orderTemplateId'] ?? null; + $this->planPhaseUid = $values['planPhaseUid'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderTemplateId(): ?string + { + return $this->orderTemplateId; + } + + /** + * @param ?string $value + */ + public function setOrderTemplateId(?string $value = null): self + { + $this->orderTemplateId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlanPhaseUid(): ?string + { + return $this->planPhaseUid; + } + + /** + * @param ?string $value + */ + public function setPlanPhaseUid(?string $value = null): self + { + $this->planPhaseUid = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PhaseInput.php b/src/Types/PhaseInput.php new file mode 100644 index 00000000..0e502851 --- /dev/null +++ b/src/Types/PhaseInput.php @@ -0,0 +1,79 @@ +ordinal = $values['ordinal']; + $this->orderTemplateId = $values['orderTemplateId'] ?? null; + } + + /** + * @return int + */ + public function getOrdinal(): int + { + return $this->ordinal; + } + + /** + * @param int $value + */ + public function setOrdinal(int $value): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderTemplateId(): ?string + { + return $this->orderTemplateId; + } + + /** + * @param ?string $value + */ + public function setOrderTemplateId(?string $value = null): self + { + $this->orderTemplateId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PrePopulatedData.php b/src/Types/PrePopulatedData.php new file mode 100644 index 00000000..37ab791e --- /dev/null +++ b/src/Types/PrePopulatedData.php @@ -0,0 +1,106 @@ +buyerEmail = $values['buyerEmail'] ?? null; + $this->buyerPhoneNumber = $values['buyerPhoneNumber'] ?? null; + $this->buyerAddress = $values['buyerAddress'] ?? null; + } + + /** + * @return ?string + */ + public function getBuyerEmail(): ?string + { + return $this->buyerEmail; + } + + /** + * @param ?string $value + */ + public function setBuyerEmail(?string $value = null): self + { + $this->buyerEmail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerPhoneNumber(): ?string + { + return $this->buyerPhoneNumber; + } + + /** + * @param ?string $value + */ + public function setBuyerPhoneNumber(?string $value = null): self + { + $this->buyerPhoneNumber = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getBuyerAddress(): ?Address + { + return $this->buyerAddress; + } + + /** + * @param ?Address $value + */ + public function setBuyerAddress(?Address $value = null): self + { + $this->buyerAddress = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ProcessingFee.php b/src/Types/ProcessingFee.php new file mode 100644 index 00000000..260966ab --- /dev/null +++ b/src/Types/ProcessingFee.php @@ -0,0 +1,109 @@ +effectiveAt = $values['effectiveAt'] ?? null; + $this->type = $values['type'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getEffectiveAt(): ?string + { + return $this->effectiveAt; + } + + /** + * @param ?string $value + */ + public function setEffectiveAt(?string $value = null): self + { + $this->effectiveAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?string $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Product.php b/src/Types/Product.php new file mode 100644 index 00000000..fbdb97dc --- /dev/null +++ b/src/Types/Product.php @@ -0,0 +1,17 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoice?: ?Invoice, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoice = $values['invoice'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Invoice + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param ?Invoice $value + */ + public function setInvoice(?Invoice $value = null): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/QrCodeOptions.php b/src/Types/QrCodeOptions.php new file mode 100644 index 00000000..43300a65 --- /dev/null +++ b/src/Types/QrCodeOptions.php @@ -0,0 +1,107 @@ +title = $values['title']; + $this->body = $values['body']; + $this->barcodeContents = $values['barcodeContents']; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function getBody(): string + { + return $this->body; + } + + /** + * @param string $value + */ + public function setBody(string $value): self + { + $this->body = $value; + return $this; + } + + /** + * @return string + */ + public function getBarcodeContents(): string + { + return $this->barcodeContents; + } + + /** + * @param string $value + */ + public function setBarcodeContents(string $value): self + { + $this->barcodeContents = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/QuickPay.php b/src/Types/QuickPay.php new file mode 100644 index 00000000..1c873b23 --- /dev/null +++ b/src/Types/QuickPay.php @@ -0,0 +1,106 @@ +name = $values['name']; + $this->priceMoney = $values['priceMoney']; + $this->locationId = $values['locationId']; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $value + */ + public function setName(string $value): self + { + $this->name = $value; + return $this; + } + + /** + * @return Money + */ + public function getPriceMoney(): Money + { + return $this->priceMoney; + } + + /** + * @param Money $value + */ + public function setPriceMoney(Money $value): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Range.php b/src/Types/Range.php new file mode 100644 index 00000000..5483de2b --- /dev/null +++ b/src/Types/Range.php @@ -0,0 +1,85 @@ +min = $values['min'] ?? null; + $this->max = $values['max'] ?? null; + } + + /** + * @return ?string + */ + public function getMin(): ?string + { + return $this->min; + } + + /** + * @param ?string $value + */ + public function setMin(?string $value = null): self + { + $this->min = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMax(): ?string + { + return $this->max; + } + + /** + * @param ?string $value + */ + public function setMax(?string $value = null): self + { + $this->max = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ReceiptOptions.php b/src/Types/ReceiptOptions.php new file mode 100644 index 00000000..9e4c80c1 --- /dev/null +++ b/src/Types/ReceiptOptions.php @@ -0,0 +1,111 @@ +paymentId = $values['paymentId']; + $this->printOnly = $values['printOnly'] ?? null; + $this->isDuplicate = $values['isDuplicate'] ?? null; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPrintOnly(): ?bool + { + return $this->printOnly; + } + + /** + * @param ?bool $value + */ + public function setPrintOnly(?bool $value = null): self + { + $this->printOnly = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsDuplicate(): ?bool + { + return $this->isDuplicate; + } + + /** + * @param ?bool $value + */ + public function setIsDuplicate(?bool $value = null): self + { + $this->isDuplicate = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RedeemLoyaltyRewardResponse.php b/src/Types/RedeemLoyaltyRewardResponse.php new file mode 100644 index 00000000..19b63261 --- /dev/null +++ b/src/Types/RedeemLoyaltyRewardResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?LoyaltyEvent $event The `LoyaltyEvent` for redeeming the reward. + */ + #[JsonProperty('event')] + private ?LoyaltyEvent $event; + + /** + * @param array{ + * errors?: ?array, + * event?: ?LoyaltyEvent, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->event = $values['event'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?LoyaltyEvent + */ + public function getEvent(): ?LoyaltyEvent + { + return $this->event; + } + + /** + * @param ?LoyaltyEvent $value + */ + public function setEvent(?LoyaltyEvent $value = null): self + { + $this->event = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Refund.php b/src/Types/Refund.php new file mode 100644 index 00000000..e77cf1e2 --- /dev/null +++ b/src/Types/Refund.php @@ -0,0 +1,287 @@ + $status + */ + #[JsonProperty('status')] + private string $status; + + /** + * @var ?Money $processingFeeMoney The amount of Square processing fee money refunded to the *merchant*. + */ + #[JsonProperty('processing_fee_money')] + private ?Money $processingFeeMoney; + + /** + * Additional recipients (other than the merchant) receiving a portion of this refund. + * For example, fees assessed on a refund of a purchase by a third party integration. + * + * @var ?array $additionalRecipients + */ + #[JsonProperty('additional_recipients'), ArrayType([AdditionalRecipient::class])] + private ?array $additionalRecipients; + + /** + * @param array{ + * id: string, + * locationId: string, + * tenderId: string, + * reason: string, + * amountMoney: Money, + * status: value-of, + * transactionId?: ?string, + * createdAt?: ?string, + * processingFeeMoney?: ?Money, + * additionalRecipients?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->locationId = $values['locationId']; + $this->transactionId = $values['transactionId'] ?? null; + $this->tenderId = $values['tenderId']; + $this->createdAt = $values['createdAt'] ?? null; + $this->reason = $values['reason']; + $this->amountMoney = $values['amountMoney']; + $this->status = $values['status']; + $this->processingFeeMoney = $values['processingFeeMoney'] ?? null; + $this->additionalRecipients = $values['additionalRecipients'] ?? null; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTransactionId(): ?string + { + return $this->transactionId; + } + + /** + * @param ?string $value + */ + public function setTransactionId(?string $value = null): self + { + $this->transactionId = $value; + return $this; + } + + /** + * @return string + */ + public function getTenderId(): string + { + return $this->tenderId; + } + + /** + * @param string $value + */ + public function setTenderId(string $value): self + { + $this->tenderId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param string $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return value-of + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @param value-of $value + */ + public function setStatus(string $value): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getProcessingFeeMoney(): ?Money + { + return $this->processingFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setProcessingFeeMoney(?Money $value = null): self + { + $this->processingFeeMoney = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAdditionalRecipients(): ?array + { + return $this->additionalRecipients; + } + + /** + * @param ?array $value + */ + public function setAdditionalRecipients(?array $value = null): self + { + $this->additionalRecipients = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RefundPaymentResponse.php b/src/Types/RefundPaymentResponse.php new file mode 100644 index 00000000..f4590170 --- /dev/null +++ b/src/Types/RefundPaymentResponse.php @@ -0,0 +1,84 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?PaymentRefund $refund The successfully created `PaymentRefund`. + */ + #[JsonProperty('refund')] + private ?PaymentRefund $refund; + + /** + * @param array{ + * errors?: ?array, + * refund?: ?PaymentRefund, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refund = $values['refund'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?PaymentRefund + */ + public function getRefund(): ?PaymentRefund + { + return $this->refund; + } + + /** + * @param ?PaymentRefund $value + */ + public function setRefund(?PaymentRefund $value = null): self + { + $this->refund = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RefundStatus.php b/src/Types/RefundStatus.php new file mode 100644 index 00000000..8660569d --- /dev/null +++ b/src/Types/RefundStatus.php @@ -0,0 +1,11 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The status of the domain registration. + * + * See [RegisterDomainResponseStatus](entity:RegisterDomainResponseStatus) for possible values. + * See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * errors?: ?array, + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RegisterDomainResponseStatus.php b/src/Types/RegisterDomainResponseStatus.php new file mode 100644 index 00000000..b0a0ac5d --- /dev/null +++ b/src/Types/RegisterDomainResponseStatus.php @@ -0,0 +1,9 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ResumeSubscriptionResponse.php b/src/Types/ResumeSubscriptionResponse.php new file mode 100644 index 00000000..5789a85b --- /dev/null +++ b/src/Types/ResumeSubscriptionResponse.php @@ -0,0 +1,106 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The resumed subscription. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @var ?array $actions A list of `RESUME` actions created by the request and scheduled for the subscription. + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * actions?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveBookingCustomAttributeDefinitionResponse.php b/src/Types/RetrieveBookingCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..4c416083 --- /dev/null +++ b/src/Types/RetrieveBookingCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveBookingCustomAttributeResponse.php b/src/Types/RetrieveBookingCustomAttributeResponse.php new file mode 100644 index 00000000..92430309 --- /dev/null +++ b/src/Types/RetrieveBookingCustomAttributeResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveJobResponse.php b/src/Types/RetrieveJobResponse.php new file mode 100644 index 00000000..7d850f87 --- /dev/null +++ b/src/Types/RetrieveJobResponse.php @@ -0,0 +1,81 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * job?: ?Job, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->job = $values['job'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Job + */ + public function getJob(): ?Job + { + return $this->job; + } + + /** + * @param ?Job $value + */ + public function setJob(?Job $value = null): self + { + $this->job = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveLocationBookingProfileResponse.php b/src/Types/RetrieveLocationBookingProfileResponse.php new file mode 100644 index 00000000..7d9edb06 --- /dev/null +++ b/src/Types/RetrieveLocationBookingProfileResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * locationBookingProfile?: ?LocationBookingProfile, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationBookingProfile = $values['locationBookingProfile'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?LocationBookingProfile + */ + public function getLocationBookingProfile(): ?LocationBookingProfile + { + return $this->locationBookingProfile; + } + + /** + * @param ?LocationBookingProfile $value + */ + public function setLocationBookingProfile(?LocationBookingProfile $value = null): self + { + $this->locationBookingProfile = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveLocationCustomAttributeDefinitionResponse.php b/src/Types/RetrieveLocationCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..8e626394 --- /dev/null +++ b/src/Types/RetrieveLocationCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveLocationCustomAttributeResponse.php b/src/Types/RetrieveLocationCustomAttributeResponse.php new file mode 100644 index 00000000..1defdbd5 --- /dev/null +++ b/src/Types/RetrieveLocationCustomAttributeResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveLocationSettingsResponse.php b/src/Types/RetrieveLocationSettingsResponse.php new file mode 100644 index 00000000..fe9ec7bd --- /dev/null +++ b/src/Types/RetrieveLocationSettingsResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CheckoutLocationSettings $locationSettings The location settings. + */ + #[JsonProperty('location_settings')] + private ?CheckoutLocationSettings $locationSettings; + + /** + * @param array{ + * errors?: ?array, + * locationSettings?: ?CheckoutLocationSettings, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->locationSettings = $values['locationSettings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CheckoutLocationSettings + */ + public function getLocationSettings(): ?CheckoutLocationSettings + { + return $this->locationSettings; + } + + /** + * @param ?CheckoutLocationSettings $value + */ + public function setLocationSettings(?CheckoutLocationSettings $value = null): self + { + $this->locationSettings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveMerchantCustomAttributeDefinitionResponse.php b/src/Types/RetrieveMerchantCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..49049995 --- /dev/null +++ b/src/Types/RetrieveMerchantCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveMerchantCustomAttributeResponse.php b/src/Types/RetrieveMerchantCustomAttributeResponse.php new file mode 100644 index 00000000..347d02f9 --- /dev/null +++ b/src/Types/RetrieveMerchantCustomAttributeResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveMerchantSettingsResponse.php b/src/Types/RetrieveMerchantSettingsResponse.php new file mode 100644 index 00000000..1ebb94b8 --- /dev/null +++ b/src/Types/RetrieveMerchantSettingsResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CheckoutMerchantSettings $merchantSettings The merchant settings. + */ + #[JsonProperty('merchant_settings')] + private ?CheckoutMerchantSettings $merchantSettings; + + /** + * @param array{ + * errors?: ?array, + * merchantSettings?: ?CheckoutMerchantSettings, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->merchantSettings = $values['merchantSettings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettings + */ + public function getMerchantSettings(): ?CheckoutMerchantSettings + { + return $this->merchantSettings; + } + + /** + * @param ?CheckoutMerchantSettings $value + */ + public function setMerchantSettings(?CheckoutMerchantSettings $value = null): self + { + $this->merchantSettings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveOrderCustomAttributeDefinitionResponse.php b/src/Types/RetrieveOrderCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..4afea71f --- /dev/null +++ b/src/Types/RetrieveOrderCustomAttributeDefinitionResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveOrderCustomAttributeResponse.php b/src/Types/RetrieveOrderCustomAttributeResponse.php new file mode 100644 index 00000000..1ec5b541 --- /dev/null +++ b/src/Types/RetrieveOrderCustomAttributeResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RetrieveTokenStatusResponse.php b/src/Types/RetrieveTokenStatusResponse.php new file mode 100644 index 00000000..a0007268 --- /dev/null +++ b/src/Types/RetrieveTokenStatusResponse.php @@ -0,0 +1,156 @@ + $scopes The list of scopes associated with an access token. + */ + #[JsonProperty('scopes'), ArrayType(['string'])] + private ?array $scopes; + + /** + * @var ?string $expiresAt The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires. + */ + #[JsonProperty('expires_at')] + private ?string $expiresAt; + + /** + * @var ?string $clientId The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token. + */ + #[JsonProperty('client_id')] + private ?string $clientId; + + /** + * @var ?string $merchantId The ID of the authorizing merchant's business. + */ + #[JsonProperty('merchant_id')] + private ?string $merchantId; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * scopes?: ?array, + * expiresAt?: ?string, + * clientId?: ?string, + * merchantId?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->scopes = $values['scopes'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->clientId = $values['clientId'] ?? null; + $this->merchantId = $values['merchantId'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getScopes(): ?array + { + return $this->scopes; + } + + /** + * @param ?array $value + */ + public function setScopes(?array $value = null): self + { + $this->scopes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiresAt(): ?string + { + return $this->expiresAt; + } + + /** + * @param ?string $value + */ + public function setExpiresAt(?string $value = null): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClientId(): ?string + { + return $this->clientId; + } + + /** + * @param ?string $value + */ + public function setClientId(?string $value = null): self + { + $this->clientId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getMerchantId(): ?string + { + return $this->merchantId; + } + + /** + * @param ?string $value + */ + public function setMerchantId(?string $value = null): self + { + $this->merchantId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RevokeTokenResponse.php b/src/Types/RevokeTokenResponse.php new file mode 100644 index 00000000..5801b3c7 --- /dev/null +++ b/src/Types/RevokeTokenResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * success?: ?bool, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->success = $values['success'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?bool + */ + public function getSuccess(): ?bool + { + return $this->success; + } + + /** + * @param ?bool $value + */ + public function setSuccess(?bool $value = null): self + { + $this->success = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RiskEvaluation.php b/src/Types/RiskEvaluation.php new file mode 100644 index 00000000..0850c7db --- /dev/null +++ b/src/Types/RiskEvaluation.php @@ -0,0 +1,87 @@ + $riskLevel + */ + #[JsonProperty('risk_level')] + private ?string $riskLevel; + + /** + * @param array{ + * createdAt?: ?string, + * riskLevel?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->createdAt = $values['createdAt'] ?? null; + $this->riskLevel = $values['riskLevel'] ?? null; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getRiskLevel(): ?string + { + return $this->riskLevel; + } + + /** + * @param ?value-of $value + */ + public function setRiskLevel(?string $value = null): self + { + $this->riskLevel = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/RiskEvaluationRiskLevel.php b/src/Types/RiskEvaluationRiskLevel.php new file mode 100644 index 00000000..eb34bf2d --- /dev/null +++ b/src/Types/RiskEvaluationRiskLevel.php @@ -0,0 +1,11 @@ +customerId = $values['customerId']; + $this->cardId = $values['cardId'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + } + + /** + * @return string + */ + public function getCustomerId(): string + { + return $this->customerId; + } + + /** + * @param string $value + */ + public function setCustomerId(string $value): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardId(): ?string + { + return $this->cardId; + } + + /** + * @param ?string $value + */ + public function setCardId(?string $value = null): self + { + $this->cardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchAvailabilityFilter.php b/src/Types/SearchAvailabilityFilter.php new file mode 100644 index 00000000..1531f735 --- /dev/null +++ b/src/Types/SearchAvailabilityFilter.php @@ -0,0 +1,146 @@ + $segmentFilters + */ + #[JsonProperty('segment_filters'), ArrayType([SegmentFilter::class])] + private ?array $segmentFilters; + + /** + * The query expression to search for buyer-accessible availabilities for an existing booking by matching the specified `booking_id` value. + * This is commonly used to reschedule an appointment. + * If this expression is set, the `location_id` and `segment_filters` expressions cannot be set. + * + * @var ?string $bookingId + */ + #[JsonProperty('booking_id')] + private ?string $bookingId; + + /** + * @param array{ + * startAtRange: TimeRange, + * locationId?: ?string, + * segmentFilters?: ?array, + * bookingId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->startAtRange = $values['startAtRange']; + $this->locationId = $values['locationId'] ?? null; + $this->segmentFilters = $values['segmentFilters'] ?? null; + $this->bookingId = $values['bookingId'] ?? null; + } + + /** + * @return TimeRange + */ + public function getStartAtRange(): TimeRange + { + return $this->startAtRange; + } + + /** + * @param TimeRange $value + */ + public function setStartAtRange(TimeRange $value): self + { + $this->startAtRange = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSegmentFilters(): ?array + { + return $this->segmentFilters; + } + + /** + * @param ?array $value + */ + public function setSegmentFilters(?array $value = null): self + { + $this->segmentFilters = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBookingId(): ?string + { + return $this->bookingId; + } + + /** + * @param ?string $value + */ + public function setBookingId(?string $value = null): self + { + $this->bookingId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchAvailabilityQuery.php b/src/Types/SearchAvailabilityQuery.php new file mode 100644 index 00000000..1e016aaf --- /dev/null +++ b/src/Types/SearchAvailabilityQuery.php @@ -0,0 +1,54 @@ +filter = $values['filter']; + } + + /** + * @return SearchAvailabilityFilter + */ + public function getFilter(): SearchAvailabilityFilter + { + return $this->filter; + } + + /** + * @param SearchAvailabilityFilter $value + */ + public function setFilter(SearchAvailabilityFilter $value): self + { + $this->filter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchAvailabilityResponse.php b/src/Types/SearchAvailabilityResponse.php new file mode 100644 index 00000000..4b12109a --- /dev/null +++ b/src/Types/SearchAvailabilityResponse.php @@ -0,0 +1,77 @@ + $availabilities List of appointment slots available for booking. + */ + #[JsonProperty('availabilities'), ArrayType([Availability::class])] + private ?array $availabilities; + + /** + * @var ?array $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * availabilities?: ?array, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->availabilities = $values['availabilities'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getAvailabilities(): ?array + { + return $this->availabilities; + } + + /** + * @param ?array $value + */ + public function setAvailabilities(?array $value = null): self + { + $this->availabilities = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchCatalogItemsRequestStockLevel.php b/src/Types/SearchCatalogItemsRequestStockLevel.php new file mode 100644 index 00000000..42fd1801 --- /dev/null +++ b/src/Types/SearchCatalogItemsRequestStockLevel.php @@ -0,0 +1,9 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $items Returned items matching the specified query expressions. + */ + #[JsonProperty('items'), ArrayType([CatalogObject::class])] + private ?array $items; + + /** + * @var ?string $cursor Pagination token used in the next request to return more of the search result. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $matchedVariationIds Ids of returned item variations matching the specified query expression. + */ + #[JsonProperty('matched_variation_ids'), ArrayType(['string'])] + private ?array $matchedVariationIds; + + /** + * @param array{ + * errors?: ?array, + * items?: ?array, + * cursor?: ?string, + * matchedVariationIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->items = $values['items'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->matchedVariationIds = $values['matchedVariationIds'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getItems(): ?array + { + return $this->items; + } + + /** + * @param ?array $value + */ + public function setItems(?array $value = null): self + { + $this->items = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMatchedVariationIds(): ?array + { + return $this->matchedVariationIds; + } + + /** + * @param ?array $value + */ + public function setMatchedVariationIds(?array $value = null): self + { + $this->matchedVariationIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchCatalogObjectsResponse.php b/src/Types/SearchCatalogObjectsResponse.php new file mode 100644 index 00000000..637e3235 --- /dev/null +++ b/src/Types/SearchCatalogObjectsResponse.php @@ -0,0 +1,158 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The pagination cursor to be used in a subsequent request. If unset, this is the final response. + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $objects The CatalogObjects returned. + */ + #[JsonProperty('objects'), ArrayType([CatalogObject::class])] + private ?array $objects; + + /** + * @var ?array $relatedObjects A list of CatalogObjects referenced by the objects in the `objects` field. + */ + #[JsonProperty('related_objects'), ArrayType([CatalogObject::class])] + private ?array $relatedObjects; + + /** + * When the associated product catalog was last updated. Will + * match the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` request. + * + * @var ?string $latestTime + */ + #[JsonProperty('latest_time')] + private ?string $latestTime; + + /** + * @param array{ + * errors?: ?array, + * cursor?: ?string, + * objects?: ?array, + * relatedObjects?: ?array, + * latestTime?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->objects = $values['objects'] ?? null; + $this->relatedObjects = $values['relatedObjects'] ?? null; + $this->latestTime = $values['latestTime'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getObjects(): ?array + { + return $this->objects; + } + + /** + * @param ?array $value + */ + public function setObjects(?array $value = null): self + { + $this->objects = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRelatedObjects(): ?array + { + return $this->relatedObjects; + } + + /** + * @param ?array $value + */ + public function setRelatedObjects(?array $value = null): self + { + $this->relatedObjects = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLatestTime(): ?string + { + return $this->latestTime; + } + + /** + * @param ?string $value + */ + public function setLatestTime(?string $value = null): self + { + $this->latestTime = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchCustomersResponse.php b/src/Types/SearchCustomersResponse.php new file mode 100644 index 00000000..919fb845 --- /dev/null +++ b/src/Types/SearchCustomersResponse.php @@ -0,0 +1,148 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`). + * Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) + * are included in the response. + * + * @var ?array $customers + */ + #[JsonProperty('customers'), ArrayType([Customer::class])] + private ?array $customers; + + /** + * A pagination cursor that can be used during subsequent calls + * to `SearchCustomers` to retrieve the next set of results associated + * with the original query. Pagination cursors are only present when + * a request succeeds and additional results are available. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * The total count of customers associated with the Square account that match the search query. Only customer profiles with + * public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is + * present only if `count` is set to `true` in the request. + * + * @var ?int $count + */ + #[JsonProperty('count')] + private ?int $count; + + /** + * @param array{ + * errors?: ?array, + * customers?: ?array, + * cursor?: ?string, + * count?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->customers = $values['customers'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->count = $values['count'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomers(): ?array + { + return $this->customers; + } + + /** + * @param ?array $value + */ + public function setCustomers(?array $value = null): self + { + $this->customers = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?int + */ + public function getCount(): ?int + { + return $this->count; + } + + /** + * @param ?int $value + */ + public function setCount(?int $value = null): self + { + $this->count = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchEventsFilter.php b/src/Types/SearchEventsFilter.php new file mode 100644 index 00000000..8379ded9 --- /dev/null +++ b/src/Types/SearchEventsFilter.php @@ -0,0 +1,130 @@ + $eventTypes Filter events by event types. + */ + #[JsonProperty('event_types'), ArrayType(['string'])] + private ?array $eventTypes; + + /** + * @var ?array $merchantIds Filter events by merchant. + */ + #[JsonProperty('merchant_ids'), ArrayType(['string'])] + private ?array $merchantIds; + + /** + * @var ?array $locationIds Filter events by location. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * @var ?TimeRange $createdAt Filter events by when they were created. + */ + #[JsonProperty('created_at')] + private ?TimeRange $createdAt; + + /** + * @param array{ + * eventTypes?: ?array, + * merchantIds?: ?array, + * locationIds?: ?array, + * createdAt?: ?TimeRange, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->eventTypes = $values['eventTypes'] ?? null; + $this->merchantIds = $values['merchantIds'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?array + */ + public function getEventTypes(): ?array + { + return $this->eventTypes; + } + + /** + * @param ?array $value + */ + public function setEventTypes(?array $value = null): self + { + $this->eventTypes = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMerchantIds(): ?array + { + return $this->merchantIds; + } + + /** + * @param ?array $value + */ + public function setMerchantIds(?array $value = null): self + { + $this->merchantIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchEventsQuery.php b/src/Types/SearchEventsQuery.php new file mode 100644 index 00000000..043840be --- /dev/null +++ b/src/Types/SearchEventsQuery.php @@ -0,0 +1,79 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?SearchEventsFilter + */ + public function getFilter(): ?SearchEventsFilter + { + return $this->filter; + } + + /** + * @param ?SearchEventsFilter $value + */ + public function setFilter(?SearchEventsFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?SearchEventsSort + */ + public function getSort(): ?SearchEventsSort + { + return $this->sort; + } + + /** + * @param ?SearchEventsSort $value + */ + public function setSort(?SearchEventsSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchEventsResponse.php b/src/Types/SearchEventsResponse.php new file mode 100644 index 00000000..fb11bd51 --- /dev/null +++ b/src/Types/SearchEventsResponse.php @@ -0,0 +1,138 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $events The list of [Event](entity:Event)s returned by the search. + */ + #[JsonProperty('events'), ArrayType([Event::class])] + private ?array $events; + + /** + * @var ?array $metadata Contains the metadata of an event. For more information, see [Event](entity:Event). + */ + #[JsonProperty('metadata'), ArrayType([EventMetadata::class])] + private ?array $metadata; + + /** + * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. If empty, this is the final response. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * events?: ?array, + * metadata?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->events = $values['events'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEvents(): ?array + { + return $this->events; + } + + /** + * @param ?array $value + */ + public function setEvents(?array $value = null): self + { + $this->events = $value; + return $this; + } + + /** + * @return ?array + */ + public function getMetadata(): ?array + { + return $this->metadata; + } + + /** + * @param ?array $value + */ + public function setMetadata(?array $value = null): self + { + $this->metadata = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchEventsSort.php b/src/Types/SearchEventsSort.php new file mode 100644 index 00000000..14e130be --- /dev/null +++ b/src/Types/SearchEventsSort.php @@ -0,0 +1,85 @@ + $order + */ + #[JsonProperty('order')] + private ?string $order; + + /** + * @param array{ + * field?: ?'DEFAULT', + * order?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->field = $values['field'] ?? null; + $this->order = $values['order'] ?? null; + } + + /** + * @return ?'DEFAULT' + */ + public function getField(): ?string + { + return $this->field; + } + + /** + * @param ?'DEFAULT' $value + */ + public function setField(?string $value = null): self + { + $this->field = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchInvoicesResponse.php b/src/Types/SearchInvoicesResponse.php new file mode 100644 index 00000000..d32ad57c --- /dev/null +++ b/src/Types/SearchInvoicesResponse.php @@ -0,0 +1,110 @@ + $invoices The list of invoices returned by the search. + */ + #[JsonProperty('invoices'), ArrayType([Invoice::class])] + private ?array $invoices; + + /** + * When a response is truncated, it includes a cursor that you can use in a + * subsequent request to fetch the next set of invoices. If empty, this is the final + * response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoices?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoices = $values['invoices'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getInvoices(): ?array + { + return $this->invoices; + } + + /** + * @param ?array $value + */ + public function setInvoices(?array $value = null): self + { + $this->invoices = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php b/src/Types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php new file mode 100644 index 00000000..0d8e6f60 --- /dev/null +++ b/src/Types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.php @@ -0,0 +1,92 @@ + $mappings + */ + #[JsonProperty('mappings'), ArrayType([LoyaltyAccountMapping::class])] + private ?array $mappings; + + /** + * The set of customer IDs to use in the loyalty account search. + * + * This cannot be combined with `mappings`. + * + * Max: 30 customer IDs + * + * @var ?array $customerIds + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private ?array $customerIds; + + /** + * @param array{ + * mappings?: ?array, + * customerIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->mappings = $values['mappings'] ?? null; + $this->customerIds = $values['customerIds'] ?? null; + } + + /** + * @return ?array + */ + public function getMappings(): ?array + { + return $this->mappings; + } + + /** + * @param ?array $value + */ + public function setMappings(?array $value = null): self + { + $this->mappings = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCustomerIds(): ?array + { + return $this->customerIds; + } + + /** + * @param ?array $value + */ + public function setCustomerIds(?array $value = null): self + { + $this->customerIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchLoyaltyAccountsResponse.php b/src/Types/SearchLoyaltyAccountsResponse.php new file mode 100644 index 00000000..4d1bf471 --- /dev/null +++ b/src/Types/SearchLoyaltyAccountsResponse.php @@ -0,0 +1,113 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The loyalty accounts that met the search criteria, + * in order of creation date. + * + * @var ?array $loyaltyAccounts + */ + #[JsonProperty('loyalty_accounts'), ArrayType([LoyaltyAccount::class])] + private ?array $loyaltyAccounts; + + /** + * The pagination cursor to use in a subsequent + * request. If empty, this is the final response. + * For more information, + * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * loyaltyAccounts?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->loyaltyAccounts = $values['loyaltyAccounts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLoyaltyAccounts(): ?array + { + return $this->loyaltyAccounts; + } + + /** + * @param ?array $value + */ + public function setLoyaltyAccounts(?array $value = null): self + { + $this->loyaltyAccounts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchLoyaltyEventsResponse.php b/src/Types/SearchLoyaltyEventsResponse.php new file mode 100644 index 00000000..dac8b25b --- /dev/null +++ b/src/Types/SearchLoyaltyEventsResponse.php @@ -0,0 +1,111 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $events The loyalty events that satisfy the search criteria. + */ + #[JsonProperty('events'), ArrayType([LoyaltyEvent::class])] + private ?array $events; + + /** + * The pagination cursor to be used in a subsequent + * request. If empty, this is the final response. + * For more information, + * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * events?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->events = $values['events'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEvents(): ?array + { + return $this->events; + } + + /** + * @param ?array $value + */ + public function setEvents(?array $value = null): self + { + $this->events = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php b/src/Types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php new file mode 100644 index 00000000..3b3836cb --- /dev/null +++ b/src/Types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php @@ -0,0 +1,82 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * loyaltyAccountId: string, + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->loyaltyAccountId = $values['loyaltyAccountId']; + $this->status = $values['status'] ?? null; + } + + /** + * @return string + */ + public function getLoyaltyAccountId(): string + { + return $this->loyaltyAccountId; + } + + /** + * @param string $value + */ + public function setLoyaltyAccountId(string $value): self + { + $this->loyaltyAccountId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchLoyaltyRewardsResponse.php b/src/Types/SearchLoyaltyRewardsResponse.php new file mode 100644 index 00000000..f5ca645b --- /dev/null +++ b/src/Types/SearchLoyaltyRewardsResponse.php @@ -0,0 +1,111 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The loyalty rewards that satisfy the search criteria. + * These are returned in descending order by `updated_at`. + * + * @var ?array $rewards + */ + #[JsonProperty('rewards'), ArrayType([LoyaltyReward::class])] + private ?array $rewards; + + /** + * The pagination cursor to be used in a subsequent + * request. If empty, this is the final response. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * rewards?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->rewards = $values['rewards'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRewards(): ?array + { + return $this->rewards; + } + + /** + * @param ?array $value + */ + public function setRewards(?array $value = null): self + { + $this->rewards = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersCustomerFilter.php b/src/Types/SearchOrdersCustomerFilter.php new file mode 100644 index 00000000..20d423c0 --- /dev/null +++ b/src/Types/SearchOrdersCustomerFilter.php @@ -0,0 +1,61 @@ + $customerIds + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private ?array $customerIds; + + /** + * @param array{ + * customerIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customerIds = $values['customerIds'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomerIds(): ?array + { + return $this->customerIds; + } + + /** + * @param ?array $value + */ + public function setCustomerIds(?array $value = null): self + { + $this->customerIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersDateTimeFilter.php b/src/Types/SearchOrdersDateTimeFilter.php new file mode 100644 index 00000000..22758f7b --- /dev/null +++ b/src/Types/SearchOrdersDateTimeFilter.php @@ -0,0 +1,129 @@ +createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->closedAt = $values['closedAt'] ?? null; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getUpdatedAt(): ?TimeRange + { + return $this->updatedAt; + } + + /** + * @param ?TimeRange $value + */ + public function setUpdatedAt(?TimeRange $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getClosedAt(): ?TimeRange + { + return $this->closedAt; + } + + /** + * @param ?TimeRange $value + */ + public function setClosedAt(?TimeRange $value = null): self + { + $this->closedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersFilter.php b/src/Types/SearchOrdersFilter.php new file mode 100644 index 00000000..8a1f2e0d --- /dev/null +++ b/src/Types/SearchOrdersFilter.php @@ -0,0 +1,161 @@ +stateFilter = $values['stateFilter'] ?? null; + $this->dateTimeFilter = $values['dateTimeFilter'] ?? null; + $this->fulfillmentFilter = $values['fulfillmentFilter'] ?? null; + $this->sourceFilter = $values['sourceFilter'] ?? null; + $this->customerFilter = $values['customerFilter'] ?? null; + } + + /** + * @return ?SearchOrdersStateFilter + */ + public function getStateFilter(): ?SearchOrdersStateFilter + { + return $this->stateFilter; + } + + /** + * @param ?SearchOrdersStateFilter $value + */ + public function setStateFilter(?SearchOrdersStateFilter $value = null): self + { + $this->stateFilter = $value; + return $this; + } + + /** + * @return ?SearchOrdersDateTimeFilter + */ + public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter + { + return $this->dateTimeFilter; + } + + /** + * @param ?SearchOrdersDateTimeFilter $value + */ + public function setDateTimeFilter(?SearchOrdersDateTimeFilter $value = null): self + { + $this->dateTimeFilter = $value; + return $this; + } + + /** + * @return ?SearchOrdersFulfillmentFilter + */ + public function getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter + { + return $this->fulfillmentFilter; + } + + /** + * @param ?SearchOrdersFulfillmentFilter $value + */ + public function setFulfillmentFilter(?SearchOrdersFulfillmentFilter $value = null): self + { + $this->fulfillmentFilter = $value; + return $this; + } + + /** + * @return ?SearchOrdersSourceFilter + */ + public function getSourceFilter(): ?SearchOrdersSourceFilter + { + return $this->sourceFilter; + } + + /** + * @param ?SearchOrdersSourceFilter $value + */ + public function setSourceFilter(?SearchOrdersSourceFilter $value = null): self + { + $this->sourceFilter = $value; + return $this; + } + + /** + * @return ?SearchOrdersCustomerFilter + */ + public function getCustomerFilter(): ?SearchOrdersCustomerFilter + { + return $this->customerFilter; + } + + /** + * @param ?SearchOrdersCustomerFilter $value + */ + public function setCustomerFilter(?SearchOrdersCustomerFilter $value = null): self + { + $this->customerFilter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersFulfillmentFilter.php b/src/Types/SearchOrdersFulfillmentFilter.php new file mode 100644 index 00000000..1540f910 --- /dev/null +++ b/src/Types/SearchOrdersFulfillmentFilter.php @@ -0,0 +1,90 @@ +> $fulfillmentTypes + */ + #[JsonProperty('fulfillment_types'), ArrayType(['string'])] + private ?array $fulfillmentTypes; + + /** + * A list of [fulfillment states](entity:FulfillmentState) to filter + * for. The list returns orders if any of its fulfillments match any of the + * fulfillment states listed in this field. + * See [FulfillmentState](#type-fulfillmentstate) for possible values + * + * @var ?array> $fulfillmentStates + */ + #[JsonProperty('fulfillment_states'), ArrayType(['string'])] + private ?array $fulfillmentStates; + + /** + * @param array{ + * fulfillmentTypes?: ?array>, + * fulfillmentStates?: ?array>, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->fulfillmentTypes = $values['fulfillmentTypes'] ?? null; + $this->fulfillmentStates = $values['fulfillmentStates'] ?? null; + } + + /** + * @return ?array> + */ + public function getFulfillmentTypes(): ?array + { + return $this->fulfillmentTypes; + } + + /** + * @param ?array> $value + */ + public function setFulfillmentTypes(?array $value = null): self + { + $this->fulfillmentTypes = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getFulfillmentStates(): ?array + { + return $this->fulfillmentStates; + } + + /** + * @param ?array> $value + */ + public function setFulfillmentStates(?array $value = null): self + { + $this->fulfillmentStates = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersQuery.php b/src/Types/SearchOrdersQuery.php new file mode 100644 index 00000000..23c30d7d --- /dev/null +++ b/src/Types/SearchOrdersQuery.php @@ -0,0 +1,79 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?SearchOrdersFilter + */ + public function getFilter(): ?SearchOrdersFilter + { + return $this->filter; + } + + /** + * @param ?SearchOrdersFilter $value + */ + public function setFilter(?SearchOrdersFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?SearchOrdersSort + */ + public function getSort(): ?SearchOrdersSort + { + return $this->sort; + } + + /** + * @param ?SearchOrdersSort $value + */ + public function setSort(?SearchOrdersSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersResponse.php b/src/Types/SearchOrdersResponse.php new file mode 100644 index 00000000..d8aa856a --- /dev/null +++ b/src/Types/SearchOrdersResponse.php @@ -0,0 +1,142 @@ + $orderEntries + */ + #[JsonProperty('order_entries'), ArrayType([OrderEntry::class])] + private ?array $orderEntries; + + /** + * A list of + * [Order](entity:Order) objects that match the query conditions. The list is populated only if + * `return_entries` is set to `false` in the request. + * + * @var ?array $orders + */ + #[JsonProperty('orders'), ArrayType([Order::class])] + private ?array $orders; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors [Errors](entity:Error) encountered during the search. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * orderEntries?: ?array, + * orders?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->orderEntries = $values['orderEntries'] ?? null; + $this->orders = $values['orders'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getOrderEntries(): ?array + { + return $this->orderEntries; + } + + /** + * @param ?array $value + */ + public function setOrderEntries(?array $value = null): self + { + $this->orderEntries = $value; + return $this; + } + + /** + * @return ?array + */ + public function getOrders(): ?array + { + return $this->orders; + } + + /** + * @param ?array $value + */ + public function setOrders(?array $value = null): self + { + $this->orders = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersSort.php b/src/Types/SearchOrdersSort.php new file mode 100644 index 00000000..fd622e8f --- /dev/null +++ b/src/Types/SearchOrdersSort.php @@ -0,0 +1,95 @@ + $sortField + */ + #[JsonProperty('sort_field')] + private string $sortField; + + /** + * The chronological order in which results are returned. Defaults to `DESC`. + * See [SortOrder](#type-sortorder) for possible values + * + * @var ?value-of $sortOrder + */ + #[JsonProperty('sort_order')] + private ?string $sortOrder; + + /** + * @param array{ + * sortField: value-of, + * sortOrder?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->sortField = $values['sortField']; + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return value-of + */ + public function getSortField(): string + { + return $this->sortField; + } + + /** + * @param value-of $value + */ + public function setSortField(string $value): self + { + $this->sortField = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersSortField.php b/src/Types/SearchOrdersSortField.php new file mode 100644 index 00000000..3543f9ab --- /dev/null +++ b/src/Types/SearchOrdersSortField.php @@ -0,0 +1,10 @@ + $sourceNames + */ + #[JsonProperty('source_names'), ArrayType(['string'])] + private ?array $sourceNames; + + /** + * @param array{ + * sourceNames?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->sourceNames = $values['sourceNames'] ?? null; + } + + /** + * @return ?array + */ + public function getSourceNames(): ?array + { + return $this->sourceNames; + } + + /** + * @param ?array $value + */ + public function setSourceNames(?array $value = null): self + { + $this->sourceNames = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchOrdersStateFilter.php b/src/Types/SearchOrdersStateFilter.php new file mode 100644 index 00000000..6d33a63f --- /dev/null +++ b/src/Types/SearchOrdersStateFilter.php @@ -0,0 +1,58 @@ +> $states + */ + #[JsonProperty('states'), ArrayType(['string'])] + private array $states; + + /** + * @param array{ + * states: array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->states = $values['states']; + } + + /** + * @return array> + */ + public function getStates(): array + { + return $this->states; + } + + /** + * @param array> $value + */ + public function setStates(array $value): self + { + $this->states = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchShiftsResponse.php b/src/Types/SearchShiftsResponse.php new file mode 100644 index 00000000..4ba5d1a1 --- /dev/null +++ b/src/Types/SearchShiftsResponse.php @@ -0,0 +1,107 @@ + $shifts Shifts. + */ + #[JsonProperty('shifts'), ArrayType([Shift::class])] + private ?array $shifts; + + /** + * @var ?string $cursor An opaque cursor for fetching the next page. + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * shifts?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->shifts = $values['shifts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getShifts(): ?array + { + return $this->shifts; + } + + /** + * @param ?array $value + */ + public function setShifts(?array $value = null): self + { + $this->shifts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchSubscriptionsFilter.php b/src/Types/SearchSubscriptionsFilter.php new file mode 100644 index 00000000..de0478e8 --- /dev/null +++ b/src/Types/SearchSubscriptionsFilter.php @@ -0,0 +1,106 @@ + $customerIds A filter to select subscriptions based on the subscribing customer IDs. + */ + #[JsonProperty('customer_ids'), ArrayType(['string'])] + private ?array $customerIds; + + /** + * @var ?array $locationIds A filter to select subscriptions based on the location. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * @var ?array $sourceNames A filter to select subscriptions based on the source application. + */ + #[JsonProperty('source_names'), ArrayType(['string'])] + private ?array $sourceNames; + + /** + * @param array{ + * customerIds?: ?array, + * locationIds?: ?array, + * sourceNames?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customerIds = $values['customerIds'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + $this->sourceNames = $values['sourceNames'] ?? null; + } + + /** + * @return ?array + */ + public function getCustomerIds(): ?array + { + return $this->customerIds; + } + + /** + * @param ?array $value + */ + public function setCustomerIds(?array $value = null): self + { + $this->customerIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSourceNames(): ?array + { + return $this->sourceNames; + } + + /** + * @param ?array $value + */ + public function setSourceNames(?array $value = null): self + { + $this->sourceNames = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchSubscriptionsQuery.php b/src/Types/SearchSubscriptionsQuery.php new file mode 100644 index 00000000..c25d87a7 --- /dev/null +++ b/src/Types/SearchSubscriptionsQuery.php @@ -0,0 +1,54 @@ +filter = $values['filter'] ?? null; + } + + /** + * @return ?SearchSubscriptionsFilter + */ + public function getFilter(): ?SearchSubscriptionsFilter + { + return $this->filter; + } + + /** + * @param ?SearchSubscriptionsFilter $value + */ + public function setFilter(?SearchSubscriptionsFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchSubscriptionsResponse.php b/src/Types/SearchSubscriptionsResponse.php new file mode 100644 index 00000000..7b3224c8 --- /dev/null +++ b/src/Types/SearchSubscriptionsResponse.php @@ -0,0 +1,112 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $subscriptions The subscriptions matching the specified query expressions. + */ + #[JsonProperty('subscriptions'), ArrayType([Subscription::class])] + private ?array $subscriptions; + + /** + * When the total number of resulting subscription exceeds the limit of a paged response, + * the response includes a cursor for you to use in a subsequent request to fetch the next set of results. + * If the cursor is unset, the response contains the last page of the results. + * + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * subscriptions?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscriptions = $values['subscriptions'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSubscriptions(): ?array + { + return $this->subscriptions; + } + + /** + * @param ?array $value + */ + public function setSubscriptions(?array $value = null): self + { + $this->subscriptions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTeamMembersFilter.php b/src/Types/SearchTeamMembersFilter.php new file mode 100644 index 00000000..af4c9751 --- /dev/null +++ b/src/Types/SearchTeamMembersFilter.php @@ -0,0 +1,118 @@ + $locationIds + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * When present, filters by team members who match the given status. + * When empty, includes team members of all statuses. + * See [TeamMemberStatus](#type-teammemberstatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?bool $isOwner When present and set to true, returns the team member who is the owner of the Square account. + */ + #[JsonProperty('is_owner')] + private ?bool $isOwner; + + /** + * @param array{ + * locationIds?: ?array, + * status?: ?value-of, + * isOwner?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationIds = $values['locationIds'] ?? null; + $this->status = $values['status'] ?? null; + $this->isOwner = $values['isOwner'] ?? null; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOwner(): ?bool + { + return $this->isOwner; + } + + /** + * @param ?bool $value + */ + public function setIsOwner(?bool $value = null): self + { + $this->isOwner = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTeamMembersQuery.php b/src/Types/SearchTeamMembersQuery.php new file mode 100644 index 00000000..7896edd2 --- /dev/null +++ b/src/Types/SearchTeamMembersQuery.php @@ -0,0 +1,54 @@ +filter = $values['filter'] ?? null; + } + + /** + * @return ?SearchTeamMembersFilter + */ + public function getFilter(): ?SearchTeamMembersFilter + { + return $this->filter; + } + + /** + * @param ?SearchTeamMembersFilter $value + */ + public function setFilter(?SearchTeamMembersFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTeamMembersResponse.php b/src/Types/SearchTeamMembersResponse.php new file mode 100644 index 00000000..d3fd9c88 --- /dev/null +++ b/src/Types/SearchTeamMembersResponse.php @@ -0,0 +1,108 @@ + $teamMembers The filtered list of `TeamMember` objects. + */ + #[JsonProperty('team_members'), ArrayType([TeamMember::class])] + private ?array $teamMembers; + + /** + * The opaque cursor for fetching the next page. For more information, see + * [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @var ?array $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMembers?: ?array, + * cursor?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMembers = $values['teamMembers'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getTeamMembers(): ?array + { + return $this->teamMembers; + } + + /** + * @param ?array $value + */ + public function setTeamMembers(?array $value = null): self + { + $this->teamMembers = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTerminalActionsResponse.php b/src/Types/SearchTerminalActionsResponse.php new file mode 100644 index 00000000..38eb3733 --- /dev/null +++ b/src/Types/SearchTerminalActionsResponse.php @@ -0,0 +1,108 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $action The requested search result of `TerminalAction`s. + */ + #[JsonProperty('action'), ArrayType([TerminalAction::class])] + private ?array $action; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more + * information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * action?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->action = $values['action'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAction(): ?array + { + return $this->action; + } + + /** + * @param ?array $value + */ + public function setAction(?array $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTerminalCheckoutsResponse.php b/src/Types/SearchTerminalCheckoutsResponse.php new file mode 100644 index 00000000..b560f7ee --- /dev/null +++ b/src/Types/SearchTerminalCheckoutsResponse.php @@ -0,0 +1,107 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $checkouts The requested search result of `TerminalCheckout` objects. + */ + #[JsonProperty('checkouts'), ArrayType([TerminalCheckout::class])] + private ?array $checkouts; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * checkouts?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->checkouts = $values['checkouts'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getCheckouts(): ?array + { + return $this->checkouts; + } + + /** + * @param ?array $value + */ + public function setCheckouts(?array $value = null): self + { + $this->checkouts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchTerminalRefundsResponse.php b/src/Types/SearchTerminalRefundsResponse.php new file mode 100644 index 00000000..e99600c5 --- /dev/null +++ b/src/Types/SearchTerminalRefundsResponse.php @@ -0,0 +1,107 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $refunds The requested search result of `TerminalRefund` objects. + */ + #[JsonProperty('refunds'), ArrayType([TerminalRefund::class])] + private ?array $refunds; + + /** + * The pagination cursor to be used in a subsequent request. If empty, + * this is the final response. + * + * See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * refunds?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->refunds = $values['refunds'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRefunds(): ?array + { + return $this->refunds; + } + + /** + * @param ?array $value + */ + public function setRefunds(?array $value = null): self + { + $this->refunds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchVendorsRequestFilter.php b/src/Types/SearchVendorsRequestFilter.php new file mode 100644 index 00000000..9022b391 --- /dev/null +++ b/src/Types/SearchVendorsRequestFilter.php @@ -0,0 +1,83 @@ + $name The names of the [Vendor](entity:Vendor) objects to retrieve. + */ + #[JsonProperty('name'), ArrayType(['string'])] + private ?array $name; + + /** + * The statuses of the [Vendor](entity:Vendor) objects to retrieve. + * See [VendorStatus](#type-vendorstatus) for possible values + * + * @var ?array> $status + */ + #[JsonProperty('status'), ArrayType(['string'])] + private ?array $status; + + /** + * @param array{ + * name?: ?array, + * status?: ?array>, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?array + */ + public function getName(): ?array + { + return $this->name; + } + + /** + * @param ?array $value + */ + public function setName(?array $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?array> + */ + public function getStatus(): ?array + { + return $this->status; + } + + /** + * @param ?array> $value + */ + public function setStatus(?array $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchVendorsRequestSort.php b/src/Types/SearchVendorsRequestSort.php new file mode 100644 index 00000000..0095422c --- /dev/null +++ b/src/Types/SearchVendorsRequestSort.php @@ -0,0 +1,85 @@ + $field + */ + #[JsonProperty('field')] + private ?string $field; + + /** + * Specifies the sort order for the returned vendors. + * See [SortOrder](#type-sortorder) for possible values + * + * @var ?value-of $order + */ + #[JsonProperty('order')] + private ?string $order; + + /** + * @param array{ + * field?: ?value-of, + * order?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->field = $values['field'] ?? null; + $this->order = $values['order'] ?? null; + } + + /** + * @return ?value-of + */ + public function getField(): ?string + { + return $this->field; + } + + /** + * @param ?value-of $value + */ + public function setField(?string $value = null): self + { + $this->field = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SearchVendorsRequestSortField.php b/src/Types/SearchVendorsRequestSortField.php new file mode 100644 index 00000000..f9eb4c90 --- /dev/null +++ b/src/Types/SearchVendorsRequestSortField.php @@ -0,0 +1,9 @@ + $errors Errors encountered when the request fails. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?array $vendors The [Vendor](entity:Vendor) objects matching the specified search filter. + */ + #[JsonProperty('vendors'), ArrayType([Vendor::class])] + private ?array $vendors; + + /** + * The pagination cursor to be used in a subsequent request. If unset, + * this is the final response. + * + * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. + * + * @var ?string $cursor + */ + #[JsonProperty('cursor')] + private ?string $cursor; + + /** + * @param array{ + * errors?: ?array, + * vendors?: ?array, + * cursor?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->vendors = $values['vendors'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?array + */ + public function getVendors(): ?array + { + return $this->vendors; + } + + /** + * @param ?array $value + */ + public function setVendors(?array $value = null): self + { + $this->vendors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SegmentFilter.php b/src/Types/SegmentFilter.php new file mode 100644 index 00000000..2304c604 --- /dev/null +++ b/src/Types/SegmentFilter.php @@ -0,0 +1,86 @@ +serviceVariationId = $values['serviceVariationId']; + $this->teamMemberIdFilter = $values['teamMemberIdFilter'] ?? null; + } + + /** + * @return string + */ + public function getServiceVariationId(): string + { + return $this->serviceVariationId; + } + + /** + * @param string $value + */ + public function setServiceVariationId(string $value): self + { + $this->serviceVariationId = $value; + return $this; + } + + /** + * @return ?FilterValue + */ + public function getTeamMemberIdFilter(): ?FilterValue + { + return $this->teamMemberIdFilter; + } + + /** + * @param ?FilterValue $value + */ + public function setTeamMemberIdFilter(?FilterValue $value = null): self + { + $this->teamMemberIdFilter = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SelectOption.php b/src/Types/SelectOption.php new file mode 100644 index 00000000..4b6bd2f5 --- /dev/null +++ b/src/Types/SelectOption.php @@ -0,0 +1,76 @@ +referenceId = $values['referenceId']; + $this->title = $values['title']; + } + + /** + * @return string + */ + public function getReferenceId(): string + { + return $this->referenceId; + } + + /** + * @param string $value + */ + public function setReferenceId(string $value): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SelectOptions.php b/src/Types/SelectOptions.php new file mode 100644 index 00000000..a08ab61a --- /dev/null +++ b/src/Types/SelectOptions.php @@ -0,0 +1,127 @@ + $options Represents the buttons/options that should be displayed in the select flow on the Terminal. + */ + #[JsonProperty('options'), ArrayType([SelectOption::class])] + private array $options; + + /** + * @var ?SelectOption $selectedOption The buyer’s selected option. + */ + #[JsonProperty('selected_option')] + private ?SelectOption $selectedOption; + + /** + * @param array{ + * title: string, + * body: string, + * options: array, + * selectedOption?: ?SelectOption, + * } $values + */ + public function __construct( + array $values, + ) { + $this->title = $values['title']; + $this->body = $values['body']; + $this->options = $values['options']; + $this->selectedOption = $values['selectedOption'] ?? null; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function getBody(): string + { + return $this->body; + } + + /** + * @param string $value + */ + public function setBody(string $value): self + { + $this->body = $value; + return $this; + } + + /** + * @return array + */ + public function getOptions(): array + { + return $this->options; + } + + /** + * @param array $value + */ + public function setOptions(array $value): self + { + $this->options = $value; + return $this; + } + + /** + * @return ?SelectOption + */ + public function getSelectedOption(): ?SelectOption + { + return $this->selectedOption; + } + + /** + * @param ?SelectOption $value + */ + public function setSelectedOption(?SelectOption $value = null): self + { + $this->selectedOption = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Shift.php b/src/Types/Shift.php new file mode 100644 index 00000000..73140c1b --- /dev/null +++ b/src/Types/Shift.php @@ -0,0 +1,407 @@ + $breaks A list of all the paid or unpaid breaks that were taken during this shift. + */ + #[JsonProperty('breaks'), ArrayType([Break_::class])] + private ?array $breaks; + + /** + * Describes the working state of the current `Shift`. + * See [ShiftStatus](#type-shiftstatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * Used for resolving concurrency issues. The request fails if the version + * provided does not match the server version at the time of the request. If not provided, + * Square executes a blind write; potentially overwriting data from another + * write. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?string $createdAt A read-only timestamp in RFC 3339 format; presented in UTC. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt A read-only timestamp in RFC 3339 format; presented in UTC. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $teamMemberId The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @var ?Money $declaredCashTipMoney The tips declared by the team member for the shift. + */ + #[JsonProperty('declared_cash_tip_money')] + private ?Money $declaredCashTipMoney; + + /** + * @param array{ + * locationId: string, + * startAt: string, + * id?: ?string, + * employeeId?: ?string, + * timezone?: ?string, + * endAt?: ?string, + * wage?: ?ShiftWage, + * breaks?: ?array, + * status?: ?value-of, + * version?: ?int, + * createdAt?: ?string, + * updatedAt?: ?string, + * teamMemberId?: ?string, + * declaredCashTipMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->locationId = $values['locationId']; + $this->timezone = $values['timezone'] ?? null; + $this->startAt = $values['startAt']; + $this->endAt = $values['endAt'] ?? null; + $this->wage = $values['wage'] ?? null; + $this->breaks = $values['breaks'] ?? null; + $this->status = $values['status'] ?? null; + $this->version = $values['version'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->declaredCashTipMoney = $values['declaredCashTipMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTimezone(): ?string + { + return $this->timezone; + } + + /** + * @param ?string $value + */ + public function setTimezone(?string $value = null): self + { + $this->timezone = $value; + return $this; + } + + /** + * @return string + */ + public function getStartAt(): string + { + return $this->startAt; + } + + /** + * @param string $value + */ + public function setStartAt(string $value): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndAt(): ?string + { + return $this->endAt; + } + + /** + * @param ?string $value + */ + public function setEndAt(?string $value = null): self + { + $this->endAt = $value; + return $this; + } + + /** + * @return ?ShiftWage + */ + public function getWage(): ?ShiftWage + { + return $this->wage; + } + + /** + * @param ?ShiftWage $value + */ + public function setWage(?ShiftWage $value = null): self + { + $this->wage = $value; + return $this; + } + + /** + * @return ?array + */ + public function getBreaks(): ?array + { + return $this->breaks; + } + + /** + * @param ?array $value + */ + public function setBreaks(?array $value = null): self + { + $this->breaks = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getDeclaredCashTipMoney(): ?Money + { + return $this->declaredCashTipMoney; + } + + /** + * @param ?Money $value + */ + public function setDeclaredCashTipMoney(?Money $value = null): self + { + $this->declaredCashTipMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftFilter.php b/src/Types/ShiftFilter.php new file mode 100644 index 00000000..89ccc3a5 --- /dev/null +++ b/src/Types/ShiftFilter.php @@ -0,0 +1,209 @@ + $locationIds Fetch shifts for the specified location. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * @var ?array $employeeIds Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead. + */ + #[JsonProperty('employee_ids'), ArrayType(['string'])] + private ?array $employeeIds; + + /** + * Fetch a `Shift` instance by `Shift.status`. + * See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?TimeRange $start Fetch `Shift` instances that start in the time range - Inclusive. + */ + #[JsonProperty('start')] + private ?TimeRange $start; + + /** + * @var ?TimeRange $end Fetch the `Shift` instances that end in the time range - Inclusive. + */ + #[JsonProperty('end')] + private ?TimeRange $end; + + /** + * @var ?ShiftWorkday $workday Fetch the `Shift` instances based on the workday date range. + */ + #[JsonProperty('workday')] + private ?ShiftWorkday $workday; + + /** + * @var ?array $teamMemberIds Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". + */ + #[JsonProperty('team_member_ids'), ArrayType(['string'])] + private ?array $teamMemberIds; + + /** + * @param array{ + * locationIds?: ?array, + * employeeIds?: ?array, + * status?: ?value-of, + * start?: ?TimeRange, + * end?: ?TimeRange, + * workday?: ?ShiftWorkday, + * teamMemberIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->locationIds = $values['locationIds'] ?? null; + $this->employeeIds = $values['employeeIds'] ?? null; + $this->status = $values['status'] ?? null; + $this->start = $values['start'] ?? null; + $this->end = $values['end'] ?? null; + $this->workday = $values['workday'] ?? null; + $this->teamMemberIds = $values['teamMemberIds'] ?? null; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEmployeeIds(): ?array + { + return $this->employeeIds; + } + + /** + * @param ?array $value + */ + public function setEmployeeIds(?array $value = null): self + { + $this->employeeIds = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getStart(): ?TimeRange + { + return $this->start; + } + + /** + * @param ?TimeRange $value + */ + public function setStart(?TimeRange $value = null): self + { + $this->start = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getEnd(): ?TimeRange + { + return $this->end; + } + + /** + * @param ?TimeRange $value + */ + public function setEnd(?TimeRange $value = null): self + { + $this->end = $value; + return $this; + } + + /** + * @return ?ShiftWorkday + */ + public function getWorkday(): ?ShiftWorkday + { + return $this->workday; + } + + /** + * @param ?ShiftWorkday $value + */ + public function setWorkday(?ShiftWorkday $value = null): self + { + $this->workday = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTeamMemberIds(): ?array + { + return $this->teamMemberIds; + } + + /** + * @param ?array $value + */ + public function setTeamMemberIds(?array $value = null): self + { + $this->teamMemberIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftFilterStatus.php b/src/Types/ShiftFilterStatus.php new file mode 100644 index 00000000..09d81b2e --- /dev/null +++ b/src/Types/ShiftFilterStatus.php @@ -0,0 +1,9 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?ShiftFilter + */ + public function getFilter(): ?ShiftFilter + { + return $this->filter; + } + + /** + * @param ?ShiftFilter $value + */ + public function setFilter(?ShiftFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?ShiftSort + */ + public function getSort(): ?ShiftSort + { + return $this->sort; + } + + /** + * @param ?ShiftSort $value + */ + public function setSort(?ShiftSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftSort.php b/src/Types/ShiftSort.php new file mode 100644 index 00000000..6c764d7d --- /dev/null +++ b/src/Types/ShiftSort.php @@ -0,0 +1,85 @@ + $field + */ + #[JsonProperty('field')] + private ?string $field; + + /** + * The order in which results are returned. Defaults to DESC. + * See [SortOrder](#type-sortorder) for possible values + * + * @var ?value-of $order + */ + #[JsonProperty('order')] + private ?string $order; + + /** + * @param array{ + * field?: ?value-of, + * order?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->field = $values['field'] ?? null; + $this->order = $values['order'] ?? null; + } + + /** + * @return ?value-of + */ + public function getField(): ?string + { + return $this->field; + } + + /** + * @param ?value-of $value + */ + public function setField(?string $value = null): self + { + $this->field = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftSortField.php b/src/Types/ShiftSortField.php new file mode 100644 index 00000000..537bcd35 --- /dev/null +++ b/src/Types/ShiftSortField.php @@ -0,0 +1,11 @@ +title = $values['title'] ?? null; + $this->hourlyRate = $values['hourlyRate'] ?? null; + $this->jobId = $values['jobId'] ?? null; + $this->tipEligible = $values['tipEligible'] ?? null; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getHourlyRate(): ?Money + { + return $this->hourlyRate; + } + + /** + * @param ?Money $value + */ + public function setHourlyRate(?Money $value = null): self + { + $this->hourlyRate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getJobId(): ?string + { + return $this->jobId; + } + + /** + * @param ?string $value + */ + public function setJobId(?string $value = null): self + { + $this->jobId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTipEligible(): ?bool + { + return $this->tipEligible; + } + + /** + * @param ?bool $value + */ + public function setTipEligible(?bool $value = null): self + { + $this->tipEligible = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftWorkday.php b/src/Types/ShiftWorkday.php new file mode 100644 index 00000000..4aee1dc9 --- /dev/null +++ b/src/Types/ShiftWorkday.php @@ -0,0 +1,113 @@ + $matchShiftsBy + */ + #[JsonProperty('match_shifts_by')] + private ?string $matchShiftsBy; + + /** + * Location-specific timezones convert workdays to datetime filters. + * Every location included in the query must have a timezone or this field + * must be provided as a fallback. Format: the IANA timezone database + * identifier for the relevant timezone. + * + * @var ?string $defaultTimezone + */ + #[JsonProperty('default_timezone')] + private ?string $defaultTimezone; + + /** + * @param array{ + * dateRange?: ?DateRange, + * matchShiftsBy?: ?value-of, + * defaultTimezone?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->dateRange = $values['dateRange'] ?? null; + $this->matchShiftsBy = $values['matchShiftsBy'] ?? null; + $this->defaultTimezone = $values['defaultTimezone'] ?? null; + } + + /** + * @return ?DateRange + */ + public function getDateRange(): ?DateRange + { + return $this->dateRange; + } + + /** + * @param ?DateRange $value + */ + public function setDateRange(?DateRange $value = null): self + { + $this->dateRange = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getMatchShiftsBy(): ?string + { + return $this->matchShiftsBy; + } + + /** + * @param ?value-of $value + */ + public function setMatchShiftsBy(?string $value = null): self + { + $this->matchShiftsBy = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDefaultTimezone(): ?string + { + return $this->defaultTimezone; + } + + /** + * @param ?string $value + */ + public function setDefaultTimezone(?string $value = null): self + { + $this->defaultTimezone = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ShiftWorkdayMatcher.php b/src/Types/ShiftWorkdayMatcher.php new file mode 100644 index 00000000..40897090 --- /dev/null +++ b/src/Types/ShiftWorkdayMatcher.php @@ -0,0 +1,10 @@ +name = $values['name'] ?? null; + $this->charge = $values['charge']; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return Money + */ + public function getCharge(): Money + { + return $this->charge; + } + + /** + * @param Money $value + */ + public function setCharge(Money $value): self + { + $this->charge = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SignatureImage.php b/src/Types/SignatureImage.php new file mode 100644 index 00000000..1fa7d026 --- /dev/null +++ b/src/Types/SignatureImage.php @@ -0,0 +1,79 @@ +imageType = $values['imageType'] ?? null; + $this->data = $values['data'] ?? null; + } + + /** + * @return ?string + */ + public function getImageType(): ?string + { + return $this->imageType; + } + + /** + * @param ?string $value + */ + public function setImageType(?string $value = null): self + { + $this->imageType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getData(): ?string + { + return $this->data; + } + + /** + * @param ?string $value + */ + public function setData(?string $value = null): self + { + $this->data = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SignatureOptions.php b/src/Types/SignatureOptions.php new file mode 100644 index 00000000..26e6fcbd --- /dev/null +++ b/src/Types/SignatureOptions.php @@ -0,0 +1,102 @@ + $signature An image representation of the collected signature. + */ + #[JsonProperty('signature'), ArrayType([SignatureImage::class])] + private ?array $signature; + + /** + * @param array{ + * title: string, + * body: string, + * signature?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->title = $values['title']; + $this->body = $values['body']; + $this->signature = $values['signature'] ?? null; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $value + */ + public function setTitle(string $value): self + { + $this->title = $value; + return $this; + } + + /** + * @return string + */ + public function getBody(): string + { + return $this->body; + } + + /** + * @param string $value + */ + public function setBody(string $value): self + { + $this->body = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSignature(): ?array + { + return $this->signature; + } + + /** + * @param ?array $value + */ + public function setSignature(?array $value = null): self + { + $this->signature = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Site.php b/src/Types/Site.php new file mode 100644 index 00000000..73b624f3 --- /dev/null +++ b/src/Types/Site.php @@ -0,0 +1,179 @@ +id = $values['id'] ?? null; + $this->siteTitle = $values['siteTitle'] ?? null; + $this->domain = $values['domain'] ?? null; + $this->isPublished = $values['isPublished'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSiteTitle(): ?string + { + return $this->siteTitle; + } + + /** + * @param ?string $value + */ + public function setSiteTitle(?string $value = null): self + { + $this->siteTitle = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDomain(): ?string + { + return $this->domain; + } + + /** + * @param ?string $value + */ + public function setDomain(?string $value = null): self + { + $this->domain = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsPublished(): ?bool + { + return $this->isPublished; + } + + /** + * @param ?bool $value + */ + public function setIsPublished(?bool $value = null): self + { + $this->isPublished = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Snippet.php b/src/Types/Snippet.php new file mode 100644 index 00000000..ae1be42d --- /dev/null +++ b/src/Types/Snippet.php @@ -0,0 +1,154 @@ +id = $values['id'] ?? null; + $this->siteId = $values['siteId'] ?? null; + $this->content = $values['content']; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSiteId(): ?string + { + return $this->siteId; + } + + /** + * @param ?string $value + */ + public function setSiteId(?string $value = null): self + { + $this->siteId = $value; + return $this; + } + + /** + * @return string + */ + public function getContent(): string + { + return $this->content; + } + + /** + * @param string $value + */ + public function setContent(string $value): self + { + $this->content = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SortOrder.php b/src/Types/SortOrder.php new file mode 100644 index 00000000..17dfd980 --- /dev/null +++ b/src/Types/SortOrder.php @@ -0,0 +1,9 @@ + $product + */ + #[JsonProperty('product')] + private ?string $product; + + /** + * __Read only__ The Square-assigned ID of the application. This field is used only if the + * [product](entity:Product) type is `EXTERNAL_API`. + * + * @var ?string $applicationId + */ + #[JsonProperty('application_id')] + private ?string $applicationId; + + /** + * __Read only__ The display name of the application + * (for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). + * + * @var ?string $name + */ + #[JsonProperty('name')] + private ?string $name; + + /** + * @param array{ + * product?: ?value-of, + * applicationId?: ?string, + * name?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->product = $values['product'] ?? null; + $this->applicationId = $values['applicationId'] ?? null; + $this->name = $values['name'] ?? null; + } + + /** + * @return ?value-of + */ + public function getProduct(): ?string + { + return $this->product; + } + + /** + * @param ?value-of $value + */ + public function setProduct(?string $value = null): self + { + $this->product = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApplicationId(): ?string + { + return $this->applicationId; + } + + /** + * @param ?string $value + */ + public function setApplicationId(?string $value = null): self + { + $this->applicationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SquareAccountDetails.php b/src/Types/SquareAccountDetails.php new file mode 100644 index 00000000..e32e7bab --- /dev/null +++ b/src/Types/SquareAccountDetails.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * paymentSourceToken?: ?string, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->paymentSourceToken = $values['paymentSourceToken'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?string + */ + public function getPaymentSourceToken(): ?string + { + return $this->paymentSourceToken; + } + + /** + * @param ?string $value + */ + public function setPaymentSourceToken(?string $value = null): self + { + $this->paymentSourceToken = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/StandardUnitDescription.php b/src/Types/StandardUnitDescription.php new file mode 100644 index 00000000..434ada78 --- /dev/null +++ b/src/Types/StandardUnitDescription.php @@ -0,0 +1,104 @@ +unit = $values['unit'] ?? null; + $this->name = $values['name'] ?? null; + $this->abbreviation = $values['abbreviation'] ?? null; + } + + /** + * @return ?MeasurementUnit + */ + public function getUnit(): ?MeasurementUnit + { + return $this->unit; + } + + /** + * @param ?MeasurementUnit $value + */ + public function setUnit(?MeasurementUnit $value = null): self + { + $this->unit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAbbreviation(): ?string + { + return $this->abbreviation; + } + + /** + * @param ?string $value + */ + public function setAbbreviation(?string $value = null): self + { + $this->abbreviation = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/StandardUnitDescriptionGroup.php b/src/Types/StandardUnitDescriptionGroup.php new file mode 100644 index 00000000..40c91234 --- /dev/null +++ b/src/Types/StandardUnitDescriptionGroup.php @@ -0,0 +1,80 @@ + $standardUnitDescriptions List of standard (non-custom) measurement units in this description group. + */ + #[JsonProperty('standard_unit_descriptions'), ArrayType([StandardUnitDescription::class])] + private ?array $standardUnitDescriptions; + + /** + * @var ?string $languageCode IETF language tag. + */ + #[JsonProperty('language_code')] + private ?string $languageCode; + + /** + * @param array{ + * standardUnitDescriptions?: ?array, + * languageCode?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->standardUnitDescriptions = $values['standardUnitDescriptions'] ?? null; + $this->languageCode = $values['languageCode'] ?? null; + } + + /** + * @return ?array + */ + public function getStandardUnitDescriptions(): ?array + { + return $this->standardUnitDescriptions; + } + + /** + * @param ?array $value + */ + public function setStandardUnitDescriptions(?array $value = null): self + { + $this->standardUnitDescriptions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLanguageCode(): ?string + { + return $this->languageCode; + } + + /** + * @param ?string $value + */ + public function setLanguageCode(?string $value = null): self + { + $this->languageCode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubmitEvidenceResponse.php b/src/Types/SubmitEvidenceResponse.php new file mode 100644 index 00000000..146011ea --- /dev/null +++ b/src/Types/SubmitEvidenceResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Dispute $dispute The `Dispute` for which evidence was submitted. + */ + #[JsonProperty('dispute')] + private ?Dispute $dispute; + + /** + * @param array{ + * errors?: ?array, + * dispute?: ?Dispute, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->dispute = $values['dispute'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Dispute + */ + public function getDispute(): ?Dispute + { + return $this->dispute; + } + + /** + * @param ?Dispute $value + */ + public function setDispute(?Dispute $value = null): self + { + $this->dispute = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Subscription.php b/src/Types/Subscription.php new file mode 100644 index 00000000..9bcf63f0 --- /dev/null +++ b/src/Types/Subscription.php @@ -0,0 +1,558 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * The tax amount applied when billing the subscription. The + * percentage is expressed in decimal form, using a `'.'` as the decimal + * separator and without a `'%'` sign. For example, a value of `7.5` + * corresponds to 7.5%. + * + * @var ?string $taxPercentage + */ + #[JsonProperty('tax_percentage')] + private ?string $taxPercentage; + + /** + * The IDs of the [invoices](entity:Invoice) created for the + * subscription, listed in order when the invoices were created + * (newest invoices appear first). + * + * @var ?array $invoiceIds + */ + #[JsonProperty('invoice_ids'), ArrayType(['string'])] + private ?array $invoiceIds; + + /** + * A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing. + * This field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, + * you should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). + * + * @var ?Money $priceOverrideMoney + */ + #[JsonProperty('price_override_money')] + private ?Money $priceOverrideMoney; + + /** + * The version of the object. When updating an object, the version + * supplied must match the version in the database, otherwise the write will + * be rejected as conflicting. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?string $createdAt The timestamp when the subscription was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * The ID of the [subscriber's](entity:Customer) [card](entity:Card) + * used to charge for the subscription. + * + * @var ?string $cardId + */ + #[JsonProperty('card_id')] + private ?string $cardId; + + /** + * Timezone that will be used in date calculations for the subscription. + * Defaults to the timezone of the location based on `location_id`. + * Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). + * + * @var ?string $timezone + */ + #[JsonProperty('timezone')] + private ?string $timezone; + + /** + * @var ?SubscriptionSource $source The origination details of the subscription. + */ + #[JsonProperty('source')] + private ?SubscriptionSource $source; + + /** + * The list of scheduled actions on this subscription. It is set only in the response from + * [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) with the query parameter + * of `include=actions` or from + * [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) with the input parameter + * of `include:["actions"]`. + * + * @var ?array $actions + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @var ?int $monthlyBillingAnchorDate The day of the month on which the subscription will issue invoices and publish orders. + */ + #[JsonProperty('monthly_billing_anchor_date')] + private ?int $monthlyBillingAnchorDate; + + /** + * @var ?array $phases array of phases for this subscription + */ + #[JsonProperty('phases'), ArrayType([Phase::class])] + private ?array $phases; + + /** + * @param array{ + * id?: ?string, + * locationId?: ?string, + * planVariationId?: ?string, + * customerId?: ?string, + * startDate?: ?string, + * canceledDate?: ?string, + * chargedThroughDate?: ?string, + * status?: ?value-of, + * taxPercentage?: ?string, + * invoiceIds?: ?array, + * priceOverrideMoney?: ?Money, + * version?: ?int, + * createdAt?: ?string, + * cardId?: ?string, + * timezone?: ?string, + * source?: ?SubscriptionSource, + * actions?: ?array, + * monthlyBillingAnchorDate?: ?int, + * phases?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->planVariationId = $values['planVariationId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->startDate = $values['startDate'] ?? null; + $this->canceledDate = $values['canceledDate'] ?? null; + $this->chargedThroughDate = $values['chargedThroughDate'] ?? null; + $this->status = $values['status'] ?? null; + $this->taxPercentage = $values['taxPercentage'] ?? null; + $this->invoiceIds = $values['invoiceIds'] ?? null; + $this->priceOverrideMoney = $values['priceOverrideMoney'] ?? null; + $this->version = $values['version'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->cardId = $values['cardId'] ?? null; + $this->timezone = $values['timezone'] ?? null; + $this->source = $values['source'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->monthlyBillingAnchorDate = $values['monthlyBillingAnchorDate'] ?? null; + $this->phases = $values['phases'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPlanVariationId(): ?string + { + return $this->planVariationId; + } + + /** + * @param ?string $value + */ + public function setPlanVariationId(?string $value = null): self + { + $this->planVariationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStartDate(): ?string + { + return $this->startDate; + } + + /** + * @param ?string $value + */ + public function setStartDate(?string $value = null): self + { + $this->startDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledDate(): ?string + { + return $this->canceledDate; + } + + /** + * @param ?string $value + */ + public function setCanceledDate(?string $value = null): self + { + $this->canceledDate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getChargedThroughDate(): ?string + { + return $this->chargedThroughDate; + } + + /** + * @param ?string $value + */ + public function setChargedThroughDate(?string $value = null): self + { + $this->chargedThroughDate = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTaxPercentage(): ?string + { + return $this->taxPercentage; + } + + /** + * @param ?string $value + */ + public function setTaxPercentage(?string $value = null): self + { + $this->taxPercentage = $value; + return $this; + } + + /** + * @return ?array + */ + public function getInvoiceIds(): ?array + { + return $this->invoiceIds; + } + + /** + * @param ?array $value + */ + public function setInvoiceIds(?array $value = null): self + { + $this->invoiceIds = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceOverrideMoney(): ?Money + { + return $this->priceOverrideMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceOverrideMoney(?Money $value = null): self + { + $this->priceOverrideMoney = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCardId(): ?string + { + return $this->cardId; + } + + /** + * @param ?string $value + */ + public function setCardId(?string $value = null): self + { + $this->cardId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTimezone(): ?string + { + return $this->timezone; + } + + /** + * @param ?string $value + */ + public function setTimezone(?string $value = null): self + { + $this->timezone = $value; + return $this; + } + + /** + * @return ?SubscriptionSource + */ + public function getSource(): ?SubscriptionSource + { + return $this->source; + } + + /** + * @param ?SubscriptionSource $value + */ + public function setSource(?SubscriptionSource $value = null): self + { + $this->source = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMonthlyBillingAnchorDate(): ?int + { + return $this->monthlyBillingAnchorDate; + } + + /** + * @param ?int $value + */ + public function setMonthlyBillingAnchorDate(?int $value = null): self + { + $this->monthlyBillingAnchorDate = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionAction.php b/src/Types/SubscriptionAction.php new file mode 100644 index 00000000..3f4ba83e --- /dev/null +++ b/src/Types/SubscriptionAction.php @@ -0,0 +1,183 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?string $effectiveDate The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. + */ + #[JsonProperty('effective_date')] + private ?string $effectiveDate; + + /** + * @var ?int $monthlyBillingAnchorDate The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. + */ + #[JsonProperty('monthly_billing_anchor_date')] + private ?int $monthlyBillingAnchorDate; + + /** + * @var ?array $phases A list of Phases, to pass phase-specific information used in the swap. + */ + #[JsonProperty('phases'), ArrayType([Phase::class])] + private ?array $phases; + + /** + * @var ?string $newPlanVariationId The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. + */ + #[JsonProperty('new_plan_variation_id')] + private ?string $newPlanVariationId; + + /** + * @param array{ + * id?: ?string, + * type?: ?value-of, + * effectiveDate?: ?string, + * monthlyBillingAnchorDate?: ?int, + * phases?: ?array, + * newPlanVariationId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->type = $values['type'] ?? null; + $this->effectiveDate = $values['effectiveDate'] ?? null; + $this->monthlyBillingAnchorDate = $values['monthlyBillingAnchorDate'] ?? null; + $this->phases = $values['phases'] ?? null; + $this->newPlanVariationId = $values['newPlanVariationId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEffectiveDate(): ?string + { + return $this->effectiveDate; + } + + /** + * @param ?string $value + */ + public function setEffectiveDate(?string $value = null): self + { + $this->effectiveDate = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMonthlyBillingAnchorDate(): ?int + { + return $this->monthlyBillingAnchorDate; + } + + /** + * @param ?int $value + */ + public function setMonthlyBillingAnchorDate(?int $value = null): self + { + $this->monthlyBillingAnchorDate = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNewPlanVariationId(): ?string + { + return $this->newPlanVariationId; + } + + /** + * @param ?string $value + */ + public function setNewPlanVariationId(?string $value = null): self + { + $this->newPlanVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionActionType.php b/src/Types/SubscriptionActionType.php new file mode 100644 index 00000000..0c10eb7c --- /dev/null +++ b/src/Types/SubscriptionActionType.php @@ -0,0 +1,12 @@ + $subscriptionEventType + */ + #[JsonProperty('subscription_event_type')] + private string $subscriptionEventType; + + /** + * @var string $effectiveDate The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. + */ + #[JsonProperty('effective_date')] + private string $effectiveDate; + + /** + * @var ?int $monthlyBillingAnchorDate The day-of-the-month the billing anchor date was changed to, if applicable. + */ + #[JsonProperty('monthly_billing_anchor_date')] + private ?int $monthlyBillingAnchorDate; + + /** + * @var ?SubscriptionEventInfo $info Additional information about the subscription event. + */ + #[JsonProperty('info')] + private ?SubscriptionEventInfo $info; + + /** + * @var ?array $phases A list of Phases, to pass phase-specific information used in the swap. + */ + #[JsonProperty('phases'), ArrayType([Phase::class])] + private ?array $phases; + + /** + * @var string $planVariationId The ID of the subscription plan variation associated with the subscription. + */ + #[JsonProperty('plan_variation_id')] + private string $planVariationId; + + /** + * @param array{ + * id: string, + * subscriptionEventType: value-of, + * effectiveDate: string, + * planVariationId: string, + * monthlyBillingAnchorDate?: ?int, + * info?: ?SubscriptionEventInfo, + * phases?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->subscriptionEventType = $values['subscriptionEventType']; + $this->effectiveDate = $values['effectiveDate']; + $this->monthlyBillingAnchorDate = $values['monthlyBillingAnchorDate'] ?? null; + $this->info = $values['info'] ?? null; + $this->phases = $values['phases'] ?? null; + $this->planVariationId = $values['planVariationId']; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $value + */ + public function setId(string $value): self + { + $this->id = $value; + return $this; + } + + /** + * @return value-of + */ + public function getSubscriptionEventType(): string + { + return $this->subscriptionEventType; + } + + /** + * @param value-of $value + */ + public function setSubscriptionEventType(string $value): self + { + $this->subscriptionEventType = $value; + return $this; + } + + /** + * @return string + */ + public function getEffectiveDate(): string + { + return $this->effectiveDate; + } + + /** + * @param string $value + */ + public function setEffectiveDate(string $value): self + { + $this->effectiveDate = $value; + return $this; + } + + /** + * @return ?int + */ + public function getMonthlyBillingAnchorDate(): ?int + { + return $this->monthlyBillingAnchorDate; + } + + /** + * @param ?int $value + */ + public function setMonthlyBillingAnchorDate(?int $value = null): self + { + $this->monthlyBillingAnchorDate = $value; + return $this; + } + + /** + * @return ?SubscriptionEventInfo + */ + public function getInfo(): ?SubscriptionEventInfo + { + return $this->info; + } + + /** + * @param ?SubscriptionEventInfo $value + */ + public function setInfo(?SubscriptionEventInfo $value = null): self + { + $this->info = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * @param ?array $value + */ + public function setPhases(?array $value = null): self + { + $this->phases = $value; + return $this; + } + + /** + * @return string + */ + public function getPlanVariationId(): string + { + return $this->planVariationId; + } + + /** + * @param string $value + */ + public function setPlanVariationId(string $value): self + { + $this->planVariationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionEventInfo.php b/src/Types/SubscriptionEventInfo.php new file mode 100644 index 00000000..7f2c7776 --- /dev/null +++ b/src/Types/SubscriptionEventInfo.php @@ -0,0 +1,82 @@ + $code + */ + #[JsonProperty('code')] + private ?string $code; + + /** + * @param array{ + * detail?: ?string, + * code?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->detail = $values['detail'] ?? null; + $this->code = $values['code'] ?? null; + } + + /** + * @return ?string + */ + public function getDetail(): ?string + { + return $this->detail; + } + + /** + * @param ?string $value + */ + public function setDetail(?string $value = null): self + { + $this->detail = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCode(): ?string + { + return $this->code; + } + + /** + * @param ?value-of $value + */ + public function setCode(?string $value = null): self + { + $this->code = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionEventInfoCode.php b/src/Types/SubscriptionEventInfoCode.php new file mode 100644 index 00000000..6c36cd4e --- /dev/null +++ b/src/Types/SubscriptionEventInfoCode.php @@ -0,0 +1,13 @@ + $cadence + */ + #[JsonProperty('cadence')] + private string $cadence; + + /** + * @var ?int $periods The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. + */ + #[JsonProperty('periods')] + private ?int $periods; + + /** + * @var ?Money $recurringPriceMoney The amount to bill for each `cadence`. Failure to specify this field results in a `MISSING_REQUIRED_PARAMETER` error at runtime. + */ + #[JsonProperty('recurring_price_money')] + private ?Money $recurringPriceMoney; + + /** + * @var ?int $ordinal The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created. + */ + #[JsonProperty('ordinal')] + private ?int $ordinal; + + /** + * @var ?SubscriptionPricing $pricing The subscription pricing. + */ + #[JsonProperty('pricing')] + private ?SubscriptionPricing $pricing; + + /** + * @param array{ + * cadence: value-of, + * uid?: ?string, + * periods?: ?int, + * recurringPriceMoney?: ?Money, + * ordinal?: ?int, + * pricing?: ?SubscriptionPricing, + * } $values + */ + public function __construct( + array $values, + ) { + $this->uid = $values['uid'] ?? null; + $this->cadence = $values['cadence']; + $this->periods = $values['periods'] ?? null; + $this->recurringPriceMoney = $values['recurringPriceMoney'] ?? null; + $this->ordinal = $values['ordinal'] ?? null; + $this->pricing = $values['pricing'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return value-of + */ + public function getCadence(): string + { + return $this->cadence; + } + + /** + * @param value-of $value + */ + public function setCadence(string $value): self + { + $this->cadence = $value; + return $this; + } + + /** + * @return ?int + */ + public function getPeriods(): ?int + { + return $this->periods; + } + + /** + * @param ?int $value + */ + public function setPeriods(?int $value = null): self + { + $this->periods = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getRecurringPriceMoney(): ?Money + { + return $this->recurringPriceMoney; + } + + /** + * @param ?Money $value + */ + public function setRecurringPriceMoney(?Money $value = null): self + { + $this->recurringPriceMoney = $value; + return $this; + } + + /** + * @return ?int + */ + public function getOrdinal(): ?int + { + return $this->ordinal; + } + + /** + * @param ?int $value + */ + public function setOrdinal(?int $value = null): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return ?SubscriptionPricing + */ + public function getPricing(): ?SubscriptionPricing + { + return $this->pricing; + } + + /** + * @param ?SubscriptionPricing $value + */ + public function setPricing(?SubscriptionPricing $value = null): self + { + $this->pricing = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionPricing.php b/src/Types/SubscriptionPricing.php new file mode 100644 index 00000000..948868a0 --- /dev/null +++ b/src/Types/SubscriptionPricing.php @@ -0,0 +1,108 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?array $discountIds The ids of the discount catalog objects + */ + #[JsonProperty('discount_ids'), ArrayType(['string'])] + private ?array $discountIds; + + /** + * @var ?Money $priceMoney The price of the subscription, if STATIC + */ + #[JsonProperty('price_money')] + private ?Money $priceMoney; + + /** + * @param array{ + * type?: ?value-of, + * discountIds?: ?array, + * priceMoney?: ?Money, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->type = $values['type'] ?? null; + $this->discountIds = $values['discountIds'] ?? null; + $this->priceMoney = $values['priceMoney'] ?? null; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?array + */ + public function getDiscountIds(): ?array + { + return $this->discountIds; + } + + /** + * @param ?array $value + */ + public function setDiscountIds(?array $value = null): self + { + $this->discountIds = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * @param ?Money $value + */ + public function setPriceMoney(?Money $value = null): self + { + $this->priceMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionPricingType.php b/src/Types/SubscriptionPricingType.php new file mode 100644 index 00000000..f79aa648 --- /dev/null +++ b/src/Types/SubscriptionPricingType.php @@ -0,0 +1,9 @@ +name = $values['name'] ?? null; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SubscriptionStatus.php b/src/Types/SubscriptionStatus.php new file mode 100644 index 00000000..b0662e16 --- /dev/null +++ b/src/Types/SubscriptionStatus.php @@ -0,0 +1,12 @@ +id = $values['id'] ?? null; + $this->statusCode = $values['statusCode'] ?? null; + $this->payload = $values['payload'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?int + */ + public function getStatusCode(): ?int + { + return $this->statusCode; + } + + /** + * @param ?int $value + */ + public function setStatusCode(?int $value = null): self + { + $this->statusCode = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPayload(): ?string + { + return $this->payload; + } + + /** + * @param ?string $value + */ + public function setPayload(?string $value = null): self + { + $this->payload = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SwapPlanResponse.php b/src/Types/SwapPlanResponse.php new file mode 100644 index 00000000..483c5d0b --- /dev/null +++ b/src/Types/SwapPlanResponse.php @@ -0,0 +1,106 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The subscription with the updated subscription plan. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @var ?array $actions A list of a `SWAP_PLAN` action created by the request. + */ + #[JsonProperty('actions'), ArrayType([SubscriptionAction::class])] + private ?array $actions; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * actions?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return ?array + */ + public function getActions(): ?array + { + return $this->actions; + } + + /** + * @param ?array $value + */ + public function setActions(?array $value = null): self + { + $this->actions = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TaxCalculationPhase.php b/src/Types/TaxCalculationPhase.php new file mode 100644 index 00000000..3c4e14af --- /dev/null +++ b/src/Types/TaxCalculationPhase.php @@ -0,0 +1,9 @@ +euVat = $values['euVat'] ?? null; + $this->frSiret = $values['frSiret'] ?? null; + $this->frNaf = $values['frNaf'] ?? null; + $this->esNif = $values['esNif'] ?? null; + $this->jpQii = $values['jpQii'] ?? null; + } + + /** + * @return ?string + */ + public function getEuVat(): ?string + { + return $this->euVat; + } + + /** + * @param ?string $value + */ + public function setEuVat(?string $value = null): self + { + $this->euVat = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFrSiret(): ?string + { + return $this->frSiret; + } + + /** + * @param ?string $value + */ + public function setFrSiret(?string $value = null): self + { + $this->frSiret = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFrNaf(): ?string + { + return $this->frNaf; + } + + /** + * @param ?string $value + */ + public function setFrNaf(?string $value = null): self + { + $this->frNaf = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEsNif(): ?string + { + return $this->esNif; + } + + /** + * @param ?string $value + */ + public function setEsNif(?string $value = null): self + { + $this->esNif = $value; + return $this; + } + + /** + * @return ?string + */ + public function getJpQii(): ?string + { + return $this->jpQii; + } + + /** + * @param ?string $value + */ + public function setJpQii(?string $value = null): self + { + $this->jpQii = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TaxInclusionType.php b/src/Types/TaxInclusionType.php new file mode 100644 index 00000000..192226a8 --- /dev/null +++ b/src/Types/TaxInclusionType.php @@ -0,0 +1,9 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?string $givenName The given name (that is, the first name) associated with the team member. + */ + #[JsonProperty('given_name')] + private ?string $givenName; + + /** + * @var ?string $familyName The family name (that is, the last name) associated with the team member. + */ + #[JsonProperty('family_name')] + private ?string $familyName; + + /** + * The email address associated with the team member. After accepting the invitation + * from Square, only the team member can change this value. + * + * @var ?string $emailAddress + */ + #[JsonProperty('email_address')] + private ?string $emailAddress; + + /** + * The team member's phone number, in E.164 format. For example: + * +14155552671 - the country code is 1 for US + * +551155256325 - the country code is 55 for BR + * + * @var ?string $phoneNumber + */ + #[JsonProperty('phone_number')] + private ?string $phoneNumber; + + /** + * @var ?string $createdAt The timestamp when the team member was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the team member was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?TeamMemberAssignedLocations $assignedLocations Describes the team member's assigned locations. + */ + #[JsonProperty('assigned_locations')] + private ?TeamMemberAssignedLocations $assignedLocations; + + /** + * @var ?WageSetting $wageSetting Information about the team member's overtime exemption status, job assignments, and compensation. + */ + #[JsonProperty('wage_setting')] + private ?WageSetting $wageSetting; + + /** + * @param array{ + * id?: ?string, + * referenceId?: ?string, + * isOwner?: ?bool, + * status?: ?value-of, + * givenName?: ?string, + * familyName?: ?string, + * emailAddress?: ?string, + * phoneNumber?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * assignedLocations?: ?TeamMemberAssignedLocations, + * wageSetting?: ?WageSetting, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->isOwner = $values['isOwner'] ?? null; + $this->status = $values['status'] ?? null; + $this->givenName = $values['givenName'] ?? null; + $this->familyName = $values['familyName'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->assignedLocations = $values['assignedLocations'] ?? null; + $this->wageSetting = $values['wageSetting'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOwner(): ?bool + { + return $this->isOwner; + } + + /** + * @param ?bool $value + */ + public function setIsOwner(?bool $value = null): self + { + $this->isOwner = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?string + */ + public function getGivenName(): ?string + { + return $this->givenName; + } + + /** + * @param ?string $value + */ + public function setGivenName(?string $value = null): self + { + $this->givenName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getFamilyName(): ?string + { + return $this->familyName; + } + + /** + * @param ?string $value + */ + public function setFamilyName(?string $value = null): self + { + $this->familyName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?TeamMemberAssignedLocations + */ + public function getAssignedLocations(): ?TeamMemberAssignedLocations + { + return $this->assignedLocations; + } + + /** + * @param ?TeamMemberAssignedLocations $value + */ + public function setAssignedLocations(?TeamMemberAssignedLocations $value = null): self + { + $this->assignedLocations = $value; + return $this; + } + + /** + * @return ?WageSetting + */ + public function getWageSetting(): ?WageSetting + { + return $this->wageSetting; + } + + /** + * @param ?WageSetting $value + */ + public function setWageSetting(?WageSetting $value = null): self + { + $this->wageSetting = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TeamMemberAssignedLocations.php b/src/Types/TeamMemberAssignedLocations.php new file mode 100644 index 00000000..67813b8c --- /dev/null +++ b/src/Types/TeamMemberAssignedLocations.php @@ -0,0 +1,83 @@ + $assignmentType + */ + #[JsonProperty('assignment_type')] + private ?string $assignmentType; + + /** + * @var ?array $locationIds The explicit locations that the team member is assigned to. + */ + #[JsonProperty('location_ids'), ArrayType(['string'])] + private ?array $locationIds; + + /** + * @param array{ + * assignmentType?: ?value-of, + * locationIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->assignmentType = $values['assignmentType'] ?? null; + $this->locationIds = $values['locationIds'] ?? null; + } + + /** + * @return ?value-of + */ + public function getAssignmentType(): ?string + { + return $this->assignmentType; + } + + /** + * @param ?value-of $value + */ + public function setAssignmentType(?string $value = null): self + { + $this->assignmentType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getLocationIds(): ?array + { + return $this->locationIds; + } + + /** + * @param ?array $value + */ + public function setLocationIds(?array $value = null): self + { + $this->locationIds = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TeamMemberAssignedLocationsAssignmentType.php b/src/Types/TeamMemberAssignedLocationsAssignmentType.php new file mode 100644 index 00000000..cea2ba9a --- /dev/null +++ b/src/Types/TeamMemberAssignedLocationsAssignmentType.php @@ -0,0 +1,9 @@ +teamMemberId = $values['teamMemberId'] ?? null; + $this->description = $values['description'] ?? null; + $this->displayName = $values['displayName'] ?? null; + $this->isBookable = $values['isBookable'] ?? null; + $this->profileImageUrl = $values['profileImageUrl'] ?? null; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param ?string $value + */ + public function setDescription(?string $value = null): self + { + $this->description = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisplayName(): ?string + { + return $this->displayName; + } + + /** + * @param ?string $value + */ + public function setDisplayName(?string $value = null): self + { + $this->displayName = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsBookable(): ?bool + { + return $this->isBookable; + } + + /** + * @param ?bool $value + */ + public function setIsBookable(?bool $value = null): self + { + $this->isBookable = $value; + return $this; + } + + /** + * @return ?string + */ + public function getProfileImageUrl(): ?string + { + return $this->profileImageUrl; + } + + /** + * @param ?string $value + */ + public function setProfileImageUrl(?string $value = null): self + { + $this->profileImageUrl = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TeamMemberStatus.php b/src/Types/TeamMemberStatus.php new file mode 100644 index 00000000..cf70d1c2 --- /dev/null +++ b/src/Types/TeamMemberStatus.php @@ -0,0 +1,9 @@ +id = $values['id'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->title = $values['title'] ?? null; + $this->hourlyRate = $values['hourlyRate'] ?? null; + $this->jobId = $values['jobId'] ?? null; + $this->tipEligible = $values['tipEligible'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param ?string $value + */ + public function setTitle(?string $value = null): self + { + $this->title = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getHourlyRate(): ?Money + { + return $this->hourlyRate; + } + + /** + * @param ?Money $value + */ + public function setHourlyRate(?Money $value = null): self + { + $this->hourlyRate = $value; + return $this; + } + + /** + * @return ?string + */ + public function getJobId(): ?string + { + return $this->jobId; + } + + /** + * @param ?string $value + */ + public function setJobId(?string $value = null): self + { + $this->jobId = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getTipEligible(): ?bool + { + return $this->tipEligible; + } + + /** + * @param ?bool $value + */ + public function setTipEligible(?bool $value = null): self + { + $this->tipEligible = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Tender.php b/src/Types/Tender.php new file mode 100644 index 00000000..aff23f72 --- /dev/null +++ b/src/Types/Tender.php @@ -0,0 +1,496 @@ + $type + */ + #[JsonProperty('type')] + private string $type; + + /** + * The details of the card tender. + * + * This value is present only if the value of `type` is `CARD`. + * + * @var ?TenderCardDetails $cardDetails + */ + #[JsonProperty('card_details')] + private ?TenderCardDetails $cardDetails; + + /** + * The details of the cash tender. + * + * This value is present only if the value of `type` is `CASH`. + * + * @var ?TenderCashDetails $cashDetails + */ + #[JsonProperty('cash_details')] + private ?TenderCashDetails $cashDetails; + + /** + * The details of the bank account tender. + * + * This value is present only if the value of `type` is `BANK_ACCOUNT`. + * + * @var ?TenderBankAccountDetails $bankAccountDetails + */ + #[JsonProperty('bank_account_details')] + private ?TenderBankAccountDetails $bankAccountDetails; + + /** + * The details of a Buy Now Pay Later tender. + * + * This value is present only if the value of `type` is `BUY_NOW_PAY_LATER`. + * + * @var ?TenderBuyNowPayLaterDetails $buyNowPayLaterDetails + */ + #[JsonProperty('buy_now_pay_later_details')] + private ?TenderBuyNowPayLaterDetails $buyNowPayLaterDetails; + + /** + * The details of a Square Account tender. + * + * This value is present only if the value of `type` is `SQUARE_ACCOUNT`. + * + * @var ?TenderSquareAccountDetails $squareAccountDetails + */ + #[JsonProperty('square_account_details')] + private ?TenderSquareAccountDetails $squareAccountDetails; + + /** + * Additional recipients (other than the merchant) receiving a portion of this tender. + * For example, fees assessed on the purchase by a third party integration. + * + * @var ?array $additionalRecipients + */ + #[JsonProperty('additional_recipients'), ArrayType([AdditionalRecipient::class])] + private ?array $additionalRecipients; + + /** + * The ID of the [Payment](entity:Payment) that corresponds to this tender. + * This value is only present for payments created with the v2 Payments API. + * + * @var ?string $paymentId + */ + #[JsonProperty('payment_id')] + private ?string $paymentId; + + /** + * @param array{ + * type: value-of, + * id?: ?string, + * locationId?: ?string, + * transactionId?: ?string, + * createdAt?: ?string, + * note?: ?string, + * amountMoney?: ?Money, + * tipMoney?: ?Money, + * processingFeeMoney?: ?Money, + * customerId?: ?string, + * cardDetails?: ?TenderCardDetails, + * cashDetails?: ?TenderCashDetails, + * bankAccountDetails?: ?TenderBankAccountDetails, + * buyNowPayLaterDetails?: ?TenderBuyNowPayLaterDetails, + * squareAccountDetails?: ?TenderSquareAccountDetails, + * additionalRecipients?: ?array, + * paymentId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->transactionId = $values['transactionId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->note = $values['note'] ?? null; + $this->amountMoney = $values['amountMoney'] ?? null; + $this->tipMoney = $values['tipMoney'] ?? null; + $this->processingFeeMoney = $values['processingFeeMoney'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->type = $values['type']; + $this->cardDetails = $values['cardDetails'] ?? null; + $this->cashDetails = $values['cashDetails'] ?? null; + $this->bankAccountDetails = $values['bankAccountDetails'] ?? null; + $this->buyNowPayLaterDetails = $values['buyNowPayLaterDetails'] ?? null; + $this->squareAccountDetails = $values['squareAccountDetails'] ?? null; + $this->additionalRecipients = $values['additionalRecipients'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTransactionId(): ?string + { + return $this->transactionId; + } + + /** + * @param ?string $value + */ + public function setTransactionId(?string $value = null): self + { + $this->transactionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAmountMoney(): ?Money + { + return $this->amountMoney; + } + + /** + * @param ?Money $value + */ + public function setAmountMoney(?Money $value = null): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTipMoney(): ?Money + { + return $this->tipMoney; + } + + /** + * @param ?Money $value + */ + public function setTipMoney(?Money $value = null): self + { + $this->tipMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getProcessingFeeMoney(): ?Money + { + return $this->processingFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setProcessingFeeMoney(?Money $value = null): self + { + $this->processingFeeMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return value-of + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param value-of $value + */ + public function setType(string $value): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?TenderCardDetails + */ + public function getCardDetails(): ?TenderCardDetails + { + return $this->cardDetails; + } + + /** + * @param ?TenderCardDetails $value + */ + public function setCardDetails(?TenderCardDetails $value = null): self + { + $this->cardDetails = $value; + return $this; + } + + /** + * @return ?TenderCashDetails + */ + public function getCashDetails(): ?TenderCashDetails + { + return $this->cashDetails; + } + + /** + * @param ?TenderCashDetails $value + */ + public function setCashDetails(?TenderCashDetails $value = null): self + { + $this->cashDetails = $value; + return $this; + } + + /** + * @return ?TenderBankAccountDetails + */ + public function getBankAccountDetails(): ?TenderBankAccountDetails + { + return $this->bankAccountDetails; + } + + /** + * @param ?TenderBankAccountDetails $value + */ + public function setBankAccountDetails(?TenderBankAccountDetails $value = null): self + { + $this->bankAccountDetails = $value; + return $this; + } + + /** + * @return ?TenderBuyNowPayLaterDetails + */ + public function getBuyNowPayLaterDetails(): ?TenderBuyNowPayLaterDetails + { + return $this->buyNowPayLaterDetails; + } + + /** + * @param ?TenderBuyNowPayLaterDetails $value + */ + public function setBuyNowPayLaterDetails(?TenderBuyNowPayLaterDetails $value = null): self + { + $this->buyNowPayLaterDetails = $value; + return $this; + } + + /** + * @return ?TenderSquareAccountDetails + */ + public function getSquareAccountDetails(): ?TenderSquareAccountDetails + { + return $this->squareAccountDetails; + } + + /** + * @param ?TenderSquareAccountDetails $value + */ + public function setSquareAccountDetails(?TenderSquareAccountDetails $value = null): self + { + $this->squareAccountDetails = $value; + return $this; + } + + /** + * @return ?array + */ + public function getAdditionalRecipients(): ?array + { + return $this->additionalRecipients; + } + + /** + * @param ?array $value + */ + public function setAdditionalRecipients(?array $value = null): self + { + $this->additionalRecipients = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderBankAccountDetails.php b/src/Types/TenderBankAccountDetails.php new file mode 100644 index 00000000..addd0def --- /dev/null +++ b/src/Types/TenderBankAccountDetails.php @@ -0,0 +1,62 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->status = $values['status'] ?? null; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderBankAccountDetailsStatus.php b/src/Types/TenderBankAccountDetailsStatus.php new file mode 100644 index 00000000..494fe8eb --- /dev/null +++ b/src/Types/TenderBankAccountDetailsStatus.php @@ -0,0 +1,10 @@ + $buyNowPayLaterBrand + */ + #[JsonProperty('buy_now_pay_later_brand')] + private ?string $buyNowPayLaterBrand; + + /** + * The buy now pay later payment's current state (such as `AUTHORIZED` or + * `CAPTURED`). See [TenderBuyNowPayLaterDetailsStatus](entity:TenderBuyNowPayLaterDetailsStatus) + * for possible values. + * See [Status](#type-status) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * buyNowPayLaterBrand?: ?value-of, + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->buyNowPayLaterBrand = $values['buyNowPayLaterBrand'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?value-of + */ + public function getBuyNowPayLaterBrand(): ?string + { + return $this->buyNowPayLaterBrand; + } + + /** + * @param ?value-of $value + */ + public function setBuyNowPayLaterBrand(?string $value = null): self + { + $this->buyNowPayLaterBrand = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderBuyNowPayLaterDetailsBrand.php b/src/Types/TenderBuyNowPayLaterDetailsBrand.php new file mode 100644 index 00000000..ca0866bf --- /dev/null +++ b/src/Types/TenderBuyNowPayLaterDetailsBrand.php @@ -0,0 +1,9 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @var ?Card $card The credit card's non-confidential details. + */ + #[JsonProperty('card')] + private ?Card $card; + + /** + * The method used to enter the card's details for the transaction. + * See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values + * + * @var ?value-of $entryMethod + */ + #[JsonProperty('entry_method')] + private ?string $entryMethod; + + /** + * @param array{ + * status?: ?value-of, + * card?: ?Card, + * entryMethod?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->status = $values['status'] ?? null; + $this->card = $values['card'] ?? null; + $this->entryMethod = $values['entryMethod'] ?? null; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?Card + */ + public function getCard(): ?Card + { + return $this->card; + } + + /** + * @param ?Card $value + */ + public function setCard(?Card $value = null): self + { + $this->card = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEntryMethod(): ?string + { + return $this->entryMethod; + } + + /** + * @param ?value-of $value + */ + public function setEntryMethod(?string $value = null): self + { + $this->entryMethod = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderCardDetailsEntryMethod.php b/src/Types/TenderCardDetailsEntryMethod.php new file mode 100644 index 00000000..6a59b1e2 --- /dev/null +++ b/src/Types/TenderCardDetailsEntryMethod.php @@ -0,0 +1,12 @@ +buyerTenderedMoney = $values['buyerTenderedMoney'] ?? null; + $this->changeBackMoney = $values['changeBackMoney'] ?? null; + } + + /** + * @return ?Money + */ + public function getBuyerTenderedMoney(): ?Money + { + return $this->buyerTenderedMoney; + } + + /** + * @param ?Money $value + */ + public function setBuyerTenderedMoney(?Money $value = null): self + { + $this->buyerTenderedMoney = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getChangeBackMoney(): ?Money + { + return $this->changeBackMoney; + } + + /** + * @param ?Money $value + */ + public function setChangeBackMoney(?Money $value = null): self + { + $this->changeBackMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderSquareAccountDetails.php b/src/Types/TenderSquareAccountDetails.php new file mode 100644 index 00000000..aecd67c6 --- /dev/null +++ b/src/Types/TenderSquareAccountDetails.php @@ -0,0 +1,59 @@ + $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->status = $values['status'] ?? null; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenderSquareAccountDetailsStatus.php b/src/Types/TenderSquareAccountDetailsStatus.php new file mode 100644 index 00000000..7a2a0be2 --- /dev/null +++ b/src/Types/TenderSquareAccountDetailsStatus.php @@ -0,0 +1,11 @@ + $cancelReason + */ + #[JsonProperty('cancel_reason')] + private ?string $cancelReason; + + /** + * @var ?string $createdAt The time when the `TerminalAction` was created as an RFC 3339 timestamp. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $appId The ID of the application that created the action. + */ + #[JsonProperty('app_id')] + private ?string $appId; + + /** + * @var ?string $locationId The location id the action is attached to, if a link can be made. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * Represents the type of the action. + * See [ActionType](#type-actiontype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?QrCodeOptions $qrCodeOptions Describes configuration for the QR code action. Requires `QR_CODE` type. + */ + #[JsonProperty('qr_code_options')] + private ?QrCodeOptions $qrCodeOptions; + + /** + * @var ?SaveCardOptions $saveCardOptions Describes configuration for the save-card action. Requires `SAVE_CARD` type. + */ + #[JsonProperty('save_card_options')] + private ?SaveCardOptions $saveCardOptions; + + /** + * @var ?SignatureOptions $signatureOptions Describes configuration for the signature capture action. Requires `SIGNATURE` type. + */ + #[JsonProperty('signature_options')] + private ?SignatureOptions $signatureOptions; + + /** + * @var ?ConfirmationOptions $confirmationOptions Describes configuration for the confirmation action. Requires `CONFIRMATION` type. + */ + #[JsonProperty('confirmation_options')] + private ?ConfirmationOptions $confirmationOptions; + + /** + * @var ?ReceiptOptions $receiptOptions Describes configuration for the receipt action. Requires `RECEIPT` type. + */ + #[JsonProperty('receipt_options')] + private ?ReceiptOptions $receiptOptions; + + /** + * @var ?DataCollectionOptions $dataCollectionOptions Describes configuration for the data collection action. Requires `DATA_COLLECTION` type. + */ + #[JsonProperty('data_collection_options')] + private ?DataCollectionOptions $dataCollectionOptions; + + /** + * @var ?SelectOptions $selectOptions Describes configuration for the select action. Requires `SELECT` type. + */ + #[JsonProperty('select_options')] + private ?SelectOptions $selectOptions; + + /** + * Details about the Terminal that received the action request (such as battery level, + * operating system version, and network connection settings). + * + * Only available for `PING` action type. + * + * @var ?DeviceMetadata $deviceMetadata + */ + #[JsonProperty('device_metadata')] + private ?DeviceMetadata $deviceMetadata; + + /** + * Indicates the action will be linked to another action and requires a waiting dialog to be + * displayed instead of returning to the idle screen on completion of the action. + * + * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. + * + * @var ?bool $awaitNextAction + */ + #[JsonProperty('await_next_action')] + private ?bool $awaitNextAction; + + /** + * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the + * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. + * + * Default: 5 minutes from when the waiting dialog is displayed + * + * Maximum: 5 minutes + * + * @var ?string $awaitNextActionDuration + */ + #[JsonProperty('await_next_action_duration')] + private ?string $awaitNextActionDuration; + + /** + * @param array{ + * id?: ?string, + * deviceId?: ?string, + * deadlineDuration?: ?string, + * status?: ?string, + * cancelReason?: ?value-of, + * createdAt?: ?string, + * updatedAt?: ?string, + * appId?: ?string, + * locationId?: ?string, + * type?: ?value-of, + * qrCodeOptions?: ?QrCodeOptions, + * saveCardOptions?: ?SaveCardOptions, + * signatureOptions?: ?SignatureOptions, + * confirmationOptions?: ?ConfirmationOptions, + * receiptOptions?: ?ReceiptOptions, + * dataCollectionOptions?: ?DataCollectionOptions, + * selectOptions?: ?SelectOptions, + * deviceMetadata?: ?DeviceMetadata, + * awaitNextAction?: ?bool, + * awaitNextActionDuration?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->deviceId = $values['deviceId'] ?? null; + $this->deadlineDuration = $values['deadlineDuration'] ?? null; + $this->status = $values['status'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->appId = $values['appId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->type = $values['type'] ?? null; + $this->qrCodeOptions = $values['qrCodeOptions'] ?? null; + $this->saveCardOptions = $values['saveCardOptions'] ?? null; + $this->signatureOptions = $values['signatureOptions'] ?? null; + $this->confirmationOptions = $values['confirmationOptions'] ?? null; + $this->receiptOptions = $values['receiptOptions'] ?? null; + $this->dataCollectionOptions = $values['dataCollectionOptions'] ?? null; + $this->selectOptions = $values['selectOptions'] ?? null; + $this->deviceMetadata = $values['deviceMetadata'] ?? null; + $this->awaitNextAction = $values['awaitNextAction'] ?? null; + $this->awaitNextActionDuration = $values['awaitNextActionDuration'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeadlineDuration(): ?string + { + return $this->deadlineDuration; + } + + /** + * @param ?string $value + */ + public function setDeadlineDuration(?string $value = null): self + { + $this->deadlineDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?value-of $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAppId(): ?string + { + return $this->appId; + } + + /** + * @param ?string $value + */ + public function setAppId(?string $value = null): self + { + $this->appId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?QrCodeOptions + */ + public function getQrCodeOptions(): ?QrCodeOptions + { + return $this->qrCodeOptions; + } + + /** + * @param ?QrCodeOptions $value + */ + public function setQrCodeOptions(?QrCodeOptions $value = null): self + { + $this->qrCodeOptions = $value; + return $this; + } + + /** + * @return ?SaveCardOptions + */ + public function getSaveCardOptions(): ?SaveCardOptions + { + return $this->saveCardOptions; + } + + /** + * @param ?SaveCardOptions $value + */ + public function setSaveCardOptions(?SaveCardOptions $value = null): self + { + $this->saveCardOptions = $value; + return $this; + } + + /** + * @return ?SignatureOptions + */ + public function getSignatureOptions(): ?SignatureOptions + { + return $this->signatureOptions; + } + + /** + * @param ?SignatureOptions $value + */ + public function setSignatureOptions(?SignatureOptions $value = null): self + { + $this->signatureOptions = $value; + return $this; + } + + /** + * @return ?ConfirmationOptions + */ + public function getConfirmationOptions(): ?ConfirmationOptions + { + return $this->confirmationOptions; + } + + /** + * @param ?ConfirmationOptions $value + */ + public function setConfirmationOptions(?ConfirmationOptions $value = null): self + { + $this->confirmationOptions = $value; + return $this; + } + + /** + * @return ?ReceiptOptions + */ + public function getReceiptOptions(): ?ReceiptOptions + { + return $this->receiptOptions; + } + + /** + * @param ?ReceiptOptions $value + */ + public function setReceiptOptions(?ReceiptOptions $value = null): self + { + $this->receiptOptions = $value; + return $this; + } + + /** + * @return ?DataCollectionOptions + */ + public function getDataCollectionOptions(): ?DataCollectionOptions + { + return $this->dataCollectionOptions; + } + + /** + * @param ?DataCollectionOptions $value + */ + public function setDataCollectionOptions(?DataCollectionOptions $value = null): self + { + $this->dataCollectionOptions = $value; + return $this; + } + + /** + * @return ?SelectOptions + */ + public function getSelectOptions(): ?SelectOptions + { + return $this->selectOptions; + } + + /** + * @param ?SelectOptions $value + */ + public function setSelectOptions(?SelectOptions $value = null): self + { + $this->selectOptions = $value; + return $this; + } + + /** + * @return ?DeviceMetadata + */ + public function getDeviceMetadata(): ?DeviceMetadata + { + return $this->deviceMetadata; + } + + /** + * @param ?DeviceMetadata $value + */ + public function setDeviceMetadata(?DeviceMetadata $value = null): self + { + $this->deviceMetadata = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getAwaitNextAction(): ?bool + { + return $this->awaitNextAction; + } + + /** + * @param ?bool $value + */ + public function setAwaitNextAction(?bool $value = null): self + { + $this->awaitNextAction = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAwaitNextActionDuration(): ?string + { + return $this->awaitNextActionDuration; + } + + /** + * @param ?string $value + */ + public function setAwaitNextActionDuration(?string $value = null): self + { + $this->awaitNextActionDuration = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalActionActionType.php b/src/Types/TerminalActionActionType.php new file mode 100644 index 00000000..89f40398 --- /dev/null +++ b/src/Types/TerminalActionActionType.php @@ -0,0 +1,15 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?TerminalActionQueryFilter + */ + public function getFilter(): ?TerminalActionQueryFilter + { + return $this->filter; + } + + /** + * @param ?TerminalActionQueryFilter $value + */ + public function setFilter(?TerminalActionQueryFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?TerminalActionQuerySort + */ + public function getSort(): ?TerminalActionQuerySort + { + return $this->sort; + } + + /** + * @param ?TerminalActionQuerySort $value + */ + public function setSort(?TerminalActionQuerySort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalActionQueryFilter.php b/src/Types/TerminalActionQueryFilter.php new file mode 100644 index 00000000..4e52348e --- /dev/null +++ b/src/Types/TerminalActionQueryFilter.php @@ -0,0 +1,139 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @param array{ + * deviceId?: ?string, + * createdAt?: ?TimeRange, + * status?: ?string, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->deviceId = $values['deviceId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->status = $values['status'] ?? null; + $this->type = $values['type'] ?? null; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalActionQuerySort.php b/src/Types/TerminalActionQuerySort.php new file mode 100644 index 00000000..347f36ed --- /dev/null +++ b/src/Types/TerminalActionQuerySort.php @@ -0,0 +1,56 @@ + $sortOrder + */ + #[JsonProperty('sort_order')] + private ?string $sortOrder; + + /** + * @param array{ + * sortOrder?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalCheckout.php b/src/Types/TerminalCheckout.php new file mode 100644 index 00000000..d040de7f --- /dev/null +++ b/src/Types/TerminalCheckout.php @@ -0,0 +1,603 @@ + $cancelReason + */ + #[JsonProperty('cancel_reason')] + private ?string $cancelReason; + + /** + * @var ?array $paymentIds A list of IDs for payments created by this `TerminalCheckout`. + */ + #[JsonProperty('payment_ids'), ArrayType(['string'])] + private ?array $paymentIds; + + /** + * @var ?string $createdAt The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $appId The ID of the application that created the checkout. + */ + #[JsonProperty('app_id')] + private ?string $appId; + + /** + * @var ?string $locationId The location of the device where the `TerminalCheckout` was directed. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * The type of payment the terminal should attempt to capture from. Defaults to `CARD_PRESENT`. + * See [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for possible values + * + * @var ?value-of $paymentType + */ + #[JsonProperty('payment_type')] + private ?string $paymentType; + + /** + * @var ?string $teamMemberId An optional ID of the team member associated with creating the checkout. + */ + #[JsonProperty('team_member_id')] + private ?string $teamMemberId; + + /** + * @var ?string $customerId An optional ID of the customer associated with the checkout. + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + + /** + * The amount the developer is taking as a fee for facilitating the payment on behalf + * of the seller. + * + * The amount cannot be more than 90% of the total amount of the payment. + * + * The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + * + * The fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller. + * + * For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + * + * To set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + * + * Supported only in the US. + * + * @var ?Money $appFeeMoney + */ + #[JsonProperty('app_fee_money')] + private ?Money $appFeeMoney; + + /** + * Optional additional payment information to include on the customer's card statement as + * part of the statement description. This can be, for example, an invoice number, ticket number, + * or short description that uniquely identifies the purchase. Supported only in the US. + * + * @var ?string $statementDescriptionIdentifier + */ + #[JsonProperty('statement_description_identifier')] + private ?string $statementDescriptionIdentifier; + + /** + * The amount designated as a tip, in addition to `amount_money`. This may only be set for a + * checkout that has tipping disabled (`tip_settings.allow_tipping` is `false`). Supported only in + * the US. + * + * @var ?Money $tipMoney + */ + #[JsonProperty('tip_money')] + private ?Money $tipMoney; + + /** + * @param array{ + * amountMoney: Money, + * deviceOptions: DeviceCheckoutOptions, + * id?: ?string, + * referenceId?: ?string, + * note?: ?string, + * orderId?: ?string, + * paymentOptions?: ?PaymentOptions, + * deadlineDuration?: ?string, + * status?: ?string, + * cancelReason?: ?value-of, + * paymentIds?: ?array, + * createdAt?: ?string, + * updatedAt?: ?string, + * appId?: ?string, + * locationId?: ?string, + * paymentType?: ?value-of, + * teamMemberId?: ?string, + * customerId?: ?string, + * appFeeMoney?: ?Money, + * statementDescriptionIdentifier?: ?string, + * tipMoney?: ?Money, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->amountMoney = $values['amountMoney']; + $this->referenceId = $values['referenceId'] ?? null; + $this->note = $values['note'] ?? null; + $this->orderId = $values['orderId'] ?? null; + $this->paymentOptions = $values['paymentOptions'] ?? null; + $this->deviceOptions = $values['deviceOptions']; + $this->deadlineDuration = $values['deadlineDuration'] ?? null; + $this->status = $values['status'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->paymentIds = $values['paymentIds'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->appId = $values['appId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->paymentType = $values['paymentType'] ?? null; + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->customerId = $values['customerId'] ?? null; + $this->appFeeMoney = $values['appFeeMoney'] ?? null; + $this->statementDescriptionIdentifier = $values['statementDescriptionIdentifier'] ?? null; + $this->tipMoney = $values['tipMoney'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return ?PaymentOptions + */ + public function getPaymentOptions(): ?PaymentOptions + { + return $this->paymentOptions; + } + + /** + * @param ?PaymentOptions $value + */ + public function setPaymentOptions(?PaymentOptions $value = null): self + { + $this->paymentOptions = $value; + return $this; + } + + /** + * @return DeviceCheckoutOptions + */ + public function getDeviceOptions(): DeviceCheckoutOptions + { + return $this->deviceOptions; + } + + /** + * @param DeviceCheckoutOptions $value + */ + public function setDeviceOptions(DeviceCheckoutOptions $value): self + { + $this->deviceOptions = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeadlineDuration(): ?string + { + return $this->deadlineDuration; + } + + /** + * @param ?string $value + */ + public function setDeadlineDuration(?string $value = null): self + { + $this->deadlineDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?value-of $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPaymentIds(): ?array + { + return $this->paymentIds; + } + + /** + * @param ?array $value + */ + public function setPaymentIds(?array $value = null): self + { + $this->paymentIds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAppId(): ?string + { + return $this->appId; + } + + /** + * @param ?string $value + */ + public function setAppId(?string $value = null): self + { + $this->appId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getPaymentType(): ?string + { + return $this->paymentType; + } + + /** + * @param ?value-of $value + */ + public function setPaymentType(?string $value = null): self + { + $this->paymentType = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getAppFeeMoney(): ?Money + { + return $this->appFeeMoney; + } + + /** + * @param ?Money $value + */ + public function setAppFeeMoney(?Money $value = null): self + { + $this->appFeeMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatementDescriptionIdentifier(): ?string + { + return $this->statementDescriptionIdentifier; + } + + /** + * @param ?string $value + */ + public function setStatementDescriptionIdentifier(?string $value = null): self + { + $this->statementDescriptionIdentifier = $value; + return $this; + } + + /** + * @return ?Money + */ + public function getTipMoney(): ?Money + { + return $this->tipMoney; + } + + /** + * @param ?Money $value + */ + public function setTipMoney(?Money $value = null): self + { + $this->tipMoney = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalCheckoutQuery.php b/src/Types/TerminalCheckoutQuery.php new file mode 100644 index 00000000..bdd2d49d --- /dev/null +++ b/src/Types/TerminalCheckoutQuery.php @@ -0,0 +1,76 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?TerminalCheckoutQueryFilter + */ + public function getFilter(): ?TerminalCheckoutQueryFilter + { + return $this->filter; + } + + /** + * @param ?TerminalCheckoutQueryFilter $value + */ + public function setFilter(?TerminalCheckoutQueryFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?TerminalCheckoutQuerySort + */ + public function getSort(): ?TerminalCheckoutQuerySort + { + return $this->sort; + } + + /** + * @param ?TerminalCheckoutQuerySort $value + */ + public function setSort(?TerminalCheckoutQuerySort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalCheckoutQueryFilter.php b/src/Types/TerminalCheckoutQueryFilter.php new file mode 100644 index 00000000..b44e7fb5 --- /dev/null +++ b/src/Types/TerminalCheckoutQueryFilter.php @@ -0,0 +1,111 @@ +deviceId = $values['deviceId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalCheckoutQuerySort.php b/src/Types/TerminalCheckoutQuerySort.php new file mode 100644 index 00000000..6463845c --- /dev/null +++ b/src/Types/TerminalCheckoutQuerySort.php @@ -0,0 +1,55 @@ + $sortOrder + */ + #[JsonProperty('sort_order')] + private ?string $sortOrder; + + /** + * @param array{ + * sortOrder?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalRefund.php b/src/Types/TerminalRefund.php new file mode 100644 index 00000000..affa532f --- /dev/null +++ b/src/Types/TerminalRefund.php @@ -0,0 +1,400 @@ + $cancelReason + */ + #[JsonProperty('cancel_reason')] + private ?string $cancelReason; + + /** + * @var ?string $createdAt The time when the `TerminalRefund` was created, as an RFC 3339 timestamp. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $appId The ID of the application that created the refund. + */ + #[JsonProperty('app_id')] + private ?string $appId; + + /** + * @var ?string $locationId The location of the device where the `TerminalRefund` was directed. + */ + #[JsonProperty('location_id')] + private ?string $locationId; + + /** + * @param array{ + * paymentId: string, + * amountMoney: Money, + * reason: string, + * deviceId: string, + * id?: ?string, + * refundId?: ?string, + * orderId?: ?string, + * deadlineDuration?: ?string, + * status?: ?string, + * cancelReason?: ?value-of, + * createdAt?: ?string, + * updatedAt?: ?string, + * appId?: ?string, + * locationId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->refundId = $values['refundId'] ?? null; + $this->paymentId = $values['paymentId']; + $this->orderId = $values['orderId'] ?? null; + $this->amountMoney = $values['amountMoney']; + $this->reason = $values['reason']; + $this->deviceId = $values['deviceId']; + $this->deadlineDuration = $values['deadlineDuration'] ?? null; + $this->status = $values['status'] ?? null; + $this->cancelReason = $values['cancelReason'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->appId = $values['appId'] ?? null; + $this->locationId = $values['locationId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundId(): ?string + { + return $this->refundId; + } + + /** + * @param ?string $value + */ + public function setRefundId(?string $value = null): self + { + $this->refundId = $value; + return $this; + } + + /** + * @return string + */ + public function getPaymentId(): string + { + return $this->paymentId; + } + + /** + * @param string $value + */ + public function setPaymentId(string $value): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return Money + */ + public function getAmountMoney(): Money + { + return $this->amountMoney; + } + + /** + * @param Money $value + */ + public function setAmountMoney(Money $value): self + { + $this->amountMoney = $value; + return $this; + } + + /** + * @return string + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param string $value + */ + public function setReason(string $value): self + { + $this->reason = $value; + return $this; + } + + /** + * @return string + */ + public function getDeviceId(): string + { + return $this->deviceId; + } + + /** + * @param string $value + */ + public function setDeviceId(string $value): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDeadlineDuration(): ?string + { + return $this->deadlineDuration; + } + + /** + * @param ?string $value + */ + public function setDeadlineDuration(?string $value = null): self + { + $this->deadlineDuration = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCancelReason(): ?string + { + return $this->cancelReason; + } + + /** + * @param ?value-of $value + */ + public function setCancelReason(?string $value = null): self + { + $this->cancelReason = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAppId(): ?string + { + return $this->appId; + } + + /** + * @param ?string $value + */ + public function setAppId(?string $value = null): self + { + $this->appId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalRefundQuery.php b/src/Types/TerminalRefundQuery.php new file mode 100644 index 00000000..be71991f --- /dev/null +++ b/src/Types/TerminalRefundQuery.php @@ -0,0 +1,76 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + } + + /** + * @return ?TerminalRefundQueryFilter + */ + public function getFilter(): ?TerminalRefundQueryFilter + { + return $this->filter; + } + + /** + * @param ?TerminalRefundQueryFilter $value + */ + public function setFilter(?TerminalRefundQueryFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?TerminalRefundQuerySort + */ + public function getSort(): ?TerminalRefundQuerySort + { + return $this->sort; + } + + /** + * @param ?TerminalRefundQuerySort $value + */ + public function setSort(?TerminalRefundQuerySort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalRefundQueryFilter.php b/src/Types/TerminalRefundQueryFilter.php new file mode 100644 index 00000000..3409ae4b --- /dev/null +++ b/src/Types/TerminalRefundQueryFilter.php @@ -0,0 +1,111 @@ +deviceId = $values['deviceId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?string + */ + public function getDeviceId(): ?string + { + return $this->deviceId; + } + + /** + * @param ?string $value + */ + public function setDeviceId(?string $value = null): self + { + $this->deviceId = $value; + return $this; + } + + /** + * @return ?TimeRange + */ + public function getCreatedAt(): ?TimeRange + { + return $this->createdAt; + } + + /** + * @param ?TimeRange $value + */ + public function setCreatedAt(?TimeRange $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?string $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TerminalRefundQuerySort.php b/src/Types/TerminalRefundQuerySort.php new file mode 100644 index 00000000..be2c68b9 --- /dev/null +++ b/src/Types/TerminalRefundQuerySort.php @@ -0,0 +1,55 @@ +sortOrder = $values['sortOrder'] ?? null; + } + + /** + * @return ?string + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?string $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TestWebhookSubscriptionResponse.php b/src/Types/TestWebhookSubscriptionResponse.php new file mode 100644 index 00000000..c4b300b4 --- /dev/null +++ b/src/Types/TestWebhookSubscriptionResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?SubscriptionTestResult $subscriptionTestResult The [SubscriptionTestResult](entity:SubscriptionTestResult). + */ + #[JsonProperty('subscription_test_result')] + private ?SubscriptionTestResult $subscriptionTestResult; + + /** + * @param array{ + * errors?: ?array, + * subscriptionTestResult?: ?SubscriptionTestResult, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscriptionTestResult = $values['subscriptionTestResult'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?SubscriptionTestResult + */ + public function getSubscriptionTestResult(): ?SubscriptionTestResult + { + return $this->subscriptionTestResult; + } + + /** + * @param ?SubscriptionTestResult $value + */ + public function setSubscriptionTestResult(?SubscriptionTestResult $value = null): self + { + $this->subscriptionTestResult = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TimeRange.php b/src/Types/TimeRange.php new file mode 100644 index 00000000..c01c8b31 --- /dev/null +++ b/src/Types/TimeRange.php @@ -0,0 +1,89 @@ +startAt = $values['startAt'] ?? null; + $this->endAt = $values['endAt'] ?? null; + } + + /** + * @return ?string + */ + public function getStartAt(): ?string + { + return $this->startAt; + } + + /** + * @param ?string $value + */ + public function setStartAt(?string $value = null): self + { + $this->startAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEndAt(): ?string + { + return $this->endAt; + } + + /** + * @param ?string $value + */ + public function setEndAt(?string $value = null): self + { + $this->endAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TipSettings.php b/src/Types/TipSettings.php new file mode 100644 index 00000000..2d3ec983 --- /dev/null +++ b/src/Types/TipSettings.php @@ -0,0 +1,170 @@ + $tipPercentages + */ + #[JsonProperty('tip_percentages'), ArrayType(['integer'])] + private ?array $tipPercentages; + + /** + * Enables the "Smart Tip Amounts" behavior. + * Exact tipping options depend on the region in which the Square seller is active. + * + * For payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, tipping options are presented as no tip, .50, 1.00 or 2.00. + * + * For payment amounts of 10.00 or greater, tipping options are presented as the following percentages: 0%, 5%, 10%, 15%. + * + * If set to true, the `tip_percentages` settings is ignored. + * Defaults to false. + * + * To learn more about smart tipping, see [Accept Tips with the Square App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app). + * + * @var ?bool $smartTipping + */ + #[JsonProperty('smart_tipping')] + private ?bool $smartTipping; + + /** + * @param array{ + * allowTipping?: ?bool, + * separateTipScreen?: ?bool, + * customTipField?: ?bool, + * tipPercentages?: ?array, + * smartTipping?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->allowTipping = $values['allowTipping'] ?? null; + $this->separateTipScreen = $values['separateTipScreen'] ?? null; + $this->customTipField = $values['customTipField'] ?? null; + $this->tipPercentages = $values['tipPercentages'] ?? null; + $this->smartTipping = $values['smartTipping'] ?? null; + } + + /** + * @return ?bool + */ + public function getAllowTipping(): ?bool + { + return $this->allowTipping; + } + + /** + * @param ?bool $value + */ + public function setAllowTipping(?bool $value = null): self + { + $this->allowTipping = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSeparateTipScreen(): ?bool + { + return $this->separateTipScreen; + } + + /** + * @param ?bool $value + */ + public function setSeparateTipScreen(?bool $value = null): self + { + $this->separateTipScreen = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getCustomTipField(): ?bool + { + return $this->customTipField; + } + + /** + * @param ?bool $value + */ + public function setCustomTipField(?bool $value = null): self + { + $this->customTipField = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTipPercentages(): ?array + { + return $this->tipPercentages; + } + + /** + * @param ?array $value + */ + public function setTipPercentages(?array $value = null): self + { + $this->tipPercentages = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getSmartTipping(): ?bool + { + return $this->smartTipping; + } + + /** + * @param ?bool $value + */ + public function setSmartTipping(?bool $value = null): self + { + $this->smartTipping = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Transaction.php b/src/Types/Transaction.php new file mode 100644 index 00000000..65a6c12d --- /dev/null +++ b/src/Types/Transaction.php @@ -0,0 +1,302 @@ + $tenders The tenders used to pay in the transaction. + */ + #[JsonProperty('tenders'), ArrayType([Tender::class])] + private ?array $tenders; + + /** + * @var ?array $refunds Refunds that have been applied to any tender in the transaction. + */ + #[JsonProperty('refunds'), ArrayType([Refund::class])] + private ?array $refunds; + + /** + * If the transaction was created with the [Charge](api-endpoint:Transactions-Charge) + * endpoint, this value is the same as the value provided for the `reference_id` + * parameter in the request to that endpoint. Otherwise, it is not set. + * + * @var ?string $referenceId + */ + #[JsonProperty('reference_id')] + private ?string $referenceId; + + /** + * The Square product that processed the transaction. + * See [TransactionProduct](#type-transactionproduct) for possible values + * + * @var ?value-of $product + */ + #[JsonProperty('product')] + private ?string $product; + + /** + * If the transaction was created in the Square Point of Sale app, this value + * is the ID generated for the transaction by Square Point of Sale. + * + * This ID has no relationship to the transaction's canonical `id`, which is + * generated by Square's backend servers. This value is generated for bookkeeping + * purposes, in case the transaction cannot immediately be completed (for example, + * if the transaction is processed in offline mode). + * + * It is not currently possible with the Connect API to perform a transaction + * lookup by this value. + * + * @var ?string $clientId + */ + #[JsonProperty('client_id')] + private ?string $clientId; + + /** + * @var ?Address $shippingAddress The shipping address provided in the request, if any. + */ + #[JsonProperty('shipping_address')] + private ?Address $shippingAddress; + + /** + * @var ?string $orderId The order_id is an identifier for the order associated with this transaction, if any. + */ + #[JsonProperty('order_id')] + private ?string $orderId; + + /** + * @param array{ + * id?: ?string, + * locationId?: ?string, + * createdAt?: ?string, + * tenders?: ?array, + * refunds?: ?array, + * referenceId?: ?string, + * product?: ?value-of, + * clientId?: ?string, + * shippingAddress?: ?Address, + * orderId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->locationId = $values['locationId'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->tenders = $values['tenders'] ?? null; + $this->refunds = $values['refunds'] ?? null; + $this->referenceId = $values['referenceId'] ?? null; + $this->product = $values['product'] ?? null; + $this->clientId = $values['clientId'] ?? null; + $this->shippingAddress = $values['shippingAddress'] ?? null; + $this->orderId = $values['orderId'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getLocationId(): ?string + { + return $this->locationId; + } + + /** + * @param ?string $value + */ + public function setLocationId(?string $value = null): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?array + */ + public function getTenders(): ?array + { + return $this->tenders; + } + + /** + * @param ?array $value + */ + public function setTenders(?array $value = null): self + { + $this->tenders = $value; + return $this; + } + + /** + * @return ?array + */ + public function getRefunds(): ?array + { + return $this->refunds; + } + + /** + * @param ?array $value + */ + public function setRefunds(?array $value = null): self + { + $this->refunds = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReferenceId(): ?string + { + return $this->referenceId; + } + + /** + * @param ?string $value + */ + public function setReferenceId(?string $value = null): self + { + $this->referenceId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getProduct(): ?string + { + return $this->product; + } + + /** + * @param ?value-of $value + */ + public function setProduct(?string $value = null): self + { + $this->product = $value; + return $this; + } + + /** + * @return ?string + */ + public function getClientId(): ?string + { + return $this->clientId; + } + + /** + * @param ?string $value + */ + public function setClientId(?string $value = null): self + { + $this->clientId = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getShippingAddress(): ?Address + { + return $this->shippingAddress; + } + + /** + * @param ?Address $value + */ + public function setShippingAddress(?Address $value = null): self + { + $this->shippingAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getOrderId(): ?string + { + return $this->orderId; + } + + /** + * @param ?string $value + */ + public function setOrderId(?string $value = null): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TransactionProduct.php b/src/Types/TransactionProduct.php new file mode 100644 index 00000000..3b24c7b6 --- /dev/null +++ b/src/Types/TransactionProduct.php @@ -0,0 +1,15 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The gift card with the ID of the unlinked customer removed from the `customer_ids` field. + * If no other customers are linked, the `customer_ids` field is also removed. + * + * @var ?GiftCard $giftCard + */ + #[JsonProperty('gift_card')] + private ?GiftCard $giftCard; + + /** + * @param array{ + * errors?: ?array, + * giftCard?: ?GiftCard, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->giftCard = $values['giftCard'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?GiftCard + */ + public function getGiftCard(): ?GiftCard + { + return $this->giftCard; + } + + /** + * @param ?GiftCard $value + */ + public function setGiftCard(?GiftCard $value = null): self + { + $this->giftCard = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateBookingCustomAttributeDefinitionResponse.php b/src/Types/UpdateBookingCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..36afc3aa --- /dev/null +++ b/src/Types/UpdateBookingCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateBookingResponse.php b/src/Types/UpdateBookingResponse.php new file mode 100644 index 00000000..474bca6d --- /dev/null +++ b/src/Types/UpdateBookingResponse.php @@ -0,0 +1,77 @@ + $errors Errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * booking?: ?Booking, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->booking = $values['booking'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Booking + */ + public function getBooking(): ?Booking + { + return $this->booking; + } + + /** + * @param ?Booking $value + */ + public function setBooking(?Booking $value = null): self + { + $this->booking = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateBreakTypeResponse.php b/src/Types/UpdateBreakTypeResponse.php new file mode 100644 index 00000000..bfc38e79 --- /dev/null +++ b/src/Types/UpdateBreakTypeResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * breakType?: ?BreakType, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->breakType = $values['breakType'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BreakType + */ + public function getBreakType(): ?BreakType + { + return $this->breakType; + } + + /** + * @param ?BreakType $value + */ + public function setBreakType(?BreakType $value = null): self + { + $this->breakType = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateCatalogImageRequest.php b/src/Types/UpdateCatalogImageRequest.php new file mode 100644 index 00000000..5793a687 --- /dev/null +++ b/src/Types/UpdateCatalogImageRequest.php @@ -0,0 +1,56 @@ +idempotencyKey = $values['idempotencyKey']; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateCatalogImageResponse.php b/src/Types/UpdateCatalogImageResponse.php new file mode 100644 index 00000000..32008f38 --- /dev/null +++ b/src/Types/UpdateCatalogImageResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * The newly updated `CatalogImage` including a Square-generated + * URL for the encapsulated image file. + * + * @var ?CatalogObject $image + */ + #[JsonProperty('image')] + private ?CatalogObject $image; + + /** + * @param array{ + * errors?: ?array, + * image?: ?CatalogObject, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->image = $values['image'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CatalogObject + */ + public function getImage(): ?CatalogObject + { + return $this->image; + } + + /** + * @param ?CatalogObject $value + */ + public function setImage(?CatalogObject $value = null): self + { + $this->image = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateCustomerCustomAttributeDefinitionResponse.php b/src/Types/UpdateCustomerCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..f601c3ab --- /dev/null +++ b/src/Types/UpdateCustomerCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateCustomerGroupResponse.php b/src/Types/UpdateCustomerGroupResponse.php new file mode 100644 index 00000000..eb19758b --- /dev/null +++ b/src/Types/UpdateCustomerGroupResponse.php @@ -0,0 +1,83 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CustomerGroup $group The successfully updated customer group. + */ + #[JsonProperty('group')] + private ?CustomerGroup $group; + + /** + * @param array{ + * errors?: ?array, + * group?: ?CustomerGroup, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->group = $values['group'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CustomerGroup + */ + public function getGroup(): ?CustomerGroup + { + return $this->group; + } + + /** + * @param ?CustomerGroup $value + */ + public function setGroup(?CustomerGroup $value = null): self + { + $this->group = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateCustomerResponse.php b/src/Types/UpdateCustomerResponse.php new file mode 100644 index 00000000..af344213 --- /dev/null +++ b/src/Types/UpdateCustomerResponse.php @@ -0,0 +1,84 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Customer $customer The updated customer. + */ + #[JsonProperty('customer')] + private ?Customer $customer; + + /** + * @param array{ + * errors?: ?array, + * customer?: ?Customer, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->customer = $values['customer'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Customer + */ + public function getCustomer(): ?Customer + { + return $this->customer; + } + + /** + * @param ?Customer $value + */ + public function setCustomer(?Customer $value = null): self + { + $this->customer = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateInvoiceResponse.php b/src/Types/UpdateInvoiceResponse.php new file mode 100644 index 00000000..98cd7578 --- /dev/null +++ b/src/Types/UpdateInvoiceResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * invoice?: ?Invoice, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->invoice = $values['invoice'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Invoice + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param ?Invoice $value + */ + public function setInvoice(?Invoice $value = null): self + { + $this->invoice = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateItemModifierListsResponse.php b/src/Types/UpdateItemModifierListsResponse.php new file mode 100644 index 00000000..5f87b666 --- /dev/null +++ b/src/Types/UpdateItemModifierListsResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $updatedAt The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * errors?: ?array, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateItemTaxesResponse.php b/src/Types/UpdateItemTaxesResponse.php new file mode 100644 index 00000000..c63f2f8b --- /dev/null +++ b/src/Types/UpdateItemTaxesResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $updatedAt The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * errors?: ?array, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateJobResponse.php b/src/Types/UpdateJobResponse.php new file mode 100644 index 00000000..8fce2546 --- /dev/null +++ b/src/Types/UpdateJobResponse.php @@ -0,0 +1,81 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * job?: ?Job, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->job = $values['job'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Job + */ + public function getJob(): ?Job + { + return $this->job; + } + + /** + * @param ?Job $value + */ + public function setJob(?Job $value = null): self + { + $this->job = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateLocationCustomAttributeDefinitionResponse.php b/src/Types/UpdateLocationCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..0e2710c8 --- /dev/null +++ b/src/Types/UpdateLocationCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateLocationResponse.php b/src/Types/UpdateLocationResponse.php new file mode 100644 index 00000000..149e976c --- /dev/null +++ b/src/Types/UpdateLocationResponse.php @@ -0,0 +1,80 @@ + $errors Information about errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Location $location The updated `Location` object. + */ + #[JsonProperty('location')] + private ?Location $location; + + /** + * @param array{ + * errors?: ?array, + * location?: ?Location, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->location = $values['location'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Location + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @param ?Location $value + */ + public function setLocation(?Location $value = null): self + { + $this->location = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateLocationSettingsResponse.php b/src/Types/UpdateLocationSettingsResponse.php new file mode 100644 index 00000000..7e3a8d04 --- /dev/null +++ b/src/Types/UpdateLocationSettingsResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred when updating the location settings. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CheckoutLocationSettings $locationSettings The updated location settings. + */ + #[JsonProperty('location_settings')] + private ?CheckoutLocationSettings $locationSettings; + + /** + * @param array{ + * errors?: ?array, + * locationSettings?: ?CheckoutLocationSettings, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->locationSettings = $values['locationSettings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CheckoutLocationSettings + */ + public function getLocationSettings(): ?CheckoutLocationSettings + { + return $this->locationSettings; + } + + /** + * @param ?CheckoutLocationSettings $value + */ + public function setLocationSettings(?CheckoutLocationSettings $value = null): self + { + $this->locationSettings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateMerchantCustomAttributeDefinitionResponse.php b/src/Types/UpdateMerchantCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..8eb9588f --- /dev/null +++ b/src/Types/UpdateMerchantCustomAttributeDefinitionResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateMerchantSettingsResponse.php b/src/Types/UpdateMerchantSettingsResponse.php new file mode 100644 index 00000000..c2f6a45a --- /dev/null +++ b/src/Types/UpdateMerchantSettingsResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred when updating the merchant settings. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CheckoutMerchantSettings $merchantSettings The updated merchant settings. + */ + #[JsonProperty('merchant_settings')] + private ?CheckoutMerchantSettings $merchantSettings; + + /** + * @param array{ + * errors?: ?array, + * merchantSettings?: ?CheckoutMerchantSettings, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->merchantSettings = $values['merchantSettings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CheckoutMerchantSettings + */ + public function getMerchantSettings(): ?CheckoutMerchantSettings + { + return $this->merchantSettings; + } + + /** + * @param ?CheckoutMerchantSettings $value + */ + public function setMerchantSettings(?CheckoutMerchantSettings $value = null): self + { + $this->merchantSettings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateOrderCustomAttributeDefinitionResponse.php b/src/Types/UpdateOrderCustomAttributeDefinitionResponse.php new file mode 100644 index 00000000..c87be21f --- /dev/null +++ b/src/Types/UpdateOrderCustomAttributeDefinitionResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttributeDefinition?: ?CustomAttributeDefinition, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttributeDefinition = $values['customAttributeDefinition'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttributeDefinition + */ + public function getCustomAttributeDefinition(): ?CustomAttributeDefinition + { + return $this->customAttributeDefinition; + } + + /** + * @param ?CustomAttributeDefinition $value + */ + public function setCustomAttributeDefinition(?CustomAttributeDefinition $value = null): self + { + $this->customAttributeDefinition = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateOrderResponse.php b/src/Types/UpdateOrderResponse.php new file mode 100644 index 00000000..937660af --- /dev/null +++ b/src/Types/UpdateOrderResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * order?: ?Order, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->order = $values['order'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Order + */ + public function getOrder(): ?Order + { + return $this->order; + } + + /** + * @param ?Order $value + */ + public function setOrder(?Order $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdatePaymentLinkResponse.php b/src/Types/UpdatePaymentLinkResponse.php new file mode 100644 index 00000000..79f52bcc --- /dev/null +++ b/src/Types/UpdatePaymentLinkResponse.php @@ -0,0 +1,77 @@ + $errors Any errors that occurred when updating the payment link. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?PaymentLink $paymentLink The updated payment link. + */ + #[JsonProperty('payment_link')] + private ?PaymentLink $paymentLink; + + /** + * @param array{ + * errors?: ?array, + * paymentLink?: ?PaymentLink, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->paymentLink = $values['paymentLink'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?PaymentLink + */ + public function getPaymentLink(): ?PaymentLink + { + return $this->paymentLink; + } + + /** + * @param ?PaymentLink $value + */ + public function setPaymentLink(?PaymentLink $value = null): self + { + $this->paymentLink = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdatePaymentResponse.php b/src/Types/UpdatePaymentResponse.php new file mode 100644 index 00000000..15fc9718 --- /dev/null +++ b/src/Types/UpdatePaymentResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Payment $payment The updated payment. + */ + #[JsonProperty('payment')] + private ?Payment $payment; + + /** + * @param array{ + * errors?: ?array, + * payment?: ?Payment, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->payment = $values['payment'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Payment + */ + public function getPayment(): ?Payment + { + return $this->payment; + } + + /** + * @param ?Payment $value + */ + public function setPayment(?Payment $value = null): self + { + $this->payment = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateShiftResponse.php b/src/Types/UpdateShiftResponse.php new file mode 100644 index 00000000..3091ed7c --- /dev/null +++ b/src/Types/UpdateShiftResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * shift?: ?Shift, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->shift = $values['shift'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?Shift + */ + public function getShift(): ?Shift + { + return $this->shift; + } + + /** + * @param ?Shift $value + */ + public function setShift(?Shift $value = null): self + { + $this->shift = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateSubscriptionResponse.php b/src/Types/UpdateSubscriptionResponse.php new file mode 100644 index 00000000..190c4214 --- /dev/null +++ b/src/Types/UpdateSubscriptionResponse.php @@ -0,0 +1,81 @@ + $errors Errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Subscription $subscription The updated subscription. + */ + #[JsonProperty('subscription')] + private ?Subscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?Subscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Subscription + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * @param ?Subscription $value + */ + public function setSubscription(?Subscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateTeamMemberRequest.php b/src/Types/UpdateTeamMemberRequest.php new file mode 100644 index 00000000..7a65daa2 --- /dev/null +++ b/src/Types/UpdateTeamMemberRequest.php @@ -0,0 +1,58 @@ +teamMember = $values['teamMember'] ?? null; + } + + /** + * @return ?TeamMember + */ + public function getTeamMember(): ?TeamMember + { + return $this->teamMember; + } + + /** + * @param ?TeamMember $value + */ + public function setTeamMember(?TeamMember $value = null): self + { + $this->teamMember = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateTeamMemberResponse.php b/src/Types/UpdateTeamMemberResponse.php new file mode 100644 index 00000000..4b49978b --- /dev/null +++ b/src/Types/UpdateTeamMemberResponse.php @@ -0,0 +1,80 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * teamMember?: ?TeamMember, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMember = $values['teamMember'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?TeamMember + */ + public function getTeamMember(): ?TeamMember + { + return $this->teamMember; + } + + /** + * @param ?TeamMember $value + */ + public function setTeamMember(?TeamMember $value = null): self + { + $this->teamMember = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateVendorRequest.php b/src/Types/UpdateVendorRequest.php new file mode 100644 index 00000000..c9bcc7c2 --- /dev/null +++ b/src/Types/UpdateVendorRequest.php @@ -0,0 +1,86 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->vendor = $values['vendor']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return Vendor + */ + public function getVendor(): Vendor + { + return $this->vendor; + } + + /** + * @param Vendor $value + */ + public function setVendor(Vendor $value): self + { + $this->vendor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateVendorResponse.php b/src/Types/UpdateVendorResponse.php new file mode 100644 index 00000000..c9b2a860 --- /dev/null +++ b/src/Types/UpdateVendorResponse.php @@ -0,0 +1,80 @@ + $errors Errors occurred when the request fails. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Vendor $vendor The [Vendor](entity:Vendor) that has been updated. + */ + #[JsonProperty('vendor')] + private ?Vendor $vendor; + + /** + * @param array{ + * errors?: ?array, + * vendor?: ?Vendor, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->vendor = $values['vendor'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Vendor + */ + public function getVendor(): ?Vendor + { + return $this->vendor; + } + + /** + * @param ?Vendor $value + */ + public function setVendor(?Vendor $value = null): self + { + $this->vendor = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateWageSettingResponse.php b/src/Types/UpdateWageSettingResponse.php new file mode 100644 index 00000000..e8a3582b --- /dev/null +++ b/src/Types/UpdateWageSettingResponse.php @@ -0,0 +1,81 @@ + $errors The errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * wageSetting?: ?WageSetting, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->wageSetting = $values['wageSetting'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?WageSetting + */ + public function getWageSetting(): ?WageSetting + { + return $this->wageSetting; + } + + /** + * @param ?WageSetting $value + */ + public function setWageSetting(?WageSetting $value = null): self + { + $this->wageSetting = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateWebhookSubscriptionResponse.php b/src/Types/UpdateWebhookSubscriptionResponse.php new file mode 100644 index 00000000..a2b3ce08 --- /dev/null +++ b/src/Types/UpdateWebhookSubscriptionResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?WebhookSubscription $subscription The updated [Subscription](entity:WebhookSubscription). + */ + #[JsonProperty('subscription')] + private ?WebhookSubscription $subscription; + + /** + * @param array{ + * errors?: ?array, + * subscription?: ?WebhookSubscription, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?WebhookSubscription + */ + public function getSubscription(): ?WebhookSubscription + { + return $this->subscription; + } + + /** + * @param ?WebhookSubscription $value + */ + public function setSubscription(?WebhookSubscription $value = null): self + { + $this->subscription = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateWebhookSubscriptionSignatureKeyResponse.php b/src/Types/UpdateWebhookSubscriptionSignatureKeyResponse.php new file mode 100644 index 00000000..dc14ac8f --- /dev/null +++ b/src/Types/UpdateWebhookSubscriptionSignatureKeyResponse.php @@ -0,0 +1,84 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $signatureKey The new Square-generated signature key used to validate the origin of the webhook event. + */ + #[JsonProperty('signature_key')] + private ?string $signatureKey; + + /** + * @param array{ + * errors?: ?array, + * signatureKey?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->signatureKey = $values['signatureKey'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSignatureKey(): ?string + { + return $this->signatureKey; + } + + /** + * @param ?string $value + */ + public function setSignatureKey(?string $value = null): self + { + $this->signatureKey = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpdateWorkweekConfigResponse.php b/src/Types/UpdateWorkweekConfigResponse.php new file mode 100644 index 00000000..7de52897 --- /dev/null +++ b/src/Types/UpdateWorkweekConfigResponse.php @@ -0,0 +1,82 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * workweekConfig?: ?WorkweekConfig, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->workweekConfig = $values['workweekConfig'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?WorkweekConfig + */ + public function getWorkweekConfig(): ?WorkweekConfig + { + return $this->workweekConfig; + } + + /** + * @param ?WorkweekConfig $value + */ + public function setWorkweekConfig(?WorkweekConfig $value = null): self + { + $this->workweekConfig = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertBookingCustomAttributeResponse.php b/src/Types/UpsertBookingCustomAttributeResponse.php new file mode 100644 index 00000000..9282514a --- /dev/null +++ b/src/Types/UpsertBookingCustomAttributeResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertCatalogObjectResponse.php b/src/Types/UpsertCatalogObjectResponse.php new file mode 100644 index 00000000..0ca272e9 --- /dev/null +++ b/src/Types/UpsertCatalogObjectResponse.php @@ -0,0 +1,102 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?CatalogObject $catalogObject The successfully created or updated CatalogObject. + */ + #[JsonProperty('catalog_object')] + private ?CatalogObject $catalogObject; + + /** + * @var ?array $idMappings The mapping between client and server IDs for this upsert. + */ + #[JsonProperty('id_mappings'), ArrayType([CatalogIdMapping::class])] + private ?array $idMappings; + + /** + * @param array{ + * errors?: ?array, + * catalogObject?: ?CatalogObject, + * idMappings?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->catalogObject = $values['catalogObject'] ?? null; + $this->idMappings = $values['idMappings'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?CatalogObject + */ + public function getCatalogObject(): ?CatalogObject + { + return $this->catalogObject; + } + + /** + * @param ?CatalogObject $value + */ + public function setCatalogObject(?CatalogObject $value = null): self + { + $this->catalogObject = $value; + return $this; + } + + /** + * @return ?array + */ + public function getIdMappings(): ?array + { + return $this->idMappings; + } + + /** + * @param ?array $value + */ + public function setIdMappings(?array $value = null): self + { + $this->idMappings = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertCustomerCustomAttributeResponse.php b/src/Types/UpsertCustomerCustomAttributeResponse.php new file mode 100644 index 00000000..0ec9a1af --- /dev/null +++ b/src/Types/UpsertCustomerCustomAttributeResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertLocationCustomAttributeResponse.php b/src/Types/UpsertLocationCustomAttributeResponse.php new file mode 100644 index 00000000..c17374b6 --- /dev/null +++ b/src/Types/UpsertLocationCustomAttributeResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertMerchantCustomAttributeResponse.php b/src/Types/UpsertMerchantCustomAttributeResponse.php new file mode 100644 index 00000000..a4e44509 --- /dev/null +++ b/src/Types/UpsertMerchantCustomAttributeResponse.php @@ -0,0 +1,81 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertOrderCustomAttributeResponse.php b/src/Types/UpsertOrderCustomAttributeResponse.php new file mode 100644 index 00000000..a2f3c080 --- /dev/null +++ b/src/Types/UpsertOrderCustomAttributeResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * customAttribute?: ?CustomAttribute, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->customAttribute = $values['customAttribute'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?CustomAttribute + */ + public function getCustomAttribute(): ?CustomAttribute + { + return $this->customAttribute; + } + + /** + * @param ?CustomAttribute $value + */ + public function setCustomAttribute(?CustomAttribute $value = null): self + { + $this->customAttribute = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/UpsertSnippetResponse.php b/src/Types/UpsertSnippetResponse.php new file mode 100644 index 00000000..271220cf --- /dev/null +++ b/src/Types/UpsertSnippetResponse.php @@ -0,0 +1,80 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?Snippet $snippet The new or updated snippet. + */ + #[JsonProperty('snippet')] + private ?Snippet $snippet; + + /** + * @param array{ + * errors?: ?array, + * snippet?: ?Snippet, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->snippet = $values['snippet'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?Snippet + */ + public function getSnippet(): ?Snippet + { + return $this->snippet; + } + + /** + * @param ?Snippet $value + */ + public function setSnippet(?Snippet $value = null): self + { + $this->snippet = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/V1Money.php b/src/Types/V1Money.php new file mode 100644 index 00000000..048a2254 --- /dev/null +++ b/src/Types/V1Money.php @@ -0,0 +1,82 @@ + $currencyCode + */ + #[JsonProperty('currency_code')] + private ?string $currencyCode; + + /** + * @param array{ + * amount?: ?int, + * currencyCode?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->amount = $values['amount'] ?? null; + $this->currencyCode = $values['currencyCode'] ?? null; + } + + /** + * @return ?int + */ + public function getAmount(): ?int + { + return $this->amount; + } + + /** + * @param ?int $value + */ + public function setAmount(?int $value = null): self + { + $this->amount = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCurrencyCode(): ?string + { + return $this->currencyCode; + } + + /** + * @param ?value-of $value + */ + public function setCurrencyCode(?string $value = null): self + { + $this->currencyCode = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/V1Order.php b/src/Types/V1Order.php new file mode 100644 index 00000000..b8c36dec --- /dev/null +++ b/src/Types/V1Order.php @@ -0,0 +1,658 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @var ?string $id The order's unique identifier. + */ + #[JsonProperty('id')] + private ?string $id; + + /** + * @var ?string $buyerEmail The email address of the order's buyer. + */ + #[JsonProperty('buyer_email')] + private ?string $buyerEmail; + + /** + * @var ?string $recipientName The name of the order's buyer. + */ + #[JsonProperty('recipient_name')] + private ?string $recipientName; + + /** + * @var ?string $recipientPhoneNumber The phone number to use for the order's delivery. + */ + #[JsonProperty('recipient_phone_number')] + private ?string $recipientPhoneNumber; + + /** + * Whether the tax is an ADDITIVE tax or an INCLUSIVE tax. + * See [V1OrderState](#type-v1orderstate) for possible values + * + * @var ?value-of $state + */ + #[JsonProperty('state')] + private ?string $state; + + /** + * @var ?Address $shippingAddress The address to ship the order to. + */ + #[JsonProperty('shipping_address')] + private ?Address $shippingAddress; + + /** + * @var ?V1Money $subtotalMoney The amount of all items purchased in the order, before taxes and shipping. + */ + #[JsonProperty('subtotal_money')] + private ?V1Money $subtotalMoney; + + /** + * @var ?V1Money $totalShippingMoney The shipping cost for the order. + */ + #[JsonProperty('total_shipping_money')] + private ?V1Money $totalShippingMoney; + + /** + * @var ?V1Money $totalTaxMoney The total of all taxes applied to the order. + */ + #[JsonProperty('total_tax_money')] + private ?V1Money $totalTaxMoney; + + /** + * @var ?V1Money $totalPriceMoney The total cost of the order. + */ + #[JsonProperty('total_price_money')] + private ?V1Money $totalPriceMoney; + + /** + * @var ?V1Money $totalDiscountMoney The total of all discounts applied to the order. + */ + #[JsonProperty('total_discount_money')] + private ?V1Money $totalDiscountMoney; + + /** + * @var ?string $createdAt The time when the order was created, in ISO 8601 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The time when the order was last modified, in ISO 8601 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @var ?string $expiresAt The time when the order expires if no action is taken, in ISO 8601 format. + */ + #[JsonProperty('expires_at')] + private ?string $expiresAt; + + /** + * @var ?string $paymentId The unique identifier of the payment associated with the order. + */ + #[JsonProperty('payment_id')] + private ?string $paymentId; + + /** + * @var ?string $buyerNote A note provided by the buyer when the order was created, if any. + */ + #[JsonProperty('buyer_note')] + private ?string $buyerNote; + + /** + * @var ?string $completedNote A note provided by the merchant when the order's state was set to COMPLETED, if any + */ + #[JsonProperty('completed_note')] + private ?string $completedNote; + + /** + * @var ?string $refundedNote A note provided by the merchant when the order's state was set to REFUNDED, if any. + */ + #[JsonProperty('refunded_note')] + private ?string $refundedNote; + + /** + * @var ?string $canceledNote A note provided by the merchant when the order's state was set to CANCELED, if any. + */ + #[JsonProperty('canceled_note')] + private ?string $canceledNote; + + /** + * @var ?V1Tender $tender The tender used to pay for the order. + */ + #[JsonProperty('tender')] + private ?V1Tender $tender; + + /** + * @var ?array $orderHistory The history of actions associated with the order. + */ + #[JsonProperty('order_history'), ArrayType([V1OrderHistoryEntry::class])] + private ?array $orderHistory; + + /** + * @var ?string $promoCode The promo code provided by the buyer, if any. + */ + #[JsonProperty('promo_code')] + private ?string $promoCode; + + /** + * @var ?string $btcReceiveAddress For Bitcoin transactions, the address that the buyer sent Bitcoin to. + */ + #[JsonProperty('btc_receive_address')] + private ?string $btcReceiveAddress; + + /** + * @var ?float $btcPriceSatoshi For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC). + */ + #[JsonProperty('btc_price_satoshi')] + private ?float $btcPriceSatoshi; + + /** + * @param array{ + * errors?: ?array, + * id?: ?string, + * buyerEmail?: ?string, + * recipientName?: ?string, + * recipientPhoneNumber?: ?string, + * state?: ?value-of, + * shippingAddress?: ?Address, + * subtotalMoney?: ?V1Money, + * totalShippingMoney?: ?V1Money, + * totalTaxMoney?: ?V1Money, + * totalPriceMoney?: ?V1Money, + * totalDiscountMoney?: ?V1Money, + * createdAt?: ?string, + * updatedAt?: ?string, + * expiresAt?: ?string, + * paymentId?: ?string, + * buyerNote?: ?string, + * completedNote?: ?string, + * refundedNote?: ?string, + * canceledNote?: ?string, + * tender?: ?V1Tender, + * orderHistory?: ?array, + * promoCode?: ?string, + * btcReceiveAddress?: ?string, + * btcPriceSatoshi?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + $this->id = $values['id'] ?? null; + $this->buyerEmail = $values['buyerEmail'] ?? null; + $this->recipientName = $values['recipientName'] ?? null; + $this->recipientPhoneNumber = $values['recipientPhoneNumber'] ?? null; + $this->state = $values['state'] ?? null; + $this->shippingAddress = $values['shippingAddress'] ?? null; + $this->subtotalMoney = $values['subtotalMoney'] ?? null; + $this->totalShippingMoney = $values['totalShippingMoney'] ?? null; + $this->totalTaxMoney = $values['totalTaxMoney'] ?? null; + $this->totalPriceMoney = $values['totalPriceMoney'] ?? null; + $this->totalDiscountMoney = $values['totalDiscountMoney'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->paymentId = $values['paymentId'] ?? null; + $this->buyerNote = $values['buyerNote'] ?? null; + $this->completedNote = $values['completedNote'] ?? null; + $this->refundedNote = $values['refundedNote'] ?? null; + $this->canceledNote = $values['canceledNote'] ?? null; + $this->tender = $values['tender'] ?? null; + $this->orderHistory = $values['orderHistory'] ?? null; + $this->promoCode = $values['promoCode'] ?? null; + $this->btcReceiveAddress = $values['btcReceiveAddress'] ?? null; + $this->btcPriceSatoshi = $values['btcPriceSatoshi'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerEmail(): ?string + { + return $this->buyerEmail; + } + + /** + * @param ?string $value + */ + public function setBuyerEmail(?string $value = null): self + { + $this->buyerEmail = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRecipientName(): ?string + { + return $this->recipientName; + } + + /** + * @param ?string $value + */ + public function setRecipientName(?string $value = null): self + { + $this->recipientName = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRecipientPhoneNumber(): ?string + { + return $this->recipientPhoneNumber; + } + + /** + * @param ?string $value + */ + public function setRecipientPhoneNumber(?string $value = null): self + { + $this->recipientPhoneNumber = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * @param ?value-of $value + */ + public function setState(?string $value = null): self + { + $this->state = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getShippingAddress(): ?Address + { + return $this->shippingAddress; + } + + /** + * @param ?Address $value + */ + public function setShippingAddress(?Address $value = null): self + { + $this->shippingAddress = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getSubtotalMoney(): ?V1Money + { + return $this->subtotalMoney; + } + + /** + * @param ?V1Money $value + */ + public function setSubtotalMoney(?V1Money $value = null): self + { + $this->subtotalMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTotalShippingMoney(): ?V1Money + { + return $this->totalShippingMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTotalShippingMoney(?V1Money $value = null): self + { + $this->totalShippingMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTotalTaxMoney(): ?V1Money + { + return $this->totalTaxMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTotalTaxMoney(?V1Money $value = null): self + { + $this->totalTaxMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTotalPriceMoney(): ?V1Money + { + return $this->totalPriceMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTotalPriceMoney(?V1Money $value = null): self + { + $this->totalPriceMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTotalDiscountMoney(): ?V1Money + { + return $this->totalDiscountMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTotalDiscountMoney(?V1Money $value = null): self + { + $this->totalDiscountMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getExpiresAt(): ?string + { + return $this->expiresAt; + } + + /** + * @param ?string $value + */ + public function setExpiresAt(?string $value = null): self + { + $this->expiresAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentId(): ?string + { + return $this->paymentId; + } + + /** + * @param ?string $value + */ + public function setPaymentId(?string $value = null): self + { + $this->paymentId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBuyerNote(): ?string + { + return $this->buyerNote; + } + + /** + * @param ?string $value + */ + public function setBuyerNote(?string $value = null): self + { + $this->buyerNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompletedNote(): ?string + { + return $this->completedNote; + } + + /** + * @param ?string $value + */ + public function setCompletedNote(?string $value = null): self + { + $this->completedNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundedNote(): ?string + { + return $this->refundedNote; + } + + /** + * @param ?string $value + */ + public function setRefundedNote(?string $value = null): self + { + $this->refundedNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledNote(): ?string + { + return $this->canceledNote; + } + + /** + * @param ?string $value + */ + public function setCanceledNote(?string $value = null): self + { + $this->canceledNote = $value; + return $this; + } + + /** + * @return ?V1Tender + */ + public function getTender(): ?V1Tender + { + return $this->tender; + } + + /** + * @param ?V1Tender $value + */ + public function setTender(?V1Tender $value = null): self + { + $this->tender = $value; + return $this; + } + + /** + * @return ?array + */ + public function getOrderHistory(): ?array + { + return $this->orderHistory; + } + + /** + * @param ?array $value + */ + public function setOrderHistory(?array $value = null): self + { + $this->orderHistory = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPromoCode(): ?string + { + return $this->promoCode; + } + + /** + * @param ?string $value + */ + public function setPromoCode(?string $value = null): self + { + $this->promoCode = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBtcReceiveAddress(): ?string + { + return $this->btcReceiveAddress; + } + + /** + * @param ?string $value + */ + public function setBtcReceiveAddress(?string $value = null): self + { + $this->btcReceiveAddress = $value; + return $this; + } + + /** + * @return ?float + */ + public function getBtcPriceSatoshi(): ?float + { + return $this->btcPriceSatoshi; + } + + /** + * @param ?float $value + */ + public function setBtcPriceSatoshi(?float $value = null): self + { + $this->btcPriceSatoshi = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/V1OrderHistoryEntry.php b/src/Types/V1OrderHistoryEntry.php new file mode 100644 index 00000000..f0585c29 --- /dev/null +++ b/src/Types/V1OrderHistoryEntry.php @@ -0,0 +1,82 @@ + $action + */ + #[JsonProperty('action')] + private ?string $action; + + /** + * @var ?string $createdAt The time when the action was performed, in ISO 8601 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @param array{ + * action?: ?value-of, + * createdAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->action = $values['action'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + } + + /** + * @return ?value-of + */ + public function getAction(): ?string + { + return $this->action; + } + + /** + * @param ?value-of $value + */ + public function setAction(?string $value = null): self + { + $this->action = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/V1OrderHistoryEntryAction.php b/src/Types/V1OrderHistoryEntryAction.php new file mode 100644 index 00000000..55565ba4 --- /dev/null +++ b/src/Types/V1OrderHistoryEntryAction.php @@ -0,0 +1,14 @@ + $type + */ + #[JsonProperty('type')] + private ?string $type; + + /** + * @var ?string $name A human-readable description of the tender. + */ + #[JsonProperty('name')] + private ?string $name; + + /** + * @var ?string $employeeId The ID of the employee that processed the tender. + */ + #[JsonProperty('employee_id')] + private ?string $employeeId; + + /** + * @var ?string $receiptUrl The URL of the receipt for the tender. + */ + #[JsonProperty('receipt_url')] + private ?string $receiptUrl; + + /** + * The brand of credit card provided. + * See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values + * + * @var ?value-of $cardBrand + */ + #[JsonProperty('card_brand')] + private ?string $cardBrand; + + /** + * @var ?string $panSuffix The last four digits of the provided credit card's account number. + */ + #[JsonProperty('pan_suffix')] + private ?string $panSuffix; + + /** + * The tender's unique ID. + * See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values + * + * @var ?value-of $entryMethod + */ + #[JsonProperty('entry_method')] + private ?string $entryMethod; + + /** + * @var ?string $paymentNote Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER. + */ + #[JsonProperty('payment_note')] + private ?string $paymentNote; + + /** + * @var ?V1Money $totalMoney The total amount of money provided in this form of tender. + */ + #[JsonProperty('total_money')] + private ?V1Money $totalMoney; + + /** + * @var ?V1Money $tenderedMoney The amount of total_money applied to the payment. + */ + #[JsonProperty('tendered_money')] + private ?V1Money $tenderedMoney; + + /** + * @var ?string $tenderedAt The time when the tender was created, in ISO 8601 format. + */ + #[JsonProperty('tendered_at')] + private ?string $tenderedAt; + + /** + * @var ?string $settledAt The time when the tender was settled, in ISO 8601 format. + */ + #[JsonProperty('settled_at')] + private ?string $settledAt; + + /** + * @var ?V1Money $changeBackMoney The amount of total_money returned to the buyer as change. + */ + #[JsonProperty('change_back_money')] + private ?V1Money $changeBackMoney; + + /** + * @var ?V1Money $refundedMoney The total of all refunds applied to this tender. This amount is always negative or zero. + */ + #[JsonProperty('refunded_money')] + private ?V1Money $refundedMoney; + + /** + * @var ?bool $isExchange Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange. + */ + #[JsonProperty('is_exchange')] + private ?bool $isExchange; + + /** + * @param array{ + * id?: ?string, + * type?: ?value-of, + * name?: ?string, + * employeeId?: ?string, + * receiptUrl?: ?string, + * cardBrand?: ?value-of, + * panSuffix?: ?string, + * entryMethod?: ?value-of, + * paymentNote?: ?string, + * totalMoney?: ?V1Money, + * tenderedMoney?: ?V1Money, + * tenderedAt?: ?string, + * settledAt?: ?string, + * changeBackMoney?: ?V1Money, + * refundedMoney?: ?V1Money, + * isExchange?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->type = $values['type'] ?? null; + $this->name = $values['name'] ?? null; + $this->employeeId = $values['employeeId'] ?? null; + $this->receiptUrl = $values['receiptUrl'] ?? null; + $this->cardBrand = $values['cardBrand'] ?? null; + $this->panSuffix = $values['panSuffix'] ?? null; + $this->entryMethod = $values['entryMethod'] ?? null; + $this->paymentNote = $values['paymentNote'] ?? null; + $this->totalMoney = $values['totalMoney'] ?? null; + $this->tenderedMoney = $values['tenderedMoney'] ?? null; + $this->tenderedAt = $values['tenderedAt'] ?? null; + $this->settledAt = $values['settledAt'] ?? null; + $this->changeBackMoney = $values['changeBackMoney'] ?? null; + $this->refundedMoney = $values['refundedMoney'] ?? null; + $this->isExchange = $values['isExchange'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmployeeId(): ?string + { + return $this->employeeId; + } + + /** + * @param ?string $value + */ + public function setEmployeeId(?string $value = null): self + { + $this->employeeId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getReceiptUrl(): ?string + { + return $this->receiptUrl; + } + + /** + * @param ?string $value + */ + public function setReceiptUrl(?string $value = null): self + { + $this->receiptUrl = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getCardBrand(): ?string + { + return $this->cardBrand; + } + + /** + * @param ?value-of $value + */ + public function setCardBrand(?string $value = null): self + { + $this->cardBrand = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPanSuffix(): ?string + { + return $this->panSuffix; + } + + /** + * @param ?string $value + */ + public function setPanSuffix(?string $value = null): self + { + $this->panSuffix = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getEntryMethod(): ?string + { + return $this->entryMethod; + } + + /** + * @param ?value-of $value + */ + public function setEntryMethod(?string $value = null): self + { + $this->entryMethod = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPaymentNote(): ?string + { + return $this->paymentNote; + } + + /** + * @param ?string $value + */ + public function setPaymentNote(?string $value = null): self + { + $this->paymentNote = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTotalMoney(): ?V1Money + { + return $this->totalMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTotalMoney(?V1Money $value = null): self + { + $this->totalMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getTenderedMoney(): ?V1Money + { + return $this->tenderedMoney; + } + + /** + * @param ?V1Money $value + */ + public function setTenderedMoney(?V1Money $value = null): self + { + $this->tenderedMoney = $value; + return $this; + } + + /** + * @return ?string + */ + public function getTenderedAt(): ?string + { + return $this->tenderedAt; + } + + /** + * @param ?string $value + */ + public function setTenderedAt(?string $value = null): self + { + $this->tenderedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSettledAt(): ?string + { + return $this->settledAt; + } + + /** + * @param ?string $value + */ + public function setSettledAt(?string $value = null): self + { + $this->settledAt = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getChangeBackMoney(): ?V1Money + { + return $this->changeBackMoney; + } + + /** + * @param ?V1Money $value + */ + public function setChangeBackMoney(?V1Money $value = null): self + { + $this->changeBackMoney = $value; + return $this; + } + + /** + * @return ?V1Money + */ + public function getRefundedMoney(): ?V1Money + { + return $this->refundedMoney; + } + + /** + * @param ?V1Money $value + */ + public function setRefundedMoney(?V1Money $value = null): self + { + $this->refundedMoney = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsExchange(): ?bool + { + return $this->isExchange; + } + + /** + * @param ?bool $value + */ + public function setIsExchange(?bool $value = null): self + { + $this->isExchange = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/V1TenderCardBrand.php b/src/Types/V1TenderCardBrand.php new file mode 100644 index 00000000..233bdcb0 --- /dev/null +++ b/src/Types/V1TenderCardBrand.php @@ -0,0 +1,16 @@ + $contacts The contacts of the [Vendor](entity:Vendor). + */ + #[JsonProperty('contacts'), ArrayType([VendorContact::class])] + private ?array $contacts; + + /** + * @var ?string $accountNumber The account number of the [Vendor](entity:Vendor). + */ + #[JsonProperty('account_number')] + private ?string $accountNumber; + + /** + * @var ?string $note A note detailing information about the [Vendor](entity:Vendor). + */ + #[JsonProperty('note')] + private ?string $note; + + /** + * @var ?int $version The version of the [Vendor](entity:Vendor). + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * The status of the [Vendor](entity:Vendor). + * See [Status](#type-status) for possible values + * + * @var ?value-of $status + */ + #[JsonProperty('status')] + private ?string $status; + + /** + * @param array{ + * id?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * name?: ?string, + * address?: ?Address, + * contacts?: ?array, + * accountNumber?: ?string, + * note?: ?string, + * version?: ?int, + * status?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + $this->name = $values['name'] ?? null; + $this->address = $values['address'] ?? null; + $this->contacts = $values['contacts'] ?? null; + $this->accountNumber = $values['accountNumber'] ?? null; + $this->note = $values['note'] ?? null; + $this->version = $values['version'] ?? null; + $this->status = $values['status'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?Address + */ + public function getAddress(): ?Address + { + return $this->address; + } + + /** + * @param ?Address $value + */ + public function setAddress(?Address $value = null): self + { + $this->address = $value; + return $this; + } + + /** + * @return ?array + */ + public function getContacts(): ?array + { + return $this->contacts; + } + + /** + * @param ?array $value + */ + public function setContacts(?array $value = null): self + { + $this->contacts = $value; + return $this; + } + + /** + * @return ?string + */ + public function getAccountNumber(): ?string + { + return $this->accountNumber; + } + + /** + * @param ?string $value + */ + public function setAccountNumber(?string $value = null): self + { + $this->accountNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNote(): ?string + { + return $this->note; + } + + /** + * @param ?string $value + */ + public function setNote(?string $value = null): self + { + $this->note = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * @param ?value-of $value + */ + public function setStatus(?string $value = null): self + { + $this->status = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/VendorContact.php b/src/Types/VendorContact.php new file mode 100644 index 00000000..340c463e --- /dev/null +++ b/src/Types/VendorContact.php @@ -0,0 +1,185 @@ +id = $values['id'] ?? null; + $this->name = $values['name'] ?? null; + $this->emailAddress = $values['emailAddress'] ?? null; + $this->phoneNumber = $values['phoneNumber'] ?? null; + $this->removed = $values['removed'] ?? null; + $this->ordinal = $values['ordinal']; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEmailAddress(): ?string + { + return $this->emailAddress; + } + + /** + * @param ?string $value + */ + public function setEmailAddress(?string $value = null): self + { + $this->emailAddress = $value; + return $this; + } + + /** + * @return ?string + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param ?string $value + */ + public function setPhoneNumber(?string $value = null): self + { + $this->phoneNumber = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getRemoved(): ?bool + { + return $this->removed; + } + + /** + * @param ?bool $value + */ + public function setRemoved(?bool $value = null): self + { + $this->removed = $value; + return $this; + } + + /** + * @return int + */ + public function getOrdinal(): int + { + return $this->ordinal; + } + + /** + * @param int $value + */ + public function setOrdinal(int $value): self + { + $this->ordinal = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/VendorStatus.php b/src/Types/VendorStatus.php new file mode 100644 index 00000000..988b99e6 --- /dev/null +++ b/src/Types/VendorStatus.php @@ -0,0 +1,9 @@ + $errors Any errors that occurred during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WageSetting.php b/src/Types/WageSetting.php new file mode 100644 index 00000000..25947960 --- /dev/null +++ b/src/Types/WageSetting.php @@ -0,0 +1,189 @@ + $jobAssignments + */ + #[JsonProperty('job_assignments'), ArrayType([JobAssignment::class])] + private ?array $jobAssignments; + + /** + * @var ?bool $isOvertimeExempt Whether the team member is exempt from the overtime rules of the seller's country. + */ + #[JsonProperty('is_overtime_exempt')] + private ?bool $isOvertimeExempt; + + /** + * **Read only** Used for resolving concurrency issues. The request fails if the version + * provided does not match the server version at the time of the request. If not provided, + * Square executes a blind write, potentially overwriting data from another write. For more information, + * see [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency). + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?string $createdAt The timestamp when the wage setting was created, in RFC 3339 format. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt The timestamp when the wage setting was last updated, in RFC 3339 format. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * teamMemberId?: ?string, + * jobAssignments?: ?array, + * isOvertimeExempt?: ?bool, + * version?: ?int, + * createdAt?: ?string, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->teamMemberId = $values['teamMemberId'] ?? null; + $this->jobAssignments = $values['jobAssignments'] ?? null; + $this->isOvertimeExempt = $values['isOvertimeExempt'] ?? null; + $this->version = $values['version'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getTeamMemberId(): ?string + { + return $this->teamMemberId; + } + + /** + * @param ?string $value + */ + public function setTeamMemberId(?string $value = null): self + { + $this->teamMemberId = $value; + return $this; + } + + /** + * @return ?array + */ + public function getJobAssignments(): ?array + { + return $this->jobAssignments; + } + + /** + * @param ?array $value + */ + public function setJobAssignments(?array $value = null): self + { + $this->jobAssignments = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIsOvertimeExempt(): ?bool + { + return $this->isOvertimeExempt; + } + + /** + * @param ?bool $value + */ + public function setIsOvertimeExempt(?bool $value = null): self + { + $this->isOvertimeExempt = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WebhookSubscription.php b/src/Types/WebhookSubscription.php new file mode 100644 index 00000000..0449ceed --- /dev/null +++ b/src/Types/WebhookSubscription.php @@ -0,0 +1,263 @@ + $eventTypes The event types associated with this subscription. + */ + #[JsonProperty('event_types'), ArrayType(['string'])] + private ?array $eventTypes; + + /** + * @var ?string $notificationUrl The URL to which webhooks are sent. + */ + #[JsonProperty('notification_url')] + private ?string $notificationUrl; + + /** + * The API version of the subscription. + * This field is optional for `CreateWebhookSubscription`. + * The value defaults to the API version used by the application. + * + * @var ?string $apiVersion + */ + #[JsonProperty('api_version')] + private ?string $apiVersion; + + /** + * @var ?string $signatureKey The Square-generated signature key used to validate the origin of the webhook event. + */ + #[JsonProperty('signature_key')] + private ?string $signatureKey; + + /** + * @var ?string $createdAt The timestamp of when the subscription was created, in RFC 3339 format. For example, "2016-09-04T23:59:33.123Z". + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * The timestamp of when the subscription was last updated, in RFC 3339 format. + * For example, "2016-09-04T23:59:33.123Z". + * + * @var ?string $updatedAt + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * id?: ?string, + * name?: ?string, + * enabled?: ?bool, + * eventTypes?: ?array, + * notificationUrl?: ?string, + * apiVersion?: ?string, + * signatureKey?: ?string, + * createdAt?: ?string, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->id = $values['id'] ?? null; + $this->name = $values['name'] ?? null; + $this->enabled = $values['enabled'] ?? null; + $this->eventTypes = $values['eventTypes'] ?? null; + $this->notificationUrl = $values['notificationUrl'] ?? null; + $this->apiVersion = $values['apiVersion'] ?? null; + $this->signatureKey = $values['signatureKey'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return ?string + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param ?string $value + */ + public function setName(?string $value = null): self + { + $this->name = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getEnabled(): ?bool + { + return $this->enabled; + } + + /** + * @param ?bool $value + */ + public function setEnabled(?bool $value = null): self + { + $this->enabled = $value; + return $this; + } + + /** + * @return ?array + */ + public function getEventTypes(): ?array + { + return $this->eventTypes; + } + + /** + * @param ?array $value + */ + public function setEventTypes(?array $value = null): self + { + $this->eventTypes = $value; + return $this; + } + + /** + * @return ?string + */ + public function getNotificationUrl(): ?string + { + return $this->notificationUrl; + } + + /** + * @param ?string $value + */ + public function setNotificationUrl(?string $value = null): self + { + $this->notificationUrl = $value; + return $this; + } + + /** + * @return ?string + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + + /** + * @param ?string $value + */ + public function setApiVersion(?string $value = null): self + { + $this->apiVersion = $value; + return $this; + } + + /** + * @return ?string + */ + public function getSignatureKey(): ?string + { + return $this->signatureKey; + } + + /** + * @param ?string $value + */ + public function setSignatureKey(?string $value = null): self + { + $this->signatureKey = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/Weekday.php b/src/Types/Weekday.php new file mode 100644 index 00000000..879e1283 --- /dev/null +++ b/src/Types/Weekday.php @@ -0,0 +1,14 @@ + $startOfWeek + */ + #[JsonProperty('start_of_week')] + private string $startOfWeek; + + /** + * The local time at which a business week starts. Represented as a + * string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are + * truncated). + * + * @var string $startOfDayLocalTime + */ + #[JsonProperty('start_of_day_local_time')] + private string $startOfDayLocalTime; + + /** + * Used for resolving concurrency issues. The request fails if the version + * provided does not match the server version at the time of the request. If not provided, + * Square executes a blind write; potentially overwriting data from another + * write. + * + * @var ?int $version + */ + #[JsonProperty('version')] + private ?int $version; + + /** + * @var ?string $createdAt A read-only timestamp in RFC 3339 format; presented in UTC. + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $updatedAt A read-only timestamp in RFC 3339 format; presented in UTC. + */ + #[JsonProperty('updated_at')] + private ?string $updatedAt; + + /** + * @param array{ + * startOfWeek: value-of, + * startOfDayLocalTime: string, + * id?: ?string, + * version?: ?int, + * createdAt?: ?string, + * updatedAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id'] ?? null; + $this->startOfWeek = $values['startOfWeek']; + $this->startOfDayLocalTime = $values['startOfDayLocalTime']; + $this->version = $values['version'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->updatedAt = $values['updatedAt'] ?? null; + } + + /** + * @return ?string + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * @param ?string $value + */ + public function setId(?string $value = null): self + { + $this->id = $value; + return $this; + } + + /** + * @return value-of + */ + public function getStartOfWeek(): string + { + return $this->startOfWeek; + } + + /** + * @param value-of $value + */ + public function setStartOfWeek(string $value): self + { + $this->startOfWeek = $value; + return $this; + } + + /** + * @return string + */ + public function getStartOfDayLocalTime(): string + { + return $this->startOfDayLocalTime; + } + + /** + * @param string $value + */ + public function setStartOfDayLocalTime(string $value): self + { + $this->startOfDayLocalTime = $value; + return $this; + } + + /** + * @return ?int + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * @param ?int $value + */ + public function setVersion(?int $value = null): self + { + $this->version = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * @param ?string $value + */ + public function setUpdatedAt(?string $value = null): self + { + $this->updatedAt = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Utils/CompatibilityConverter.php b/src/Utils/CompatibilityConverter.php deleted file mode 100644 index 5ae5ee50..00000000 --- a/src/Utils/CompatibilityConverter.php +++ /dev/null @@ -1,64 +0,0 @@ -createHttpResponse($response); - return new ApiException($message, $this->createHttpRequest($request), $response); - } - - public function createHttpContext(ContextInterface $context): HttpContext - { - return new HttpContext( - $this->createHttpRequest($context->getRequest()), - $this->createHttpResponse($context->getResponse()) - ); - } - - public function createHttpRequest(RequestInterface $request): HttpRequest - { - return new HttpRequest( - $request->getHttpMethod(), - $request->getHeaders(), - $request->getQueryUrl(), - $request->getParameters() - ); - } - - public function createHttpResponse(ResponseInterface $response): HttpResponse - { - return new HttpResponse($response->getStatusCode(), $response->getHeaders(), $response->getRawBody()); - } - - public function createApiResponse(ContextInterface $context, $deserializedBody): ApiResponse - { - return ApiResponse::createFromContext( - $context->getResponse()->getBody(), - $deserializedBody, - $this->createHttpContext($context) - ); - } - - public function createFileWrapper(string $realFilePath, ?string $mimeType, ?string $filename): FileWrapper - { - return FileWrapper::createFromPath($realFilePath, $mimeType, $filename); - } -} diff --git a/src/Utils/File.php b/src/Utils/File.php new file mode 100644 index 00000000..7cec0b37 --- /dev/null +++ b/src/Utils/File.php @@ -0,0 +1,125 @@ +filename = $filename; + $this->contentType = $contentType; + $this->stream = $stream; + } + + /** + * Creates a File instance from a filepath. + * + * @param string $filepath + * @param ?string $filename + * @param ?string $contentType + * @return File + * @throws Exception + */ + public static function createFromFilepath( + string $filepath, + ?string $filename = null, + ?string $contentType = null, + ): File { + $resource = fopen($filepath, 'r'); + if (!$resource) { + throw new Exception("Unable to open file $filepath"); + } + $stream = Utils::streamFor($resource); + if (!$stream->isReadable()) { + throw new Exception("File $filepath is not readable"); + } + return new self( + stream: $stream, + filename: $filename ?? basename($filepath), + contentType: $contentType, + ); + } + + /** + * Creates a File instance from a string. + * + * @param string $content + * @param ?string $filename + * @param ?string $contentType + * @return File + */ + public static function createFromString( + string $content, + ?string $filename, + ?string $contentType = null, + ): File { + return new self( + stream: Utils::streamFor($content), + filename: $filename, + contentType: $contentType, + ); + } + + /** + * Maps this File into a multipart form data part. + * + * @param string $name The name of the multipart form data part. + * @param ?string $contentType Overrides the Content-Type associated with the file, if any. + * @return MultipartFormDataPart + */ + public function toMultipartFormDataPart(string $name, ?string $contentType = null): MultipartFormDataPart + { + $contentType ??= $this->contentType; + $headers = $contentType != null + ? ['Content-Type' => $contentType] + : null; + + return new MultipartFormDataPart( + name: $name, + value: $this->stream, + filename: $this->filename, + headers: $headers, + ); + } + + /** + * Closes the file stream. + */ + public function close(): void + { + $this->stream->close(); + } + + /** + * Destructor to ensure stream is closed. + */ + public function __destruct() + { + $this->close(); + } +} diff --git a/src/Utils/FileWrapper.php b/src/Utils/FileWrapper.php deleted file mode 100644 index 62083ebd..00000000 --- a/src/Utils/FileWrapper.php +++ /dev/null @@ -1,21 +0,0 @@ - $order The order in which payments are listed in the response. + */ + private ?string $order; + + /** + * @var ?int $limit The maximum number of payments to return in a single response. This value cannot exceed 200. + */ + private ?int $limit; + + /** + * A pagination cursor to retrieve the next set of results for your + * original query to the endpoint. + * + * @var ?string $batchToken + */ + private ?string $batchToken; + + /** + * @param array{ + * locationId: string, + * order?: ?value-of, + * limit?: ?int, + * batchToken?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->order = $values['order'] ?? null; + $this->limit = $values['limit'] ?? null; + $this->batchToken = $values['batchToken'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getOrder(): ?string + { + return $this->order; + } + + /** + * @param ?value-of $value + */ + public function setOrder(?string $value = null): self + { + $this->order = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } + + /** + * @return ?string + */ + public function getBatchToken(): ?string + { + return $this->batchToken; + } + + /** + * @param ?string $value + */ + public function setBatchToken(?string $value = null): self + { + $this->batchToken = $value; + return $this; + } +} diff --git a/src/V1Transactions/Requests/V1RetrieveOrderRequest.php b/src/V1Transactions/Requests/V1RetrieveOrderRequest.php new file mode 100644 index 00000000..fefa9fdc --- /dev/null +++ b/src/V1Transactions/Requests/V1RetrieveOrderRequest.php @@ -0,0 +1,65 @@ +locationId = $values['locationId']; + $this->orderId = $values['orderId']; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } +} diff --git a/src/V1Transactions/Requests/V1UpdateOrderRequest.php b/src/V1Transactions/Requests/V1UpdateOrderRequest.php new file mode 100644 index 00000000..72c683c0 --- /dev/null +++ b/src/V1Transactions/Requests/V1UpdateOrderRequest.php @@ -0,0 +1,195 @@ + $action + */ + #[JsonProperty('action')] + private string $action; + + /** + * @var ?string $shippedTrackingNumber The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. + */ + #[JsonProperty('shipped_tracking_number')] + private ?string $shippedTrackingNumber; + + /** + * @var ?string $completedNote A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. + */ + #[JsonProperty('completed_note')] + private ?string $completedNote; + + /** + * @var ?string $refundedNote A merchant-specified note about the refunding of the order. Only valid if action is REFUND. + */ + #[JsonProperty('refunded_note')] + private ?string $refundedNote; + + /** + * @var ?string $canceledNote A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. + */ + #[JsonProperty('canceled_note')] + private ?string $canceledNote; + + /** + * @param array{ + * locationId: string, + * orderId: string, + * action: value-of, + * shippedTrackingNumber?: ?string, + * completedNote?: ?string, + * refundedNote?: ?string, + * canceledNote?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->locationId = $values['locationId']; + $this->orderId = $values['orderId']; + $this->action = $values['action']; + $this->shippedTrackingNumber = $values['shippedTrackingNumber'] ?? null; + $this->completedNote = $values['completedNote'] ?? null; + $this->refundedNote = $values['refundedNote'] ?? null; + $this->canceledNote = $values['canceledNote'] ?? null; + } + + /** + * @return string + */ + public function getLocationId(): string + { + return $this->locationId; + } + + /** + * @param string $value + */ + public function setLocationId(string $value): self + { + $this->locationId = $value; + return $this; + } + + /** + * @return string + */ + public function getOrderId(): string + { + return $this->orderId; + } + + /** + * @param string $value + */ + public function setOrderId(string $value): self + { + $this->orderId = $value; + return $this; + } + + /** + * @return value-of + */ + public function getAction(): string + { + return $this->action; + } + + /** + * @param value-of $value + */ + public function setAction(string $value): self + { + $this->action = $value; + return $this; + } + + /** + * @return ?string + */ + public function getShippedTrackingNumber(): ?string + { + return $this->shippedTrackingNumber; + } + + /** + * @param ?string $value + */ + public function setShippedTrackingNumber(?string $value = null): self + { + $this->shippedTrackingNumber = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCompletedNote(): ?string + { + return $this->completedNote; + } + + /** + * @param ?string $value + */ + public function setCompletedNote(?string $value = null): self + { + $this->completedNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getRefundedNote(): ?string + { + return $this->refundedNote; + } + + /** + * @param ?string $value + */ + public function setRefundedNote(?string $value = null): self + { + $this->refundedNote = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCanceledNote(): ?string + { + return $this->canceledNote; + } + + /** + * @param ?string $value + */ + public function setCanceledNote(?string $value = null): self + { + $this->canceledNote = $value; + return $this; + } +} diff --git a/src/V1Transactions/V1TransactionsClient.php b/src/V1Transactions/V1TransactionsClient.php new file mode 100644 index 00000000..27c0f4fe --- /dev/null +++ b/src/V1Transactions/V1TransactionsClient.php @@ -0,0 +1,233 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Provides summary information for a merchant's online store orders. + * + * @param V1ListOrdersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return array + * @throws SquareException + * @throws SquareApiException + */ + public function v1ListOrders(V1ListOrdersRequest $request, ?array $options = null): array + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getOrder() != null) { + $query['order'] = $request->getOrder(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + if ($request->getBatchToken() != null) { + $query['batch_token'] = $request->getBatchToken(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v1/{$request->getLocationId()}/orders", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return JsonDecoder::decodeArray($json, [V1Order::class]); // @phpstan-ignore-line + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Provides comprehensive information for a single online store order, including the order's history. + * + * @param V1RetrieveOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return V1Order + * @throws SquareException + * @throws SquareApiException + */ + public function v1RetrieveOrder(V1RetrieveOrderRequest $request, ?array $options = null): V1Order + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v1/{$request->getLocationId()}/orders/{$request->getOrderId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return V1Order::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: + * + * @param V1UpdateOrderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return V1Order + * @throws SquareException + * @throws SquareApiException + */ + public function v1UpdateOrder(V1UpdateOrderRequest $request, ?array $options = null): V1Order + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v1/{$request->getLocationId()}/orders/{$request->getOrderId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return V1Order::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Vendors/Requests/BatchCreateVendorsRequest.php b/src/Vendors/Requests/BatchCreateVendorsRequest.php new file mode 100644 index 00000000..7047a9be --- /dev/null +++ b/src/Vendors/Requests/BatchCreateVendorsRequest.php @@ -0,0 +1,45 @@ + $vendors Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency-key/`Vendor`-object pairs. + */ + #[JsonProperty('vendors'), ArrayType(['string' => Vendor::class])] + private array $vendors; + + /** + * @param array{ + * vendors: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->vendors = $values['vendors']; + } + + /** + * @return array + */ + public function getVendors(): array + { + return $this->vendors; + } + + /** + * @param array $value + */ + public function setVendors(array $value): self + { + $this->vendors = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/BatchGetVendorsRequest.php b/src/Vendors/Requests/BatchGetVendorsRequest.php new file mode 100644 index 00000000..e7e88092 --- /dev/null +++ b/src/Vendors/Requests/BatchGetVendorsRequest.php @@ -0,0 +1,44 @@ + $vendorIds IDs of the [Vendor](entity:Vendor) objects to retrieve. + */ + #[JsonProperty('vendor_ids'), ArrayType(['string'])] + private ?array $vendorIds; + + /** + * @param array{ + * vendorIds?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->vendorIds = $values['vendorIds'] ?? null; + } + + /** + * @return ?array + */ + public function getVendorIds(): ?array + { + return $this->vendorIds; + } + + /** + * @param ?array $value + */ + public function setVendorIds(?array $value = null): self + { + $this->vendorIds = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/BatchUpdateVendorsRequest.php b/src/Vendors/Requests/BatchUpdateVendorsRequest.php new file mode 100644 index 00000000..1d4c56df --- /dev/null +++ b/src/Vendors/Requests/BatchUpdateVendorsRequest.php @@ -0,0 +1,48 @@ + $vendors + */ + #[JsonProperty('vendors'), ArrayType(['string' => UpdateVendorRequest::class])] + private array $vendors; + + /** + * @param array{ + * vendors: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->vendors = $values['vendors']; + } + + /** + * @return array + */ + public function getVendors(): array + { + return $this->vendors; + } + + /** + * @param array $value + */ + public function setVendors(array $value): self + { + $this->vendors = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/CreateVendorRequest.php b/src/Vendors/Requests/CreateVendorRequest.php new file mode 100644 index 00000000..7fdd2f6f --- /dev/null +++ b/src/Vendors/Requests/CreateVendorRequest.php @@ -0,0 +1,75 @@ +idempotencyKey = $values['idempotencyKey']; + $this->vendor = $values['vendor'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return ?Vendor + */ + public function getVendor(): ?Vendor + { + return $this->vendor; + } + + /** + * @param ?Vendor $value + */ + public function setVendor(?Vendor $value = null): self + { + $this->vendor = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/GetVendorsRequest.php b/src/Vendors/Requests/GetVendorsRequest.php new file mode 100644 index 00000000..aff71546 --- /dev/null +++ b/src/Vendors/Requests/GetVendorsRequest.php @@ -0,0 +1,41 @@ +vendorId = $values['vendorId']; + } + + /** + * @return string + */ + public function getVendorId(): string + { + return $this->vendorId; + } + + /** + * @param string $value + */ + public function setVendorId(string $value): self + { + $this->vendorId = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/SearchVendorsRequest.php b/src/Vendors/Requests/SearchVendorsRequest.php new file mode 100644 index 00000000..c19c6eb6 --- /dev/null +++ b/src/Vendors/Requests/SearchVendorsRequest.php @@ -0,0 +1,100 @@ +filter = $values['filter'] ?? null; + $this->sort = $values['sort'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } + + /** + * @return ?SearchVendorsRequestFilter + */ + public function getFilter(): ?SearchVendorsRequestFilter + { + return $this->filter; + } + + /** + * @param ?SearchVendorsRequestFilter $value + */ + public function setFilter(?SearchVendorsRequestFilter $value = null): self + { + $this->filter = $value; + return $this; + } + + /** + * @return ?SearchVendorsRequestSort + */ + public function getSort(): ?SearchVendorsRequestSort + { + return $this->sort; + } + + /** + * @param ?SearchVendorsRequestSort $value + */ + public function setSort(?SearchVendorsRequestSort $value = null): self + { + $this->sort = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } +} diff --git a/src/Vendors/Requests/UpdateVendorsRequest.php b/src/Vendors/Requests/UpdateVendorsRequest.php new file mode 100644 index 00000000..b2a6f3da --- /dev/null +++ b/src/Vendors/Requests/UpdateVendorsRequest.php @@ -0,0 +1,66 @@ +vendorId = $values['vendorId']; + $this->body = $values['body']; + } + + /** + * @return string + */ + public function getVendorId(): string + { + return $this->vendorId; + } + + /** + * @param string $value + */ + public function setVendorId(string $value): self + { + $this->vendorId = $value; + return $this; + } + + /** + * @return UpdateVendorRequest + */ + public function getBody(): UpdateVendorRequest + { + return $this->body; + } + + /** + * @param UpdateVendorRequest $value + */ + public function setBody(UpdateVendorRequest $value): self + { + $this->body = $value; + return $this; + } +} diff --git a/src/Vendors/VendorsClient.php b/src/Vendors/VendorsClient.php new file mode 100644 index 00000000..f3f427f1 --- /dev/null +++ b/src/Vendors/VendorsClient.php @@ -0,0 +1,456 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller. + * + * @param BatchCreateVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchCreateVendorsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchCreate(BatchCreateVendorsRequest $request, ?array $options = null): BatchCreateVendorsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/bulk-create", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchCreateVendorsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. + * + * @param BatchGetVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchGetVendorsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchGet(BatchGetVendorsRequest $request = new BatchGetVendorsRequest(), ?array $options = null): BatchGetVendorsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/bulk-retrieve", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchGetVendorsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller. + * + * @param BatchUpdateVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return BatchUpdateVendorsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function batchUpdate(BatchUpdateVendorsRequest $request, ?array $options = null): BatchUpdateVendorsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/bulk-update", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return BatchUpdateVendorsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller. + * + * @param CreateVendorRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateVendorResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateVendorRequest $request, ?array $options = null): CreateVendorResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/create", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateVendorResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter. + * + * @param SearchVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return SearchVendorsResponse + * @throws SquareException + * @throws SquareApiException + */ + public function search(SearchVendorsRequest $request = new SearchVendorsRequest(), ?array $options = null): SearchVendorsResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/search", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return SearchVendorsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. + * + * @param GetVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetVendorResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetVendorsRequest $request, ?array $options = null): GetVendorResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/{$request->getVendorId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetVendorResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. + * + * @param UpdateVendorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateVendorResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateVendorsRequest $request, ?array $options = null): UpdateVendorResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/vendors/{$request->getVendorId()}", + method: HttpMethod::PUT, + body: $request->getBody(), + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateVendorResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Webhooks/EventTypes/EventTypesClient.php b/src/Webhooks/EventTypes/EventTypesClient.php new file mode 100644 index 00000000..c0cd4a2b --- /dev/null +++ b/src/Webhooks/EventTypes/EventTypesClient.php @@ -0,0 +1,113 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists all webhook event types that can be subscribed to. + * + * @param ListEventTypesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListWebhookEventTypesResponse + * @throws SquareException + * @throws SquareApiException + */ + public function list(ListEventTypesRequest $request = new ListEventTypesRequest(), ?array $options = null): ListWebhookEventTypesResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getApiVersion() != null) { + $query['api_version'] = $request->getApiVersion(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/event-types", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListWebhookEventTypesResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Webhooks/EventTypes/Requests/ListEventTypesRequest.php b/src/Webhooks/EventTypes/Requests/ListEventTypesRequest.php new file mode 100644 index 00000000..8e9b3c80 --- /dev/null +++ b/src/Webhooks/EventTypes/Requests/ListEventTypesRequest.php @@ -0,0 +1,41 @@ +apiVersion = $values['apiVersion'] ?? null; + } + + /** + * @return ?string + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + + /** + * @param ?string $value + */ + public function setApiVersion(?string $value = null): self + { + $this->apiVersion = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/CreateWebhookSubscriptionRequest.php b/src/Webhooks/Subscriptions/Requests/CreateWebhookSubscriptionRequest.php new file mode 100644 index 00000000..18702f33 --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/CreateWebhookSubscriptionRequest.php @@ -0,0 +1,69 @@ +idempotencyKey = $values['idempotencyKey'] ?? null; + $this->subscription = $values['subscription']; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return WebhookSubscription + */ + public function getSubscription(): WebhookSubscription + { + return $this->subscription; + } + + /** + * @param WebhookSubscription $value + */ + public function setSubscription(WebhookSubscription $value): self + { + $this->subscription = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/DeleteSubscriptionsRequest.php b/src/Webhooks/Subscriptions/Requests/DeleteSubscriptionsRequest.php new file mode 100644 index 00000000..923b8adf --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/DeleteSubscriptionsRequest.php @@ -0,0 +1,41 @@ +subscriptionId = $values['subscriptionId']; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/GetSubscriptionsRequest.php b/src/Webhooks/Subscriptions/Requests/GetSubscriptionsRequest.php new file mode 100644 index 00000000..6e49b015 --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/GetSubscriptionsRequest.php @@ -0,0 +1,41 @@ +subscriptionId = $values['subscriptionId']; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/ListSubscriptionsRequest.php b/src/Webhooks/Subscriptions/Requests/ListSubscriptionsRequest.php new file mode 100644 index 00000000..ea3c00bf --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/ListSubscriptionsRequest.php @@ -0,0 +1,131 @@ + $sortOrder + */ + private ?string $sortOrder; + + /** + * The maximum number of results to be returned in a single page. + * It is possible to receive fewer results than the specified limit on a given page. + * The default value of 100 is also the maximum allowed value. + * + * Default: 100 + * + * @var ?int $limit + */ + private ?int $limit; + + /** + * @param array{ + * cursor?: ?string, + * includeDisabled?: ?bool, + * sortOrder?: ?value-of, + * limit?: ?int, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->cursor = $values['cursor'] ?? null; + $this->includeDisabled = $values['includeDisabled'] ?? null; + $this->sortOrder = $values['sortOrder'] ?? null; + $this->limit = $values['limit'] ?? null; + } + + /** + * @return ?string + */ + public function getCursor(): ?string + { + return $this->cursor; + } + + /** + * @param ?string $value + */ + public function setCursor(?string $value = null): self + { + $this->cursor = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getIncludeDisabled(): ?bool + { + return $this->includeDisabled; + } + + /** + * @param ?bool $value + */ + public function setIncludeDisabled(?bool $value = null): self + { + $this->includeDisabled = $value; + return $this; + } + + /** + * @return ?value-of + */ + public function getSortOrder(): ?string + { + return $this->sortOrder; + } + + /** + * @param ?value-of $value + */ + public function setSortOrder(?string $value = null): self + { + $this->sortOrder = $value; + return $this; + } + + /** + * @return ?int + */ + public function getLimit(): ?int + { + return $this->limit; + } + + /** + * @param ?int $value + */ + public function setLimit(?int $value = null): self + { + $this->limit = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/TestWebhookSubscriptionRequest.php b/src/Webhooks/Subscriptions/Requests/TestWebhookSubscriptionRequest.php new file mode 100644 index 00000000..25b82f0f --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/TestWebhookSubscriptionRequest.php @@ -0,0 +1,70 @@ +subscriptionId = $values['subscriptionId']; + $this->eventType = $values['eventType'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getEventType(): ?string + { + return $this->eventType; + } + + /** + * @param ?string $value + */ + public function setEventType(?string $value = null): self + { + $this->eventType = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionRequest.php b/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionRequest.php new file mode 100644 index 00000000..7c786133 --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionRequest.php @@ -0,0 +1,68 @@ +subscriptionId = $values['subscriptionId']; + $this->subscription = $values['subscription'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?WebhookSubscription + */ + public function getSubscription(): ?WebhookSubscription + { + return $this->subscription; + } + + /** + * @param ?WebhookSubscription $value + */ + public function setSubscription(?WebhookSubscription $value = null): self + { + $this->subscription = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionSignatureKeyRequest.php b/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionSignatureKeyRequest.php new file mode 100644 index 00000000..6337460c --- /dev/null +++ b/src/Webhooks/Subscriptions/Requests/UpdateWebhookSubscriptionSignatureKeyRequest.php @@ -0,0 +1,67 @@ +subscriptionId = $values['subscriptionId']; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } + + /** + * @return string + */ + public function getSubscriptionId(): string + { + return $this->subscriptionId; + } + + /** + * @param string $value + */ + public function setSubscriptionId(string $value): self + { + $this->subscriptionId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getIdempotencyKey(): ?string + { + return $this->idempotencyKey; + } + + /** + * @param ?string $value + */ + public function setIdempotencyKey(?string $value = null): self + { + $this->idempotencyKey = $value; + return $this; + } +} diff --git a/src/Webhooks/Subscriptions/SubscriptionsClient.php b/src/Webhooks/Subscriptions/SubscriptionsClient.php new file mode 100644 index 00000000..1738b5a0 --- /dev/null +++ b/src/Webhooks/Subscriptions/SubscriptionsClient.php @@ -0,0 +1,500 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Lists all webhook subscriptions owned by your application. + * + * @param ListSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return Pager + */ + public function list(ListSubscriptionsRequest $request = new ListSubscriptionsRequest(), ?array $options = null): Pager + { + return new CursorPager( + request: $request, + getNextPage: fn (ListSubscriptionsRequest $request) => $this->_list($request, $options), + setCursor: function (ListSubscriptionsRequest $request, ?string $cursor) { + $request->setCursor($cursor); + }, + /* @phpstan-ignore-next-line */ + getNextCursor: fn (ListWebhookSubscriptionsResponse $response) => $response?->getCursor() ?? null, + /* @phpstan-ignore-next-line */ + getItems: fn (ListWebhookSubscriptionsResponse $response) => $response?->getSubscriptions() ?? [], + ); + } + + /** + * Creates a webhook subscription. + * + * @param CreateWebhookSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateWebhookSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function create(CreateWebhookSubscriptionRequest $request, ?array $options = null): CreateWebhookSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateWebhookSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Retrieves a webhook subscription identified by its ID. + * + * @param GetSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return GetWebhookSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function get(GetSubscriptionsRequest $request, ?array $options = null): GetWebhookSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions/{$request->getSubscriptionId()}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return GetWebhookSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a webhook subscription. + * + * @param UpdateWebhookSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateWebhookSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function update(UpdateWebhookSubscriptionRequest $request, ?array $options = null): UpdateWebhookSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions/{$request->getSubscriptionId()}", + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateWebhookSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Deletes a webhook subscription. + * + * @param DeleteSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DeleteWebhookSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function delete(DeleteSubscriptionsRequest $request, ?array $options = null): DeleteWebhookSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions/{$request->getSubscriptionId()}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DeleteWebhookSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Updates a webhook subscription by replacing the existing signature key with a new one. + * + * @param UpdateWebhookSubscriptionSignatureKeyRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return UpdateWebhookSubscriptionSignatureKeyResponse + * @throws SquareException + * @throws SquareApiException + */ + public function updateSignatureKey(UpdateWebhookSubscriptionSignatureKeyRequest $request, ?array $options = null): UpdateWebhookSubscriptionSignatureKeyResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions/{$request->getSubscriptionId()}/signature-key", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return UpdateWebhookSubscriptionSignatureKeyResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Tests a webhook subscription by sending a test event to the notification URL. + * + * @param TestWebhookSubscriptionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return TestWebhookSubscriptionResponse + * @throws SquareException + * @throws SquareApiException + */ + public function test(TestWebhookSubscriptionRequest $request, ?array $options = null): TestWebhookSubscriptionResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions/{$request->getSubscriptionId()}/test", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return TestWebhookSubscriptionResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Lists all webhook subscriptions owned by your application. + * + * @param ListSubscriptionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ListWebhookSubscriptionsResponse + * @throws SquareException + * @throws SquareApiException + */ + private function _list(ListSubscriptionsRequest $request = new ListSubscriptionsRequest(), ?array $options = null): ListWebhookSubscriptionsResponse + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->getCursor() != null) { + $query['cursor'] = $request->getCursor(); + } + if ($request->getIncludeDisabled() != null) { + $query['include_disabled'] = $request->getIncludeDisabled(); + } + if ($request->getSortOrder() != null) { + $query['sort_order'] = $request->getSortOrder(); + } + if ($request->getLimit() != null) { + $query['limit'] = $request->getLimit(); + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/webhooks/subscriptions", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return ListWebhookSubscriptionsResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Webhooks/WebhooksClient.php b/src/Webhooks/WebhooksClient.php new file mode 100644 index 00000000..4d8909ae --- /dev/null +++ b/src/Webhooks/WebhooksClient.php @@ -0,0 +1,57 @@ +, + * } $options + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + $this->eventTypes = new EventTypesClient($this->client, $this->options); + $this->subscriptions = new SubscriptionsClient($this->client, $this->options); + } +} diff --git a/tests/Apis/BaseTestController.php b/tests/Apis/BaseTestController.php deleted file mode 100644 index 66a4acfb..00000000 --- a/tests/Apis/BaseTestController.php +++ /dev/null @@ -1,30 +0,0 @@ -getLocationsApi(); - } - - public function testListLocations() - { - // Perform API call - $result = null; - try { - $result = self::$controller->listLocations()->getResult(); - } catch (Exceptions\ApiException $e) { - } - - // Assert result with expected response - $this->newTestCase($result)->expectStatus(200)->assert(); - } -} diff --git a/tests/ClientFactory.php b/tests/ClientFactory.php deleted file mode 100644 index 7d594cfa..00000000 --- a/tests/ClientFactory.php +++ /dev/null @@ -1,72 +0,0 @@ -httpCallback($httpCallback)->build(); - } - - public static function addTestConfiguration(SquareClientBuilder $builder): SquareClientBuilder - { - return $builder; - } - - public static function addConfigurationFromEnvironment(SquareClientBuilder $builder): SquareClientBuilder - { - $timeout = getenv('SQUARE_TIMEOUT'); - $numberOfRetries = getenv('SQUARE_NUMBER_OF_RETRIES'); - $maximumRetryWaitTime = getenv('SQUARE_MAXIMUM_RETRY_WAIT_TIME'); - $squareVersion = getenv('SQUARE_SQUARE_VERSION'); - $userAgentDetail = getenv('SQUARE_USER_AGENT_DETAIL'); - $environment = getenv('SQUARE_ENVIRONMENT'); - $customUrl = getenv('SQUARE_CUSTOM_URL'); - $accessToken = getenv('SQUARE_ACCESS_TOKEN'); - - if (!empty($timeout) && \is_numeric($timeout)) { - $builder->timeout(intval($timeout)); - } - - if (!empty($numberOfRetries) && \is_numeric($numberOfRetries)) { - $builder->numberOfRetries(intval($numberOfRetries)); - } - - if (!empty($maximumRetryWaitTime) && \is_numeric($maximumRetryWaitTime)) { - $builder->maximumRetryWaitTime(intval($maximumRetryWaitTime)); - } - - if (!empty($squareVersion)) { - $builder->squareVersion($squareVersion); - } - - if (!empty($userAgentDetail)) { - $builder->userAgentDetail($userAgentDetail); - } - - if (!empty($environment)) { - $builder->environment($environment); - } - - if (!empty($customUrl)) { - $builder->customUrl($customUrl); - } - - if (!empty($accessToken)) { - $builder->bearerAuthCredentials(BearerAuthCredentialsBuilder::init($accessToken)); - } - - return $builder; - } -} diff --git a/tests/Core/Client/RawClientTest.php b/tests/Core/Client/RawClientTest.php new file mode 100644 index 00000000..54d136da --- /dev/null +++ b/tests/Core/Client/RawClientTest.php @@ -0,0 +1,444 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function getName(): ?string + { + return $this->name; + } +} + +class RawClientTest extends TestCase +{ + private string $baseUrl = 'https://api.example.com'; + private MockHandler $mockHandler; + private RawClient $rawClient; + + protected function setUp(): void + { + $this->mockHandler = new MockHandler(); + $handlerStack = HandlerStack::create($this->mockHandler); + // since the client is constructed manually, we need to add the retry middleware manually + $handlerStack->push(RetryMiddleware::create([ + 'maxRetries' => 0, + 'baseDelay' => 0, + ])); + $client = new Client(['handler' => $handlerStack]); + $this->rawClient = new RawClient(['client' => $client]); + } + + /** + * @throws ClientExceptionInterface + */ + public function testHeaders(): void + { + $this->mockHandler->append(new Response(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ['X-Custom-Header' => 'TestValue'] + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('TestValue', $lastRequest->getHeaderLine('X-Custom-Header')); + } + + /** + * @throws ClientExceptionInterface + */ + public function testQueryParameters(): void + { + $this->mockHandler->append(new Response(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + [], + ['param1' => 'value1', 'param2' => ['a', 'b'], 'param3' => 'true'] + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals( + 'https://api.example.com/test?param1=value1¶m2=a¶m2=b¶m3=true', + (string)$lastRequest->getUri() + ); + } + + /** + * @throws ClientExceptionInterface + */ + public function testJsonBody(): void + { + $this->mockHandler->append(new Response(200)); + + $body = ['key' => 'value']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(json_encode($body), (string)$lastRequest->getBody()); + } + + public function testAdditionalHeaders(): void + { + $this->mockHandler->append(new Response(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $headers = [ + 'X-API-Version' => '1.0.0', + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + $headers, + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'headers' => [ + 'X-Tenancy' => 'test' + ] + ] + ); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('1.0.0', $lastRequest->getHeaderLine('X-API-Version')); + $this->assertEquals('test', $lastRequest->getHeaderLine('X-Tenancy')); + } + + public function testOverrideAdditionalHeaders(): void + { + $this->mockHandler->append(new Response(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $headers = [ + 'X-API-Version' => '1.0.0', + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + $headers, + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'headers' => [ + 'X-API-Version' => '2.0.0' + ] + ] + ); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('2.0.0', $lastRequest->getHeaderLine('X-API-Version')); + } + + public function testAdditionalBodyProperties(): void + { + $this->mockHandler->append(new Response(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'bodyProperties' => [ + 'age' => 42 + ] + ] + ); + + $expectedJson = [ + 'name' => 'john.doe', + 'age' => 42 + ]; + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(json_encode($expectedJson), (string)$lastRequest->getBody()); + } + + public function testOverrideAdditionalBodyProperties(): void + { + $this->mockHandler->append(new Response(200)); + + $body = [ + 'name' => 'john.doe' + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'bodyProperties' => [ + 'name' => 'jane.doe' + ] + ] + ); + + $expectedJson = [ + 'name' => 'jane.doe', + ]; + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(json_encode($expectedJson), (string)$lastRequest->getBody()); + } + + public function testAdditionalQueryParameters(): void + { + $this->mockHandler->append(new Response(200)); + + $query = ['key' => 'value']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + $query, + [] + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'queryParameters' => [ + 'extra' => 42 + ] + ] + ); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('key=value&extra=42', $lastRequest->getUri()->getQuery()); + } + + public function testOverrideQueryParameters(): void + { + $this->mockHandler->append(new Response(200)); + + $query = ['key' => 'invalid']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + $query, + [] + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'queryParameters' => [ + 'key' => 'value' + ] + ] + ); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('key=value', $lastRequest->getUri()->getQuery()); + } + + public function testDefaultRetries(): void + { + $this->mockHandler->append(new Response(500)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + try { + $this->rawClient->sendRequest($request); + $this->fail("Request should've failed but succeeded."); + } catch (ClientExceptionInterface) { + } + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals(0, $this->mockHandler->count()); + } + + /** + * @throws ClientExceptionInterface + */ + public function testExplicitRetriesSuccess(): void + { + $this->mockHandler->append(new Response(500), new Response(500), new Response(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + $this->rawClient->sendRequest($request, ['maxRetries' => 2]); + + $lastRequest = $this->mockHandler->getLastRequest(); + assert($lastRequest instanceof RequestInterface); + $this->assertEquals(0, $this->mockHandler->count()); + } + + public function testExplicitRetriesFailure(): void + { + $this->mockHandler->append(new Response(500), new Response(500), new Response(500)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + try { + $this->rawClient->sendRequest($request, ['maxRetries' => 2]); + $this->fail("Request should've failed but succeeded."); + } catch (ClientExceptionInterface) { + } + + $this->assertEquals(0, $this->mockHandler->count()); + } + + /** + * @throws ClientExceptionInterface + */ + public function testShouldRetryOnStatusCodes(): void + { + $this->mockHandler->append( + new Response(408), + new Response(429), + new Response(500), + new Response(501), + new Response(502), + new Response(503), + new Response(504), + new Response(505), + new Response(599), + new Response(200), + ); + $countOfErrorRequests = $this->mockHandler->count() - 1; + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + $this->rawClient->sendRequest($request, ['maxRetries' => $countOfErrorRequests]); + + $this->assertEquals(0, $this->mockHandler->count()); + } + + public function testShouldFailOn400Response(): void + { + $this->mockHandler->append(new Response(400), new Response(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + try { + $this->rawClient->sendRequest($request, ['maxRetries' => 2]); + $this->fail("Request should've failed but succeeded."); + } catch (ClientExceptionInterface) { + } + + $this->assertEquals(1, $this->mockHandler->count()); + } +} diff --git a/tests/Core/Json/AdditionalPropertiesTest.php b/tests/Core/Json/AdditionalPropertiesTest.php new file mode 100644 index 00000000..736e0cc8 --- /dev/null +++ b/tests/Core/Json/AdditionalPropertiesTest.php @@ -0,0 +1,76 @@ +name; + } + + /** + * @return string|null + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @param array{ + * name: string, + * email?: string|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->email = $values['email'] ?? null; + } +} + +class AdditionalPropertiesTest extends TestCase +{ + public function testExtraProperties(): void + { + $expectedJson = json_encode( + [ + 'name' => 'john.doe', + 'email' => 'john.doe@example.com', + 'age' => 42 + ], + JSON_THROW_ON_ERROR + ); + + $person = Person::fromJson($expectedJson); + $this->assertEquals('john.doe', $person->getName()); + $this->assertEquals('john.doe@example.com', $person->getEmail()); + $this->assertEquals( + [ + 'age' => 42 + ], + $person->getAdditionalProperties(), + ); + } +} diff --git a/tests/Core/Json/DateArrayTest.php b/tests/Core/Json/DateArrayTest.php new file mode 100644 index 00000000..06fbf01f --- /dev/null +++ b/tests/Core/Json/DateArrayTest.php @@ -0,0 +1,54 @@ +dates = $values['dates']; + } +} + +class DateArrayTest extends TestCase +{ + public function testDateTimeInArrays(): void + { + $expectedJson = json_encode( + [ + 'dates' => ['2023-01-01', '2023-02-01', '2023-03-01'] + ], + JSON_THROW_ON_ERROR + ); + + $object = DateArray::fromJson($expectedJson); + $this->assertInstanceOf(DateTime::class, $object->dates[0], 'dates[0] should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->dates[0]->format('Y-m-d'), 'dates[0] should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->dates[1], 'dates[1] should be a DateTime instance.'); + $this->assertEquals('2023-02-01', $object->dates[1]->format('Y-m-d'), 'dates[1] should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->dates[2], 'dates[2] should be a DateTime instance.'); + $this->assertEquals('2023-03-01', $object->dates[2]->format('Y-m-d'), 'dates[2] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for dates array.'); + } +} diff --git a/tests/Core/Json/EmptyArrayTest.php b/tests/Core/Json/EmptyArrayTest.php new file mode 100644 index 00000000..492ffb78 --- /dev/null +++ b/tests/Core/Json/EmptyArrayTest.php @@ -0,0 +1,71 @@ + $emptyMapArray + */ + #[JsonProperty('empty_map_array')] + #[ArrayType(['integer' => new Union('string', 'null')])] + public array $emptyMapArray; + + /** + * @var array $emptyDatesArray + */ + #[ArrayType([new Union('date', 'null')])] + #[JsonProperty('empty_dates_array')] + public array $emptyDatesArray; + + /** + * @param array{ + * emptyStringArray: string[], + * emptyMapArray: array, + * emptyDatesArray: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->emptyStringArray = $values['emptyStringArray']; + $this->emptyMapArray = $values['emptyMapArray']; + $this->emptyDatesArray = $values['emptyDatesArray']; + } +} + +class EmptyArrayTest extends TestCase +{ + public function testEmptyArray(): void + { + $expectedJson = json_encode( + [ + 'empty_string_array' => [], + 'empty_map_array' => [], + 'empty_dates_array' => [] + ], + JSON_THROW_ON_ERROR + ); + + $object = EmptyArray::fromJson($expectedJson); + $this->assertEmpty($object->emptyStringArray, 'empty_string_array should be empty.'); + $this->assertEmpty($object->emptyMapArray, 'empty_map_array should be empty.'); + $this->assertEmpty($object->emptyDatesArray, 'empty_dates_array should be empty.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for EmptyArraysType.'); + } +} diff --git a/tests/Core/Json/EnumTest.php b/tests/Core/Json/EnumTest.php new file mode 100644 index 00000000..e8909766 --- /dev/null +++ b/tests/Core/Json/EnumTest.php @@ -0,0 +1,76 @@ +value; + } +} + +class ShapeType extends JsonSerializableType +{ + /** + * @var Shape $shape + */ + #[JsonProperty('shape')] + public Shape $shape; + + /** + * @var Shape[] $shapes + */ + #[ArrayType([Shape::class])] + #[JsonProperty('shapes')] + public array $shapes; + + /** + * @param Shape $shape + * @param Shape[] $shapes + */ + public function __construct( + Shape $shape, + array $shapes, + ) { + $this->shape = $shape; + $this->shapes = $shapes; + } +} + +class EnumTest extends TestCase +{ + public function testEnumSerialization(): void + { + $object = new ShapeType( + Shape::Circle, + [Shape::Square, Shape::Circle, Shape::Triangle] + ); + + $expectedJson = json_encode([ + 'shape' => 'CIRCLE', + 'shapes' => ['SQUARE', 'CIRCLE', 'TRIANGLE'] + ], JSON_THROW_ON_ERROR); + + $actualJson = $object->toJson(); + + $this->assertJsonStringEqualsJsonString( + $expectedJson, + $actualJson, + 'Serialized JSON does not match expected JSON for shape and shapes properties.' + ); + } +} diff --git a/tests/Core/Json/ExhaustiveTest.php b/tests/Core/Json/ExhaustiveTest.php new file mode 100644 index 00000000..4384a3a1 --- /dev/null +++ b/tests/Core/Json/ExhaustiveTest.php @@ -0,0 +1,197 @@ +nestedProperty = $values['nestedProperty']; + } +} + +class Type extends JsonSerializableType +{ + /** + * @var Nested nestedType + */ + #[JsonProperty('nested_type')] + public Nested $nestedType; /** + + * @var string $simpleProperty + */ + #[JsonProperty('simple_property')] + public string $simpleProperty; + + /** + * @var DateTime $dateProperty + */ + #[Date(Date::TYPE_DATE)] + #[JsonProperty('date_property')] + public DateTime $dateProperty; + + /** + * @var DateTime $datetimeProperty + */ + #[Date(Date::TYPE_DATETIME)] + #[JsonProperty('datetime_property')] + public DateTime $datetimeProperty; + + /** + * @var array $stringArray + */ + #[ArrayType(['string'])] + #[JsonProperty('string_array')] + public array $stringArray; + + /** + * @var array $mapProperty + */ + #[ArrayType(['string' => 'integer'])] + #[JsonProperty('map_property')] + public array $mapProperty; + + /** + * @var array $objectArray + */ + #[ArrayType(['integer' => new Union(Nested::class, 'null')])] + #[JsonProperty('object_array')] + public array $objectArray; + + /** + * @var array> $nestedArray + */ + #[ArrayType(['integer' => ['integer' => new Union('string', 'null')]])] + #[JsonProperty('nested_array')] + public array $nestedArray; + + /** + * @var array $datesArray + */ + #[ArrayType([new Union('date', 'null')])] + #[JsonProperty('dates_array')] + public array $datesArray; + + /** + * @var string|null $nullableProperty + */ + #[JsonProperty('nullable_property')] + public ?string $nullableProperty; + + /** + * @param array{ + * nestedType: Nested, + * simpleProperty: string, + * dateProperty: DateTime, + * datetimeProperty: DateTime, + * stringArray: array, + * mapProperty: array, + * objectArray: array, + * nestedArray: array>, + * datesArray: array, + * nullableProperty?: string|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nestedType = $values['nestedType']; + $this->simpleProperty = $values['simpleProperty']; + $this->dateProperty = $values['dateProperty']; + $this->datetimeProperty = $values['datetimeProperty']; + $this->stringArray = $values['stringArray']; + $this->mapProperty = $values['mapProperty']; + $this->objectArray = $values['objectArray']; + $this->nestedArray = $values['nestedArray']; + $this->datesArray = $values['datesArray']; + $this->nullableProperty = $values['nullableProperty'] ?? null; + } +} + +class ExhaustiveTest extends TestCase +{ + /** + * Test serialization and deserialization of all types in Type. + */ + public function testExhaustive(): void + { + $expectedJson = json_encode( + [ + 'nested_type' => ['nested_property' => '1995-07-20'], + 'simple_property' => 'Test String', + // Omit 'nullable_property' to test null serialization + 'date_property' => '2023-01-01', + 'datetime_property' => '2023-01-01T12:34:56+00:00', + 'string_array' => ['one', 'two', 'three'], + 'map_property' => ['key1' => 1, 'key2' => 2], + 'object_array' => [ + 1 => ['nested_property' => '2021-07-20'], + 2 => null, // Testing nullable objects in array + ], + 'nested_array' => [ + 1 => [1 => 'value1', 2 => null], // Testing nullable strings in nested array + 2 => [3 => 'value3', 4 => 'value4'] + ], + 'dates_array' => ['2023-01-01', null, '2023-03-01'] // Testing nullable dates in array> + ], + JSON_THROW_ON_ERROR + ); + + $object = Type::fromJson($expectedJson); + + // Check that nullable property is null and not included in JSON + $this->assertNull($object->nullableProperty, 'Nullable property should be null.'); + + // Check date properties + $this->assertInstanceOf(DateTime::class, $object->dateProperty, 'date_property should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->dateProperty->format('Y-m-d'), 'date_property should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->datetimeProperty, 'datetime_property should be a DateTime instance.'); + $this->assertEquals('2023-01-01 12:34:56', $object->datetimeProperty->format('Y-m-d H:i:s'), 'datetime_property should have the correct datetime.'); + + // Check scalar arrays + $this->assertEquals(['one', 'two', 'three'], $object->stringArray, 'string_array should match the original data.'); + $this->assertEquals(['key1' => 1, 'key2' => 2], $object->mapProperty, 'map_property should match the original data.'); + + // Check object array with nullable elements + $this->assertInstanceOf(Nested::class, $object->objectArray[1], 'object_array[1] should be an instance of TestNestedType1.'); + $this->assertEquals('2021-07-20', $object->objectArray[1]->nestedProperty->format('Y-m-d'), 'object_array[1]->nestedProperty should match the original data.'); + $this->assertNull($object->objectArray[2], 'object_array[2] should be null.'); + + // Check nested array with nullable strings + $this->assertEquals('value1', $object->nestedArray[1][1], 'nested_array[1][1] should match the original data.'); + $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); + $this->assertEquals('value3', $object->nestedArray[2][3], 'nested_array[2][3] should match the original data.'); + $this->assertEquals('value4', $object->nestedArray[2][4], 'nested_array[2][4] should match the original data.'); + + // Check dates array with nullable DateTime objects + $this->assertInstanceOf(DateTime::class, $object->datesArray[0], 'dates_array[0] should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->datesArray[0]->format('Y-m-d'), 'dates_array[0] should have the correct date.'); + $this->assertNull($object->datesArray[1], 'dates_array[1] should be null.'); + $this->assertInstanceOf(DateTime::class, $object->datesArray[2], 'dates_array[2] should be a DateTime instance.'); + $this->assertEquals('2023-03-01', $object->datesArray[2]->format('Y-m-d'), 'dates_array[2] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'The serialized JSON does not match the original JSON.'); + } +} diff --git a/tests/Core/Json/InvalidTest.php b/tests/Core/Json/InvalidTest.php new file mode 100644 index 00000000..dc9dace2 --- /dev/null +++ b/tests/Core/Json/InvalidTest.php @@ -0,0 +1,42 @@ +integerProperty = $values['integerProperty']; + } +} + +class InvalidTest extends TestCase +{ + public function testInvalidJsonThrowsException(): void + { + $this->expectException(\TypeError::class); + $json = json_encode( + [ + 'integer_property' => 'not_an_integer' + ], + JSON_THROW_ON_ERROR + ); + Invalid::fromJson($json); + } +} diff --git a/tests/Core/Json/NestedUnionArrayTest.php b/tests/Core/Json/NestedUnionArrayTest.php new file mode 100644 index 00000000..c8c506c1 --- /dev/null +++ b/tests/Core/Json/NestedUnionArrayTest.php @@ -0,0 +1,89 @@ +nestedProperty = $values['nestedProperty']; + } +} + +class NestedUnionArray extends JsonSerializableType +{ + /** + * @var array> $nestedArray + */ + #[ArrayType(['integer' => ['integer' => new Union(UnionObject::class, 'null', 'date')]])] + #[JsonProperty('nested_array')] + public array $nestedArray; + + /** + * @param array{ + * nestedArray: array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nestedArray = $values['nestedArray']; + } +} + +class NestedUnionArrayTest extends TestCase +{ + public function testNestedUnionArray(): void + { + $expectedJson = json_encode( + [ + 'nested_array' => [ + 1 => [ + 1 => ['nested_property' => 'Nested One'], + 2 => null, + 4 => '2023-01-02' + ], + 2 => [ + 5 => ['nested_property' => 'Nested Two'], + 7 => '2023-02-02' + ] + ] + ], + JSON_THROW_ON_ERROR + ); + + $object = NestedUnionArray::fromJson($expectedJson); + $this->assertInstanceOf(UnionObject::class, $object->nestedArray[1][1], 'nested_array[1][1] should be an instance of Object.'); + $this->assertEquals('Nested One', $object->nestedArray[1][1]->nestedProperty, 'nested_array[1][1]->nestedProperty should match the original data.'); + $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); + $this->assertInstanceOf(DateTime::class, $object->nestedArray[1][4], 'nested_array[1][4] should be a DateTime instance.'); + $this->assertEquals('2023-01-02T00:00:00+00:00', $object->nestedArray[1][4]->format(Constant::DateTimeFormat), 'nested_array[1][4] should have the correct datetime.'); + $this->assertInstanceOf(UnionObject::class, $object->nestedArray[2][5], 'nested_array[2][5] should be an instance of Object.'); + $this->assertEquals('Nested Two', $object->nestedArray[2][5]->nestedProperty, 'nested_array[2][5]->nestedProperty should match the original data.'); + $this->assertInstanceOf(DateTime::class, $object->nestedArray[2][7], 'nested_array[1][4] should be a DateTime instance.'); + $this->assertEquals('2023-02-02', $object->nestedArray[2][7]->format('Y-m-d'), 'nested_array[1][4] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nested_array.'); + } +} diff --git a/tests/Core/Json/NullPropertyTest.php b/tests/Core/Json/NullPropertyTest.php new file mode 100644 index 00000000..db78c5fe --- /dev/null +++ b/tests/Core/Json/NullPropertyTest.php @@ -0,0 +1,53 @@ +nonNullProperty = $values['nonNullProperty']; + $this->nullProperty = $values['nullProperty'] ?? null; + } +} + +class NullPropertyTest extends TestCase +{ + public function testNullPropertiesAreOmitted(): void + { + $object = new NullProperty( + [ + "nonNullProperty" => "Test String", + "nullProperty" => null + ] + ); + + $serialized = $object->jsonSerialize(); + $this->assertArrayHasKey('non_null_property', $serialized, 'non_null_property should be present in the serialized JSON.'); + $this->assertArrayNotHasKey('null_property', $serialized, 'null_property should be omitted from the serialized JSON.'); + $this->assertEquals('Test String', $serialized['non_null_property'], 'non_null_property should have the correct value.'); + } +} diff --git a/tests/Core/Json/NullableArrayTest.php b/tests/Core/Json/NullableArrayTest.php new file mode 100644 index 00000000..25b0a27d --- /dev/null +++ b/tests/Core/Json/NullableArrayTest.php @@ -0,0 +1,49 @@ + $nullableStringArray + */ + #[ArrayType([new Union('string', 'null')])] + #[JsonProperty('nullable_string_array')] + public array $nullableStringArray; + + /** + * @param array{ + * nullableStringArray: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nullableStringArray = $values['nullableStringArray']; + } +} + +class NullableArrayTest extends TestCase +{ + public function testNullableArray(): void + { + $expectedJson = json_encode( + [ + 'nullable_string_array' => ['one', null, 'three'] + ], + JSON_THROW_ON_ERROR + ); + + $object = NullableArray::fromJson($expectedJson); + $this->assertEquals(['one', null, 'three'], $object->nullableStringArray, 'nullable_string_array should match the original data.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nullable_string_array.'); + } +} diff --git a/tests/Core/Json/ScalarTest.php b/tests/Core/Json/ScalarTest.php new file mode 100644 index 00000000..507414a9 --- /dev/null +++ b/tests/Core/Json/ScalarTest.php @@ -0,0 +1,116 @@ + $intFloatArray + */ + #[ArrayType([new Union('integer', 'float')])] + #[JsonProperty('int_float_array')] + public array $intFloatArray; + + /** + * @var array $floatArray + */ + #[ArrayType(['float'])] + #[JsonProperty('float_array')] + public array $floatArray; + + /** + * @var bool|null $nullableBooleanProperty + */ + #[JsonProperty('nullable_boolean_property')] + public ?bool $nullableBooleanProperty; + + /** + * @param array{ + * integerProperty: int, + * floatProperty: float, + * otherFloatProperty: float, + * booleanProperty: bool, + * stringProperty: string, + * intFloatArray: array, + * floatArray: array, + * nullableBooleanProperty?: bool|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->integerProperty = $values['integerProperty']; + $this->floatProperty = $values['floatProperty']; + $this->otherFloatProperty = $values['otherFloatProperty']; + $this->booleanProperty = $values['booleanProperty']; + $this->stringProperty = $values['stringProperty']; + $this->intFloatArray = $values['intFloatArray']; + $this->floatArray = $values['floatArray']; + $this->nullableBooleanProperty = $values['nullableBooleanProperty'] ?? null; + } +} + +class ScalarTest extends TestCase +{ + public function testAllScalarTypesIncludingFloat(): void + { + $expectedJson = json_encode( + [ + 'integer_property' => 42, + 'float_property' => 3.14159, + 'other_float_property' => 3, + 'boolean_property' => true, + 'string_property' => 'Hello, World!', + 'int_float_array' => [1, 2.5, 3, 4.75], + 'float_array' => [1, 2, 3, 4] // Ensure we handle "integer-looking" floats + ], + JSON_THROW_ON_ERROR + ); + + $object = Scalar::fromJson($expectedJson); + $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); + $this->assertEquals(3.14159, $object->floatProperty, 'float_property should be 3.14159.'); + $this->assertTrue($object->booleanProperty, 'boolean_property should be true.'); + $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); + $this->assertNull($object->nullableBooleanProperty, 'nullable_boolean_property should be null.'); + $this->assertEquals([1, 2.5, 3, 4.75], $object->intFloatArray, 'int_float_array should match the original data.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTest.'); + } +} diff --git a/tests/Core/Json/TraitTest.php b/tests/Core/Json/TraitTest.php new file mode 100644 index 00000000..e185bb90 --- /dev/null +++ b/tests/Core/Json/TraitTest.php @@ -0,0 +1,60 @@ +integerProperty = $values['integerProperty']; + $this->stringProperty = $values['stringProperty']; + } +} + +class TraitTest extends TestCase +{ + public function testTraitPropertyAndString(): void + { + $expectedJson = json_encode( + [ + 'integer_property' => 42, + 'string_property' => 'Hello, World!', + ], + JSON_THROW_ON_ERROR + ); + + $object = TypeWithTrait::fromJson($expectedJson); + $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); + $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTestWithTrait.'); + } +} diff --git a/tests/Core/Json/UnionArrayTest.php b/tests/Core/Json/UnionArrayTest.php new file mode 100644 index 00000000..fd2691d5 --- /dev/null +++ b/tests/Core/Json/UnionArrayTest.php @@ -0,0 +1,57 @@ + $mixedDates + */ + #[ArrayType(['integer' => new Union('datetime', 'string', 'null')])] + #[JsonProperty('mixed_dates')] + public array $mixedDates; + + /** + * @param array{ + * mixedDates: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->mixedDates = $values['mixedDates']; + } +} + +class UnionArrayTest extends TestCase +{ + public function testUnionArray(): void + { + $expectedJson = json_encode( + [ + 'mixed_dates' => [ + 1 => '2023-01-01T12:00:00+00:00', + 2 => null, + 3 => 'Some String' + ] + ], + JSON_THROW_ON_ERROR + ); + + $object = UnionArray::fromJson($expectedJson); + $this->assertInstanceOf(DateTime::class, $object->mixedDates[1], 'mixed_dates[1] should be a DateTime instance.'); + $this->assertEquals('2023-01-01 12:00:00', $object->mixedDates[1]->format('Y-m-d H:i:s'), 'mixed_dates[1] should have the correct datetime.'); + $this->assertNull($object->mixedDates[2], 'mixed_dates[2] should be null.'); + $this->assertEquals('Some String', $object->mixedDates[3], 'mixed_dates[3] should be "Some String".'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for mixed_dates.'); + } +} diff --git a/tests/Core/Json/UnionPropertyTest.php b/tests/Core/Json/UnionPropertyTest.php new file mode 100644 index 00000000..7309b2a3 --- /dev/null +++ b/tests/Core/Json/UnionPropertyTest.php @@ -0,0 +1,115 @@ + 'integer'], UnionProperty::class)] + #[JsonProperty('complexUnion')] + public mixed $complexUnion; + + /** + * @param array{ + * complexUnion: string|int|null|array|UnionProperty + * } $values + */ + public function __construct( + array $values, + ) { + $this->complexUnion = $values['complexUnion']; + } +} + +class UnionPropertyTest extends TestCase +{ + public function testWithMapOfIntToInt(): void + { + $expectedJson = json_encode( + [ + 'complexUnion' => [1 => 100, 2 => 200] + ], + JSON_THROW_ON_ERROR + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsArray($object->complexUnion, 'complexUnion should be an array.'); + $this->assertEquals([1 => 100, 2 => 200], $object->complexUnion, 'complexUnion should match the original map of int => int.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithNestedUnionPropertyType(): void + { + $expectedJson = json_encode( + [ + 'complexUnion' => new UnionProperty( + [ + 'complexUnion' => 'Nested String' + ] + ) + ], + JSON_THROW_ON_ERROR + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertInstanceOf(UnionProperty::class, $object->complexUnion, 'complexUnion should be an instance of UnionPropertyType.'); + $this->assertEquals('Nested String', $object->complexUnion->complexUnion, 'Nested complexUnion should match the original value.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithNull(): void + { + $expectedJson = json_encode( + [], + JSON_THROW_ON_ERROR + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertNull($object->complexUnion, 'complexUnion should be null.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithInteger(): void + { + $expectedJson = json_encode( + [ + 'complexUnion' => 42 + ], + JSON_THROW_ON_ERROR + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsInt($object->complexUnion, 'complexUnion should be an integer.'); + $this->assertEquals(42, $object->complexUnion, 'complexUnion should match the original integer.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithString(): void + { + $expectedJson = json_encode( + [ + 'complexUnion' => 'Some String' + ], + JSON_THROW_ON_ERROR + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsString($object->complexUnion, 'complexUnion should be a string.'); + $this->assertEquals('Some String', $object->complexUnion, 'complexUnion should match the original string.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } +} diff --git a/tests/Core/Pagination/CreateRequestWithDefaultsTest.php b/tests/Core/Pagination/CreateRequestWithDefaultsTest.php new file mode 100644 index 00000000..03691889 --- /dev/null +++ b/tests/Core/Pagination/CreateRequestWithDefaultsTest.php @@ -0,0 +1,131 @@ +pagination = $values['pagination'] ?? null; + $this->query = $values['query']; + } +} + +class StartingAfterPaging +{ + /** + * @var int $perPage + */ + public int $perPage; + + /** + * @var ?string $startingAfter + */ + public ?string $startingAfter; + + /** + * @param array{ + * perPage: int, + * startingAfter?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->perPage = $values['perPage']; + $this->startingAfter = $values['startingAfter'] ?? null; + } +} + +class SingleFilterSearchRequest +{ + /** + * @var ?string $field + */ + public ?string $field; + + /** + * @var ?string $operator + */ + public ?string $operator; + + /** + * @var ?string $value + */ + public ?string $value; + + /** + * @param array{ + * field?: ?string, + * operator?: ?string, + * value?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->field = $values['field'] ?? null; + $this->operator = $values['operator'] ?? null; + $this->value = $values['value'] ?? null; + } +} + +class MultipleFilterSearchRequest +{ + /** + * @var ?string $operator + */ + public ?string $operator; + + /** + * @var array|array|null $value + */ + public array|null $value; + + /** + * @param array{ + * operator?: ?string, + * value?: array|array|null, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->operator = $values['operator'] ?? null; + $this->value = $values['value'] ?? null; + } +} + +class CreateRequestWithDefaultsTest extends TestCase +{ + public function testCreateInstanceWithDefaults(): void + { + $instance = PaginationHelper::createRequestWithDefaults(SearchRequest::class); + $this->assertInstanceOf(SearchRequest::class, $instance); + $this->assertNull($instance->pagination); + $this->assertInstanceOf(SingleFilterSearchRequest::class, $instance->query); + $this->assertNull($instance->query->field); + $this->assertNull($instance->query->operator); + $this->assertNull($instance->query->value); + } +} diff --git a/tests/Core/Pagination/CursorPagerTest/CursorPagerTest.php b/tests/Core/Pagination/CursorPagerTest/CursorPagerTest.php new file mode 100644 index 00000000..ed5b916a --- /dev/null +++ b/tests/Core/Pagination/CursorPagerTest/CursorPagerTest.php @@ -0,0 +1,132 @@ +cursor = $cursor; + } +} + +class Response +{ + /** + * @var ?array + */ + public ?array $items; + + public ?ResponseCursor $next; + + /** + * @param ?array $items + * @param ?ResponseCursor $next + */ + public function __construct(?array $items, ?ResponseCursor $next) + { + $this->items = $items; + $this->next = $next; + } +} + +class ResponseCursor +{ + public ?string $cursor; + + /** + * @param ?string $cursor + */ + public function __construct(?string $cursor) + { + $this->cursor = $cursor; + } +} + +class CursorPagerTest extends TestCase +{ + private const CURSOR1 = null; + private const CURSOR2 = '00000000-0000-0000-0000-000000000001'; + private const CURSOR3 = '00000000-0000-0000-0000-000000000002'; + private ?string $cursorCopy; + + public function testCursorPager(): void + { + $pager = $this->createPager(); + $this->assertPager($pager); + } + + /** + * @return CursorPager + */ + private function createPager(): CursorPager + { + $request = new Request(self::CURSOR1); + $responses = new ArrayIterator([ + new Response(['item1', 'item2'], new ResponseCursor(self::CURSOR2)), + new Response(['item1'], new ResponseCursor(self::CURSOR3)), + new Response([], null), + ]); + + $this->cursorCopy = self::CURSOR1; + + return new CursorPager( + $request, + function (Request $request) use ($responses) { + $response = $responses->current(); + $responses->next(); + return $response; + }, + function (Request $request, ?string $cursor) { + $request->cursor = $cursor; + $this->cursorCopy = $cursor; + }, + fn (Response $response) => $response->next->cursor ?? null, + fn (Response $response) => $response->items ?? [] + ); + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPager(Pager $pager): void + { + /** @var Generator> $pages */ + $pages = $pager->getPages(); + + // first page + /** @var Page $page */ + $page = $pages->current(); + $this->assertCount(2, $page->getItems()); + $this->assertEquals(self::CURSOR1, $this->cursorCopy); + + // second page + $pages->next(); + $page = $pages->current(); + $this->assertCount(1, $page->getItems()); + $this->assertEquals(self::CURSOR2, $this->cursorCopy); + + // third page + $pages->next(); + $page = $pages->current(); + $this->assertCount(0, $page->getItems()); + $this->assertEquals(self::CURSOR3, $this->cursorCopy); + + // no more pages + $pages->next(); + $this->assertNull($pages->current()); + } +} diff --git a/tests/Core/Pagination/DeepSetAccessorsTest.php b/tests/Core/Pagination/DeepSetAccessorsTest.php new file mode 100644 index 00000000..58fe8e63 --- /dev/null +++ b/tests/Core/Pagination/DeepSetAccessorsTest.php @@ -0,0 +1,101 @@ +level1; + } + + /** + * @param ?array{ + * level1?: ?Level1ObjectAccessors, + * } $data + */ + public function __construct(?array $data = []) + { + $this->level1 = $data['level1'] ?? null; + } +} + +class Level1ObjectAccessors +{ + private ?Level2ObjectAccessors $level2; + + public function getLevel2(): ?Level2ObjectAccessors + { + return $this->level2; + } + + /** + * @param ?array{ + * level2?: ?Level2ObjectAccessors, + * } $data + */ + public function __construct(?array $data = []) + { + $this->level2 = $data['level2'] ?? null; + } +} + +class Level2ObjectAccessors +{ + private ?string $level3; + + /** + * @return string|null + */ + public function getLevel3(): ?string + { + return $this->level3; + } + + /** + * @param ?array{ + * level3?: ?string, + * } $data + */ + public function __construct(?array $data = []) + { + $this->level3 = $data['level3'] ?? null; + } +} + +class DeepSetAccessorsTest extends TestCase +{ + public function testSetNestedPropertyWithNull(): void + { + $object = new RootObjectAccessors(); + + $this->assertNull($object->getLevel1()); + + PaginationHelper::setDeep($object, ['level1', 'level2', 'level3'], 'testValue'); + + $this->assertEquals('testValue', $object->getLevel1()?->getLevel2()?->getLevel3()); + } + + public function testSetNestedProperty(): void + { + $object = new RootObjectAccessors([ + "level1" => new Level1ObjectAccessors([ + "level2" => new Level2ObjectAccessors([ + "level3" => null + ]) + ]) + ]); + + $this->assertNull($object->getLevel1()?->getLevel2()?->getLevel3()); + + PaginationHelper::setDeep($object, ['level1', 'level2', 'level3'], 'testValue'); + + $this->assertEquals('testValue', $object->getLevel1()?->getLevel2()?->getLevel3()); + } + +} diff --git a/tests/Core/Pagination/DeepSetTest.php b/tests/Core/Pagination/DeepSetTest.php new file mode 100644 index 00000000..35401d11 --- /dev/null +++ b/tests/Core/Pagination/DeepSetTest.php @@ -0,0 +1,83 @@ +level1 = $data['level1'] ?? null; + } +} + +class Level1Object +{ + public ?Level2Object $level2; + + /** + * @param ?array{ + * level2?: ?Level2Object, + * } $data + */ + public function __construct(?array $data = []) + { + $this->level2 = $data['level2'] ?? null; + } +} + +class Level2Object +{ + public ?string $level3; + + /** + * @param ?array{ + * level3?: ?string, + * } $data + */ + public function __construct(?array $data = []) + { + $this->level3 = $data['level3'] ?? null; + } +} + +class DeepSetTest extends TestCase +{ + public function testSetNestedPropertyWithNull(): void + { + $object = new RootObject(); + + $this->assertNull($object->level1); + + PaginationHelper::setDeep($object, ['level1', 'level2', 'level3'], 'testValue'); + + $this->assertEquals('testValue', $object->level1?->level2?->level3); + } + + public function testSetNestedProperty(): void + { + $object = new RootObject([ + "level1" => new Level1Object([ + "level2" => new Level2Object([ + "level3" => null + ]) + ]) + ]); + + $this->assertNull($object->level1?->level2?->level3); + + PaginationHelper::setDeep($object, ['level1', 'level2', 'level3'], 'testValue'); + + $this->assertEquals('testValue', $object->level1?->level2?->level3); + } + +} diff --git a/tests/Core/Pagination/GeneratorPagerTest/GeneratorPagerTest.php b/tests/Core/Pagination/GeneratorPagerTest/GeneratorPagerTest.php new file mode 100644 index 00000000..a07eee4b --- /dev/null +++ b/tests/Core/Pagination/GeneratorPagerTest/GeneratorPagerTest.php @@ -0,0 +1,130 @@ +page = $page; + } +} + +class Response +{ + public Data $data; + + public function __construct(Data $data) + { + $this->data = $data; + } +} + +class Data +{ + /** + * @var string[] + */ + public array $items; + + /** + * @param string[] $items + */ + public function __construct(array $items) + { + $this->items = $items; + } +} + +class GeneratorPagerTest extends TestCase +{ + public function testPagerItemsIteration(): void + { + $pager = $this->createPager(); + $this->assertPagerItems($pager); + } + + public function testPagerPagesIteration(): void + { + $pager = $this->createPager(); + $this->assertPagerPages($pager); + } + + /** + * @return Pager + */ + private function createPager(): Pager + { + $responses = new ArrayIterator([ + new Response(new Data(['item1', 'item2'])), + new Response(new Data(['item3'])), + new Response(new Data([])), + ]); + + return new class ($responses) extends Pager { + /** + * @var ArrayIterator + */ + private ArrayIterator $responses; + + /** + * @param ArrayIterator $responses + */ + public function __construct(ArrayIterator $responses) + { + $this->responses = $responses; + } + + /** + * @return Generator> + */ + public function getPages(): Generator + { + while ($this->responses->valid()) { + $response = $this->responses->current(); + $this->responses->next(); + yield new Page($response->data->items); + } + } + }; + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPagerItems(Pager $pager): void + { + $items = []; + foreach ($pager as $item) { + $items[] = $item; + } + $this->assertCount(3, $items); + $this->assertEquals(['item1', 'item2', 'item3'], $items); + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPagerPages(Pager $pager): void + { + $pages = []; + foreach ($pager->getPages() as $page) { + $pages[] = $page; + } + $pageCounter = count($pages); + $itemCounter = array_reduce($pages, fn ($carry, $page) => $carry + count($page->getItems()), 0); + + $this->assertEquals(3, $pageCounter); + $this->assertEquals(3, $itemCounter); + } +} diff --git a/tests/Core/Pagination/HasNextPageOffsetPagerTest/HasNextPageOffsetPagerTest.php b/tests/Core/Pagination/HasNextPageOffsetPagerTest/HasNextPageOffsetPagerTest.php new file mode 100644 index 00000000..0355c1e4 --- /dev/null +++ b/tests/Core/Pagination/HasNextPageOffsetPagerTest/HasNextPageOffsetPagerTest.php @@ -0,0 +1,110 @@ +pagination = $pagination; + } +} + +class Pagination +{ + public int $page; + + public function __construct(int $page) + { + $this->page = $page; + } +} + +class Response +{ + public Data $data; + public bool $hasNext; + + public function __construct(Data $data, bool $hasNext) + { + $this->data = $data; + $this->hasNext = $hasNext; + } +} + +class Data +{ + /** + * @var string[] + */ + public array $items; + + /** + * @param string[] $items + */ + public function __construct(array $items) + { + $this->items = $items; + } +} + +class HasNextPageOffsetPagerTest extends TestCase +{ + public function testOffsetPagerWithHasNextPage(): void + { + $pager = $this->createPager(); + $this->assertPager($pager); + } + + /** + * @return OffsetPager + */ + private function createPager(): OffsetPager + { + $responses = new ArrayIterator([ + new Response(new Data(['item1', 'item2']), true), + new Response(new Data(['item3', 'item4']), true), + new Response(new Data(['item5']), false), + ]); + + return new OffsetPager( + new Request(new Pagination(1)), + function (Request $request) use ($responses) { + $response = $responses->current(); + $responses->next(); + return $response; + }, + fn (Request $request) => $request->pagination?->page ?? 0, + function (Request $request, int $offset) { + if ($request->pagination === null) { + $request->pagination = new Pagination(0); + } + $request->pagination->page = $offset; + }, + null, + fn (Response $response) => $response->data->items, + fn (Response $response) => $response->hasNext + ); + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPager(Pager $pager): void + { + $pages = iterator_to_array($pager->getPages()); + $pageCounter = count($pages); + $itemCounter = array_reduce($pages, fn ($carry, $page) => $carry + count($page->getItems()), 0); + + $this->assertEquals(3, $pageCounter); + $this->assertEquals(5, $itemCounter); + } +} diff --git a/tests/Core/Pagination/IntOffsetPagerTest/IntOffsetPagerTest.php b/tests/Core/Pagination/IntOffsetPagerTest/IntOffsetPagerTest.php new file mode 100644 index 00000000..59d3d988 --- /dev/null +++ b/tests/Core/Pagination/IntOffsetPagerTest/IntOffsetPagerTest.php @@ -0,0 +1,108 @@ +pagination = $pagination; + } +} + +class Pagination +{ + public int $page; + + public function __construct(int $page) + { + $this->page = $page; + } +} + +class Response +{ + public Data $data; + + public function __construct(Data $data) + { + $this->data = $data; + } +} + +class Data +{ + /** + * @var string[] + */ + public array $items; + + /** + * @param string[] $items + */ + public function __construct(array $items) + { + $this->items = $items; + } +} + +class IntOffsetPagerTest extends TestCase +{ + public function testOffsetPagerWithPage(): void + { + $pager = $this->createPager(); + $this->assertPager($pager); + } + + /** + * @return OffsetPager + */ + private function createPager(): OffsetPager + { + $responses = new ArrayIterator([ + new Response(new Data(['item1', 'item2'])), + new Response(new Data(['item3'])), + new Response(new Data([])), + ]); + + return new OffsetPager( + new Request(new Pagination(1)), + function (Request $request) use ($responses) { + $response = $responses->current(); + $responses->next(); + return $response; + }, + fn (Request $request) => $request->pagination?->page ?? 0, + function (Request $request, int $offset) { + if ($request->pagination === null) { + $request->pagination = new Pagination(0); + } + $request->pagination->page = $offset; + }, + null, + fn (Response $response) => $response->data->items, + null + ); + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPager(Pager $pager): void + { + $pages = iterator_to_array($pager->getPages()); + $pageCounter = count($pages); + $itemCounter = array_reduce($pages, fn ($carry, $page) => $carry + count($page->getItems()), 0); + + $this->assertEquals(3, $pageCounter); + $this->assertEquals(3, $itemCounter); + } +} diff --git a/tests/Core/Pagination/StepOffsetPagerTest/StepOffsetPagerTest.php b/tests/Core/Pagination/StepOffsetPagerTest/StepOffsetPagerTest.php new file mode 100644 index 00000000..49058e02 --- /dev/null +++ b/tests/Core/Pagination/StepOffsetPagerTest/StepOffsetPagerTest.php @@ -0,0 +1,131 @@ +pagination = $pagination; + } +} + +class Pagination +{ + public int $itemOffset; + public int $pageSize; + + public function __construct(int $itemOffset, int $pageSize) + { + $this->itemOffset = $itemOffset; + $this->pageSize = $pageSize; + } +} + +class Response +{ + public Data $data; + + public function __construct(Data $data) + { + $this->data = $data; + } +} + +class Data +{ + /** + * @var string[] + */ + public array $items; + + /** + * @param string[] $items + */ + public function __construct(array $items) + { + $this->items = $items; + } +} + +class StepOffsetPagerTest extends TestCase +{ + private Pagination $paginationCopy; + + public function testOffsetPagerWithStep(): void + { + $pager = $this->createPager(); + $this->assertPager($pager); + } + + /** + * @return OffsetPager + */ + private function createPager(): OffsetPager + { + $responses = new ArrayIterator([ + new Response(new Data(['item1', 'item2'])), + new Response(new Data(['item3'])), + new Response(new Data([])), + ]); + + $this->paginationCopy = new Pagination(0, 2); + + return new OffsetPager( + new Request($this->paginationCopy), + function (Request $request) use ($responses) { + $response = $responses->current(); + $responses->next(); + return $response; + }, + fn (Request $request) => $request->pagination?->itemOffset ?? 0, + function (Request $request, int $offset) { + if ($request->pagination === null) { + $request->pagination = new Pagination(0, 2); + } + $request->pagination->itemOffset = $offset; + $this->paginationCopy = $request->pagination; + }, + fn (Request $request) => $request->pagination?->pageSize, + fn (Response $response) => $response->data->items, + null + ); + } + + /** + * @param Pager $pager + * @return void + */ + private function assertPager(Pager $pager): void + { + $pages = $pager->getPages(); + + // first page + $page = $pages->current(); + $this->assertCount(2, $page->getItems()); + $this->assertEquals(0, $this->paginationCopy->itemOffset); + + // second page + $pages->next(); + $page = $pages->current(); + $this->assertCount(1, $page->getItems()); + $this->assertEquals(2, $this->paginationCopy->itemOffset); + + // third page + $pages->next(); + $page = $pages->current(); + $this->assertCount(0, $page->getItems()); + $this->assertEquals(3, $this->paginationCopy->itemOffset); + + // no more pages + $pages->next(); + $this->assertNull($pages->current()); + } +} diff --git a/tests/Flows/CatalogTest.php b/tests/Flows/CatalogTest.php deleted file mode 100644 index 35c89eaf..00000000 --- a/tests/Flows/CatalogTest.php +++ /dev/null @@ -1,147 +0,0 @@ -getCatalogApi(); - } - - - // public function testFileUpload() - // { - // $imageData = new CatalogImage(); - // $imageData->setCaption("Image for File Upload Test"); - // $imageData->setName('New Image'); - - // $image = new CatalogObject("IMAGE", "#java_sdk_test"); - // $image->setImageData($imageData); - - // $request = new CreateCatalogImageRequest(uniqid()); - // $request->setImage($image); - - // $imageFile = FileWrapper::createFromPath( - // __DIR__ . './../Resources/square.png', - // 'image/png' - // ); - - // $response = self::$controller->createCatalogImage($request, $imageFile); - - // // Log errors array if reponse->isError() returns true - // fwrite(STDERR, print_r($response, $response->isError())); - - // $this->assertTrue($response->isSuccess()); - // $this->assertNotNull($response->getResult()->getImage()->getImageData()->getUrl()); - - // self::$controller->deleteCatalogObject($response->getResult()->getImage()->getId()); - // } - - public function testUpsertCatalogObject() - { - $body_idempotencyKey = uniqid(); - $body_object_type = CatalogObjectType::ITEM; - $body_object_id = '#Cocoa'; - $body_object = new CatalogObject( - $body_object_type, - $body_object_id - ); - $body_object->setItemData(new CatalogItem); - $body_object->getItemData()->setName('Cocoa'); - $body_object->getItemData()->setDescription('Hot chocolate'); - $body_object->getItemData()->setAbbreviation('Ch'); - - $variation_object_type = CatalogObjectType::ITEM_VARIATION; - $variation_object_id = '#Small'; - $variation_object = new CatalogObject( - $variation_object_type, - $variation_object_id - ); - $variation_object->setItemVariationData(new CatalogItemVariation); - $variation_object->getItemVariationData()->setItemId($body_object_id); - $variation_object->getItemVariationData()->setName('Small'); - $variation_object->getItemVariationData()->setPricingType('VARIABLE_PRICING'); - - $body_object->getItemData()->setVariations([$variation_object]); - $body = new UpsertCatalogObjectRequest( - $body_idempotencyKey, - $body_object - ); - - $result = self::$controller->upsertCatalogObject($body); - - // Assert is succeess and of correct type before retrieving response object - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof UpsertCatalogObjectResponse); - - // Retrieve response object - $resultCatalogObject = $result->getResult()->getCatalogObject(); - - $this->assertEquals($body->getObject()->getType(), $resultCatalogObject->getType()); - $this->assertEquals($body->getObject()->getItemData()->getName(), $resultCatalogObject->getItemData()->getName()); - $this->assertEquals($body->getObject()->getItemData()->getDescription(), $resultCatalogObject->getItemData()->getDescription()); - $this->assertEquals($body->getObject()->getItemData()->getAbbreviation(), $resultCatalogObject->getItemData()->getAbbreviation()); - - return $result->getResult()->getCatalogObject()->getId(); - } - - /** - * @depends testUpsertCatalogObject - */ - public function testRetrieveCatalogObject($catalogObjectId) - { - $result = self::$controller->retrieveCatalogObject($catalogObjectId,false); - - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof RetrieveCatalogObjectResponse); - - return $catalogObjectId; - } - - /** - * @depends testRetrieveCatalogObject - */ - public function deleteCatalogObject($catalogObjectId) - { - $result = self::$controller->deleteCatalogObject($catalogObjectId); - - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof DeleteCatalogObjectResponse); - $this->assertTrue(in_array($catalogObjectId, $result->getResult()->getDeletedObjectIds())); - } -} \ No newline at end of file diff --git a/tests/Flows/CustomerGroupsTest.php b/tests/Flows/CustomerGroupsTest.php deleted file mode 100644 index e5574914..00000000 --- a/tests/Flows/CustomerGroupsTest.php +++ /dev/null @@ -1,129 +0,0 @@ -getCustomerGroupsApi(); - } - - public function testListCustomerGroups() - { - $apiResponse = self::$controller->listCustomerGroups(); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof ListCustomerGroupsResponse); - } - - public function testCreateCustomerGroup() - { - // uniqid ensures that group name is unique - // used in test to avoid errors caused by concurrently running tests - $body_group_name = uniqid('Great Customers'); - $body_group = new CustomerGroup( - $body_group_name - ); - $body = new CreateCustomerGroupRequest( - $body_group - ); - - $apiResponse = self::$controller->createCustomerGroup($body); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof CreateCustomerGroupResponse); - $this->assertTrue($apiResponse->getResult()->getGroup() instanceof CustomerGroup); - - return $apiResponse->getResult()->getGroup()->getId(); - } - - /** - * @depends testCreateCustomerGroup - */ - public function testRetrieveCustomerGroup($groupId) - { - $apiResponse = self::$controller->retrieveCustomerGroup($groupId);; - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof RetrieveCustomerGroupResponse); - $this->assertTrue($apiResponse->getResult()->getGroup() instanceof CustomerGroup); - $this->assertEquals($apiResponse->getResult()->getGroup()->getId(), $groupId); - - return $groupId; - } - - /** - * @depends testRetrieveCustomerGroup - */ - public function testUpdateCustomerGroup($groupId) - { - $body_group_name = uniqid('The Best Customers' ); - $body_group = new CustomerGroup( - $body_group_name - ); - $body = new UpdateCustomerGroupRequest( - $body_group - ); - - $apiResponse = self::$controller->updateCustomerGroup($groupId, $body); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof UpdateCustomerGroupResponse); - $this->assertTrue($apiResponse->getResult()->getGroup() instanceof CustomerGroup); - $this->assertEquals($apiResponse->getResult()->getGroup()->getId(), $groupId); - - return $groupId; - } - - /** - * @depends testUpdateCustomerGroup - */ - public function testDeleteCustomerGroup($groupId) - { - $apiResponse = self::$controller->deleteCustomerGroup($groupId); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof DeleteCustomerGroupResponse); - } -} diff --git a/tests/Flows/CustomersTest.php b/tests/Flows/CustomersTest.php deleted file mode 100644 index 31290c5c..00000000 --- a/tests/Flows/CustomersTest.php +++ /dev/null @@ -1,299 +0,0 @@ -getCustomersApi(); - self::$customAttributesController = ClientFactory::create(self::$httpResponse)->getCustomerCustomAttributesApi(); - } - - public function testCreateCustomer(): ?Customer - { - $phone_number = "1-212-555-4240"; - - $postal_code = "10003"; - - // Create customer - $request = new CreateCustomerRequest; - $request->setGivenName('Amelia'); - $request->setFamilyName('Earhart'); - $request->setPhoneNumber($phone_number); - $request->setNote('a customer'); - - $address = new Address; - $address->setAddressLine1("500 Electric Ave"); - $address->setAddressLine2("Suite 600"); - $address->setLocality("New York"); - $address->setAdministrativeDistrictLevel1("NY"); - $address->setPostalCode($postal_code); - $address->setCountry("US"); - - $request->setAddress($address); - - $response = self::$controller->createCustomer($request); - $result = $response->getResult(); - assert($result instanceof CreateCustomerResponse); - $data = $result->getCustomer(); - - $this->assertEquals($data->getPhoneNumber(), $phone_number); - $this->assertEquals($data->getAddress()->getPostalCode(), $postal_code); - $this->assertEquals($response->getStatusCode(), 200); - $this->assertTrue($response->isSuccess()); - $this->assertFalse($response->isError()); - - return $data; - } - - /** - * @depends testCreateCustomer - */ - public function testGetCustomer(Customer $prevData): ?Customer - { - // Retrieve customer - $customer_id = $prevData->getId(); - $response = self::$controller->retrieveCustomer($customer_id); - $result = $response->getResult(); - assert($result instanceof RetrieveCustomerResponse); - $data = $result->getCustomer(); - - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $this->assertEquals($data->getPhoneNumber(), $prevData->getPhoneNumber()); - $this->assertEquals($data->getAddress()->getPostalCode(), $prevData->getAddress()->getPostalCode()); - - return $data; - } - - /** - * @depends testGetCustomer - */ - public function testUpdateCustomer(Customer $prevData): ?Customer - { - $phone_number2 = "1-917-500-1000"; - $postal_code2 = "98100"; - $customer_id = $prevData->getId(); - - // Update customer - $updateRequest = new UpdateCustomerRequest; - $updateRequest->setGivenName($prevData->getGivenName()); - $updateRequest->setFamilyName($prevData->getFamilyName()); - $updateRequest->setCompanyName($prevData->getCompanyName()); - $updateRequest->setNickname($prevData->getNickname()); - $updateRequest->setEmailAddress($prevData->getEmailAddress()); - $updateRequest->setAddress($prevData->getAddress()); - $updateRequest->setPhoneNumber($prevData->getPhoneNumber()); - $updateRequest->setReferenceId($prevData->getReferenceId()); - $updateRequest->setNote($prevData->getNote()); - $updateRequest->setBirthday($prevData->getBirthday()); - $updateRequest->setPhoneNumber($phone_number2); - $updateRequest->getAddress()->setPostalCode($postal_code2); - - $response = self::$controller->updateCustomer($customer_id, $updateRequest); - $result = $response->getResult(); - assert($result instanceof UpdateCustomerResponse); - $data = $result->getCustomer(); - - $this->assertTrue($response->isSuccess()); - $this->assertEquals($data->getPhoneNumber(), $phone_number2); - $this->assertEquals($data->getAddress()->getPostalCode(), $postal_code2); - $this->assertEquals($response->getStatusCode(), 200); - - return $data; - } - - // Delete the `favorite-drink` definition if it exists - public function testCleanupCustomerCustomAttributeDefinition() - { - $response = self::$customAttributesController->deleteCustomerCustomAttributeDefinition(self::$key); - $result = $response->getResult(); - assert($result instanceof DeleteCustomerCustomAttributeDefinitionResponse); - - $this->assertEmpty($response->getErrors()); - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $this->assertNull($result->getErrors()); - } - - /** - * @depends testCleanupCustomerCustomAttributeDefinition - */ - public function testCreateCustomerCustomAttributeDefinition(): ?CustomAttributeDefinition - { - $definition = new CustomAttributeDefinition; - $definition->setKey(self::$key); - $definition->setName('Favorite Drink' . phpversion()); - $definition->setDescription('The customer\'s favorite drink'); - $definition->setVisibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES); - $definition->setSchema('{"$ref":"https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"}'); - $createRequest = new CreateCustomerCustomAttributeDefinitionRequest($definition); - - $response = self::$customAttributesController->createCustomerCustomAttributeDefinition($createRequest); - $responseResult = $response->getResult(); - assert($responseResult instanceof CreateCustomerCustomAttributeDefinitionResponse); - $data = $responseResult->getCustomAttributeDefinition(); - - $this->assertEmpty($response->getErrors()); - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $this->assertNull($responseResult->getErrors()); - $this->assertEquals($data->getKey(), self::$key); - $this->assertEquals($data->getName(), 'Favorite Drink' . phpversion()); - $this->assertEquals($data->getDescription(), 'The customer\'s favorite drink'); - $this->assertEquals($data->getVisibility(), 'VISIBILITY_READ_WRITE_VALUES'); - $this->assertEquals($data->getVersion(), 1); - $expectedSchema = json_decode('{ "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }'); - $this->assertEquals($data->getSchema(), $expectedSchema); - - return $data; - } - - /** - * @depends testCreateCustomerCustomAttributeDefinition - */ - public function testUpdateCustomerCustomAttributeDefinition(CustomAttributeDefinition $created): ?CustomAttributeDefinition - { - $created->setName('Preferred Drink' . phpversion()); - $updateRequest = new UpdateCustomerCustomAttributeDefinitionRequest($created); - - $response = self::$customAttributesController->updateCustomerCustomAttributeDefinition($created->getKey(), $updateRequest); - $responseResult = $response->getResult(); - assert($responseResult instanceof UpdateCustomerCustomAttributeDefinitionResponse); - $data = $responseResult->getCustomAttributeDefinition(); - - $this->assertEmpty($response->getErrors()); - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $this->assertNull($responseResult->getErrors()); - $this->assertEquals($data->getKey(), self::$key); - $this->assertEquals($data->getName(), 'Preferred Drink' . phpversion()); - $this->assertEquals($data->getDescription(), 'The customer\'s favorite drink'); - $this->assertEquals($data->getVisibility(), 'VISIBILITY_READ_WRITE_VALUES'); - $this->assertEquals($data->getVersion(), 2); - $expectedSchema = json_decode('{ "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }'); - $this->assertEquals($data->getSchema(), $expectedSchema); - - return $data; - } - - /** - * @depends testUpdateCustomer - * @depends testUpdateCustomerCustomAttributeDefinition - */ - public function testCreateCustomerCustomAttribute(Customer $customerData, CustomAttributeDefinition $definitionData): ?CustomAttribute - { - $customAttribute = new CustomAttribute; - $customAttribute->setValue('Double-shot breve'); - $upsertRequest = new UpsertCustomerCustomAttributeRequest($customAttribute); - - $customerId = $customerData->getId(); - $key = $definitionData->getKey(); - $response = self::$customAttributesController->upsertCustomerCustomAttribute($customerId, $key, $upsertRequest); - - $this->assertEmpty($response->getErrors()); - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $responseResult = $response->getResult(); - assert($responseResult instanceof UpsertCustomerCustomAttributeResponse); - $this->assertNull($responseResult->getErrors()); - $result = $responseResult->getCustomAttribute(); - $this->assertEquals($result->getKey(), self::$key); - $this->assertEquals($result->getValue(), 'Double-shot breve'); - $this->assertEquals($result->getVersion(), 1); - $this->assertEquals($result->getVisibility(), 'VISIBILITY_READ_WRITE_VALUES'); - - return $result; - } - - /** - * @depends testUpdateCustomer - * @depends testCreateCustomerCustomAttributeDefinition - * @depends testCreateCustomerCustomAttribute - */ - public function testUpdateCustomerCustomAttribute(Customer $customerData, CustomAttributeDefinition $definitionData, CustomAttribute $created) - { - $customAttribute = new CustomAttribute; - $customAttribute->setVersion($created->getVersion()); - $customAttribute->setValue('Black coffee'); - $upsertRequest = new UpsertCustomerCustomAttributeRequest($customAttribute); - - $customerId = $customerData->getId(); - $key = $definitionData->getKey(); - $response = self::$customAttributesController->upsertCustomerCustomAttribute($customerId, $key, $upsertRequest); - - $this->assertEmpty($response->getErrors()); - $this->assertTrue($response->isSuccess()); - $this->assertEquals($response->getStatusCode(), 200); - $responseResult = $response->getResult(); - assert($responseResult instanceof UpsertCustomerCustomAttributeResponse); - $this->assertNull($responseResult->getErrors()); - $result = $responseResult->getCustomAttribute(); - $this->assertEquals($result->getKey(), self::$key); - $this->assertEquals($result->getValue(), 'Black coffee'); - $this->assertEquals($result->getVersion(), 2); - $this->assertEquals($result->getVisibility(), 'VISIBILITY_READ_WRITE_VALUES'); - - return $customerId; - } - - /** - * @depends testUpdateCustomerCustomAttribute - */ - public function testDelete($customer_id) - { - // Delete customer - $response = self::$controller->deleteCustomer($customer_id); - $this->assertEquals($response->getStatusCode(), 200); - } -} diff --git a/tests/Flows/DisputesTest.php b/tests/Flows/DisputesTest.php deleted file mode 100644 index 88cec6cc..00000000 --- a/tests/Flows/DisputesTest.php +++ /dev/null @@ -1,45 +0,0 @@ -getDisputesApi(); - } - - public function testListDisputes() - { - $apiResponse = self::$controller->listDisputes(); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof ListDisputesResponse); - } -} \ No newline at end of file diff --git a/tests/Flows/ErrorsTest.php b/tests/Flows/ErrorsTest.php deleted file mode 100644 index 7ee1cbd0..00000000 --- a/tests/Flows/ErrorsTest.php +++ /dev/null @@ -1,28 +0,0 @@ - \Square\Environment::SANDBOX, - 'accessToken' => 'BAD_TOKEN' - ]); - - $response = $client->getLocationsApi()->listLocations(); - - $this->assertEquals(401, $response->getStatusCode()); - $this->assertEquals(1, count($response->getErrors())); - $this->assertEquals("AUTHENTICATION_ERROR", $response->getErrors()[0]->getCategory()); - $this->assertEquals("UNAUTHORIZED", $response->getErrors()[0]->getCode()); - } -} diff --git a/tests/Flows/JsonSerializeTest.php b/tests/Flows/JsonSerializeTest.php deleted file mode 100644 index 66ed04b0..00000000 --- a/tests/Flows/JsonSerializeTest.php +++ /dev/null @@ -1,25 +0,0 @@ -setAddressLine1("500 Electric Ave"); - $address->setAddressLine2("Suite 600"); - $address->setLocality("New York"); - $address->setAdministrativeDistrictLevel1("NY"); - $address->setPostalCode("10003"); - $address->setCountry("US"); - - $this->assertEquals( - '{"address_line_1":"500 Electric Ave","address_line_2":"Suite 600","locality":"New York","administrative_district_level_1":"NY","postal_code":"10003","country":"US"}', - \json_encode($address) - ); - } -} \ No newline at end of file diff --git a/tests/Flows/MerchantsTest.php b/tests/Flows/MerchantsTest.php deleted file mode 100644 index 091665c7..00000000 --- a/tests/Flows/MerchantsTest.php +++ /dev/null @@ -1,69 +0,0 @@ -getMerchantsApi(); - } - - public function testListMerchants() - { - $apiResponse = self::$controller->listMerchants(); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof ListMerchantsResponse); - $this->assertIsArray($apiResponse->getResult()->getMerchant()); - - return $apiResponse->getResult()->getMerchant()[0]->getId(); - } - - - /** - * @depends testListMerchants - */ - public function testRetrieveMerchant($merchantId) - { - - $apiResponse = self::$controller->retrieveMerchant($merchantId); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof RetrieveMerchantResponse); - $this->assertTrue($apiResponse->getResult()->getMerchant() instanceof Merchant); - $this->assertEquals($apiResponse->getResult()->getMerchant()->getId(), $merchantId); - } - -} \ No newline at end of file diff --git a/tests/Flows/MobileAuthorizationTest.php b/tests/Flows/MobileAuthorizationTest.php deleted file mode 100644 index 15a27b97..00000000 --- a/tests/Flows/MobileAuthorizationTest.php +++ /dev/null @@ -1,63 +0,0 @@ -getMobileAuthorizationApi(); - self::$Locations = $client->getLocationsApi(); - } - - public function testCreateMobileAuthorizationCode() - { - $locationsResult = self::$Locations->listLocations(); - - $this->assertTrue($locationsResult->isSuccess()); - - $locationId = $locationsResult->getResult()->getLocations()[0]->getId(); - $body = new CreateMobileAuthorizationCodeRequest(); - $body->setLocationId($locationId); - $apiResponse = self::$controller->createMobileAuthorizationCode($body); - - $this->assertEquals($apiResponse->getStatusCode(), 200); - $this->assertTrue($apiResponse->isSuccess()); - $this->assertFalse($apiResponse->isError()); - $this->assertTrue($apiResponse->getResult() instanceof CreateMobileAuthorizationCodeResponse); - } - -} \ No newline at end of file diff --git a/tests/Flows/OrdersTest.php b/tests/Flows/OrdersTest.php deleted file mode 100644 index 86a916c8..00000000 --- a/tests/Flows/OrdersTest.php +++ /dev/null @@ -1,191 +0,0 @@ -getOrdersApi(); - self::$Locations = $client->getLocationsApi(); - } - - - public function testSearchOrders() - { - - $locationsResult = self::$Locations->listLocations(); - - $this->assertTrue($locationsResult->isSuccess()); - - $locationId = $locationsResult->getResult()->getLocations()[0]->getId(); - - - $body = new SearchOrdersRequest; - $body->setLocationIds([$locationId]); - $body->setQuery(new SearchOrdersQuery); - $body->getQuery()->setFilter(new SearchOrdersFilter); - $body_query_filter_stateFilter_states = [OrderState::COMPLETED]; - $body->getQuery()->getFilter()->setStateFilter(new SearchOrdersStateFilter( - $body_query_filter_stateFilter_states - )); - - $body->setLimit(3); - $body->setReturnEntries(true); - - $apiResponse = self::$controller->searchOrders($body); - - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof SearchOrdersResponse); - } - - public function testCreateOrder() - { - - $locationsResult = self::$Locations->listLocations(); - - $this->assertTrue($locationsResult->isSuccess()); - - $locationId = $locationsResult->getResult()->getLocations()[0]->getId(); - - $body_idempotencyKey = uniqid(); - $order = new Order($locationId); - - $body = new CreateOrderRequest; - $body->setIdempotencyKey($body_idempotencyKey); - $body->setOrder($order); - - $apiResponse = self::$controller->createOrder($body); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof CreateOrderResponse); - $this->assertTrue($apiResponse->getResult()->getOrder() instanceof Order); - $this->assertEquals($apiResponse->getResult()->getOrder()->getLocationId(), $locationId); - - $orderId = $apiResponse->getResult()->getOrder()->getId(); - $version = $apiResponse->getResult()->getOrder()->getVersion(); - return array($orderId,$locationId,$version); - } - - - /** - * @depends testCreateOrder - */ - public function testUpdateOrder(array $orderLocationVersion) - { - $orderId = $orderLocationVersion[0]; - $locationId = $orderLocationVersion[1]; - $version = $orderLocationVersion[2]; - - $order = new Order($locationId); - $order->setVersion($version); - - $body = new UpdateOrderRequest(); - $body->setOrder($order); - - $apiResponse = self::$controller->updateOrder($orderId, $body); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof UpdateOrderResponse); - $this->assertTrue($apiResponse->getResult()->getOrder() instanceof Order); - $this->assertEquals($apiResponse->getResult()->getOrder()->getLocationId(), $locationId); - $this->assertEquals($apiResponse->getResult()->getOrder()->getVersion(), $version + 1); - - return array($orderId,$locationId); - } - - /** - * @depends testUpdateOrder - */ - public function testBatchRetrieveOrders(array $orderIdLocationId) - { - $orderId = $orderIdLocationId[0]; - $locationId = $orderIdLocationId[1]; - - $body_orderIds = [$orderId]; - $body = new BatchRetrieveOrdersRequest( - $body_orderIds - ); - - $apiResponse = self::$controller->batchRetrieveOrders($body); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof BatchRetrieveOrdersResponse ); - $this->assertEquals($apiResponse->getResult()->getOrders()[0]->getLocationId(), $locationId); - - return $orderId; - } - - /** - * @depends testBatchRetrieveOrders - */ - public function testPayOrder($orderId) - { - $body_idempotencyKey = uniqid(); - $body = new PayOrderRequest( - $body_idempotencyKey - ); - - // Empty since dollar value is zero - $body->setPaymentIds([]); - - $apiResponse = self::$controller->payOrder($orderId, $body); - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof PayOrderResponse ); - $this->assertTrue($apiResponse->getResult()->getOrder() instanceof Order ); - $this->assertEquals($apiResponse->getResult()->getOrder()->getState(), OrderState::COMPLETED); - $this->assertTrue($apiResponse->getResult()->getOrder()->getTotalMoney() instanceof Money); - $this->assertEquals($apiResponse->getResult()->getOrder()->getTotalMoney()->getAmount(), 0); - - } - -} diff --git a/tests/Flows/PaymentsTest.php b/tests/Flows/PaymentsTest.php deleted file mode 100644 index 7dafa61f..00000000 --- a/tests/Flows/PaymentsTest.php +++ /dev/null @@ -1,201 +0,0 @@ -getPaymentsApi(); - } - - - public function testListPayments() - { - // Set callback and perform API call - $result = null; - try { - $result = self::$controller->listPayments()->getResult(); - } catch (ApiException $e) { - } - - // Test response code - $this->assertEquals( - 200, - self::$httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - $this->assertTrue($result instanceof ListPaymentsResponse); - } - - public function testCreatePayment() - { - $body_sourceId = 'cnon:card-nonce-ok'; - $body_idempotencyKey = uniqid(); - $body_amountMoney = new Money; - $body_amountMoney->setAmount(200); - $body_amountMoney->setCurrency(Currency::USD); - $body = new CreatePaymentRequest( - $body_sourceId, - $body_idempotencyKey, - ); - - $body->setAmountMoney($body_amountMoney); - $body->setAppFeeMoney(new Money); - $body->getAppFeeMoney()->setAmount(10); - $body->getAppFeeMoney()->setCurrency(Currency::USD); - $body->setAutocomplete(true); - - $result = self::$controller->createPayment($body); - if (!$result->isSuccess()) { - $errors = serialize($result->getErrors()); - echo "\n Error(s): {$errors}"; - } - - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof CreatePaymentResponse); - $this->assertEquals($body->getAppFeeMoney()->getCurrency(), $result->getResult()->getPayment()->getAppFeeMoney()->getCurrency()); - $this->assertEquals($body->getAppFeeMoney()->getAmount(), $result->getResult()->getPayment()->getAppFeeMoney()->getAmount()); - $this->assertEquals($body->getAmountMoney()->getAmount(), $result->getResult()->getPayment()->getAmountMoney()->getAmount()); - $this->assertEquals($body->getAmountMoney()->getCurrency(), $result->getResult()->getPayment()->getAmountMoney()->getCurrency()); - - return $result->getResult()->getPayment()->getId(); - } - - /** - * @depends testCreatePayment - */ - public function testGetPayment($paymentId) - { - $result = self::$controller->getPayment($paymentId); - - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof GetPaymentResponse); - $this->assertTrue($result->getResult()->getPayment() instanceof Payment); - $this->assertEquals($result->getResult()->getPayment()->getId(), $paymentId); - - return $paymentId; - } - - public function testCreatePaymentDelayed() - { - $body_sourceId = 'cnon:card-nonce-ok'; - $body_idempotencyKey = uniqid(); - $body_amountMoney = new Money; - $body_amountMoney->setAmount(200); - $body_amountMoney->setCurrency(Currency::USD); - $body = new CreatePaymentRequest( - $body_sourceId, - $body_idempotencyKey, - ); - - $body->setAmountMoney($body_amountMoney); - $body->setAppFeeMoney(new Money); - $body->getAppFeeMoney()->setAmount(10); - $body->getAppFeeMoney()->setCurrency(Currency::USD); - $body->setAutocomplete(false); - - $result = self::$controller->createPayment($body); - if (!$result->isSuccess()) { - $errors = serialize($result->getErrors()); - echo "\n Error(s): {$errors}"; - } - - $this->assertTrue($result->isSuccess()); - $this->assertEquals($body->getAppFeeMoney()->getCurrency(), $result->getResult()->getPayment()->getAppFeeMoney()->getCurrency()); - $this->assertEquals($body->getAppFeeMoney()->getAmount(), $result->getResult()->getPayment()->getAppFeeMoney()->getAmount()); - $this->assertEquals($body->getAmountMoney()->getAmount(), $result->getResult()->getPayment()->getAmountMoney()->getAmount()); - $this->assertEquals($body->getAmountMoney()->getCurrency(), $result->getResult()->getPayment()->getAmountMoney()->getCurrency()); - - return $result->getResult()->getPayment()->getId(); - } - - // PHP defaults to serializing to `[]` and not `{}` for empty JSON. This breaks - // our expected default JSON body. Will re-enable the test once this difference is resolved. - // /** - // * @depends testCreatePaymentDelayed - // */ - // public function testCompletePayment($paymentId) - // { - // $body = new CompletePaymentRequest(); - // $result = self::$controller->completePayment($paymentId, $body); - - // $this->assertTrue($result->isSuccess()); - // $this->assertTrue($result->getResult() instanceof CompletePaymentResponse); - // } - - public function testCancelPaymentByIdempotency() - { - $body_sourceId = 'cnon:card-nonce-ok'; - $body_idempotencyKey = uniqid(); - $body_amountMoney = new Money; - $body_amountMoney->setAmount(200); - $body_amountMoney->setCurrency(Currency::USD); - $body = new CreatePaymentRequest( - $body_sourceId, - $body_idempotencyKey, - ); - - $body->setAmountMoney($body_amountMoney); - $body->setAppFeeMoney(new Money); - $body->getAppFeeMoney()->setAmount(10); - $body->getAppFeeMoney()->setCurrency(Currency::USD); - $body->setAutocomplete(false); - - $createPaymentResult = self::$controller->createPayment($body); - if (!$createPaymentResult->isSuccess()) { - $errors = serialize($createPaymentResult->getErrors()); - echo "\n Error(s): {$errors}"; - } - - $this->assertTrue($createPaymentResult->isSuccess()); - - - $cancelBody = new CancelPaymentByIdempotencyKeyRequest( - $body_idempotencyKey - ); - - $apiResponse = self::$controller->cancelPaymentByIdempotencyKey($cancelBody); - if (!$apiResponse->isSuccess()) { - $errors = serialize($apiResponse->getErrors()); - echo "\n Error(s): {$errors}"; - } - - - $this->assertTrue($apiResponse->isSuccess()); - } -} diff --git a/tests/Flows/RefundsTest.php b/tests/Flows/RefundsTest.php deleted file mode 100644 index 0f4a2f07..00000000 --- a/tests/Flows/RefundsTest.php +++ /dev/null @@ -1,143 +0,0 @@ -getRefundsApi(); - self::$paymentsController = $client->getPaymentsApi(); - } - - - public function testListRefunds() - { - // Set callback and perform API call - $result = null; - try { - $result = self::$controller->listPaymentRefunds()->getResult(); - } catch (ApiException $e) { - } - - // Test response code - $this->assertEquals( - 200, - self::$httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - $this->assertTrue($result instanceof ListPaymentRefundsResponse); - } - - public function testRefundPayment() - { - // Creat Payment to be refunded - $amount = 200; - $currency = Currency::USD; - $body_sourceId = 'cnon:card-nonce-ok'; - $body_idempotencyKey = uniqid(); - $body_amountMoney = new Money; - $body_amountMoney->setAmount($amount); - $body_amountMoney->setCurrency($currency); - $body = new CreatePaymentRequest( - $body_sourceId, - $body_idempotencyKey, - ); - - $body->setAmountMoney($body_amountMoney); - $body->setAppFeeMoney(new Money); - $body->getAppFeeMoney()->setAmount(10); - $body->getAppFeeMoney()->setCurrency(Currency::USD); - $body->setAutocomplete(true); - - $result = self::$paymentsController->createPayment($body); - if (!$result->isSuccess()) { - $errors = serialize($result->getErrors()); - echo "\n Error(s): {$errors}"; - } - - $this->assertTrue($result->isSuccess()); - - // Square may need a moment to capture payment before we can issue a Refund - sleep(1); - - // Create Refund - $payment_id = $result->getResult()->getPayment()->getId(); - $refundBody_idempotencyKey = uniqid(); - $refundBody_amountMoney = new Money; - $refundBody_amountMoney->setAmount($amount); - $refundBody_amountMoney->setCurrency($currency); - $refundBody_paymentId = $payment_id; - $refundBody = new RefundPaymentRequest( - $refundBody_idempotencyKey, - $refundBody_amountMoney - ); - $refundBody->setPaymentId($refundBody_paymentId); - - $apiResponse = self::$controller->refundPayment($refundBody); - if (!$apiResponse->isSuccess()) { - $errors = serialize($apiResponse->getErrors()); - echo "\n Error(s): {$errors}"; - } - - $this->assertTrue($apiResponse->isSuccess()); - $this->assertTrue($apiResponse->getResult() instanceof RefundPaymentResponse); - $this->assertEquals($apiResponse->getResult()->getRefund()->getAmountMoney()->getAmount(), $amount); - $this->assertEquals($apiResponse->getResult()->getRefund()->getAmountMoney()->getCurrency(), $currency); - $this->assertEquals($apiResponse->getResult()->getRefund()->getPaymentId(), $payment_id); - - return $apiResponse->getResult()->getRefund()->getId(); - } - - /** - * @depends testRefundPayment - */ - public function testGetPaymentRefund($paymentId) - { - $result = self::$controller->getPaymentRefund($paymentId); - - $this->assertTrue($result->isSuccess()); - $this->assertTrue($result->getResult() instanceof GetPaymentRefundResponse); - } -} diff --git a/tests/Flows/WebhooksHelperTest.php b/tests/Flows/WebhooksHelperTest.php deleted file mode 100644 index dd7e6e54..00000000 --- a/tests/Flows/WebhooksHelperTest.php +++ /dev/null @@ -1,152 +0,0 @@ -requestBody, - $this->signatureHeader, - $this->signatureKey, - $this->notificationUrl - ); - $this->assertTrue($isValid); - } - - public function testEscapedCharactersPass(): void - { - $specialRequestBody = '{"data":{"type":"webhooks","id":">id<"}}'; - $escapedSignatureHeader = 'Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U='; - $defaultSignatureKey = 'signature-key'; - $defaultNotificationUrl = 'https://webhook.site/webhooks'; - - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $specialRequestBody, - $escapedSignatureHeader, - $defaultSignatureKey, - $defaultNotificationUrl - ); - $this->assertTrue($isValid); - } - - public function testSignatureValidationFailsOnNotificationUrlMismatch(): void - { - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - $this->signatureKey, - 'https://webhook.site/79a4f3a-dcfa-49ee-bac5-9d0edad886b9' - ); - $this->assertFalse($isValid); - } - - public function testSignatureValidationFailsOnInvalidSignatureKey(): void - { - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - 'MCmhFRxGX82xMwg5FsaoQA', - $this->notificationUrl - ); - $this->assertFalse($isValid); - } - - public function testSignatureValidationFailsOnInvalidSignatureHeader(): void - { - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - '1z2n3DEJJiUPKcPzQo1ftvbxGdw=', - $this->signatureKey, - $this->notificationUrl - ); - $this->assertFalse($isValid); - } - - public function testSignatureValidationFailsOnRequestBodyMismatch(): void - { - $requestBody = '{"merchant_id":"MLEFBHHSJGVHD","type":"webhooks.test_notification","event_id":"ac3ac95b-f97d-458c-a6e6-18981597e05f","created_at":"2022-06-13T20:30:59.037339943Z","data":{"type":"webhooks","id":"bc368e64-01aa-407e-b46e-3231809b1129"}}'; - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $requestBody, - $this->signatureHeader, - $this->signatureKey, - $this->notificationUrl - ); - $this->assertFalse($isValid); - } - - public function testSignatureValidationFailsOnRequestBodyFormatted(): void - { - $requestBody = '{ - "merchant_id": "MLEFBHHSJGVHD", - "type": "webhooks.test_notification", - "event_id": "ac3ac95b-f97d-458c-a6e6-18981597e05f", - "created_at": "2022-07-13T20:30:59.037339943Z", - "data": { - "type": "webhooks", - "id": "bc368e64-01aa-407e-b46e-3231809b1129" - } - }'; - $isValid = WebhooksHelper::isValidWebhookEventSignature( - $requestBody, - $this->signatureHeader, - $this->signatureKey, - $this->notificationUrl - ); - $this->assertFalse($isValid); - } - - public function testThrowsErrorOnEmptySignatureKey(): void - { - $this->expectExceptionMessage('signatureKey is null or empty'); - WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - '', - $this->notificationUrl - ); - } - - public function testThrowsErrorOnSignatureKeyNotConfigured(): void - { - $this->expectException(\TypeError::class); - - WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - null, - $this->notificationUrl - ); - } - - public function testThrowsErrorOnEmptyNotificationUrl(): void - { - $this->expectExceptionMessage('notificationUrl is null or empty'); - WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - $this->signatureKey, - '' - ); - } - - public function testThrowsErrorOnNotificationUrlNotConfigured(): void - { - $this->expectException(\TypeError::class); - - WebhooksHelper::isValidWebhookEventSignature( - $this->requestBody, - $this->signatureHeader, - $this->signatureKey, - null - ); - } -} diff --git a/tests/Models/CustomAttributeDefinitionTest.php b/tests/Models/CustomAttributeDefinitionTest.php deleted file mode 100644 index d956eb45..00000000 --- a/tests/Models/CustomAttributeDefinitionTest.php +++ /dev/null @@ -1,68 +0,0 @@ - 'https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String' - ); - $model = new CustomAttributeDefinition(); - $model->setKey('test-string-attribute'); - $model->setSchema($schema); - $model->setName('Test String Attribute'); - $model->setDescription('This is a test'); - $model->setVisibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-string-attribute', - 'schema' => $schema, - 'name' => 'Test String Attribute', - 'description' => 'This is a test', - 'visibility' => 'VISIBILITY_READ_WRITE_VALUES', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeSelectionDefinition(){ - $schema = array( - '$schema' => 'https://developer-production-s.squarecdn.com/meta-schemas/v1/selection.json', - 'items' => [ - 'enum' => [ - 'b17bb293-c44a-4622-b995-cd18ea44775e', - '2d7f100b-03c4-463d-a2a1-a7679eddf9d6', - 'bda8cd16-50b2-48b6-974a-c6272a47cf77' - ], - 'names' => [ - 'Red', - 'Blue', - 'Yellow' - ] - ], - 'maxItems' => 2, - 'uniqueItems' => true, - 'type' => 'array', - ); - $model = new CustomAttributeDefinition(); - $model->setKey('test-selection-attribute'); - $model->setSchema($schema); - $model->setName('Test Selection Attribute'); - $model->setDescription('This is a test'); - $model->setVisibility(CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-selection-attribute', - 'schema' => $schema, - 'name' => 'Test Selection Attribute', - 'description' => 'This is a test', - 'visibility' => 'VISIBILITY_READ_WRITE_VALUES', - ]; - $this->assertEquals($result, $expected); - } -} \ No newline at end of file diff --git a/tests/Models/CustomAttributeTest.php b/tests/Models/CustomAttributeTest.php deleted file mode 100644 index 2c0e97d4..00000000 --- a/tests/Models/CustomAttributeTest.php +++ /dev/null @@ -1,144 +0,0 @@ -setKey('test-string-attribute'); - $model->setValue('hello world'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-string-attribute', - 'value' => 'hello world', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeNumber(){ - $model = new CustomAttribute(); - $model->setKey('test-number-attribute'); - $model->setValue('-12.345'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-number-attribute', - 'value' => '-12.345', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeBool(){ - $model = new CustomAttribute(); - $model->setKey('test-boolean-attribute'); - $model->setValue(true); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-boolean-attribute', - 'value' => true, - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializePhone(){ - $model = new CustomAttribute(); - $model->setKey('test-phone-attribute'); - $model->setValue('+16175551212'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-phone-attribute', - 'value' => '+16175551212', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeEmail(){ - $model = new CustomAttribute(); - $model->setKey('test-email-attribute'); - $model->setValue('example@squareup.com'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-email-attribute', - 'value' => 'example@squareup.com', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeDate(){ - $model = new CustomAttribute(); - $model->setKey('test-date-attribute'); - $model->setValue('2020-02-08'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-date-attribute', - 'value' => '2020-02-08', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeDateTime(){ - $model = new CustomAttribute(); - $model->setKey('test-datetime-attribute'); - $model->setValue('2020-02-08T09:30:26.123'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-datetime-attribute', - 'value' => '2020-02-08T09:30:26.123', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeDuration(){ - $model = new CustomAttribute(); - $model->setKey('test-duration-attribute'); - $model->setValue('P3Y6M4DT12H30M5S'); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-duration-attribute', - 'value' => 'P3Y6M4DT12H30M5S', - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeAddress(){ - $model = new CustomAttribute(); - $model->setKey('test-address-attribute'); - $model->setValue([ - 'first_name' => 'Elmo', - 'address_line_1' => '123 Sesame St.', - 'locality' => 'San Francisco', - 'administrative_district_level_1' => 'CA', - 'postal_code' => '12345', - 'country' => 'US', - ]); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-address-attribute', - 'value' => [ - 'first_name' => 'Elmo', - 'address_line_1' => '123 Sesame St.', - 'locality' => 'San Francisco', - 'administrative_district_level_1' => 'CA', - 'postal_code' => '12345', - 'country' => 'US', - ], - ]; - $this->assertEquals($result, $expected); - } - - public function testJsonSerializeSelection(){ - $model = new CustomAttribute(); - $model->setKey('test-selection-attribute'); - $model->setValue(['a740bb60-1002-4a4f-8280-914eb351f53d', '5ce4be85-16e6-4038-92a8-b7e7aef1c752']); - $result = $model->jsonSerialize(); - $expected = [ - 'key' => 'test-selection-attribute', - 'value' => ['a740bb60-1002-4a4f-8280-914eb351f53d', '5ce4be85-16e6-4038-92a8-b7e7aef1c752'], - ]; - $this->assertEquals($result, $expected); - } -} \ No newline at end of file diff --git a/tests/Resources/square.png b/tests/Resources/square.png deleted file mode 100644 index ba026405..00000000 Binary files a/tests/Resources/square.png and /dev/null differ diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 446ad90f..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ -